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 {*}

11
common/style/new_style.css

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

2
common/style/pdabasic.css

@ -733,7 +733,7 @@ page {
.page-header .header_item {
/* padding-left: 10rpx; */
padding: 5rpx 10rpx;
font-size:15px ;
font-size:32rpx ;
}
.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>
<view class="std_pack" v-if="dataContent.stdPackQty!=undefined">
<text>
{{Number(dataContent.stdPackQty)}}{{getStdPackUnit(dataContent.uom)}}
{{Number(dataContent.stdPackQty)}}{{getStdPackUnit(dataContent.stdPackUnit)}}
</text>
</view>
</template>
<script>
import {
// getStdPackUnitInfo,
getUnitInfo
getStdPackUnitInfo
} from "@/common/directory.js"
export default {
data() {
@ -25,7 +25,7 @@
},
methods: {
getStdPackUnit(stdPackUnit) {
let std = getUnitInfo(stdPackUnit);
let std = getStdPackUnitInfo(stdPackUnit);
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">
<!-- uni-inline-item 暂时拿掉-->
<view style="word-break: break-all;">
<container v-if="isShowContainer&&detail.containerNumber!=''" :container="detail.containerNumber"></container>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="detail.fromLocationCode">
@ -31,6 +32,7 @@
</template>
<script>
import container from '@/mycomponents/container/container.vue'
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
@ -40,6 +42,7 @@
export default {
components: {
container,
pack,
location,
toLocation,
@ -58,6 +61,10 @@
type: Object,
default: {}
},
isShowContainer: {
type: Boolean,
default: true
},
isShowPack: {
type: Boolean,
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>
</template>
<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-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
@ -14,6 +14,7 @@
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<u-line />
</uni-collapse-item>
</uni-collapse>

4
pages/purchaseReceipt/coms/comReceiptJobCard.vue

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

108
pages/purchaseReceipt/job/receiptDetail.vue

@ -7,6 +7,8 @@
<view class="header_item">
发货单号 : {{jobContent.asnNumber}}
</view>
<required-location ref="requiredLocation" title="默认收货库位 :" :locationCode="jobToLocationCode"
:isShowEdit="false"></required-location>
<u-line color="#D8D8D8" />
</view>
<view class="page-main">
@ -25,9 +27,9 @@
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<required-location ref="requiredLocation" title="默认收货库位" :locationCode="toLocationCode"
:isShowEdit="jobContent.allowModifyLocation=='TRUE'" @getLocation='scanLocationCode'
:locationTypeList="toLocationTypeList"></required-location>
<required-location ref="requiredLocation" title="收货库位 :" :locationCode="toLocationCode"
:isShowEdit="true" @getLocation='scanLocationCode' :locationTypeList="toLocationTypeList">
</required-location>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -36,7 +38,7 @@
</view>
<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>
</view>
</template>
@ -75,7 +77,7 @@
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 comMessage from '@/mycomponents/common/comMessage.vue'
import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue'
@ -85,7 +87,7 @@
name: 'receipt_detail',
components: {
winScanButton,
winScanPack,
winScanPackAndCont,
comReceiptDetailCard,
requiredLocation,
comMessage,
@ -101,10 +103,11 @@
detailSource: [], //
toLocationTypeList: [],
toLocationCode: '',
jobToLocationCode: "",
toLocationInfo: {},
businessTypeInfo: {},
managementList: [],
jobStatus:""
jobStatus: ""
};
},
onLoad(option) {
@ -130,7 +133,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus=="2") {
if (this.jobStatus == "2") {
//
cancleTakePurchaseReceiptJob(this.id).then(res => {
uni.navigateBack();
@ -186,8 +189,10 @@
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
// that.jobContent.toLocationTypeList = that.toLocationTypeList;
that.subList = res.data.subList;
that.subList[0].containerNumber = "CN-00000001";
that.subList[1].containerNumber = "CN-00000001";
that.jobStatus = res.data.status
that.toLocationCode = that.subList[0].toLocationCode
that.jobToLocationCode = that.subList[0].toLocationCode
that.detailSource = getDataSource(that.subList)
} else {
that.showMessage('列表数据为0');
@ -203,30 +208,57 @@
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
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 + "】不在列表中")
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
return;
}
if (result.label.labelType == "ContainerLabel") {
var containerNumber = result.label.container;
var itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber);
if (itemDetail.length == 0) {
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("箱码【" + packingNumber + "】已经扫描")
if (itemDetail[0].scaned) {
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】已经扫描")
} 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')); //
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan()
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) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
if(this.jobContent.allowModifyLocation == 'TRUE'){
this.toLocationCode = code;
}else {
if(code==this.jobToLocationCode){
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() {
@ -317,7 +359,7 @@
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购收货记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg+"]")
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()

24
pages/query/container.vue

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

Loading…
Cancel
Save