diff --git a/src/views/eam/device/devicemaintainjob/index.vue b/src/views/eam/device/devicemaintainjob/index.vue index 2d27088..a58af6c 100644 --- a/src/views/eam/device/devicemaintainjob/index.vue +++ b/src/views/eam/device/devicemaintainjob/index.vue @@ -192,8 +192,6 @@ const HeadButttondata = [ const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 - DeviceMaintainOrderMain.allSchemas.formSchema[3].value = 'DEVICE' - DeviceMaintainOrderMain.allSchemas.formSchema[0].componentProps.disabled = false openForm('create') } else if (val == 'import') { // 导入 @@ -247,8 +245,6 @@ const butttondata = (row) => { } const onChange = (field, cur, item) => { if (field == 'deviceNumber') { - // DeviceMaintainOrderMain.allSchemas.formSchema[1].componentProps.disabled = true - // DeviceMaintainOrderMain.allSchemas.formSchema[2].componentProps.disabled = true formRef.value.formRef.formModel.factoryAreaNumber =String(item.componentProps.options.find((item) => item.number == cur).factoryAreaNumber) console.log(typeof formRef.value.formRef.formModel.factoryAreaNumber) // console.log(item) @@ -258,11 +254,9 @@ const onChange = (field, cur, item) => { } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - DeviceMaintainOrderMain.allSchemas.formSchema[0].componentProps.disabled = false if (val == 'edit') { // 编辑 openForm('update', row) - DeviceMaintainOrderMain.allSchemas.formSchema[0].componentProps.disabled = true } else if (val == 'delete') { // 删除 handleDelete(row.id) diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index bfaa2b4..ed201ac 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -298,8 +298,12 @@ const HeadButttondata = [ const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 - DeviceMaintenanceMain.allSchemas.formSchema[3].value = 'DEVICE' - DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false + DeviceMaintenanceMain.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.disabled = false + DeviceMaintenanceMain.allSchemas.formSchema.find(item => { + return item.field == 'type' + }).value = 'DEVICE' DeviceMaintenanceMain.allSchemas.formSchema.find(item => { return item.field == 'type' }).componentProps.options = deviceTypeList @@ -358,8 +362,6 @@ const butttondata = (row) => { } const onChange = (field, cur, item) => { if (field == 'deviceNumber') { - // DeviceMaintenanceMain.allSchemas.formSchema[1].componentProps.disabled = true - // DeviceMaintenanceMain.allSchemas.formSchema[2].componentProps.disabled = true formRef.value.formRef.formModel.factoryAreaNumber =String(item.componentProps.options.find((item) => item.number == cur).factoryAreaNumber) console.log(typeof formRef.value.formRef.formModel.factoryAreaNumber) // console.log(item) @@ -455,14 +457,18 @@ const onChangeSec = (field, cur, item,formRefSec) => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false + DeviceMaintenanceMain.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.disabled = false if (val == 'edit') { // 编辑 + DeviceMaintenanceMain.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.disabled = true DeviceMaintenanceMain.allSchemas.formSchema.find(item => { return item.field == 'type' }).componentProps.options = deviceTypeList openForm('update', row) - DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true } else if (val == 'delete') { // 删除 handleDelete(row.id) diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index 1a31fe3..e5f4753 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -176,7 +176,6 @@ const HeadButttondata = [ // 头部按钮事件 const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 - // MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED'; MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED'; MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'type').value = 'MOLD'; openForm('create') diff --git a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts index d10cc57..ff143d2 100644 --- a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts +++ b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts @@ -16,7 +16,7 @@ const moldList = await MoldAccountsApi.getMoldAccountsNoPage({}) const moldListAll = await MoldAccountsApi.getMoldAccountsAllNoPage({}) const moldListByFactory = moldListAll.filter(item => item.factoryAreaNumber == userStore.userSelfInfo.dept.parentId) const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }) -const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: undefined }) +const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: null }) const engineerList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 2}) const repairList = await MoldMaintenanceMainApi.getMoldMainTempList('MOLD') // 表单校验 @@ -175,12 +175,12 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ }, api: () => userList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return userList.find((account) => account.id == cellValue)?.name + return userListAll.find((account) => account.id == cellValue)?.nickname }, search: { show: true, component: 'Select', - api: () => userList, + api: () => dutyUserList, componentProps: { optionsAlias: { labelField: 'name', @@ -190,7 +190,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ }, form: { component: 'Select', - api: () => userList, + api: () => dutyUserList, componentProps: { disabled: true, optionsAlias: { @@ -350,7 +350,7 @@ export const MoldInspectionDetail = useCrudSchemas(reactive([ }, tableForm: { type: 'Select', - initOptions: userList, + initOptions: dutyUserList, multiple:true, collapseTags:true, collapseTagsTooltip:true, diff --git a/src/views/eam/mold/moldmaintainjob/index.vue b/src/views/eam/mold/moldmaintainjob/index.vue index 087c9f4..8d99f45 100644 --- a/src/views/eam/mold/moldmaintainjob/index.vue +++ b/src/views/eam/mold/moldmaintainjob/index.vue @@ -193,8 +193,6 @@ const HeadButttondata = [ const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 - MoldMaintainOrderMain.allSchemas.formSchema[3].value = 'MOLD' - MoldMaintainOrderMain.allSchemas.formSchema[0].componentProps.disabled = false openForm('create') } else if (val == 'import') { // 导入 @@ -259,11 +257,9 @@ const onChange = (field, cur, item) => { } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - MoldMaintainOrderMain.allSchemas.formSchema[0].componentProps.disabled = false if (val == 'edit') { // 编辑 openForm('update', row) - MoldMaintainOrderMain.allSchemas.formSchema[0].componentProps.disabled = true } else if (val == 'delete') { // 删除 handleDelete(row.id) diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index 61be45e..0b74f01 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -356,7 +356,7 @@ const butttondata = (row) => { ) }), // 验证 defaultButtons.finishOrderBtn({ - hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) + hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails) }), // 完成 defaultButtons.pictureBtn({ hide: !(row.filePathList != null && row.filePathList.length > 0) @@ -365,8 +365,6 @@ const butttondata = (row) => { } const onChange = (field, cur, item) => { if (field == 'deviceNumber') { - // MoldMaintenanceMain.allSchemas.formSchema[1].componentProps.disabled = true - // MoldMaintenanceMain.allSchemas.formSchema[2].componentProps.disabled = true formRef.value.formRef.formModel.factoryAreaNumber =String(item.componentProps.options.find((item) => item.number == cur).factoryAreaNumber) console.log(typeof formRef.value.formRef.formModel.factoryAreaNumber) // console.log(item) @@ -376,7 +374,9 @@ const onChange = (field, cur, item) => { } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - MoldMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false + MoldMaintenanceMain.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.disabled = false if (val == 'edit') { // 编辑 openForm('update', row)