Browse Source

采购收货添加扫描托码校验

wms3.0_pda
lijuncheng 10 months ago
parent
commit
9faeba0b7e
  1. 10
      api/request2.js
  2. 11
      common/style/new_style.css
  3. 2
      common/style/pdabasic.css
  4. 24
      mycomponents/container/container.vue
  5. 6
      mycomponents/qty/stdPackQty.vue
  6. 7
      mycomponents/recommend/recommend.vue
  7. 134
      mycomponents/scan/winScanPackAndCont.vue
  8. 3
      pages/purchaseReceipt/coms/comReceiptDetailCard.vue
  9. 4
      pages/purchaseReceipt/coms/comReceiptJobCard.vue
  10. 108
      pages/purchaseReceipt/job/receiptDetail.vue
  11. 24
      pages/query/container.vue

10
api/request2.js

@ -109,6 +109,16 @@ export function getWarehouseCodeList(pageNo,pageSize) {
}); });
} }
//获取产品标签信息inventorylabel
export function getInventoryLabel (code){
return request({
url: baseApi + "/api/pda/label/inventorylabel/by-code?code="+code,
method: "get",
data: {},
});
}
/** /**
* 获取消息列表 * 获取消息列表
* @param {*} * @param {*}

11
common/style/new_style.css

@ -2089,6 +2089,17 @@ button::after {
padding: 5px; padding: 5px;
} }
.card_container {
color: #0076F6;
padding: 5px;
}
.card_container_content {
font-size: 32rpx;
padding: 5px;
}
.card_business { .card_business {
color: #F1A532; color: #F1A532;
padding: 5px; padding: 5px;

2
common/style/pdabasic.css

@ -733,7 +733,7 @@ page {
.page-header .header_item { .page-header .header_item {
/* padding-left: 10rpx; */ /* padding-left: 10rpx; */
padding: 5rpx 10rpx; padding: 5rpx 10rpx;
font-size:15px ; font-size:32rpx ;
} }
.page-header .header_job_top { .page-header .header_job_top {

24
mycomponents/container/container.vue

@ -0,0 +1,24 @@
<template>
<view class="card_view ">
<text class="card_container card_content ">托码</text>
<text class="card_content ">{{container}}</text>
</view>
</template>
<script>
export default {
data() {
return {}
},
props: {
container: {
type: String,
default: ""
}
},
}
</script>
<style>
</style>

6
mycomponents/qty/stdPackQty.vue

@ -1,14 +1,14 @@
<template> <template>
<view class="std_pack" v-if="dataContent.stdPackQty!=undefined"> <view class="std_pack" v-if="dataContent.stdPackQty!=undefined">
<text> <text>
{{Number(dataContent.stdPackQty)}}{{getStdPackUnit(dataContent.uom)}} {{Number(dataContent.stdPackQty)}}{{getStdPackUnit(dataContent.stdPackUnit)}}
</text> </text>
</view> </view>
</template> </template>
<script> <script>
import { import {
// getStdPackUnitInfo, // getStdPackUnitInfo,
getUnitInfo getStdPackUnitInfo
} from "@/common/directory.js" } from "@/common/directory.js"
export default { export default {
data() { data() {
@ -25,7 +25,7 @@
}, },
methods: { methods: {
getStdPackUnit(stdPackUnit) { getStdPackUnit(stdPackUnit) {
let std = getUnitInfo(stdPackUnit); let std = getStdPackUnitInfo(stdPackUnit);
return std == "" ? stdPackUnit : std.label; return std == "" ? stdPackUnit : std.label;
} }
} }

7
mycomponents/recommend/recommend.vue

@ -3,6 +3,7 @@
<view class="uni-flex uni-row space-between" style="align-items: center"> <view class="uni-flex uni-row space-between" style="align-items: center">
<!-- uni-inline-item 暂时拿掉--> <!-- uni-inline-item 暂时拿掉-->
<view style="word-break: break-all;"> <view style="word-break: break-all;">
<container v-if="isShowContainer&&detail.containerNumber!=''" :container="detail.containerNumber"></container>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="detail.fromLocationCode"> <location v-if="isShowFromLocation" title="来源库位" :locationCode="detail.fromLocationCode">
@ -31,6 +32,7 @@
</template> </template>
<script> <script>
import container from '@/mycomponents/container/container.vue'
import pack from '@/mycomponents/balance/pack.vue' import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue' import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue' import toLocation from '@/mycomponents/balance/toLocation.vue'
@ -40,6 +42,7 @@
export default { export default {
components: { components: {
container,
pack, pack,
location, location,
toLocation, toLocation,
@ -58,6 +61,10 @@
type: Object, type: Object,
default: {} default: {}
}, },
isShowContainer: {
type: Boolean,
default: true
},
isShowPack: { isShowPack: {
type: Boolean, type: Boolean,
default: true default: true

134
mycomponents/scan/winScanPackAndCont.vue

@ -0,0 +1,134 @@
<template>
<view>
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描 : {{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
<com-message ref="comMessage" @afterClose="getfocus"></com-message>
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getInventoryLabel,
getContainerByNumber
} from '@/api/request2.js';
export default {
name: 'winScanPack',
components: {
winComScan,
comMessage
},
props: {
title: {
type: String,
default: '箱标签或托标签'
},
isShowHistory: {
type: Boolean,
default: true
},
headerType:{
type: String,
default: 'HPQ,HMQ,HCQ'
}
},
data() {
return {
show: false,
}
},
created() {
},
methods: {
openScanPopup() {
this.$refs.popup.open('bottom');
},
closeScanPopup() {
this.$refs.popup.close();
this.$emit("close", '');
},
scanClick() {
this.$refs.comscan.clickScanMsg();
},
cancelClick() {
this.$refs.comscan.clearScanValue();
},
getScanResult(result) {
if (result.success) {
if(result.label.labelType=="ContainerLabel"){
this.getContainerByNumber(result);
}else {
this.$emit("getResult", result);
}
} else {
this.showMessage(result.message)
}
},
getContainerByNumber(result){
getContainerByNumber(result.label.container).then(res => {
if (res.data.list.length > 0) {
this.$emit("getResult", result);
} else {
this.showMessage('未查找到托码【' + result.label.container + '】');
}
}).catch(error => {
this.showMessage(error);
})
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
change(e) {
this.show = e.show
},
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

3
pages/purchaseReceipt/coms/comReceiptDetailCard.vue

@ -6,7 +6,7 @@
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"></itemCompareQty> <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"></itemCompareQty>
</template> </template>
<u-line /> <u-line />
<view class="" v-for="(item,index) in dataContent.subList"> <view class="" v-for="(item,index) in dataContent.subList" :key="item.id">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
@ -14,6 +14,7 @@
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>
<u-line />
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>

4
pages/purchaseReceipt/coms/comReceiptJobCard.vue

@ -1,11 +1,11 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<view class="task_item"> <view class="task_item">
<view class="task_text"> <!-- <view class="task_text">
<view class=""> <view class="">
申请单号 : {{dataContent.requestNumber}} 申请单号 : {{dataContent.requestNumber}}
</view> </view>
</view> </view> -->
<view class="task_text"> <view class="task_text">
<view class=""> <view class="">
发货单号 : {{dataContent.asnNumber}} 发货单号 : {{dataContent.asnNumber}}

108
pages/purchaseReceipt/job/receiptDetail.vue

@ -7,6 +7,8 @@
<view class="header_item"> <view class="header_item">
发货单号 : {{jobContent.asnNumber}} 发货单号 : {{jobContent.asnNumber}}
</view> </view>
<required-location ref="requiredLocation" title="默认收货库位 :" :locationCode="jobToLocationCode"
:isShowEdit="false"></required-location>
<u-line color="#D8D8D8" /> <u-line color="#D8D8D8" />
</view> </view>
<view class="page-main"> <view class="page-main">
@ -25,9 +27,9 @@
<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="">
<required-location ref="requiredLocation" title="默认收货库位" :locationCode="toLocationCode" <required-location ref="requiredLocation" title="收货库位 :" :locationCode="toLocationCode"
:isShowEdit="jobContent.allowModifyLocation=='TRUE'" @getLocation='scanLocationCode' :isShowEdit="true" @getLocation='scanLocationCode' :locationTypeList="toLocationTypeList">
:locationTypeList="toLocationTypeList"></required-location> </required-location>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -36,7 +38,7 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack headerType='HPQ,HMQ' ref="scanPopup" @getResult='getScanResult'></win-scan-pack> <winScanPackAndCont ref="scanPopup" @getResult='getScanResult'></winScanPackAndCont>
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
</view> </view>
</template> </template>
@ -75,7 +77,7 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPackAndCont from '@/mycomponents/scan/winScanPackAndCont.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue' import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue'
@ -85,7 +87,7 @@
name: 'receipt_detail', name: 'receipt_detail',
components: { components: {
winScanButton, winScanButton,
winScanPack, winScanPackAndCont,
comReceiptDetailCard, comReceiptDetailCard,
requiredLocation, requiredLocation,
comMessage, comMessage,
@ -101,10 +103,11 @@
detailSource: [], // detailSource: [], //
toLocationTypeList: [], toLocationTypeList: [],
toLocationCode: '', toLocationCode: '',
jobToLocationCode: "",
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [], managementList: [],
jobStatus:"" jobStatus: ""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -130,7 +133,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.jobStatus=="2") { if (this.jobStatus == "2") {
// //
cancleTakePurchaseReceiptJob(this.id).then(res => { cancleTakePurchaseReceiptJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -186,8 +189,10 @@
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes); that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
// that.jobContent.toLocationTypeList = that.toLocationTypeList; // that.jobContent.toLocationTypeList = that.toLocationTypeList;
that.subList = res.data.subList; that.subList = res.data.subList;
that.subList[0].containerNumber = "CN-00000001";
that.subList[1].containerNumber = "CN-00000001";
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.toLocationCode = that.subList[0].toLocationCode that.jobToLocationCode = that.subList[0].toLocationCode
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
@ -203,30 +208,57 @@
getScanResult(result) { getScanResult(result) {
try { try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode; var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode); var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) { if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中") this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else { return;
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); }
if (itemDetail == undefined) { if (result.label.labelType == "ContainerLabel") {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") var containerNumber = result.label.container;
var itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber);
if (itemDetail.length == 0) {
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】不在列表中")
} else { } else {
if (itemDetail.scaned) { if (itemDetail[0].scaned) {
this.showMessage("箱码【" + packingNumber + "】已经扫描") this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】已经扫描")
} else { } else {
itemDetail.scaned = true; itemDetail.forEach(item => {
item.scaned = true;
item.handleQty = item.qty;
item.toLocationCode = this.toLocationCode;
})
this.detailSource[0].subList.sort(compareAsc('scaned')); // this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
this.continueScan() this.continueScan()
this.$forceUpdate() this.$forceUpdate()
var list = this.detailSource[0].subList; }
}
} else if (result.label.labelType == "PurchaseLabel") {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch ==
batch);
if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
} }
} }
} }
@ -252,14 +284,24 @@
}, },
scanLocationCode(location, code) { scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { if(this.jobContent.allowModifyLocation == 'TRUE'){
this.toLocationCode = code this.toLocationCode = code;
this.detailSource.forEach(item => { }else {
item.subList.forEach(detail => { if(code==this.jobToLocationCode){
detail.toLocationCode = code this.toLocationCode =code;
}) }else {
}) this.showErrorMessage("任务设置中不允许修改库位,扫描的库位【"+code+"】与推荐的库位【"+this.jobToLocationCode+"】不一致")
}) }
}
// this.$refs.comMessage.showQuestionMessage("[" + code + "]", res => {
// this.toLocationCode = code
// this.detailSource.forEach(item => {
// item.subList.forEach(detail => {
// detail.toLocationCode = code
// })
// })
// })
}, },
commit() { commit() {
@ -317,7 +359,7 @@
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()

24
pages/query/container.vue

@ -7,7 +7,7 @@
<!-- 需要固定在顶部不滚动的view放在slot="top"的view中如果需要跟着滚动则不要设置slot="top" --> <!-- 需要固定在顶部不滚动的view放在slot="top"的view中如果需要跟着滚动则不要设置slot="top" -->
<template #top> <template #top>
<view v-if="containerNumber!=''"> <view v-if="containerNumber!=''">
<containerInfo :itemDetail="containerInfo" v-if="containerNumber"></containerInfo> <containerInfo :itemDetail="containerInfo" ></containerInfo>
<u-line /> <u-line />
<z-tabs :list="tabList" @change="tabChange" /> <z-tabs :list="tabList" @change="tabChange" />
</view> </view>
@ -27,8 +27,8 @@
<win-scan-button @goScan='openScanPopup' v-if="containerNumber!=''"></win-scan-button> <win-scan-button @goScan='openScanPopup' v-if="containerNumber!=''"></win-scan-button>
<win-scan-item ref="scanPopup" title='器具代码' @getScanResult='getScanCode'> <winScanContainer ref="scanPopup" title='器具代码' @getContainer='getScanCode'>
</win-scan-item> </winScanContainer>
<show-modal ref="modal"></show-modal> <show-modal ref="modal"></show-modal>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
@ -94,7 +94,8 @@
tabIndex: 0, tabIndex: 0,
}; };
}, },
onLoad() {}, onLoad() {
},
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
@ -106,6 +107,7 @@
}, },
methods: { methods: {
openScanPopup() { openScanPopup() {
var test =this.$refs;
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();
}, },
closeScanPopup() { closeScanPopup() {
@ -116,7 +118,10 @@
this.summarys = []; this.summarys = [];
this.balances = []; this.balances = [];
this.occupieds = []; this.occupieds = [];
this.getItemInfo(code); this.containerNumber = code.number;
this.containerInfo = code;
this.tabChange(0)
// this.getItemInfo(code.number);
}, },
getItemInfo(code) { getItemInfo(code) {
@ -124,7 +129,6 @@
title: "正在查询器具信息...", title: "正在查询器具信息...",
mask: true mask: true
}); });
getContainerByNumber(code).then(res => { getContainerByNumber(code).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
@ -133,7 +137,7 @@
this.containerInfo = res.data.list[0]; this.containerInfo = res.data.list[0];
this.tabChange(0) this.tabChange(0)
} else { } else {
this.showMessage('未查找到物料【' + code + '】'); this.showMessage('未查找到器具【' + code + '】');
} }
}).catch(error => { }).catch(error => {
@ -161,7 +165,7 @@
this.$refs.paging.complete(this.summarysList); this.$refs.paging.complete(this.summarysList);
} else { } else {
this.$refs.paging.complete(false); this.$refs.paging.complete(false);
this.showMessage('未查找到器具【' + this.containerNumber + '】'); this.showMessage('未查找到器具【' + this.containerNumber + '】的库存信息');
} }
}).catch(error => { }).catch(error => {
this.$refs.paging.complete(false); this.$refs.paging.complete(false);
@ -189,7 +193,7 @@
this.$refs.paging.complete(this.detailList); this.$refs.paging.complete(this.detailList);
} else { } else {
this.$refs.paging.complete(false); this.$refs.paging.complete(false);
this.showMessage('未查找到器具【' + this.containerNumber + '】'); this.showMessage('未查找到器具【' + this.containerNumber + '】的库存信息');
} }
}).catch(error => { }).catch(error => {
this.$refs.paging.complete(false); this.$refs.paging.complete(false);
@ -249,7 +253,7 @@
this.$refs.paging.reload(true); this.$refs.paging.reload(true);
}, },
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showWarningMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
this.afterCloseMessage() this.afterCloseMessage()
} }

Loading…
Cancel
Save