diff --git a/apps/hand-factory/api/wms/coil.js b/apps/hand-factory/api/wms/coil.js index 7ab2866..1db14ad 100644 --- a/apps/hand-factory/api/wms/coil.js +++ b/apps/hand-factory/api/wms/coil.js @@ -75,3 +75,11 @@ export function exportCoil(coilId) { method: 'get' }) } + +// 撤回钢卷发货 +export function cancelExportCoil(coilId) { + return request({ + url: '/wms/materialCoil/withdrawExportCoil/' + coilId, + method: 'get' + }) +} \ No newline at end of file diff --git a/apps/hand-factory/config.js b/apps/hand-factory/config.js index a41c69a..71e24a5 100644 --- a/apps/hand-factory/config.js +++ b/apps/hand-factory/config.js @@ -8,7 +8,7 @@ module.exports = { // 应用名称 name: "ruoyi-app", // 应用版本 - version: "1.3.19", + version: "1.3.20", // 应用logo logo: "/static/logo.jpg", // 官方网站 diff --git a/apps/hand-factory/manifest.json b/apps/hand-factory/manifest.json index aa554a6..73e7d2c 100644 --- a/apps/hand-factory/manifest.json +++ b/apps/hand-factory/manifest.json @@ -2,7 +2,7 @@ "name" : "科伦普", "appid" : "__UNI__E781B49", "description" : "", - "versionName" : "1.3.19", + "versionName" : "1.3.20", "versionCode" : 1, "transformPx" : false, "app-plus" : { diff --git a/apps/hand-factory/pages/easycode/easycode.vue b/apps/hand-factory/pages/easycode/easycode.vue index a4cbfce..9a0303c 100644 --- a/apps/hand-factory/pages/easycode/easycode.vue +++ b/apps/hand-factory/pages/easycode/easycode.vue @@ -36,6 +36,7 @@ + @@ -108,6 +109,58 @@ + + + + + + + 入场钢卷号 + {{ coilDetail.enterCoilNo || '-' }} + + + 当前钢卷号 + {{ coilDetail.currentCoilNo || '-' }} + + + 重量 + {{ coilDetail.netWeight || '-' }} + + + 厂家 + {{ coilDetail.product && coilDetail.product.manufacturer || '-' }} + + + 材质 + {{ coilDetail.product && coilDetail.product.material || '-' }} + + + 规格 + {{ coilDetail.product && coilDetail.product.specification || '-' }} + + + 品名 + {{ coilDetail.product && coilDetail.product.productName || '-' }} + + + + + + + + @@ -123,7 +176,8 @@ updateMaterialCoilSimple, listMaterialCoil, updateMaterialCoil, - exportCoil + exportCoil, + cancelExportCoil } from '@/api/wms/coil.js' import { addPendingAction @@ -141,7 +195,9 @@ form: {}, targetWarehouse: null, // 存储选中的目标库区信息 bomDialogShow: false, // BOM参数弹窗控制(原有功能补充), - mode: 'pda' // pda或camera + mode: 'pda', // pda或camera + currentAction: '', + buttonLoading: false, } }, computed: { @@ -169,6 +225,54 @@ }) }, + async handleCancelShip() { + // 撤回发货 + this.currentAction = 'withdrawShip'; + const content = await this.getQRCodeContent() + let coilId = content.current_coil_id && content.current_coil_id !== 'null' ? content + .current_coil_id : null; + if (!coilId) { + uni.showToast({ + title: '二维码异常', + icon: 'none' + }) + return; + } + const coilRes = await getMaterialCoil(coilId); + if (coilRes.data.status == 0) { + uni.showToast({ + title: '钢卷还未发货', + icon: 'error' + }) + return; + } + this.coilDetail = coilRes.data; + this.$refs.shipPopup.open('bottom'); + }, + + async handleCancelShipSubmit() { + if (!this.coilDetail.coilId) { + uni.showToast({ + title: '钢卷标识缺失', + icon: 'none' + }) + } + const res = await cancelExportCoil(this.coilDetail.coilId) + console.log(res) + if (res.code != 200) { + uni.showToast({ + icon: 'error', + title: res.message || '撤回失败请重试' + }) + return; + } + uni.showToast({ + icon: 'success', + title: this.coilDetail.currentCoilNo + '发货已撤回' + }) + this.$refs.shipPopup.close() + }, + scan(mode = 'camera') { return new Promise((resolve, reject) => { if (mode == 'camera') { @@ -393,68 +497,121 @@ }) return; } + this.$refs.shipPopup.open('bottom'); + this.currentAction = 'ship'; + this.coilDetail = coilRes.data - uni.showModal({ - cancelText: '取消', - confirmText: '确认', - title: '确定要将钢卷号为:' + coilRes.data.currentCoilNo + '发货吗?', - showCancel: true, - success: async (res) => { - console.log(res) - if (res.cancel) { - uni.showToast({ - title: '已取消发货', - icon: 'none' - }) - return; - } - try { - // 判断钢卷的质量状态,必须是A+, A,A-, B+其中之一 - if (!['A+', 'A', 'A-', 'B+'].includes(coilRes.data.qualityStatus)) { - uni.showToast({ - title: '只能发货B+以上品质的钢卷', - icon: 'none' - }); - return; - } - // 1. 更新钢卷状态为已发货 - await exportCoil(coilRes.data.coilId); + // uni.showModal({ + // cancelText: '取消', + // confirmText: '确认', + // title: '确定要将钢卷号为:' + coilRes.data.currentCoilNo + '发货吗?', + // showCancel: true, + // success: async (res) => { + // console.log(res) + // if (res.cancel) { + // uni.showToast({ + // title: '已取消发货', + // icon: 'none' + // }) + // return; + // } + // try { + // // 判断钢卷的质量状态,必须是A+, A,A-, B+其中之一 + // if (!['A+', 'A', 'A-', 'B+'].includes(coilRes.data.qualityStatus)) { + // uni.showToast({ + // title: '只能发货B+以上品质的钢卷', + // icon: 'none' + // }); + // return; + // } + // // 1. 更新钢卷状态为已发货 + // await exportCoil(coilRes.data.coilId); - // 2. 插入一条已完成的待操作记录 - await addPendingAction({ - coilId: coilRes.data.coilId, - currentCoilNo: coilRes.data.currentCoilNo, - actionType: 402, // 402=发货 - actionStatus: 2, // 直接标记为完成状态 - scanTime: new Date(), - scanDevice: this.getDeviceInfo(), - priority: 0, // 0=普通 - sourceType: 'scan', - warehouseId: coilRes.data.warehouseId, - processTime: new Date(), - completeTime: new Date() - }); + // // 2. 插入一条已完成的待操作记录 + // await addPendingAction({ + // coilId: coilRes.data.coilId, + // currentCoilNo: coilRes.data.currentCoilNo, + // actionType: 402, // 402=发货 + // actionStatus: 2, // 直接标记为完成状态 + // scanTime: new Date(), + // scanDevice: this.getDeviceInfo(), + // priority: 0, // 0=普通 + // sourceType: 'scan', + // warehouseId: coilRes.data.warehouseId, + // processTime: new Date(), + // completeTime: new Date() + // }); - uni.showToast({ - title: '发货成功', - icon: 'none' - }); - } catch (error) { - console.error('发货失败:', error); - uni.showToast({ - title: error?.message || '发货失败', - icon: 'none' - }); - } - }, - fail() { + // uni.showToast({ + // title: '发货成功', + // icon: 'none' + // }); + // } catch (error) { + // console.error('发货失败:', error); + // uni.showToast({ + // title: error?.message || '发货失败', + // icon: 'none' + // }); + // } + // }, + // fail() { + // uni.showToast({ + // title: '已取消发货', + // icon: 'none' + // }) + // } + // }); + // uni.hideLoading(); + }, + + async handleShipSubmit() { + try { + // 判断钢卷的质量状态,必须是A+, A,A-, B+其中之一 + if (!['A+', 'A', 'A-', 'B+'].includes(this.coilDetail.qualityStatus)) { uni.showToast({ - title: '已取消发货', + title: '只能发货B+以上品质的钢卷', icon: 'none' - }) + }); + return; } - }); - uni.hideLoading(); + // 1. 更新钢卷状态为已发货 + const res = await exportCoil(this.coilDetail.coilId); + + // 2. 插入一条已完成的待操作记录 + await addPendingAction({ + coilId: this.coilDetail.coilId, + currentCoilNo: this.coilDetail.currentCoilNo, + actionType: 402, // 402=发货 + actionStatus: 2, // 直接标记为完成状态 + scanTime: new Date(), + scanDevice: this.getDeviceInfo(), + priority: 0, // 0=普通 + sourceType: 'scan', + warehouseId: this.coilDetail.warehouseId, + processTime: new Date(), + completeTime: new Date() + }); + + if (res.code != 200) { + uni.showToast({ + icon: 'error', + title: res.message || '发货失败请重试' + }) + return; + } + + uni.showToast({ + title: '发货成功', + icon: 'success' + }); + this.$refs.shipPopup.close() + } catch (error) { + console.error('发货失败:', error); + uni.showToast({ + title: error?.message || '发货失败', + icon: 'none' + }); + } }, // 移库操作:第一步 - 扫描钢卷,打开移库弹窗(原有方法优化) diff --git a/apps/hand-factory/utils/update.js b/apps/hand-factory/utils/update.js index 711eb2b..47d6697 100644 --- a/apps/hand-factory/utils/update.js +++ b/apps/hand-factory/utils/update.js @@ -73,7 +73,7 @@ function checkStorageSpace() { function checkUpdate(forceCheck = false) { // 1. 准备本地版本信息 const localVersion = plus.runtime.version; // 基座版本 - const staticVersion = '1.3.19'; // 静态默认版本 + const staticVersion = '1.3.20'; // 静态默认版本 const localWgtVersion = uni.getStorageSync('wgtVersion') || staticVersion; // 本地wgt版本(从存储获取或用默认) const currentVersion = compareVersion(localWgtVersion, localVersion) > 0 ? localWgtVersion diff --git a/apps/hand-factory/version.json b/apps/hand-factory/version.json index 2431a27..f827cb4 100644 --- a/apps/hand-factory/version.json +++ b/apps/hand-factory/version.json @@ -1,5 +1,5 @@ { - "version": "klp 1.3.19", + "version": "klp 1.3.20", "wgtUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.wgt", "apkUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.apk" } \ No newline at end of file