|
@@ -14,9 +14,8 @@
|
|
<view class="table-container" style="height: 100vh;">
|
|
<view class="table-container" style="height: 100vh;">
|
|
<scroll-view class="table-content" :style="{'height': clientHeight + 'px'}" scroll-x scroll-y
|
|
<scroll-view class="table-content" :style="{'height': clientHeight + 'px'}" scroll-x scroll-y
|
|
:scroll-into-view="scrollItem">
|
|
:scroll-into-view="scrollItem">
|
|
- <!-- <scroll-view scroll-x="true" class="scroll-view-header"> -->
|
|
|
|
<view class="table-header">
|
|
<view class="table-header">
|
|
- <view class="table-cell">操作</view>
|
|
|
|
|
|
+ <!-- <view class="table-cell">操作</view> -->
|
|
<view class="table-cell">扫描状态</view>
|
|
<view class="table-cell">扫描状态</view>
|
|
<view class="table-cell1">装箱单号</view>
|
|
<view class="table-cell1">装箱单号</view>
|
|
<view class="table-cell">仓位</view>
|
|
<view class="table-cell">仓位</view>
|
|
@@ -27,24 +26,11 @@
|
|
<view class="table-cell1">计量单位</view>
|
|
<view class="table-cell1">计量单位</view>
|
|
<view class="table-cell">日期</view>
|
|
<view class="table-cell">日期</view>
|
|
<view class="table-cell3">单据编号</view>
|
|
<view class="table-cell3">单据编号</view>
|
|
- <!-- <view class="table-cell1">即时库存数量</view>
|
|
|
|
- <view class="table-cell">面料订单号</view>
|
|
|
|
- <view class="table-cell">等级</view>
|
|
|
|
- <view class="table-cell2" v-if="showWorkCenter">工作中心</view>
|
|
|
|
- <view class="table-cell" v-if="showRemark">备注</view>
|
|
|
|
- <view class="table-cell">仓位原件数</view>
|
|
|
|
- <view class="table-cell">发货件数</view>
|
|
|
|
- <view class="table-cell">剩余件数</view>
|
|
|
|
- <view class="table-cell" v-if="showApplicant">作业申请人</view>
|
|
|
|
- <view class="table-cell">仓管员</view> -->
|
|
|
|
</view>
|
|
</view>
|
|
- <!-- </scroll-view> -->
|
|
|
|
- <!-- <scroll-view class="table-content" :style="{'height': clientHeight + 'px'}" scroll-x scroll-y
|
|
|
|
- :scroll-into-view="scrollItem"> -->
|
|
|
|
<view class="table-row" v-for="(item, index) in indexList" :key="index" :id="'scrollItem-' + index"
|
|
<view class="table-row" v-for="(item, index) in indexList" :key="index" :id="'scrollItem-' + index"
|
|
:style="getStyle(item.smzt)">
|
|
:style="getStyle(item.smzt)">
|
|
- <view class="table-cell"><button type="default" size="mini" @click="edit(item,index)">编辑</button>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <!-- <view class="table-cell"><button type="default" size="mini" @click="edit(item,index)">编辑</button>
|
|
|
|
+ </view> -->
|
|
<view class="table-cell">{{ item.smzt? '已扫描' : '未扫描' }}</view>
|
|
<view class="table-cell">{{ item.smzt? '已扫描' : '未扫描' }}</view>
|
|
<view class="table-cell1" :style="getStyle(item.smzt)">{{ item["FEnchaseNum.LT"] }}</view>
|
|
<view class="table-cell1" :style="getStyle(item.smzt)">{{ item["FEnchaseNum.LT"] }}</view>
|
|
<view class="table-cell">{{ item["FStockLocId.FF102029.FNumber"] }}</view>
|
|
<view class="table-cell">{{ item["FStockLocId.FF102029.FNumber"] }}</view>
|
|
@@ -69,8 +55,6 @@
|
|
style="display: flex;flex-direction: row;margin-top: 8px;font-size: 12px;margin-right: 15px;margin-bottom: 8px;">
|
|
style="display: flex;flex-direction: row;margin-top: 8px;font-size: 12px;margin-right: 15px;margin-bottom: 8px;">
|
|
<view style="margin-right: 15px;">源单明细:{{ indexList.length }}</view>
|
|
<view style="margin-right: 15px;">源单明细:{{ indexList.length }}</view>
|
|
<view style="margin-right: 15px;">已扫描:{{ indexListLength }}</view>
|
|
<view style="margin-right: 15px;">已扫描:{{ indexListLength }}</view>
|
|
- <!-- <button type="default" @click="navigateToSearch">仓位</button> -->
|
|
|
|
- <!-- <view>剩余件数:{{ balance }}</view> -->
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -101,7 +85,7 @@
|
|
getSaveParam,
|
|
getSaveParam,
|
|
getSubmitParam
|
|
getSubmitParam
|
|
} from '../../utils/params';
|
|
} from '../../utils/params';
|
|
- import submitHelper from '@/utils/commonSubmitHelper.js'; // 确保路径正确
|
|
|
|
|
|
+ import submitHelper from '@/utils/storageSubmitHelper.js'; // 确保路径正确
|
|
import {
|
|
import {
|
|
executeSql
|
|
executeSql
|
|
} from '../../utils/database';
|
|
} from '../../utils/database';
|
|
@@ -202,7 +186,7 @@
|
|
searchValue: '',
|
|
searchValue: '',
|
|
scrollItem: '', // 滚动到的指定元素
|
|
scrollItem: '', // 滚动到的指定元素
|
|
color: '',
|
|
color: '',
|
|
- Location: '', //正操作仓位
|
|
|
|
|
|
+ stockNum: '', //正操作仓库
|
|
uniqueFStockLocId: [],
|
|
uniqueFStockLocId: [],
|
|
balance: 0,
|
|
balance: 0,
|
|
isStage: false,
|
|
isStage: false,
|
|
@@ -280,42 +264,52 @@
|
|
})
|
|
})
|
|
uni.$on('search', (data) => {
|
|
uni.$on('search', (data) => {
|
|
console.log(data)
|
|
console.log(data)
|
|
- this.indexList = data
|
|
|
|
|
|
+ console.log(this.indexList)
|
|
|
|
+ // 遍历 indexList 数组
|
|
this.indexList.forEach(item => {
|
|
this.indexList.forEach(item => {
|
|
- // item.smzt = 0; // 增加属性 smzt,并设置初始值为0
|
|
|
|
- this.$set(item, 'smzt', 0);
|
|
|
|
- })
|
|
|
|
- // 用于记录每个组合的计数
|
|
|
|
- let countMap = {};
|
|
|
|
- // 统计每个组合的行数
|
|
|
|
- this.indexList.forEach(obj => {
|
|
|
|
- // 获取当前对象的组合键
|
|
|
|
- let key = obj.FBillNo + '|' + obj['FStockLocId.FF102029.fname'];
|
|
|
|
-
|
|
|
|
- // 如果该组合已经存在于 countMap 中,则增加计数,否则初始化为 1
|
|
|
|
- if (countMap[key]) {
|
|
|
|
- countMap[key]++;
|
|
|
|
- } else {
|
|
|
|
- countMap[key] = 1;
|
|
|
|
|
|
+ // 检查 smzt 是否为 1
|
|
|
|
+ if (item.smzt === 1 && item['FStockLocId.FF102029.FNumber'] == null) {
|
|
|
|
+ // 修改 FStockLocId.FF102029.FNumber 为 'a'
|
|
|
|
+ item['FStockLocId.FF102029.FNumber'] = data;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- // 将计数值添加到每个对象中
|
|
|
|
- this.indexList.forEach(obj => {
|
|
|
|
- let key = obj.FBillNo + '|' + obj['FStockLocId.FF102029.fname'];
|
|
|
|
- // obj.rowCount = countMap[key];
|
|
|
|
- this.$set(obj, 'rowCount', countMap[key])
|
|
|
|
- });
|
|
|
|
- // 1. 提取不同的仓位
|
|
|
|
- this.uniqueFStockLocId = [...new Set(this.indexList.map(obj => obj[
|
|
|
|
- 'FStockLocId.FF102029.fname']))];
|
|
|
|
- console.log(this.uniqueFStockLocId)
|
|
|
|
- // this.processQuantity(this.uniqueFStockLocId[0])
|
|
|
|
- this.updateIndexList(this.indexList)
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.searchValue = ''
|
|
|
|
- this.isFocus = true;
|
|
|
|
- })
|
|
|
|
|
|
+ // this.indexList = data
|
|
|
|
+ // this.indexList.forEach(item => {
|
|
|
|
+ // // item.smzt = 0; // 增加属性 smzt,并设置初始值为0
|
|
|
|
+ // this.$set(item, 'smzt', 0);
|
|
|
|
+ // })
|
|
|
|
+ // // 用于记录每个组合的计数
|
|
|
|
+ // let countMap = {};
|
|
|
|
+ // // 统计每个组合的行数
|
|
|
|
+ // this.indexList.forEach(obj => {
|
|
|
|
+ // // 获取当前对象的组合键
|
|
|
|
+ // let key = obj.FBillNo + '|' + obj['FStockLocId.FF102029.fname'];
|
|
|
|
+
|
|
|
|
+ // // 如果该组合已经存在于 countMap 中,则增加计数,否则初始化为 1
|
|
|
|
+ // if (countMap[key]) {
|
|
|
|
+ // countMap[key]++;
|
|
|
|
+ // } else {
|
|
|
|
+ // countMap[key] = 1;
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ // // 将计数值添加到每个对象中
|
|
|
|
+ // this.indexList.forEach(obj => {
|
|
|
|
+ // let key = obj.FBillNo + '|' + obj['FStockLocId.FF102029.fname'];
|
|
|
|
+ // // obj.rowCount = countMap[key];
|
|
|
|
+ // this.$set(obj, 'rowCount', countMap[key])
|
|
|
|
+ // });
|
|
|
|
+ // // 1. 提取不同的仓位
|
|
|
|
+ // this.uniqueFStockLocId = [...new Set(this.indexList.map(obj => obj[
|
|
|
|
+ // 'FStockLocId.FF102029.fname']))];
|
|
|
|
+ // console.log(this.uniqueFStockLocId)
|
|
|
|
+ // // this.processQuantity(this.uniqueFStockLocId[0])
|
|
|
|
+ // this.updateIndexList(this.indexList)
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
+ // this.searchValue = ''
|
|
|
|
+ // this.isFocus = true;
|
|
|
|
+ // })
|
|
})
|
|
})
|
|
uni.$on('summary', (data) => {
|
|
uni.$on('summary', (data) => {
|
|
console.log(data)
|
|
console.log(data)
|
|
@@ -411,29 +405,6 @@
|
|
let promises = [];
|
|
let promises = [];
|
|
// 遍历 uniqueFStockLocId 数组
|
|
// 遍历 uniqueFStockLocId 数组
|
|
for (let fname of this.uniqueFStockLocId) {
|
|
for (let fname of this.uniqueFStockLocId) {
|
|
- // const data = {
|
|
|
|
- // "parameters": [{
|
|
|
|
- // "FormId": "STK_Inventory",
|
|
|
|
- // "FieldKeys": "fID",
|
|
|
|
- // "FilterString": [{
|
|
|
|
- // "Left": "",
|
|
|
|
- // "FieldName": "FStockLocId.FF102029.FName",
|
|
|
|
- // "Compare": "67",
|
|
|
|
- // "Value": fname,
|
|
|
|
- // "Right": "",
|
|
|
|
- // "Logic": 0
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // "Left": "",
|
|
|
|
- // "FieldName": "FBaseQty",
|
|
|
|
- // "Compare": "21",
|
|
|
|
- // "Value": "0",
|
|
|
|
- // "Right": "",
|
|
|
|
- // "Logic": 0
|
|
|
|
- // }
|
|
|
|
- // ],
|
|
|
|
- // }]
|
|
|
|
- // };
|
|
|
|
const requestData = createInventoryQueryRequest(fname)
|
|
const requestData = createInventoryQueryRequest(fname)
|
|
|
|
|
|
// 发起异步请求,并将 promise 存储在数组中
|
|
// 发起异步请求,并将 promise 存储在数组中
|
|
@@ -458,33 +429,6 @@
|
|
console.error('Error updating indexList:', error);
|
|
console.error('Error updating indexList:', error);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // // 定义一个函数来创建请求数据
|
|
|
|
- // createInventoryQueryRequest(value) {
|
|
|
|
- // return {
|
|
|
|
- // parameters: [{
|
|
|
|
- // FormId: "STK_Inventory",
|
|
|
|
- // FieldKeys: "fID",
|
|
|
|
- // FilterString: [
|
|
|
|
- // {
|
|
|
|
- // Left: "",
|
|
|
|
- // FieldName: "FStockLocId.FF102029.FName",
|
|
|
|
- // Compare: "67",
|
|
|
|
- // Value: value,
|
|
|
|
- // Right: "",
|
|
|
|
- // Logic: 0
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // Left: "",
|
|
|
|
- // FieldName: "FBaseQty",
|
|
|
|
- // Compare: "21",
|
|
|
|
- // Value: "0",
|
|
|
|
- // Right: "",
|
|
|
|
- // Logic: 0
|
|
|
|
- // }
|
|
|
|
- // ]
|
|
|
|
- // }]
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
scrollToItem(itemId) {
|
|
scrollToItem(itemId) {
|
|
// 设置滚动到的指定元素的 ID
|
|
// 设置滚动到的指定元素的 ID
|
|
this.scrollItem = itemId;
|
|
this.scrollItem = itemId;
|
|
@@ -507,7 +451,7 @@
|
|
},
|
|
},
|
|
edit(item, index) {
|
|
edit(item, index) {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: '/pages/stock-dispatch/show?item=' + encodeURIComponent(JSON.stringify(
|
|
|
|
|
|
+ url: '/pages/storage/show?item=' + encodeURIComponent(JSON.stringify(
|
|
item)) +
|
|
item)) +
|
|
'&&index=' + encodeURIComponent(JSON.stringify(index))
|
|
'&&index=' + encodeURIComponent(JSON.stringify(index))
|
|
});
|
|
});
|
|
@@ -538,25 +482,26 @@
|
|
},
|
|
},
|
|
//跳转到查询页面
|
|
//跳转到查询页面
|
|
navigateToSearch() {
|
|
navigateToSearch() {
|
|
- if (this.indexList.length > 0) {
|
|
|
|
|
|
+ if (this.indexList.length == 0) {
|
|
// this.isRangeSelected = false; // 显示错误提示
|
|
// this.isRangeSelected = false; // 显示错误提示
|
|
playVoice(audioUrls.failVoiceUrl)
|
|
playVoice(audioUrls.failVoiceUrl)
|
|
uni.showToast({
|
|
uni.showToast({
|
|
- title: '源单已选择',
|
|
|
|
|
|
+ title: '请先扫描',
|
|
duration: 2000,
|
|
duration: 2000,
|
|
icon: "error"
|
|
icon: "error"
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ console.log(this.stockNum)
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
// url: '/pages/production-replenishment/search', //这是你的当前页面地址
|
|
// url: '/pages/production-replenishment/search', //这是你的当前页面地址
|
|
- url: `/pages/stock-dispatch/search?FormId=${this.formId}&FBillType=${this.fbillType}`
|
|
|
|
|
|
+ url: `/pages/storage/search?stockNum=${this.stockNum}`
|
|
});
|
|
});
|
|
|
|
|
|
},
|
|
},
|
|
navigateToSummary() {
|
|
navigateToSummary() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: '/pages/stock-dispatch/summary?Info=' + encodeURIComponent(JSON
|
|
|
|
|
|
+ url: '/pages/storage/summary?Info=' + encodeURIComponent(JSON
|
|
.stringify(this.indexList)) + '&&stageInfo=' + encodeURIComponent(JSON
|
|
.stringify(this.indexList)) + '&&stageInfo=' + encodeURIComponent(JSON
|
|
.stringify(this.stageLists)), //这是你的当前页面地址
|
|
.stringify(this.stageLists)), //这是你的当前页面地址
|
|
});
|
|
});
|
|
@@ -564,7 +509,7 @@
|
|
},
|
|
},
|
|
navigateToStage() {
|
|
navigateToStage() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: '/pages/stock-dispatch/stage?Info=' + encodeURIComponent(JSON
|
|
|
|
|
|
+ url: '/pages/storage/stage?Info=' + encodeURIComponent(JSON
|
|
.stringify(this.indexList)), //这是你的当前页面地址
|
|
.stringify(this.indexList)), //这是你的当前页面地址
|
|
});
|
|
});
|
|
|
|
|
|
@@ -594,6 +539,23 @@
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+ isAllPositionsComplete(nowindex) {
|
|
|
|
+ console.log(this.indexList[nowindex].FBillNo)
|
|
|
|
+ console.log(this.indexList[nowindex]["FStockLocId.FF102029.FNumber"])
|
|
|
|
+ if (this.indexList.filter(item =>
|
|
|
|
+ item["FBillNo"] == this.indexList[nowindex].FBillNo && item["FStockLocId.FF102029.FNumber"] ==
|
|
|
|
+ null
|
|
|
|
+ ).length == 0) {
|
|
|
|
+ console.log(this.indexList.filter(item =>
|
|
|
|
+ item["FBillNo"] == this.indexList[nowindex].FBillNo && item[
|
|
|
|
+ "FStockLocId.FF102029.FNumber"] ==
|
|
|
|
+ null
|
|
|
|
+ ).length)
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+
|
|
},
|
|
},
|
|
showToast() {
|
|
showToast() {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -705,6 +667,31 @@
|
|
}.bind(this)
|
|
}.bind(this)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ showModalAndHandlePosition(nowindex) {
|
|
|
|
+ let vm = this
|
|
|
|
+ // console.log(nowindex)
|
|
|
|
+ let bBillNo = this.indexList[nowindex]["FBillNo"]
|
|
|
|
+ // let FID = this.indexList[nowindex]["FID"]
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
+ // this.searchValue = ''
|
|
|
|
+ // this.isFocus = true;
|
|
|
|
+ // })
|
|
|
|
+ // playVoice(audioUrls.allSuccessVoiceUrl)
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: "提示",
|
|
|
|
+ content: "单号(" + bBillNo + ")已扫描完毕,请选择仓位",
|
|
|
|
+ showCancel: true,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ // this.submit(FID)
|
|
|
|
+ this.navigateToSearch()
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ // 执行取消后的操作
|
|
|
|
+ }
|
|
|
|
+ }.bind(this)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
handleScanSuccess() {
|
|
handleScanSuccess() {
|
|
// this.Location = this.indexList[nowindex]["FStockLocId.FF102029.fname"]
|
|
// this.Location = this.indexList[nowindex]["FStockLocId.FF102029.fname"]
|
|
// this.indexList[nowindex].smzt = 1 //修改数据状态
|
|
// this.indexList[nowindex].smzt = 1 //修改数据状态
|
|
@@ -720,13 +707,15 @@
|
|
if (this.indexList[i]["FEnchaseNum.LT"] === this.searchValue) {
|
|
if (this.indexList[i]["FEnchaseNum.LT"] === this.searchValue) {
|
|
// nowlocation = this.indexList[i]["FStockLocId.FF102029.fname"] //当前仓位
|
|
// nowlocation = this.indexList[i]["FStockLocId.FF102029.fname"] //当前仓位
|
|
nowindex = i //当前索引
|
|
nowindex = i //当前索引
|
|
|
|
+ this.stockNum = this.indexList[nowindex]["FSTOCKID.FNumber"]
|
|
// this.balance = this.indexList[i]["quantity"] - this.indexList[i]["rowCount"]
|
|
// this.balance = this.indexList[i]["quantity"] - this.indexList[i]["rowCount"]
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ console.log(this.stockNum)
|
|
console.log(this.indexList.filter(obj => obj.smzt === 1).length)
|
|
console.log(this.indexList.filter(obj => obj.smzt === 1).length)
|
|
const audioUrlsArr = [];
|
|
const audioUrlsArr = [];
|
|
- audioUrlsArr.push(audioUrls.success2VoiceUrl);
|
|
|
|
|
|
+ audioUrlsArr.push(audioUrls.success2VoiceUrl);
|
|
// console.log(this.getActualWorkQuantity(this.indexList[nowindex]))
|
|
// console.log(this.getActualWorkQuantity(this.indexList[nowindex]))
|
|
//是否全发
|
|
//是否全发
|
|
// if (this.getActualWorkQuantity(this.indexList[nowindex]) == this.indexList[nowindex][
|
|
// if (this.getActualWorkQuantity(this.indexList[nowindex]) == this.indexList[nowindex][
|
|
@@ -747,9 +736,15 @@
|
|
// audioUrlsArr.push(audioUrls.storeSuccessUrl);
|
|
// audioUrlsArr.push(audioUrls.storeSuccessUrl);
|
|
// }
|
|
// }
|
|
if (this.areAllDetailsScanned(nowindex)) { //校验单号是否全扫完
|
|
if (this.areAllDetailsScanned(nowindex)) { //校验单号是否全扫完
|
|
|
|
+ //校验仓位是否全填
|
|
audioUrlsArr.push(audioUrls.allSuccessVoiceUrl)
|
|
audioUrlsArr.push(audioUrls.allSuccessVoiceUrl)
|
|
|
|
+ if (this.isAllPositionsComplete(nowindex)) {
|
|
|
|
+ this.showModalAndHandleSubmit(nowindex)
|
|
|
|
+ } else {
|
|
|
|
+ this.showModalAndHandlePosition(nowindex)
|
|
|
|
+
|
|
|
|
+ }
|
|
// playVoice(audioUrls.allSuccessVoiceUrl)
|
|
// playVoice(audioUrls.allSuccessVoiceUrl)
|
|
- this.showModalAndHandleSubmit(nowindex)
|
|
|
|
} else { //单号未全扫完
|
|
} else { //单号未全扫完
|
|
// this.handlePositionScanCompletion()
|
|
// this.handlePositionScanCompletion()
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -803,7 +798,7 @@
|
|
this.$set(item, 'smzt', 0);
|
|
this.$set(item, 'smzt', 0);
|
|
})
|
|
})
|
|
// this.indexList = BillList
|
|
// this.indexList = BillList
|
|
- this.indexList = this.indexList.concat(BillList)
|
|
|
|
|
|
+ this.indexList = this.indexList.concat(BillList)
|
|
this.handleScanSuccess()
|
|
this.handleScanSuccess()
|
|
// this.indexList = this.indexList.map(item => {
|
|
// this.indexList = this.indexList.map(item => {
|
|
// if (item["FEnchaseNum.LT"] == this.searchValue) {
|
|
// if (item["FEnchaseNum.LT"] == this.searchValue) {
|