Browse Source

客户退货和三方库发货和收货

pda_nev
李俊城 1 year ago
parent
commit
a1afc2def2
  1. 7
      fe/PDA/api/index.js
  2. 47
      fe/PDA/mycomponents/wincom/winScanByProductCode.vue
  3. 22
      fe/PDA/pages.js
  4. 23
      fe/PDA/pages.json
  5. 4
      fe/PDA/pages/login/index.vue
  6. 333
      fe/PDA/pages/record/productionReturn.vue
  7. 553
      fe/PDA/pages/record/thirdLocationDeviler.vue
  8. 193
      fe/PDA/pages/task/thirdLocation.vue
  9. 410
      fe/PDA/pages/task/thirdLocationDetail.vue

7
fe/PDA/api/index.js

@ -1421,3 +1421,10 @@ export const finshContainerJob = (id, params) => request(
method: "post"
})
//生产退库详情
export const customerReturn = (params) => request(
devUrl + "/api/pda/job/production-return", { //
method: "post",
data: params,
});

47
fe/PDA/mycomponents/wincom/winScanByProductCode.vue

@ -29,7 +29,7 @@
import winComScan from '@/mycomponents/wincom/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getInventoryLabel
getitems,
} from '@/api/index.js';
export default {
@ -76,16 +76,21 @@
title: '扫描中...',
mask: true
})
//
getInventoryLabel(result.data.code).then(label => {
if (label) {
getitems(result.data.code).then(item => {
if (item) {
this.losefocus(); //,getfocus()
let result = this.getLabelResult(label);
this.scanResult = result;
this.scanResult = {
itemCode:item.code,
itemName:item.name,
itemDesc1:item.desc1,
stdPackQty: item.stdPackQty,
uom: item.basicUom
};
uni.hideLoading();
this.callBack();
} else {
this.showMessage('标签【' + result.data.code + '】,在标签表中不存在')
this.showMessage('单件码【' + result.data.code + '】,在物料表中不存在')
uni.hideLoading();
}
}).catch(err => {
@ -95,35 +100,7 @@
}
},
getLabelResult(label) {
let labelResult = {
sucess: true,
message: "",
data: label,
// data: {
// isPack: true,
// // scanType: null,
// itemCode: label.itemCode,
// itemName: label.itemName,
// itemDesc1: label.itemDesc1,
// itemDesc2: label.itemDesc2,
// lot: label.lot,
// qty: label.qty,
// uom: label.uom,
// poNumber: label.poNumber,
// // asn: null,
// packingCode: label.code,
// supplierBatch: label.supplierBatch,
// // order: null,
// // poLine: null,
// code: label.code,
// }
};
labelResult.data.isPack = true;
labelResult.data.packingCode = label.code;
return labelResult;
},
callBack() {
this.$refs.comscan.clear();

22
fe/PDA/pages.js

@ -624,8 +624,30 @@ module.exports = () => ({
"navigationBarTitleText": "客户退货",
"enablePullDownRefresh": true
}
},
{
"path": "pages/record/thirdLocationDeviler",
"style": {
"navigationBarTitleText": "三方库发货",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/thirdLocation",
"style": {
"navigationBarTitleText": "三方库收货",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/thirdLocationDetail",
"style": {
"navigationBarTitleText": "三方库收货详情",
"enablePullDownRefresh": true
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

23
fe/PDA/pages.json

@ -602,10 +602,29 @@
"navigationBarTitleText": "客户退货",
"enablePullDownRefresh": true
}
},
{
"path": "pages/record/thirdLocationDeviler",
"style": {
"navigationBarTitleText": "三方库发货",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/thirdLocation",
"style": {
"navigationBarTitleText": "三方库收货",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/thirdLocationDetail",
"style": {
"navigationBarTitleText": "三方库收货详情",
"enablePullDownRefresh": true
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

4
fe/PDA/pages/login/index.vue

@ -36,8 +36,8 @@
<image class="icon_normal" src="../../static/icons_ui/icon_login_password.svg"></image>
密码
</view>
<view class="uni-input-wrapper">
<input class="uni-input" placeholder="请输入密码" :password="showPassword"
<view class="uni-input-wrapper" >
<input class="uni-input" style="padding: 20rpx;" placeholder="请输入密码" :password="showPassword"
v-model="password" />
<text class="uni-icon" :class="[!showPassword ? 'uni-eye-active' : '']"
@click="changePassword">&#xe568;</text>

333
fe/PDA/pages/record/productionReturn.vue

@ -1,56 +1,70 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-blank-view @goScan='openScanPopup' v-if="dataList.length==0"></win-blank-view>
<scroll-view scroll-y="true" class="scroll-detail" style="margin-top: 10rpx;padding-bottom:100px">
<view class="detail-list " v-for="(item, index) in dataList" :key="index">
<win-blank-view @goScan='openScanPopup' v-if="allDataList.length==0"></win-blank-view>
<scroll-view scroll-y class="scroll-detail" style="margin-top: 10rpx;padding-bottom:100px" >
<view class="detail-list " v-for="(item, index) in showList" :key="index">
<view class="detail-content">
<view class="" style="">
<comItemCode :itemData="item"></comItemCode>
<view class="uni-flex uni-row u-col-center">
<view class="" style="margin-top: 20rpx; margin-left: 10rpx; font-weight: bold;">
({{index+1}}).
</view>
<comItemCode :itemData="item"></comItemCode>
</view>
<uni-table border stripe style="">
<!-- <uni-tr>
<uni-td align="center">物品代码</uni-td>
<uni-td>{{item.itemCode}}</uni-td>
</uni-tr> -->
<uni-tr>
<uni-td align="center">单位</uni-td>
<uni-td>{{item.uom}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">标包数</uni-td>
<uni-td>{{item.stdPackQty}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">数量</uni-td>
<uni-td>
<view class="uni-flex uni-row">
<view class="uni-flex uni-row space-between">
<view class="uni-flex uni-row space-between" style="width: 100%;">
<view class="">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty"
:max="99999" :min="0"
@change="qtyChanged($event,item,index)">
:max="99999" :min="0" @change="qtyChanged($event,item,index)">
</com-number-box>
</view>
<view class="">
<button type="primary" size="mini" style="margin-left: 30rpx;" @click="remove(item,index)">移除</button>
<button type="primary" size="mini" style="margin-left: 30rpx;"
@click="remove(item,index)">移除</button>
</view>
</view>
</view>
</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">箱码</uni-td>
<uni-td>1234567890</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
</scroll-view>
<div class="new_bot_box" v-show="dataList.length>0">
<win-collapse-location scanTitle='扫描目标库位' ref='comCollapseLocation'
@getLocationCode='getDefaultToLocation' @clear='clearDefaultLocation'>
<uni-load-more :status="loadingType" v-if="showList.length>0" />
<div class="new_bot_box" v-show="showList.length>0">
<win-collapse-location scanTitle='扫描目标库位' ref='comCollapseLocation' @getLocationCode='getDefaultToLocation'
@clear='clearDefaultLocation'>
</win-collapse-location>
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="cancel()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
</div>
<win-scan-button @goScan='openScanPopup' v-if="dataList.length>0"></win-scan-button>
<win-scan-by-code ref="scanToLocationPopup" title="目标库位" @getScanCode='getToLocation'></win-scan-by-code>
<winScanByProductCode ref="scanPackPopup" title="产品码" @getScanResult='getScanResult'></winScanByProductCode>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<win-scan-button @goScan='openScanPopup' v-if="showList.length>0"></win-scan-button>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan'
@afterCloseCommitMessage='closeCommitMessage'>
</com-message>
@ -62,7 +76,7 @@
locations,
getBalancesByFilterAsync,
getWipListAsync,
returnToWarehouse,
customerReturnCommit,
} from '@/api/index.js';
import {
@ -80,7 +94,6 @@
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue'
import comScanSemiPutaway from '@/mycomponents/scan/comScanSemiPutaway.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue'
import comItemCode from '@/mycomponents/comItem/comItemCode.vue'
@ -88,7 +101,7 @@
export default {
name: 'returnToWarehouse',
name: 'customerReturnCommit',
components: {
winBlankView,
comBaseItem,
@ -97,7 +110,6 @@
winScanByPack,
winScanByCode,
comScanSemiPutaway,
comBalance,
winCollapseLocation,
SemiCollapseItem,
winScanByProductCode,
@ -107,14 +119,54 @@
data() {
return {
options: [],
toLocation: null,
currentItem: {},
dataList: []
showList: [],
defaultToLocation: {},
defaultToLocationCode: "",
allCount: 0,
allDataList: [],
loadingType: "",
pageNo: 0,
pageSize: 5,
scrollTop: 60,
old: {
scrollTop: 0
},
};
},
props: {
},
onLoad() {
uni.setNavigationBarTitle({
title: "客户退货"
})
},
onPullDownRefresh() {
this.pageNo = 1;
this.showList=[]
this.loadingType = "";
this.showList = this.getDataPage(this.pageNo, this.pageSize)
uni.stopPullDownRefresh()
},
onReachBottom() {
console.log("底部")
if (this.loadingType == 'nomore') {
console.log("没有更多了")
return;
}
this.pageNo++;
var list = this.getDataPage(this.pageNo, this.pageSize)
if (list.length > 0) {
console.log("加载更多了")
// this.showList=list
this.showList = this.showList.concat(list)
} else {
//
this.loadingType = "nomore";
}
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
@ -128,150 +180,170 @@
},
methods: {
remove(item,index){
showConfirmMsg("是否移除当前"+item.itemCode,res=>{
if(res){
this.dataList.splice(index,1);
getDataPage(pageNo, pageSize) {
//
var totalPages = Math.ceil(this.allCount / pageSize);
//
const start = (pageNo - 1) * pageSize;
const end = start + pageSize; //
return this.allDataList.slice(start, end)
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('退货数量必须大于0')
item.handledQty = item.qty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
}
},
remove(item, index) {
showConfirmMsg("是否移除当前" + item.itemCode, res => {
if (res) {
this.allDataList.splice(index, 1);
this.allCount = this.allDataList.length;
uni.setNavigationBarTitle({
title: "客户退货"+"("+this.allCount+")"
})
this.$forceUpdate()
}
})
},
getScanResult(result) {
this.currentLabel = result.data;
let code = result.data.code;
var filterItem= this.dataList.filter(res=>{
if(res.itemCode==result.data.itemCode){
var filterItem = this.allDataList.filter(res => {
if (res.itemCode == result.itemCode) {
return res;
}
})
if(filterItem.length>0){
this.showMessage(filterItem[0].itemCode+"已经扫描")
if (filterItem.length > 0) {
this.showMessage("单件码【" + filterItem[0].itemCode + "已经扫描")
return;
}
var item = {
itemCode: result.data.itemCode,
itemName: result.data.itemName,
itemDesc1: result.data.itemDesc1,
itemCode: result.itemCode,
itemName: result.itemName,
itemDesc1: result.itemDesc1,
stdPackQty: result.stdPackQty,
uom: result.uom,
qty: result.stdPackQty
}
this.dataList.push(item)
this.allDataList.unshift(item)
this.allCount = this.allDataList.length;
this.pageNo = 1;
this.showList = []
this.loadingType = "";
this.showList = this.getDataPage(this.pageNo, this.pageSize)
uni.setNavigationBarTitle({
title: "客户退货"+"("+this.allCount+")"
})
this.$forceUpdate();
},
scanToLocation(item) {
this.currentItem = item;
this.openScanToLocationPopup();
},
//
getDefaultToLocation(locationCode) {
let that = this;
uni.showLoading({
title: "扫描中",
mask: true
});
locations(locationCode).then(res => {
if (res == null) {
that.showMessage('目标库位【' + locationCode + '】不存在');
} else {
if (res.type == 2 || res.type == 3 || res.type == 4 || res.type == 6) {
showConfirmMsg('是否要将所有未扫描目标库位的零件,指定目标库位【' + locationCode + '】',
confirm => {
if (confirm) {
that.defaultToLocation = res;
}
});
} else {
that.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】')
}
}
uni.hideLoading();
}).catch(err => {
that.toLocation = null;
that.showMessage(err.message);
uni.hideLoading();
})
},
getToLocation(code) {
if (code == '') {
this.showMessage('目标库位不能为空');
return;
}
uni.showLoading({
title: "扫描中",
mask: true
});
let that = this;
locations(code).then(res => {
if (res == null) {
that.showMessage('目标库位【' + code + '】不存在');
if (res) {
this.defaultToLocation = res;
this.defaultToLocationCode = res.code
} else {
if (res.type == 2 || res.type == 3 || res.type == 4 || res.type == 6) {
this.handledToLocation(this.currentItem, res);
} else {
this.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】')
}
this.showMessage('目标库位【' + locationCode + '】不存在');
}
uni.hideLoading();
}).catch(err => {
that.toLocation = null;
that.showMessage(err.message);
uni.hideLoading();
})
},
this.defaultToLocation = {};
this.defaultToLocationCode = ""
this.showMessage(err.message);
handledToLocation(item, location) {
item.toLocationCode = location.code;
item.toLocationGroup = location.locationGroupCode;
item.toLocationArea = location.areaCode;
item.toLocationErpCode = location.erpLocationCode;
this.$forceUpdate();
this.closeScanToLocationPopup();
})
},
clearDefaultLocation() {
this.toLocationCode=""
this.defaultToLocationCode = ""
this.defaultToLocation = {};
},
submit() {
let that = this;
if (that.dataList.length === 0) {
that.showMessage('请扫描要退货的条码');
if (this.allDataList.length === 0) {
this.showMessage('请扫描单件码');
return;
}
if(this.toLocation==""){
that.showMessage('请扫描目标库位');
if (this.defaultToLocationCode == "") {
this.showMessage('请扫描目标库位');
return;
}
var checkQtyItem =this.checkQty()
if(checkQtyItem!=undefined){
this.showMessage("【"+checkQtyItem.itemCode+'】数量为0,退货数量必须大于0');
return;
}
uni.showLoading({
title: "提交中....",
mask: true
});
let item = this.getSubmitParam();
let params = JSON.stringify(item);
returnToWarehouse(params)
let params = this.setSubmitParam();
console.log( JSON.stringify(params) )
customerReturnCommit(params)
.then(res => {
that.showCommitSuccess();
that.clearInfo();
uni.hideLoading();
this.showCommitSuccess();
this.clearInfo();
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
this.showMessage(err.message);
});
},
checkQty(){
var isCheck =true;
var result =undefined
for (let item of this.allDataList) {
if(item.qty==0){
result =item
break
}
}
return result;
},
setSubmitParam() {
let item = {
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
details: []
}
this.allDataList.forEach(res => {
var detail = {
itemCode: res.itemCode,
itemName: res.itemName,
itemDesc1: res.itemDesc1,
uom: res.uom,
qty: res.qty,
stdPackQty: res.stdPackQty,
toLocationCode:this.defaultToLocationCode
}
item.details.push(detail)
})
return item;
},
getSubmitParam() {
let that = this;
@ -282,7 +354,7 @@
details: []
}
that.dataList.forEach(i => {
that.showList.forEach(i => {
let balanceItem = i.balanceItem;
i.labelList.forEach(l => {
let detail = {};
@ -366,18 +438,20 @@
},
clearInfo() {
let that = this;
that.dataList = [];
that.toLocation = null;
that.defaultToLocation = null;
this.allDataList = [];
this.showList = [];
this.defaultToLocation = {};
this.defaultToLocationCode = "";
this.allCount = 0;
this.loadingType = ""
this.pageNo = 0
uni.setNavigationBarTitle({
title: "客户退货"
})
},
openScanPopup() {
if (this.dataList.length == 0) { //
this.scanPackPopup();
} else { //
this.openPackLabel();
}
this.scanPackPopup();
},
scanPopupGetFocus() {
@ -389,9 +463,6 @@
showCommitSuccess() {
this.$refs.comMessage.showCommitSuccess();
},
showRescanMessage(message) {
this.$refs.comMessage.showRescanMessage(message);
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
@ -401,21 +472,11 @@
closeScanMessage() {
this.scanPopupGetFocus();
},
openPackLabel() {
this.$refs.scanPackPopup.openScanPopup()
},
scanPackPopup() {
this.$refs.scanPackPopup.openScanPopup()
},
openScanToLocationPopup() {
this.$refs.scanToLocationPopup.openScanPopup()
},
closeScanToLocationPopup() {
this.$refs.scanToLocationPopup.closeScanPopup();
},
}
};
</script>

553
fe/PDA/pages/record/thirdLocationDeviler.vue

@ -0,0 +1,553 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-blank-view @goScan='openScanPopup' v-if="fromLocationCode==''"></win-blank-view>
<view class="" style=" background-color: #5A7CF3; color: #fff; border-radius: 20rpx; margin: 15rpx;" v-if="fromLocationCode!=''">
<view class="" style="">
<view class="uni-flex top_lines_info" style="flex-direction: column;">
<view class="" style="padding: 10rpx;">
来源库位:
<text class="text_bold" >{{fromLocationCode.code}}</text>
</view>
<!-- <view class="" style="padding: 10rpx;">
扫描数量:
<text class="text_bold"> {{allCount}}</text>
</view> -->
</view>
</view>
</view>
<scroll-view scroll-y class="scroll-detail" style="margin-top: 10rpx;padding-bottom:100px" >
<view class="detail-list " v-for="(item, index) in showList" :key="index">
<view class="detail-content">
<view class="" style="">
<view class="uni-flex uni-row u-col-center">
<view class="" style="margin-top: 20rpx; margin-left: 10rpx; font-weight: bold;">
({{index+1}}).
</view>
<comItemCode :itemData="item"></comItemCode>
</view>
<uni-table border stripe style="">
<!-- <uni-tr>
<uni-td align="center">物品代码</uni-td>
<uni-td>{{item.itemCode}}</uni-td>
</uni-tr> -->
<uni-tr>
<uni-td align="center">单位</uni-td>
<uni-td>{{item.uom}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">标包数</uni-td>
<uni-td>{{item.stdPackQty}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">数量</uni-td>
<uni-td>
<view class="uni-flex uni-row">
<view class="uni-flex uni-row space-between" style="width: 100%;">
<view class="">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty"
:max="99999" :min="0" @change="qtyChanged($event,item,index)">
</com-number-box>
</view>
<view class="">
<button type="primary" size="mini" style="margin-left: 30rpx;"
@click="remove(item,index)">移除</button>
</view>
</view>
</view>
</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
</scroll-view>
<uni-load-more :status="loadingType" v-if="showList.length>0" />
<div class="new_bot_box" v-show="showList.length>0">
<win-collapse-location scanTitle='扫描目标库位' ref='comCollapseLocation' @getLocationCode='getDefaultToLocation'
@clear='clearDefaultLocation'>
</win-collapse-location>
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="cancel()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
</div>
<win-scan-button @goScan='openScanPopup' v-if="showList.length>0"></win-scan-button>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<win-scan-by-code ref="scanFromLocationPopup" title="来源库位" @getScanCode='scanFromLocation'></win-scan-by-code>
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan'
@afterCloseCommitMessage='closeCommitMessage'>
</com-message>
</view>
</template>
<script>
import {
locations,
getBalancesByFilterAsync,
getWipListAsync,
customerReturn,
} from '@/api/index.js';
import {
showConfirmMsg,
goHome,
getRemoveOption
} from '@/common/basic.js';
import winBlankView from '@/mycomponents/wincom/winBlankView.vue'
import comBaseItem from '@/mycomponents/comItem/comBaseItem.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue'
import comScanSemiPutaway from '@/mycomponents/scan/comScanSemiPutaway.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue'
import comItemCode from '@/mycomponents/comItem/comItemCode.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
export default {
name: 'customerReturn',
components: {
winBlankView,
comBaseItem,
comMessage,
winScanButton,
winScanByPack,
winScanByCode,
comScanSemiPutaway,
winCollapseLocation,
SemiCollapseItem,
winScanByProductCode,
comItemCode,
comNumberBox
},
data() {
return {
options: [],
currentItem: {},
showList: [],
defaultToLocation: {},
defaultToLocationCode: "",
fromLocationCode: "",
allCount: 0,
allDataList: [],
loadingType: "",
pageNo: 0,
pageSize: 5,
scrollTop: 60,
old: {
scrollTop: 0
},
};
},
onLoad() {
uni.setNavigationBarTitle({
title: "三方库发货"
})
},
onPullDownRefresh() {
this.pageNo = 1;
this.showList=[]
this.loadingType = "";
this.showList = this.getDataPage(this.pageNo, this.pageSize)
uni.stopPullDownRefresh()
},
onReachBottom() {
console.log("底部")
if (this.loadingType == 'nomore') {
console.log("没有更多了")
return;
}
this.pageNo++;
var list = this.getDataPage(this.pageNo, this.pageSize)
if (list.length > 0) {
console.log("加载更多了")
this.showList = this.showList.concat(list)
} else {
//
this.loadingType = "nomore";
}
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
mounted: function() {
this.openScanPopup();
},
methods: {
//
scanFromLocation(code) {
let that = this;
if (code == '') return;
uni.showLoading({
title: '扫描中...',
mask: true
});
locations(code).then(res => {
uni.hideLoading();
if(res){
if(res.type == 3||res.type == 5){
that.fromLocationCode = res;
this.openPackLabel();
this.closeScanFromLocationPopup();
}else {
that.showMessage('扫描的库位【' + code + '】不是【半成品库】或【成品库位】');
}
}else {
that.showMessage('未查询到库位【' + code + '】');
}
}).catch(err => {
uni.hideLoading();
that.showMessage(err.message);
});
},
getDataPage(pageNo, pageSize) {
//
var totalPages = Math.ceil(this.allCount / pageSize);
//
const start = (pageNo - 1) * pageSize;
const end = start + pageSize; //
return this.allDataList.slice(start, end)
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('退货数量必须大于0')
item.handledQty = item.qty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
}
},
remove(item, index) {
showConfirmMsg("是否移除当前" + item.itemCode, res => {
if (res) {
this.allDataList.splice(index, 1);
this.allCount = this.allDataList.length;
uni.setNavigationBarTitle({
title: "三方库发货"+"("+this.allCount+")"
})
this.$forceUpdate()
}
})
},
async getScanResult(result) {
var balanceParam={
pageIndex: 1,
pageSize: 100,
itemCode:result.itemCode,
locationCode:this.fromLocationCode
}
let balanceRes = await getBalancesByFilterAsync(balanceParam);
if(balanceRes.totalCount==0){
this.showMessage("单件码【" + filterItem[0].itemCode + "】在库位【"+this.fromLocationCode+"】没有库存")
return;
}
var filterItem = this.allDataList.filter(res => {
if (res.itemCode == result.itemCode) {
return res;
}
})
if (filterItem.length > 0) {
this.showMessage("单件码【" + filterItem[0].itemCode + "】已经扫描")
return;
}
var item = {
itemCode: result.itemCode,
itemName: result.itemName,
itemDesc1: result.itemDesc1,
stdPackQty: result.stdPackQty,
uom: result.uom,
qty: result.stdPackQty
}
this.allDataList.unshift(item)
this.allCount = this.allDataList.length;
this.pageNo = 1;
this.showList = []
this.loadingType = "";
this.showList = this.getDataPage(this.pageNo, this.pageSize)
uni.setNavigationBarTitle({
title: "三方库发货"+"("+this.allCount+")"
})
this.$forceUpdate();
},
//
getDefaultToLocation(locationCode) {
uni.showLoading({
title: "扫描中",
mask: true
});
locations(locationCode).then(res => {
uni.hideLoading();
if (res) {
this.defaultToLocation = res;
this.defaultToLocationCode = res.code
} else {
this.showMessage('目标库位【' + locationCode + '】不存在');
}
}).catch(err => {
uni.hideLoading();
this.defaultToLocation = {};
this.defaultToLocationCode = ""
this.showMessage(err.message);
})
},
clearDefaultLocation() {
this.defaultToLocationCode = ""
this.defaultToLocation = {};
},
submit() {
if (this.allDataList.length === 0) {
this.showMessage('请扫描单件码');
return;
}
if (this.defaultToLocationCode == "") {
this.showMessage('请扫描目标库位');
return;
}
var checkQtyItem =this.checkQty()
if(checkQtyItem!=undefined){
this.showMessage("【"+checkQtyItem.itemCode+'】数量为0,退货数量必须大于0');
return;
}
uni.showLoading({
title: "提交中....",
mask: true
});
let params = this.setSubmitParam();
console.log( JSON.stringify(params) )
customerReturn(params)
.then(res => {
uni.hideLoading();
this.showCommitSuccess();
this.clearInfo();
})
.catch(err => {
uni.hideLoading();
this.showMessage(err.message);
});
},
checkQty(){
var isCheck =true;
var result =undefined
for (let item of this.allDataList) {
if(item.qty==0){
result =item
break
}
}
return result;
},
setSubmitParam() {
let item = {
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
details: []
}
this.allDataList.forEach(res => {
var detail = {
itemCode: res.itemCode,
itemName: res.itemName,
itemDesc1: res.itemDesc1,
uom: res.uom,
qty: res.qty,
stdPackQty: res.stdPackQty,
toLocationCode:this.defaultToLocationCode
}
item.details.push(detail)
})
return item;
},
getSubmitParam() {
let that = this;
let item = {
number: "",
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
putawayType: 2,
details: []
}
that.showList.forEach(i => {
let balanceItem = i.balanceItem;
i.labelList.forEach(l => {
let detail = {};
detail.itemCode = balanceItem.itemCode;
detail.itemName = balanceItem.itemName;
detail.itemDesc1 = balanceItem.itemDesc1;
detail.itemDesc2 = balanceItem.itemDesc2;
detail.uom = l.uom;
detail.qty = l.qty;
detail.stdPackQty = balanceItem.stdPackQty;
detail.fromPackingCode = balanceItem.packingCode;
detail.toPackingCode = l.packingCode;
detail.fromLot = balanceItem.lot;
detail.toLot = l.lot;
detail.toLocationCode = l.toLocationCode ?? that.defaultToLocation.code;
detail.toLocationGroup = l.toLocationGroup ?? that.defaultToLocation
.locationGroupCode;
detail.toLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode;
detail.toLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation
.erpLocationCode;
detail.fromStatus = balanceItem.status;
detail.toStatus = l.status;
detail.fromWarehouseCode = localStorage.warehouseCode;
detail.toWarehouseCode = localStorage.warehouseCode;
detail.supplierBatch = balanceItem.supplierBatch;
detail.arriveDate = balanceItem.arriveDate;
detail.produceDate = balanceItem.produceDate;
detail.expireDate = balanceItem.expireDate;
//===========================================
detail.recommendPackingCode = balanceItem.packingCode;
detail.recommendSupplierBatch = l.supplierBatch;
detail.recommendArriveDate = l.arriveDate;
detail.recommendProduceDate = l.produceDate;
detail.recommendExpireDate = l.expireDate;
detail.recommendLot = balanceItem.lot;;
detail.recommendToLocationCode = l.toLocationCode ?? that.defaultToLocation.code;
detail.recommendToLocationArea = l.toLocationArea ?? that.defaultToLocation
.areaCode;
detail.recommendToLocationGroup = l.toLocationGroup ?? that.defaultToLocation
.locationGroupCode;
detail.recommendToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation
.erpLocationCode;
detail.recommendToWarehouseCode = localStorage.warehouseCode;
detail.recommendQty = balanceItem.qty;
detail.handledContainerCode = l.containerCode;
detail.handledPackingCode = l.packingCode;
detail.handledSupplierBatch = l.supplierBatch;
detail.handledArriveDate = l.arriveDate;
detail.handledProduceDate = l.produceDate;
detail.handledExpireDate = l.expireDate;
detail.handledLot = l.lot;
detail.handledToLocationCode = l.toLocationCode ?? that.defaultToLocation.code;
detail.handledToLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode;
detail.handledToLocationGroup = l.toLocationGroup ?? that.defaultToLocation
.locationGroupCode;
detail.handledToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation
.erpLocationCode;
detail.handledToWarehouseCode = localStorage.warehouseCode;
detail.handledQty = l.qty;
item.details.push(detail);
});
})
return item;
},
cancel() {
let that = this;
showConfirmMsg('是否要清空已扫描信息?', confirm => {
if (confirm) {
that.clearInfo();
}
})
},
clearInfo() {
this.allDataList = [];
this.showList = [];
this.defaultToLocation = {};
this.defaultToLocationCode = "";
this.allCount = 0;
this.loadingType = ""
this.pageNo = 0
uni.setNavigationBarTitle({
title: "三方库发货"
})
},
openScanPopup() {
this.scanPackPopup();
},
scanPopupGetFocus() {
this.$refs.scanPackPopup.getfocus();
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showCommitSuccess() {
this.$refs.comMessage.showCommitSuccess();
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
closeCommitMessage() {
// this.openScanPopup();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
openPackLabel() {
this.$refs.scanPackPopup.openScanPopup()
},
openScanFromLocationPopup() {
this.$refs.scanFromLocationPopup.openScanPopup()
},
closeScanFromLocationPopup() {
this.$refs.scanFromLocationPopup.closeScanPopup();
},
scanPackPopup(){
if (this.fromLocationCode == "") { //
this.openScanFromLocationPopup();
} else { //
this.openPackLabel();
}
}
}
};
</script>
<style scoped lang="scss">
</style>

193
fe/PDA/pages/task/thirdLocation.vue

@ -0,0 +1,193 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-empty-view v-if="deliverList.length==0"></win-empty-view>
<view hover-class="uni-list-cell-hover" v-for="(item, index) in deliverList" :key="item.id"
@click="openDetail(item)">
<com-deliver :dataContent="item"></com-deliver>
</view>
<uni-load-more :status="loadingType" v-if="deliverList.length>0" />
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'>
</win-mulit-scan> -->
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getDeliverList,
getDeliverJobByNumber
} from '@/api/index.js';
import {
goHome
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import comDeliver from '@/mycomponents/coms/task/comDeliver.vue';
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
name: 'deliver',
components: {
winEmptyView,
winScanButton,
winMulitScan,
comDeliver,
comMessage
},
data() {
return {
deliverList: [],
reload: false,
status: '',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
pageSize: this.modelConfig,
pageIndex: 1,
isTimeWindowSorting: false,
isToday: true,
titleArray: ['任务编号'],
loadingType: "nomore"
};
},
props: {
datacontent: {
type: Object,
value: null
}
},
onShow: function() {
this.getList('refresh');
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
return false;
}
goHome();
return true;
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
window.location.reload();
}
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
//
timeSortingChange: function(e) {
this.isTimeWindowSorting = e.detail.value
this.getList()
},
//
isTodayChange: function(e) {
this.isToday = e.detail.value
this.getList()
},
//
getList(type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageIndex = 1;
this.deliverList = [];
}
let params = {
pageSize: that.pageSize,
pageIndex: that.pageIndex,
// isCreationTimeSorting: that.isTimeWindowSorting,
// isToday: that.isToday
};
getDeliverList(params)
.then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.items;
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
//
this.loadingType = "nomore";
return;
}
// that.deliverList = [...that.deliverList, ...list];
that.deliverList = type === "refresh" ? list : this.deliverList.concat(list);
that.pageIndex++;
})
.catch(err => {
this.loadingType = "";
this.showMessage(err.message);
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
});
},
getScanResult(type, result) {
if (type == '任务编号') {
this.getByNumber(type, result.data.code);
}
},
getByNumber(type, code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getDeliverJobByNumber(code).then(res => {
uni.hideLoading();
if (res != null) {
that.openDetail(res);
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的盘点任务');
}
}).catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
openDetail(item) {
uni.navigateTo({
url: './thirdLocationDetail?id=' + item.id + '&jobStatus=' + item.jobStatus
});
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
}
};
</script>
<style scoped lang="scss">
</style>

410
fe/PDA/pages/task/thirdLocationDetail.vue

@ -0,0 +1,410 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<view class="top_card">
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount">
</com-job-scan-detail>
</view>
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
class="scroll-detail">
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id">
<!-- 单选卡片 -->
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.itemCode }}</view>
<view class="ljh_left">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view>
</view>
<view class="list_form hold_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;">
<uni-tr>
<!-- <uni-th width="90"></uni-th>
<uni-th width="100" align="center">推荐</uni-th>
<uni-th width="100" align="center">实际</uni-th> -->
<uni-th width="50"></uni-th>
<uni-th width="120" align="center">推荐</uni-th>
<uni-th width="120" align="center">实际</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">数量</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{item.recommendQty}}({{item.uom}})</text>
</view>
</uni-th>
<!-- -->
<uni-th width="120" align="center">
<view v-if="item.scaned" class="text_black">
{{item.handledQty}}({{item.uom}})
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">箱码</uni-th>
<uni-th width="120" align="center">
<view class="text_packingCode">{{ item.recommendPackingCode }}</view>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned" class="text_packingCode">
{{ item.handledPackingCode }}
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">批次</uni-th>
<uni-th width="120" align="center">
<view><text class="text_black">{{item.recommendLot }}</text>
</view>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned">
<text class="text_black">{{item.handledLot }}</text>
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">库位</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{ item.recommendLocationCode }}</view>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned" class="text_black">
{{ item.handledFromLocationCode }}
</view>
</uni-th>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view class="choose_marked" v-if="item.scaned">
<image src="@/static/image_marked.svg"></image>
</view>
</view>
</view>
</scroll-view>
<view class="new_btn_bot count_shadow">
<button type="primary" class="new_save_btn" @click="submit()">提交</button>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage>
</view>
</template>
<script>
import {
getDeliverDetail,
takeDeliverJob,
cancelTakeDeliverJob,
finshDeliverJob,
balances
} from '@/api/index.js';
import {
showConfirmMsg,
goHome,
navigateBack
} from '@/common/basic.js';
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
export default {
components: {
winScanButton,
winMulitScan,
winScanByPack,
comMessage,
comJobScanDetail,
comBalance
},
data() {
return {
type: '',
id: "",
datacontent: {},
details: {},
toLocation: '',
scrollTop: 0,
old: {
scrollTop: 0
},
ispending: false,
balancesItem: {},
titleArray: ['箱标签', '目标库位'],
allCount: 0,
scanCount: 0,
jobStatus:""
}
},
props: {
itemCode: "",
},
onLoad(param) {
this.id = param.id;
if (param.jobStatus == 1) {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
window.location.reload();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus == 2) {
//
cancelTakeDeliverJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
mounted() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: "#5A7CF3 !important"
})
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
//
getDetail() {
let that = this;
let params = {
id: that.id,
};
getDeliverDetail(params)
.then(item => {
console.log('item', item);
that.datacontent = item;
that.jobStatus = item.jobStatus
that.details = item.details;
that.details.forEach(r => r.scaned = false);
that.ispending = item.jobStatus === 2;
that.allCount = item.details.length;
// that.toLocation = item.details[0].recommendLocationCode;
})
.catch(err => {
this.showMessage('未查找到详细信息')
});
},
//
getScanResult(result) {
let that = this;
let code = result.data.code;
let item = this.details.find(r => {
return r.recommendPackingCode === code
});
if (item === undefined) {
this.showMessage('在发货任务详情中,未找到箱码【' + code + '】');
return;
} else {
if (item.scaned) {
this.showMessage('箱码【' + code + '】已经扫描,请扫描下一箱零件');
return;
}
}
//
let params = {
pageSize: 1000,
pageIndex: 1,
packingCode: code,
locationTypes: [4], //
inventoryStatuses: [2], //
};
balances(params)
.then(res => {
try {
if (res.totalCount == 0) {
this.showMessage('箱码【' + code + '】在【成品库】未查询到库存信息');
} else if (res.totalCount == 1) {
that.balancesItem = res.items[0];
this.createItem(item);
} else {
this.$refs.balanceItems.openPopup(res.items);
}
uni.hideLoading();
} catch (e) {
this.showMessage(e.message)
}
})
.catch(err => {
this.showMessage(err.message)
});
},
createItem(item) {
let that = this;
if (that.balancesItem != null || that.balancesItem != undefined) {
// if (that.balancesItem.qty != item.recommendQty) {
// this.showMessage('' + that.balancesItem.qty + '' + item.recommendQty + ',')
// } else {
item.scaned = true;
item.handledContainerCode = that.balancesItem.containerCode;
item.handledPackingCode = that.balancesItem.packingCode;
item.handledBatch = that.balancesItem.batch;
item.handledLot = that.balancesItem.lot;
item.handledFromLocationArea = that.balancesItem.locationCode;
item.handledQty = that.balancesItem.qty;
// ==================================
// item.recommendFromLocationCode = string;
// item.recommendFromLocationArea = string;
// item.recommendFromLocationGroup = string;
// item.recommendFromLocationErpCode = string;
// item.recommendFromWarehouseCode = string;
// item.uom = string;
// item.recommendQty = 0;
// item.handledFromLocationCode = string;
// item.handledFromLocationArea = string;
// item.handledFromLocationGroup = string;
// item.handledFromLocationErpCode = string;
// item.handledFromWarehouseCode = string;
// item.handledQty = that.balancesItem.qty;
// item.toLocationCode = string;
// item.toLocationArea = string;
// item.toLocationGroup = string;
// item.toLocationErpCode = string;
// item.toWarehouseCode = string;
// item.onTheWayLocationCode = string;
this.getScanCount();
this.closeScanPopup();
that.$forceUpdate();
// }
}
},
getScanCount() {
this.scanCount = this.datacontent.details.filter(r => r.scaned).length;
},
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPopup.closeScanPopup();
}
},
selectedBalanceItem(balanceItem) {
that.balancesItem = balanceItem;
this.createItem(item);
},
//
receive(callback) {
let params = {
id: this.id
};
takeDeliverJob(params)
.then(res => {
callback(true);
})
.catch(err => {
this.showMessage(err.message);
callback(false);
});
},
submit() {
let that = this;
if (that.datacontent.details.length === 0) {
this.showMessage('该任务没有要发货的零件');
return;
}
let items = that.datacontent.details.filter(r => r.scaned);
if (items.length === 0) {
this.showMessage('请扫描要发货的零件');
return;
} else if (items.length < that.datacontent.details.length) {
this.showMessage('还有未扫描的零件,不可以发货');
return;
} else {
that.finsh();
}
},
finsh() {
let that = this;
uni.showLoading({
title: "提交中..."
});
let params = JSON.stringify(that.datacontent);
console.log(params);
// finshDeliverJob(that.id, params)
// .then(res => {
// uni.hideLoading();
// if (res != null) {
// that.showCommitSuccessMessage();
// navigateBack(1);
// }
// })
// .catch(err => {
// this.showMessage(err.message);
// uni.hideLoading();
// });
},
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},
closeCommitMessage() {
navigateBack(1); //
uni.hideLoading();
},
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPopup.closeScanPopup();
}
},
clearScanLocation() {
// this.$refs.scanLocation.getfocus();
// this.$refs.scanLocation.clear();
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
scroll: function(e) {
this.old.scrollTop = e.detail.scrollTop;
},
}
}
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save