Commit 5a94c44f by 金民

Merge remote-tracking branch 'origin/weiqiao-vue3' into weiqiao-vue3

parents 72f71591 aa32be0a
# 是否开启mock数据,关闭时需要自行对接后台接口
VITE_USE_MOCK=false
VITE_USE_MOCK = false
# 资源公共路径,需要以 /开头和结尾
VITE_PUBLIC_PATH=/
VITE_PUBLIC_PATH = /
# 本地开发代理(解决跨域)
# 所有匹配前缀的请求将被代理到目标服务器
VITE_PROXY=[["/system","http://localhost:8080"],["/language","http://localhost:8080"],["/api","http://localhost:8080"]]
# 本地开发代理,可以解决跨域及多地址代理
# 如果接口地址匹配到,则会转发到http://localhost:3000,防止本地出现跨域问题
# 可以有多个,注意多个不能换行,否则代理将会失效
# VITE_PROXY = [["/basic-api","http://localhost:3000"],["/upload","http://localhost:3300/upload"]]
# VITE_PROXY=[["/api","https://vvbin.cn/test"]]
# 是否删除Console.log
VITE_DROP_CONSOLE=false
VITE_DROP_CONSOLE = false
# 接口地址(用于代码中生成 baseURL)
# 接口地址
# 如果没有跨域问题,直接在这里配置即可
# VITE_GLOB_API_URL=http://192.168.8.73:8080
VITE_GLOB_API_URL=http://localhost:8080
# 文件上传接口
VITE_GLOB_UPLOAD_URL=/system/oss/upload
# 文件上传接口 可选
VITE_GLOB_UPLOAD_URL = /system/oss/upload
# 文件预览接口
VITE_GLOB_UPLOAD_PREVIEW=http://114.116.210.204:8013/onlinePreview?url=
# 文件预览接口 可选
VITE_GLOB_UPLOAD_PREVIEW = http://114.116.210.204:8013/onlinePreview?url=
# 外部url地址
VITE_GLOB_OUT_LINK_URL=http://localhost:4100
#外部url地址
VITE_GLOB_OUT_LINK_URL = http://localhost:4100
# 打印项目地址
VITE_GLOB_PRINT_BASE_URL=http://vue.xjrsoft.com:3300
#打印项目地址
VITE_GLOB_PRINT_BASE_URL = http://vue.xjrsoft.com:3300
# IM URL 地址
VITE_GLOB_IM_LINK_URL=http://localhost:8827
#IM URL 地址
VITE_GLOB_IM_LINK_URL = http://localhost:8827
# 调查问卷地址
VITE_GLOB_QN_LINK_URL=http://localhost:3100
#调查问卷地址
VITE_GLOB_QN_LINK_URL = http://localhost:3100
# 接口地址前缀(如统一加 /prefix)
VITE_GLOB_API_URL_PREFIX=
# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换
VITE_GLOB_API_URL_PREFIX =
# 是否启用官网代码
VITE_GLOB_PRODUCTION=false
VITE_GLOB_PRODUCTION = false
......@@ -29,21 +29,6 @@ export async function getMesCollectionItemPage(params: MesCollectionItemPagePara
}
/**
* @description: 查询MesCollectionItem列表(不分页)
*/
export async function getMesCollectionItemList(params?: MesCollectionItemPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesCollectionItemPageModel[]>(
{
url: Api.List,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取MesCollectionItem信息
*/
export async function getMesCollectionItem(id: String, mode: ErrorMessageMode = 'modal') {
......
......@@ -4,33 +4,173 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
* @description: RokeRouting分页参数 模型
*/
export interface RokeRoutingPageParams extends BasicPageParams {
code: string;
companyId: string;
name: string;
lotRuleId: string;
}
internalCode: string;
/**
* @description: RokeRouting分页返回值模型
*/
export interface RokeRoutingPageModel {
id: string;
deductionBasis: string;
code: string;
note: string;
companyId: string;
name: string;
lotRuleId: string;
}
/**
* @description: RokeRouting分页返回值模
* @description: RokeRouting表类
*/
export interface RokeRoutingPageModel {
export interface RokeRoutingModel {
id: string;
messageMainAttachmentId: string;
name: string;
code: string;
internalCode: string;
active: string;
note: string;
companyId: string;
lotRuleId: string;
autoDeduction: string;
deductionAutoConfirm: string;
deductionMoment: string;
deductionBasis: string;
note: string;
deductionWorkCenter: string;
documentId: string;
productId: string;
routingQualityMode: string;
deleteMark: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
rokeRoutingProcessList?: RokeRoutingProcessModel;
}
0;
/**
* @description: RokeRoutingProcess表类型
*/
export interface RokeRoutingProcessModel {
id: string;
deleteMark: string;
name: string;
code: string;
categoryId: string;
processType: string;
internalCode: string;
active: string;
withoutWoProduce: string;
note: string;
ratedWorkingHours: string;
companyId: string;
isPress: string;
prepareWorkHours: string;
collectionSchemeId: string;
qualityMode: string;
qcSchemeId: string;
isQuality: string;
salaryType: string;
baseQty: string;
salaryUnit: string;
salary: string;
salaryCode: string;
qcSalaryBasis: string;
qcSalaryType: string;
qcBaseQty: string;
qcSalaryUnit: string;
qcSalary: string;
qcSalaryCode: string;
defaultReporter: string;
collectionItem: string;
inspectionCollectionItem: string;
inspectionScheme: string;
inspectionDepartment: string;
inspectionStaff: string;
defectProcessing: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
zyzdFile: string;
zyzdtpFile: string;
routingId: string;
processId: string;
}
/**
* @description: RokeRouting分页返回值结构
......
......@@ -6,19 +6,25 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface RokeEmployeePageParams extends BasicPageParams {
name: string;
code: string;
phone: string;
skillLevelId: string;
jobNumber: string;
positionId: string;
gender: string;
departmentId: string;
phone: string;
gender: string;
idNumber: string;
note: string;
isOnJob: string;
companyId: string;
}
/**
......@@ -33,15 +39,7 @@ export interface RokeEmployeePageModel {
positionId: string;
gender: string;
departmentId: string;
phone: string;
age: string;
note: string;
}
0;
......
import { MesBaseBomPageModel, MesBaseBomPageParams, MesBaseBomPageResult } from './model/WlqdModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/jcsj/wlqd/page',
List = '/jcsj/wlqd/list',
Info = '/jcsj/wlqd/info',
MesBaseBom = '/jcsj/wlqd',
}
/**
* @description: 查询MesBaseBom分页列表
*/
export async function getMesBaseBomPage(params: MesBaseBomPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesBaseBomPageResult>(
{
url: Api.Page,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取MesBaseBom信息
*/
export async function getMesBaseBom(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesBaseBomPageModel>(
{
url: Api.Info,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 新增MesBaseBom
*/
export async function addMesBaseBom(mesBaseBom: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.MesBaseBom,
params: mesBaseBom,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 更新MesBaseBom
*/
export async function updateMesBaseBom(mesBaseBom: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.put<boolean>(
{
url: Api.MesBaseBom,
params: mesBaseBom,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 删除MesBaseBom(批量删除)
*/
export async function deleteMesBaseBom(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.delete<boolean>(
{
url: Api.MesBaseBom,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
/**
* @description: MesBaseBom分页参数 模型
*/
export interface MesBaseBomPageParams extends BasicPageParams {
bommc: string;
bomsl: string;
bombb: string;
cpid: string;
cpbh: string;
cpmc: string;
cpgg: string;
cpxh: string;
sfyy: string;
bz: string;
}
/**
* @description: MesBaseBom分页返回值模型
*/
export interface MesBaseBomPageModel {
id: string;
bommc: string;
bomsl: string;
bombb: string;
cpid: string;
sfyy: string;
cpbh: string;
cpmc: string;
cpgg: string;
cpxh: string;
bz: string;
}
/**
* @description: MesBaseBom表类型
*/
export interface MesBaseBomModel {
id: string;
deleteMark: string;
cpid: string;
bommc: string;
bomsl: string;
sfyy: string;
cpbh: string;
cpmc: string;
bombb: string;
bz: string;
cpgg: string;
cpxh: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
mesBaseBomItemList?: MesBaseBomItemModel;
}
/**
* @description: MesBaseBomItem表类型
*/
export interface MesBaseBomItemModel {
id: string;
deleteMark: string;
bomid: string;
wlbh: string;
wlmc: string;
wlsl: string;
wlkcl: string;
khbz: string;
nkbz: string;
sftl: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
bz: string;
}
/**
* @description: MesBaseBom分页返回值结构
*/
export type MesBaseBomPageResult = BasicFetchResult<MesBaseBomPageModel>;
......@@ -1667,20 +1667,11 @@
localStorage.setItem('tableColumnShowSetting', JSON.stringify(obj));
}
// 获取采集项表单API(用于采集方案页面)
const collectionItemFormApi = inject('collectionItemFormApi', null);
function customClick(executeButton, record?, index?) {
curRecord.value = index;
curButtonModalConfig.value = executeButton.modal;
// 特殊处理:如果是选择采集项按钮,直接调用provide的方法
if (executeButton.key === 'selectCollectionItem' && collectionItemFormApi) {
if (collectionItemFormApi.openCollectionItemSelect) {
collectionItemFormApi.openCollectionItemSelect();
}
return;
}
let obj = {
selectedRows: selectedRowsData.value,
......
<template>
<BasicModal
v-bind="$attrs"
@register="registerModal"
title="选择采集项"
width="800"
@ok="handleSubmit"
@cancel="handleCancel"
:destroyOnClose="true"
>
<BasicTable @register="registerTable" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, nextTick } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicTable, useTable } from '/@/components/Table';
import { getMesCollectionItemPage } from '/@/api/jcsj/cjx';
import { columns } from './collectionItemColumns';
import { useMessage } from '/@/hooks/web/useMessage';
const emit = defineEmits(['success']);
const { createMessage } = useMessage();
const contentType = ref<string>('');
const getExistingItemIds = ref<(() => string[]) | null>(null); // 获取已存在的采集项ID列表的函数
// 表格配置:不再维护外部 selection 状态
const [registerTable, {
reload,
clearSelectedRowKeys,
getSelectRows,
getDataSource,
setTableData
}] = useTable({
title: '采集项列表',
rowSelection: {
type: 'checkbox',
},
api: async (params) => {
if (!contentType.value) {
createMessage.warning('请先选择采集内容');
return { list: [], total: 0 };
}
const ctParam = String(contentType.value || '');
if (!ctParam) return { list: [], total: 0 };
const queryParams = {
...params,
contentType: ctParam,
size: Math.min(params.pageSize || 50, 100),
};
try {
const result = await getMesCollectionItemPage(queryParams);
// 兼容多种返回格式
if (Array.isArray(result)) {
return { list: result, total: result.length };
}
if (result?.list) {
return { list: result.list, total: result.total ?? result.list.length };
}
if (result?.records) {
return { list: result.records, total: result.total ?? result.records.length };
}
// 泛型兼容:找第一个数组字段
for (const key in result) {
if (Array.isArray(result[key])) {
return { list: result[key], total: result.total ?? result[key].length };
}
}
} catch (error: any) {
console.error('获取采集项失败:', error);
createMessage.error(error?.message || '请求失败');
}
return { list: [], total: 0 };
},
columns,
pagination: { pageSize: 50 },
rowKey: 'id',
canResize: false,
showIndexColumn: false,
useSearchForm: false,
});
// 弹窗注册
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
// 先重置所有状态,确保按钮可用
setModalProps({
confirmLoading: false,
destroyOnClose: true,
});
// 提取 contentType
let ctValue = data?.contentType;
if (Array.isArray(ctValue)) ctValue = ctValue[0];
contentType.value = ctValue ? String(ctValue) : '';
// 保存获取已存在采集项ID列表的函数
getExistingItemIds.value = typeof data?.getExistingItemIds === 'function'
? data.getExistingItemIds
: null;
if (!contentType.value) {
createMessage.warning('请先选择采集内容');
closeModal();
return;
}
// 等待 DOM 更新
await nextTick();
// 清除可能遗留的选中状态和数据
if (clearSelectedRowKeys) {
clearSelectedRowKeys();
}
if (setTableData) {
setTableData([]);
}
// 重新加载对应类型的数据
await reload();
// 再次确保选中已清空
await nextTick();
if (clearSelectedRowKeys) {
clearSelectedRowKeys();
}
// 确保按钮状态正确
setModalProps({
confirmLoading: false,
});
});
// 提交处理:直接从表格获取选中行
async function handleSubmit() {
try {
// 设置加载状态,防止重复点击
setModalProps({ confirmLoading: true });
const selectedRows = getSelectRows();
console.log('handleSubmit - selectedRows:', selectedRows);
if (!selectedRows || selectedRows.length === 0) {
createMessage.warning('请至少选择一个采集项');
setModalProps({ confirmLoading: false });
return;
}
// 在提交时实时获取最新的采集项列表,检查是否重复
let currentExistingItemIds: string[] = [];
if (getExistingItemIds.value) {
try {
const ids = getExistingItemIds.value();
currentExistingItemIds = Array.isArray(ids)
? ids.map(id => String(id)).filter(Boolean)
: [];
} catch (error) {
console.error('获取已存在的采集项列表失败:', error);
}
}
// 检查是否与已存在的采集项重复
const duplicateItems: any[] = [];
selectedRows.forEach((item: any) => {
const itemId = String(item.id || '');
if (currentExistingItemIds.includes(itemId)) {
duplicateItems.push(item);
}
});
if (duplicateItems.length > 0) {
const names = duplicateItems.map(item => item.name || item.code || item.id).join('、');
createMessage.warning(`以下采集项已存在,不可重复选择:${names}`);
setModalProps({ confirmLoading: false });
return;
}
// 触发成功事件
emit('success', selectedRows);
// 重置加载状态
setModalProps({ confirmLoading: false });
// 清空所有数据和状态(这些操作即使失败也不应该影响成功流程)
try {
if (clearSelectedRowKeys) {
clearSelectedRowKeys();
}
if (setTableData) {
setTableData([]);
}
} catch (cleanupError) {
console.warn('清空数据时出错(不影响提交):', cleanupError);
}
// 使用 nextTick 确保状态更新后再关闭
await nextTick();
closeModal();
} catch (error) {
console.error('提交失败:', error);
createMessage.error('提交失败,请重试');
setModalProps({ confirmLoading: false });
}
}
// 取消处理
function handleCancel() {
// 确保按钮状态正确
setModalProps({ confirmLoading: false });
// 清空所有数据和状态
if (clearSelectedRowKeys) {
clearSelectedRowKeys();
}
if (setTableData) {
setTableData([]);
}
closeModal();
}
</script>
......@@ -9,28 +9,28 @@
:isCamelCase="true"
@model-change="handleChange"
/>
<CollectionItemSelectModal @register="registerSelectModal" @success="handleSelectSuccess" />
<SelectCollectionItemModal @register="registerSelectModal" @success="handleSelectSuccess" />
</div>
</template>
<script lang="ts" setup>
import { reactive, ref, onMounted, nextTick, watch, provide } from 'vue';
import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addMesCollectionScheme, getMesCollectionScheme, updateMesCollectionScheme } from '/@/api/jcsj/cjfa';
import { cloneDeep, isString } from 'lodash-es';
import { FormDataProps } from '/@/components/Designer/src/types';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router';
import { useModal } from '/@/components/Modal';
import CollectionItemSelectModal from './CollectionItemSelectModal.vue';
import SelectCollectionItemModal from './SelectCollectionItemModal.vue';
import { useMessage } from '/@/hooks/web/useMessage';
const { filterFormSchemaAuth } = usePermission();
const { notification } = useMessage();
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']);
......@@ -41,21 +41,20 @@
},
});
const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({
formDataProps: cloneDeep(formProps),
const formDataPropsValue = cloneDeep(formProps);
if (!formDataPropsValue.buttonList) {
formDataPropsValue.buttonList = [];
}
const data: { formDataProps: FormDataProps & { buttonList: any[] } } = reactive({
formDataProps: formDataPropsValue as FormDataProps & { buttonList: any[] },
});
const state = reactive({
formModel: {},
formInfo:{formId:'',formName:''}
formModel: {} as any,
formInfo:{formId:'',formName:''},
subFormRef: null as any,
});
const { currentRoute } = useRouter();
const [registerSelectModal, { openModal: openSelectModal }] = useModal();
const { createMessage } = useMessage();
// 提供方法给SubForm使用
provide('collectionItemFormApi', {
openCollectionItemSelect,
});
watch(
() => state.formModel,
......@@ -67,11 +66,185 @@
},
);
// 监听采集内容变化,更新SubForm配置
watch(
() => state.formModel.contentType,
() => {
updateSubFormConfig();
},
);
// 更新SubForm配置,添加自定义新增逻辑
function updateSubFormConfig() {
const schemas = data.formDataProps.schemas;
if (!schemas) return;
// 查找SubForm组件
const tabSchema = schemas.find((s) => s.component === 'Tab');
if (!tabSchema || !tabSchema.children) return;
const tabPane = tabSchema.children[0];
if (!tabPane || !tabPane.list) return;
const subFormSchema = tabPane.list.find((s: any) => s.component === 'SubForm');
if (!subFormSchema || !subFormSchema.componentProps) return;
// 修改SubForm配置,添加addBefore钩子来拦截新增
subFormSchema.componentProps.addBefore = (formModel: any, pushObj: any) => {
// 检查是否选择了采集内容
const currentContentType = formModel?.contentType;
if (!currentContentType) {
notification.warning({
message: '提示',
description: '请先选择采集内容',
});
// 标记为需要取消,但在addBefore中无法阻止,需要在addAfter中处理
pushObj._shouldCancel = true;
return;
}
// 设置标志,表示需要打开选择弹窗而不是直接添加
pushObj._customAdd = true;
};
// 在addAfter中处理自定义添加逻辑
subFormSchema.componentProps.addAfter = (formModel: any, pushObj: any) => {
// 如果需要取消(未选择采集内容),移除刚添加的行
if (pushObj._shouldCancel) {
nextTick(() => {
const currentList = state.formModel.mesCollectionSchemeItemList || [];
// 使用key属性或对象引用来查找并移除
const index = pushObj.key !== undefined
? currentList.findIndex((item: any) => item.key === pushObj.key)
: currentList.findIndex((item: any) => item === pushObj);
// 如果找不到,尝试移除最后一个元素(通常是刚添加的)
if (index < 0 && currentList.length > 0) {
currentList.pop();
} else if (index >= 0) {
currentList.splice(index, 1);
}
// 更新表单数据
if (systemFormRef.value) {
systemFormRef.value.setFieldsValue(state.formModel);
}
});
return;
}
// 如果是自定义添加(需要打开选择弹窗),移除刚添加的空行并打开选择弹窗
if (pushObj._customAdd) {
nextTick(() => {
const currentList = state.formModel.mesCollectionSchemeItemList || [];
// 使用key属性或对象引用来查找并移除
const index = pushObj.key !== undefined
? currentList.findIndex((item: any) => item.key === pushObj.key)
: currentList.findIndex((item: any) => item === pushObj);
// 如果找不到,尝试移除最后一个元素(通常是刚添加的)
if (index < 0 && currentList.length > 0) {
currentList.pop();
} else if (index >= 0) {
currentList.splice(index, 1);
}
// 更新表单数据
if (systemFormRef.value) {
systemFormRef.value.setFieldsValue(state.formModel);
}
// 打开选择弹窗
const currentContentType = formModel?.contentType;
if (currentContentType) {
openSelectModal(true, { contentType: currentContentType });
}
});
}
};
}
// 处理选择采集项成功
function handleSelectSuccess(selectedItems: any[]) {
if (!selectedItems || selectedItems.length === 0) return;
// 获取当前的采集项列表
const currentList = state.formModel.mesCollectionSchemeItemList || [];
// 获取已存在的采集项ID和编码,避免重复添加
const existingIds = new Set(currentList.map((item: any) => item.id).filter(Boolean));
const existingCodes = new Set(currentList.map((item: any) => item.code).filter(Boolean));
// 记录重复的项
const duplicateItems: string[] = [];
const addedItems: any[] = [];
// 检查并添加选中的采集项
selectedItems.forEach((item) => {
// 检查是否已存在(通过ID或编码判断)
const isDuplicateById = item.id && existingIds.has(item.id);
const isDuplicateByCode = item.code && existingCodes.has(item.code);
if (isDuplicateById || isDuplicateByCode) {
// 记录重复项的名称
duplicateItems.push(item.name || item.code || '未知项');
} else {
// 添加新项
const newItem = {
code: item.code,
name: item.name,
contentType: item.contentType,
note: item.note,
id: item.id,
schemeId: state.formModel.id || '',
};
currentList.push(newItem);
addedItems.push(newItem);
// 更新已存在的ID和编码集合
if (item.id) {
existingIds.add(item.id);
}
if (item.code) {
existingCodes.add(item.code);
}
}
});
// 如果有重复项,提示用户
if (duplicateItems.length > 0) {
notification.warning({
message: '提示',
description: `以下采集项已存在,已跳过:${duplicateItems.join('、')}`,
duration: 3,
});
}
// 如果没有成功添加任何项,直接返回
if (addedItems.length === 0) {
return;
}
// 更新表单模型
state.formModel.mesCollectionSchemeItemList = currentList;
// 更新表单数据,触发表单刷新
nextTick(() => {
if (systemFormRef.value) {
systemFormRef.value.setFieldsValue(state.formModel);
// 触发表单更新事件,让SubForm组件重新渲染
emits('update:value', state.formModel);
}
});
}
onMounted(async () => {
try {
if (props.fromPage == FromPageType.MENU) {
setMenuPermission();
// 更新SubForm配置,添加自定义新增逻辑
updateSubFormConfig();
if(currentRoute.value.meta){
state.formInfo.formName = currentRoute.value.meta.title&&isString(currentRoute.value.meta.title)?currentRoute.value.meta.title:'';
state.formInfo.formId = currentRoute.value.meta.formId&&isString(currentRoute.value.meta.formId)?currentRoute.value.meta.formId:'';
......@@ -126,6 +299,8 @@
const record = await getMesCollectionScheme(rowId);
setFieldsValue(record);
state.formModel = record;
// 编辑模式下,数据加载后需要重新更新SubForm配置
updateSubFormConfig();
await getFormDataEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据
......@@ -201,6 +376,8 @@
}
state.formModel = formModels;
setFieldsValue(formModels);
// 工作流模式下,数据加载后需要重新更新SubForm配置
updateSubFormConfig();
} catch (error) {}
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
......@@ -213,64 +390,6 @@
emits('update:value', val);
}
// 打开采集项选择弹窗
function openCollectionItemSelect() {
const contentType = state.formModel.contentType;
if (!contentType) {
createMessage.warning('请先选择采集内容');
return;
}
// 传入获取最新采集项列表的函数,以便在提交时实时获取最新数据
const getExistingItemIds = () => {
const currentList = state.formModel.mesCollectionSchemeItemList || [];
return currentList.map((item: any) => item.collectionItemId || item.id).filter(Boolean);
};
openSelectModal(true, { contentType, getExistingItemIds });
}
// 处理选择采集项成功
function handleSelectSuccess(selectedItems: any[]) {
try {
if (!selectedItems || selectedItems.length === 0) {
return;
}
const currentList = state.formModel.mesCollectionSchemeItemList || [];
selectedItems.forEach((item) => {
const newItem = {
code: item.code,
name: item.name,
contentType: item.contentType,
note: item.note || '',
collectionItemId: item.id,
schemeId: state.formModel.id || '',
_isFromSelect: true, // 标记为从选择弹窗添加的项,用于禁用编辑
};
currentList.push(newItem);
});
state.formModel.mesCollectionSchemeItemList = currentList;
// 更新表单值
if (systemFormRef.value) {
systemFormRef.value.setFieldsValue({
mesCollectionSchemeItemList: currentList,
});
}
} catch (error) {
console.error('处理选择采集项成功时出错:', error);
// 不抛出错误,避免影响弹窗关闭
}
}
// 暴露方法给外部调用
function getFormApi() {
return {
openCollectionItemSelect,
};
}
async function sendMessageForAllIframe() {
try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
......@@ -291,9 +410,6 @@
getRowKey,
getFieldsValue,
sendMessageForAllIframe,
getFormApi,
openCollectionItemSelect,
});
</script>
\ No newline at end of file
<template>
<BasicModal
v-bind="$attrs"
@register="registerModal"
title="选择采集项"
@ok="handleSubmit"
@visible-change="handleVisibleChange"
@cancel="handleCancel"
width="800px"
:height="600"
>
<BasicTable @register="registerTable" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicTable, useTable } from '/@/components/Table';
import { FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
import { getMesCollectionItemPage } from '/@/api/jcsj/cjx';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const emit = defineEmits(['success', 'register']);
const contentType = ref<string>('');
const searchFormSchema: FormSchema[] = [
{
field: 'code',
label: '编码',
component: 'Input',
colProps: { span: 8 },
},
{
field: 'name',
label: '名称',
component: 'Input',
colProps: { span: 8 },
},
];
const columns: BasicColumn[] = [
{
title: '编码',
dataIndex: 'code',
width: 150,
},
{
title: '名称',
dataIndex: 'name',
width: 200,
},
{
title: '采集内容',
dataIndex: 'contentType',
width: 150,
},
{
title: '备注',
dataIndex: 'note',
width: 200,
},
];
const [registerTable, { getSelectRows, reload, clearSelectedRowKeys, getForm }] = useTable({
title: '采集项列表',
api: getMesCollectionItemPage,
rowKey: 'id',
columns,
formConfig: {
labelWidth: 70,
schemas: searchFormSchema,
},
rowSelection: {
type: 'checkbox',
},
useSearchForm: true,
showTableSetting: false,
bordered: true,
pagination: {
pageSize: 10,
},
beforeFetch: (params) => {
// 根据选择的采集内容过滤
if (contentType.value) {
params.contentType = contentType.value;
}
return params;
},
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
contentType.value = data?.contentType || '';
setModalProps({ confirmLoading: false });
await reload();
});
// 清空弹窗内的操作
function clearModalOperations() {
// 清空表格选中项
clearSelectedRowKeys();
// 重置搜索表单
const form = getForm();
if (form) {
form.resetFields();
}
}
// 处理弹窗可见性变化
function handleVisibleChange(visible: boolean) {
// 当弹窗关闭时,清空操作
if (!visible) {
clearModalOperations();
}
}
// 处理取消事件
function handleCancel() {
clearModalOperations();
}
const handleSubmit = () => {
const selectedRows = getSelectRows();
if (selectedRows.length === 0) {
return;
}
emit('success', selectedRows);
closeModal();
};
</script>
import { BasicColumn } from '/@/components/Table';
export const columns: BasicColumn[] = [
{
title: '编码',
dataIndex: 'code',
width: 150,
},
{
title: '名称',
dataIndex: 'name',
width: 200,
},
{
title: '数据类型',
dataIndex: 'dataType',
width: 120,
},
{
title: '备注',
dataIndex: 'note',
width: 200,
},
];
......@@ -409,7 +409,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: (record: any) => record?._isFromSelect === true,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -440,7 +440,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: (record: any) => record?._isFromSelect === true,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -468,7 +468,7 @@ export const formProps: FormProps = {
showSearch: false,
isMultiple: false,
clearable: false,
disabled: (record: any) => record?._isFromSelect === true,
disabled: true,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
......@@ -510,7 +510,7 @@ export const formProps: FormProps = {
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: (record: any) => record?._isFromSelect === true,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -567,7 +567,7 @@ export const formProps: FormProps = {
buttonName: '选择数据',
showLabel: true,
showComponentBorder: true,
showBorder: true,
showBorder: false,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
......@@ -603,20 +603,12 @@ export const formProps: FormProps = {
checked: false,
},
],
isShowAdd: false,
isShowAdd: true,
isShowDelete: true,
hasCheckedCol: true,
events: {},
showPagenation: true,
showColunmSet: false,
topButtonList: [
{
key: 'selectCollectionItem',
label: '新增',
style: 'primary',
icon: 'ant-design:plus-outlined',
},
],
},
},
],
......
......@@ -3,29 +3,29 @@ import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: '名称',
field: 'code',
label: '编号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'lotRuleId',
label: '单件/批次号规则',
field: 'companyId',
label: '公司',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: '/jcxx/getLot',
path: '/bmxx/getCompanyList',
method: 'GET',
apiId: 'c2c9e271bd684ba3bf4e57ff94f82e54',
apiId: 'copy1765431632890d13798',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from roke_lot_rule where delete_mark = 0";\r\nreturn db.select(sql);',
'var sql="select id as value,name as label from res_company";\r\nreturn db.select(sql);',
},
labelField: 'label',
valueField: 'value',
......@@ -35,32 +35,14 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'internalCode',
label: '内部标识',
field: 'name',
label: '名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'deductionBasis',
label: '扣料依据',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'staticData',
staticOptions: [
{ key: 1, label: '产品MOD', value: '产品MOD' },
{ key: 2, label: '工艺MOD', value: '工艺MO' },
],
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'note',
label: '备注',
field: 'lotRuleId',
label: '批次号',
defaultValue: undefined,
component: 'Input',
},
......@@ -69,21 +51,21 @@ export const searchFormSchema: FormSchema[] = [
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'name',
title: '名称',
componentType: 'input',
dataIndex: 'code',
title: '编号',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'lotRuleId',
title: '单件/批次号规则',
dataIndex: 'companyId',
title: '公司',
componentType: 'select',
fixed: false,
......@@ -95,31 +77,22 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'deductionBasis',
title: '扣料依据',
componentType: 'select',
customRender: ({ record }) => {
const staticOptions = [
{ key: 1, label: '产品MOD', value: '产品MOD' },
{ key: 2, label: '工艺MOD', value: '工艺MO' },
];
return staticOptions.filter((x) => x.value == record.deductionBasis)[0]?.label;
},
dataIndex: 'name',
title: '名称',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'note',
title: '备注',
componentType: 'textarea',
dataIndex: 'lotRuleId',
title: '批次号',
componentType: 'auto-code',
fixed: false,
sorter: true,
......@@ -211,55 +184,39 @@ export const formProps: FormProps = {
span: 6,
list: [
{
key: '8d9ef135306242729fb4673b9e2dd918',
field: 'name',
label: '名称',
type: 'input',
component: 'Input',
key: '536715321b4c49df8b63b2fcb7cc14ab',
field: 'code',
label: '编号',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入名称',
maxlength: null,
placeholder: '自动生成',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
autoCodeRule: 'GYBH',
required: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 6,
list: [
{
key: '097aabe7380a49f5a691ed3b0613ab26',
field: 'lotRuleId',
label: '单件/批次号规则',
key: '62dc90bd2b2548f39626c59222f2c208',
field: 'companyId',
label: '公司',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 16,
placeholder: '请选择下拉选择单件/批次号规则',
span: 7,
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: false,
isMultiple: false,
......@@ -270,22 +227,21 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: null,
defaultSelect: '',
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx/getLot',
path: '/bmxx/getCompanyList',
method: 'GET',
apiId: 'c2c9e271bd684ba3bf4e57ff94f82e54',
apiId: 'copy1765431632890d13798',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from roke_lot_rule where delete_mark = 0";\r\nreturn db.select(sql);',
'var sql="select id as value,name as label from res_company";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
......@@ -302,19 +258,18 @@ export const formProps: FormProps = {
span: 6,
list: [
{
key: '8a507b277c4d46fb9c3dacc18f98a41b',
field: 'internalCode',
label: '内部标识',
key: '8d9ef135306242729fb4673b9e2dd918',
field: 'name',
label: '名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 11,
span: 7,
defaultValue: '',
placeholder: '请输入内部标识',
maxlength: null,
placeholder: '请输入名称',
prefix: '',
suffix: '',
addonBefore: '',
......@@ -322,7 +277,7 @@ export const formProps: FormProps = {
disabled: false,
allowClear: false,
showLabel: true,
required: false,
required: true,
rules: [],
events: {},
listStyle: '',
......@@ -341,6 +296,34 @@ export const formProps: FormProps = {
span: 6,
list: [
{
key: '2a666ef333114556a7e018a75573fd92',
field: 'lotRuleId',
label: '批次号',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '自动生成',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
showLabel: true,
autoCodeRule: 'GYPC',
required: false,
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 6,
list: [
{
key: '6636f959cd3a4c239aeb3ab43505a27b',
field: 'active',
label: '有效的',
......@@ -380,6 +363,61 @@ export const formProps: FormProps = {
},
},
{
key: 'b7ea8bb6e83b42129ec31ca2cb3716e4',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 24,
list: [
{
key: '08fea1146775468ba1b3ba1193710e09',
field: 'note',
label: '备注',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入备注备注',
rows: 4,
autoSize: false,
showCount: false,
disabled: false,
showLabel: true,
allowClear: false,
required: false,
isShow: true,
isShowAi: false,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
],
componentProps: {
gutter: 16,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
{
key: 'e64fff4326284f16aa6d86acb8678b89',
field: '',
label: '',
......@@ -410,125 +448,108 @@ export const formProps: FormProps = {
conImageUrl: '',
list: [
{
key: '3c2b6278f4114cbc86780eec1f980f0c',
key: 'e75eeef314c4485c922588bb979d0b04',
label: '',
field: 'rokeRoutingLineList',
field: 'rokeRoutingProcessList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'rokeRoutingLineList',
mainKey: 'rokeRoutingProcessList',
columns: [
{
key: '9432fa26a1e44a25b1d68d28eed7372a',
title: '工序',
key: '9e9467d976174786a67851ccb34bb8f7',
title: '名称',
dataIndex: 'processId',
componentType: 'XjrSelect',
componentType: 'MultiplePopup',
componentProps: {
popupType: 'associate',
width: '100%',
span: '',
placeholder: '请选择下拉选择工序',
placeholder: '请选择工序',
showLabel: true,
showSearch: true,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '毛胚原料', value: '毛胚原料' },
{ key: 2, label: '车床', value: '车床' },
],
defaultSelect: '',
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '选择工序',
apiConfig: {
path: '/jcxx/getProcessList',
path: '/jcxx/gxlb',
method: 'GET',
apiId: 'copy1766022481900d48902',
apiId: '8a735bb14d5f4a709efb65b34691acd3',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'processType',
value: '1',
description: null,
required: true,
dataType: null,
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: 'value',
},
],
},
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from roke_process where process_type = #{processType} and delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {
change:
"// 取第一行,统一引用,避免多处硬编码 [0]\nconst row = formModel.roke_routing_lineList?.[0];\n\nif (!row || !row.process_id) {\n console.warn('工序行或 process_id 不存在', row);\n return;\n}\n\nformActionType.httpRequest({\n requestType: 'get',\n requestUrl: '/magic-api/jcxx/getProcess',\n params: {\n id: row.process_id\n },\n errorMessageMode: 'none'\n}).then(res => {\n\n // 兼容 magic-api 常见返回结构\n const list = res?.data || res;\n\n if (Array.isArray(list) && list.length > 0) {\n row.rated_working_hours = list[0].rated_working_hours;\n } else {\n formActionType.showMessage('未查询到工序信息');\n }\n\n}).catch(err => {\n console.error('接口请求异常:', err);\n formActionType.showMessage('接口请求异常');\n});\n",
'var sql="select * from roke_process where delete_mark = 0";\r\nreturn db.select(sql);',
outputParams: [
{
name: 'code',
tableTitle: '编码',
bindField: 'code',
show: true,
width: 150,
component: '8f0c524797e64b40bc4124837d406cdb',
bindTable: 'roke_routing_process',
},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'border: 0'",
{ name: 'name', tableTitle: '名称', show: true, width: 150 },
{
name: 'collection_scheme_id',
tableTitle: '',
bindField: 'collectionSchemeId',
show: false,
width: 150,
component: 'bfdf4979bec74654ae607c3339e56ef2',
bindTable: 'roke_routing_process',
},
{
name: 'category_id',
tableTitle: '',
bindField: 'categoryId',
show: false,
width: 150,
component: 'a56d6b8d54aa4d7c8246feb647f8da8b',
bindTable: 'roke_routing_process',
},
{
key: 'c8785464a8a24157abeb102aa6637d0e',
title: '工序提前/预产期',
dataIndex: 'inAdvTime',
componentType: 'InputNumber',
defaultValue: 1,
componentProps: {
width: '100%',
span: 6,
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
name: 'rated_working_hours',
tableTitle: '',
bindField: 'ratedWorkingHours',
show: false,
width: 150,
component: 'd7f88b9a824042b8b717ba4ffc0aa729',
bindTable: 'roke_routing_process',
},
],
},
dicOptions: [],
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'dbafb88382df488696722e143ff1b9b3',
title: '计薪规则',
dataIndex: 'salaryRule',
key: '8f0c524797e64b40bc4124837d406cdb',
title: '编码',
dataIndex: 'code',
componentType: 'Input',
defaultValue: '每 1.0 产品单位 0.0 元',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '每 1.0 产品单位 0.0 元',
placeholder: '请输入计薪规则计薪规则',
maxlength: null,
defaultValue: '',
placeholder: '请输入编码',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -544,110 +565,39 @@ export const formProps: FormProps = {
},
},
{
key: '63b9efd0597a4b73b381e31b2b0ec874',
title: '工序报工数',
dataIndex: 'workQty',
componentType: 'InputNumber',
defaultValue: 1,
componentProps: {
width: '100%',
span: '',
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'd7a9c539183d43a29ff1689e2cbe87e2',
title: '最终成品数',
dataIndex: 'finishedQty',
componentType: 'InputNumber',
defaultValue: 1,
componentProps: {
width: '100%',
span: '',
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'e20b853140d143e7a90cf447ce0df137',
title: '消耗工序',
dataIndex: 'consumeProcessId',
key: 'a56d6b8d54aa4d7c8246feb647f8da8b',
title: '工序类别',
dataIndex: 'categoryId',
componentType: 'XjrSelect',
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
disabled: true,
staticOptions: [
{ key: 1, label: '毛胚原料', value: '毛胚原料' },
{ key: 2, label: '车床', value: '车床' },
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: '1',
datasourceType: 'api',
params: null,
labelField: 'label',
datasourceType: 'dic',
params: { itemId: '2005547790246666242' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: '/jcxx/getProcessList',
path: '/jcxx/getCollectionSchemeList',
method: 'GET',
apiId: 'copy1766022481900d48902',
apiId: 'copy1767064303024d70507',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'processType',
value: '1',
description: null,
required: true,
dataType: null,
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: 'value',
},
],
},
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from roke_process where process_type = #{processType} and delete_mark = 0";\r\nreturn db.select(sql);',
'var sql="select id as value,name as label from mes_collection_scheme where delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
......@@ -655,37 +605,12 @@ export const formProps: FormProps = {
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2005547790246666242',
listStyle: "return 'border: 0'",
},
},
{
key: '6dad49cc96da4279a8eca463be7ee3b3',
title: '额定工时',
dataIndex: 'ratedWorkingHours',
componentType: 'InputNumber',
defaultValue: 1,
componentProps: {
width: '100%',
span: '',
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '7133da67da6f450a921a6aaa37d05364',
key: 'bfdf4979bec74654ae607c3339e56ef2',
title: '采集方案',
dataIndex: 'collectionSchemeId',
componentType: 'XjrSelect',
......@@ -694,54 +619,30 @@ export const formProps: FormProps = {
span: '',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '无', value: '无' }],
disabled: true,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
path: '/jcxx/getCollectionSchemeList',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'border: 0'",
},
},
{
key: 'd806a68e571c47ecbc653755cd908b0b',
title: '采集项',
dataIndex: 'collectionItemId',
componentType: 'XjrSelect',
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: true,
isMultiple: true,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '环境温度', value: '环境温度' }],
defaultSelect: null,
datasourceType: 'dic',
params: { itemId: '2001194974510096385' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
apiId: 'copy1767064303024d70507',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from mes_collection_scheme where delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
......@@ -749,128 +650,20 @@ export const formProps: FormProps = {
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2001194974510096385',
listStyle: "return 'border: 0'",
},
},
{
key: 'df36ce1665194f998c7f7b43bdf3e730',
title: '作业规范',
dataIndex: 'standardItemsNumber',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'cce7f159869e44d7b7243b7f0b9544ed',
title: '作业指导',
dataIndex: 'documentNumber',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '569b4f85f2a243d4bf69d190a7d299ba',
title: '关键物料',
dataIndex: 'pBomNumber',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '8be06556e4864b0eb89a97477f9f8644',
title: '子工序',
dataIndex: 'childProcessNumber',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '23a0c5a0303840fd81f65f6fa36d3526',
title: '工作中心',
dataIndex: 'workCenterNumber',
key: 'd7f88b9a824042b8b717ba4ffc0aa729',
title: '额定工时',
dataIndex: 'ratedWorkingHours',
componentType: 'InputNumber',
defaultValue: 0,
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
defaultValue: '',
step: 0.01,
disabled: true,
showLabel: true,
controls: true,
......@@ -885,7 +678,7 @@ export const formProps: FormProps = {
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
span: '24',
span: 7,
preloadType: 'api',
apiConfig: {},
itemId: '',
......@@ -917,297 +710,9 @@ export const formProps: FormProps = {
},
],
},
{
span: 24,
name: '质检设置',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '2b6470174fb74ea1b7ebcf0a745cc90a',
field: 'routingQualityMode',
label: '质检方式',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '20%',
span: 12,
placeholder: '请选择下拉选择质检方式质检方式',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '工单质检', value: '工单质检' },
{ key: 3, label: '质检单', value: '质检单' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: true,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '20%' },
},
},
],
},
{
span: 24,
name: '自动扣料',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '810345b81a7540a4917ef3c8ab8dea1a',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 6,
list: [
{
key: '7d2104a70396450485eb4225debf924f',
field: 'autoDeduction',
label: '自动扣料',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 17,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {
change:
"let value = formModel.auto_deduction;\nvar fieldConfigs = [\n {field: 'deduction_work_center'},\n {field: 'deduction_auto_confirm'},\n {field: 'deduction_moment'},\n {field: 'deduction_basis'}\n];\nfieldConfigs.forEach(function(config) {\n var isDisabled = false;\n var isRequired = false;\n if (value == 1) {\n isDisabled = false; \n if (config.field === 'deduction_moment' || config.field === 'deduction_basis') {\n isRequired = true;\n }\n } else {\n isDisabled = true;\n isRequired = false;\n }\n formActionType.updateSchema({\n field: config.field,\n componentProps: {\n disabled: isDisabled,\n required: isRequired\n }\n });\n});",
},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
{
key: 'fdc20894032645628350fa8df3a515f3',
field: 'deductionWorkCenter',
label: '分车间扣料',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 11,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: true,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
{
span: 6,
list: [
{
key: '82efccd1f14a4a43b60f35ad75939c03',
field: 'deductionAutoConfirm',
label: '自动确认扣料',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 19,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: true,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
{
span: 6,
list: [
{
key: '1684c8eba06c45c1a0e4df9bcbe4eaf2',
field: 'deductionMoment',
label: ' 扣料节点',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 17,
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: true,
staticOptions: [
{ key: 1, label: '首道扣料', value: '首道扣料' },
{ key: 2, label: '末道扣料', value: '末道扣料' },
{ key: 3, label: '入库扣料', value: '入库扣料' },
{ key: 4, label: '分步扣料', value: '分步扣料' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 6,
list: [
{
key: 'f529e8bc463f4811983593cf2987e15e',
field: 'deductionBasis',
label: '扣料依据',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 17,
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: true,
staticOptions: [
{ key: 1, label: '产品MOD', value: '产品MOD' },
{ key: 2, label: '工艺MOD', value: '工艺MO' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
],
componentProps: {
gutter: 16,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
],
},
],
componentProps: { tabPosition: 'top', size: 'default', type: 'line', isShow: true },
},
{
key: '16cce9dceb104efc9af33d84f3734488',
field: 'note',
label: '备注',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入备注',
maxlength: null,
rows: 4,
autoSize: false,
showCount: false,
disabled: false,
showLabel: true,
allowClear: false,
required: false,
isShow: true,
isShowAi: false,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
],
......@@ -1243,7 +748,6 @@ export const formButtons = [
isShow: true,
index: 2,
type: 1,
modal: null,
},
{
key: 'cancel',
......@@ -1254,7 +758,6 @@ export const formButtons = [
isShow: true,
index: 1,
type: 1,
modal: null,
},
{
key: 'reset',
......@@ -1265,6 +768,5 @@ export const formButtons = [
isShow: true,
index: 0,
type: 1,
modal: null,
},
];
export const permissionList = [
{
required: true,
required: false,
view: true,
edit: true,
disabled: false,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '名称',
fieldId: 'name',
fieldName: '编号',
fieldId: 'code',
isSubTable: false,
showChildren: true,
type: 'input',
key: '8d9ef135306242729fb4673b9e2dd918',
type: 'auto-code',
key: '536715321b4c49df8b63b2fcb7cc14ab',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -23,28 +22,28 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '单件/批次号规则',
fieldId: 'lotRuleId',
fieldName: '公司',
fieldId: 'companyId',
isSubTable: false,
showChildren: true,
type: 'select',
key: '097aabe7380a49f5a691ed3b0613ab26',
key: '62dc90bd2b2548f39626c59222f2c208',
children: [],
options: {},
},
{
required: false,
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '内部标识',
fieldId: 'internalCode',
fieldName: '名称',
fieldId: 'name',
isSubTable: false,
showChildren: true,
type: 'input',
key: '8a507b277c4d46fb9c3dacc18f98a41b',
key: '8d9ef135306242729fb4673b9e2dd918',
children: [],
options: {},
defaultValue: '',
......@@ -52,6 +51,22 @@ export const permissionList = [
{
required: false,
view: true,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '批次号',
fieldId: 'lotRuleId',
isSubTable: false,
showChildren: true,
type: 'auto-code',
key: '2a666ef333114556a7e018a75573fd92',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
......@@ -67,63 +82,35 @@ export const permissionList = [
defaultValue: 1,
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '',
fieldId: 'rokeRoutingLineList',
type: 'form',
key: '3c2b6278f4114cbc86780eec1f980f0c',
children: [
{
required: true,
required: false,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '工序',
fieldId: 'processId',
type: 'XjrSelect',
key: '9432fa26a1e44a25b1d68d28eed7372a',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
tableName: '',
fieldName: '备注',
fieldId: 'note',
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '工序提前/预产期',
fieldId: 'inAdvTime',
type: 'InputNumber',
key: 'c8785464a8a24157abeb102aa6637d0e',
showChildren: true,
type: 'textarea',
key: '08fea1146775468ba1b3ba1193710e09',
children: [],
options: {},
defaultValue: '',
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
isSubTable: true,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '计薪规则',
fieldId: 'salaryRule',
type: 'Input',
key: 'dbafb88382df488696722e143ff1b9b3',
children: [],
},
tableName: 'rokeRoutingProcessList',
fieldName: '',
fieldId: 'rokeRoutingProcessList',
type: 'form',
key: 'e75eeef314c4485c922588bb979d0b04',
children: [
{
required: true,
view: true,
......@@ -132,11 +119,11 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '工序报工数',
fieldId: 'workQty',
type: 'InputNumber',
key: '63b9efd0597a4b73b381e31b2b0ec874',
tableName: 'rokeRoutingProcessList',
fieldName: '名称',
fieldId: 'processId',
type: 'MultiplePopup',
key: '9e9467d976174786a67851ccb34bb8f7',
children: [],
},
{
......@@ -147,11 +134,11 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '最终成品数',
fieldId: 'finishedQty',
type: 'InputNumber',
key: 'd7a9c539183d43a29ff1689e2cbe87e2',
tableName: 'rokeRoutingProcessList',
fieldName: '编码',
fieldId: 'code',
type: 'Input',
key: '8f0c524797e64b40bc4124837d406cdb',
children: [],
},
{
......@@ -162,11 +149,11 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '消耗工序',
fieldId: 'consumeProcessId',
tableName: 'rokeRoutingProcessList',
fieldName: '工序类别',
fieldId: 'categoryId',
type: 'XjrSelect',
key: 'e20b853140d143e7a90cf447ce0df137',
key: 'a56d6b8d54aa4d7c8246feb647f8da8b',
children: [],
},
{
......@@ -177,56 +164,11 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '额定工时',
fieldId: 'ratedWorkingHours',
type: 'InputNumber',
key: '6dad49cc96da4279a8eca463be7ee3b3',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
tableName: 'rokeRoutingProcessList',
fieldName: '采集方案',
fieldId: 'collectionSchemeId',
type: 'XjrSelect',
key: '7133da67da6f450a921a6aaa37d05364',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '采集项',
fieldId: 'collectionItemId',
type: 'XjrSelect',
key: 'd806a68e571c47ecbc653755cd908b0b',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '作业规范',
fieldId: 'standardItemsNumber',
type: 'InputNumber',
key: 'df36ce1665194f998c7f7b43bdf3e730',
key: 'bfdf4979bec74654ae607c3339e56ef2',
children: [],
},
{
......@@ -237,174 +179,13 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '作业指导',
fieldId: 'documentNumber',
type: 'InputNumber',
key: 'cce7f159869e44d7b7243b7f0b9544ed',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '关键物料',
fieldId: 'pBomNumber',
type: 'InputNumber',
key: '569b4f85f2a243d4bf69d190a7d299ba',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '子工序',
fieldId: 'childProcessNumber',
type: 'InputNumber',
key: '8be06556e4864b0eb89a97477f9f8644',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '工作中心',
fieldId: 'workCenterNumber',
tableName: 'rokeRoutingProcessList',
fieldName: '额定工时',
fieldId: 'ratedWorkingHours',
type: 'InputNumber',
key: '23a0c5a0303840fd81f65f6fa36d3526',
key: 'd7f88b9a824042b8b717ba4ffc0aa729',
children: [],
},
],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检方式',
fieldId: 'routingQualityMode',
isSubTable: false,
showChildren: true,
type: 'select',
key: '2b6470174fb74ea1b7ebcf0a745cc90a',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '自动扣料',
fieldId: 'autoDeduction',
isSubTable: false,
showChildren: true,
type: 'switch',
key: '7d2104a70396450485eb4225debf924f',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '分车间扣料',
fieldId: 'deductionWorkCenter',
isSubTable: false,
showChildren: true,
type: 'switch',
key: 'fdc20894032645628350fa8df3a515f3',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '自动确认扣料',
fieldId: 'deductionAutoConfirm',
isSubTable: false,
showChildren: true,
type: 'switch',
key: '82efccd1f14a4a43b60f35ad75939c03',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: ' 扣料节点',
fieldId: 'deductionMoment',
isSubTable: false,
showChildren: true,
type: 'select',
key: '1684c8eba06c45c1a0e4df9bcbe4eaf2',
children: [],
options: {},
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '扣料依据',
fieldId: 'deductionBasis',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'f529e8bc463f4811983593cf2987e15e',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'note',
isSubTable: false,
showChildren: true,
type: 'textarea',
key: '16cce9dceb104efc9af33d84f3734488',
children: [],
options: {},
defaultValue: '',
},
];
......@@ -133,7 +133,7 @@
//展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isEnableLock":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]
const list = [{"buttonId":"2006195708167311360","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2006195708171505664","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2006195708171505665","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2006195708171505666","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list);
})
......
......@@ -9,20 +9,26 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
},
{
field: 'jobNumber',
label: '号',
field: 'code',
label: '号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'positionId',
label: '职位',
field: 'phone',
label: '电话',
defaultValue: undefined,
component: 'Input',
},
{
field: 'skillLevelId',
label: '技能等级',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'staticData',
staticOptions: [{ key: 1, label: '工程师', value: '1' }],
labelField: 'label',
datasourceType: 'dic',
params: { itemId: '2006238300988784641' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
showSearch: true,
......@@ -30,17 +36,20 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'gender',
label: '性别',
field: 'jobNumber',
label: '工号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'positionId',
label: '职位',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'staticData',
staticOptions: [
{ key: 1, label: '男', value: '男' },
{ key: 2, label: '女', value: '女' },
],
labelField: 'label',
datasourceType: 'dic',
params: { itemId: '2006236571274592257' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
showSearch: true,
......@@ -74,10 +83,22 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'phone',
label: '电话',
field: 'gender',
label: '性别',
defaultValue: undefined,
component: 'Input',
component: 'XjrSelect',
componentProps: {
datasourceType: 'staticData',
staticOptions: [
{ key: 1, label: '男', value: '男' },
{ key: 2, label: '女', value: '女' },
],
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'idNumber',
......@@ -86,10 +107,45 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
},
{
field: 'note',
label: '备注',
field: 'isOnJob',
label: '在职情况',
defaultValue: undefined,
component: 'Input',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '2006237055246942210' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'companyId',
label: '公司',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: '/bmxx/getCompanyList',
method: 'GET',
apiId: 'copy1765431632890d13798',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from res_company";\r\nreturn db.select(sql);',
},
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
];
......@@ -126,34 +182,6 @@ export const columns: BasicColumn[] = [
title: '职位',
componentType: 'select',
customRender: ({ record }) => {
const staticOptions = [{ key: 1, label: '工程师', value: '1' }];
return staticOptions.filter((x) => x.value == record.positionId)[0]?.label;
},
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'gender',
title: '性别',
componentType: 'select',
customRender: ({ record }) => {
const staticOptions = [
{ key: 1, label: '男', value: '男' },
{ key: 2, label: '女', value: '女' },
];
return staticOptions.filter((x) => x.value == record.gender)[0]?.label;
},
fixed: false,
sorter: true,
......@@ -173,45 +201,6 @@ export const columns: BasicColumn[] = [
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'phone',
title: '电话',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'age',
title: '年龄',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'note',
title: '备注',
componentType: 'textarea',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
];
//表头合并配置
export const headerMergingData = [];
......@@ -332,7 +321,7 @@ export const formProps: FormProps = {
width: '100%',
span: 11,
defaultValue: '',
placeholder: '请输入人员名称人员名称人员名称',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
......@@ -412,9 +401,32 @@ export const formProps: FormProps = {
span: 6,
list: [
{
key: 'bae97ad7fefb4f8aa692e678934e8f97',
key: '552fd440728b449eb2e2ed15bf8eb068',
field: 'code',
label: '编号',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '自动生成',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
showLabel: true,
autoCodeRule: 'RYBH',
required: false,
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '488d22332deb4f2abf4a9423122d98f7',
field: 'phone',
label: '电话',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -423,7 +435,7 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入编号人员编号',
placeholder: '请输入电话',
maxlength: null,
prefix: '',
suffix: '',
......@@ -432,7 +444,7 @@ export const formProps: FormProps = {
disabled: false,
allowClear: false,
showLabel: true,
required: true,
required: false,
rules: [],
events: {},
listStyle: '',
......@@ -446,29 +458,57 @@ export const formProps: FormProps = {
},
},
{
key: 'b8f4cac721c84e4e8202cc66b54a6795',
field: 'teamId',
label: '班组',
key: '6b94c3e5675b4202bb9aeb73f30c9306',
field: 'teamWeighted',
label: '班组报工权重',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 1,
componentProps: {
width: '100%',
span: 13,
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '7126b5787dc647bda9c3b05d626a2cf2',
field: 'skillLevelId',
label: '技能等级',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择下拉选择班组',
placeholder: '请选择下拉选择技能等级技能等级',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '一', value: '1' },
{ key: 2, label: '二', value: '2' },
{ key: 1, label: '一', value: '1' },
{ key: 2, label: '二', value: '2' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
defaultSelect: null,
datasourceType: 'dic',
params: { itemId: '2006238300988784641' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
......@@ -481,38 +521,16 @@ export const formProps: FormProps = {
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2006238300988784641',
style: { width: '100%' },
},
},
{
key: '6b94c3e5675b4202bb9aeb73f30c9306',
field: 'teamWeighted',
label: '班组报工权重',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 1,
componentProps: {
width: '100%',
span: 13,
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
],
},
{
span: 6,
list: [
{
key: '1ef1b726c6f34f4fa0d704afac0aac7a',
field: 'jobNumber',
label: '工号',
......@@ -524,7 +542,7 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入工号人员名称',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
......@@ -546,11 +564,6 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
],
},
{
span: 6,
list: [
{
key: 'ea8630c3055b4a28a85ef1fbefadfc75',
field: 'positionId',
......@@ -568,49 +581,10 @@ export const formProps: FormProps = {
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '工程师', value: '1' }],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'b5eb1855dc6d409280dbb7c4a333ae07',
field: 'gender',
label: '性别',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择下拉选择性别',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '男', value: '男' },
{ key: 2, label: '女', value: '女' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
defaultSelect: null,
datasourceType: 'dic',
params: { itemId: '2006236571274592257' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
......@@ -623,6 +597,7 @@ export const formProps: FormProps = {
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2006236571274592257',
style: { width: '100%' },
},
},
......@@ -669,25 +644,30 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
],
},
{
key: '7126b5787dc647bda9c3b05d626a2cf2',
field: 'skillLevelId',
label: '技能等级',
span: 6,
list: [
{
key: 'b5eb1855dc6d409280dbb7c4a333ae07',
field: 'gender',
label: '性别',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 11,
placeholder: '请选择下拉选择技能等级',
span: 7,
placeholder: '请选择下拉选择性别',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '一级', value: '1' },
{ key: 2, label: '二级', value: '2' },
{ key: 1, label: '男', value: '男' },
{ key: 2, label: '女', value: '女' },
],
defaultSelect: '',
datasourceType: 'staticData',
......@@ -708,45 +688,6 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
],
},
{
span: 6,
list: [
{
key: '488d22332deb4f2abf4a9423122d98f7',
field: 'phone',
label: '电话',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入电话',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'dc946f68a78148c3bedd3cc361899726',
field: 'idNumber',
......@@ -759,7 +700,7 @@ export const formProps: FormProps = {
width: '100%',
span: 10,
defaultValue: '',
placeholder: '请输入身份证号人员名称',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
......@@ -793,7 +734,7 @@ export const formProps: FormProps = {
width: '100%',
span: 14,
defaultValue: '',
placeholder: '请输入户口所在地人员名称',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
......@@ -815,49 +756,6 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
{
key: 'dfb0639d444c4449b11f26cf210feac5',
field: 'companyId',
label: '公司',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 9,
placeholder: '请选择下拉选择公司',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '和利时', value: '1' }],
defaultSelect: null,
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/bmxx/getCompanyList',
method: 'GET',
apiId: 'copy1765431632890d13798',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from res_company";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
......@@ -907,7 +805,7 @@ export const formProps: FormProps = {
componentProps: {
width: '100%',
span: 13,
placeholder: '请选择下拉选择在职情况',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: false,
isMultiple: false,
......@@ -917,10 +815,10 @@ export const formProps: FormProps = {
{ key: 1, label: '在职', value: '在职' },
{ key: 2, label: '离职', value: '离职' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
defaultSelect: null,
datasourceType: 'dic',
params: { itemId: '2006237055246942210' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
......@@ -933,6 +831,50 @@ export const formProps: FormProps = {
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2006237055246942210',
style: { width: '100%' },
},
},
{
key: 'dfb0639d444c4449b11f26cf210feac5',
field: 'companyId',
label: '公司',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择下拉选择公司',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '和利时', value: '1' }],
defaultSelect: null,
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/bmxx/getCompanyList',
method: 'GET',
apiId: 'copy1765431632890d13798',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from res_company";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
......
......@@ -51,21 +51,20 @@ export const permissionList = [
defaultValue: 1,
},
{
required: true,
required: false,
view: true,
edit: true,
disabled: false,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '编号',
fieldId: 'code',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'bae97ad7fefb4f8aa692e678934e8f97',
type: 'auto-code',
key: '552fd440728b449eb2e2ed15bf8eb068',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -74,14 +73,15 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '班组',
fieldId: 'teamId',
fieldName: '电话',
fieldId: 'phone',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'b8f4cac721c84e4e8202cc66b54a6795',
type: 'input',
key: '488d22332deb4f2abf4a9423122d98f7',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -107,15 +107,14 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '工号',
fieldId: 'jobNumber',
fieldName: '技能等级',
fieldId: 'skillLevelId',
isSubTable: false,
showChildren: true,
type: 'input',
key: '1ef1b726c6f34f4fa0d704afac0aac7a',
type: 'select',
key: '7126b5787dc647bda9c3b05d626a2cf2',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -124,14 +123,15 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '职位',
fieldId: 'positionId',
fieldName: '工号',
fieldId: 'jobNumber',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'ea8630c3055b4a28a85ef1fbefadfc75',
type: 'input',
key: '1ef1b726c6f34f4fa0d704afac0aac7a',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -140,12 +140,12 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '性别',
fieldId: 'gender',
fieldName: '职位',
fieldId: 'positionId',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'b5eb1855dc6d409280dbb7c4a333ae07',
key: 'ea8630c3055b4a28a85ef1fbefadfc75',
children: [],
options: {},
},
......@@ -172,31 +172,14 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '技能等级',
fieldId: 'skillLevelId',
fieldName: '性别',
fieldId: 'gender',
isSubTable: false,
showChildren: true,
type: 'select',
key: '7126b5787dc647bda9c3b05d626a2cf2',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '电话',
fieldId: 'phone',
isSubTable: false,
showChildren: true,
type: 'input',
key: '488d22332deb4f2abf4a9423122d98f7',
key: 'b5eb1855dc6d409280dbb7c4a333ae07',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -239,14 +222,15 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '公司',
fieldId: 'companyId',
fieldName: '年龄',
fieldId: 'age',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'dfb0639d444c4449b11f26cf210feac5',
type: 'input',
key: '8c0ea91bdee24d40aa94110ab9f19eae',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -255,15 +239,14 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '年龄',
fieldId: 'age',
fieldName: '在职情况',
fieldId: 'isOnJob',
isSubTable: false,
showChildren: true,
type: 'input',
key: '8c0ea91bdee24d40aa94110ab9f19eae',
type: 'select',
key: 'a1494eb3af92444bb256d4781a46a52c',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -272,12 +255,12 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '在职情况',
fieldId: 'isOnJob',
fieldName: '公司',
fieldId: 'companyId',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'a1494eb3af92444bb256d4781a46a52c',
key: 'dfb0639d444c4449b11f26cf210feac5',
children: [],
options: {},
},
......
<template>
<div class="pt-4">
<SimpleForm
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="state.formModel"
:isWorkFlow="props.fromPage!=FromPageType.MENU"
:isCamelCase="true"
@model-change="handleChange"
/>
</div>
</template>
<script lang="ts" setup>
import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addMesBaseBom, getMesBaseBom, updateMesBaseBom } from '/@/api/jcsj/wlqd';
import { cloneDeep, isString } from 'lodash-es';
import { FormDataProps } from '/@/components/Designer/src/types';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router';
const { filterFormSchemaAuth } = usePermission();
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']);
const props = defineProps({
fromPage: {
type: Number,
default: FromPageType.MENU,
},
});
const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({
formDataProps: cloneDeep(formProps),
});
const state = reactive({
formModel: {},
formInfo:{formId:'',formName:''}
});
const { currentRoute } = useRouter();
watch(
() => state.formModel,
(val) => {
emits('update:value', val);
},
{
deep: true,
},
);
onMounted(async () => {
try {
if (props.fromPage == FromPageType.MENU) {
setMenuPermission();
if(currentRoute.value.meta){
state.formInfo.formName = currentRoute.value.meta.title&&isString(currentRoute.value.meta.title)?currentRoute.value.meta.title:'';
state.formInfo.formId = currentRoute.value.meta.formId&&isString(currentRoute.value.meta.formId)?currentRoute.value.meta.formId:'';
}
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await nextTick();
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
} else if (props.fromPage == FromPageType.PREVIEW) {
// 预览 无需权限,表单事件也无需执行
} else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
}
} catch (error) {}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
}
// 校验form 通过返回表单数据
async function validate() {
let values = [];
try {
values = await systemFormRef.value?.validate();
//添加隐藏组件
if (data.formDataProps.hiddenComponent?.length) {
data.formDataProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
} finally {
}
return values;
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) {
try {
const record = await getMesBaseBom(rowId);
setFieldsValue(record);
state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据
} catch (error) {
}
}
// 辅助返回表单数据
async function getFieldsValue() {
let values = [];
try {
values = await systemFormRef.value?.getFieldsValue();
//添加隐藏组件
if (data.formDataProps.hiddenComponent?.length) {
data.formDataProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
} finally {
}
return values;
}
// 辅助设置表单数据
function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record);
}
// 重置表单数据
async function resetFields() {
await systemFormRef.value.resetFields();
}
// 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
}
// 获取行键值
function getRowKey() {
return RowKey;
}
// 更新api表单数据
async function update({ values, rowId }) {
try {
values[RowKey] = rowId;
state.formModel = values;
let saveVal = await updateMesBaseBom(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 新增api表单数据
async function add(values) {
try {
state.formModel = values;
let saveVal = await addMesBaseBom(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) {
try {
if (obj.formId) state.formInfo.formId = obj.formId;
if (obj.formName) state.formInfo.formName = obj.formName;
let flowData = await changeWorkFlowForm(cloneDeep(formProps), obj);
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData;
data.formDataProps = buildOptionJson;
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】
if (isViewProcess) {
setDisabledForm(); //查看
}
state.formModel = formModels;
setFieldsValue(formModels);
} catch (error) {}
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
}
function handleChange(val) {
emits('update:value', val);
}
async function sendMessageForAllIframe() {
try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
systemFormRef.value.sendMessageForAllIframe();
}
} catch (error) {}
}
defineExpose({
setFieldsValue,
resetFields,
validate,
add,
update,
setFormDataFromId,
setDisabledForm,
setMenuPermission,
setWorkFlowForm,
getRowKey,
getFieldsValue,
sendMessageForAllIframe
});
</script>
\ No newline at end of file
<template>
<BasicModal
:height="1080"
v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" >
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
<template #footer v-if=" !state.isView">
<template v-for="(item, index) in sortBy(formButtons, 'index')" :key="item.key">
<template v-if="item.isShow">
<CustomButtonModal v-if="item.type == CustomButtonModalType.Modal" :info="item" />
<a-button
:type="item.style"
v-else
:style="{ marginLeft: index > 0 ? '10px' : 0 }"
@click="customClick(item)"
>
{{ t(item.name) }}
</a-button>
</template>
</template>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { CustomButtonModalType } from '/@/enums/userEnum';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { formProps ,formButtons } from './config';
import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum';
import { sortBy } from 'lodash-es';
import { executeCurFormEvent } from '/@/utils/event/data';
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const formRef = ref();
const isCopy = ref<boolean>(false)
const state = reactive({
formModel: {},
isUpdate: true,
isView: false,
rowId: '',
});
provide<Ref<boolean>>('isCopy', isCopy);
const { t } = useI18n();
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await handleInner(data);
});
const getTitle = computed(() => (state.isView ? '查看' : state.isUpdate ? '编辑' : isCopy.value ? '复制数据' : '新增'));
async function handleInner(data){
state.isUpdate = !!data?.isUpdate;
state.isView = !!data?.isView;
isCopy.value = !!data?.isCopy;
setModalProps({
destroyOnClose: true,
maskClosable: false,
showCancelBtn: false,
showOkBtn: false,
canFullscreen: true,
width: 1920,
footer: state.isView ? null : undefined,defaultFullscreen:true,
});
if (state.isUpdate || state.isView || isCopy.value) {
state.rowId = data.id;
if (state.isView) {
await formRef.value.setDisabledForm();
}
await formRef.value.setFormDataFromId(state.rowId);
} else {
formRef.value.resetFields();
}
}
async function saveModal() {
let saveSuccess = false;
try {
const values = await formRef.value?.validate();
//添加隐藏组件
if (formProps.hiddenComponent?.length) {
formProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
if (values !== false) {
try {
if (!state.isUpdate || isCopy.value) {
saveSuccess = await formRef.value.add(values);
} else {
saveSuccess = await formRef.value.update({ values, rowId: state.rowId });
}
return saveSuccess;
} catch (error) {}
}
} catch (error) {
return saveSuccess;
}
}
async function handleSubmit() {
try {
const saveSuccess = await saveModal();
setModalProps({ confirmLoading: true });
if (saveSuccess) {
if (!state.isUpdate || isCopy.value) {
//false 新增
notification.success({
message: 'Tip',
description: isCopy.value ? '复制成功' : t('新增成功!'),
}); //提示消息
} else {
notification.success({
message: 'Tip',
description: t('修改成功!'),
}); //提示消息
}
closeModal();
formRef.value.resetFields();
emit('success');
}
} finally {
setModalProps({ confirmLoading: false });
}
}
function customClick(item) {
if (item.key == 'confirm') {
handleSubmit();
} else if (item.key == 'cancel' && props.formType !== 'normal') {
handleClose();
closeModal();
} else if (item.key == 'reset') {
formRef.value.resetFields();
} else {
executeCurFormEvent(item.event, state.formModel, true);
}
}
function handleClose() {
formRef.value.resetFields();
}
</script>
\ No newline at end of file
import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'bommc',
label: 'BOM名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'bomsl',
label: 'BOM数量',
defaultValue: undefined,
component: 'InputNumber',
componentProps: {
style: { width: '100%' },
},
},
{
field: 'bombb',
label: 'BOM版本',
defaultValue: undefined,
component: 'Input',
},
{
field: 'cpid',
label: '选择产品',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
outputParams: [
{
name: 'cpbh',
tableTitle: '产品编号',
bindField: 'cpbh',
show: true,
width: 150,
component: 'b2682f1ff2dc48448211cacb4bf48bfd',
},
{
name: 'cpmc',
tableTitle: '产品名称',
bindField: 'cpmc',
show: true,
width: 150,
component: 'db0bea5c2dbf4505833e67179e8618f3',
},
{
name: 'gg',
tableTitle: '产品规格',
bindField: 'cpgg',
show: true,
width: 150,
component: '3e7491b6d43c4ef7a7b6c2fd49a94a7f',
},
{
name: 'xh',
tableTitle: '产品型号',
bindField: 'cpxh',
show: true,
width: 150,
component: 'cf7d04d1e6374a3fbc4a9dfb9ebdf19e',
},
],
},
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'cpbh',
label: '产品编号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'cpmc',
label: '产品名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'cpgg',
label: '产品规格',
defaultValue: undefined,
component: 'Input',
},
{
field: 'cpxh',
label: '产品型号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'sfyy',
label: '是否有效',
defaultValue: 1,
component: 'Select',
componentProps: {
getPopupContainer: () => document.body,
options: [
{
label: '开',
value: 1,
},
{
label: '关',
value: 0,
},
],
},
},
{
field: 'bz',
label: '备注',
defaultValue: undefined,
component: 'Input',
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'bommc',
title: 'BOM名称',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'bomsl',
title: 'BOM数量',
componentType: 'number',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'bombb',
title: 'BOM版本',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'cpid',
title: '选择产品',
componentType: 'associate-popup',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'sfyy',
title: '是否有效',
componentType: 'switch',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'cpbh',
title: '产品编号',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'cpmc',
title: '产品名称',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'cpgg',
title: '产品规格',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'cpxh',
title: '产品型号',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'bz',
title: '备注',
componentType: 'textarea',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
];
//表头合并配置
export const headerMergingData = [];
//表单事件
export const formEventConfigs = {
0: [
{
type: 'circle',
color: '#2774ff',
text: '开始节点',
icon: '#icon-kaishi',
bgcColor: '#D8E5FF',
isUserDefined: false,
},
{
color: '#F6AB01',
icon: '#icon-chushihua',
text: '初始化表单',
bgcColor: '#f9f5ea',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
1: [
{
color: '#B36EDB',
icon: '#icon-shujufenxi',
text: '获取表单数据',
detail: '(新增无此操作)',
bgcColor: '#F8F2FC',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
2: [
{
color: '#F8625C',
icon: '#icon-jiazai',
text: '加载表单',
bgcColor: '#FFF1F1',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
3: [
{
color: '#6C6AE0',
icon: '#icon-jsontijiao',
text: '提交表单',
bgcColor: '#F5F4FF',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
4: [
{
type: 'circle',
color: '#F8625C',
text: '结束节点',
icon: '#icon-jieshuzhiliao',
bgcColor: '#FFD6D6',
isLast: true,
isUserDefined: false,
},
],
};
export const formProps: FormProps = {
labelCol: { span: 2, offset: 0 },
labelAlign: 'right',
layout: 'horizontal',
size: 'default',
schemas: [
{
key: '4752659a82714a54967a2da899d68d24',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 8,
list: [
{
key: '0bb6edfef8ac486482e02a6e650306e6',
field: 'bommc',
label: 'BOM名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入BOM名称',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: '4bc74304a0144e879b2fc45ae28ab1c5',
field: 'bomsl',
label: 'BOM数量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
min: 0,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
defaultValue: 0,
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: '50bff2d4c82d40a98ace5fd2b1d3b41e',
field: 'bombb',
label: 'BOM版本',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入BOM版本',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'c42ef62f38e1445b89e5c3362ffd3af2',
field: 'cpid',
label: '选择产品',
type: 'associate-popup',
component: 'MultiplePopup',
colProps: { span: 24 },
componentProps: {
popupType: 'associate',
width: '100%',
span: 7,
placeholder: '请选择产品选择',
showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '产品列表',
apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
outputParams: [
{
name: 'cpbh',
tableTitle: '产品编号',
bindField: 'cpbh',
show: true,
width: 150,
component: 'b2682f1ff2dc48448211cacb4bf48bfd',
},
{
name: 'cpmc',
tableTitle: '产品名称',
bindField: 'cpmc',
show: true,
width: 150,
component: 'db0bea5c2dbf4505833e67179e8618f3',
},
{
name: 'gg',
tableTitle: '产品规格',
bindField: 'cpgg',
show: true,
width: 150,
component: '3e7491b6d43c4ef7a7b6c2fd49a94a7f',
},
{
name: 'xh',
tableTitle: '产品型号',
bindField: 'cpxh',
show: true,
width: 150,
component: 'cf7d04d1e6374a3fbc4a9dfb9ebdf19e',
},
],
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'b2682f1ff2dc48448211cacb4bf48bfd',
field: 'cpbh',
label: '产品编号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入产品编号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'db0bea5c2dbf4505833e67179e8618f3',
field: 'cpmc',
label: '产品名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入产品名称',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: '3e7491b6d43c4ef7a7b6c2fd49a94a7f',
field: 'cpgg',
label: '产品规格',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入产品规格',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'cf7d04d1e6374a3fbc4a9dfb9ebdf19e',
field: 'cpxh',
label: '产品型号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入产品型号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'd8387e383f7342f8b829cb672dad42cb',
field: 'sfyy',
label: '是否有效',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 1,
componentProps: {
span: 7,
defaultValue: 1,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
type: 1,
event: [],
style: {},
},
},
],
},
{
span: 24,
list: [
{
key: 'ccb91eb8f48b4ff3aaa1086f0adcd48e',
field: 'bz',
label: '备注',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 2,
defaultValue: '',
placeholder: '请输入备注',
rows: 4,
autoSize: false,
showCount: false,
disabled: false,
showLabel: true,
allowClear: false,
required: false,
isShow: true,
isShowAi: false,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
],
componentProps: {
gutter: 0,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
{
key: 'c87fc2d18e24429a819521f35f19137b',
label: 'BOM清单',
field: 'mesBaseBomItemList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'mesBaseBomItemList',
columns: [
{
key: '709b38c05d11468db0db4e6e9168e4f9',
title: '选择物料',
dataIndex: 'bomid',
componentType: 'MultiplePopup',
componentProps: {
popupType: 'associate',
width: '100%',
span: 3,
placeholder: '请选择物料选择',
showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '物料列表',
apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
outputParams: [
{
name: 'cpbh',
tableTitle: '物料编号',
bindField: 'wlbh',
show: true,
width: 150,
component: '3988d1cba45a464abbeabce6ed09970e',
bindTable: 'mes_base_bom_item',
},
{
name: 'cpmc',
tableTitle: '物料名称',
bindField: 'wlmc',
show: true,
width: 150,
component: '112f6292bd884006ad872f06aeef4e6f',
bindTable: 'mes_base_bom_item',
},
],
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
},
},
{
key: '3988d1cba45a464abbeabce6ed09970e',
title: '物料编号',
dataIndex: 'wlbh',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: 3,
defaultValue: '',
placeholder: '请输入物料编号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
},
},
{
key: '112f6292bd884006ad872f06aeef4e6f',
title: '物料名称',
dataIndex: 'wlmc',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: 3,
defaultValue: '',
placeholder: '请输入物料名称',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
},
},
{
key: '80fe637a2eaa47a49e96f6e86f0efdda',
title: '物料数量',
dataIndex: 'wlsl',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: 3,
min: 0,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
defaultValue: 0,
listStyle: "return 'width:100%'",
},
},
{
key: '1afa69530c154b6f904f1661e82ff9a3',
title: '库存数量',
dataIndex: 'wlkcl',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: 3,
min: 0,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
defaultValue: 0,
listStyle: "return 'width:100%'",
},
},
{
key: 'd15b4777d2794944995aa2a085442a6e',
title: '客户标准(%)',
dataIndex: 'khbz',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: 3,
min: 0,
max: 100,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
defaultValue: 0,
listStyle: "return 'width:100%'",
},
},
{
key: '1ef860d823ff46c690334dc5eff5a6e4',
title: '内控标准(%)',
dataIndex: 'nkbz',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: 3,
min: 0,
max: 100,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
defaultValue: 0,
listStyle: "return 'width:100%'",
},
},
{
key: '40a1e893e8ee496a96d7ed6dbe17e271',
title: '是否投料',
dataIndex: 'sftl',
componentType: 'Switch',
defaultValue: 1,
componentProps: {
span: '',
defaultValue: 1,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
},
},
{
key: '9230b500d1024028af68ed4ac49bdbd3',
title: '备注',
dataIndex: 'bz',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入备注',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
},
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
span: 2,
preloadType: 'dic',
apiConfig: {
path: '/scgl/wlqd/getAllBomItemList',
method: 'GET',
apiId: '1a6a0c6bab2a4aceaf761b0c2c8d17a0',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,wlmc as label from mes_base_bom_item where delete_mark=0';\r\nreturn db.select(sql)",
},
itemId: '',
dicOptions: [],
useSelectButton: false,
buttonName: '选择数据',
showLabel: true,
showComponentBorder: true,
showBorder: true,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
showIndex: false,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [
{
key: '112f6292bd884006ad872f06aeef4e6f',
label: '物料名称',
field: 'wlmc',
componentType: 'input',
checked: true,
},
{
key: '3988d1cba45a464abbeabce6ed09970e',
label: '物料编号',
field: 'wlbh',
componentType: 'input',
checked: true,
},
{
key: '80fe637a2eaa47a49e96f6e86f0efdda',
label: '物料数量',
field: 'wlsl',
componentType: 'number',
checked: true,
},
{
key: '1afa69530c154b6f904f1661e82ff9a3',
label: '库存数量',
field: 'wlkcl',
componentType: 'number',
checked: true,
},
{
key: 'd15b4777d2794944995aa2a085442a6e',
label: '客户标准(%)',
field: 'khbz',
componentType: 'number',
checked: true,
},
{
key: '1ef860d823ff46c690334dc5eff5a6e4',
label: '内控标准(%)',
field: 'nkbz',
componentType: 'number',
checked: true,
},
{
key: '9230b500d1024028af68ed4ac49bdbd3',
label: '备注',
field: 'bz',
componentType: 'input',
checked: true,
},
{
key: '40a1e893e8ee496a96d7ed6dbe17e271',
label: '是否投料',
field: 'sftl',
componentType: 'switch',
checked: false,
},
{
key: '709b38c05d11468db0db4e6e9168e4f9',
label: '选择物料',
field: 'bomid',
componentType: 'associate-popup',
checked: false,
},
],
isShowAdd: true,
isShowDelete: true,
hasCheckedCol: false,
events: {},
showPagenation: true,
rowResize: false,
},
},
],
showActionButtonGroup: false,
buttonLocation: 'center',
actionColOptions: { span: 24 },
showResetButton: false,
showSubmitButton: false,
hiddenComponent: [],
};
export const formButtons = [
{
key: 'confirm',
code: 'confirm',
name: '确定',
style: 'primary',
event: [],
isShow: true,
index: 2,
type: 1,
},
{
key: 'cancel',
code: 'cancel',
name: '取消',
style: 'default',
event: [],
isShow: true,
index: 1,
type: 1,
},
{
key: 'reset',
code: 'reset',
name: '重置',
style: 'default',
event: [],
isShow: true,
index: 0,
type: 1,
},
];
export const permissionList = [
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'BOM名称',
fieldId: 'bommc',
isSubTable: false,
showChildren: true,
type: 'input',
key: '0bb6edfef8ac486482e02a6e650306e6',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'BOM数量',
fieldId: 'bomsl',
isSubTable: false,
showChildren: true,
type: 'number',
key: '4bc74304a0144e879b2fc45ae28ab1c5',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'BOM版本',
fieldId: 'bombb',
isSubTable: false,
showChildren: true,
type: 'input',
key: '50bff2d4c82d40a98ace5fd2b1d3b41e',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '选择产品',
fieldId: 'cpid',
isSubTable: false,
showChildren: true,
type: 'associate-popup',
key: 'c42ef62f38e1445b89e5c3362ffd3af2',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品编号',
fieldId: 'cpbh',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'b2682f1ff2dc48448211cacb4bf48bfd',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品名称',
fieldId: 'cpmc',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'db0bea5c2dbf4505833e67179e8618f3',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品规格',
fieldId: 'cpgg',
isSubTable: false,
showChildren: true,
type: 'input',
key: '3e7491b6d43c4ef7a7b6c2fd49a94a7f',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品型号',
fieldId: 'cpxh',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'cf7d04d1e6374a3fbc4a9dfb9ebdf19e',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '是否有效',
fieldId: 'sfyy',
isSubTable: false,
showChildren: true,
type: 'switch',
key: 'd8387e383f7342f8b829cb672dad42cb',
children: [],
options: {},
defaultValue: 1,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'bz',
isSubTable: false,
showChildren: true,
type: 'textarea',
key: 'ccb91eb8f48b4ff3aaa1086f0adcd48e',
children: [],
options: {},
defaultValue: '',
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: 'BOM清单',
fieldId: 'mesBaseBomItemList',
type: 'form',
key: 'c87fc2d18e24429a819521f35f19137b',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '选择物料',
fieldId: 'bomid',
type: 'MultiplePopup',
key: '709b38c05d11468db0db4e6e9168e4f9',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '物料编号',
fieldId: 'wlbh',
type: 'Input',
key: '3988d1cba45a464abbeabce6ed09970e',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '物料名称',
fieldId: 'wlmc',
type: 'Input',
key: '112f6292bd884006ad872f06aeef4e6f',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '物料数量',
fieldId: 'wlsl',
type: 'InputNumber',
key: '80fe637a2eaa47a49e96f6e86f0efdda',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '库存数量',
fieldId: 'wlkcl',
type: 'InputNumber',
key: '1afa69530c154b6f904f1661e82ff9a3',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '客户标准(%)',
fieldId: 'khbz',
type: 'InputNumber',
key: 'd15b4777d2794944995aa2a085442a6e',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '内控标准(%)',
fieldId: 'nkbz',
type: 'InputNumber',
key: '1ef860d823ff46c690334dc5eff5a6e4',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '是否投料',
fieldId: 'sftl',
type: 'Switch',
key: '40a1e893e8ee496a96d7ed6dbe17e271',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesBaseBomItemList',
fieldName: '备注',
fieldId: 'bz',
type: 'Input',
key: '9230b500d1024028af68ed4ac49bdbd3',
children: [],
},
],
},
];
<template>
<ResizePageWrapper :hasLeft="false">
<template #resizeRight>
<BasicTable @register="registerTable" isMenuTable ref="tableRef"
>
<template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" type="primary" @click="buttonClick(button.code)">
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
<CustomButtonModal v-else-if="button.buttonType == 'modal'" :info="button" />
<a-button v-else :type="button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'" :danger="button.buttonType === 'danger'" >
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.componentType === 'switch'">
<a-switch
v-model:checked="record[column.dataIndex]"
:unCheckedValue="0"
:checkedValue="1"
:disabled="true"
/>
</template>
<template v-if="column.dataIndex === 'action'">
<TableAction
:actions="getLessActions(record)"
:dropDownActions="getMoreActions(record)"
/>
</template>
<template v-else-if="column.dataIndex && column?.listStyle">
<span :style="executeListStyle(getValue(record, column, 'style'), column?.listStyle)">{{
getValue(record, column, 'value')
}}</span>
</template>
</template>
</BasicTable>
</template>
<WlqdModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed,provide,Ref, createVNode,
} from 'vue';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesBaseBomPage, deleteMesBaseBom} from '/@/api/jcsj/wlqd';
import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置
import { useRouter } from 'vue-router';
import { useModal } from '/@/components/Modal';
import WlqdModal from './components/WlqdModal.vue';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
const pageParamsInfo = ref<any>({});
const { enableLockeData,handleOpenFormEnableLockeData, handleCloseFormEnableLocke, handleHasEnableLocke } =
useConcurrentLock();
const { notification } = useMessage();
const { t } = useI18n();
defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth, hasPermission } = usePermission();
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
//展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"buttonId":"2006204718531538944","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2006204718531538945","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2006204718531538946","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2006204718531538947","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list);
})
const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
});
const actionButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {view : handleView,add : handleAdd,edit : handleEdit,delete : handleDelete,}
const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef);
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, }] = useTable({
title: 'Wlqd列表',
api: getMesBaseBomPage,
rowKey: 'id',
columns: filterColumns,
pagination: {
pageSize: 10,
},
formConfig: {
labelWidth: 100,
schemas: searchFormSchema,
fieldMapToTime: [],
showResetButton: false,
},
bordered:false,
beforeFetch: (params) => {
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
return pageParamsInfo.value;
},
afterFetch: (res) => {
},
useSearchForm: true,
showTableSetting: true,
striped: false,
actionColumn: {
width: 195,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
tableSetting: {
size: false,
},
customRow,
isAdvancedQuery: false,
querySelectOption: JSON.stringify(searchFormSchema),
objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值
});
function buttonClick(code) {
btnEvent[code]();
}
function handleAdd() {
openModal(true, { isUpdate: false, });
}
async function handleEdit(record: Recordable) {
let field = 'id';
try {
let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit');
if (hasIn) {
let res = await handleOpenFormEnableLockeData(
record[field],
formIdComputedRef.value,
);
if (res !== null) {
return;
}
}
let info = {
id: record[field],
isUpdate: true,
};
openModal(true, info);
} catch (error) {}
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认删除?',
okText: '确认',
cancelText: '取消',
onOk() {
deleteMesBaseBom(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
});
},
onCancel() {},
});
}
function customRow(record: Recordable) {
return {
ondblclick: () => {
if (record.isCanEdit && hasPermission("wlqd:edit")) {
handleEdit(record);
}
},
};
}
function handleSuccess() {
reload();
}
function handleFormSuccess() {
handleSuccess();
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleFormCancel() {
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleView(record: Recordable) {
let info={
isView: true,
id: record.id,
}
openModal(true, info);
}
function getLessActions(record: Recordable) {
let list = getActions(record);
return list.slice(0, listSpliceNum.value);
}
function getMoreActions(record: Recordable) {
let list = getActions(record);
return list.slice(listSpliceNum.value);
}
function getActions(record: Recordable):ActionItem[] {
record.isCanEdit = false;
let actionsList: ActionItem[] = [];
actionButtonConfig.value?.map((button) => {
if (!record?.workflowData?.processId) {
record.isCanEdit = true;
actionsList.push({
...button,
auth: `wlqd:${button.code}`,
label: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code]?.bind(null, record),
});
} else {
if (!['edit', 'delete'].includes(button.code)) {
actionsList.push({
auth: `wlqd:${button.code}`,
label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record),
});
}
}
});
return actionsList;
}
</script>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
width: 50px;
}
.show{
display: flex;
}
.hide{
display: none !important;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment