You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

167 lines
4.0 KiB

<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='goScan()'></com-blank-view>
</view>
</view>
<winScanPackLevel ref="scanPopup" @getResult='getScanResult' headerType="HCMQ" title="叫料标签" :isShowHistory="false">
</winScanPackLevel>
<comMessage ref="comMessage"></comMessage>
</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 comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import winScanPackLevel from '@/mycomponents/scan/winScanPackLevel.vue'
export default {
name: 'issueRequestSubmit',
components: {
comBlankView,
jobDetailPopup,
comIssueRequestCreator,
winScanPackLevel
},
data() {
return {
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
detailSource: {
subList: []
}, //绑定在页面上的数据源
detailOptions: [],
scanOptions: [],
requestList: [], //需求信息
itemCodeTypeList: [],
useOnTheWay: "FALSE"
}
},
mounted() {},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title
})
var typeCode = "Issue"
getBusinessType(typeCode, res => {
if (res.success) {
this.itemCodeTypeList = res.itemCodeTypeList;
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(result) {
this.detailSource = {
subList: []
}
var labelInfo = result.label;
var data = {
itemCode: labelInfo.itemCode,
location: labelInfo.location,
qty: labelInfo.qty,
uom: labelInfo.uom,
packUnit: labelInfo.packUnit
};
this.detailSource.subList.push(data)
this.detailSource.productionLineCode = labelInfo.productionLineCode;
this.detailSource.workStationCode = labelInfo.workStationCode;
this.detailSource.warehouseCode = labelInfo.warehouseCode;
this.detailSource.workshopCode = labelInfo.workshopCode;
this.detailSource.priority = result.priorityCode
this.submit();
},
setParams() {
// this.detailSource.dueTime = getCurrDateOneMonthsTimes();
this.detailSource.isCallMaterialsLabel = "TRUE";
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("提交成功\n生成发料申请[" + res.data + "]")
} else {
this.showCommitSuccessMessage("提交成功")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.closeScanPopup();
setTimeout(end => {
this.goScan();
}, 500)
})
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
showErrorMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus();
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus()
}
});
},
scanPopupGetFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus();
}
},
}
}
</script>
<style>
</style>