diff --git a/src/api/eam/device/deviceInspectionDetail/index.ts b/src/api/eam/device/deviceInspectionDetail/index.ts index 7b5ce73..bc303c4 100644 --- a/src/api/eam/device/deviceInspectionDetail/index.ts +++ b/src/api/eam/device/deviceInspectionDetail/index.ts @@ -14,6 +14,7 @@ export interface DeviceInspectionDetailVO { completionTime: Date engineer: string uncompleted: string + status: string } // 查询检修工单子列表 diff --git a/src/api/eam/device/deviceInspectionMain/index.ts b/src/api/eam/device/deviceInspectionMain/index.ts index 09a4ed9..1b701ef 100644 --- a/src/api/eam/device/deviceInspectionMain/index.ts +++ b/src/api/eam/device/deviceInspectionMain/index.ts @@ -54,5 +54,11 @@ export const exportDeviceInspectionMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { - return request.download({ url: '/eam/device-inspection-job-main/get-import-template' }) + return request.download({ url: `/eam/device-inspection-job-main/get-import-template` }) } + + +// 检修完成 +export const finishInspection = (id: number) => { + return request.get({ url: `/eam/device-inspection-job-main/onClick?id=` + id }) +} \ No newline at end of file diff --git a/src/api/eam/device/deviceMaintenanceMain/index.ts b/src/api/eam/device/deviceMaintenanceMain/index.ts index 38c5022..644b4f5 100644 --- a/src/api/eam/device/deviceMaintenanceMain/index.ts +++ b/src/api/eam/device/deviceMaintenanceMain/index.ts @@ -71,3 +71,11 @@ export const orderTurnTo = async (data: DeviceMaintenanceMainVO) => { export const getDeviceMainTempList = async (type: String) => { return await request.get({ url: `/eam/device-maintenance-job-main/getList?type=` + type }) } + + + +// 完成维修工单 +export const finishOrder = async (params) => { + return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params}) +} + diff --git a/src/api/eam/mold/moldMaintenanceMain/index.ts b/src/api/eam/mold/moldMaintenanceMain/index.ts index 3b5074f..18e433a 100644 --- a/src/api/eam/mold/moldMaintenanceMain/index.ts +++ b/src/api/eam/mold/moldMaintenanceMain/index.ts @@ -72,3 +72,9 @@ export const orderTurnTo = async (data: MoldMaintenanceMainVO) => { export const getMoldMainTempList = async (type: String) => { return await request.get({ url: `/eam/device-maintenance-job-main/getList?type=` + type }) } + + +// 完成维修工单 +export const finishOrder = async (params) => { + return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params}) +} \ No newline at end of file diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 5318529..7f1d2b6 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -283,6 +283,11 @@ const props = defineProps({ required: false, default: undefined }, + openFormCallBack: { + type: Function, + required: false, + default: undefined + }, }) const isShowDrawer = ref(false) const detailLoading = ref(false) @@ -491,22 +496,21 @@ const openForm = async (type: string, row?: number) => { } } } - //打开弹窗 - let callbackTriggered = false; - // 触发openFormCallBack,传递一个回调函数(此处为了修改翻译list信息添加) - emit('openFormCallBack', type, row, masterParmas.value, () => { - callbackTriggered = true; // 标记回调被执行 - }); - nextTick(() => { // 使用nextTick来延迟检查 - if (!callbackTriggered) { // 如果回调没有被执行,说明父组件没有配置openFormCallBack或没有处理这个事件 - formRef.value.open(type, row, masterParmas.value); - } - }); + if (await props.openFormCallBack) { + props.openFormCallBack(type, row, masterParmas.value, () => { + formRef.value.open(type, row, masterParmas.value) + }) + } else { + formRef.value.open(type, row, masterParmas.value); + } } // form 提交 const submitForm = async (formType, data) => { + data.masterId = masterParmas.value.masterId try { + const rs = (await props.detailValidate) ? props.detailValidate(data) : true + if (!rs) return emit('detailSubmitForm', formType, data, getList, formRef.value) } finally { // formRef.value.formLoading = false @@ -527,7 +531,6 @@ const emit = defineEmits([ 'openImage', 'detailSubmitForm', 'detailOnChange', - 'openFormCallBack', ]) /** 删除按钮操作 */ const handleDelete = async (id: number) => { diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 24a6c09..2deef46 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -961,10 +961,10 @@ export function verifyOrderBtn(option:any) { } // 主列表-检修 -export function maintenanceOrderBtn(option:any) { +export function mainInspectionOrderBtn(option:any) { return __defaultBtnOption(option,{ label: '检修', - name: 'maintenanceOrder', + name: 'mainInspectionOrder', hide: false, type: 'primary', color: '', diff --git a/src/views/eam/device/deviceAccounts/index.vue b/src/views/eam/device/deviceAccounts/index.vue index 91e5a5b..2a83fb9 100644 --- a/src/views/eam/device/deviceAccounts/index.vue +++ b/src/views/eam/device/deviceAccounts/index.vue @@ -228,7 +228,6 @@ const buttonTableClick = async (val, row) => { } else if (val == 'selectItem') { openItem(row.number) } else if (val == 'qrCode') { - debugger window.open(src.value + "&number='" + row.number + "'") } else { // 其他按钮 diff --git a/src/views/eam/device/deviceRepair/index.vue b/src/views/eam/device/deviceRepair/index.vue index 3d850a0..5ebd3e9 100644 --- a/src/views/eam/device/deviceRepair/index.vue +++ b/src/views/eam/device/deviceRepair/index.vue @@ -295,11 +295,12 @@ function handleBackout(row) { } const onChange = (field, cur, item) => { - // if (field == 'factoryAreaNumber') { - - // // 获取当前的工厂区域编号 - // DeviceRepair.allSchemas.formSchema - // } + if (field == 'factoryAreaNumber') { + // 获取当前的工厂区域编号 + DeviceRepair.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).value = null + } } diff --git a/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts b/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts index 1ac8928..64dccac 100644 --- a/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts +++ b/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts @@ -318,7 +318,9 @@ export const DeviceInspectionDetailRules = reactive({ { validator:validateNum, message: '请输入数字格式', trigger: 'blur'} ], number: [required], - estimatedMinutes: [required], + actualMinutes: [ + { validator:validateNum, message: '请输入数字格式', trigger: 'blur'} + ], maintenance: [required], }) @@ -477,12 +479,15 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive([ label: '未完成原因', field: 'uncompleted', sort: 'custom', - table: { - width: '150', - }, isSearch: false, - isForm: true, isTable: true, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + disabled: true, + } + } }, { label: '备件', diff --git a/src/views/eam/device/deviceinspectionjob/index.vue b/src/views/eam/device/deviceinspectionjob/index.vue index 1ea94d0..434324b 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -70,7 +70,8 @@ :detailValidate="detailValidate" @detailSubmitForm="detailSubmitForm" :isSearchTableItem="true" - @openFormCallBack="openFormCallBack" + :openFormCallBack="openFormCallBack" + @detailOnChange="detailOnChange" /> @@ -188,7 +189,7 @@ const butttondata = (row) => { // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // 删除 defaultButtons.mainListEditBtn(null), // 编辑 - defaultButtons.maintenanceOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 + defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 ] } @@ -197,8 +198,8 @@ const butttondata = (row) => { const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) - } else if (val == 'maintenanceOrder') { // 检修 - handleMaintenanceOrder(row) + } else if (val == 'mainInspectionOrder') { // 检修 + openDetail(row, '代码', row.number) } else if (val == 'finishOrder') { // 完成 handleFinishOrder(row) } @@ -312,7 +313,33 @@ function handleMaintenanceOrder(row) { } function handleFinishOrder(row) { - + let param = { + masterId : row.id + } + DeviceInspectionDetailApi.getDeviceInspectionDetailPage(param + ).then(response => { + if (response != null) { + if (response.list.length == 0) { + message.error(t('请先填写并完成检修明细内容!')) + } else { + let unFinishedList = response.list.filters(item => { + return item.status == 0 + }) + if (unFinishedList != null && unFinishedList.length > 0) { + message.error(t('请先完成各检修明细内容!')) + return + } else { + DeviceInspectionMainApi.finishInspection(row.id).then(res => { + message.success(t('common.finishSuccess')) + getList() + }) + } + } + } else { + message.error(t('common.finishFail')) + } + }) + } const onChange = (field, cur, item) => { @@ -360,16 +387,26 @@ const detailOpenForm = (type, row) => { // 子表新增/编辑校验 const detailValidate = (data) => { - return true; + // return true; let tag = false; - if (data.qty <= 0) { - message.warning('数量必须大于0') - tag = false; - return tag; + // if (data.qty <= 0) { + // message.warning('数量必须大于0') + // tag = false; + // return tag; + // } else { + // tag = true; + // return tag; + // } + let req = DeviceInspectionDetailRules.uncompleted?.find(item => { + return item.required == true + }) + if (req !== undefined) { + tag = false + message.warning('需填入未完成原因') } else { - tag = true; - return tag; + tag = true } + return tag } // 子表提交 const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { @@ -377,12 +414,14 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) => try { let data1 = { id: data.id, - number: data.maintenanceNumber, + number: data.number, + masterId: data.masterId, siteId: data.siteId, available: data.available, concurrencyStamp: data.concurrencyStamp, name: data.name, peoples: data.peoples, + status: data.status, estimatedMinutes: data.estimatedMinutes, actualMinutes: data.actualMinutes, chargePeoples: data.chargePeoples.join(','), @@ -458,6 +497,41 @@ const submitForm = async (formType, data) => { } } + +function detailOnChange(field, cur, item) { + if (field == 'status') { + if (cur == '1') { + DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false + DeviceInspectionDetailRules.uncompleted = [required] + } else { + DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true + DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' + delete DeviceInspectionDetailRules.uncompleted; + } + } +} + +const openFormCallBack = (type, row, masterParmas, callback) => { + if (row == undefined || row == null) { + DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true + DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' + delete DeviceInspectionDetailRules.uncompleted; + DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' + } else { + if (row.status == '1') { + DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false + DeviceInspectionDetailRules.uncompleted = [required] + } else { + DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true + DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' + delete DeviceInspectionDetailRules.uncompleted; + } + } + + callback() +} + + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts index 7647e95..f9125c5 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -219,6 +219,30 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ }, }, + { + label: '是否完成', + field: 'status', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isTable: true, + dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, + dictClass: 'string', + form: { + component: 'Select', + componentProps: { + disabled: false, + } + }, + tableForm: { + type: 'Select', + componentProps: { + disabled: false, + } + }, + }, { label: '操作', field: 'action', @@ -296,7 +320,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ isDetail: false, api: () => userListAll, formatter: (_: Recordable, __: TableColumn, cellValue) => { - return userListAll.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',') + return userListAll.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.nickname)?.join(',') }, tableForm: { type: 'Select', @@ -328,6 +352,9 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ field: 'maintenances1', sort: 'custom', isDetail: true, + isSearch: false, + isForm: false, + isTable: false, table: { width: 150 } diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index 8d71cf2..a1689e5 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -83,7 +83,7 @@ :detailValidate="detailValidate" @detailSubmitForm="detailSubmitForm" :isSearchTableItem="true" - @openFormCallBack="openFormCallBack" + :openFormCallBack="openFormCallBack" /> @@ -291,8 +291,12 @@ const buttonTableClick = async (val, row) => { handleDelete(row.id) } else if (val == 'acceptOrder') { acceptOrder(row) + } else if (val == 'repair') { + openDetail(row, '代码', row.number) } else if (val == 'turnOrder') { openForm('turnOrder', row) + } else if (val == 'finish') { + finishOrder(row) } else if (val == 'picture') { showView.value = true urls.value = row.filePathList @@ -375,7 +379,19 @@ function acceptOrder(row) { // 转办 function turnOrder() {} // 完成 -function finishOrder() {} +function finishOrder(row) { + let param = { + id: row.id, + number: row.number, + status: row.status, + result: 'COMPLETED', + requestNumber: row.requestNumber, + } + DeviceMaintenanceMainApi.finishOrder(param).then(res => { + getList() + message.success('操作成功') + }) +} // 验证 function verifyOrder() {} // 维修 @@ -504,35 +520,33 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { } const openFormCallBack = (type, row, masterParmas,callback) => { - if (type === 'create') { - if (operatRecord.value.type == 'TECH') { - DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { - if (item.field == 'maintenances') { - selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: 1 }).then(response => { - item.componentProps.options = response - callback(); - }); - } - }) - } else if (operatRecord.value.type == 'DEVICE') { - DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { - if (item.field == 'maintenances') { - selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }).then(response => { - item.componentProps.options = response - callback(); - }); - } - }) - } else if (operatRecord.value.type == 'MOLD') { - DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { - if (item.field == 'maintenances') { - selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }).then(response => { - item.componentProps.options = response - callback(); - }); - } - }) - } + if (operatRecord.value.type == 'TECH') { + DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { + if (item.field == 'maintenances') { + selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: 1 }).then(response => { + item.componentProps.options = response + callback(); + }); + } + }) + } else if (operatRecord.value.type == 'DEVICE') { + DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { + if (item.field == 'maintenances') { + selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }).then(response => { + item.componentProps.options = response + callback(); + }); + } + }) + } else if (operatRecord.value.type == 'MOLD') { + DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { + if (item.field == 'maintenances') { + selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }).then(response => { + item.componentProps.options = response + callback(); + }); + } + }) } } diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index c007b16..5b4bbc1 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -159,7 +159,6 @@ const HeadButttondata = [ // 头部按钮事件 const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 - debugger // MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED'; MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED'; MoldInspectionMain.allSchemas.formSchema[5].value = 'DEVICE'; @@ -340,16 +339,16 @@ const detailOpenForm = (type, row) => { // 子表新增/编辑校验 const detailValidate = (data) => { - return true; + // return true; let tag = false; - if (data.qty <= 0) { - message.warning('数量必须大于0') - tag = false; - return tag; - } else { - tag = true; - return tag; - } + // if (data.qty <= 0) { + // message.warning('数量必须大于0') + // tag = false; + // return tag; + // } else { + // tag = true; + // return tag; + // } } // 子表提交 const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { diff --git a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts index 289b84c..d7d2190 100644 --- a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts +++ b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts @@ -7,9 +7,12 @@ import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain' import { dateFormatter } from '@/utils/formatTime' import { ItemSearchTable } from '../../basic/item/item.data' import * as ItemApi from '@/api/eam/basic/item' +import { validateHanset, validateNumDot, validateNum, validateEmail } from '@/utils/validator' const userStore = useUserStore() const factoryList = await selectAllFactoryArea() 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 engineerList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 2}) @@ -17,12 +20,20 @@ const repairList = await MoldMaintenanceMainApi.getMoldMainTempList('MOLD') // 表单校验 export const MoldInspectionMainRules = reactive({ number: [required], - // maintenanceNumber: [required], - moldNumber: [required], - factoryAreaNumber: [required], + deviceNumber: [ + required, + ], + factoryAreaNumber: [ + required, + ], + describes: [ + { max: 200, message: '不得超过200个字符', trigger: 'blur' }, + ], + maintenancePhone: [ + { validator:validateHanset, message: '输入电话格式不正确', trigger: 'blur'} + ], status: [required], type: [required], - concurrencyStamp: [required], faultType: [required], }) @@ -80,7 +91,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ }, api: () => moldList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return moldList.find((account) => account.number == cellValue)?.name + return moldListAll.find((account) => account.number == cellValue)?.name }, search: { show: true, @@ -270,14 +281,25 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ } ])) - + + // 表单校验 export const MoldInspectionDetailRules = reactive({ + chargePeoples:[ + required, + ], + estimatedMinutes:[ + required, + { validator:validateNum, message: '请输入数字格式', trigger: 'blur'} + ], number: [required], - estimatedMinutes: [required], + actualMinutes: [ + { validator:validateNum, message: '请输入数字格式', trigger: 'blur'} + ], maintenance: [required], }) + export const MoldInspectionDetail = useCrudSchemas(reactive([ { label: '检修编号', diff --git a/src/views/eam/mold/moldmaintainjob/index.vue b/src/views/eam/mold/moldmaintainjob/index.vue index c44c1a9..0640536 100644 --- a/src/views/eam/mold/moldmaintainjob/index.vue +++ b/src/views/eam/mold/moldmaintainjob/index.vue @@ -452,7 +452,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { try { let data1 = { id:data.id, - maintenanceNumber:data.maintenanceNumber, + number:data.number, describes:data.describes, describes1:data.describes1, itemNumbers:data.itemNumbers, diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index 12cfa48..69450c4 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -55,13 +55,14 @@ :tableData="tableData" :apiUpdate="MoldMaintenanceMainApi.updateMoldMaintenanceMain" :apiCreate="MoldMaintenanceMainApi.createMoldMaintenanceMain" - :isBusiness="true" + :isBusiness="false" @onChange="onChange" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" - :isSearchTableItem="true" + @success="submitForm" + :isSearchTableItem="true" /> @@ -289,7 +290,11 @@ const buttonTableClick = async (val, row) => { acceptOrder(row) } else if (val == 'turnOrder') { openForm('turnOrder', row) - }else if (val == 'picture') { + } else if (val == 'finishOrder') { + finishOrder(row) + } else if (val == 'repair') { + openDetail(row, '代码', row.code) + } else if (val == 'picture') { showView.value = true urls.value = row.filePathList viewKey.value += 1 @@ -369,7 +374,19 @@ function acceptOrder(row) { // 转办 function turnOrder() {} // 完成 -function finishOrder() {} +function finishOrder(row) { + let param = { + id: row.id, + number: row.number, + status: row.status, + result: 'COMPLETED', + requestNumber: row.requestNumber, + } + MoldMaintenanceMainApi.finishOrder(param).then(res => { + getList() + message.success('操作成功') + }) +} // 验证 function verifyOrder() {} // 维修 @@ -464,7 +481,8 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { try { let data1 = { id:data.id, - maintenanceNumber:data.maintenanceNumber, + number: data.number, + masterId: data.id, describes:data.describes, describes1:data.describes1, itemNumbers:data.itemNumbers, diff --git a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts index 462408d..ea50e0d 100644 --- a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts +++ b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts @@ -8,7 +8,7 @@ import * as ItemApi from '@/api/eam/basic/item' const userStore = useUserStore() const factoryList = await selectAllFactoryArea() const moldList = await MoldAccountsApi.getMoldAccountsNoPage({}) -const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) +const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }) // 表单校验 export const MoldMaintenanceMainRules = reactive({ number: [required], @@ -86,6 +86,9 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ width: '150', }, api: () => factoryList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return factoryList.find((account) => account.id == cellValue)?.name + }, search: { show: true, component: 'Select', @@ -106,7 +109,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, - placeholder: "请先选择模具" + placeholder: "请先选择设备" }, } }, @@ -189,7 +192,33 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ }, form: { component: 'Input', - + componentProps:{ + type:'textarea' + } + }, + }, + { + label: '是否完成', + field: 'status', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isTable: true, + dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, + dictClass: 'string', + form: { + component: 'Select', + componentProps: { + disabled: false, + } + }, + tableForm: { + type: 'Select', + componentProps: { + disabled: false, + } }, }, {