From 60933ee1a6703256b121897ef8f6cfbc48b25db6 Mon Sep 17 00:00:00 2001 From: zc Date: Fri, 6 Mar 2026 14:17:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/weightManage/index.vue | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/views/weightManage/index.vue b/src/views/weightManage/index.vue index fa092b6..728a355 100644 --- a/src/views/weightManage/index.vue +++ b/src/views/weightManage/index.vue @@ -266,7 +266,7 @@ const workOrderResp = ref({ // 称重登记页面数据 const inputQuantity = ref('') -const ahDeviceWeight = ref('') +const ahDeviceWeight = ref('10') const calculatedWeight = ref('') const weighingCount = ref(1) @@ -283,8 +283,8 @@ const weighingList = ref([ const columns = [ { title: '称重次数', - dataIndex: 'count', - key: 'count' + dataIndex: 'weightTime', + key: 'weightTime' }, { title: '数量', @@ -306,8 +306,8 @@ const columns = [ }, { title: '抓拍图片', - dataIndex: 'image', - key: 'image', + dataIndex: 'imgUrl', + key: 'imgUrl', className: 'green-bg' }, { @@ -338,7 +338,7 @@ const handleMaterialCodeChange = async () => { } }; -// 模拟调用后端接口 +// 扫码核验获取物料信息 const fetchMaterialData = async (code: string) => { getMaterialDetail(code).then(res => { if (res.code == '0') { @@ -370,6 +370,7 @@ const handleNext = async () => { // 准备工作订单数据 const workOrderData = { materialId: formData.id, + materialName: formData.materialName, workOrderInfos: weighingList.value } @@ -432,7 +433,7 @@ const calculateWeight = () => { const singleWeight = parseFloat(formData.unitWeight.toString()) const quantity = parseFloat(inputQuantity.value) if (!isNaN(singleWeight) && !isNaN(quantity)) { - calculatedWeight.value = (singleWeight * quantity).toFixed(2) + 'g' + calculatedWeight.value = (singleWeight * quantity).toFixed(2) } } else { calculatedWeight.value = '' @@ -446,12 +447,12 @@ const handleConfirm = () => { // 生成新的列表数据 const newItem = { key: (weighingList.value.length + 1).toString(), - count: weighingCount.value, - name: formData.materialName, + weightTime: weighingCount.value, + materialId: formData.id, quantity: inputQuantity.value, - unitWeight: ahDeviceWeight.value, + weight: ahDeviceWeight.value, calculatedWeight: calculatedWeight.value, - image: '图片' + imgUrl: '图片' } // 添加到列表 weighingList.value.push(newItem) @@ -476,7 +477,7 @@ const handleDelete = (key) => { weighingList.value = weighingList.value.filter(item => item.key !== key) // 重新排序称重次数 weighingList.value.forEach((item, index) => { - item.count = index + 1 + item.weightTime = index + 1 }) // 更新当前称重次数 weighingCount.value = weighingList.value.length + 1