Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
8094a41ff5
5
.idea/.gitignore
vendored
5
.idea/.gitignore
vendored
@ -1,5 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
@ -610,6 +610,25 @@ const install = (Vue, vm) => {
|
||||
wmsInventory),
|
||||
reprintPackageNum: (printName, packageNumber) => vm.$u.get(
|
||||
'/nlv-wms/wmscuttingpackage/reprint/' + printName + '/' + packageNumber)
|
||||
},
|
||||
production_warehousing :{
|
||||
selectDocumentNo: (param) => vm.$u.get('/nlv-wms/wmsdocumentsplitting/selectProdcutionWarehousing',param),
|
||||
fetchProductionRequisitionList: (param) => vm.$u.get('/nlv-wms/wmsdocumentsplitting/selectProdcutionWarehousingPage', param),
|
||||
},
|
||||
storag_request_detail :{
|
||||
getTray: (param) => vm.$u.get('/nlv-wms/wmsdocumentsplitting/getTray', param),
|
||||
receive:(param) => vm.$u.post('/nlv-wms/wmsdocumentsplitting/receive', param),
|
||||
checkReceive: (param) => vm.$u.get('/nlv-wms/z-storag-request-detail/checkReceive', param),
|
||||
receiveExecute:(param) => vm.$u.post('/nlv-wms/wmsdocumentsplitting/checkReceiveExecute', param),
|
||||
receiveComplete:(param) => vm.$u.post('/nlv-wms/wmsdocumentsplitting/receiveComplete', param),
|
||||
saveReceiveList:(obj) => vm.$u.post('/nlv-wms/wmsdocumentsplitting/saveReceiveList', obj),
|
||||
},
|
||||
wms_productrec: {
|
||||
saveList: (obj) => vm.$u.post('/nlv-wms/wms-productrec/saveList', obj),
|
||||
getList:(param) => vm.$u.get('/nlv-wms/wms-productrec/list', param),
|
||||
},
|
||||
WarehouseMaterialPfep: {
|
||||
getWmMaterialPfepDetail:(obj) => vm.$u.get('/nlv-wms/WarehouseMaterialPfep/getWmMaterialPfepDetail', obj),
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
21
pages.json
21
pages.json
@ -779,6 +779,27 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "单卷查询"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/nlv-wms/production-warehousing/index",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "生产入库"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/nlv-wms/production-warehousing/itemFormDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "生产入库-扫码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/nlv-wms/production-warehousing/receiveExecuteDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "入库执行"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [],
|
||||
|
||||
247
pages/nlv-wms/production-warehousing/index.vue
Normal file
247
pages/nlv-wms/production-warehousing/index.vue
Normal file
@ -0,0 +1,247 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<view class="uni-padding-wrap uni-common-mt" style="padding: 10px;">
|
||||
<view class="row">
|
||||
<scroll-view class="chen-scroll" scroll-y="true" scroll-x="true">
|
||||
<u-table>
|
||||
<u-tr class="u-tr">
|
||||
<u-th width="25%" class="u-th">单号</u-th>
|
||||
<u-th width="25%" class="u-th">物料</u-th>
|
||||
<u-th width="25%" class="u-th">描述</u-th>
|
||||
<u-th width="15%" class="u-th">入库数量</u-th>
|
||||
<u-th width="25%" class="u-th">操作</u-th>
|
||||
</u-tr>
|
||||
<u-tr class="u-tr" style="height: 30px;" v-for="(item,index) in itemList" :key="index">
|
||||
<u-td width="25%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.documentNo}}
|
||||
</u-td>
|
||||
<u-td width="25%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.item}}
|
||||
</u-td>
|
||||
<u-td width="25%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.itemDesc}}
|
||||
</u-td>
|
||||
<u-td width="15%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.requiredQty}}
|
||||
</u-td>
|
||||
<u-td width="25%" class="u-td">
|
||||
<u-row>
|
||||
<u-button style="width:50%; color: black" size="mini" type="warning" v-if="item.isReceOut =='Y' && item.inIninvFlag == 'Y'" @click="navToItemFormDetail(item)">入库接收</u-button>
|
||||
<u-button style="width:50%; color: black" size="mini" type="success" v-if="item.isReceOut == 'Y' && item.receiveComplete == 'Y'" @click="receiveInv(item)">接收完成</u-button>
|
||||
<u-button style="width:50%; color: black" size="mini" type="primary" v-if="item.isReceOut == 'Y' && item.receiveExecute == 'Y'" @click="inInv(item)">入库执行</u-button>
|
||||
<u-button style="width:50%; color: black" size="mini" type="info" v-if="item.isReceOut =='Y' && item.finishInInvFlag == 'Y'" @click="finishInInv(item)">入库完成</u-button>
|
||||
<u-button style="width:50%; color: black" size="mini" type="primary" v-if="item.isReceOut == 'N'" @click="inInv(item)">入库执行</u-button>
|
||||
<u-button style="width:50%;" size="mini" type="info" v-if="item.isReceOut =='N'" @click="finishInInv(item)">入库完成</u-button>
|
||||
</u-row>
|
||||
</u-td>
|
||||
</u-tr>
|
||||
</u-table>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {isBlank} from "utils/string";
|
||||
import {inputFocus} from 'utils/common';
|
||||
import {add} from 'utils/number';
|
||||
import URow from "../../../uview-ui/components/u-row/u-row";
|
||||
|
||||
export default {
|
||||
components: {URow},
|
||||
data() {
|
||||
return {
|
||||
site: this.vuex_tenantId,
|
||||
isUse: false,
|
||||
wms_document_save: false,
|
||||
formObj: {},
|
||||
documentNo: "",
|
||||
itemForm: {},
|
||||
submitList: [],
|
||||
codeList: [],
|
||||
verifyDefaultStorageBin: "",
|
||||
dialogItemType1FormVisible: true,
|
||||
itemList: [],
|
||||
initData: {
|
||||
documentNo: "",
|
||||
itemList: [],
|
||||
site: this.vuex_tenantId,
|
||||
},
|
||||
receive: this.$u.api.nlvWms.storag_request_detail.receive,
|
||||
checkReceive: this.$u.api.nlvWms.storag_request_detail.checkReceive,
|
||||
receiveExecute : this.$u.api.nlvWms.storag_request_detail.receiveExecute,
|
||||
receiveComplete: this.$u.api.nlvWms.storag_request_detail.receiveComplete,
|
||||
};
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
let me = this;
|
||||
me.site = me.vuex_tenantId;
|
||||
me.loadData();
|
||||
},
|
||||
onShow() {
|
||||
let me = this;
|
||||
me.loadData();
|
||||
},
|
||||
|
||||
methods: {
|
||||
loadData() {
|
||||
let me = this
|
||||
this.$u.api.nlvWms.production_warehousing.selectDocumentNo().then((res)=> {
|
||||
me.itemList = res.data;
|
||||
console.log(me.itemList)
|
||||
}).catch((e)=> {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
//入库接收
|
||||
receiveInv(row,index) {
|
||||
let me = this;
|
||||
let param = {
|
||||
documentNo: row.documentNo,
|
||||
item: row.item,
|
||||
}
|
||||
me.receive(param).then((res) => {
|
||||
me.$u.toast("接收完成");
|
||||
me.loadData();
|
||||
}).catch((e)=> {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
//入库执行(Y)
|
||||
inInv(row,index) {
|
||||
let me = this;
|
||||
let param = {
|
||||
documentNo: row.documentNo,
|
||||
item: row.item,
|
||||
}
|
||||
me.receiveExecute(param).then((res) => {
|
||||
if (res.code == 0) {
|
||||
me.navToReceiveExecuteDetail(row)
|
||||
}
|
||||
}).catch((e)=> {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
//入库完成(Y)
|
||||
finishInInv(row,index) {
|
||||
let me = this;
|
||||
let param = {
|
||||
documentNo: row.documentNo,
|
||||
item: row.item,
|
||||
}
|
||||
me.receiveComplete(param).then((res) => {
|
||||
if (res.code == 0) {
|
||||
me.$u.toast("入库完成");
|
||||
me.loadData();
|
||||
}
|
||||
}).catch((e)=> {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
getList(documentNo) {
|
||||
let me = this;
|
||||
let param = {
|
||||
documentNo: documentNo
|
||||
}
|
||||
this.$u.api.nlvWms.production_warehousing.selectDocumentNo(param).then((res)=> {
|
||||
me.itemList = res.data;
|
||||
}).catch((e)=> {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
|
||||
isNotBank(str) {
|
||||
return !isBlank(str);
|
||||
},
|
||||
|
||||
inputConfirm(target, id) {
|
||||
let me = this;
|
||||
switch (id) {
|
||||
case "item":
|
||||
if (target.inventoryQty < 0) {
|
||||
me.$set(target, "inventoryQty", 0);
|
||||
} else {
|
||||
me.$set(target, "inventoryQty", me.toFixed(target.inventoryQty, 4));
|
||||
}
|
||||
}
|
||||
},
|
||||
//-------------------------------------------------------------------------------------------
|
||||
checkReceiveAndNavToItemFormDetail(row) {
|
||||
let me = this;
|
||||
let param = {
|
||||
documentNo: row.originalDocumentNo,
|
||||
item: row.item,
|
||||
}
|
||||
me.checkReceive(param).then(res => {
|
||||
if (res.code == 0) {
|
||||
me.navToItemFormDetail(row)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
navToItemFormDetail(row) {
|
||||
let me = this;
|
||||
console.log(row)
|
||||
uni.navigateTo({
|
||||
url: '/pages/nlv-wms/production-warehousing/itemFormDetail?params=' + encodeURIComponent(JSON.stringify({
|
||||
site: me.site,
|
||||
documentNo: row.documentNo,
|
||||
//originalDocumentNo: row.originalDocumentNo,
|
||||
item : row.item,
|
||||
itemBo: row.itemBo,
|
||||
requiredQty: row.requiredQty,
|
||||
qty: row.qty
|
||||
})),
|
||||
fail: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
navToReceiveExecuteDetail(row) {
|
||||
let me = this;
|
||||
uni.navigateTo({
|
||||
url: '/pages/nlv-wms/production-warehousing/receiveExecuteDetail?params=' + encodeURIComponent(JSON.stringify({
|
||||
site: me.site,
|
||||
documentNo: row.documentNo,
|
||||
//originalDocumentNo: row.originalDocumentNo,
|
||||
item: row.item,
|
||||
itemBo: row.itemBo,
|
||||
itemDesc: row.itemDesc,
|
||||
unit: row.unit,
|
||||
requiredQty: row.requiredQty,
|
||||
qty: row.qty,
|
||||
lotNumber: row.lotNumber
|
||||
})),
|
||||
fail: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.uni-form-item .title {
|
||||
padding: 10px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.stay-below {
|
||||
width: 98%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.inputBorder {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
</style>
|
||||
313
pages/nlv-wms/production-warehousing/itemFormDetail.vue
Normal file
313
pages/nlv-wms/production-warehousing/itemFormDetail.vue
Normal file
@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="uni-padding-wrap uni-common-mt" style="padding: 10px">
|
||||
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
||||
<view class="uni-form-item uni-column">
|
||||
<view class="title">
|
||||
<u-row class="row">
|
||||
<u-col span="3">
|
||||
<view class="title">
|
||||
单据号:
|
||||
</view>
|
||||
</u-col>
|
||||
<u-col span="9">
|
||||
{{itemForm.documentNo}}
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<scroll-view class="chen-scroll" scroll-y="true">
|
||||
<u-table >
|
||||
<u-tr class="u-tr">
|
||||
<u-th width="50%" class="u-th">物料</u-th>
|
||||
<u-th width="25%" class="u-th">需求数量</u-th>
|
||||
<u-th width="25%" class="u-th">拣配数量</u-th>
|
||||
</u-tr>
|
||||
<u-tr class="u-tr" style="height: 30px;" >
|
||||
<u-td width="50%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{itemForm.item}}
|
||||
</u-td>
|
||||
<u-td width="25%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{itemForm.requiredQty}}
|
||||
</u-td>
|
||||
<u-td width="25%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{itemForm.sumQuantity}}
|
||||
</u-td>
|
||||
</u-tr>
|
||||
</u-table>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view class="uni-form-item uni-column">
|
||||
<view class="title">
|
||||
<u-row class="row">
|
||||
<u-col span="3">
|
||||
<view class="title">
|
||||
<span class="inputRequired">*</span>
|
||||
托条码:
|
||||
</view>
|
||||
</u-col>
|
||||
<u-col span="9">
|
||||
<u-input style="background-color: #FFFF99" ref="code" v-model="itemForm.code" placeholder="扫描托条码" :border="true" @confirm="scanCode"
|
||||
:focus="focus.code"></u-input>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="scroll-list" scroll-y="true" scrill-x="true">
|
||||
<u-table >
|
||||
<u-tr class="u-tr">
|
||||
<u-th width="20%" class="u-th">序号</u-th>
|
||||
<u-th width="20%" class="u-th">托条码</u-th>
|
||||
<u-th width="20%" class="u-th">物料</u-th>
|
||||
<u-th width="20%" class="u-th">数量</u-th>
|
||||
<u-th width="20%" class="u-th">操作</u-th>
|
||||
</u-tr>
|
||||
<u-tr class="u-tr" style="height: 30px;"v-for="(item, index) in wmsProductrecList" :key="index" :index="index" >
|
||||
<u-td width="20%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.seq}}
|
||||
</u-td>
|
||||
<u-td width="20%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.carrierNumber}}
|
||||
</u-td>
|
||||
<u-td width="20%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.item}}
|
||||
</u-td>
|
||||
<u-td width="20%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.qty}}
|
||||
</u-td>
|
||||
<u-td width="20%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
<u-button size="mini" type="error" @click="delRow(index,item)">删除</u-button>
|
||||
</u-td>
|
||||
</u-tr>
|
||||
</u-table>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="pda-foot">
|
||||
<view style="padding: 10px;background-color: white">
|
||||
<u-button style="margin:5px;" type="primary" @click="save">保存</u-button>
|
||||
<u-button style="margin:5px;" type="primary" @click="backToMain()">返回</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {isBlank} from "utils/string";
|
||||
import UInput from "uview-ui/components/u-input/u-input";
|
||||
import {inputFocus} from 'utils/common';
|
||||
import {add, sub} from 'utils/bigNumber';
|
||||
|
||||
export default {
|
||||
components: {UInput},
|
||||
data() {
|
||||
return {
|
||||
site: this.vuex_tenantId,
|
||||
isUse: false,
|
||||
itemForm: {},
|
||||
itemList: [],
|
||||
wmsProductrecList: [],
|
||||
getFinishedProductQty: this.$u.api.wms.production_warehousing.getFinishedProductQty,
|
||||
getTray: this.$u.api.nlvWms.storag_request_detail.getTray,
|
||||
saveList: this.$u.api.nlvWms.wms_productrec.saveList,
|
||||
getList: this.$u.api.nlvWms.wms_productrec.getList,
|
||||
focus: {
|
||||
code: false
|
||||
},
|
||||
scrollTop: 0
|
||||
};
|
||||
},
|
||||
onLoad: function (option) {
|
||||
let params = JSON.parse(decodeURIComponent(option.params));
|
||||
console.log("params")
|
||||
console.log(params)
|
||||
this.site = params.site;
|
||||
this.itemForm.documentNo = params.documentNo;
|
||||
this.itemForm.originalDocumentNo = params.originalDocumentNo
|
||||
this.itemForm.item = params.item;
|
||||
this.itemForm.itemBo = params.itemBo;
|
||||
this.itemForm.requiredQty = params.requiredQty;
|
||||
this.itemForm.qty = params.qty;
|
||||
//查询列表
|
||||
this.getFinishedProductReceipt(params.documentNo,params.item)
|
||||
inputFocus(this, "code");
|
||||
},
|
||||
methods: {
|
||||
//扫描条码
|
||||
scanCode() {
|
||||
let me = this;
|
||||
if (isBlank(me.itemForm.code)) {
|
||||
me.$u.toast("不可扫描空条码");
|
||||
inputFocus(me, "code");
|
||||
return;
|
||||
}
|
||||
|
||||
if (me.wmsProductrecList.length > 0) {
|
||||
let index = me.wmsProductrecList.findIndex(o => o.carrierNumber === me.itemForm.code);
|
||||
if (index >= 0) {
|
||||
me.itemForm.code = "";
|
||||
me.$u.toast("不可重复扫描");
|
||||
inputFocus(this, "code");
|
||||
return;
|
||||
}
|
||||
this.getInventoryList();
|
||||
} else {
|
||||
this.getInventoryList();
|
||||
}
|
||||
},
|
||||
|
||||
//查询托盘号
|
||||
getInventoryList() {
|
||||
let me = this;
|
||||
console.log(me.itemForm);
|
||||
let obj = Object.assign({}, {
|
||||
"originalDocumentNo": me.itemForm.originalDocumentNo,
|
||||
"documentNo": me.itemForm.documentNo,
|
||||
"carrierNumber": me.itemForm.code,
|
||||
"item": me.itemForm.item
|
||||
});
|
||||
me.itemForm.code = me.itemForm.carrierNumber
|
||||
console.log(obj)
|
||||
uni.showLoading()
|
||||
me.getTray(obj).then(res => {
|
||||
if (res.code == 0) {
|
||||
let records = res.data;
|
||||
console.log(records)
|
||||
if (me.itemForm.sumQuantity == null) {
|
||||
me.itemForm.sumQuantity = 0
|
||||
}
|
||||
for (let i = 0; i < records.length; i++) {
|
||||
records[i].seq = i + 1
|
||||
me.itemForm.sumQuantity = add(records[i].qty, me.itemForm.sumQuantity);
|
||||
if (me.itemForm.sumQuantity > me.itemForm.requiredQty) {
|
||||
return me.$u.toast("不可超过需求数量");
|
||||
}
|
||||
}
|
||||
me.wmsProductrecList = records
|
||||
console.log("me.inventoryList--------")
|
||||
console.log(me.wmsProductrecList)
|
||||
}
|
||||
inputFocus(this, "code");
|
||||
me.itemForm.code = "";
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e)
|
||||
});
|
||||
},
|
||||
|
||||
//查询成品入库接收表
|
||||
getFinishedProductReceipt(documentNo,item) {
|
||||
let me = this
|
||||
let param = {
|
||||
documentNo :documentNo,
|
||||
item: item,
|
||||
}
|
||||
uni.showLoading()
|
||||
me.getList(param).then(res => {
|
||||
if (res.code == 0){
|
||||
console.log("217")
|
||||
console.log(res)
|
||||
let records = res.data;
|
||||
me.itemForm.sumQuantity = 0
|
||||
for (let i = 0; i < records.length; i++) {
|
||||
records[i].seq = i + 1
|
||||
me.itemForm.sumQuantity = add(records[i].qty, me.itemForm.sumQuantity);
|
||||
}
|
||||
me.wmsProductrecList = records
|
||||
}
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
delRow(index, row) {
|
||||
let me = this;
|
||||
//删除已扫描过条码中集合的信息
|
||||
me.wmsProductrecList.splice(index, 1);
|
||||
for (let i = 0; i < me.wmsProductrecList.length; i++) {
|
||||
me.wmsProductrecList[i].seq = me.wmsProductrecList.length - i;
|
||||
}
|
||||
me.wmsProductrecList.splice(index, 1);
|
||||
me.itemForm.sumQuantity = sub(me.itemForm.sumQuantity, row.qty);
|
||||
},
|
||||
save() {
|
||||
let me = this;
|
||||
if (me.wmsProductrecList.length === 0) {
|
||||
return me.$u.toast("请扫描条码");
|
||||
}
|
||||
let params = {
|
||||
itemBo : me.itemForm.itemBo,
|
||||
item: me.itemForm.item,
|
||||
documentNo: me.itemForm.documentNo,
|
||||
wmsProductrecList : me.wmsProductrecList
|
||||
}
|
||||
uni.showLoading()
|
||||
me.saveList(params).then(res => {
|
||||
if (res.code == 0) {
|
||||
me.$u.toast("保存成功");
|
||||
} else {
|
||||
me.$u.toast(res.msg);
|
||||
}
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
|
||||
backToMain() {
|
||||
uni.navigateBack({
|
||||
delta: 1, // 返回的页面数,如果需要返回上一页,delta 设为 1
|
||||
success: function() {
|
||||
// 成功返回上一页之后,通过事件通信触发上一页的刷新方法
|
||||
uni.$emit('loadData');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.uni-form-item .title {
|
||||
padding: 10px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.disabledColor {
|
||||
background: #EAECEF;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-bottom: 10 rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: right;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.inputRequired {
|
||||
content: "*";
|
||||
width: 10px;
|
||||
height: 20px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
line-height: 26px;
|
||||
font-size: large;
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
/deep/ .chen-scroll {
|
||||
height: 200 rpx;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
349
pages/nlv-wms/production-warehousing/receiveExecuteDetail.vue
Normal file
349
pages/nlv-wms/production-warehousing/receiveExecuteDetail.vue
Normal file
@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="uni-padding-wrap uni-common-mt" style="padding: 10px">
|
||||
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
||||
<u-cell-group class="item-head">
|
||||
<u-cell-item title="单据号" :value="itemForm.documentNo" :arrow="false"></u-cell-item>
|
||||
<u-cell-item title="物料" :value="itemForm.item" :arrow="false"></u-cell-item>
|
||||
<u-cell-item title="物料描述" :value="itemForm.itemDesc" :arrow="false"></u-cell-item>
|
||||
<u-cell-item title="单位" :value="itemForm.unit" :arrow="false"></u-cell-item>
|
||||
<u-cell-item title="需求数量" :value="itemForm.requiredQty" :arrow="false"></u-cell-item>
|
||||
<u-cell-item title="拣配数量" :value="itemForm.sumQuantity" :arrow="false"></u-cell-item>
|
||||
</u-cell-group>
|
||||
<view class="uni-form-item uni-column">
|
||||
<view class="title"></view>
|
||||
<view class="uni-form-item uni-column">
|
||||
<view class="title">
|
||||
<u-row class="row">
|
||||
<u-col span="3">
|
||||
<view class="title">
|
||||
<span class="inputRequired">*</span>
|
||||
入库仓:
|
||||
</view>
|
||||
</u-col>
|
||||
<u-col span="9">
|
||||
<input-select-dialog :value.sync="itemForm.storageBin" input-placeholder="扫描入库仓"
|
||||
style="background-color: #FFFF99"
|
||||
:query-param="{item: itemForm.item}"
|
||||
:get-list-data="getWmMaterialPfepDetail" :maskCloseAble="true"
|
||||
:allowSearch="true" ref="documentNo"
|
||||
@confirm="scanStorageBin"
|
||||
@doSelected="inputCallBack($event,'storageBin',itemForm,{storageBin:'storageBin'})">
|
||||
<template #row="{ storageBin, storageBinDesc }">
|
||||
<u-cell-item :border-bottom="false" style="padding-top: 0px; padding-bottom: 0px;"
|
||||
:arrow="false">
|
||||
<text slot="title">货格:{{ storageBin }}</text>
|
||||
<text slot="label">描述:{{ storageBinDesc }}</text>
|
||||
</u-cell-item>
|
||||
</template>
|
||||
</input-select-dialog>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-row class="row">
|
||||
<u-col span="3">
|
||||
<view class="title">
|
||||
<span class="inputRequired">*</span>
|
||||
托条码:
|
||||
</view>
|
||||
</u-col>
|
||||
<u-col span="9">
|
||||
<u-input style="background-color: #FFFF99" ref="code" v-model="itemForm.code" placeholder="扫描托条码" :border="true" @confirm="scanCode"
|
||||
:focus="focus.code"></u-input>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="chen-scroll" scroll-y="true" scroll-x="true">
|
||||
<u-table >
|
||||
<u-tr class="u-tr">
|
||||
<u-th width="15%" class="u-th">序号</u-th>
|
||||
<u-th width="20%" class="u-th">托条码</u-th>
|
||||
<u-th width="20%" class="u-th">物料</u-th>
|
||||
<u-th width="15%" class="u-th">数量</u-th>
|
||||
<u-th width="20%" class="u-th">货位</u-th>
|
||||
<u-th width="20%" class="u-th">操作</u-th>
|
||||
</u-tr>
|
||||
<u-tr class="u-tr" style="height: 30px;"v-for="(item, index) in wmsProductrecList" :key="index" :index="index" >
|
||||
<u-td width="15%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.seq}}
|
||||
</u-td>
|
||||
<u-td width="20%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.carrierNumber}}
|
||||
</u-td>
|
||||
<u-td width="20%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.item}}
|
||||
</u-td>
|
||||
<u-td width="15%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.qty}}
|
||||
</u-td>
|
||||
<u-td width="20%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
{{item.storageBin}}
|
||||
</u-td>
|
||||
<u-td width="20%" style="overflow: hidden; white-space: normal;" class="u-td">
|
||||
<u-button size="mini" type="error" @click="delRow(index,item)">删除</u-button>
|
||||
</u-td>
|
||||
</u-tr>
|
||||
</u-table>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="pda-foot">
|
||||
<view style="padding: 10px;background-color: white">
|
||||
<u-button style="margin:5px;" type="primary" @click="save">保存</u-button>
|
||||
<u-button style="margin:5px;" type="primary" @click="backToMain()">返回</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {isBlank} from "utils/string";
|
||||
import UInput from "uview-ui/components/u-input/u-input";
|
||||
import {inputFocus} from 'utils/common';
|
||||
import {add, sub} from 'utils/bigNumber';
|
||||
|
||||
export default {
|
||||
components: {UInput},
|
||||
data() {
|
||||
return {
|
||||
site: this.vuex_tenantId,
|
||||
isUse: false,
|
||||
itemForm: {},
|
||||
itemList: [],
|
||||
wmsProductrecList: [],
|
||||
getFinishedProductQty: this.$u.api.wms.production_warehousing.getFinishedProductQty,
|
||||
getTray: this.$u.api.nlvWms.storag_request_detail.getTray,
|
||||
saveReceiveList: this.$u.api.nlvWms.storag_request_detail.saveReceiveList,
|
||||
getList: this.$u.api.nlvWms.wms_productrec.getList,
|
||||
getWmMaterialPfepDetail: this.$u.api.nlvWms.WarehouseMaterialPfep.getWmMaterialPfepDetail,
|
||||
focus: {
|
||||
code: false
|
||||
},
|
||||
scrollTop: 0
|
||||
};
|
||||
},
|
||||
onLoad: function (option) {
|
||||
let params = JSON.parse(decodeURIComponent(option.params));
|
||||
console.log("params")
|
||||
console.log(params)
|
||||
this.site = params.site;
|
||||
this.itemForm.documentNo = params.documentNo;
|
||||
this.itemForm.originalDocumentNo = params.originalDocumentNo
|
||||
this.itemForm.item = params.item;
|
||||
this.itemForm.itemBo = params.itemBo;
|
||||
this.itemForm.itemDesc = params.itemDesc;
|
||||
this.itemForm.unit = params.unit;
|
||||
this.itemForm.requiredQty = params.requiredQty;
|
||||
this.itemForm.qty = params.qty;
|
||||
this.itemForm.lotNumber = params.lotNumber;
|
||||
//查询列表
|
||||
this.getFinishedProductReceipt(params.documentNo,params.item)
|
||||
//inputFocus(this, "code");
|
||||
},
|
||||
methods: {
|
||||
inputCallBack(row, id, callBackTarget, callBackFun) {
|
||||
if (!callBackTarget) {
|
||||
callBackTarget = this;
|
||||
}
|
||||
if (callBackFun instanceof Array) {
|
||||
for (let key of callBackFun) {
|
||||
this.$set(callBackTarget, key, row[key]);
|
||||
}
|
||||
} else if (callBackFun instanceof Object) {
|
||||
for (let key of Object.keys(callBackFun)) {
|
||||
this.$set(callBackTarget, callBackFun[key], row[key]);
|
||||
}
|
||||
} else {
|
||||
this.$set(callBackTarget, Object.keys(row)[0], row[Object.keys(row)[0]]);
|
||||
}
|
||||
},
|
||||
//扫描货格
|
||||
scanStorageBin() {
|
||||
let me = this;
|
||||
if (isBlank(me.itemForm.storageLocation)) {
|
||||
me.$u.toast("请先选择货位");
|
||||
inputFocus(me, "storageLocation");
|
||||
return;
|
||||
}
|
||||
me.getWmMaterialPfepDetail().then(res => {
|
||||
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
})
|
||||
},
|
||||
//扫描条码
|
||||
scanCode() {
|
||||
let me = this;
|
||||
if (isBlank(me.itemForm.code)) {
|
||||
me.$u.toast("不可扫描空条码");
|
||||
inputFocus(me, "code");
|
||||
return;
|
||||
}
|
||||
|
||||
if (me.wmsProductrecList.length > 0) {
|
||||
let index = me.wmsProductrecList.findIndex(o => o.carrierNumber === me.itemForm.code);
|
||||
if (index >= 0) {
|
||||
me.itemForm.code = "";
|
||||
me.$u.toast("不可重复扫描");
|
||||
inputFocus(this, "code");
|
||||
return;
|
||||
}
|
||||
this.getInventoryList();
|
||||
} else {
|
||||
this.getInventoryList();
|
||||
}
|
||||
},
|
||||
|
||||
//查询托盘号
|
||||
getInventoryList() {
|
||||
let me = this;
|
||||
console.log(me.itemForm);
|
||||
let obj = Object.assign({}, {
|
||||
"originalDocumentNo": me.itemForm.originalDocumentNo,
|
||||
"documentNo": me.itemForm.documentNo,
|
||||
"carrierNumber": me.itemForm.code,
|
||||
"item": me.itemForm.item
|
||||
});
|
||||
me.itemForm.code = me.itemForm.carrierNumber
|
||||
console.log(obj)
|
||||
me.getTray(obj).then(res => {
|
||||
if (res.code == 0) {
|
||||
let records = res.data;
|
||||
console.log(records)
|
||||
if (me.itemForm.sumQuantity == null) {
|
||||
me.itemForm.sumQuantity = 0
|
||||
}
|
||||
for (let i = 0; i < records.length; i++) {
|
||||
records[i].seq = i + 1
|
||||
me.itemForm.sumQuantity = add(records[i].qty, me.itemForm.sumQuantity);
|
||||
if (me.itemForm.sumQuantity > me.itemForm.requiredQty) {
|
||||
return me.$u.toast("不可超过需求数量");
|
||||
}
|
||||
}
|
||||
me.wmsProductrecList = records
|
||||
console.log("me.inventoryList--------")
|
||||
console.log(me.wmsProductrecList)
|
||||
}
|
||||
inputFocus(this, "code");
|
||||
me.itemForm.code = "";
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
});
|
||||
},
|
||||
|
||||
//查询成品入库接收表
|
||||
getFinishedProductReceipt(documentNo,item) {
|
||||
let me = this
|
||||
let param = {
|
||||
documentNo :documentNo,
|
||||
item: item
|
||||
}
|
||||
console.log(param)
|
||||
me.getList(param).then(res => {
|
||||
if (res.code == 0){
|
||||
console.log("217")
|
||||
console.log(res)
|
||||
let records = res.data;
|
||||
me.itemForm.sumQuantity = 0
|
||||
for (let i = 0; i < records.length; i++) {
|
||||
records[i].seq = i + 1
|
||||
me.itemForm.sumQuantity = add(records[i].qty, me.itemForm.sumQuantity);
|
||||
}
|
||||
me.wmsProductrecList = records
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
delRow(index, row) {
|
||||
let me = this;
|
||||
//删除已扫描过条码中集合的信息
|
||||
me.wmsProductrecList.splice(index, 1);
|
||||
for (let i = 0; i < me.wmsProductrecList.length; i++) {
|
||||
me.wmsProductrecList[i].seq = me.wmsProductrecList.length - i;
|
||||
}
|
||||
me.wmsProductrecList.splice(index, 1);
|
||||
me.itemForm.sumQuantity = sub(me.itemForm.sumQuantity, row.qty);
|
||||
},
|
||||
save() {
|
||||
let me = this;
|
||||
if (isBlank(me.itemForm.storageBin)) {
|
||||
return me.$u.toast("请先选择货位");
|
||||
}
|
||||
if (me.wmsProductrecList.length === 0) {
|
||||
return me.$u.toast("请扫描条码");
|
||||
}
|
||||
let params = {
|
||||
itemBo : me.itemForm.itemBo,
|
||||
item: me.itemForm.item,
|
||||
documentNo: me.itemForm.documentNo,
|
||||
storageBin: me.itemForm.storageBin,
|
||||
wmsProductrecList : me.wmsProductrecList
|
||||
}
|
||||
console.log(params)
|
||||
uni.showLoading();
|
||||
me.saveReceiveList(params).then(res => {
|
||||
if (res.code == 0) {
|
||||
me.getFinishedProductReceipt(me.itemForm.documentNo,me.itemForm.item)
|
||||
me.$u.toast("保存成功");
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
me.$u.toast(res.msg);
|
||||
}
|
||||
}).catch(e => {
|
||||
uni.hideLoading();
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
|
||||
backToMain() {
|
||||
uni.navigateBack({
|
||||
delta: 1, // 返回的页面数,如果需要返回上一页,delta 设为 1
|
||||
success: function() {
|
||||
// 成功返回上一页之后,通过事件通信触发上一页的刷新方法
|
||||
uni.$emit('loadData');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.uni-form-item .title {
|
||||
padding: 10px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.disabledColor {
|
||||
background: #EAECEF;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-bottom: 10 rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: right;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.inputRequired {
|
||||
content: "*";
|
||||
width: 10px;
|
||||
height: 20px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
line-height: 26px;
|
||||
font-size: large;
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
/deep/ .chen-scroll {
|
||||
height: 200 rpx;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user