From 663a51e2a5eacdcc529ab4f44fa3354e4f7664cc Mon Sep 17 00:00:00 2001 From: bb_pan Date: Thu, 3 Jul 2025 19:15:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E9=87=8F=E9=80=89=E6=8B=A9=E7=BC=96?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages.json | 6 + src/pages/picking/outbound/num-outbound.vue | 66 +- src/pages/picking/outbound/numCodeSelect.vue | 731 +++++++++++++++++++ src/pages/repair/wsMaInfo/index.vue | 71 +- src/services/picking/outbound.js | 27 + 5 files changed, 874 insertions(+), 27 deletions(-) create mode 100644 src/pages/picking/outbound/numCodeSelect.vue diff --git a/src/pages.json b/src/pages.json index 3e02bdd..6d33673 100644 --- a/src/pages.json +++ b/src/pages.json @@ -183,6 +183,12 @@ "navigationBarTitleText": "数量出库" } }, + { + "path": "pages/picking/outbound/numCodeSelect", + "style": { + "navigationBarTitleText": "编码选择" + } + }, // 1. 主列表 { diff --git a/src/pages/picking/outbound/num-outbound.vue b/src/pages/picking/outbound/num-outbound.vue index f26cb60..7f60a28 100644 --- a/src/pages/picking/outbound/num-outbound.vue +++ b/src/pages/picking/outbound/num-outbound.vue @@ -37,6 +37,12 @@ @input="onChangeNumber" /> + +
+ +
已选 {{ maCodeList.length }} 个编码
+
+
出库 @@ -46,14 +52,13 @@ + + diff --git a/src/pages/repair/wsMaInfo/index.vue b/src/pages/repair/wsMaInfo/index.vue index 132f042..82c56a3 100644 --- a/src/pages/repair/wsMaInfo/index.vue +++ b/src/pages/repair/wsMaInfo/index.vue @@ -9,14 +9,18 @@ + :key="maName" @change="onMaModelChange" @clear="onMaModelClear" /> - +
+ + - + +
+ :key="supplier" @change="onSupplierChange" @clear="onSupplierClear" /> @@ -33,6 +37,18 @@ +
+
+ + + +
+ +
+
{{ item }}
+
+
+
@@ -57,7 +73,7 @@ const maName = ref('') // ✅ 机具类型 const maModel = ref('') // 机具规格 - const maCode = ref('') // 机具编码 + const maCode = ref([]) // 机具编码 const supplier = ref('') // 出厂厂家 const repairMan = ref('王鹏') // 检修员 const checkMan = ref('高民') // 检验员 @@ -66,17 +82,49 @@ const maNameList = ref([]) // 机具类型下拉列表 const maModelList = ref([]) // 机具规格下拉列表 const supplierList = ref([]) // 机具规格下拉列表 + const prefix = ref() + const postfix = ref() + const fillNum = ref(1) // 填充数量 // 清空表单 const clearForm = () => { maName.value = '' maModel.value = '' - maCode.value = '' + maCode.value = [] supplier.value = '' repairMan.value = '' checkMan.value = '' phone.value = '' } + // 填充编码 + const handleFillCode = () => { + if (!prefix.value || !postfix.value) { + uni.showToast({ + title: '请填写编码前缀和后缀', + icon: 'none' + }) + return + } + + const prefixValue = prefix.value.trim() + const postfixValue = postfix.value.trim() + const fillNumValue = fillNum.value + const codeList = [] + const startNum = parseInt(postfixValue, 10) + const padLen = postfixValue.length + for (let i = 0; i < fillNumValue; i++) { + const num = String(startNum + i).padStart(padLen, '0') + codeList.push(`${prefixValue}${num}`) + } + maCode.value = codeList + console.log('🚀 ~ handleFillCode ~ maCode.value:', maCode.value) + } + + const handleFillNumBlur = () => { + // 只能是正整数 + fillNum.value = Math.ceil(String(fillNum.value).replace(/[^\d]/g, '')) + } + const onMaNameChange = (item) => { maName.value = item.label; maModel.value = null; // 清空规格值 @@ -159,7 +207,7 @@ icon: 'none' }) } - if (!maCode.value) { + if (maCode.value.length === 0) { return uni.showToast({ title: '请输入机具编码', icon: 'none' @@ -193,7 +241,7 @@ const postData = { maName: maName.value, maModel: maModel.value, - maCode: maCode.value, + maCodeList: maCode.value, supplier: supplier.value, repairMan: repairMan.value, checkMan: checkMan.value, @@ -210,18 +258,9 @@ }) clearForm() uni.navigateBack() - } else { - uni.showToast({ - title: res.msg || '新增失败', - icon: 'none' - }) } } catch (error) { console.error(error) - uni.showToast({ - title: '请求失败,请稍后重试', - icon: 'none' - }) } } onLoad(() => { diff --git a/src/services/picking/outbound.js b/src/services/picking/outbound.js index 297e627..222a947 100644 --- a/src/services/picking/outbound.js +++ b/src/services/picking/outbound.js @@ -100,3 +100,30 @@ export const leaseOutBackApi = (data) => { data, }) } + +// 数量编码查询 +export const getInfoByTypeId = (data) => { + return http({ + method: 'GET', + url: '/material/ma_machine/getInfoByTypeId', + data, + }) +} + +// 数量编码出库 +export const leaseOutByInfoApi = (data) => { + return http({ + method: 'POST', + url: '/material/lease_apply_info/leaseOutByInfo', + data, + }) +} + +// 标准箱详情 +export const getBoxDetailsAPI = (data) => { + return http({ + method: 'GET', + url: '/material/bm_qrcode_box/getBoxDetails', + data, + }) +} \ No newline at end of file