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: [],
}, },
], ],
......
...@@ -12,40 +12,40 @@ ...@@ -12,40 +12,40 @@
</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 RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']); const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']);
const props = defineProps({ const props = defineProps({
fromPage: { fromPage: {
type: Number, type: Number,
default: FromPageType.MENU, default: FromPageType.MENU,
}, },
}); });
const systemFormRef = ref(); const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({ const data: { formDataProps: FormDataProps } = reactive({
formDataProps: cloneDeep(formProps), formDataProps: cloneDeep(formProps),
}); });
const state = reactive({ const state = reactive({
formModel: {}, formModel: {},
formInfo:{formId:'',formName:''} formInfo:{formId:'',formName:''}
}); });
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
watch( watch(
() => state.formModel, () => state.formModel,
(val) => { (val) => {
emits('update:value', val); emits('update:value', val);
...@@ -53,9 +53,9 @@ watch( ...@@ -53,9 +53,9 @@ watch(
{ {
deep: true, deep: true,
}, },
); );
onMounted(async () => { onMounted(async () => {
try { try {
if (props.fromPage == FromPageType.MENU) { if (props.fromPage == FromPageType.MENU) {
setMenuPermission(); setMenuPermission();
...@@ -86,14 +86,14 @@ onMounted(async () => { ...@@ -86,14 +86,14 @@ onMounted(async () => {
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
} }
} catch (error) {} } catch (error) {}
}); });
// 根据菜单页面权限,设置表单属性(必填,禁用,显示) // 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() { function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!); 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();
...@@ -106,24 +106,11 @@ async function validate() { ...@@ -106,24 +106,11 @@ async function validate() {
} finally { } finally {
} }
return values; return values;
} }
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】 // 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) { async function setFormDataFromId(rowId) {
try { try {
const record = await getMesProductionPlan(rowId); const record = await getMesProductionPlan(rowId);
// 处理 mesProductionPlanProductList 字段映射
if (record.mesProductionPlanProductList && Array.isArray(record.mesProductionPlanProductList)) {
record.mesProductionPlanProductList = record.mesProductionPlanProductList.map((item) => {
return {
...item,
wuLiaoBianHao8001: item.cpbh || item.wuLiaoBianHao8001, // 物料编号
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); setFieldsValue(record);
state.formModel = record; state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel, await getFormDataEvent(formEventConfigs, state.formModel,
...@@ -132,9 +119,9 @@ async function setFormDataFromId(rowId) { ...@@ -132,9 +119,9 @@ async function setFormDataFromId(rowId) {
} catch (error) { } catch (error) {
} }
} }
// 辅助返回表单数据 // 辅助返回表单数据
async function getFieldsValue() { async function getFieldsValue() {
let values = []; let values = [];
try { try {
values = await systemFormRef.value?.getFieldsValue(); values = await systemFormRef.value?.getFieldsValue();
...@@ -147,25 +134,25 @@ async function getFieldsValue() { ...@@ -147,25 +134,25 @@ async function getFieldsValue() {
} finally { } finally {
} }
return values; return values;
} }
// 辅助设置表单数据 // 辅助设置表单数据
function setFieldsValue(record) { function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record); systemFormRef.value.setFieldsValue(record);
} }
// 重置表单数据 // 重置表单数据
async function resetFields() { async function resetFields() {
await systemFormRef.value.resetFields(); await systemFormRef.value.resetFields();
} }
// 设置表单数据全部为Disabled 【查看】 // 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) { async function setDisabledForm( ) {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas)); data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
} }
// 获取行键值 // 获取行键值
function getRowKey() { function getRowKey() {
return RowKey; return RowKey;
} }
// 更新api表单数据 // 更新api表单数据
async function update({ values, rowId }) { async function update({ values, rowId }) {
try { try {
values[RowKey] = rowId; values[RowKey] = rowId;
state.formModel = values; state.formModel = values;
...@@ -175,9 +162,9 @@ async function update({ values, rowId }) { ...@@ -175,9 +162,9 @@ async function update({ values, rowId }) {
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
// 新增api表单数据 // 新增api表单数据
async function add(values) { async function add(values) {
try { try {
state.formModel = values; state.formModel = values;
let saveVal = await addMesProductionPlan(values); let saveVal = await addMesProductionPlan(values);
...@@ -186,9 +173,9 @@ async function add(values) { ...@@ -186,9 +173,9 @@ async function add(values) {
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
// 根据工作流页面权限,设置表单属性(必填,禁用,显示) // 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) { async function setWorkFlowForm(obj: WorkFlowFormParams) {
try { try {
if (obj.formId) state.formInfo.formId = obj.formId; if (obj.formId) state.formInfo.formId = obj.formId;
if (obj.formName) state.formInfo.formName = obj.formName; if (obj.formName) state.formInfo.formName = obj.formName;
...@@ -208,18 +195,18 @@ async function setWorkFlowForm(obj: WorkFlowFormParams) { ...@@ -208,18 +195,18 @@ async function setWorkFlowForm(obj: WorkFlowFormParams) {
await loadFormEvent(formEventConfigs, state.formModel, await loadFormEvent(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); //表单事件:加载表单
} }
function handleChange(val) { function handleChange(val) {
emits('update:value', val); emits('update:value', val);
} }
async function sendMessageForAllIframe() { async function sendMessageForAllIframe() {
try { try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) { if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
systemFormRef.value.sendMessageForAllIframe(); systemFormRef.value.sendMessageForAllIframe();
} }
} catch (error) {} } catch (error) {}
} }
defineExpose({ defineExpose({
setFieldsValue, setFieldsValue,
resetFields, resetFields,
validate, validate,
...@@ -232,6 +219,6 @@ defineExpose({ ...@@ -232,6 +219,6 @@ defineExpose({
getRowKey, getRowKey,
getFieldsValue, getFieldsValue,
sendMessageForAllIframe 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