优化
This commit is contained in:
@@ -266,7 +266,7 @@ const workOrderResp = ref<WorkOrderResp>({
|
|||||||
|
|
||||||
// 称重登记页面数据
|
// 称重登记页面数据
|
||||||
const inputQuantity = ref('')
|
const inputQuantity = ref('')
|
||||||
const ahDeviceWeight = ref('')
|
const ahDeviceWeight = ref('10')
|
||||||
const calculatedWeight = ref('')
|
const calculatedWeight = ref('')
|
||||||
const weighingCount = ref(1)
|
const weighingCount = ref(1)
|
||||||
|
|
||||||
@@ -283,8 +283,8 @@ const weighingList = ref([
|
|||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: '称重次数',
|
title: '称重次数',
|
||||||
dataIndex: 'count',
|
dataIndex: 'weightTime',
|
||||||
key: 'count'
|
key: 'weightTime'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '数量',
|
title: '数量',
|
||||||
@@ -306,8 +306,8 @@ const columns = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '抓拍图片',
|
title: '抓拍图片',
|
||||||
dataIndex: 'image',
|
dataIndex: 'imgUrl',
|
||||||
key: 'image',
|
key: 'imgUrl',
|
||||||
className: 'green-bg'
|
className: 'green-bg'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -338,7 +338,7 @@ const handleMaterialCodeChange = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 模拟调用后端接口
|
// 扫码核验获取物料信息
|
||||||
const fetchMaterialData = async (code: string) => {
|
const fetchMaterialData = async (code: string) => {
|
||||||
getMaterialDetail(code).then(res => {
|
getMaterialDetail(code).then(res => {
|
||||||
if (res.code == '0') {
|
if (res.code == '0') {
|
||||||
@@ -370,6 +370,7 @@ const handleNext = async () => {
|
|||||||
// 准备工作订单数据
|
// 准备工作订单数据
|
||||||
const workOrderData = {
|
const workOrderData = {
|
||||||
materialId: formData.id,
|
materialId: formData.id,
|
||||||
|
materialName: formData.materialName,
|
||||||
workOrderInfos: weighingList.value
|
workOrderInfos: weighingList.value
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,7 +433,7 @@ const calculateWeight = () => {
|
|||||||
const singleWeight = parseFloat(formData.unitWeight.toString())
|
const singleWeight = parseFloat(formData.unitWeight.toString())
|
||||||
const quantity = parseFloat(inputQuantity.value)
|
const quantity = parseFloat(inputQuantity.value)
|
||||||
if (!isNaN(singleWeight) && !isNaN(quantity)) {
|
if (!isNaN(singleWeight) && !isNaN(quantity)) {
|
||||||
calculatedWeight.value = (singleWeight * quantity).toFixed(2) + 'g'
|
calculatedWeight.value = (singleWeight * quantity).toFixed(2)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
calculatedWeight.value = ''
|
calculatedWeight.value = ''
|
||||||
@@ -446,12 +447,12 @@ const handleConfirm = () => {
|
|||||||
// 生成新的列表数据
|
// 生成新的列表数据
|
||||||
const newItem = {
|
const newItem = {
|
||||||
key: (weighingList.value.length + 1).toString(),
|
key: (weighingList.value.length + 1).toString(),
|
||||||
count: weighingCount.value,
|
weightTime: weighingCount.value,
|
||||||
name: formData.materialName,
|
materialId: formData.id,
|
||||||
quantity: inputQuantity.value,
|
quantity: inputQuantity.value,
|
||||||
unitWeight: ahDeviceWeight.value,
|
weight: ahDeviceWeight.value,
|
||||||
calculatedWeight: calculatedWeight.value,
|
calculatedWeight: calculatedWeight.value,
|
||||||
image: '图片'
|
imgUrl: '图片'
|
||||||
}
|
}
|
||||||
// 添加到列表
|
// 添加到列表
|
||||||
weighingList.value.push(newItem)
|
weighingList.value.push(newItem)
|
||||||
@@ -476,7 +477,7 @@ const handleDelete = (key) => {
|
|||||||
weighingList.value = weighingList.value.filter(item => item.key !== key)
|
weighingList.value = weighingList.value.filter(item => item.key !== key)
|
||||||
// 重新排序称重次数
|
// 重新排序称重次数
|
||||||
weighingList.value.forEach((item, index) => {
|
weighingList.value.forEach((item, index) => {
|
||||||
item.count = index + 1
|
item.weightTime = index + 1
|
||||||
})
|
})
|
||||||
// 更新当前称重次数
|
// 更新当前称重次数
|
||||||
weighingCount.value = weighingList.value.length + 1
|
weighingCount.value = weighingList.value.length + 1
|
||||||
|
|||||||
Reference in New Issue
Block a user