|
@@ -10,7 +10,7 @@
|
|
|
</view>
|
|
|
<view class="button-group" v-else>
|
|
|
<button type="default" @click="reset">取消</button>
|
|
|
- <button type="default" @click="navigateToSearch">提交</button>
|
|
|
+ <button type="default" @click="submit">提交</button>
|
|
|
</view>
|
|
|
<uni-easyinput prefixIcon="search" :focus="isFocus" v-model="searchValue" @blur="isFocus = false"
|
|
|
@confirm="getIsCreate()" @clear="clear" placeholder="请扫描拼件单号">
|
|
@@ -24,7 +24,7 @@
|
|
|
<scroll-view class="table-content" :style="{'height': clientHeight + 'px'}" scroll-x scroll-y
|
|
|
:scroll-into-view="scrollItem">
|
|
|
<!-- 表头-正常-->
|
|
|
- <view class="table-header" v-if="isCreate === false">
|
|
|
+ <view class="table-header" v-if="!isCreate">
|
|
|
<view class="table-cell">操作</view>
|
|
|
<view class="table-cell">扫描状态</view>
|
|
|
<view class="table-cell">调出仓位</view>
|
|
@@ -48,38 +48,43 @@
|
|
|
<view class="table-cell2">调出仓位</view>
|
|
|
<view class="table-cell2">调入仓位</view>
|
|
|
</view>
|
|
|
- <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>
|
|
|
- </view>
|
|
|
- <view class="table-cell">{{ item.smzt? '已扫描' : '未扫描' }}</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-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["FBOXNO.LT"] }}</view>
|
|
|
- <view class="table-cell1" :style="getStyle(item.smzt)">{{ item["FAuxPropId.FF101501.FDataValue"] }}
|
|
|
+ <view v-if="!isCreate">
|
|
|
+ <view class="table-row" v-for="(item, index) in indexList" :key="index" :id="'scrollItem-' + index"
|
|
|
+ :style="getStyle(item.smzt)">
|
|
|
+ <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["FSrcStockLocId.FF102029.FName"] }}</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["FQty"] }}</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-cellph" :style="getStyle(item.smzt)">{{ item["FLot.FNumber"] }}</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-cell2" :style="getStyle(item.smzt)">{{ item["quantity"] }}</view>
|
|
|
+ <view class="table-cell" :style="getStyle(item.smzt)">{{ item["rowCount"] }}</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>
|
|
|
- <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-cell" :style="getStyle(item.smzt)">{{ item["FNoteEntry"] }}</view>
|
|
|
- <view class="table-cell2" :style="getStyle(item.smzt)">{{ item["quantity"] }}</view>
|
|
|
- <view class="table-cell" :style="getStyle(item.smzt)">{{ item["rowCount"] }}</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>
|
|
|
- <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 class="table-cell2">{{ item["FCMKBarCode"] }}</view>
|
|
|
- <view class="table-cell2">{{ item["FStockName"] }}</view>
|
|
|
- <view class="table-cell2">{{ item["smzt"] }}</view>
|
|
|
+ <view v-else>
|
|
|
+ <view class="table-row" v-for="(item) in indexList" :key="item.FCMKBarCode"
|
|
|
+ :id="'scrollItem-' + item.index">
|
|
|
+ <view class="table-cell">
|
|
|
+ <button type="default" size="mini" @click="edit(item,item.index)">编辑</button>
|
|
|
+ </view>
|
|
|
+ <view class="table-cell2">{{ item["FCMKBarCode"] }}</view>
|
|
|
+ <view class="table-cell2">{{ item["FStockName"] }}</view>
|
|
|
+ <view class="table-cell2">{{ item["FStockId.FName"] }}</view>
|
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
|
|
@@ -90,7 +95,7 @@
|
|
|
<uni-data-select v-model="loginForm.acctID" :localdata="range" @change="change"
|
|
|
:clear="false"></uni-data-select>
|
|
|
</view> -->
|
|
|
- <view v-if="isCreate === false"
|
|
|
+ <view v-if="!isCreate"
|
|
|
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;">已扫描:{{ indexListLength }}</view>
|
|
@@ -215,6 +220,11 @@
|
|
|
this.Location = newValue
|
|
|
// 可以在这里执行相应的操作
|
|
|
},
|
|
|
+ indexList(newValue, oldValue) {
|
|
|
+ console.log(`Location changed from ${oldValue} to ${newValue}`)
|
|
|
+ this.indexList = newValue
|
|
|
+ // 可以在这里执行相应的操作
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -438,7 +448,7 @@
|
|
|
let promises = [];
|
|
|
// 遍历 uniqueFStockLocId 数组
|
|
|
for (let fname of this.uniqueFStockLocId) {
|
|
|
-
|
|
|
+
|
|
|
const requestData = createInventoryQueryRequest(fname)
|
|
|
|
|
|
// 发起异步请求,并将 promise 存储在数组中
|
|
@@ -486,11 +496,21 @@
|
|
|
})
|
|
|
},
|
|
|
edit(item, index) {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/direct-transfer/show?item=' + encodeURIComponent(JSON.stringify(
|
|
|
- item)) +
|
|
|
- '&&index=' + encodeURIComponent(JSON.stringify(index))
|
|
|
- });
|
|
|
+ if (this.isCreate) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/direct-transfer/show?isCreate=true&&item=' + encodeURIComponent(JSON
|
|
|
+ .stringify(
|
|
|
+ item)) +
|
|
|
+ '&&index=' + encodeURIComponent(JSON.stringify(index))
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/direct-transfer/show?item=' + encodeURIComponent(JSON.stringify(
|
|
|
+ item)) +
|
|
|
+ '&&index=' + encodeURIComponent(JSON.stringify(index))
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
showDetail(index) {
|
|
@@ -511,6 +531,35 @@
|
|
|
clear() {
|
|
|
this.focusPoint()
|
|
|
},
|
|
|
+ submit() {
|
|
|
+ let vm = this
|
|
|
+ uni.showModal({
|
|
|
+ title: "提示",
|
|
|
+ content: "是否生成单据?",
|
|
|
+ showCancel: true,
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ vm.createSubmit()
|
|
|
+ } else {
|
|
|
+ // 执行取消后的操作
|
|
|
+ vm.$nextTick(() => {
|
|
|
+ vm.searchValue = ''
|
|
|
+ vm.focusPoint();
|
|
|
+ })
|
|
|
+ // return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //重置页面
|
|
|
+ // {
|
|
|
+ // this.depotList = []
|
|
|
+ // this.indexList = []
|
|
|
+ // this.searchValue = ""
|
|
|
+ // this.balance = 0
|
|
|
+ // this.isFocus = true
|
|
|
+ // playVoice(audioUrls.warningSuccessUrl)
|
|
|
+ // }
|
|
|
+ },
|
|
|
//跳转到查询页面
|
|
|
navigateToSearch() {
|
|
|
if (this.indexList.length > 0) {
|
|
@@ -528,6 +577,7 @@
|
|
|
url: `/pages/direct-transfer/search?FormId=${this.formId}&FBillType=${this.fbillType}`
|
|
|
});
|
|
|
|
|
|
+
|
|
|
},
|
|
|
navigateToSummary() {
|
|
|
uni.navigateTo({
|
|
@@ -615,6 +665,17 @@
|
|
|
// icon: "none"
|
|
|
// });
|
|
|
|
|
|
+ },
|
|
|
+ async createSubmit() {
|
|
|
+ const FormId = uni.getStorageSync('formId')
|
|
|
+ try {
|
|
|
+ await submitHelper.createSubmit(FormId, this.indexList);
|
|
|
+ this.indexList = [];
|
|
|
+ console.log("提交成功!this.indexList已清空");
|
|
|
+ } catch (error) {
|
|
|
+ this.handleError(error)
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
async handleSubmit(FID) {
|
|
|
const FormId = uni.getStorageSync('formId')
|
|
@@ -723,8 +784,11 @@
|
|
|
CreateScanSuccess(nowindex) {
|
|
|
console.log("扫描完成开始渲染------------", nowindex)
|
|
|
this.indexList[nowindex].smzt = 1
|
|
|
- this.$forceUpdate()
|
|
|
+ this.indexList[nowindex]['FStockId.FNumber'] = 'MLCK006'
|
|
|
+ this.indexList[nowindex]['FStockLocId.FF102029.FNumber'] = '301100206'
|
|
|
+ // this.$forceUpdate()
|
|
|
this.$nextTick(() => {
|
|
|
+ console.log("准备刷新---------------", this.indexList)
|
|
|
this.searchValue = ''
|
|
|
this.isFocus = true;
|
|
|
this.scrollToItem("scrollItem-" + nowindex)
|
|
@@ -746,8 +810,21 @@
|
|
|
return
|
|
|
}
|
|
|
info.FCMKBarCode = this.searchValue
|
|
|
+ //校验是否重复扫码
|
|
|
+ const isDuplicate = this.indexList.some(item => item.FCMKBarCode === info.FCMKBarCode);
|
|
|
+ if (isDuplicate) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ console.log("重复扫码---------------", this.indexList)
|
|
|
+ this.searchValue = ''
|
|
|
+ playVoice(audioUrls.successVoiceUrl);
|
|
|
+ this.focusPoint()
|
|
|
+ })
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
modal.loading('扫描数据中,请耐心等待...')
|
|
|
try {
|
|
|
+
|
|
|
//根据条形码找编码
|
|
|
const lot = await this.getFLotCode(this.searchValue)
|
|
|
if (!lot) {
|
|
@@ -797,14 +874,18 @@
|
|
|
this.showPicker = true
|
|
|
this.indexList.push(info)
|
|
|
} else {
|
|
|
+ info.index = this.indexList.length
|
|
|
Object.assign(info, stockLoc[0])
|
|
|
- this.indexList.push(info)
|
|
|
- this.CreateScanSuccess(this.indexList.length)
|
|
|
+ console.log("不用选择--------------------", info)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.indexList.push(info);
|
|
|
+ this.CreateScanSuccess(this.indexList.length - 1);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
} finally {
|
|
|
modal.closeLoading();
|
|
|
- console.log("```````````````````",this.indexList)
|
|
|
+ console.log("`````````````结束扫描生成", this.indexList)
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -910,12 +991,12 @@
|
|
|
this.Location = e.value[0]
|
|
|
const selectedValue = e.value[0];
|
|
|
if (this.indexList.length > 0) {
|
|
|
- this.$set(this.indexList, this.indexList.length - 1, {
|
|
|
- ...this.indexList[this.indexList.length - 1],
|
|
|
- FStockName: selectedValue.FStockName,
|
|
|
- });
|
|
|
- }
|
|
|
- this.indexList[this.indexList.length - 1].FStockName = e.value[0].FStockName
|
|
|
+ this.$set(this.indexList, this.indexList.length - 1, {
|
|
|
+ ...this.indexList[this.indexList.length - 1],
|
|
|
+ ...selectedValue,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 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)
|