From c4b48a5f22e8825efddbbceb3c5488439a976dc6 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Wed, 25 Dec 2024 09:07:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=9F=E4=BA=A7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/basic/location/index.ts | 3 + src/api/eam/item/itemAccounts/index.ts | 2 +- src/views/eam/basic/item/item.data.ts | 4 +- .../deviceInternalAudit.data.ts | 5 +- .../eam/device/deviceinspectionjob/index.vue | 13 +- .../deviceMaintainOrderMain.data.ts | 4 +- src/views/eam/item/itemAccounts/index.vue | 47 ++++++- .../item/itemAccounts/itemAccounts.data.ts | 124 +++++++++++++++--- .../eam/mold/moldinspectionjob/index.vue | 2 +- .../moldMaintainOrderMain.data.ts | 5 +- 10 files changed, 170 insertions(+), 39 deletions(-) diff --git a/src/api/eam/basic/location/index.ts b/src/api/eam/basic/location/index.ts index 6785906..8a4682f 100644 --- a/src/api/eam/basic/location/index.ts +++ b/src/api/eam/basic/location/index.ts @@ -61,6 +61,9 @@ export const selectPageByConditions = async (params) => { // 不在台账中的库位 export const getLocationNoInAccountPage = async (params) => { + if (params.isInAccount == 'ALL') { + delete params.isInAccount + } if (params.isSearch) { delete params.isSearch const data = {...params} diff --git a/src/api/eam/item/itemAccounts/index.ts b/src/api/eam/item/itemAccounts/index.ts index 88fb3d1..7087dc3 100644 --- a/src/api/eam/item/itemAccounts/index.ts +++ b/src/api/eam/item/itemAccounts/index.ts @@ -59,5 +59,5 @@ export const replaceLocation = async (data: Array) => { // 备件不分页 export const getItemAccountsNoPage = async (params) => { - return await request.get({ url: `/eam/item-accounts/noPage`, params }) + return await request.get({ url: `/eam/item-accounts/noPage`, params}) } diff --git a/src/views/eam/basic/item/item.data.ts b/src/views/eam/basic/item/item.data.ts index 9ab0806..6e24154 100644 --- a/src/views/eam/basic/item/item.data.ts +++ b/src/views/eam/basic/item/item.data.ts @@ -160,13 +160,13 @@ export const Item = useCrudSchemas(reactive([ field: 'safetyStock', sort: 'custom', isSearch: false, - isForm: false, + isForm: true, table: { width: 110, }, form: { component: 'InputNumber', - value: 0 + value: 0, }, }, { diff --git a/src/views/eam/device/deviceInternalAudit/deviceInternalAudit.data.ts b/src/views/eam/device/deviceInternalAudit/deviceInternalAudit.data.ts index 2ad9a66..c4ecebc 100644 --- a/src/views/eam/device/deviceInternalAudit/deviceInternalAudit.data.ts +++ b/src/views/eam/device/deviceInternalAudit/deviceInternalAudit.data.ts @@ -5,7 +5,7 @@ import { dateFormatter } from '@/utils/formatTime' export const DeviceInternalAuditRules = reactive({ personer: [ { required: true, message: '请输入人员', trigger: 'blur' }, - + { max: 20, message: '不得超过20', trigger: 'blur' } ], fitOut: [ { required: true, message: '请输入装配', trigger: 'blur' }, @@ -43,6 +43,9 @@ export const DeviceInternalAuditRules = reactive({ { required: true, message: '请输入模具前期', trigger: 'blur' }, // { max: 200, message: '不得超过200', trigger: 'blur' } ], + describes: [ + { max: 200, message: '不得超过200', trigger: 'blur' } + ] }) export const DeviceInternalAudit = useCrudSchemas(reactive([ diff --git a/src/views/eam/device/deviceinspectionjob/index.vue b/src/views/eam/device/deviceinspectionjob/index.vue index a322bfd..4af61c6 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -259,6 +259,7 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = (row) => { + return [ // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // 删除 @@ -271,7 +272,7 @@ const butttondata = (row) => { }), // 验证 defaultButtons.orderPrintBtn({ hasPermi:'eam:device-inspection-job-main:print', - hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED') && judgeIsTheClassEngineer(row)) + hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED')) }) // 打印 ] } @@ -737,16 +738,6 @@ function verifyCancel(row) { verifyDialogVisible.value = false } -const judgeIsTheClassEngineer = (row) => { - const rolesOk = userStore.roles.find(item => { - return item == 'device_class_Engineer_role' - }) - if (rolesOk != undefined && rolesOk != null) { - return true - } else { - return false - } -} const orderPrint = (row) => { window.open(src.value + "&id=" + row.id) diff --git a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts index baadb2b..1f6994e 100644 --- a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts +++ b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts @@ -353,7 +353,7 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive([ }, tableForm: { type: 'Select', - initOptions: userList, + initOptions: dutyUserList, multiple:true, collapseTags:true, collapseTagsTooltip:true, @@ -365,7 +365,7 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive([ }, api: () => dutyUserList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return userList.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',') + return dutyUserList.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',') }, form: { component: 'Select', diff --git a/src/views/eam/item/itemAccounts/index.vue b/src/views/eam/item/itemAccounts/index.vue index c8b7085..5ce2318 100644 --- a/src/views/eam/item/itemAccounts/index.vue +++ b/src/views/eam/item/itemAccounts/index.vue @@ -113,10 +113,51 @@ const urls = ref([]) const viewKey = ref(0) // 查询页面返回 -const searchTableSuccess = (formField, searchField, val, formRef) => { +const searchTableSuccess = async (formField, searchField, val, formRef) => { + const setV = {} + setV[formField] = val[0][searchField] + if (formField == 'itemNumber') { + const params = { + 'itemNumber': val[0]['number'] + }; + await ItemAccountsApi.getItemAccountsNoPage(params).then((res) => { + let oldData = ['TRUE', 'FALSE']; + // 遍历 res 中的每一项 item + res.forEach(item => { + // 从 oldData 中排除 item.isInAccount + oldData = oldData.filter(data => data !== item.isInAccount); + }); + // 根据 oldData 剩余项设置 setV['isInAccountWill'] + if (oldData.length === 2) { + setV['isInAccountWill'] = 'ALL'; + } else if (oldData.length === 1) { + setV['isInAccountWill'] = oldData[0]; + } else { + setV['isInAccountWill'] = 'BOTH'; + } + console.log(setV); + }); + setV['name'] = val[0]['name'], + setV['specifications'] = val[0]['specifications'], + setV['singlePrice'] = val[0]['singlePrice'], + setV['category'] = val[0]['category'], + setV['classification'] = val[0]['classification'], + setV['cost'] = val[0]['cost'], + setV['financer'] = val[0]['financer'], + setV['isConstant'] = val[0]['isConstant'], + setV['isFramework'] = val[0]['isFramework'], + setV['isRadeIn'] = val[0]['isRadeIn'], + setV['purchaser'] = val[0]['purchaser'], + setV['region'] = val[0]['region'], + setV['reprocurement'] = val[0]['reprocurement'], + setV['subject'] = val[0]['subject'], + setV['subjectCode'] = val[0]['subjectCode'], + setV['uom'] = val[0]['uom'] + setV['safetyStock'] = val[0]['safetyStock'] + } else if (formField == 'locationNumber') { + setV['isInAccount'] = val[0]['isInAccount'] + } nextTick(() => { - const setV = {} - setV[formField] = val[0][searchField] formRef.setValues(setV) }) } diff --git a/src/views/eam/item/itemAccounts/itemAccounts.data.ts b/src/views/eam/item/itemAccounts/itemAccounts.data.ts index 70c52d9..8fa761a 100644 --- a/src/views/eam/item/itemAccounts/itemAccounts.data.ts +++ b/src/views/eam/item/itemAccounts/itemAccounts.data.ts @@ -75,14 +75,31 @@ export const ItemAccounts = useCrudSchemas(reactive([ value: 'areaNumber', message: '请选择库区编号!', isMainValue: true, // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 // 前置添加必有,和isFormModel结合使用 + },{ + key: 'isInAccount', + value: 'isInAccountWill', + message: '请选择备件编号!', + isMainValue: true, // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 // 前置添加必有,和isFormModel结合使用 }] } } }, + { + + label: '是否账内预期值', + field: 'isInAccountWill', + sort: 'custom', + isDetail: false, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: false, + }, { label: '备件名称', field: 'name', sort: 'custom', + isForm: false, table: { width: 110 }, @@ -92,6 +109,12 @@ export const ItemAccounts = useCrudSchemas(reactive([ label: '规格', field: 'specifications', sort: 'custom', + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { label: '(账内或账外)库存数量', @@ -132,11 +155,18 @@ export const ItemAccounts = useCrudSchemas(reactive([ label: '单价', field: 'singlePrice', sort: 'custom', + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { label: '总价', field: 'totalPrice', sort: 'custom', + isForm: false, }, { label: '是否账内库', @@ -159,7 +189,8 @@ export const ItemAccounts = useCrudSchemas(reactive([ value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TRUE' + activeValue: 'TRUE', + disabled: true } } }, @@ -185,7 +216,8 @@ export const ItemAccounts = useCrudSchemas(reactive([ value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TRUE' + activeValue: 'TRUE', + disabled: true } } }, @@ -199,7 +231,13 @@ export const ItemAccounts = useCrudSchemas(reactive([ isTable: true, tableForm: { type: 'Select' - } + }, + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { @@ -207,6 +245,12 @@ export const ItemAccounts = useCrudSchemas(reactive([ field: 'subjectCode', sort: 'custom', isTable: true, + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { label: '单位', @@ -218,7 +262,13 @@ export const ItemAccounts = useCrudSchemas(reactive([ isTable: true, tableForm: { type: 'Select' - } + }, + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { label: '类别', @@ -230,7 +280,13 @@ export const ItemAccounts = useCrudSchemas(reactive([ isTable: true, tableForm: { type: 'Select' - } + }, + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { label: '备件分类', @@ -242,7 +298,13 @@ export const ItemAccounts = useCrudSchemas(reactive([ isTable: true, tableForm: { type: 'Select' - } + }, + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { label: '区域', @@ -254,7 +316,13 @@ export const ItemAccounts = useCrudSchemas(reactive([ isTable: true, tableForm: { type: 'Select' - } + }, + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, // { // label: '单价', @@ -268,22 +336,27 @@ export const ItemAccounts = useCrudSchemas(reactive([ table: { width: 110, }, + isForm: true, form: { - component: 'InputNumber', - value: 0 + componentProps: { + disabled: true + } }, }, { label: '安全库存', field: 'safetyStock', sort: 'custom', - isForm: false, + isForm: true, table: { width: 110, }, form: { component: 'InputNumber', - value: 0 + value: 0, + componentProps: { + disabled: true + } }, }, { @@ -293,6 +366,12 @@ export const ItemAccounts = useCrudSchemas(reactive([ table: { width: 110, }, + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { label: '采购员', @@ -301,11 +380,23 @@ export const ItemAccounts = useCrudSchemas(reactive([ table: { width: 100, }, + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { label: '财务', field: 'financer', sort: 'custom', + isForm: true, + form: { + componentProps: { + disabled: true + } + }, }, { label: '是否以旧换新', @@ -328,7 +419,8 @@ export const ItemAccounts = useCrudSchemas(reactive([ value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TRUE' + activeValue: 'TRUE', + disabled: true } } }, @@ -337,10 +429,10 @@ export const ItemAccounts = useCrudSchemas(reactive([ field: 'purchaseTime', sort: 'custom', formatter: dateFormatter, - isForm: false, table: { width: 150 }, + isForm: false, }, { label: '库龄', @@ -387,7 +479,8 @@ export const ItemAccounts = useCrudSchemas(reactive([ value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TRUE' + activeValue: 'TRUE', + disabled: true } } }, @@ -414,7 +507,8 @@ export const ItemAccounts = useCrudSchemas(reactive([ inactiveValue: 'FALSE', activeValue: 'TRUE' } - } + }, + isForm: false }, { label: '操作', diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index f02c9f8..b17c585 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -547,7 +547,7 @@ const detailSubmitForm = async (formType, data, formRef, tableList) => { estimatedMinutes: data.estimatedMinutes, actualMinutes: data.actualMinutes, chargePeoples: data.chargePeoples.join(','), - completionTime: data.completionTime?data.completionTime:null, + completionTime: data.completionTime?data.completionTime:'', engineer: data.engineer, uncompleted: data.uncompleted, itemNumbers: data.itemNumbers, diff --git a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts index 9a382cb..5aaa0b7 100644 --- a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts +++ b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts @@ -401,7 +401,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ }, tableForm: { type: 'Select', - initOptions: userList, + initOptions: dutyUserList, multiple: true, collapseTags: true, collapseTagsTooltip: true, @@ -413,8 +413,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ }, api: () => dutyUserList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - - return userList.filter(item => cellValue?.includes(item.id)).map(cur => cur.name).join(',') + return dutyUserList.filter(item => cellValue?.includes(item.id)).map(cur => cur.name).join(',') }, form: { component: 'Select',