Browse Source

修改拆箱参数

pda_nev
李俊城 1 year ago
parent
commit
a751395376
  1. 95
      fe/PDA/mycomponents/coms/comUnPacking.vue
  2. 46
      fe/PDA/pages/task/deliverJis.vue
  3. 534
      fe/PDA/pages/task/deliverJis_detail.vue
  4. 3
      fe/PDA/pages/task/issue_detail.vue
  5. 7
      fe/PDA/pages/task/receipt_detail.vue

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

@ -32,6 +32,7 @@
<script> <script>
import { import {
showErrorMsg, showErrorMsg,
getCurrDateTime
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
generateNewPacking, generateNewPacking,
@ -65,7 +66,8 @@
default: true default: true
}, },
dataContent: {}, dataContent: {},
jobContent:{} jobContent:{},
jobType:""
} }
}, },
created() { created() {
@ -95,6 +97,7 @@
openPopup3(jobContent,item, qty, vaildqty, isZero) { openPopup3(jobContent,item, qty, vaildqty, isZero) {
this.jobContent =jobContent this.jobContent =jobContent
this.dataContent = item this.dataContent = item
this.jobType =jobContent.jobType
this.value = qty; this.value = qty;
this.defaultValue = vaildqty; this.defaultValue = vaildqty;
this.vaildMaxValue = true; this.vaildMaxValue = true;
@ -218,17 +221,21 @@
async getDataInfo(qty){ async getDataInfo(qty){
try{ try{
var labelData = await getInventoryLabel(this.dataContent.handledPackingCode) var labelData = await getInventoryLabel(this.dataContent.recommendPackingCode)
var newPackingCodeParam = this.setNewPackingCodeParam(labelData,qty) var newPackingCodeParam = this.setNewPackingCodeParam(labelData,qty)
var newPackingCodeData = await generateNewPacking(1,newPackingCodeParam); var newPackingCodeData = await generateNewPacking(1,newPackingCodeParam);
var unPackingParams = this.setUnPackingParams(labelData,qty,newPackingCodeData[0].code) if(this.jobType==6){
var unPackingParams= this.setUnPackingParamsByIssue(labelData,qty,newPackingCodeData[0].code)
}else{
var unPackingParams= this.setUnPackingParamsByReceipt(labelData,qty,newPackingCodeData[0].code)
}
var unPackingData = await unPacking(unPackingParams) var unPackingData = await unPacking(unPackingParams)
this.showMessage("生成新的箱码【"+newPackingCodeData[0].code+"】请到PC端打印标签")
}catch(error){ }catch(error){
this.showMessage(error) this.showMessage(error)
} }
}, },
setNewPackingCodeParam(labelData,qty){ setNewPackingCodeParam(labelData,qty){
@ -242,8 +249,7 @@
}, },
setUnPackingParamsByReceipt(labelData,qty,newPackingCode){
setUnPackingParams(labelData,qty,newPackingCode){
var data = labelData; var data = labelData;
var itemData =this.dataContent; var itemData =this.dataContent;
var param = { var param = {
@ -253,7 +259,7 @@
worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN, worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN,
activeDate: data.arriveDate, activeDate: data.arriveDate,
confirmed: true, confirmed: true,
confirmTime: data.arriveDate, confirmTime: getCurrDateTime(),
requestNumber:"", requestNumber:"",
jobNumber: "", jobNumber: "",
type: "SplitPacking", type: "SplitPacking",
@ -279,13 +285,13 @@
fromStatus: 1, fromStatus: 1,
toPackingCode: newPackingCode, toPackingCode: newPackingCode,
toContainerCode: itemData.handledContainerCode, toContainerCode: itemData.recommendContainerCode,
toLocationCode: itemData.handledToLocationCode, toLocationCode: itemData.recommendToLocationCode,
toLocationArea: itemData.handledToLocationArea, toLocationArea: itemData.recommendToLocationArea,
toLocationGroup: itemData.handledToLocationGroup, toLocationGroup: itemData.recommendToLocationGroup,
toLocationErpCode: itemData.handledToLocationErpCode, toLocationErpCode: itemData.recommendToLocationErpCode,
toWarehouseCode: itemData.handledToWarehouseCode, toWarehouseCode: itemData.recommendToWarehouseCode,
toLot: itemData.handledLot, toLot: itemData.recommendLot,
toStatus: 1, toStatus: 1,
supplierBatch: data.supplierBatch, supplierBatch: data.supplierBatch,
@ -300,7 +306,66 @@
} }
return param; return param;
},
setUnPackingParamsByIssue(labelData,qty,newPackingCode){
var data = labelData;
var itemData =this.dataContent;
var param = {
tenantId: data.tenantId,
remark: "",
extraProperties: {},
worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN,
activeDate: data.arriveDate,
confirmed: true,
confirmTime: data.arriveDate,
requestNumber:"",
jobNumber: "",
type: "SplitPacking",
useOnTheWayLocation: false,
details: [
{
remark: itemData.remark,
itemCode: itemData.itemCode,
itemName:itemData.itemName,
itemDesc1: itemData.itemDesc1,
itemDesc2:itemData.itemDesc2,
uom: itemData.uom,
qty: qty,
stdPackQty: itemData.stdPackQty,
fromPackingCode: itemData.recommendPackingCode,
fromContainerCode: itemData.recommendContainerCode,
fromLocationCode: itemData.recommendFromLocationCode,
fromLocationArea: itemData.recommendFromLocationArea,
fromLocationGroup: itemData.recommendFromLocationGroup,
fromLocationErpCode: itemData.recommendFromLocationErpCode,
fromWarehouseCode: itemData.recommendFromWarehouseCode,
fromLot: itemData.recommendLot,
fromStatus: 1,
toPackingCode: newPackingCode,
toContainerCode: itemData.recommendContainerCode,
toLocationCode: itemData.recommendFromLocationCode,
toLocationArea: itemData.recommendFromLocationArea,
toLocationGroup: itemData.recommendFromLocationGroup,
toLocationErpCode: itemData.recommendFromLocationErpCode,
toWarehouseCode: itemData.recommendFromWarehouseCode,
toLot: itemData.recommendLot,
toStatus: 1,
supplierBatch: itemData.recommendSupplierBatch,
arriveDate: itemData.recommendArriveDate,
produceDate: itemData.recommendProduceDate,
expireDate: itemData.recommendExpireDate,
onTheWayLocationCode: "",
reason: ""
} }
]
}
return param;
},
} }
} }
</script> </script>

46
fe/PDA/pages/task/deliverJis.vue

@ -1,26 +1,15 @@
<template> <template>
<page-meta root-font-size="18px"></page-meta> <page-meta root-font-size="18px"></page-meta>
<view class=""> <view class="">
<!-- <view class="uni-flex uni-row require_wrap">
<button @click="isTodayChange" :class="[isToday==true?'require_cell require_active':'require_cell']">
<text></text>
只看当天发料
</button>
<button @click="timeSortingChange"
:class="[isIssueTimeChange==true?'require_cell require_active':'require_cell']">
<text></text>
按发料时间排序
</button>
</view> -->
<win-empty-view v-if="issueList.length==0"></win-empty-view> <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" <view hover-class="uni-list-cell-hover" v-for="(item, index) in issueList" :key="item.id"
@click="openDetail(item)"> @click="openDetail(item)">
<com-issue :dataContent="item"></com-issue> <comDeliverBoard :dataContent="item"></comDeliverBoard>
</view> </view>
<uni-load-more :status="loadingType" v-if="issueList.length>0" /> <uni-load-more :status="loadingType" v-if="issueList.length>0" />
<win-scan-button @goScan='openScanPopup'></win-scan-button> <!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> -->
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'> <win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'>
</win-mulit-scan> </win-mulit-scan>
<com-scan-issue-list ref="scanList" @selectedItem="selectedItem"></com-scan-issue-list> <com-scan-issue-list ref="scanList" @selectedItem="selectedItem"></com-scan-issue-list>
@ -31,7 +20,7 @@
<script> <script>
import { import {
getIssueList, getDeliverBoardList,
getIssueJobByNumber, getIssueJobByNumber,
getIssueListByRequest getIssueListByRequest
} from '@/api/index.js'; } from '@/api/index.js';
@ -41,8 +30,7 @@
} from '@/common/basic.js'; } from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import issueDetail from './issue_detail.vue'; import comDeliverBoard from '@/mycomponents/coms/task/comDeliverBoard.vue';
import comIssue from '@/mycomponents/coms/task/comIssue.vue';
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
@ -52,8 +40,7 @@
name: 'issue', name: 'issue',
components: { components: {
winEmptyView, winEmptyView,
comIssue, comDeliverBoard,
issueDetail,
comMessage, comMessage,
winScanButton, winScanButton,
winMulitScan, winMulitScan,
@ -89,7 +76,7 @@
value: false value: false
} }
}, },
mounted() { onShow() {
this.getList('refresh'); this.getList('refresh');
}, },
methods: { methods: {
@ -97,17 +84,6 @@
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();
}, },
//
timeSortingChange() {
this.isIssueTimeChange = !this.isIssueTimeChange;
this.getList()
},
//
isTodayChange() {
this.isToday = !this.isToday
this.getList()
},
// //
getList(type) { getList(type) {
let that = this; let that = this;
@ -126,7 +102,7 @@
isCreationTimeSorting: that.isIssueTimeChange, isCreationTimeSorting: that.isIssueTimeChange,
isToday: that.isToday isToday: that.isToday
}; };
getIssueList(params) getDeliverBoardList(params)
.then(res => { .then(res => {
uni.hideLoading(); uni.hideLoading();
if (type === "refresh") { if (type === "refresh") {
@ -154,9 +130,7 @@
this.showMessage('扫描的内容不能为空') this.showMessage('扫描的内容不能为空')
return; return;
} }
if (type == '申请单号') { if (type == '任务编号') {
this.scanByRequesNumber(code, type);
} else if (type == '任务编号') {
this.scanByNumber(code, type); this.scanByNumber(code, type);
} }
}, },
@ -208,9 +182,7 @@
openDetail(item) { openDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: './issue_detail?id=' + item.id + '&jobStatus=' + item.jobStatus + '&isByFIFO=' + url: './deliverJis_detail?id=' + item.id + '&jobStatus=' + item.jobStatus
this
.isByFIFO
}); });
}, },

534
fe/PDA/pages/task/deliverJis_detail.vue

@ -10,6 +10,7 @@
@scroll="scroll" class="scroll-detail"> @scroll="scroll" class="scroll-detail">
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id"> <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="detail-content">
<view class="choose_main"> <view class="choose_main">
<view class="ljh_box"> <view class="ljh_box">
@ -19,7 +20,6 @@
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view> <view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view> </view>
</view> </view>
<view class="list_form"> <view class="list_form">
<view class="uni-container"> <view class="uni-container">
<uni-table style="overflow-x: hidden;"> <uni-table style="overflow-x: hidden;">
@ -32,52 +32,32 @@
<uni-th width="120" align="center">实际</uni-th> <uni-th width="120" align="center">实际</uni-th>
</uni-tr> </uni-tr>
<uni-tr> <uni-tr>
<uni-th width="50">数量</text></uni-th> <uni-th width="50">器具码</uni-th>
<uni-th width="120" align="center">
<text class="text_black">{{item.recommendQty}}({{item.uom}})</text>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned"
style="display: flex;flex-direction: row;justify-content:center;align-items: center;">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.handledQty"
:max="99999" :min="0" style='width: 100px;'
@change="qtyChanged($event,item,index)">
</com-number-box>
<text class="text_black">({{item.uom}})</text>
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">箱码</uni-th>
<uni-th width="120" align="center"> <uni-th width="120" align="center">
<view class="text_packingCode"> <view class="text_packingCode">
{{ item.recommendPackingCode }} {{ item.recommendContainerCode }}
</view> </view>
</uni-th> </uni-th>
<uni-th width="120" align="center"> <uni-th width="120" align="center">
<view v-if="item.scaned" class="text_packingCode"> <view v-if="item.scaned" class="text_packingCode">
{{ item.handledPackingCode }} {{ item.containerCode }}
</view> </view>
</uni-th> </uni-th>
</uni-tr> </uni-tr>
<uni-tr> <uni-tr>
<uni-th width="50">批次</uni-th> <uni-th width="50">数量</text></uni-th>
<uni-th width="120" align="center"> <uni-th width="120" align="center">
<view class="text_black">{{item.recommendLot }}</view> <!-- <text class="text_black">{{item.recommendQty}}({{item.uom}})</text> -->
</uni-th> </uni-th>
<uni-th width="120" align="center"> <uni-th width="120" align="center">
<view v-if="item.scaned" class="text_black">{{item.handledLot }}</view> <view v-if="item.scaned"
</uni-th> style="display: flex;flex-direction: row;justify-content:center;align-items: center;">
</uni-tr>
<uni-tr> <com-number-box ref="comNumberBox" v-model="item.handledQty"
<uni-th width="60">库位</uni-th> :max="99999" :min="0" style='width: 100px;'
<uni-th width="100" align="center"> @change="qtyChanged($event,item,index)">
<view class="text_black">{{ item.recommendFromLocationCode }}</view> </com-number-box>
</uni-th> <text class="text_black">({{item.uom}})</text>
<uni-th width="100" align="center">
<view class="text_black" v-if="item.scaned">
{{ item.handledFromLocationCode }}
</view> </view>
</uni-th> </uni-th>
</uni-tr> </uni-tr>
@ -88,8 +68,7 @@
<view class="choose_marked" v-if="item.scaned"> <view class="choose_marked" v-if="item.scaned">
<image src="@/static/image_marked.svg"></image> <image src="@/static/image_marked.svg"></image>
</view> </view>
<view class="fr" <view class="fr" >
>
<button class="btn_single" hover-class="btn_single_after" @click="unPacking(item)">拆箱</button> <button class="btn_single" hover-class="btn_single_after" @click="unPacking(item)">拆箱</button>
</view> </view>
</view> </view>
@ -101,9 +80,7 @@
</view> </view>
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance> <com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack> <winScanByContainer ref="scanPopup" @getScanResult='getScanResult'></winScanByContainer>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<comUnPacking ref='comUnPacking' <comUnPacking ref='comUnPacking'
@getvalue="getUnPackingCount" title="拆箱"> @getvalue="getUnPackingCount" title="拆箱">
</comUnPacking> </comUnPacking>
@ -114,9 +91,9 @@
<script> <script>
import { import {
getIssueDetail, getDeliverJobDetail,
takeIssueJob, takeDeliverBoardJob,
cancelTakeIssueJob, cancelTakeDeliverBoardJob,
finshIssueJob, finshIssueJob,
issueBalances issueBalances
} from '@/api/index.js'; } from '@/api/index.js';
@ -127,14 +104,15 @@
goHome, goHome,
compareDesc, compareDesc,
compareStr, compareStr,
getCurrDateTime getCurrDateTime,
navigateBack
} from '@/common/basic.js'; } from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' import winScanByContainer from '@/mycomponents/wincom/winScanByContainer.vue'
import comBalance from '@/mycomponents/common/comBalance.vue' import comBalance from '@/mycomponents/common/comBalance.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' import comDeliverBoardDetail from '@/mycomponents/coms/comDeliverBoardDetail.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import comUnPacking from '@/mycomponents/coms/comUnPacking.vue' import comUnPacking from '@/mycomponents/coms/comUnPacking.vue'
@ -142,10 +120,10 @@
components: { components: {
comMessage, comMessage,
winScanButton, winScanButton,
winMulitScan, winScanByContainer,
comBalance, comBalance,
comJobScanDetail, comJobScanDetail,
winScanByPack, comDeliverBoardDetail,
comNumberBox, comNumberBox,
comUnPacking comUnPacking
}, },
@ -163,28 +141,14 @@
balancesItem: null, balancesItem: null,
currentItem: null, currentItem: null,
received: false, received: false,
currentScanLebel: null,
allCount: 0, allCount: 0,
scanCount: 0, scanCount: 0,
byFIFO: false, jobStatus: ""
isPack: true,
titleArray: ['箱标签'],
}
},
filters: {
statusStyle: function(val) {
return getJobStatuStyle(val);
},
statusColor: function(val) {
return getJobStatuDesc(val);
} }
}, },
props: {
itemCode: "",
},
onLoad(param) { onLoad(param) {
this.id = param.id; this.id = param.id;
this.byFIFO = param.isByFIFO === 'true' ? true : false;
if (param.jobStatus == 1) { if (param.jobStatus == 1) {
this.receive((callback => { this.receive((callback => {
this.received = true; this.received = true;
@ -194,36 +158,32 @@
this.getDetail(); this.getDetail();
} }
}, },
onReady() {
// if (this.byFIFO) {
// uni.setNavigationBarTitle({
// title: ''
// })
// } else {
// uni.setNavigationBarTitle({
// title: 'FIFO'
// })
// }
},
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
}else if(e.index === 1){ } else if (e.index === 1) {
window.location.reload(); window.location.reload();
} }
}, },
//
onBackPress(e) { onBackPress(e) {
if (this.received) { //
if (e.from == 'backbutton') {
if (this.jobStatus == 2) {
// //
cancelTakeIssueJob(this.id) cancelTakeDeliverBoardJob(this.id).then(res => {
.then(res => {}) uni.navigateBack();
.catch(err => { }).catch(error => {
this.showMessage(err.message); uni.navigateBack();
}); })
} else {
uni.navigateBack();
}
return true;
} }
}, },
mounted() { mounted() {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#ffffff', frontColor: '#ffffff',
@ -232,10 +192,6 @@
}, },
methods: { methods: {
openScanPopup() { openScanPopup() {
// if (this.allCount === this.scanCount) {
// this.showMessage("");
// return;
// }
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();
}, },
// //
@ -251,11 +207,13 @@
let params = { let params = {
id: that.id, id: that.id,
}; };
getIssueDetail(params) getDeliverJobDetail(params)
.then(item => { .then(item => {
console.log('item', item); console.log('item', item);
that.datacontent = item; that.datacontent = item;
that.details = item.details; that.details = item.details;
that.details[0].recommendContainerCode = "C19"
that.jobStatus = item.jobStatus
if (that.details != null) { if (that.details != null) {
that.details.forEach( that.details.forEach(
r => { r => {
@ -282,280 +240,32 @@
getScanResult(result) { getScanResult(result) {
// //
let item = this.details.find(r => r.recommendPackingCode === result.data.packingCode && r let item = this.details.find(r => r.recommendContainerCode == result.containerCode);
.scanPackingCode != result.data.packingCode); if (item == undefined) {
if (item != undefined && item.scaned) { this.showMessage("器具码【" + result.containerCode + "】不在列表中")
showConfirmMsg('扫描的箱码【' + result.data.packingCode + '】匹配到任务中的【' + item.scanPackingCode +
'】箱,是否要重新匹配任务中的【' + item.scanPackingCode + '】箱?',
confirm => {
if (confirm) {
this.handledPackCode(result, true);
} else { } else {
return; if (item.scaned) {
} this.showMessage("器具码【" + result.containerCode + "】已经扫描")
})
} else { } else {
if (this.allCount === this.scanCount) { if (this.allCount == this.scanCount) {
this.showMessage("零件已经全部扫描完成"); this.showMessage("零件已经全部扫描完成");
return; return;
} }
this.handledPackCode(result, false); item.containerCode = result.containerCode;
}
this.scrollToTop();
},
//
//scaned
handledPackCode(result, scaned) {
//
let that = this;
that.currentScanLebel = result;
let scanItem = this.details.find(r => r.scanItemCode === that.currentScanLebel.data.itemCode &&
r.scanPackingCode === that.currentScanLebel.data.packingCode &&
r.scanLot === that.currentScanLebel.data.lot &&
r.scaned == true)
if (scanItem != undefined) {
this.showScanMessage('箱码【' + that.currentScanLebel.data.packingCode + '】已经扫描,请扫描下一箱零件');
} else {
this.dyIssue(result, scaned);
}
},
dyIssue(result, scaned) {
let that = this;
var itemCode = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.scaned === scaned
})
if (itemCode == undefined) {
that.showScanMessage('所扫描的箱码【' + result.data.code + '】对应的物料【' + result.data.itemCode + '】不在任务中');
}else {
//
var itemCode1 = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.recommendPackingCode === result.data.code
r.scaned === scaned
})
//
if(itemCode1 == undefined){
var itemCode2 = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.recommendLot === result.data.lot
&&r.scaned === scaned
})
//
if(itemCode2==undefined){
//
console.log("零件号相同、箱码不相同、批次不相同")
setTimeout(res => {
showConfirmMsg(itemCode.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => {
if (confirm) {
that.currentItem = itemCode;
that.afterScanPackLabel(result);
} else {
that.scanPopupGetFocus();
}
});
}, 100)
}else {
console.log("零件号相同、箱码不相同、批次相同")
//
that.currentItem = itemCode2;
that.afterScanPackLabel(result);
}
}else {
//
var itemCode3 = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.recommendPackingCode === result.data.code&&
r.recommendLot === result.data.lot
&&r.scaned === scaned
})
if(itemCode3==undefined){
//
console.log("零件号相同、箱码相同、批次不同")
setTimeout(res => {
showConfirmMsg(itemCode1.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => {
if (confirm) {
that.currentItem = itemCode1;
that.afterScanPackLabel(result);
} else {
that.scanPopupGetFocus();
}
});
}, 100)
}else {
console.log("零件号相同、箱码相同、批次相同")
//
that.currentItem = itemCode3;
that.afterScanPackLabel(result);
}
}
}
// that.currentItem = that.details.find(r => {
// return r.itemCode === result.data.itemCode &&
// r.recommendPackingCode === result.data.code &&
// r.recommendLot === result.data.lot &&
// r.scaned === scaned
// });
// //
// if (that.currentItem === undefined) {
// var itemCode = that.details.find(res => {
// return res.itemCode === result.data.itemCode &&
// res.scaned === scaned
// })
// //
// if (itemCode != undefined) {
// var lot = that.details.find(res => {
// return res.itemCode === result.data.itemCode &&
// res.recommendLot === result.data.lot &&
// res.scaned === scaned
// })
// if (lot != undefined) {
// //
// that.currentItem = lot;
// that.afterScanPackLabel(result);
// } else {
// //
// //
// setTimeout(res => {
// showConfirmMsg(',?', confirm => {
// if (confirm) {
// that.currentItem = itemCode;
// that.afterScanPackLabel(result);
// } else {
// that.scanPopupGetFocus();
// }
// });
// }, 100)
// }
// } else {
// //
// var lot = that.details.find(res => {
// return res.recommendLot === result.data.lot &&
// res.scaned === scaned
// })
// //
// if (lot != undefined) {
// //
// that.showScanMessage('');
// } else {
// //,
// that.showScanMessage('');
// }
// }
// } else {
// that.afterScanPackLabel(result);
// }
},
afterScanPackLabel(result) {
let that = this;
that.getBalance(result, res => {
if (res.totalCount === 1) {
that.balancesItem = res.items[0];
if (that.balancesItem != null || that.balancesItem != undefined) {
that.setBalanceInfo(this.currentItem, that.balancesItem);
that.scanPopupGetFocus();
}
} else {
this.$refs['issueitems'].openPopup(res.items);
}
});
},
//
getBalance(result, callback) {
uni.showLoading({
title: '扫描中...',
mask: true
})
let params = {
pageSize: 1000,
pageIndex: 1,
packingCode: result.data.code,
itemCode: result.data.itemCode,
lot: result.data.lot,
inventoryStatus: 2, //2
locationTypes: [2, 3],
sortBy: 'PackingCode asc'
};
issueBalances(params)
.then(res => {
if (res.totalCount === 0) {
this.showScanMessage('按零件号【' + result.data.itemCode + '】箱码【' + result.data.code + '】批次【' +
result
.data.lot + '】在【原料库、半成品库】未查询到库存信息');
} else {
callback(res);
}
uni.hideLoading();
})
.catch(err => {
this.showScanMessage(err.message);
uni.hideLoading();
});
},
setBalanceInfo(item, balanceItem) {
item.scaned = true; item.scaned = true;
item.scanDate = new Date() // item.handleQty = 10;
item.fromLocationCode = balanceItem.locationCode; this.calcScanCount()
item.fromLocationErpCode = balanceItem.locationErpCode;
item.toLocationCode = item.locationCode;
item.toLocationErpCode = item.locationErpCode;
//
item.handledContainerCode = balanceItem.containerCode;
item.handledPackingCode = balanceItem.packingCode;
item.handledBatch = balanceItem.batch;
item.handledLot = balanceItem.lot;
item.defaultHandleQty = balanceItem.qty;
item.handledQty = balanceItem.qty;
item.handledFromLocationCode = balanceItem.locationCode;
item.handledFromLocationArea = balanceItem.locationArea;
item.handledFromLocationGroup = balanceItem.locationErpCode;
item.handledFromLocationErpCode = balanceItem.locationGroup;
item.handledFromWarehouseCode = balanceItem.warehouseCode;
item.toLocationArea = balanceItem.locationArea;
item.toLocationGroup = balanceItem.locationGroup;
item.toLocationErpCode = balanceItem.locationErpCode;
//
item.scanItemCode = this.currentScanLebel.data.itemCode;
item.scanPackingCode = this.currentScanLebel.data.code;
item.scanLot = this.currentScanLebel.data.lot;
item.worker = localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN;
item.uom = balanceItem.uom;
this.details.sort(compareDesc('scanDate')); //
this.calcScanCount(); //
this.$forceUpdate(); this.$forceUpdate();
}
}
}, },
selectedBalanceItem(balanceItem) {
this.setBalanceInfo(this.currentItem, balanceItem);
},
// // // //
receive(callback) { receive(callback) {
let params = { let params = {
id: this.id id: this.id
}; };
takeIssueJob(params) takeDeliverBoardJob(params)
.then(res => { .then(res => {
callback(true); callback(true);
}) })
@ -564,125 +274,45 @@
callback(false); callback(false);
}); });
}, },
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.closeScanPopup();
},
submit() { submit() {
let that = this; this.calcScanCount()
if (that.datacontent.details.length === 0) { if (this.scanCount != this.allCount) {
this.showMessage('该任务没有要上架的零件'); this.showMessage('当前扫描数量【'+this.scanCount+"】,总数量为【"+this.allCount+"】,未全部扫描");
return; return;
} }
let checkItems = that.details.filter(r => r.scaned === true);
if (checkItems.length < that.details.length) {
showConfirmMsg('还有未扫描的零件,是否继续发料', confirm => {
if (confirm) {
that.finsh();
}
});
} else {
that.finsh();
}
},
handleLocation() {
let that = this;
if (that.details[0].requestLocationCode != that.toLocation) {
showConfirmMsg('目标库位【' + that.toLocation + '】与需求库位不一致,是否要将以上零件发到目标库位?', confirm => {
if (confirm) {
that.handledPackingCode();
} else {
that.clearScanLocation();
}
});
} else {
showConfirmMsg('是否要将以上零件发到目标库位:【' + that.toLocation + "】", confirm => {
if (confirm) {
that.handledPackingCode();
} else {
that.clearScanLocation();
}
});
}
},
//
handledPackingCode() {
let that = this;
let items = this.details.filter(r => {
return r.scaned && (r.handledPackingCode === null || r.handledPackingCode === '')
})
if (items.length > 0) {
let packingCodes = '';
items.forEach(r => {
packingCodes += r.recommendPackingCode + ','
})
showConfirmMsg('以下箱码对应的实际箱码为空,是否要继续发料?【' + packingCodes + "】", confirm => {
if (confirm) {
that.finsh();
} else {
that.clearScanLocation();
}
});
} else {
that.finsh();
}
},
finsh() {
let that = this;
uni.showLoading({ uni.showLoading({
title: "提交中...", title: "提交中...",
mask: true mask: true
}); });
that.datacontent.completeUserId = localStorage.getItem('userId') let params = that.datacontent;
that.datacontent.completeUserName = localStorage.getItem('userName_CN') // finshIssueJob(that.id, params)
that.datacontent.completeTime = getCurrDateTime(); // .then(res => {
that.datacontent.worker = localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN; // uni.hideLoading();
that.datacontent.details = that.details; // if (res != null) {
let params = JSON.stringify(that.datacontent); // that.showCommitSuccessMessage();
finshIssueJob(that.id, params) // that.backJobList();
.then(res => { // }
uni.hideLoading(); // })
if (res != null) { // .catch(err => {
that.showCommitSuccessMessage(); // that.showMessage(err.message);
that.backJobList(1000); // uni.hideLoading();
} // });
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
}, },
// //
backJobList(delay) { backJobList() {
if (this.byFIFO) { navigateBack(1)
setTimeout(() => {
uni.navigateTo({
url: './issueByFIFO'
})
}, 1000)
} else {
setTimeout(() => {
uni.navigateTo({
url: './issueNoFIFO'
})
}, 1000)
}
}, },
clear() { clear() {
this.scanCount = 0; this.scanCount = 0;
this.currentItem = null;
this.currentScanLebel = null;
this.getDetail(); this.getDetail();
}, },
clearScanLocation() {
this.currentItem = null;
},
unPacking(item) {
this.$refs.comUnPacking.openPopup3(item,item.handledQty,item.recommendQty,false);
},
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message); this.$refs.comMessage.showMessage(message);
}, },
@ -744,14 +374,10 @@
qtyChanged(value, item, index) { qtyChanged(value, item, index) {
if (value <= 0) { if (value <= 0) {
this.showMessage('发料数量不能小于或等于0') this.showMessage('发料数量不能小于或等于0')
item.handledQty = item.defaultHandleQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
} else if (value > item.defaultHandleQty) {
item.handledQty = item.defaultHandleQty
this.showMessage('发料数量不能大于库存数量:' + item.handledQty)
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
} }
}, },
} }
} }
</script> </script>

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

@ -103,7 +103,6 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack> <win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<comUnPacking ref='comUnPacking' <comUnPacking ref='comUnPacking'
@getvalue="getUnPackingCount" title="拆箱"> @getvalue="getUnPackingCount" title="拆箱">
</comUnPacking> </comUnPacking>
@ -681,7 +680,7 @@
this.currentItem = null; this.currentItem = null;
}, },
unPacking(item) { unPacking(item) {
this.$refs.comUnPacking.openPopup3(item,item.handledQty,item.recommendQty,false); this.$refs.comUnPacking.openPopup3(this.datacontent, item,item.handledQty,item.recommendQty,false);
}, },
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message); this.$refs.comMessage.showMessage(message);

7
fe/PDA/pages/task/receipt_detail.vue

@ -50,13 +50,10 @@
<image class="icon_normal fl" src="@/static/icons_ui/icon_take_photo.svg"></image> <image class="icon_normal fl" src="@/static/icons_ui/icon_take_photo.svg"></image>
<text class="fl" style="text-align: center;" >拍照</text> <text class="fl" style="text-align: center;" >拍照</text>
</view> </view>
<view v-if="item.purchaseReceiptInspectStatus>1" class="fr"> <view class="fr">
<button class="btn_single" hover-class="btn_single_after" @click="unPacking(item)">拆箱</button> <button class="btn_single" hover-class="btn_single_after" @click="unPacking(item)">拆箱</button>
</view> </view>
<!-- <view class="photo_btn fr" style="margin:0 20rpx 20rpx; font-size:38rpx;"
@click="unPacking(item)">
拆箱
</view> -->
</view> </view>
<view v-if="item.purchaseReceiptInspectStatus>1" <view v-if="item.purchaseReceiptInspectStatus>1"
:class="item.purchaseReceiptInspectStatus==2?'choose_marked':'choose_marked_faild'"> :class="item.purchaseReceiptInspectStatus==2?'choose_marked':'choose_marked_faild'">

Loading…
Cancel
Save