Browse Source

修改计划外出入库记录

wms3.0_pda
lijuncheng 11 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) {
return request({
url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit?id=" + id,
url: baseApi + "/wms/unplannedreceipt-record-main/create",
method: "post",
data: params,
});
@ -2819,8 +2819,8 @@ export function scrapRequestHandle(id) {
*/
export function scrapRecordSubmit(params) {
return request({
url: baseApi + "/wms/purchasereturn-request-main/submit",
method: "put",
url: baseApi + "/wms/scrap-record-main/create",
method: "post",
data: params,
});
}

11
common/basic.js

@ -320,17 +320,6 @@ export function getUnPlannedIssuseReasonList(value) {
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) {

106
pages/scrap/record/scrapRecord.vue

@ -10,7 +10,7 @@
</view>
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;"
class='uni-data-picker' placeholder="请选择原因" popup-title="选择报废原因" :localdata="reasonList"
v-model="reason">
@change="reasonChange">
</uni-data-picker>
</view>
<view class="page-main">
@ -56,12 +56,12 @@
import {
goHome,
updateTitle,
getScarpReasonList
} from '@/common/basic.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray,
getScarpReasonList
} from '@/common/directory.js';
import {
@ -94,27 +94,19 @@
data() {
return {
id: '',
receiptJob: {},
received: false,
isShowPackingCode: true,
scanCount: 0,
dataContent: {}, //
subList: [], //subList
detailSource: [], //
locationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
fromLocationInfo: {},
fromLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [],
tolocationTypeList: [],
allowModifyLocation: false,
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
reasonList: [],
reason: "",
reasonText: "",
reasonCode:"",
};
},
onLoad(option) {
@ -249,7 +241,7 @@
commit() {
if(this.reason==""){
if(this.reasonText==""){
this.showMessage("请先选择报废原因")
return;
}
@ -259,18 +251,17 @@
mask: true
});
// scrapRecordSubmit(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)
// })
scrapRecordSubmit(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)
})
},
@ -279,10 +270,26 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch);
// detail.toPackingNumber =info.packingNumber;
// detail.toBatch =info.batch;
detail.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
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)
}
})
@ -290,31 +297,7 @@
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) {
@ -345,14 +328,18 @@
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code;
this.openScanPopup();
},
showCommitSuccessMessage(hint) {
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)
}
}
},
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">
<scroll-view scroll-y="true" class="page-main-scroll">
<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>
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
@ -98,13 +98,15 @@
toInventoryStatus: [],
businessType: {}, //
detailSource: [], //
reason: "",
reasonText: "",
reasonCode:"",
reasonList: [],
dataContent:{}
}
},
mounted() {
this.reasonList = getUnPlannedIssuseReasonList();
var typeCode = "UnplannedDeliver"
getBusinessType(typeCode, res => {
if (res.success) {
@ -209,11 +211,12 @@
this.detailSource.splice(index, 1)
},
commit() {
if (this.reason == '') {
if (this.reasonText == '') {
this.showErrorMessage("请选择出库原因")
return;
}
var params =this.setParams()
console.log("提交" + JSON.stringify(params))
// unPlannedIssueRecordSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
@ -232,8 +235,6 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch);
detail.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
@ -241,17 +242,19 @@
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = detail.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch;
detail.fromBatch = detail.batch;
detail.toBatch = detail.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode;
detail.toLocationCode = "";
detail.reason = this.reasonCode;
subList.push(detail)
}
})
@ -259,6 +262,25 @@
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>

56
pages/unPlanned/record/receiptRecord.vue

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