From 68dcfd51164ba01b2a181e81e6bdf50ff15c11ed Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Mon, 22 Sep 2025 20:04:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E7=AB=99=E9=A2=86=E6=96=99?= =?UTF-8?q?=E9=80=80=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/materialsStation/index/index.vue | 4 +-- .../toolsBack/toolsAddBack.vue | 33 +++++++++++------- .../toolsLease/toolsLease.vue | 5 +-- .../toolsLease/toolsLeaseAdd.vue | 34 +++++++++---------- src/services/materialsStation.js | 9 +++++ 5 files changed, 50 insertions(+), 35 deletions(-) diff --git a/src/pages/materialsStation/index/index.vue b/src/pages/materialsStation/index/index.vue index 6782286..623bc9c 100644 --- a/src/pages/materialsStation/index/index.vue +++ b/src/pages/materialsStation/index/index.vue @@ -71,14 +71,14 @@ const isUsingList = ref([ { path: 'toolsLease', name: '班组预领申请', src: 'lease', isShow: true }, { path: 'toolsOut', name: '材料站出库', src: 'outStore', isShow: true }, { path: 'toolsBack', name: '退料', src: 'back', isShow: true }, - { path: 'toolsLedger', name: '台账', src: 'ledger', isShow: true }, + { path: 'equipmentRecord', name: '站内库存台账', src: 'ledger', isShow: true }, + // { path: 'toolsLedger', name: '台账', src: 'ledger', isShow: true }, { path: 'teamLeaseRecord', name: '班组领料记录', src: 'teamLease', isShow: true }, { path: 'teamBackRecord', name: '班组退料记录', src: 'teamBack', isShow: true }, { path: 'teamStore', name: '班组库存', src: 'teamStore', isShow: true }, { path: 'teamWarning', name: '班组预警', src: 'teamWarning', isShow: true }, { path: 'authorizeSignature', name: '项目部授权', src: 'authorizeSignature', isShow: true }, { path: 'materialClerkConfirms', name: '领料确认', src: 'outStore', isShow: true }, - { path: 'equipmentRecord', name: '站内库存台账', src: 'ledger', isShow: true }, ]) const userAgent = navigator.userAgent.toLowerCase() diff --git a/src/pages/materialsStation/toolsBack/toolsAddBack.vue b/src/pages/materialsStation/toolsBack/toolsAddBack.vue index 6bc7696..b86cd8d 100644 --- a/src/pages/materialsStation/toolsBack/toolsAddBack.vue +++ b/src/pages/materialsStation/toolsBack/toolsAddBack.vue @@ -151,12 +151,12 @@ const formData = reactive({ projectId: '', backPerson: '', phone: '', - agreementId: undefined, + agreementIds:[], remark: undefined, isBack: 1, remark: '', }) -const agreementId = ref('') +const agreementIds = ref('') const equipmentId = ref() const teamRange = ref([]) // 班组 const prodRange = ref([]) // 工程 @@ -242,17 +242,17 @@ const getAgreement = () => { getAgreementInfoByIdBackApi(obj) .then((res) => { console.log(res) - if (res.code == 200) { - agreementId.value = res.data.agreementId - formData.agreementId = res.data.agreementId + if (res.code == 200 && res.data && res.data.length>0) { + agreementIds.value = res.data.map(item => item.agreementId) + formData.agreementIds = res.data.map(item => item.agreementId) getEquipmentList() } else { - agreementId.value = '' - formData.agreementId = '' + agreementIds.value = '' + formData.agreementIds = '' } }) .catch((error) => { - formData.agreementId = '' + formData.agreementIds = '' console.log(error) }) } @@ -260,7 +260,7 @@ const getAgreement = () => { const getEquipmentList = async () => { try { let obj = { - agreementId: agreementId.value, + agreementIds: agreementIds.value, } const res = await getUseTypeTree(obj) // machineList.value = res.data @@ -366,6 +366,7 @@ const changeEquipment = (e) => { setTimeout(() => { equipmentId.value = '' }, 300) + console.log('xxxxxxxxxxxxxxxxx:', tableData.value) } // 递归查找指定 id 的节点 function findEquipmentById(list, id) { @@ -417,15 +418,21 @@ const submit = (isBack) => { } // tableData.value 循环 preNum 不能小于 0, 小于0的提示到具体行 for (let i = 0; i < tableData.value.length; i++) { - console.log('🚀 ~ .then ~ tableData.value[i].preNum:', tableData.value[i].preNum) - if (tableData.value[i].preNum < 1) { + console.log('🚀yyyyyyyyyyyyyyyyyyy:', tableData.value[i].unitValue) + if (tableData.value[i].preNum < 1 && tableData.value[i].unitValue == 0 ) { await uni.showToast({ title: `第${i + 1}行退料数量不能为0`, icon: 'none', duration: 1000, }) return - } else if (tableData.value[i].preNum > tableData.value[i].num) { + }else if(tableData.value[i].preNum <= 0 && tableData.value[i].unitValue == 1){ + await uni.showToast({ + title: `第${i + 1}行退料数量不能为0`, + icon: 'none', + duration: 1000, + }) + }else if (tableData.value[i].preNum > tableData.value[i].num) { await uni.showToast({ title: `第${i + 1}行退料数量不能大于在用数量`, icon: 'none', @@ -450,7 +457,7 @@ const submit = (isBack) => { backApplyDetailsList: tableData.value, backApplyInfo: formData, } - console.log('🚀 ~ .then ~ params:', params) + console.log('🚀 yyyyyyyyyyy:', params) uni.showLoading({ title: '提交中...', }) diff --git a/src/pages/materialsStation/toolsLease/toolsLease.vue b/src/pages/materialsStation/toolsLease/toolsLease.vue index 2d00017..b255596 100644 --- a/src/pages/materialsStation/toolsLease/toolsLease.vue +++ b/src/pages/materialsStation/toolsLease/toolsLease.vue @@ -95,7 +95,7 @@