|
|
@@ -127,28 +127,20 @@
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- <tr v-if="localData.length>0" v-for="(item,index) in localData" :key="index">
|
|
|
+ <tr v-for="(item, index) in localData" :key="index" :class="{'odd-row': index % 2 !== 0}">
|
|
|
<td>{{ item.barcode }}</td>
|
|
|
- <td>{{ item.latticeCode }}</td>
|
|
|
+ <td>{{item.latticeCode}}</td>
|
|
|
<td>{{ item.qty }}</td>
|
|
|
<td>
|
|
|
- <van-button plain size="mini" type="primary" @click="_setBarcodeCount(item)" >修改数量</van-button>
|
|
|
+ <van-button plain size="mini" type="primary" @click="_setBarcodeCount(item)">修改数量</van-button>
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr v-if=" modeType===0" v-for="(item,index) in dataList" :key="index" :class="{'odd-row': index % 2 !=0}">
|
|
|
+ <tr v-for="(item, index) in dataList" :key="index" :class="{'odd-row': index+localData.length % 2 !== 0}">
|
|
|
<td>{{ item.barcode }}</td>
|
|
|
- <td>{{ item.cartonCode }}</td>
|
|
|
+ <td>{{ modeType === 0 ? item.cartonCode : item.latticeCode }}</td>
|
|
|
<td>{{ item.qty }}</td>
|
|
|
<td>
|
|
|
- <van-button plain size="mini" type="primary" @click="_setBarcodeCount(item)" >修改数量</van-button>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr v-if="modeType===1" v-for="(item,index) in dataList" :key="index" :class="{'odd-row': index % 2 !=0}">
|
|
|
- <td>{{ item.barcode }}</td>
|
|
|
- <td>{{ item.latticeCode }}</td>
|
|
|
- <td>{{ item.qty }}</td>
|
|
|
- <td>
|
|
|
- <van-button plain size="mini" type="primary" @click="_setBarcodeCount(item)" >修改数量</van-button>
|
|
|
+ <van-button plain size="mini" type="primary" @click="_setBarcodeCount(item)">修改数量</van-button>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
@@ -167,13 +159,13 @@ import {
|
|
|
getBlindTask,
|
|
|
getBoxCacheData, resetBoxCacheData, resetBoxCacheDataBin, resetBoxCacheDataBox, setBlindTaskMode,
|
|
|
setBoxBarcodeCount,
|
|
|
- setBoxCacheData, setNoBoxBarcodeCount, submitBoxCacheData,
|
|
|
+ setBoxCacheData, submitBoxCacheData,
|
|
|
} from '@/api/blind/index.ts'
|
|
|
-import { computed, nextTick, onMounted, ref } from 'vue'
|
|
|
+import { computed, onMounted, ref } from 'vue'
|
|
|
import { playVoiceBin, scanError, scanSuccess } from '@/utils/android'
|
|
|
import BarcodeCount from '@/views/inbound/blindCollection/components/BarcodeCount.vue'
|
|
|
-import { showConfirmDialog, showToast } from 'vant'
|
|
|
import ResetData from '@/views/inbound/blindCollection/components/ResetData.vue'
|
|
|
+import { showConfirmDialog, showToast } from 'vant'
|
|
|
import { barcodeIsData } from '@/views/inbound/blindCollection/task/hooks/barcodeIsData'
|
|
|
import { closeLoading, showLoading } from '@/utils/loading'
|
|
|
import { binData } from '@/views/inbound/blindCollection/task/hooks/binData'
|
|
|
@@ -205,14 +197,14 @@ const newOneData = computed(() =>
|
|
|
: dataList.value?.[0] ?? { qty: 0, latticeCode: 0 }
|
|
|
)
|
|
|
|
|
|
-//计算总数量,默认空数组处理,确保 data 是有效的数组
|
|
|
+//计算总数量
|
|
|
const sumQty = (data = []) => data.reduce((sum, item) => sum + Number(item.qty), 0);
|
|
|
-// 计算所有数量
|
|
|
const allCount = computed(() => {
|
|
|
const localNumber = sumQty(localData.value);
|
|
|
const dataNumber = sumQty(dataList.value);
|
|
|
return localNumber + dataNumber
|
|
|
});
|
|
|
+// 格口数据相同格口合并数量
|
|
|
const binList=computed(() => {
|
|
|
return binData(dataList.value)
|
|
|
})
|
|
|
@@ -228,10 +220,10 @@ const getTaskInfo = async (taskNo) => {
|
|
|
const taskResponse = await getBlindTask({ taskNo });
|
|
|
taskInfo.value = taskResponse.data;
|
|
|
localData.value=loadLocalData(taskInfo.value.code)
|
|
|
+
|
|
|
+ // 获取任务
|
|
|
const { warehouseCode,typeCode,code, ownerCode}=taskResponse.data
|
|
|
- const params={typeCode,warehouseCode,ownerCode,code}
|
|
|
- // 获取设置模式
|
|
|
- setBlindTaskMode(params).then(res=>{})
|
|
|
+ setBlindTaskMode({typeCode,warehouseCode,ownerCode,code}).then(res=>{})
|
|
|
//获取缓存数据
|
|
|
const boxResponse = await getBoxCacheData({ code: taskNo });
|
|
|
if(boxResponse.data){
|
|
|
@@ -247,14 +239,12 @@ onMounted(() => {
|
|
|
barcodeRef.value?.focus()
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
// 验证箱号
|
|
|
const scanBox=()=>{
|
|
|
if (boxNo.value === '') return;
|
|
|
preBoxNo.value=boxNo.value
|
|
|
boxNo.value=''
|
|
|
barcodeRef.value?.focus()
|
|
|
-
|
|
|
}
|
|
|
// 验证条码
|
|
|
const _checkBarcode = () => {
|
|
|
@@ -293,7 +283,7 @@ const setBarcode = (curBarcode) => {
|
|
|
case 1:
|
|
|
// 根据 类型设置箱号
|
|
|
const data = [{
|
|
|
- cartonCode: modeType == 5 ? preBoxNo.value : '*',
|
|
|
+ cartonCode: modeType === 5 ? preBoxNo.value : '*',
|
|
|
barcode: curBarcode,
|
|
|
qty: 1,
|
|
|
}];
|
|
|
@@ -315,7 +305,6 @@ const loadLocalData = (taskCode) => {
|
|
|
const savedData = localStorage.getItem(`task_${taskCode}`);
|
|
|
return savedData ? JSON.parse(savedData) : []; // 如果缓存有数据,解析并返回,如果没有,则返回空数组
|
|
|
};
|
|
|
-
|
|
|
const setLocalData=(barCode,type)=>{
|
|
|
scanSuccess();
|
|
|
const data = {
|
|
|
@@ -382,22 +371,13 @@ const setBarcodeCount=(count)=>{
|
|
|
}
|
|
|
localStorage.setItem(`task_${taskInfo.value.code}`, JSON.stringify(localData.value));
|
|
|
}else {
|
|
|
- let url=setBoxBarcodeCount
|
|
|
let data={
|
|
|
code:route.query.code,
|
|
|
sku,
|
|
|
cartonCode,
|
|
|
qty:count,
|
|
|
}
|
|
|
- if(cartonCode==null){
|
|
|
- url=setNoBoxBarcodeCount
|
|
|
- data={
|
|
|
- code:route.query.code,
|
|
|
- sku,
|
|
|
- qty:count,
|
|
|
- }
|
|
|
- }
|
|
|
- url(data).then(res=>{
|
|
|
+ setBoxBarcodeCount(data).then(res=>{
|
|
|
dataList.value = res.data
|
|
|
scanSuccess()
|
|
|
barcodeRef.value?.focus();
|