Browse Source

修改采购收货扫描数量

hella_vue3
lijuncheng 9 months ago
parent
commit
ac9d1b0458
  1. 2
      src/common/detail.js
  2. 2
      src/mycomponents/package/packageList.vue
  3. 7
      src/pages.json
  4. 144
      src/pages/issue/request/issueScanRequest.vue
  5. 23
      src/pages/purchaseReceipt/job/receiptDetail.vue

2
src/common/detail.js

@ -118,12 +118,14 @@ export function calcTreeHandleQty(detailSource) {
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
if(detail.packList.length>0){
detail.handleQty = new Decimal(0).toNumber();
for (let pack of detail.packList){
if(pack!=undefined&&pack.scaned){
detail.handleQty = calc.add(detail.handleQty, pack.handleQty);
}
}
}
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
}

2
src/mycomponents/package/packageList.vue

@ -117,7 +117,7 @@
res => {
if (res) {
item.scaned = false
item.handleQty = 0
item.handleQty = null;
this.$emit('updateData')
this.$forceUpdate()
}

7
src/pages.json

@ -472,6 +472,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/issue/request/issueScanRequest",
"style": {
"navigationBarTitleText": "扫描叫料申请",
"enablePullDownRefresh": false
}
},
{
"path": "pages/issue/job/issueJob",

144
src/pages/issue/request/issueScanRequest.vue

@ -0,0 +1,144 @@
<template>
<view class="page-wraper">
<view class="" >
<com-blank-view @goScan='goScan()'></com-blank-view>
</view>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HCMQ" title="叫料标签"></win-scan-pack>
</template>
<script>
import {
issueRequestSubmit,
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
getBusinessType,
} from '@/common/record.js';
import {
goHome,
updateTitle,
getRemoveOption,
navigateBack,
getCurrDateOneMonthsTimes
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
export default {
name: 'issueRequestSubmit',
components: {
comBlankView,
jobDetailPopup,
comScanIssuePack,
comIssueRequestCreator,
winScanPack
},
data() {
return {
jobContent: {}, //
subList: [], //subList
detailSource: {
subList: []
}, //
detailOptions: [],
scanOptions: [],
requestList: [], //
itemCodeTypeList:[],
useOnTheWay:"FALSE"
}
},
mounted() {
},
onLoad(option) {
var typeCode = "Issue"
getBusinessType(typeCode, res => {
if (res.success) {
this.itemCodeTypeList = res.itemCodeTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.useOnTheWay = res.useOnTheWay;
this.fromInventoryStatuses = res.fromInventoryStatuses
this.toInventoryStatuses = res.toInventoryStatuses
this.goScan()
} else {
this.showErrorMessage(res.message)
}
});
},
methods: {
goScan() {
this.$refs.scanPopup.openScanPopup();
},
getScanResult(data){
this.detailSource.subList = [];
var labelInfo = data.label;
var warehouseCode = labelInfo.warehouseCode;
var workshopCode =labelInfo.workshopCode;
var productionLineCode =labelInfo.productionLineCode;
var workStationCode = labelInfo.workStationCode;
var itemCode = labelInfo.itemCode;
var location = labelInfo.location;
var qty = labelInfo.qty;
var uom = labelInfo.uom;
var packUnit = labelInfo.packUnit;
var data = {};
this.detailSource.subList.push()
},
setParams() {
this.detailSource.dueTime = getCurrDateOneMonthsTimes();
return this.detailSource
},
submit() {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
issueRequestSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发料申请" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
}
}
</script>
<style>
</style>

23
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -311,6 +311,7 @@
})
calcTreeHandleQty(this.detailSource);
var test =this.detailSource
this.continueScan()
this.$forceUpdate()
}
@ -409,17 +410,17 @@
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
purchaseReceiptJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购收货记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
// purchaseReceiptJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br><br>" + res.data)
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);

Loading…
Cancel
Save