Commit 07a92d0a by 张恒

feat(jcsj): 更新工艺管理配置和生产计划组件

- 添加额定工时字段配置
- 修改产品物料相关字段映射关系
- 调整工作流权限配置中的字段定义
- 更新生产计划产品列表组件配置
- 修改表单模型中字段名称映射逻辑
parent f6b76856
...@@ -26,6 +26,8 @@ export interface RokeProcessPageModel { ...@@ -26,6 +26,8 @@ export interface RokeProcessPageModel {
categoryId: string; categoryId: string;
collectionSchemeId: string; collectionSchemeId: string;
ratedWorkingHours: string;
} }
/** /**
...@@ -118,60 +120,26 @@ export interface RokeProcessModel { ...@@ -118,60 +120,26 @@ export interface RokeProcessModel {
zyzdtpFile: string; zyzdtpFile: string;
mesProcessItemList?: MesProcessItemModel;
mesProcessProductList?: MesProcessProductModel; mesProcessProductList?: MesProcessProductModel;
mesProcessSchemeList?: MesProcessSchemeModel;
} }
/** /**
* @description: MesProcessItem表类型 * @description: MesProcessProduct表类型
*/ */
export interface MesProcessItemModel { export interface MesProcessProductModel {
id: string; id: string;
processId: string; deleteMark: string;
code: string;
name: string;
required: string;
categoryId: string;
contentType: string;
dataType: string;
dictId: string;
relatedModelId: string;
relatedModelName: string;
relatedModelDomain: string;
standardValue: string;
upperValue: string;
lowerValue: string;
note: string;
companyId: string;
qualityCategoryId: string;
analysisMethod: string;
qualityMethodId: string; productId: string;
destructive: string; processId: string;
keyItem: string; erpid: string;
deleteMark: string; bz: string;
createDate: string; createDate: string;
...@@ -180,67 +148,27 @@ export interface MesProcessItemModel { ...@@ -180,67 +148,27 @@ export interface MesProcessItemModel {
modifyDate: string; modifyDate: string;
modifyUserId: string; modifyUserId: string;
isFeeding: string;
number: string;
} }
/** /**
* @description: MesProcessProduct表类型 * @description: MesProcessScheme表类型
*/ */
export interface MesProcessProductModel { export interface MesProcessSchemeModel {
id: string; id: string;
deleteMark: string; processId: string;
cpbh: string;
cpmc: string;
nbdm: string;
hjzt: string;
cptp: string;
kxs: string;
kcg: string;
wllx: string;
cplx: string;
gg: string;
xh: string;
fpl: string;
bzzl: string;
erpid: string;
zygf: string;
bz: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string; collectionSchemeId: string;
p8: string; required: string;
p9: string; note: string;
p10: string; deleteMark: string;
createDate: string; createDate: string;
...@@ -249,12 +177,6 @@ export interface MesProcessProductModel { ...@@ -249,12 +177,6 @@ export interface MesProcessProductModel {
modifyDate: string; modifyDate: string;
modifyUserId: string; modifyUserId: string;
processId: string;
isFeeding: string;
number: string;
} }
/** /**
......
...@@ -110,6 +110,19 @@ export const columns: BasicColumn[] = [ ...@@ -110,6 +110,19 @@ export const columns: BasicColumn[] = [
styleConfig: undefined, styleConfig: undefined,
listStyle: undefined, listStyle: undefined,
}, },
{
resizable: true,
dataIndex: 'ratedWorkingHours',
title: '额定工时',
componentType: 'number',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
]; ];
//表头合并配置 //表头合并配置
export const headerMergingData = []; export const headerMergingData = [];
...@@ -532,9 +545,40 @@ export const formProps: FormProps = { ...@@ -532,9 +545,40 @@ export const formProps: FormProps = {
mainKey: 'mesProcessProductList', mainKey: 'mesProcessProductList',
columns: [ columns: [
{ {
key: '6e053d43971d4157b0f9118f9cbbb4bb',
title: '产品物料id',
dataIndex: 'productId',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '00c0e93b675841f48265b896515a5241', key: '00c0e93b675841f48265b896515a5241',
title: '编号', title: '编号',
dataIndex: 'cpbh', dataIndex: 'bianHao3907',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -553,7 +597,7 @@ export const formProps: FormProps = { ...@@ -553,7 +597,7 @@ export const formProps: FormProps = {
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: false, isSave: true,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
...@@ -564,7 +608,7 @@ export const formProps: FormProps = { ...@@ -564,7 +608,7 @@ export const formProps: FormProps = {
{ {
key: '91863c5a0ec24d76ade8735cd401059b', key: '91863c5a0ec24d76ade8735cd401059b',
title: '名称', title: '名称',
dataIndex: 'cpmc', dataIndex: 'mingChen2461',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -583,7 +627,7 @@ export const formProps: FormProps = { ...@@ -583,7 +627,7 @@ export const formProps: FormProps = {
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: false, isSave: true,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
...@@ -636,27 +680,32 @@ export const formProps: FormProps = { ...@@ -636,27 +680,32 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '1084a7c39baf47ba9a0251cb4e2f8c14', key: '86ad9fb6998c4d0ea8e11ed0ef6585cb',
title: '备注', title: '备注',
dataIndex: 'bz', dataIndex: 'beiZhu7713',
componentType: 'InputTextArea', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入备注', placeholder: '',
rows: 2, prefix: '',
autoSize: false, suffix: '',
showCount: false, addonBefore: '',
disabled: false, addonAfter: '',
showLabel: true, disabled: true,
allowClear: false, allowClear: false,
showLabel: true,
required: false, required: false,
isShow: true,
isShowAi: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '',
isSave: true,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
}, },
}, },
...@@ -701,18 +750,18 @@ export const formProps: FormProps = { ...@@ -701,18 +750,18 @@ export const formProps: FormProps = {
{ {
key: '3fd474ce5f8c4bf78bd86dc701cbdc4f', key: '3fd474ce5f8c4bf78bd86dc701cbdc4f',
label: '', label: '',
field: 'mesProcessItemList', field: 'mesProcessSchemeList',
type: 'form', type: 'form',
component: 'SubForm', component: 'SubForm',
required: true, required: true,
colProps: { span: 24 }, colProps: { span: 24 },
componentProps: { componentProps: {
mainKey: 'mesProcessItemList', mainKey: 'mesProcessSchemeList',
columns: [ columns: [
{ {
key: '3999831fde0a4e879f64f33eb2a1edd1', key: '3999831fde0a4e879f64f33eb2a1edd1',
title: '编码', title: '编码',
dataIndex: 'code', dataIndex: 'bianMa8881',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -724,14 +773,14 @@ export const formProps: FormProps = { ...@@ -724,14 +773,14 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: false, disabled: true,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: false, isSave: true,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
...@@ -742,7 +791,7 @@ export const formProps: FormProps = { ...@@ -742,7 +791,7 @@ export const formProps: FormProps = {
{ {
key: 'ab6576e960ee44b4af09975e64088f05', key: 'ab6576e960ee44b4af09975e64088f05',
title: '名称', title: '名称',
dataIndex: 'name', dataIndex: 'mingChen4867',
componentType: 'Input', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
...@@ -754,14 +803,14 @@ export const formProps: FormProps = { ...@@ -754,14 +803,14 @@ export const formProps: FormProps = {
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: false, disabled: true,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: false, isSave: true,
isShow: true, isShow: true,
scan: false, scan: false,
bordered: true, bordered: true,
...@@ -770,85 +819,92 @@ export const formProps: FormProps = { ...@@ -770,85 +819,92 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '745cb3bb014d4dd9ba38139d17b2f305', key: 'f086101bc78b4471b3cb95b3970c368e',
title: '数据类型', title: '数据类型',
dataIndex: 'dataType', dataIndex: 'mingChen3506',
componentType: 'XjrSelect', componentType: 'Input',
defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
span: '', span: '',
defaultValue: '',
placeholder: '', placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true, showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
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' },
],
datasourceType: 'dic',
params: { itemId: '2004076331787718658' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '',
isSave: true,
isShow: true, isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2004076331787718658',
listStyle: "return 'border: 0'",
}, },
}, },
{ {
key: '36a40652260d491e8a088ff843aab982', key: '5d40e3c7f274461aba1f041c5f33c13d',
title: '是否必填', title: '是否必填',
dataIndex: 'required', dataIndex: 'mingChen6235',
componentType: 'Switch', componentType: 'Input',
defaultValue: 0, defaultValue: '',
componentProps: { componentProps: {
width: '100%',
span: '', span: '',
defaultValue: 0, defaultValue: '',
checkedChildren: '', placeholder: '',
unCheckedChildren: '', prefix: '',
checkedColor: '#1C8DFF', suffix: '',
unCheckedColor: '#bbbdbf', addonBefore: '',
addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true, showLabel: true,
disabled: false, required: false,
rules: [],
events: {}, events: {},
listStyle: '',
isSave: true,
isShow: true, isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
}, },
}, },
{ {
key: 'f3ba1f809888475d925665668e2a1851', key: '7674096c8feb431a8689c584a93c5b8a',
title: '备注', title: '备注',
dataIndex: 'note', dataIndex: 'beiZhu2454',
componentType: 'InputTextArea', componentType: 'Input',
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '', placeholder: '',
rows: 2, prefix: '',
autoSize: false, suffix: '',
showCount: false, addonBefore: '',
disabled: false, addonAfter: '',
showLabel: true, disabled: true,
allowClear: false, allowClear: false,
showLabel: true,
required: false, required: false,
isShow: true,
isShowAi: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '',
isSave: true,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
}, },
}, },
......
...@@ -155,8 +155,23 @@ export const permissionList = [ ...@@ -155,8 +155,23 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProcessProductList', tableName: 'mesProcessProductList',
fieldName: '产品物料id',
fieldId: 'productId',
type: 'Input',
key: '6e053d43971d4157b0f9118f9cbbb4bb',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '编号', fieldName: '编号',
fieldId: 'cpbh', fieldId: 'bianHao3907',
type: 'Input', type: 'Input',
key: '00c0e93b675841f48265b896515a5241', key: '00c0e93b675841f48265b896515a5241',
children: [], children: [],
...@@ -171,7 +186,7 @@ export const permissionList = [ ...@@ -171,7 +186,7 @@ export const permissionList = [
showChildren: false, showChildren: false,
tableName: 'mesProcessProductList', tableName: 'mesProcessProductList',
fieldName: '名称', fieldName: '名称',
fieldId: 'cpmc', fieldId: 'mingChen2461',
type: 'Input', type: 'Input',
key: '91863c5a0ec24d76ade8735cd401059b', key: '91863c5a0ec24d76ade8735cd401059b',
children: [], children: [],
...@@ -216,9 +231,9 @@ export const permissionList = [ ...@@ -216,9 +231,9 @@ export const permissionList = [
showChildren: false, showChildren: false,
tableName: 'mesProcessProductList', tableName: 'mesProcessProductList',
fieldName: '备注', fieldName: '备注',
fieldId: 'bz', fieldId: 'beiZhu7713',
type: 'InputTextArea', type: 'Input',
key: '1084a7c39baf47ba9a0251cb4e2f8c14', key: '86ad9fb6998c4d0ea8e11ed0ef6585cb',
children: [], children: [],
}, },
], ],
...@@ -230,9 +245,9 @@ export const permissionList = [ ...@@ -230,9 +245,9 @@ export const permissionList = [
disabled: false, disabled: false,
isSubTable: true, isSubTable: true,
showChildren: false, showChildren: false,
tableName: 'mesProcessItemList', tableName: 'mesProcessSchemeList',
fieldName: '', fieldName: '',
fieldId: 'mesProcessItemList', fieldId: 'mesProcessSchemeList',
type: 'form', type: 'form',
key: '3fd474ce5f8c4bf78bd86dc701cbdc4f', key: '3fd474ce5f8c4bf78bd86dc701cbdc4f',
children: [ children: [
...@@ -244,9 +259,9 @@ export const permissionList = [ ...@@ -244,9 +259,9 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProcessItemList', tableName: 'mesProcessSchemeList',
fieldName: '编码', fieldName: '编码',
fieldId: 'code', fieldId: 'bianMa8881',
type: 'Input', type: 'Input',
key: '3999831fde0a4e879f64f33eb2a1edd1', key: '3999831fde0a4e879f64f33eb2a1edd1',
children: [], children: [],
...@@ -259,9 +274,9 @@ export const permissionList = [ ...@@ -259,9 +274,9 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProcessItemList', tableName: 'mesProcessSchemeList',
fieldName: '名称', fieldName: '名称',
fieldId: 'name', fieldId: 'mingChen4867',
type: 'Input', type: 'Input',
key: 'ab6576e960ee44b4af09975e64088f05', key: 'ab6576e960ee44b4af09975e64088f05',
children: [], children: [],
...@@ -274,11 +289,11 @@ export const permissionList = [ ...@@ -274,11 +289,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProcessItemList', tableName: 'mesProcessSchemeList',
fieldName: '数据类型', fieldName: '数据类型',
fieldId: 'dataType', fieldId: 'mingChen3506',
type: 'XjrSelect', type: 'Input',
key: '745cb3bb014d4dd9ba38139d17b2f305', key: 'f086101bc78b4471b3cb95b3970c368e',
children: [], children: [],
}, },
{ {
...@@ -289,11 +304,11 @@ export const permissionList = [ ...@@ -289,11 +304,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProcessItemList', tableName: 'mesProcessSchemeList',
fieldName: '是否必填', fieldName: '是否必填',
fieldId: 'required', fieldId: 'mingChen6235',
type: 'Switch', type: 'Input',
key: '36a40652260d491e8a088ff843aab982', key: '5d40e3c7f274461aba1f041c5f33c13d',
children: [], children: [],
}, },
{ {
...@@ -304,11 +319,11 @@ export const permissionList = [ ...@@ -304,11 +319,11 @@ export const permissionList = [
isSubTable: false, isSubTable: false,
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProcessItemList', tableName: 'mesProcessSchemeList',
fieldName: '备注', fieldName: '备注',
fieldId: 'note', fieldId: 'beiZhu2454',
type: 'InputTextArea', type: 'Input',
key: 'f3ba1f809888475d925665668e2a1851', key: '7674096c8feb431a8689c584a93c5b8a',
children: [], children: [],
}, },
], ],
......
...@@ -6,232 +6,219 @@ ...@@ -6,232 +6,219 @@
:formProps="data.formDataProps" :formProps="data.formDataProps"
:formModel="state.formModel" :formModel="state.formModel"
:isWorkFlow="props.fromPage!=FromPageType.MENU" :isWorkFlow="props.fromPage!=FromPageType.MENU"
:isCamelCase="true" :isCamelCase="true"
@model-change="handleChange" @model-change="handleChange"
/> />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, ref, onMounted, nextTick, watch } from 'vue'; import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config'; import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue'; import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addMesProductionPlan, getMesProductionPlan, updateMesProductionPlan } from '/@/api/scgl/scjh'; import { addMesProductionPlan, getMesProductionPlan, updateMesProductionPlan } from '/@/api/scgl/scjh';
import { cloneDeep, isString } from 'lodash-es'; import { cloneDeep, isString } from 'lodash-es';
import { FormDataProps } from '/@/components/Designer/src/types'; import { FormDataProps } from '/@/components/Designer/src/types';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue'; import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { FromPageType } from '/@/enums/workflowEnum'; import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent'; import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm'; import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig'; import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
const { filterFormSchemaAuth } = usePermission();
const { filterFormSchemaAuth } = usePermission(); const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']);
const RowKey = 'id'; const props = defineProps({
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']); fromPage: {
const props = defineProps({ type: Number,
fromPage: { default: FromPageType.MENU,
type: Number, },
default: FromPageType.MENU, });
}, const systemFormRef = ref();
}); const data: { formDataProps: FormDataProps } = reactive({
const systemFormRef = ref(); formDataProps: cloneDeep(formProps),
const data: { formDataProps: FormDataProps } = reactive({ });
formDataProps: cloneDeep(formProps), const state = reactive({
}); formModel: {},
const state = reactive({ formInfo:{formId:'',formName:''}
formModel: {}, });
formInfo:{formId:'',formName:''} const { currentRoute } = useRouter();
}); watch(
const { currentRoute } = useRouter(); () => state.formModel,
watch( (val) => {
() => state.formModel, emits('update:value', val);
(val) => { },
emits('update:value', val); {
}, deep: true,
{ },
deep: true, );
},
); onMounted(async () => {
try {
onMounted(async () => { if (props.fromPage == FromPageType.MENU) {
try { setMenuPermission();
if (props.fromPage == FromPageType.MENU) { if(currentRoute.value.meta){
setMenuPermission(); state.formInfo.formName = currentRoute.value.meta.title&&isString(currentRoute.value.meta.title)?currentRoute.value.meta.title:'';
if(currentRoute.value.meta){ state.formInfo.formId = currentRoute.value.meta.formId&&isString(currentRoute.value.meta.formId)?currentRoute.value.meta.formId:'';
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); //表单事件:加载表单
} }
await createFormEvent(formEventConfigs, state.formModel, } catch (error) {}
systemFormRef.value, });
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 // 根据菜单页面权限,设置表单属性(必填,禁用,显示)
await nextTick(); function setMenuPermission() {
await loadFormEvent(formEventConfigs, state.formModel, data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
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 通过返回表单数据 // 校验form 通过返回表单数据
async function validate() { async function validate() {
let values = []; let values = [];
try { try {
values = await systemFormRef.value?.validate(); values = await systemFormRef.value?.validate();
//添加隐藏组件 //添加隐藏组件
if (data.formDataProps.hiddenComponent?.length) { if (data.formDataProps.hiddenComponent?.length) {
data.formDataProps.hiddenComponent.forEach((component) => { data.formDataProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value; values[component.bindField] = component.value;
}); });
}
} finally {
} }
} finally { return values;
} }
return values; // 根据行唯一ID查询行数据,并设置表单数据 【编辑】
} async function setFormDataFromId(rowId) {
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】 try {
async function setFormDataFromId(rowId) {
try {
const record = await getMesProductionPlan(rowId); const record = await getMesProductionPlan(rowId);
// 处理 mesProductionPlanProductList 字段映射 setFieldsValue(record);
if (record.mesProductionPlanProductList && Array.isArray(record.mesProductionPlanProductList)) { state.formModel = record;
record.mesProductionPlanProductList = record.mesProductionPlanProductList.map((item) => { await getFormDataEvent(formEventConfigs, state.formModel,
return { systemFormRef.value,
...item, formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据
wuLiaoBianHao8001: item.cpbh || item.wuLiaoBianHao8001, // 物料编号 } catch (error) {
naBuDaiMa1765: item.nbdm || item.naBuDaiMa1765, // 内部代码
xingHao5094: item.xh || item.xingHao5094, // 型号
heJinZhuangTai4056: item.hjzt || item.heJinZhuangTai4056, // 合金状态 (兼容 hzjt 和 hjzt)
'guiGe(ChiCun)9562': item.gg || item['guiGe(ChiCun)9562'], // 规格(尺寸)
};
});
} }
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() {
async function getFieldsValue() { let values = [];
let values = []; try {
try { values = await systemFormRef.value?.getFieldsValue();
values = await systemFormRef.value?.getFieldsValue(); //添加隐藏组件
//添加隐藏组件 if (data.formDataProps.hiddenComponent?.length) {
if (data.formDataProps.hiddenComponent?.length) { data.formDataProps.hiddenComponent.forEach((component) => {
data.formDataProps.hiddenComponent.forEach((component) => { values[component.bindField] = component.value;
values[component.bindField] = component.value; });
}); }
} finally {
} }
} finally { return values;
}
// 辅助设置表单数据
function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record);
} }
return values; // 重置表单数据
} async function resetFields() {
// 辅助设置表单数据 await systemFormRef.value.resetFields();
function setFieldsValue(record) { }
systemFormRef.value.setFieldsValue(record); // 设置表单数据全部为Disabled 【查看】
} async function setDisabledForm( ) {
// 重置表单数据 data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
async function resetFields() { }
await systemFormRef.value.resetFields(); // 获取行键值
} function getRowKey() {
// 设置表单数据全部为Disabled 【查看】 return RowKey;
async function setDisabledForm( ) { }
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas)); // 更新api表单数据
} async function update({ values, rowId }) {
// 获取行键值 try {
function getRowKey() { values[RowKey] = rowId;
return RowKey; state.formModel = values;
} let saveVal = await updateMesProductionPlan(values);
// 更新api表单数据 await submitFormEvent(formEventConfigs, state.formModel,
async function update({ values, rowId }) { systemFormRef.value,
try { formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
values[RowKey] = rowId; return saveVal;
state.formModel = values; } catch (error) {}
let saveVal = await updateMesProductionPlan(values); }
await submitFormEvent(formEventConfigs, state.formModel, // 新增api表单数据
async function add(values) {
try {
state.formModel = values;
let saveVal = await addMesProductionPlan(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, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
return saveVal; await loadFormEvent(formEventConfigs, state.formModel,
} catch (error) {}
}
// 新增api表单数据
async function add(values) {
try {
state.formModel = values;
let saveVal = await addMesProductionPlan(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
return saveVal; }
} catch (error) {} function handleChange(val) {
} emits('update:value', val);
// 根据工作流页面权限,设置表单属性(必填,禁用,显示) }
async function setWorkFlowForm(obj: WorkFlowFormParams) { async function sendMessageForAllIframe() {
try { try {
if (obj.formId) state.formInfo.formId = obj.formId; if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
if (obj.formName) state.formInfo.formName = obj.formName; systemFormRef.value.sendMessageForAllIframe();
let flowData = await changeWorkFlowForm(cloneDeep(formProps), obj); }
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData; } catch (error) {}
data.formDataProps = buildOptionJson; }
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】 defineExpose({
if (isViewProcess) { setFieldsValue,
setDisabledForm(); //查看 resetFields,
} validate,
state.formModel = formModels; add,
setFieldsValue(formModels); update,
} catch (error) {} setFormDataFromId,
await createFormEvent(formEventConfigs, state.formModel, setDisabledForm,
systemFormRef.value, setMenuPermission,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 setWorkFlowForm,
await loadFormEvent(formEventConfigs, state.formModel, getRowKey,
systemFormRef.value, getFieldsValue,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 sendMessageForAllIframe
} });
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> </script>
...@@ -487,6 +487,36 @@ export const formProps: FormProps = { ...@@ -487,6 +487,36 @@ export const formProps: FormProps = {
mainKey: 'mesProductionPlanProductList', mainKey: 'mesProductionPlanProductList',
columns: [ columns: [
{ {
key: '0b5e3de2d92f4a1cba6a650cff672653',
title: 'id',
dataIndex: 'id',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入id',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '416cd1b15c314d0dafaf6fc91e3f4653', key: '416cd1b15c314d0dafaf6fc91e3f4653',
title: '产品选择', title: '产品选择',
dataIndex: 'cpid', dataIndex: 'cpid',
......
...@@ -156,6 +156,21 @@ export const permissionList = [ ...@@ -156,6 +156,21 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProductionPlanProductList', tableName: 'mesProductionPlanProductList',
fieldName: 'id',
fieldId: 'id',
type: 'Input',
key: '0b5e3de2d92f4a1cba6a650cff672653',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProductionPlanProductList',
fieldName: '产品选择', fieldName: '产品选择',
fieldId: 'cpid', fieldId: 'cpid',
type: 'MultiplePopup', type: 'MultiplePopup',
......
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