优化
This commit is contained in:
@@ -266,7 +266,7 @@ const workOrderResp = ref<WorkOrderResp>({
|
||||
|
||||
// 称重登记页面数据
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user