|
@ -108,6 +108,8 @@ import * as MoldMaintainOrderMainApi from '@/api/eam/mold/moldMaintainOrderMain' |
|
|
import * as MoldMaintainOrderDetailApi from '@/api/eam/mold/moldMaintainOrderDetail' |
|
|
import * as MoldMaintainOrderDetailApi from '@/api/eam/mold/moldMaintainOrderDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
|
|
import * as UserApi from '@/api/system/user' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'MoldMaintainOrderMain' }) |
|
|
defineOptions({ name: 'MoldMaintainOrderMain' }) |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
@ -288,7 +290,9 @@ const openForm = (type: string, row?: any) => { |
|
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = async (row: any, titleName: any, titleValue: any) => { |
|
|
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
|
|
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name |
|
|
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintainOrderMain') |
|
|
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintainOrderMain') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -392,7 +396,7 @@ const submitForm = async (formType, data) => { |
|
|
describes: item.describes, |
|
|
describes: item.describes, |
|
|
describes1: item.describes1, |
|
|
describes1: item.describes1, |
|
|
itemNumbers: item.itemNumbers1, |
|
|
itemNumbers: item.itemNumbers1, |
|
|
maintenances: item.maintenances.join(','), |
|
|
maintenances: item.maintenances?.join(','), |
|
|
workOut: item.workOut, |
|
|
workOut: item.workOut, |
|
|
} |
|
|
} |
|
|
}) // 拼接子表数据参数 |
|
|
}) // 拼接子表数据参数 |
|
@ -451,16 +455,22 @@ const detailValidate = (data) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 子表提交 |
|
|
// 子表提交 |
|
|
const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { |
|
|
const detailSubmitForm= async (formType,data,getList1,formRef,tableList) => { |
|
|
try { |
|
|
try { |
|
|
let data1 = { |
|
|
let data1 = { |
|
|
id:data.id, |
|
|
id:data.id, |
|
|
number:data.number, |
|
|
number:data.number, |
|
|
describes:data.describes, |
|
|
describes:data.describes, |
|
|
describes1:data.describes1, |
|
|
describes1: data.describes1, |
|
|
itemNumbers:data.itemNumbers, |
|
|
peoples: data.peoples, |
|
|
maintenances:data.maintenances.join(','), |
|
|
status: data.status, |
|
|
workOut:data.workOut, |
|
|
itemNumbers: data.itemNumbers, |
|
|
|
|
|
estimatedMinutes: data.estimatedMinutes, |
|
|
|
|
|
actualMinutes: data.actualMinutes, |
|
|
|
|
|
chargePeoples:data.chargePeoples?.join(','), |
|
|
|
|
|
workOut: data.workOut, |
|
|
|
|
|
engineer: data.engineer, |
|
|
|
|
|
completionTime: data.completionTime, |
|
|
} |
|
|
} |
|
|
console.log(data1) |
|
|
console.log(data1) |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
@ -472,7 +482,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { |
|
|
} |
|
|
} |
|
|
formRef.dialogVisible = false |
|
|
formRef.dialogVisible = false |
|
|
// 刷新当前列表 |
|
|
// 刷新当前列表 |
|
|
await getList() |
|
|
await formRef.getList1 |
|
|
detailRef.value.tableObject.tableList.forEach(item=>{ |
|
|
detailRef.value.tableObject.tableList.forEach(item=>{ |
|
|
if (item.itemNumbers?.length>0) { |
|
|
if (item.itemNumbers?.length>0) { |
|
|
let str = '' |
|
|
let str = '' |
|
@ -484,7 +494,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
} finally { |
|
|
} finally { |
|
|
formRef.formLoading = false |
|
|
detailRef.formLoading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -506,16 +516,35 @@ function buttonControllFunction(row, val) { |
|
|
function detailOnChange(field, cur, item) { |
|
|
function detailOnChange(field, cur, item) { |
|
|
if (field == 'status') { |
|
|
if (field == 'status') { |
|
|
if (cur == '1') { |
|
|
if (cur == '1') { |
|
|
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
DeviceMaintainOrderDetailRules.uncompleted = [required] |
|
|
MoldMaintainOrderDetailRules.uncompleted = [{ required: true }] |
|
|
} else { |
|
|
} else { |
|
|
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
delete DeviceMaintainOrderDetailRules.uncompleted; |
|
|
MoldMaintainOrderDetailRules.uncompleted = [{ required: false }] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
|
|
|
if (row == undefined || row == null) { |
|
|
|
|
|
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
|
|
|
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
|
|
|
MoldMaintainOrderDetailRules.uncompleted = [{ required: false }] |
|
|
|
|
|
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' |
|
|
|
|
|
} else { |
|
|
|
|
|
if (row.status == '1') { |
|
|
|
|
|
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
|
|
|
MoldMaintainOrderDetailRules.uncompleted = [{ required: true }] |
|
|
|
|
|
} else { |
|
|
|
|
|
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
|
|
|
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
|
|
|
MoldMaintainOrderDetailRules.uncompleted = [{ required: false }] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
callback() |
|
|
|
|
|
} |
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|