Browse Source

修改计划外出入库记录

wms3.0_pda
lijuncheng 12 months ago
parent
commit
5f247206b0
  1. 6
      api/request2.js
  2. 11
      common/basic.js
  3. 106
      pages/scrap/record/scrapRecord.vue
  4. 42
      pages/unPlanned/record/issueRecord.vue
  5. 56
      pages/unPlanned/record/receiptRecord.vue

6
api/request2.js

@ -1349,7 +1349,7 @@ export function unPlannedReceiptRequestHandle(id) {
*/ */
export function unPlannedReceiptRecordbSubmit(id, params) { export function unPlannedReceiptRecordbSubmit(id, params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit?id=" + id, url: baseApi + "/wms/unplannedreceipt-record-main/create",
method: "post", method: "post",
data: params, data: params,
}); });
@ -2819,8 +2819,8 @@ export function scrapRequestHandle(id) {
*/ */
export function scrapRecordSubmit(params) { export function scrapRecordSubmit(params) {
return request({ return request({
url: baseApi + "/wms/purchasereturn-request-main/submit", url: baseApi + "/wms/scrap-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }

11
common/basic.js

@ -320,17 +320,6 @@ export function getUnPlannedIssuseReasonList(value) {
return unplannedIissueReason return unplannedIissueReason
} }
//获取报废出库原因
export function getScarpReasonList(value) {
if (scrapReasonList.length == 0) {
scrapReasonList = getDirectoryInfo("scrap_reason")
}
scrapReasonList.forEach(res => {
res.text = res.label;
res.value = res.code
})
return scrapReasonList
}
//获取检验不合格原因 //获取检验不合格原因
export function getInspectReasonList(value) { export function getInspectReasonList(value) {

106
pages/scrap/record/scrapRecord.vue

@ -10,7 +10,7 @@
</view> </view>
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;" <uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;"
class='uni-data-picker' placeholder="请选择原因" popup-title="选择报废原因" :localdata="reasonList" class='uni-data-picker' placeholder="请选择原因" popup-title="选择报废原因" :localdata="reasonList"
v-model="reason"> @change="reasonChange">
</uni-data-picker> </uni-data-picker>
</view> </view>
<view class="page-main"> <view class="page-main">
@ -56,12 +56,12 @@
import { import {
goHome, goHome,
updateTitle, updateTitle,
getScarpReasonList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray, getDirectoryItemArray,
getScarpReasonList
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
@ -94,27 +94,19 @@
data() { data() {
return { return {
id: '', id: '',
receiptJob: {},
received: false,
isShowPackingCode: true,
scanCount: 0,
dataContent: {}, // dataContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [], locationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
allowModifyLocation: false,
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {}, businessType: {},
reasonList: [], reasonList: [],
reason: "", reasonText: "",
reasonCode:"",
}; };
}, },
onLoad(option) { onLoad(option) {
@ -249,7 +241,7 @@
commit() { commit() {
if(this.reason==""){ if(this.reasonText==""){
this.showMessage("请先选择报废原因") this.showMessage("请先选择报废原因")
return; return;
} }
@ -259,18 +251,17 @@
mask: true mask: true
}); });
scrapRecordSubmit(params).then(res => {
// scrapRecordSubmit(params).then(res => { uni.hideLoading()
// uni.hideLoading() if (res.data) {
// if (res.data) { this.showCommitSuccessMessage("提交成功<br>生成报废出库记录" + res.data)
// this.showCommitSuccessMessage("<br>" + res.data, ) } else {
// } else { this.showErrorMessage("提交失败[" + res.msg + "]")
// this.showErrorMessage("[" + res.msg + "]") }
// } }).catch(error => {
// }).catch(error => { uni.hideLoading()
// uni.hideLoading() this.showErrorMessage(error)
// this.showErrorMessage(error) })
// })
}, },
@ -279,10 +270,26 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.itemCode = detail.itemCode;
// detail.packingNumber, detail.batch); detail.itemName = detail.package.itemName;
// detail.toPackingNumber =info.packingNumber; detail.itemDesc1 = detail.package.itemDesc1;
// detail.toBatch =info.batch; detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = detail.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = detail.batch;
detail.toBatch = detail.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = "";
detail.reason = this.reasonCode;
subList.push(detail) subList.push(detail)
} }
}) })
@ -290,31 +297,7 @@
return subList; return subList;
}, },
setRequestParams(){
var subList = []
var supplierCode=""
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
if(supplierCode==""){
supplierCode = detail.package.supplierCode
}
subList.push(detail)
}
})
})
this.dataContent.subList = subList
this.dataContent.supplierCode = supplierCode
this.dataContent.businessType = "PurchasePutaway"
this.dataContent.departmentCode= "研发部门";
this.dataContent.status= 1 ;
this.dataContent.autoCommit = "FALSE";
this.dataContent.autoAgree = "FALSE";
this.dataContent.autoExecute = "FALSE";
this.dataContent.directCreateRecord = "FALSE";
return this.dataContent;
},
showMessage(message) { showMessage(message) {
@ -345,14 +328,18 @@
this.getFromLocationCode(location, code) this.getFromLocationCode(location, code)
}, },
getFromLocationCode(location, code) { getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code; this.fromLocationCode = code;
this.openScanPopup(); this.openScanPopup();
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = ''; this.reasonCode = ""
this.reasonText = "";
this.detailSource = [];
this.subList =[];
this.managementList =[];
this.dataContent ={}
}) })
}, },
@ -365,6 +352,15 @@
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
} }
},
reasonChange(e) {
if (e.detail.value.length == 0) {
this.reasonCode = ""
this.reasonText = ""
} else {
this.reasonCode = e.detail.value[0].value
this.reasonText = e.detail.value[0].text
}
} }
} }
} }

42
pages/unPlanned/record/issueRecord.vue

@ -7,7 +7,7 @@
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<uni-data-picker style="padding: 20rpx; background-color:#fff;" class='uni-data-picker' <uni-data-picker style="padding: 20rpx; background-color:#fff;" class='uni-data-picker'
placeholder="请选择出库原因" popup-title="出库原因" :localdata="reasonList" v-model="reason"> placeholder="请选择出库原因" popup-title="出库原因" :localdata="reasonList" @change="reasonChange">
</uni-data-picker> </uni-data-picker>
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
@ -98,13 +98,15 @@
toInventoryStatus: [], toInventoryStatus: [],
businessType: {}, // businessType: {}, //
detailSource: [], // detailSource: [], //
reason: "", reasonText: "",
reasonCode:"",
reasonList: [], reasonList: [],
dataContent:{} dataContent:{}
} }
}, },
mounted() { mounted() {
this.reasonList = getUnPlannedIssuseReasonList();
var typeCode = "UnplannedDeliver" var typeCode = "UnplannedDeliver"
getBusinessType(typeCode, res => { getBusinessType(typeCode, res => {
if (res.success) { if (res.success) {
@ -209,11 +211,12 @@
this.detailSource.splice(index, 1) this.detailSource.splice(index, 1)
}, },
commit() { commit() {
if (this.reason == '') { if (this.reasonText == '') {
this.showErrorMessage("请选择出库原因") this.showErrorMessage("请选择出库原因")
return; return;
} }
var params =this.setParams() var params =this.setParams()
console.log("提交" + JSON.stringify(params))
// unPlannedIssueRecordSubmit(params).then(res => { // unPlannedIssueRecordSubmit(params).then(res => {
// uni.hideLoading() // uni.hideLoading()
// if (res.data) { // if (res.data) {
@ -232,8 +235,6 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch);
detail.itemCode = detail.itemCode; detail.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName; detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1; detail.itemDesc1 = detail.package.itemDesc1;
@ -241,17 +242,19 @@
detail.inventoryStatus = detail.inventoryStatus; detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber; detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = info.packingNumber; detail.toPackingNumber = detail.packingNumber;
detail.fromContainerNumber = detail.containerNumber; detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch; detail.fromBatch = detail.batch;
detail.toBatch = info.batch; detail.toBatch = detail.batch;
detail.fromLocationCode = detail.locationCode; detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode; detail.toLocationCode = "";
detail.reason = this.reasonCode;
subList.push(detail) subList.push(detail)
} }
}) })
@ -259,6 +262,25 @@
return subList; return subList;
}, },
reasonChange(e) {
if (e.detail.value.length == 0) {
this.reasonCode = ""
this.reasonText = ""
} else {
this.reasonCode = e.detail.value[0].value
this.reasonText = e.detail.value[0].text
}
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.reasonCode = ""
this.reasonText = "";
this.detailSource = [];
this.managementList =[];
this.dataContent ={}
})
},
} }
} }
</script> </script>

56
pages/unPlanned/record/receiptRecord.vue

@ -8,7 +8,7 @@
<view class="page-main"> <view class="page-main">
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;" <uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;"
class='uni-data-picker' placeholder="请选择入库原因" popup-title="入库原因" :localdata="reasonList" class='uni-data-picker' placeholder="请选择入库原因" popup-title="入库原因" :localdata="reasonList"
v-model="reason"> @change="reasonChange">
</uni-data-picker> </uni-data-picker>
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
@ -27,7 +27,7 @@
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation> :locationTypeList="tolocationTypeList"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
@ -92,14 +92,13 @@
data() { data() {
return { return {
toLocationCode: "", toLocationCode: "",
toLocationInfo: {},
toInventoryStatus: [], toInventoryStatus: [],
businessType: {}, // businessType: {}, //
detailSource: [], // detailSource: [], //
businessTypeCode: "UnplannedReceipt", businessTypeCode: "UnplannedReceipt",
reason: "", reasonText: "",
reasonCode:"",
reasonList: [], reasonList: [],
showToLoaction:true,
dataContent:{}, dataContent:{},
managementList:[] managementList:[]
} }
@ -229,11 +228,11 @@
this.detailSource.splice(index, 1) this.detailSource.splice(index, 1)
}, },
commit() { commit() {
if (this.showToLoaction &&this.toLocationCode == "") { if (this.toLocationCode == "") {
this.showErrorMessage("请先选择目标库位") this.showErrorMessage("请先选择目标库位")
return; return;
} }
if (this.reason == '') { if (this.reasonText == '') {
this.showErrorMessage("请选择入库原因") this.showErrorMessage("请选择入库原因")
return; return;
} }
@ -251,19 +250,18 @@
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams() var params = this.setParams()
debugger
console.log("提交" + JSON.stringify(params)) console.log("提交" + JSON.stringify(params))
// unPlannedReceiptRecordbSubmit(params).then(res => { unPlannedReceiptRecordbSubmit(params).then(res => {
// uni.hideLoading() uni.hideLoading()
// if (res.data) { if (res.data) {
// this.showCommitSuccessMessage("<br><br>" + res.data) this.showCommitSuccessMessage("提交成功<br>生成计划外入库记录<br>" + res.data)
// } else { } else {
// this.showErrorMessage("[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
// } }
// }).catch(error => { }).catch(error => {
// uni.hideLoading() uni.hideLoading()
// this.showErrorMessage(error) this.showErrorMessage(error)
// }) })
} else { } else {
uni.hideLoading(); uni.hideLoading();
@ -332,6 +330,7 @@
detail.fromLocationCode = ""; detail.fromLocationCode = "";
detail.toLocationCode = detail.toLocationCode; detail.toLocationCode = detail.toLocationCode;
detail.reason = this.reasonCode;
subList.push(detail) subList.push(detail)
} }
@ -341,6 +340,25 @@
this.dataContent.creator = creator; this.dataContent.creator = creator;
return this.dataContent; return this.dataContent;
}, },
reasonChange(e) {
if (e.detail.value.length == 0) {
this.reasonCode = ""
this.reasonText = ""
} else {
this.reasonCode = e.detail.value[0].value
this.reasonText = e.detail.value[0].text
}
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.reasonCode = ""
this.reasonText = "";
this.detailSource = [];
this.managementList=[];
this.dataContent ={}
this.toLocationCode =""
})
},
} }

Loading…
Cancel
Save