From 78870b52b61bb3340d13b845a5f1958961c4fbae Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Tue, 8 Sep 2026 15:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E5=93=81=E5=A4=87=E4=BB=B6=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E6=9F=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/partspare/partSpareLocation.js | 2 + src/api/partspare/smartCabinet.js | 10 + .../modules/partspare/partSpareLocation.vue | 132 +++++++++++- .../modules/partspare/repairtransdetail.vue | 86 ++++++++ .../modules/partspare/smartCabinetSyncLog.vue | 143 +++++++++++++ .../modules/partspare/spareBorrowRecord.vue | 99 +++++++++ .../modules/partspare/spareStocktake.vue | 188 ++++++++++++++++++ .../reportWorkOrder/reportDefectOrder.vue | 6 +- .../reportWorkOrder/reportDefectOrder2.vue | 6 +- .../reportMaintenanceOrder.vue | 6 +- 10 files changed, 668 insertions(+), 10 deletions(-) create mode 100644 src/api/partspare/smartCabinet.js create mode 100644 src/views/modules/partspare/smartCabinetSyncLog.vue create mode 100644 src/views/modules/partspare/spareBorrowRecord.vue create mode 100644 src/views/modules/partspare/spareStocktake.vue diff --git a/src/api/partspare/partSpareLocation.js b/src/api/partspare/partSpareLocation.js index bf878a0..a9bdb69 100644 --- a/src/api/partspare/partSpareLocation.js +++ b/src/api/partspare/partSpareLocation.js @@ -14,6 +14,8 @@ export const updatePartSpareLocation = data => createAPI(`/pms/partSpareLocation // 删除货位 export const deletePartSpareLocation = data => createAPI(`/pms/partSpareLocation/deletePartSpareLocation`, 'post', data) +export const createSmartCabinet = data => createAPI(`/pms/partSpareLocation/createSmartCabinet`, 'post', data) + // 打印 export function partSpareLocationTemp (dataList) { const LODOP = getLodop() diff --git a/src/api/partspare/smartCabinet.js b/src/api/partspare/smartCabinet.js new file mode 100644 index 0000000..3788c46 --- /dev/null +++ b/src/api/partspare/smartCabinet.js @@ -0,0 +1,10 @@ +import { createAPI } from '@/utils/httpRequest.js' + +export const searchStocktakeList = data => createAPI('/pms/smartcabinet/stocktake/list', 'POST', data) +export const getStocktakeInfo = data => createAPI('/pms/smartcabinet/stocktake/info', 'POST', data) +export const confirmStocktake = data => createAPI('/pms/smartcabinet/stocktake/confirm', 'POST', data) +export const cancelStocktake = data => createAPI('/pms/smartcabinet/stocktake/cancel', 'POST', data) +export const searchBorrowList = data => createAPI('/pms/smartcabinet/borrow/list', 'POST', data) +export const searchSyncLogList = data => createAPI('/pms/smartcabinet/syncLog/list', 'POST', data) +export const retrySyncLog = data => createAPI('/pms/smartcabinet/syncLog/retry', 'POST', data) +export const pickCreate = data => createAPI('/pms/smartcabinet/pick/create', 'POST', data) diff --git a/src/views/modules/partspare/partSpareLocation.vue b/src/views/modules/partspare/partSpareLocation.vue index b83fa24..21dae66 100644 --- a/src/views/modules/partspare/partSpareLocation.vue +++ b/src/views/modules/partspare/partSpareLocation.vue @@ -37,6 +37,7 @@ 查询 新增 + 新增智能柜 打印 - + + + + + + + {{ i.sitename }} + + {{ i.buDesc }} + + + + + + + + + + + + + + + + + + + + + +
+ 将生成仓库(备品备件仓)及 {{ smartCabinetTotal }} 个货位,编码为 + {{ smartCabinetPreview }} +
+ + 生成 + 关闭 + +
@@ -171,6 +214,7 @@ import { savePartSpareLocation, // 新增货位 updatePartSpareLocation, // 修改货位 deletePartSpareLocation, // 删除货位 + createSmartCabinet, partSpareLocationTemp, // 打印 } from '@/api/partspare/partSpareLocation.js' import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" @@ -465,6 +509,33 @@ export default { modalFlag: false, modalDisableFlag: false, dataListLoading: false, + smartCabinetFlag: false, + smartCabinetData: { + bu: '', + cabinetCode: '', + description: '', + horizontal: 1, + vertical: 1 + }, + } + }, + + computed: { + smartCabinetTotal () { + const horizontal = Number(this.smartCabinetData.horizontal) || 0 + const vertical = Number(this.smartCabinetData.vertical) || 0 + return horizontal > 0 && vertical > 0 ? horizontal * vertical : 0 + }, + smartCabinetPreview () { + const code = (this.smartCabinetData.cabinetCode || '编码').trim() || '编码' + const total = this.smartCabinetTotal + if (total <= 0) { + return code + '-1' + } + if (total === 1) { + return code + '-1' + } + return code + '-1 至 ' + code + '-' + total } }, @@ -570,6 +641,65 @@ export default { this.modalFlag = true }, + openSmartCabinetModal () { + this.smartCabinetData = { + bu: this.userBuList.length > 0 ? this.userBuList[0].buNo : '', + cabinetCode: '', + description: '', + horizontal: 1, + vertical: 1 + } + this.smartCabinetFlag = true + }, + + saveSmartCabinet () { + if (this.smartCabinetData.bu === '' || this.smartCabinetData.bu == null) { + this.$message.warning('请选择BU!') + return + } + if (!this.smartCabinetData.cabinetCode || !this.smartCabinetData.cabinetCode.trim()) { + this.$message.warning('请输入智能柜编码!') + return + } + if (!this.smartCabinetData.description || !this.smartCabinetData.description.trim()) { + this.$message.warning('请输入智能柜名称!') + return + } + if (!this.smartCabinetData.horizontal || this.smartCabinetData.horizontal < 1) { + this.$message.warning('请输入横向库位数!') + return + } + if (!this.smartCabinetData.vertical || this.smartCabinetData.vertical < 1) { + this.$message.warning('请输入纵向库位数!') + return + } + const payload = { + bu: this.smartCabinetData.bu, + cabinetCode: this.smartCabinetData.cabinetCode.trim(), + description: this.smartCabinetData.description.trim(), + horizontal: this.smartCabinetData.horizontal, + vertical: this.smartCabinetData.vertical, + createBy: this.$store.state.user.name + } + createSmartCabinet(payload).then(({ data }) => { + if (data && data.code === 0) { + this.smartCabinetFlag = false + this.getWareHouseList() + this.getDataList() + this.$message({ + message: data.msg || '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 编辑模态框 updateModal (row) { this.modalData = { diff --git a/src/views/modules/partspare/repairtransdetail.vue b/src/views/modules/partspare/repairtransdetail.vue index 0d440c0..1d1993e 100644 --- a/src/views/modules/partspare/repairtransdetail.vue +++ b/src/views/modules/partspare/repairtransdetail.vue @@ -26,6 +26,15 @@
+ + + + + + + + + @@ -154,6 +163,7 @@ export default { site: '', buDesc: '', direction: '', + status: '', partNo: '', partDescription: '', batchNo: '', @@ -302,6 +312,40 @@ export default { status: true, fixed: '', columnWidth: 140, + }, { + userId: this.$store.state.user.name, + functionId:200101104, + serialNumber: '200101104TableStatus', + tableId: "200101104Table", + tableName: "出入库明细表", + columnProp: 'status', + headerAlign: "center", + align: "left", + columnLabel: '单据状态', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 90, + }, { + userId: this.$store.state.user.name, + functionId:200101104, + serialNumber: '200101104TableCabinetBillNo', + tableId: "200101104Table", + tableName: "出入库明细表", + columnProp: 'cabinetBillNo', + headerAlign: "center", + align: "left", + columnLabel: '柜侧单号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 140, }, { userId: this.$store.state.user.name, functionId:200101104, @@ -687,6 +731,27 @@ export default { case 1: // 检查是否有领用人列,如果没有则添加 const hasRemark3 = data.rows.some(item => item.columnProp === 'remark3') + const hasStatus = data.rows.some(item => item.columnProp === 'status') + if (!hasStatus) { + data.rows.push({ + userId: this.$store.state.user.name, + functionId: 200101104, + serialNumber: '200101104TableStatus', + tableId: "200101104Table", + tableName: "出入库明细表", + columnProp: 'status', + headerAlign: "center", + align: "left", + columnLabel: '单据状态', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 90 + }) + } if (!hasRemark3) { // 找到备注列的位置 const remarkIndex = data.rows.findIndex(item => item.columnProp === 'remark') @@ -735,6 +800,27 @@ export default { case 1: // 检查是否有领用人列,如果没有则添加 const hasRemark3 = data.rows.some(item => item.columnProp === 'remark3') + const hasStatus = data.rows.some(item => item.columnProp === 'status') + if (!hasStatus) { + data.rows.push({ + userId: this.$store.state.user.name, + functionId: 200101104, + serialNumber: '200101104TableStatus', + tableId: "200101104Table", + tableName: "出入库明细表", + columnProp: 'status', + headerAlign: "center", + align: "left", + columnLabel: '单据状态', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 90 + }) + } if (!hasRemark3) { // 找到备注列的位置 const remarkIndex = data.rows.findIndex(item => item.columnProp === 'remark') diff --git a/src/views/modules/partspare/smartCabinetSyncLog.vue b/src/views/modules/partspare/smartCabinetSyncLog.vue new file mode 100644 index 0000000..ac2dfc4 --- /dev/null +++ b/src/views/modules/partspare/smartCabinetSyncLog.vue @@ -0,0 +1,143 @@ + + + diff --git a/src/views/modules/partspare/spareBorrowRecord.vue b/src/views/modules/partspare/spareBorrowRecord.vue new file mode 100644 index 0000000..0529baa --- /dev/null +++ b/src/views/modules/partspare/spareBorrowRecord.vue @@ -0,0 +1,99 @@ + + + diff --git a/src/views/modules/partspare/spareStocktake.vue b/src/views/modules/partspare/spareStocktake.vue new file mode 100644 index 0000000..346a067 --- /dev/null +++ b/src/views/modules/partspare/spareStocktake.vue @@ -0,0 +1,188 @@ + + + diff --git a/src/views/modules/reportWorkOrder/reportDefectOrder.vue b/src/views/modules/reportWorkOrder/reportDefectOrder.vue index 19eba2b..3870c52 100644 --- a/src/views/modules/reportWorkOrder/reportDefectOrder.vue +++ b/src/views/modules/reportWorkOrder/reportDefectOrder.vue @@ -728,12 +728,12 @@ getFeedBackImages, // 获取故障图片 deleteObjectFile, getInventoryStockList, // 获取领用出库信息 - saveTrans, // 维修出库 saveCoreComponent, getSparPartImages, // 获取备件图片 deleteCoreComponents,//删除核心备件 reportExchangeWorkOrderExcel//执行工单导出 } from "@/api/eam/eam.js" + import { pickCreate } from '@/api/partspare/smartCabinet.js' import { downLoadObjectFile, getDeviceCorePartListAll, @@ -1863,10 +1863,10 @@ orderNo: this.saveData.orderNo, outType: '维修出库' } - saveTrans(jsonData).then(({data}) => { + pickCreate(jsonData).then(({data}) => { if (data.code === 0) { this.$message({ - message: '操作成功', + message: data.msg || '已下发智能柜,待领料完成回写', type: 'success', duration: 1500, onClose: () => {} diff --git a/src/views/modules/reportWorkOrder/reportDefectOrder2.vue b/src/views/modules/reportWorkOrder/reportDefectOrder2.vue index 3f5ae37..5f94140 100644 --- a/src/views/modules/reportWorkOrder/reportDefectOrder2.vue +++ b/src/views/modules/reportWorkOrder/reportDefectOrder2.vue @@ -828,13 +828,13 @@ import { getFeedBackImages, // 获取故障图片 deleteObjectFile, getInventoryStockList, // 获取领用出库信息 - saveTrans, // 维修出库 saveCoreComponent, getCoreSerialLatestAction, getSparPartImages, // 获取备件图片 deleteCoreComponents,//删除核心备件 reportExchangeWorkOrderExcel//执行工单导出 } from "@/api/eam/eam.js" +import { pickCreate } from '@/api/partspare/smartCabinet.js' import { downLoadObjectFile, getDeviceCorePartList, @@ -2085,10 +2085,10 @@ export default { orderNo: this.saveData.orderNo, outType: '维修出库' } - saveTrans(jsonData).then(({data}) => { + pickCreate(jsonData).then(({data}) => { if (data.code === 0) { this.$message({ - message: '操作成功', + message: data.msg || '已下发智能柜,待领料完成回写', type: 'success', duration: 1500, onClose: () => {} diff --git a/src/views/modules/reportWorkOrder/reportMaintenanceOrder.vue b/src/views/modules/reportWorkOrder/reportMaintenanceOrder.vue index 142999e..de47f9c 100644 --- a/src/views/modules/reportWorkOrder/reportMaintenanceOrder.vue +++ b/src/views/modules/reportWorkOrder/reportMaintenanceOrder.vue @@ -549,8 +549,8 @@ getSiteAndBuByUserName, getUserRoleList, // 获取用户角色列表 getInventoryStockList, // 获取领用出库信息 - saveTrans, // 维修出库 } from "@/api/eam/eam.js" + import { pickCreate } from '@/api/partspare/smartCabinet.js' import { getTableDefaultListLanguage, getTableUserListLanguage, @@ -1562,10 +1562,10 @@ orderNo: this.saveData.orderNo, outType: '维保出库' } - saveTrans(jsonData).then(({data}) => { + pickCreate(jsonData).then(({data}) => { if (data.code === 0) { this.$message({ - message: '操作成功', + message: data.msg || '已下发智能柜,待领料完成回写', type: 'success', duration: 1500, onClose: () => {}