|
@ -65,6 +65,26 @@ |
|
|
:isSearchTableItem="true" |
|
|
:isSearchTableItem="true" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
|
|
<BasicForm |
|
|
|
|
|
ref="formRefSec" |
|
|
|
|
|
:rules="MoldMaintenanceMainSecRules" |
|
|
|
|
|
:formAllSchemas="MoldMaintenanceMainSec.allSchemas" |
|
|
|
|
|
:tableAllSchemas="MoldMaintenanceDetail.allSchemas" |
|
|
|
|
|
:tableFormRules="MoldMaintenanceDetailRules" |
|
|
|
|
|
:tableData="tableData" |
|
|
|
|
|
:apiUpdate="MoldMaintenanceMainApi.updateMoldMaintenanceMain" |
|
|
|
|
|
:apiCreate="MoldMaintenanceMainApi.createMoldMaintenanceMain" |
|
|
|
|
|
:isBusiness="false" |
|
|
|
|
|
@onChange="onChangeSec" |
|
|
|
|
|
@handleAddTable="handleAddTable" |
|
|
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
|
|
@submitForm="submitFormSec" |
|
|
|
|
|
@success="submitForm" |
|
|
|
|
|
:isSearchTableItem="true" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="MoldMaintenanceMain.allSchemas" /> --> |
|
|
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="MoldMaintenanceMain.allSchemas" /> --> |
|
|
<Detail |
|
|
<Detail |
|
@ -83,6 +103,7 @@ |
|
|
:detailValidate="detailValidate" |
|
|
:detailValidate="detailValidate" |
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
:isSearchTableItem="true" |
|
|
:isSearchTableItem="true" |
|
|
|
|
|
:openFormCallBack="openFormCallBack" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
@ -112,13 +133,18 @@ import { |
|
|
MoldMaintenanceMain, |
|
|
MoldMaintenanceMain, |
|
|
MoldMaintenanceMainRules, |
|
|
MoldMaintenanceMainRules, |
|
|
MoldMaintenanceDetail, |
|
|
MoldMaintenanceDetail, |
|
|
MoldMaintenanceDetailRules |
|
|
MoldMaintenanceDetailRules, |
|
|
|
|
|
MoldMaintenanceMainSec, |
|
|
|
|
|
MoldMaintenanceMainSecRules, |
|
|
} from './moldMaintenanceMain.data' |
|
|
} from './moldMaintenanceMain.data' |
|
|
import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain' |
|
|
import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain' |
|
|
import * as MoldMaintenanceDetailApi from '@/api/eam/mold/moldMaintenanceDetail' |
|
|
import * as MoldMaintenanceDetailApi from '@/api/eam/mold/moldMaintenanceDetail' |
|
|
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 { selecUserByType } from '@/api/system/dept' |
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
|
|
|
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
|
|
|
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' |
|
|
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) |
|
|
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) |
|
|
const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD') |
|
|
const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD') |
|
|
|
|
|
|
|
@ -129,10 +155,16 @@ const userStore = useUserStore() // 用户信息 |
|
|
const route = useRoute() // 路由信息 |
|
|
const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
|
|
|
const formRefSec = ref() |
|
|
const showView = ref(false) |
|
|
const showView = ref(false) |
|
|
const viewTitle = ref('图片预览') |
|
|
const viewTitle = ref('图片预览') |
|
|
const urls = ref([]) |
|
|
const urls = ref([]) |
|
|
const viewKey = ref(0) |
|
|
const viewKey = ref(0) |
|
|
|
|
|
const operatRecord = ref() |
|
|
|
|
|
const newRow = ref() |
|
|
|
|
|
const deviceList = ref() |
|
|
|
|
|
const moldList = ref() |
|
|
|
|
|
const repairUser = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns) |
|
|
const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns) |
|
|
|
|
|
|
|
@ -305,16 +337,7 @@ const buttonTableClick = async (val, row) => { |
|
|
} else if (val == 'acceptOrder') { |
|
|
} else if (val == 'acceptOrder') { |
|
|
acceptOrder(row) |
|
|
acceptOrder(row) |
|
|
} else if (val == 'turnOrder') { |
|
|
} else if (val == 'turnOrder') { |
|
|
MoldMaintenanceMain.allSchemas.formSchema.find(item => { |
|
|
openFormSec('turnOrder', row) |
|
|
return item.field == 'turnType' |
|
|
|
|
|
}).isForm = true |
|
|
|
|
|
MoldMaintenanceMain.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'type' |
|
|
|
|
|
}).componentProps.options = deviceMoldTypeList |
|
|
|
|
|
MoldMaintenanceMain.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'type' |
|
|
|
|
|
}).componentProps.disabled = false |
|
|
|
|
|
openForm('turnOrder', row) |
|
|
|
|
|
} else if (val == 'finishOrder') { |
|
|
} else if (val == 'finishOrder') { |
|
|
finishOrder(row) |
|
|
finishOrder(row) |
|
|
} else if (val == 'verifyOrder') { |
|
|
} else if (val == 'verifyOrder') { |
|
@ -338,6 +361,7 @@ const openForm = (type: string, row?: any) => { |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
|
|
operatRecord.value = row; |
|
|
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintenanceMain') |
|
|
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintenanceMain') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -556,6 +580,189 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
|
|
|
if (operatRecord.value.type == 'TECH') { |
|
|
|
|
|
MoldMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
|
|
|
if (item.field == 'maintenance') { |
|
|
|
|
|
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: 1 }).then(response => { |
|
|
|
|
|
item.componentProps.options = response |
|
|
|
|
|
callback(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (operatRecord.value.type == 'DEVICE') { |
|
|
|
|
|
MoldMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
|
|
|
if (item.field == 'maintenance') { |
|
|
|
|
|
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }).then(response => { |
|
|
|
|
|
item.componentProps.options = response |
|
|
|
|
|
callback(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (operatRecord.value.type == 'MOLD') { |
|
|
|
|
|
MoldMaintenanceDetail.allSchemas.formSchema.forEach((item) => { |
|
|
|
|
|
if (item.field == 'maintenance') { |
|
|
|
|
|
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }).then(response => { |
|
|
|
|
|
item.componentProps.options = response |
|
|
|
|
|
callback(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const openFormSec = async (type: string, row?: any) => { |
|
|
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
|
|
newRow.value = { ...row } |
|
|
|
|
|
newRow.value.turnType = '0' |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'type' |
|
|
|
|
|
}).componentProps.disabled = false |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'deviceNumber' |
|
|
|
|
|
}).componentProps.disabled = false |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'factoryAreaNumber' |
|
|
|
|
|
}).componentProps.disabled = true |
|
|
|
|
|
await MoldAccountsApi.getMoldAccountsNoPage({}) |
|
|
|
|
|
.then(res => { |
|
|
|
|
|
moldList.value = res |
|
|
|
|
|
}) |
|
|
|
|
|
await DeviceAccountsApi.getDeviceAccountsNoPage({}) |
|
|
|
|
|
.then(res => { |
|
|
|
|
|
deviceList.value = res |
|
|
|
|
|
}) |
|
|
|
|
|
if (row.type == 'MOLD') { |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'deviceNumber' |
|
|
|
|
|
}).componentProps.options = moldList.value |
|
|
|
|
|
} else { |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'deviceNumber' |
|
|
|
|
|
}).componentProps.options = deviceList.value |
|
|
|
|
|
} |
|
|
|
|
|
formRefSec.value.open(type, newRow.value) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onChangeSec = (field, cur, item,formRefSec) => { |
|
|
|
|
|
if (field == 'type') { |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'deviceNumber' |
|
|
|
|
|
}).componentProps.disabled = false |
|
|
|
|
|
if (cur == 'MOLD') { |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'deviceNumber' |
|
|
|
|
|
}).componentProps.options = moldList.value |
|
|
|
|
|
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: null }).then(res => { |
|
|
|
|
|
repairUser.value = res |
|
|
|
|
|
const setV = {} |
|
|
|
|
|
setV['maintenance'] = '' |
|
|
|
|
|
formRefSec.setValues(setV) |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'maintenance' |
|
|
|
|
|
}).componentProps.options = res |
|
|
|
|
|
}) |
|
|
|
|
|
const setV = {} |
|
|
|
|
|
setV['deviceNumber'] = '' |
|
|
|
|
|
formRefSec.setValues(setV) |
|
|
|
|
|
} else { |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'deviceNumber' |
|
|
|
|
|
}).componentProps.options = deviceList.value |
|
|
|
|
|
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }).then(res => { |
|
|
|
|
|
repairUser.value = res |
|
|
|
|
|
const setV = {} |
|
|
|
|
|
setV['maintenance'] = '' |
|
|
|
|
|
formRefSec.setValues(setV) |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'maintenance' |
|
|
|
|
|
}).componentProps.options = res |
|
|
|
|
|
}) |
|
|
|
|
|
const setV = {} |
|
|
|
|
|
setV['deviceNumber'] = '' |
|
|
|
|
|
formRefSec.setValues(setV) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (field == 'turnType') { |
|
|
|
|
|
if (cur == '0') { |
|
|
|
|
|
const setV = {} |
|
|
|
|
|
setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber |
|
|
|
|
|
setV['maintenance'] = newRow.value.maintenance |
|
|
|
|
|
formRefSec.setValues(setV) |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'type' |
|
|
|
|
|
}).componentProps.disabled = false |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'deviceNumber' |
|
|
|
|
|
}).componentProps.disabled = false |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'factoryAreaNumber' |
|
|
|
|
|
}).componentProps.disabled = true |
|
|
|
|
|
} else if (cur == '1') { |
|
|
|
|
|
const setV = {} |
|
|
|
|
|
setV['deviceNumber'] = newRow.value.deviceNumber |
|
|
|
|
|
setV['type'] = newRow.value.type |
|
|
|
|
|
formRefSec.setValues(setV) |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'type' |
|
|
|
|
|
}).componentProps.disabled = true |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'deviceNumber' |
|
|
|
|
|
}).componentProps.disabled = true |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'factoryAreaNumber' |
|
|
|
|
|
}).componentProps.disabled = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (field == 'factoryAreaNumber') { |
|
|
|
|
|
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: cur, flag: null }).then(res => { |
|
|
|
|
|
repairUser.value = res |
|
|
|
|
|
const setV = {} |
|
|
|
|
|
setV['maintenance'] = '' |
|
|
|
|
|
formRefSec.setValues(setV) |
|
|
|
|
|
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { |
|
|
|
|
|
return item.field == 'maintenance' |
|
|
|
|
|
}).componentProps.options = res |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
|
|
|
const submitFormSec = async (formType, data) => { |
|
|
|
|
|
data.subList = tableData.value.map((item) => { |
|
|
|
|
|
return { |
|
|
|
|
|
describes: item.describes, |
|
|
|
|
|
describes1: item.describes1, |
|
|
|
|
|
itemNumbers: item.itemNumbers, |
|
|
|
|
|
maintenances: item.maintenances.join(','), |
|
|
|
|
|
workOut: item.workOut, |
|
|
|
|
|
factoryAreaNumber: newRow.value.factoryAreaNumber, |
|
|
|
|
|
} |
|
|
|
|
|
}) // 拼接子表数据参数 |
|
|
|
|
|
console.log(data.subList) |
|
|
|
|
|
try { |
|
|
|
|
|
if (formType === 'create') { |
|
|
|
|
|
await DeviceMaintenanceMainApi.createDeviceMaintenanceMain(data) |
|
|
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
|
|
} else { |
|
|
|
|
|
await DeviceMaintenanceMainApi.updateDeviceMaintenanceMain(data) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
} |
|
|
|
|
|
formRefSec.value.dialogVisible = false |
|
|
|
|
|
// 刷新当前列表 |
|
|
|
|
|
getList() |
|
|
|
|
|
} finally { |
|
|
|
|
|
formRefSec.value.formLoading = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|