|
@@ -4,9 +4,8 @@
|
|
<view class="button-group" v-if="isCreate === false">
|
|
<view class="button-group" v-if="isCreate === false">
|
|
<button type="default" @click="reset">取消</button>
|
|
<button type="default" @click="reset">取消</button>
|
|
<!-- <button type="default" @click="navigateToSummary">统计</button> -->
|
|
<!-- <button type="default" @click="navigateToSummary">统计</button> -->
|
|
- <button type="default" @click="navigateToSearch" >查询</button>
|
|
|
|
- <button type="default" >源单</button>
|
|
|
|
- <button type="default" @click="navigateToStage" >暂存</button>
|
|
|
|
|
|
+ <button type="default" @click="navigateToSearch">查询</button>
|
|
|
|
+ <button type="default" @click="navigateToStage">暂存</button>
|
|
<button type="default" @click="navigateToSearch">提交</button>
|
|
<button type="default" @click="navigateToSearch">提交</button>
|
|
</view>
|
|
</view>
|
|
<view class="button-group" v-else>
|
|
<view class="button-group" v-else>
|
|
@@ -17,6 +16,9 @@
|
|
@confirm="getIsCreate()" @clear="clear" placeholder="请扫描拼件单号">
|
|
@confirm="getIsCreate()" @clear="clear" placeholder="请扫描拼件单号">
|
|
</uni-easyinput>
|
|
</uni-easyinput>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view>
|
|
|
|
+ <u-picker :show="showPicker" :columns="depotList" keyName="FStockName" @confirm="pickDepot" title="仓位选择"></u-picker>
|
|
|
|
+ </view>
|
|
<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">
|
|
@@ -46,16 +48,18 @@
|
|
<view class="table-cell2">调入仓位</view>
|
|
<view class="table-cell2">调入仓位</view>
|
|
</view>
|
|
</view>
|
|
<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)" v-if="isCreate === false">
|
|
|
|
- <view class="table-cell"><button type="default" size="mini" @click="edit(item,index)">编辑</button>
|
|
|
|
|
|
+ :style="getStyle(item.smzt)" v-if="isCreate === false">
|
|
|
|
+ <view class="table-cell">
|
|
|
|
+ <button type="default" size="mini" @click="edit(item,index)">编辑</button>
|
|
</view>
|
|
</view>
|
|
<view class="table-cell">{{ item.smzt? '已扫描' : '未扫描' }}</view>
|
|
<view class="table-cell">{{ item.smzt? '已扫描' : '未扫描' }}</view>
|
|
<view class="table-cell">{{ item["FSrcStockLocId.FF102029.FName"] }}</view>
|
|
<view class="table-cell">{{ item["FSrcStockLocId.FF102029.FName"] }}</view>
|
|
<view class="table-cellwl" :style="getStyle(item.smzt)">{{ item["FMaterialId.FNumber"] }}</view>
|
|
<view class="table-cellwl" :style="getStyle(item.smzt)">{{ item["FMaterialId.FNumber"] }}</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-cell1" :style="getStyle(item.smzt)">{{ item["FQty"] }}</view>
|
|
|
|
|
|
+ <view class="table-cell1" :style="getStyle(item.smzt)">{{ item["FQty"] }}</view>
|
|
<view class="table-cell1" :style="getStyle(item.smzt)">{{ item["FBOXNO.LT"] }}</view>
|
|
<view class="table-cell1" :style="getStyle(item.smzt)">{{ item["FBOXNO.LT"] }}</view>
|
|
- <view class="table-cell1" :style="getStyle(item.smzt)">{{ item["FAuxPropId.FF101501.FDataValue"] }}</view>
|
|
|
|
|
|
+ <view class="table-cell1" :style="getStyle(item.smzt)">{{ item["FAuxPropId.FF101501.FDataValue"] }}
|
|
|
|
+ </view>
|
|
<view class="table-cellph" :style="getStyle(item.smzt)">{{ item["FLot.FNumber"] }}</view>
|
|
<view class="table-cellph" :style="getStyle(item.smzt)">{{ item["FLot.FNumber"] }}</view>
|
|
<view class="table-cell2" :style="getStyle(item.smzt)">{{ item["rowCount"] }}</view>
|
|
<view class="table-cell2" :style="getStyle(item.smzt)">{{ item["rowCount"] }}</view>
|
|
<view class="table-cell" :style="getStyle(item.smzt)">{{ item["FNoteEntry"] }}</view>
|
|
<view class="table-cell" :style="getStyle(item.smzt)">{{ item["FNoteEntry"] }}</view>
|
|
@@ -64,12 +68,15 @@
|
|
<view class="table-cell3" :style="getStyle(item.smzt)">{{ item["FBillNo"] }}</view>
|
|
<view class="table-cell3" :style="getStyle(item.smzt)">{{ item["FBillNo"] }}</view>
|
|
<view class="table-cell" :style="getStyle(item.smzt)">{{ item["FStockerId.FName"] }}</view>
|
|
<view class="table-cell" :style="getStyle(item.smzt)">{{ item["FStockerId.FName"] }}</view>
|
|
</view>
|
|
</view>
|
|
- <view class="table-row" v-else>
|
|
|
|
- <view class="table-cell"><button type="default" size="mini" @click="edit(item,index)">编辑</button>
|
|
|
|
|
|
+ <view class="table-row" v-for="(item, index) in indexList" :key="index" :id="'scrollItem-' + index"
|
|
|
|
+ :style="getStyle(item.smzt)" v-else>
|
|
|
|
+ <view class="table-cell">
|
|
|
|
+ <button type="default" size="mini" @click="edit(item,index)">编辑</button>
|
|
</view>
|
|
</view>
|
|
<view class="table-cell2">{{ item["FCMKBarCode"] }}</view>
|
|
<view class="table-cell2">{{ item["FCMKBarCode"] }}</view>
|
|
- <view class="table-cell2">{{ item["FSrcStockLocId.FF102029.FName"] }}</view>
|
|
|
|
|
|
+ <view class="table-cell2">{{ item["FStockName"] }}</view>
|
|
<view class="table-cell2">{{ item["FDestStockLocId.FF102029.FName"] }}</view>
|
|
<view class="table-cell2">{{ item["FDestStockLocId.FF102029.FName"] }}</view>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
@@ -81,12 +88,16 @@
|
|
<uni-data-select v-model="loginForm.acctID" :localdata="range" @change="change"
|
|
<uni-data-select v-model="loginForm.acctID" :localdata="range" @change="change"
|
|
:clear="false"></uni-data-select>
|
|
:clear="false"></uni-data-select>
|
|
</view> -->
|
|
</view> -->
|
|
- <view
|
|
|
|
|
|
+ <view v-if="isCreate === false"
|
|
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>
|
|
<!-- <view>剩余件数:{{ balance }}</view> -->
|
|
<!-- <view>剩余件数:{{ balance }}</view> -->
|
|
</view>
|
|
</view>
|
|
|
|
+ <view v-else
|
|
|
|
+ style="display: flex;flex-direction: row;margin-top: 8px;font-size: 12px;margin-right: 15px;margin-bottom: 8px;">
|
|
|
|
+ <view style="margin-right: 15px;">已扫描:{{ indexListLength }}</view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -98,13 +109,11 @@
|
|
audit,
|
|
audit,
|
|
getInventoryList,
|
|
getInventoryList,
|
|
save,
|
|
save,
|
|
- submit
|
|
|
|
|
|
+ submit,
|
|
|
|
+ getBillList
|
|
} from '../../api/production_replenishment';
|
|
} from '../../api/production_replenishment';
|
|
import modal from '../../plugins/modal';
|
|
import modal from '../../plugins/modal';
|
|
- // import {
|
|
|
|
- // audioUrls,
|
|
|
|
- // playVoice
|
|
|
|
- // } from '../../utils/audio';
|
|
|
|
|
|
+
|
|
import {
|
|
import {
|
|
playVoice,
|
|
playVoice,
|
|
audioUrls,
|
|
audioUrls,
|
|
@@ -120,7 +129,9 @@
|
|
executeSql
|
|
executeSql
|
|
} from '../../utils/database';
|
|
} from '../../utils/database';
|
|
import {
|
|
import {
|
|
- createInventoryQueryRequest
|
|
|
|
|
|
+ createInventoryQueryRequest,
|
|
|
|
+ getFLotFNumber,
|
|
|
|
+ getInventory
|
|
} from '@/utils/transferparams.js';
|
|
} from '@/utils/transferparams.js';
|
|
export default {
|
|
export default {
|
|
onShow() {
|
|
onShow() {
|
|
@@ -222,6 +233,8 @@
|
|
tableName: "common_bill",
|
|
tableName: "common_bill",
|
|
destStockLocId: '',
|
|
destStockLocId: '',
|
|
isCreate: false,
|
|
isCreate: false,
|
|
|
|
+ showPicker: false,
|
|
|
|
+ depotList: [],
|
|
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -243,8 +256,9 @@
|
|
if ("NewFENCHASENUM.LT" in data) {
|
|
if ("NewFENCHASENUM.LT" in data) {
|
|
this.indexList[index]["FENCHASENUM.LT"] = data["NewFENCHASENUM.LT"]
|
|
this.indexList[index]["FENCHASENUM.LT"] = data["NewFENCHASENUM.LT"]
|
|
}
|
|
}
|
|
- if (this.indexList[index]["FSrcStockLocId.FF102029.FName"] != data["FSrcStockLocId.FF102029.FName"]) {
|
|
|
|
-
|
|
|
|
|
|
+ if (this.indexList[index]["FSrcStockLocId.FF102029.FName"] != data[
|
|
|
|
+ "FSrcStockLocId.FF102029.FName"]) {
|
|
|
|
+
|
|
const requestData = createInventoryQueryRequest(data["FSrcStockLocId.FF102029.FName"])
|
|
const requestData = createInventoryQueryRequest(data["FSrcStockLocId.FF102029.FName"])
|
|
getInventoryList(JSON.stringify(requestData)).then(res => {
|
|
getInventoryList(JSON.stringify(requestData)).then(res => {
|
|
this.indexList[index]["quantity"] = res.length
|
|
this.indexList[index]["quantity"] = res.length
|
|
@@ -272,8 +286,8 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
this.indexList[index]['FInventoryQty'] = data["FInventoryQty"]
|
|
this.indexList[index]['FInventoryQty'] = data["FInventoryQty"]
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
// 定义一个映射对象
|
|
// 定义一个映射对象
|
|
const formIdMap = {
|
|
const formIdMap = {
|
|
'STK_TransferDirect': 'FQty',
|
|
'STK_TransferDirect': 'FQty',
|
|
@@ -470,7 +484,7 @@
|
|
console.error('Error updating indexList:', error);
|
|
console.error('Error updating indexList:', error);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
scrollToItem(itemId) {
|
|
scrollToItem(itemId) {
|
|
// 设置滚动到的指定元素的 ID
|
|
// 设置滚动到的指定元素的 ID
|
|
this.scrollItem = itemId;
|
|
this.scrollItem = itemId;
|
|
@@ -481,6 +495,7 @@
|
|
const self = this
|
|
const self = this
|
|
modal.confirm("是否重置?").then(res => {
|
|
modal.confirm("是否重置?").then(res => {
|
|
if (res) {
|
|
if (res) {
|
|
|
|
+ self.depotList = []
|
|
self.indexList = []
|
|
self.indexList = []
|
|
self.searchValue = ""
|
|
self.searchValue = ""
|
|
self.balance = 0
|
|
self.balance = 0
|
|
@@ -498,12 +513,7 @@
|
|
'&&index=' + encodeURIComponent(JSON.stringify(index))
|
|
'&&index=' + encodeURIComponent(JSON.stringify(index))
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- // scrollToItem(id) {
|
|
|
|
- // // 使用id属性定位
|
|
|
|
- // this.$nextTick(() => {
|
|
|
|
- // uni.$emit('scrollIntoView', id);
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
|
|
+
|
|
showDetail(index) {
|
|
showDetail(index) {
|
|
console.log(index);
|
|
console.log(index);
|
|
let item = this.indexList[index.name]
|
|
let item = this.indexList[index.name]
|
|
@@ -731,8 +741,24 @@
|
|
playSequentially(audioUrlsArr);
|
|
playSequentially(audioUrlsArr);
|
|
|
|
|
|
},
|
|
},
|
|
- scanToCreate(){
|
|
|
|
|
|
+ CreateScanSuccess(nowindex) {
|
|
|
|
+ console.log("扫描完成开始渲染------------",nowindex)
|
|
|
|
+ console.log("-----------",this.indexList)
|
|
|
|
+ this.indexList[nowindex].smzt = 1
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.searchValue = ''
|
|
|
|
+ this.isFocus = true;
|
|
|
|
+ this.scrollToItem("scrollItem-" + nowindex)
|
|
|
|
+ })
|
|
|
|
+ const audioUrlsArr = [];
|
|
|
|
+ audioUrlsArr.push(audioUrls.success2VoiceUrl);
|
|
|
|
+ playSequentially(audioUrlsArr);
|
|
|
|
+ },
|
|
|
|
+ async scanToCreate() {
|
|
|
|
+ console.log("```````````````````进入扫描生成块")
|
|
let vm = this
|
|
let vm = this
|
|
|
|
+ let info = {}
|
|
//校验是否输入条码
|
|
//校验是否输入条码
|
|
if (this.searchValueIsEmpty(this.searchValue)) {
|
|
if (this.searchValueIsEmpty(this.searchValue)) {
|
|
playVoice(audioUrls.failVoiceUrl)
|
|
playVoice(audioUrls.failVoiceUrl)
|
|
@@ -740,10 +766,70 @@
|
|
this.focusPoint()
|
|
this.focusPoint()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- //根据条形码找编码
|
|
|
|
- //根据编码批号找即时库存
|
|
|
|
- //有多条时进行仓位选择
|
|
|
|
- //扫描完毕信息填充
|
|
|
|
|
|
+ info.FCMKBarCode = this.searchValue
|
|
|
|
+ modal.loading('扫描数据中,请耐心等待...')
|
|
|
|
+ try {
|
|
|
|
+ //根据条形码找编码
|
|
|
|
+ const lot = await this.getFLotCode(this.searchValue)
|
|
|
|
+ if (!lot) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: "未查询到编码!",
|
|
|
|
+ showCancel: false,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ this.focusPoint()
|
|
|
|
+ vm.searchValue = ''
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ // 执行取消后的操作
|
|
|
|
+ }
|
|
|
|
+ }.bind(this)
|
|
|
|
+ })
|
|
|
|
+ playVoice(audioUrls.failVoiceUrl)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ //根据编码批号找即时库存
|
|
|
|
+ const stockLoc = await this.getStockLoc(lot["FLot.FNumber"], lot["FMaterialId.FNumber"])
|
|
|
|
+ if (!stockLoc) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: "未查询到即时库存信息!",
|
|
|
|
+ showCancel: false,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ this.focusPoint()
|
|
|
|
+ vm.searchValue = ''
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ // 执行取消后的操作
|
|
|
|
+ }
|
|
|
|
+ }.bind(this)
|
|
|
|
+ })
|
|
|
|
+ playVoice(audioUrls.failVoiceUrl)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //有多条时进行仓位选择
|
|
|
|
+ if (stockLoc.length > 1) {
|
|
|
|
+ console.log("进行仓位选择--------------------",stockLoc)
|
|
|
|
+ this.depotList = [stockLoc]
|
|
|
|
+ this.showPicker = true
|
|
|
|
+ this.indexList.push(info)
|
|
|
|
+ }else{
|
|
|
|
+ info.FStockName = stockLoc[0].FStockName
|
|
|
|
+ this.indexList.push(info)
|
|
|
|
+ this.CreateScanSuccess(this.indexList.length)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ } finally {
|
|
|
|
+ modal.closeLoading();
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
scan() {
|
|
scan() {
|
|
let vm = this
|
|
let vm = this
|
|
@@ -758,7 +844,7 @@
|
|
if (this.checkBarcodeInArray(this.searchValue, this.indexList, "FENCHASENUM.LT")) {
|
|
if (this.checkBarcodeInArray(this.searchValue, this.indexList, "FENCHASENUM.LT")) {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '提示',
|
|
title: '提示',
|
|
- content: "条码:" + vm.searchValue + '不存在',
|
|
|
|
|
|
+ content: "条码:" + vm.searchValue + "不存在",
|
|
showCancel: false,
|
|
showCancel: false,
|
|
success: function(res) {
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
@@ -773,7 +859,7 @@
|
|
playVoice(audioUrls.failVoiceUrl)
|
|
playVoice(audioUrls.failVoiceUrl)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
//条码存在未扫描
|
|
//条码存在未扫描
|
|
let nowlocation = null; //该条码的仓位
|
|
let nowlocation = null; //该条码的仓位
|
|
let nowindex = null; //该条码的索引
|
|
let nowindex = null; //该条码的索引
|
|
@@ -790,7 +876,7 @@
|
|
let UnscannedNumber = this.indexList.filter(item =>
|
|
let UnscannedNumber = this.indexList.filter(item =>
|
|
item["FSrcStockLocId.FF102029.FName"] === this.Location && item['smzt'] != 1
|
|
item["FSrcStockLocId.FF102029.FName"] === this.Location && item['smzt'] != 1
|
|
).length
|
|
).length
|
|
-
|
|
|
|
|
|
+
|
|
if (nowlocation != this.Location && UnscannedNumber != 0) { //仓位不一致
|
|
if (nowlocation != this.Location && UnscannedNumber != 0) { //仓位不一致
|
|
playVoice(audioUrls.warningSuccessUrl)
|
|
playVoice(audioUrls.warningSuccessUrl)
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -818,8 +904,12 @@
|
|
this.handleScanSuccess(nowindex)
|
|
this.handleScanSuccess(nowindex)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getIsCreate(){
|
|
|
|
- return this.isCreate === true ? 'scanToCreate' : 'scan'
|
|
|
|
|
|
+ getIsCreate() {
|
|
|
|
+ if (this.isCreate) {
|
|
|
|
+ this.scanToCreate()
|
|
|
|
+ } else {
|
|
|
|
+ this.scan()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
getHeightStyle() {
|
|
getHeightStyle() {
|
|
return 'height:' + this.listHeight + 'px';
|
|
return 'height:' + this.listHeight + 'px';
|
|
@@ -828,6 +918,25 @@
|
|
return smzt ? 'background-color: Navy;color:white' : '';
|
|
return smzt ? 'background-color: Navy;color:white' : '';
|
|
// return 'scrollItem-' + index === this.scrollItem ? 'background-color: blue;color:white' : '';
|
|
// return 'scrollItem-' + index === this.scrollItem ? 'background-color: blue;color:white' : '';
|
|
},
|
|
},
|
|
|
|
+ async getFLotCode(code) {
|
|
|
|
+ const searchParam = getFLotFNumber(code)
|
|
|
|
+ let ress = await getBillList(JSON.stringify(searchParam))
|
|
|
|
+ return ress?.[0]
|
|
|
|
+ },
|
|
|
|
+ async getStockLoc(lot, material) {
|
|
|
|
+ const searchParam = getInventory(lot, material)
|
|
|
|
+ return getBillList(JSON.stringify(searchParam))
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ pickDepot(e){
|
|
|
|
+ console.log('confirm', e)
|
|
|
|
+ this.Location = e.value[0]
|
|
|
|
+ this.indexList[this.indexList.length - 1].FStockName = e.value[0].FStockName
|
|
|
|
+ console.log('confirm2', this.indexList)
|
|
|
|
+ this.showPicker = false
|
|
|
|
+ this.CreateScanSuccess(this.indexList.length-1)
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|