Browse Source

修改发料拆箱

pda_nev
李俊城 1 year ago
parent
commit
baac3101fc
  1. 5
      fe/PDA/mycomponents/coms/comUnPacking.vue
  2. 4
      fe/PDA/mycomponents/wincom/winScanByContainer.vue
  3. 158
      fe/PDA/pages/task/deliverBoard.vue
  4. 329
      fe/PDA/pages/task/deliverBoard_detail.vue
  5. 6
      fe/PDA/pages/task/issue_detail.vue

5
fe/PDA/mycomponents/coms/comUnPacking.vue

@ -350,7 +350,7 @@
fromLocationErpCode: itemData.recommendFromLocationErpCode,
fromWarehouseCode: itemData.recommendFromWarehouseCode,
fromLot: itemData.recommendLot,
fromStatus: 1,
fromStatus: 2,
toPackingCode: newPackingCode,
toContainerCode: itemData.recommendContainerCode,
@ -361,12 +361,11 @@
toWarehouseCode: itemData.recommendFromWarehouseCode,
toLot: itemData.recommendLot,
toStatus: 1,
toStatus: 2,
supplierBatch: itemData.recommendSupplierBatch,
arriveDate: itemData.recommendArriveDate,
produceDate: itemData.recommendProduceDate,
expireDate: itemData.recommendExpireDate,
onTheWayLocationCode: "",
reason: ""
}

4
fe/PDA/mycomponents/wincom/winScanByContainer.vue

@ -70,8 +70,8 @@
getScanResult(result) {
console.log("扫描",result.data.code)
if (result != null) {
if(result.data.code[0].toUpperCase()!="C"){
this.showMessage("标签格式不正确")
if(result.data.code[0].toUpperCase()!="Q"){
this.showMessage("标签格式不正确 : "+result.data.code)
return;
}
// uni.showLoading({

158
fe/PDA/pages/task/deliverBoard.vue

@ -1,28 +1,23 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-empty-view v-if="issueList.length==0"></win-empty-view>
<view hover-class="uni-list-cell-hover" v-for="(item, index) in issueList" :key="item.id"
<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)">
<comDeliverBoard :dataContent="item"></comDeliverBoard>
<com-deliver :dataContent="item"></com-deliver>
</view>
<uni-load-more :status="loadingType" v-if="issueList.length>0" />
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> -->
<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>
<com-scan-issue-list ref="scanList" @selectedItem="selectedItem"></com-scan-issue-list>
<!-- com-message必须放在最下层 -->
<com-message ref="comMessage"></com-message>
</win-mulit-scan> -->
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getDeliverBoardList,
getIssueJobByNumber,
getIssueListByRequest
getDeliverList,
getDeliverJobByNumber
} from '@/api/index.js';
import {
@ -30,27 +25,22 @@
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import comDeliverBoard from '@/mycomponents/coms/task/comDeliverBoard.vue';
import comMessage from '@/mycomponents/common/comMessage.vue'
import comDeliver from '@/mycomponents/coms/task/comDeliver.vue';
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comScanIssueList from '@/mycomponents/scan/comScanIssueList.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
name: 'issue',
name: 'deliver',
components: {
winEmptyView,
comDeliverBoard,
comMessage,
winScanButton,
winMulitScan,
comScanIssueList
comDeliver,
comMessage
},
data() {
return {
//popup
type: '',
issueList: [],
deliverList: [],
reload: false,
status: '',
contentText: {
@ -60,8 +50,8 @@
},
pageSize: this.modelConfig,
pageIndex: 1,
isIssueTimeChange: false,
isToday: false,
isTimeWindowSorting: false,
isToday: true,
titleArray: ['任务编号'],
loadingType: "nomore"
};
@ -70,21 +60,54 @@
datacontent: {
type: Object,
value: null
}
},
isByFIFO: {
type: Boolean,
value: false
onShow: function() {
this.getList('refresh');
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onShow() {
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({
@ -94,15 +117,15 @@
this.loadingType = "loading";
if (type === "refresh") {
this.pageIndex = 1;
this.issueList = [];
this.deliverList = [];
}
let params = {
pageSize: that.pageSize,
pageIndex: that.pageIndex,
isCreationTimeSorting: that.isIssueTimeChange,
isToday: that.isToday
// isCreationTimeSorting: that.isTimeWindowSorting,
// isToday: that.isToday
};
getDeliverBoardList(params)
getDeliverList(params)
.then(res => {
uni.hideLoading();
if (type === "refresh") {
@ -115,64 +138,38 @@
this.loadingType = "nomore";
return;
}
that.issueList = type === "refresh" ? list : this.issueList.concat(list);
// 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) {
let code = result.data.code;
if (code == '') {
this.showMessage('扫描的内容不能为空')
return;
}
if (type == '任务编号') {
this.scanByNumber(code, type);
}
},
//
scanByRequesNumber(code, type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getIssueListByRequest(code).then(res => {
uni.hideLoading();
let items = res.items;
if (res.totalCount > 0) {
if (res.totalCount == 1) {
that.openDetail(items[0]);
} else {
that.showItemList(items);
}
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
this.getByNumber(type, result.data.code);
}
}).catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
//
scanByNumber(code, type) {
getByNumber(type, code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getIssueJobByNumber(code).then(res => {
getDeliverJobByNumber(code).then(res => {
uni.hideLoading();
if (res != null) {
that.openDetail(res);
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
that.showMessage('未查找到' + type + '为【' + code + '】的盘点任务');
}
}).catch(err => {
that.showMessage(err.message);
@ -185,26 +182,9 @@
url: './deliverBoard_detail?id=' + item.id + '&jobStatus=' + item.jobStatus
});
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
onPull() {
this.getList('refresh');
},
onReach() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more');
},
showItemList(itemList) {
this.$refs.scanList.openPopup(itemList);
},
selectedItem(item) {
this.openDetail(item);
}
}
};
</script>

329
fe/PDA/pages/task/deliverBoard_detail.vue

@ -1,16 +1,14 @@
<!-- 发料任务详情 -->
<template>
<page-meta root-font-size="16px"></page-meta>
<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-top="scrollTop" scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower"
@scroll="scroll" class="scroll-detail">
<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">
<!-- <comDeliverBoardDetail :dataContent="item" :isShowPacking="true"></comDeliverBoardDetail> -->
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
@ -72,63 +70,58 @@
<button class="btn_single" hover-class="btn_single_after" @click="unPacking(item)">拆箱</button>
</view>
</view>
</view>
</scroll-view>
<view class="uni-flex uni-row new_btn_bot">
<button class="new_clear_btn btn_double" @click="clear()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
<view class="new_btn_bot count_shadow">
<button type="primary" class="new_save_btn" @click="submit()">提交</button>
</view>
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<winScanByContainer ref="scanPopup" @getScanResult='getScanResult'></winScanByContainer>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<comUnPacking ref='comUnPacking'
@getvalue="getUnPackingCount" title="拆箱">
</comUnPacking>
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@afterCloseScanMessage='closeScanMessage'></com-message>
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage>
</view>
</template>
<script>
import {
getDeliverJobDetail,
takeDeliverBoardJob,
cancelTakeDeliverBoardJob,
finshIssueJob,
issueBalances
getDeliverDetail,
takeDeliverJob,
cancelTakeDeliverJob,
finshDeliverJob,
balances
} from '@/api/index.js';
import {
getJobStatuStyle,
getJobStatuDesc,
showConfirmMsg,
goHome,
compareDesc,
compareStr,
getCurrDateTime,
navigateBack
goHome
} from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winScanByContainer from '@/mycomponents/wincom/winScanByContainer.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
import comDeliverBoardDetail from '@/mycomponents/coms/comDeliverBoardDetail.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import comBalance from '@/mycomponents/common/comBalance.vue'
import comUnPacking from '@/mycomponents/coms/comUnPacking.vue'
import winScanByContainer from '@/mycomponents/wincom/winScanByContainer.vue'
export default {
components: {
comMessage,
winScanButton,
winMulitScan,
winScanByContainer,
comBalance,
comMessage,
comJobScanDetail,
comDeliverBoardDetail,
comNumberBox,
comBalance,
comUnPacking
},
data() {
return {
type: '',
id: "",
datacontent: {},
details: {},
@ -138,15 +131,24 @@
scrollTop: 0
},
ispending: false,
balancesItem: null,
currentItem: null,
balancesItem: {},
received: false,
titleArray: ['箱标签', '目标库位'],
allCount: 0,
scanCount: 0,
jobStatus: ""
}
},
filters: {
statusStyle: function(val) {
return getJobStatuStyle(val);
},
statusColor: function(val) {
return getJobStatuDesc(val);
}
},
props: {
itemCode: "",
},
onLoad(param) {
this.id = param.id;
if (param.jobStatus == 1) {
@ -166,24 +168,17 @@
window.location.reload();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus == 2) {
if (this.received) {
//
cancelTakeDeliverBoardJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
cancelTakeDeliverJob(this.id)
.then(res => {})
.catch(err => {
this.showMessage(err.message);
});
}
},
mounted() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
@ -197,75 +192,138 @@
//
getDetail() {
let that = this;
if (that.id == undefined) {
return;
}
uni.showLoading({
title: '加载中...',
mask: true
})
let params = {
id: that.id,
};
getDeliverJobDetail(params)
getDeliverDetail(params)
.then(item => {
console.log('item', item);
that.datacontent = item;
that.details = item.details;
that.details[0].recommendContainerCode = "C19"
that.jobStatus = item.jobStatus
if (that.details != null) {
that.details.forEach(
r => {
r.scaned = false;
r.scanDate = new Date()
}
);
that.details.forEach(r => r.scaned = false);
that.ispending = item.jobStatus === 2;
// if (that.toLocation === '') {
// that.toLocation = item.details[0].requestLocationCode;
// }
this.allCount = that.details.length;
this.scanCount = 0;
}
uni.hideLoading();
that.allCount = item.details.length;
// that.toLocation = item.details[0].recommendLocationCode;
})
.catch(err => {
this.showMessage('未查找到详细信息')
uni.hideLoading();
});
},
//
getScanResult(result) {
//
let item = this.details.find(r => r.recommendContainerCode == result.containerCode);
if (item == undefined) {
this.showMessage("器具码【" + result.containerCode + "】不在列表中")
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("器具码【" + result.containerCode + "】已经扫描")
} else {
if (this.allCount == this.scanCount) {
this.showMessage("零件已经全部扫描完成");
this.showMessage('箱码【' + code + '】已经扫描,请扫描下一箱零件');
return;
}
item.containerCode = result.containerCode;
}
//
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.handleQty = 10;
this.calcScanCount()
this.$forceUpdate();
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();
// }
}
},
unPacking(item) {
this.$refs.comUnPacking.openPopup3(this.datacontent,item,item.handledQty,item.recommendQty,false);
},
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
};
takeDeliverBoardJob(params)
takeDeliverJob(params)
.then(res => {
callback(true);
})
@ -274,59 +332,54 @@
callback(false);
});
},
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.closeScanPopup();
},
submit() {
this.calcScanCount()
if (this.scanCount != this.allCount) {
this.showMessage('当前扫描数量【'+this.scanCount+"】,总数量为【"+this.allCount+"】,未全部扫描");
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: "提交中...",
mask: true
title: "提交中..."
});
let params = that.datacontent;
// finshIssueJob(that.id, params)
let params = JSON.stringify(that.datacontent);
console.log(params);
// finshDeliverJob(that.id, params)
// .then(res => {
// uni.hideLoading();
// if (res != null) {
// that.showCommitSuccessMessage();
// that.backJobList();
// that.backJobList(1000);
// }
// })
// .catch(err => {
// that.showMessage(err.message);
// this.showMessage(err.message);
// uni.hideLoading();
// });
},
//
backJobList() {
navigateBack(1)
},
clear() {
this.scanCount = 0;
this.getDetail();
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() {
this.$refs.scanPopup.getfocus();
},
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.closeScanPopup();
backJobList(delay) {
setTimeout(() => {
uni.navigateTo({
url: './deliver'
})
}, delay)
},
showCommitSuccessMessage() {
@ -344,21 +397,12 @@
}
},
closeScanMessage() {
this.scanPopupGetFocus();
clearScanLocation() {
// this.$refs.scanLocation.getfocus();
// this.$refs.scanLocation.clear();
},
scanPopupGetFocus() {
this.$refs.scanPopup.getfocus();
},
scrollToTop() {
let that = this;
// view
that.scrollTop = that.old.scrollTop
this.$nextTick(function() {
that.scrollTop = 0
});
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
upper: function(e) {
@ -371,13 +415,6 @@
// console.log(e)
this.old.scrollTop = e.detail.scrollTop;
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('发料数量不能小于或等于0')
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
}
},
}
}
</script>

6
fe/PDA/pages/task/issue_detail.vue

@ -520,8 +520,8 @@
item.handledBatch = balanceItem.batch;
item.handledLot = balanceItem.lot;
item.defaultHandleQty = balanceItem.qty;
item.handledQty = balanceItem.qty;
item.handledQty = balanceItem.qty>item.recommendQty?item.recommendQty:balanceItem.qty;
item.defaultHandleQty = item.handledQty;
item.handledFromLocationCode = balanceItem.locationCode;
item.handledFromLocationArea = balanceItem.locationArea;
item.handledFromLocationGroup = balanceItem.locationErpCode;
@ -747,7 +747,7 @@
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
} else if (value > item.defaultHandleQty) {
item.handledQty = item.defaultHandleQty
this.showMessage('发料数量不能大于库存数量:' + item.handledQty)
this.showMessage('发料数量不能大于叫料数量:' + item.handledQty)
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
}
},

Loading…
Cancel
Save