Browse Source

计划外出入库

wms3.0_pda
lijuncheng 12 months ago
parent
commit
0084971057
  1. 13
      api/request2.js
  2. 4
      pages/supplierDeliver/record/supplierDeliverRecord.vue
  3. 12
      pages/unPlanned/coms/comIssueJobCard.vue
  4. 12
      pages/unPlanned/coms/comReceiptJobCard.vue
  5. 2
      pages/unPlanned/request/issueRequest.vue
  6. 298
      pages/unPlanned/request/issueRequestCreate.vue
  7. 2
      pages/unPlanned/request/receiptRequest.vue

13
api/request2.js

@ -1232,13 +1232,13 @@ export function getUnPlannedReceiptJobDetail(id) {
/** /**
* 计划外入库 任务承接 * 计划外入库任务 任务承接
* @param {*} id * @param {*} id
* *
*/ */
export function takeUnPlannedReceiptJob(id) { export function takeUnPlannedReceiptJob(id) {
return request({ return request({
url: baseApi + "/wms/purchasereceipt-job-main/accept?id=" + id, url: baseApi + "/wms/unplannedreceipt-job-main/accept?id=" + id,
method: "put", method: "put",
data: {}, data: {},
}); });
@ -1251,8 +1251,8 @@ export function takeUnPlannedReceiptJob(id) {
*/ */
export function cancleTakeUnPlannedReceiptJob(id) { export function cancleTakeUnPlannedReceiptJob(id) {
return request({ return request({
url: baseApi + "/wms/purchasereceipt-job-main/abandon?id=" + id, url: baseApi + "/wms/unplannedreceipt-job-main/abandon?id=" + id,
method: "get", method: "put",
data: {}, data: {},
}); });
} }
@ -1263,7 +1263,7 @@ export function cancleTakeUnPlannedReceiptJob(id) {
*/ */
export function unPlannedReceiptJobSubmit(params) { export function unPlannedReceiptJobSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit", url: baseApi + "/wms/unplannedreceipt-job-main/execute",
method: "put", method: "put",
data: params, data: params,
}); });
@ -1352,9 +1352,10 @@ export function cancleTakeUnPlannedIssueJob(id) {
* 计划外出库任务 提交 * 计划外出库任务 提交
* @param {*} params * @param {*} params
*/ */
export function unPlannedIssueJobSubmit(params) { export function unPlannedIssueJobSubmit(params) {
return request({ return request({
url: baseApi + "/wms/unplannedissue-job-main/abandon", url: baseApi + "/wms/unplannedissue-job-main/execute",
method: "put", method: "put",
data: params, data: params,
}); });

4
pages/supplierDeliver/record/supplierDeliverRecord.vue

@ -23,10 +23,6 @@
</template> </template>
<script> <script>
import {
getPurchasereceiptByAsnNumber,
getPurchaseReceiptJobByNumber,
} from '@/api/request.js';
import { import {
getSupplierDeliverRecordList, getSupplierDeliverRecordList,
} from '@/api/request2.js'; } from '@/api/request2.js';

12
pages/unPlanned/coms/comIssueJobCard.vue

@ -6,18 +6,6 @@
申请单号 : {{dataContent.requestNumber}} 申请单号 : {{dataContent.requestNumber}}
</view> </view>
</view> </view>
<view class="task_text">
<view class="">
出库物料 : {{dataContent.itemCode}}
</view>
</view>
<view class="task_text">
<view class="">
出库库位 : {{dataContent.fromLocationCode}}
</view>
</view>
</view> </view>
</job-com-main-card> </job-com-main-card>
</template> </template>

12
pages/unPlanned/coms/comReceiptJobCard.vue

@ -6,18 +6,6 @@
申请单号 : {{dataContent.requestNumber}} 申请单号 : {{dataContent.requestNumber}}
</view> </view>
</view> </view>
<view class="task_text">
<view class="">
入库物料 : {{dataContent.itemCode}}
</view>
</view>
<view class="task_text">
<view class="">
入库库位 : {{dataContent.toLocationCode}}
</view>
</view>
</view> </view>
</job-com-main-card> </job-com-main-card>
</template> </template>

2
pages/unPlanned/request/issueRequest.vue

@ -199,7 +199,7 @@
openScanDetailPopup() { openScanDetailPopup() {
uni.navigateTo({ uni.navigateTo({
url: "../record/issueRecord?fromType=" + this.fromType url: "./issueRequestCreate?fromType=" + this.fromType
}) })
}, },

298
pages/unPlanned/request/issueRequestCreate.vue

@ -1,8 +1,304 @@
<template> <template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<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">
</uni-data-picker>
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index"
@removeItem="removeItem(index,item)" @updateData="updateData" :isShowLocation="true"
@removePack="removePack">
</record-com-detail-card>
</view>
<u-line />
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'">
</win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromLocationTypeArray"></win-scan-location>
<com-message ref="comMessage"></com-message>
</view>
</template> </template>
<script> <script>
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import {
unPlannedIssueRequestSubmit,
unPlannedIssueRecordSubmit
} from '@/api/request2.js';
import {
getBalanceByUniquecode,
} from '@/api/request.js';
import {
getBusinessType,
} from '@/common/record.js';
import {
getDirectoryItemArray,
getUnPlannedIssuseReasonList,
} from '@/common/directory.js';
import {
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
export default {
components: {
comEmptyView,
winScanButton,
requiredLocation,
comBlankView,
winScanLocation,
winScanPackAndLocation,
comMessage,
recordComDetailCard
},
props: {},
data() {
return {
fromLocationCode: "",
fromLocationInfo: {},
fromLocationTypeArray: [],
fromInventoryStatus: [],
toInventoryStatus: [],
businessType: {}, //
detailSource: [], //
reason: "",
reasonList: [],
fromType: "",
dataContent:{}
}
},
mounted() {
var typeCode = "UnplannedDeliver"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromLocationTypeArray = res.fromlocationTypeList;
this.showFromLocationPopup();
} else {
this.$refs.comMessage.showBreakMessage(res.message);
}
});
},
onLoad(option) {
this.fromType = option.fromType
if (this.fromType == "requestType") {
updateTitle("计划外出库申请")
} else {
updateTitle("计划外出库记录")
}
},
methods: {
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanFromLocationCode.openScanPopup();
})
},
getLocation(location) {
this.getfromLocationCode(location)
},
getfromLocationCode(location) {
this.fromLocationInfo = location;
this.fromLocationCode = location.code;
this.openScanPopup();
},
getScanResult(result) {
this.getDataSource(result)
},
getDataSource(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == label.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == result.packingNumber &&
r.batch == result.batch &&
r.locationCode == result.locationCode &&
r.inventoryStatus == result.inventoryStatus &&
r.scaned == true) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
} else {
this.showErrorMessage(result.packingNumber + "已经在列表中")
}
}
this.calcHandleQty();
},
calcHandleQty() {
calcHandleQty(this.detailSource);
this.$forceUpdate();
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
updateData() {
this.calcHandleQty();
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
commit() {
if (this.reason == '') {
this.showErrorMessage("请选择出库原因")
return;
}
if(this.fromType=="requestType"){
var params = this.setRequestParams();
console.log("提交参数",JSON.stringify(params));
// unPlannedIssueRequestSubmit(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)
// })
}else {
// unPlannedIssueRecordSubmit(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)
// })
}
},
setParams() {
var subList = []
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;
subList.push(detail)
}
})
})
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;
},
}
}
</script> </script>
<style> <style>
</style> </style>

2
pages/unPlanned/request/receiptRequest.vue

@ -197,7 +197,7 @@
openScanDetailPopup() { openScanDetailPopup() {
uni.navigateTo({ uni.navigateTo({
url: "../record/receiptRecord?fromType=" + this.fromType url: "./receiptRequest?fromType=" + this.fromType
}) })
}, },

Loading…
Cancel
Save