From f78b71403bc9e89b5307482d8310637de454c53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Wed, 13 Mar 2024 10:23:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E4=B8=80=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/deviceInspectionDetail/index.ts | 1 - .../eam/device/deviceInspectionMain/index.ts | 8 +- .../eam/device/deviceMaintenanceMain/index.ts | 8 - src/api/eam/mold/moldMaintenanceMain/index.ts | 6 - src/components/Detail/src/Detail.vue | 27 +- src/utils/disposition/defaultButtons.ts | 4 +- .../deviceMaintenance.data.ts | 10 + .../eam/basic/inspection/inspection.data.ts | 10 + src/views/eam/basic/item/item.data.ts | 11 + src/views/eam/basic/location/location.data.ts | 11 + .../basic/locationArea/locationArea.data.ts | 10 + .../moldMaintenance/moldMaintenance.data.ts | 10 + src/views/eam/basic/supplier/supplier.data.ts | 11 + src/views/eam/device/deviceAccounts/index.vue | 1 + src/views/eam/device/deviceRepair/index.vue | 11 +- .../deviceInspectionMain.data.ts | 15 +- .../eam/device/deviceinspectionjob/index.vue | 100 +--- .../deviceMaintenanceMain.data.ts | 29 +- .../eam/device/devicemaintenancejob/index.vue | 76 ++- .../item/adjustRecord/adjustRecord.data.ts | 24 + .../applicationRecordMain.data.ts | 76 +-- .../eam/item/countRecord/countRecord.data.ts | 24 + .../countadjustWork/countadjustWork.data.ts | 12 + src/views/eam/item/itemAccounts/index.vue | 504 +++++++++--------- src/views/eam/item/itemApplyMain/index.vue | 6 + .../item/itemApplyMain/itemApplyMain.data.ts | 224 ++++---- .../eam/mold/moldinspectionjob/index.vue | 19 +- .../moldInspectionMain.data.ts | 36 +- src/views/eam/mold/moldmaintainjob/index.vue | 2 +- .../eam/mold/moldmaintenancejob/index.vue | 28 +- .../moldMaintenanceMain.data.ts | 35 +- 31 files changed, 628 insertions(+), 721 deletions(-) diff --git a/src/api/eam/device/deviceInspectionDetail/index.ts b/src/api/eam/device/deviceInspectionDetail/index.ts index bc303c4..7b5ce73 100644 --- a/src/api/eam/device/deviceInspectionDetail/index.ts +++ b/src/api/eam/device/deviceInspectionDetail/index.ts @@ -14,7 +14,6 @@ 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 1b701ef..09a4ed9 100644 --- a/src/api/eam/device/deviceInspectionMain/index.ts +++ b/src/api/eam/device/deviceInspectionMain/index.ts @@ -54,11 +54,5 @@ 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 644b4f5..38c5022 100644 --- a/src/api/eam/device/deviceMaintenanceMain/index.ts +++ b/src/api/eam/device/deviceMaintenanceMain/index.ts @@ -71,11 +71,3 @@ 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 18e433a..3b5074f 100644 --- a/src/api/eam/mold/moldMaintenanceMain/index.ts +++ b/src/api/eam/mold/moldMaintenanceMain/index.ts @@ -72,9 +72,3 @@ 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 7f1d2b6..5318529 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -283,11 +283,6 @@ const props = defineProps({ required: false, default: undefined }, - openFormCallBack: { - type: Function, - required: false, - default: undefined - }, }) const isShowDrawer = ref(false) const detailLoading = ref(false) @@ -496,21 +491,22 @@ const openForm = async (type: string, row?: number) => { } } } - 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); - } + //打开弹窗 + 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); + } + }); } // 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 @@ -531,6 +527,7 @@ 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 2deef46..24a6c09 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -961,10 +961,10 @@ export function verifyOrderBtn(option:any) { } // 主列表-检修 -export function mainInspectionOrderBtn(option:any) { +export function maintenanceOrderBtn(option:any) { return __defaultBtnOption(option,{ label: '检修', - name: 'mainInspectionOrder', + name: 'maintenanceOrder', hide: false, type: 'primary', color: '', diff --git a/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts b/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts index d248ef8..f234cde 100644 --- a/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts +++ b/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts @@ -174,6 +174,16 @@ export const DeviceMaintenance = useCrudSchemas(reactive([ } } }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + table: { + width: 170 + }, + }, { label: '操作', field: 'action', diff --git a/src/views/eam/basic/inspection/inspection.data.ts b/src/views/eam/basic/inspection/inspection.data.ts index 6407f86..bc98bd3 100644 --- a/src/views/eam/basic/inspection/inspection.data.ts +++ b/src/views/eam/basic/inspection/inspection.data.ts @@ -144,6 +144,16 @@ export const DeviceMoldItems = useCrudSchemas(reactive([ } } }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + table: { + width: 170 + }, + }, { label: '操作', field: 'action', diff --git a/src/views/eam/basic/item/item.data.ts b/src/views/eam/basic/item/item.data.ts index ef3723c..de8f673 100644 --- a/src/views/eam/basic/item/item.data.ts +++ b/src/views/eam/basic/item/item.data.ts @@ -1,4 +1,5 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const ItemRules = reactive({ @@ -243,6 +244,16 @@ export const Item = useCrudSchemas(reactive([ } } }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + table: { + width: 170 + }, + }, { label: '描述', field: 'describes', diff --git a/src/views/eam/basic/location/location.data.ts b/src/views/eam/basic/location/location.data.ts index d6259df..2131184 100644 --- a/src/views/eam/basic/location/location.data.ts +++ b/src/views/eam/basic/location/location.data.ts @@ -1,4 +1,5 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' import * as LocationAreaApi from '@/api/eam/basic/locationArea' import { LocationArea } from '../locationArea/locationArea.data' @@ -121,6 +122,16 @@ export const Location = useCrudSchemas(reactive([ } } }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + table: { + width: 170 + }, + }, { label: '描述', field: 'description', diff --git a/src/views/eam/basic/locationArea/locationArea.data.ts b/src/views/eam/basic/locationArea/locationArea.data.ts index 043b8aa..bd9f236 100644 --- a/src/views/eam/basic/locationArea/locationArea.data.ts +++ b/src/views/eam/basic/locationArea/locationArea.data.ts @@ -68,6 +68,16 @@ export const LocationArea = useCrudSchemas(reactive([ } } }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + table: { + width: 170 + }, + }, { label: '描述', diff --git a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts index 007d025..89fc56e 100644 --- a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts +++ b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts @@ -147,6 +147,16 @@ export const MoldMaintenance = useCrudSchemas(reactive([ } } }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + table: { + width: 170 + }, + }, { label: '操作', field: 'action', diff --git a/src/views/eam/basic/supplier/supplier.data.ts b/src/views/eam/basic/supplier/supplier.data.ts index d06aec8..a59fa8a 100644 --- a/src/views/eam/basic/supplier/supplier.data.ts +++ b/src/views/eam/basic/supplier/supplier.data.ts @@ -1,4 +1,5 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' import {validateHanset,validateFax,validatePostCode,validateYS} from '@/utils/validator' // 表单校验 @@ -77,6 +78,16 @@ export const Supplier = useCrudSchemas(reactive([ } } }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + table: { + width: 170 + }, + }, { label: '备注', field: 'remark', diff --git a/src/views/eam/device/deviceAccounts/index.vue b/src/views/eam/device/deviceAccounts/index.vue index 2a83fb9..91e5a5b 100644 --- a/src/views/eam/device/deviceAccounts/index.vue +++ b/src/views/eam/device/deviceAccounts/index.vue @@ -228,6 +228,7 @@ 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 5ebd3e9..3d850a0 100644 --- a/src/views/eam/device/deviceRepair/index.vue +++ b/src/views/eam/device/deviceRepair/index.vue @@ -295,12 +295,11 @@ function handleBackout(row) { } const onChange = (field, cur, item) => { - if (field == 'factoryAreaNumber') { - // 获取当前的工厂区域编号 - DeviceRepair.allSchemas.formSchema.find(item => { - return item.field == 'deviceNumber' - }).value = null - } + // if (field == 'factoryAreaNumber') { + + // // 获取当前的工厂区域编号 + // DeviceRepair.allSchemas.formSchema + // } } diff --git a/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts b/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts index 64dccac..1ac8928 100644 --- a/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts +++ b/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts @@ -318,9 +318,7 @@ export const DeviceInspectionDetailRules = reactive({ { validator:validateNum, message: '请输入数字格式', trigger: 'blur'} ], number: [required], - actualMinutes: [ - { validator:validateNum, message: '请输入数字格式', trigger: 'blur'} - ], + estimatedMinutes: [required], maintenance: [required], }) @@ -479,15 +477,12 @@ 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 434324b..1ea94d0 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -70,8 +70,7 @@ :detailValidate="detailValidate" @detailSubmitForm="detailSubmitForm" :isSearchTableItem="true" - :openFormCallBack="openFormCallBack" - @detailOnChange="detailOnChange" + @openFormCallBack="openFormCallBack" /> @@ -189,7 +188,7 @@ const butttondata = (row) => { // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // 删除 defaultButtons.mainListEditBtn(null), // 编辑 - defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 + defaultButtons.maintenanceOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 ] } @@ -198,8 +197,8 @@ const butttondata = (row) => { const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) - } else if (val == 'mainInspectionOrder') { // 检修 - openDetail(row, '代码', row.number) + } else if (val == 'maintenanceOrder') { // 检修 + handleMaintenanceOrder(row) } else if (val == 'finishOrder') { // 完成 handleFinishOrder(row) } @@ -313,33 +312,7 @@ 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) => { @@ -387,26 +360,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; - // } - let req = DeviceInspectionDetailRules.uncompleted?.find(item => { - return item.required == true - }) - if (req !== undefined) { - tag = false - message.warning('需填入未完成原因') + if (data.qty <= 0) { + message.warning('数量必须大于0') + tag = false; + return tag; } else { - tag = true + tag = true; + return tag; } - return tag } // 子表提交 const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { @@ -414,14 +377,12 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) => try { let data1 = { id: data.id, - number: data.number, - masterId: data.masterId, + number: data.maintenanceNumber, 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(','), @@ -497,41 +458,6 @@ 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 f9125c5..7647e95 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -219,30 +219,6 @@ 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', @@ -320,7 +296,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.nickname)?.join(',') + return userListAll.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',') }, tableForm: { type: 'Select', @@ -352,9 +328,6 @@ 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 a1689e5..8d71cf2 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,12 +291,8 @@ 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 @@ -379,19 +375,7 @@ function acceptOrder(row) { // 转办 function turnOrder() {} // 完成 -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 finishOrder() {} // 验证 function verifyOrder() {} // 维修 @@ -520,33 +504,35 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { } const openFormCallBack = (type, row, masterParmas,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(); - }); - } - }) + 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(); + }); + } + }) + } } } diff --git a/src/views/eam/item/adjustRecord/adjustRecord.data.ts b/src/views/eam/item/adjustRecord/adjustRecord.data.ts index fff1ebf..af5e7b2 100644 --- a/src/views/eam/item/adjustRecord/adjustRecord.data.ts +++ b/src/views/eam/item/adjustRecord/adjustRecord.data.ts @@ -107,6 +107,18 @@ export const AdjustRecordDetail = useCrudSchemas(reactive([ table: { width: 180, }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 + } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2 + } }, { label: '盘点数量', @@ -117,6 +129,18 @@ export const AdjustRecordDetail = useCrudSchemas(reactive([ table: { width: 180, }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 + } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2 + } }, { label: '操作', diff --git a/src/views/eam/item/applicationRecord/applicationRecordMain.data.ts b/src/views/eam/item/applicationRecord/applicationRecordMain.data.ts index c83aa89..0160659 100644 --- a/src/views/eam/item/applicationRecord/applicationRecordMain.data.ts +++ b/src/views/eam/item/applicationRecord/applicationRecordMain.data.ts @@ -63,16 +63,16 @@ export const ApplicationRecordMain = useCrudSchemas(reactive([ disabled: true } }, - { - label: '操作', - field: 'action', - isDetail: false, - isForm: false, - table: { - width: 200, - fixed: 'right' - } - } + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 200, + fixed: 'right' + } + } ])) //表单校验 @@ -152,8 +152,8 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive([ disabled: false } }, - - + + { label: '设备/模具编号', field: 'deviceNumber', @@ -164,17 +164,17 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive([ searchListPlaceholder: '请选择单号', searchField: 'number', searchTitle: '单号信息', - searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 - searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 + searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 + searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: "TRUE", isMainValue: false }, { - key: 'type', - value: "type", - isMainValue: true - } + key: 'type', + value: "type", + isMainValue: true + } ] }, }, @@ -188,14 +188,14 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive([ form: { component: 'InputNumber', componentProps: { - min: 1, - precision: 6 + min: 0, + precision: 2 } }, tableForm: { type: 'InputNumber', - min: 1, - precision: 6 + min: 0, + precision: 2 } }, { @@ -205,21 +205,21 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, - form: { - component: 'InputNumber', - componentProps: { - min: 1, - precision: 6 - } - }, - tableForm: { - type: 'InputNumber', - min: 1, - precision: 6 - } + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 + } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2 + } }, - - + + { label: '是否可用', field: 'available', @@ -236,8 +236,8 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive([ disabled: true } }, - - + + { label: '是否以旧换新', field: 'isRadeIn', diff --git a/src/views/eam/item/countRecord/countRecord.data.ts b/src/views/eam/item/countRecord/countRecord.data.ts index 9b5297a..d534c5e 100644 --- a/src/views/eam/item/countRecord/countRecord.data.ts +++ b/src/views/eam/item/countRecord/countRecord.data.ts @@ -147,6 +147,18 @@ export const CountRecordDetail = useCrudSchemas(reactive([ table: { width: 180, }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 + } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2 + } }, { label: '盘点数量', @@ -157,6 +169,18 @@ export const CountRecordDetail = useCrudSchemas(reactive([ table: { width: 180, }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 + } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2 + } }, { label: '操作', diff --git a/src/views/eam/item/countadjustWork/countadjustWork.data.ts b/src/views/eam/item/countadjustWork/countadjustWork.data.ts index 89aa3cb..2453aa3 100644 --- a/src/views/eam/item/countadjustWork/countadjustWork.data.ts +++ b/src/views/eam/item/countadjustWork/countadjustWork.data.ts @@ -118,6 +118,18 @@ export const CountJobDetail = useCrudSchemas(reactive([ table: { width: 180, }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 + } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2 + } }, { label: '操作', diff --git a/src/views/eam/item/itemAccounts/index.vue b/src/views/eam/item/itemAccounts/index.vue index a1669bc..6c9ae75 100644 --- a/src/views/eam/item/itemAccounts/index.vue +++ b/src/views/eam/item/itemAccounts/index.vue @@ -4,29 +4,16 @@ - - + + - + }" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" + v-model:sort="tableObject.sort"> diff --git a/src/views/eam/item/itemApplyMain/index.vue b/src/views/eam/item/itemApplyMain/index.vue index 28798d6..2d7bd1a 100644 --- a/src/views/eam/item/itemApplyMain/index.vue +++ b/src/views/eam/item/itemApplyMain/index.vue @@ -261,6 +261,12 @@ const submitForm = async (formType, data) => { data.subList = tableData.value // 拼接子表数据参数 try { + for (let item of tableData.value) { + if (item.qty > item.currentQty) { + message.error('要货计划数量不得大于订单数量-已计划数量') + return false; + } + } if (formType === 'create') { await ItemApplyMainApi.createItemApplyMain(data) message.success(t('common.createSuccess')) diff --git a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts index f4cb95b..848de51 100644 --- a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts +++ b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts @@ -21,7 +21,7 @@ export const ItemApplyMain = useCrudSchemas(reactive([ fixed: 'left' }, }, - { + { label: '申领人', field: 'applyName', sort: 'custom', @@ -111,135 +111,135 @@ export const ItemApplyDetail = useCrudSchemas(reactive([ isInpuFocusShow: true, searchListPlaceholder: '请选择备件编号', searchField: 'number', - searchTitle: '库区信息', + searchTitle: '备件信息', searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false - } + }, ] }, }, - { - label: '类型', - field: 'type', - sort: 'custom', - dictType: DICT_TYPE.DEVICE_MOLD_TYPE, - dictClass: 'string', - isSearch: true, - isTable: true, - table: { - width: 150 - }, - tableForm: { - type: 'Select', - disabled: false + { + label: '类型', + field: 'type', + sort: 'custom', + dictType: DICT_TYPE.DEVICE_MOLD_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: false + } + }, + + + { + label: '设备/模具编号', + field: 'deviceNumber', + sort: 'custom', + isSearch: true, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择单号', + searchField: 'number', + searchTitle: '单号信息', + searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 + searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: "TRUE", + isMainValue: false + }, { + key: 'type', + value: "type", + isMainValue: true } + ] }, - - - { - label: '设备/模具编号', - field: 'deviceNumber', - sort: 'custom', - isSearch: true, - tableForm: { - isInpuFocusShow: true, - searchListPlaceholder: '请选择单号', - searchField: 'number', - searchTitle: '单号信息', - searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 - searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 - searchCondition: [{ - key: 'available', - value: "TRUE", - isMainValue: false - }, { - key: 'type', - value: "type", - isMainValue: true - } - ] - }, + }, + { + label: '申领数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 }, - { - label: '申领数量', - field: 'qty', - sort: 'custom', - table: { - width: 150 - }, - form: { - component: 'InputNumber', - componentProps: { - min: 1, - precision: 6 - } - }, - tableForm: { - type: 'InputNumber', - min: 1, - precision: 6 + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 } }, - { - label: '库存数量', - field: 'currentQty', - sort: 'custom', - table: { - width: 150 - }, - form: { - component: 'InputNumber', - componentProps: { - min: 1, - precision: 6 - } - }, - tableForm: { - type: 'InputNumber', - min: 1, - precision: 6 - } + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2 + } + }, + { + label: '库存数量', + field: 'currentQty', + sort: 'custom', + table: { + width: 150 }, - - - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', - isSearch: true, - isTable: true, - table: { - width: 150 - }, - tableForm: { - type: 'Select', - disabled: true + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 } }, - - - { - label: '是否以旧换新', - field: 'isRadeIn', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', - isSearch: true, - isTable: true, - table: { - width: 150 - }, - tableForm: { - type: 'Select', - disabled: true - } + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2 + } + }, + + + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 }, + tableForm: { + type: 'Select', + disabled: true + } + }, + + + { + label: '是否以旧换新', + field: 'isRadeIn', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: true + } + }, { label: '备注', field: 'remark', diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index 5b4bbc1..c007b16 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -159,6 +159,7 @@ 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'; @@ -339,16 +340,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 d7d2190..289b84c 100644 --- a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts +++ b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts @@ -7,12 +7,9 @@ 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}) @@ -20,20 +17,12 @@ const repairList = await MoldMaintenanceMainApi.getMoldMainTempList('MOLD') // 表单校验 export const MoldInspectionMainRules = reactive({ number: [required], - deviceNumber: [ - required, - ], - factoryAreaNumber: [ - required, - ], - describes: [ - { max: 200, message: '不得超过200个字符', trigger: 'blur' }, - ], - maintenancePhone: [ - { validator:validateHanset, message: '输入电话格式不正确', trigger: 'blur'} - ], + // maintenanceNumber: [required], + moldNumber: [required], + factoryAreaNumber: [required], status: [required], type: [required], + concurrencyStamp: [required], faultType: [required], }) @@ -91,7 +80,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ }, api: () => moldList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return moldListAll.find((account) => account.number == cellValue)?.name + return moldList.find((account) => account.number == cellValue)?.name }, search: { show: true, @@ -281,25 +270,14 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ } ])) - - + // 表单校验 export const MoldInspectionDetailRules = reactive({ - chargePeoples:[ - required, - ], - estimatedMinutes:[ - required, - { validator:validateNum, message: '请输入数字格式', trigger: 'blur'} - ], number: [required], - actualMinutes: [ - { validator:validateNum, message: '请输入数字格式', trigger: 'blur'} - ], + estimatedMinutes: [required], 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 0640536..c44c1a9 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, - number:data.number, + maintenanceNumber:data.maintenanceNumber, 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 69450c4..12cfa48 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -55,14 +55,13 @@ :tableData="tableData" :apiUpdate="MoldMaintenanceMainApi.updateMoldMaintenanceMain" :apiCreate="MoldMaintenanceMainApi.createMoldMaintenanceMain" - :isBusiness="false" + :isBusiness="true" @onChange="onChange" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" - @success="submitForm" - :isSearchTableItem="true" + :isSearchTableItem="true" /> @@ -290,11 +289,7 @@ const buttonTableClick = async (val, row) => { acceptOrder(row) } else if (val == 'turnOrder') { openForm('turnOrder', row) - } else if (val == 'finishOrder') { - finishOrder(row) - } else if (val == 'repair') { - openDetail(row, '代码', row.code) - } else if (val == 'picture') { + }else if (val == 'picture') { showView.value = true urls.value = row.filePathList viewKey.value += 1 @@ -374,19 +369,7 @@ function acceptOrder(row) { // 转办 function turnOrder() {} // 完成 -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 finishOrder() {} // 验证 function verifyOrder() {} // 维修 @@ -481,8 +464,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { try { let data1 = { id:data.id, - number: data.number, - masterId: data.id, + maintenanceNumber:data.maintenanceNumber, 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 ea50e0d..462408d 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: 'MOLD', factoryAreaNumber: '', flag: 1 }) +const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) // 表单校验 export const MoldMaintenanceMainRules = reactive({ number: [required], @@ -86,9 +86,6 @@ 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', @@ -109,7 +106,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, - placeholder: "请先选择设备" + placeholder: "请先选择模具" }, } }, @@ -192,33 +189,7 @@ 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, - } + }, }, {