Browse Source

非生产领料

pda_nev
李俊城 6 months ago
parent
commit
eaddb48660
  1. 4
      fe/PDA/pages.json
  2. 170
      fe/PDA/pages/task/unProducePickDetail.vue
  3. 321
      fe/PDA/pages/task/unProducePickWipDetail.vue
  4. 1
      fe/PDA/pages/task/unProduceReturnDetail.vue
  5. 53
      fe/PDA/pages/task/unProduceReturnWipDetail.vue

4
fe/PDA/pages.json

@ -556,7 +556,7 @@
"path": "pages/task/unProducePickDetail", "path": "pages/task/unProducePickDetail",
"style": { "style": {
"navigationBarTitleText": "非生产领料详情", "navigationBarTitleText": "非生产领料详情",
"enablePullDownRefresh": true "enablePullDownRefresh": false
} }
}, },
{ {
@ -570,7 +570,7 @@
"path": "pages/task/unProducePickWipDetail", "path": "pages/task/unProducePickWipDetail",
"style": { "style": {
"navigationBarTitleText": "非生产领料(线边)详情", "navigationBarTitleText": "非生产领料(线边)详情",
"enablePullDownRefresh": true "enablePullDownRefresh": false
} }
}, },

170
fe/PDA/pages/task/unProducePickDetail.vue

@ -12,8 +12,11 @@
</view> </view>
<scroll-view :scroll-top="scrollTop" scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" <scroll-view :scroll-top="scrollTop" scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower"
@scroll="scroll" class="scroll-detail"> @scroll="scroll" class="scroll-detail">
<view class="" style="margin-bottom:120rpx">
<view class="detail-list margin_top" v-for="(item, index) in facDetails" :key="item.id"> <view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id">
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" :auto-close="false"
@click="swipeClick($event,item,index)" style='background-color: #ffffff;'>
<view class="detail-content"> <view class="detail-content">
<view class="choose_main"> <view class="choose_main">
<view class="ljh_box"> <view class="ljh_box">
@ -33,8 +36,9 @@
<uni-th width="270" align="center"> <uni-th width="270" align="center">
<view <view
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> style="display: flex;flex-direction: row;justify-content:center;align-items: center;">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.handledQty" <com-number-box :ref="'comNumberBox_'+index"
:max="99999" :min="0" style='width: 100px;' v-model="item.handledQty" :max="99999" :min="0"
style='width: 100px;'
@change="qtyChanged($event,item,index)"> @change="qtyChanged($event,item,index)">
</com-number-box> </com-number-box>
<text class="text_black">({{item.uom}})</text> <text class="text_black">({{item.uom}})</text>
@ -72,17 +76,15 @@
</uni-table> </uni-table>
</view> </view>
</view> </view>
</view>
<view v-if="item.scaned" class="choose_marked_count"
style="background-color: #5FCB94; opacity: 0.65">
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;">
</view> </view>
<!-- <image src="@/static/image_marked.svg"></image> -->
</view> </view>
</uni-swipe-action-item>
</uni-swipe-action>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="uni-flex uni-row new_btn_bot"> <view class="uni-flex uni-row new_btn_bot">
<button class="new_clear_btn btn_double" @click="clear()">清空</button> <button class="new_clear_btn btn_double" @click="clear()">清空</button>
@ -117,7 +119,8 @@
getCurrDateTimeAndT, getCurrDateTimeAndT,
scanSuccessAudio, scanSuccessAudio,
scanFailedAudio, scanFailedAudio,
guid guid,
getRemoveOption
} 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'
@ -142,8 +145,8 @@
return { return {
id: "", id: "",
datacontent: {}, datacontent: {},
details: [], details: [], //
facDetails: [], facDetails: [],//
toLocation: '', toLocation: '',
scrollTop: 0, scrollTop: 0,
old: { old: {
@ -157,6 +160,8 @@
scanCount: 0, scanCount: 0,
isPack: true, isPack: true,
titleArray: ['箱标签'], titleArray: ['箱标签'],
options:[],
recommendQty:0
} }
}, },
@ -173,6 +178,7 @@
}, },
onLoad(param) { onLoad(param) {
this.id = param.id; this.id = param.id;
this.options = getRemoveOption();
if (param.jobStatus == 1) { if (param.jobStatus == 1) {
this.receive((callback => { this.receive((callback => {
this.getDetail(); this.getDetail();
@ -215,6 +221,23 @@
}) })
}, },
methods: { methods: {
swipeClick(e, item, index) {
let {
content
} = e;
if (content.text === '移除') {
uni.showModal({
title: '提示',
content: '是否移除选择的行?',
success: res => {
if (res.confirm) {
this.details.splice(index, 1)
}
}
});
}
},
openScanPopup() { openScanPopup() {
// if (this.allCount === this.scanCount) { // if (this.allCount === this.scanCount) {
// this.showMessage(""); // this.showMessage("");
@ -238,8 +261,10 @@
getUnProducePickDetail(params) getUnProducePickDetail(params)
.then(item => { .then(item => {
that.datacontent = item; that.datacontent = item;
that.details = item.details; that.facDetails=item.facDetails
that.details = [];
uni.hideLoading(); uni.hideLoading();
}) })
.catch(err => { .catch(err => {
this.showMessage('未查找到详细信息') this.showMessage('未查找到详细信息')
@ -248,18 +273,17 @@
}, },
showRecommend() { showRecommend() {
this.$refs.recommendList.openScanPopup(this.details) this.$refs.recommendList.openScanPopup(this.facDetails)
}, },
getScanResult(result) { getScanResult(result) {
this.currentItem =result; this.currentItem = result;
// //ERP
let item = this.details.find(r => r.itemCode == result.data.itemCode); let item = this.facDetails.find(r => r.itemCode == result.data.itemCode);
// //
if (item) { if (item) {
// //
let scanItem = this.facDetails.find(r => r.handledPackingCode == result.data.code); let scanItem = this.details.find(r => r.handledPackingCode == result.data.code);
if (scanItem) { if (scanItem) {
scanFailedAudio() scanFailedAudio()
this.showMessage('扫描箱码[' + result.data.code + "]已经在列表中,请勿重复扫描") this.showMessage('扫描箱码[' + result.data.code + "]已经在列表中,请勿重复扫描")
@ -269,11 +293,18 @@
this.balancesItem = res.items[0]; this.balancesItem = res.items[0];
if (this.balancesItem) { if (this.balancesItem) {
var addItem = this.setItemInfo(result, this.balancesItem) var addItem = this.setItemInfo(result, this.balancesItem)
if (item.recommendFromLocationErpCode != addItem.handledFromLocationErpCode) {
if( item.recommendFromLocationErpCode !=addItem.handledFromLocationErpCode){
this.showMessage('扫描箱码[' + result.data.code + "]的ERP储位与推荐的不在同一个ERP储位") this.showMessage('扫描箱码[' + result.data.code + "]的ERP储位与推荐的不在同一个ERP储位")
} else {
if(item.recommendPackingCode!= result.data.code){
showConfirmMsg("扫描的箱码[" + result.data.code+"]与任务中的箱码["+item.recommendPackingCode+"]不一致,是否添加到列表中",res=>{
if(res){
this.details.unshift(addItem)
}
})
}else { }else {
this.facDetails.push(addItem) this.details.unshift(addItem)
}
} }
} }
} else { } else {
@ -285,7 +316,7 @@
} else { } else {
scanFailedAudio() scanFailedAudio()
// //
this.showMessage('扫描的物料[' + result.data.itemCode + "]不在推荐任务列表中") this.showMessage('扫描的ERP料号[' + result.data.itemCode + "]不在推荐任务列表中")
} }
@ -384,52 +415,21 @@
}); });
}, },
setBalanceInfo(item, balanceItem) {
item.scaned = true;
item.scanDate = new Date() //
item.fromLocationCode = balanceItem.locationCode;
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.recommendQty ? item.recommendQty : balanceItem
.qty;
item.handledQty = balanceItem.qty > item.recommendQty ? item.recommendQty : balanceItem.qty;
item.handledFromLocationCode = balanceItem.locationCode;
item.handledFromLocationArea = balanceItem.locationArea;
item.handledFromLocationGroup = balanceItem.locationGroup;
item.handledFromLocationErpCode = balanceItem.locationErpCode;
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.$forceUpdate();
},
selectedBalanceItem(balanceItem) { selectedBalanceItem(balanceItem) {
var addItem = this.setItemInfo(this.currentItem, this.balancesItem) var addItem = this.setItemInfo(result, this.balancesItem)
if( item.recommendFromLocationErpCode !=addItem.handledFromLocationErpCode){ if (item.recommendFromLocationErpCode != addItem.handledFromLocationErpCode) {
this.showMessage('扫描箱码[' + this.currentItem.data.code + "]的ERP储位与推荐的不在同一个ERP储位") this.showMessage('扫描箱码[' + result.data.code + "]的ERP储位与推荐的不在同一个ERP储位")
} else {
if(item.recommendPackingCode!= result.data.code){
showConfirmMsg("扫描的箱码[" + result.data.code+"]与任务中的箱码["+item.recommendPackingCode+"]不一致,是否添加到列表中",res=>{
if(res){
this.details.unshift(addItem)
}
})
}else { }else {
this.facDetails.push(addItem) this.details.unshift(addItem)
}
} }
}, },
@ -453,7 +453,23 @@
this.showMessage('扫描列表为0,请先扫描'); this.showMessage('扫描列表为0,请先扫描');
return; return;
} }
var hint = ""
this.details.forEach(res => {
var temp = this.facDetails.find(fac => {
if (res.itemCode == fac.itemCode) {
return fac
}
})
if (temp && temp.recommendQty < res.handledQty) {
hint += "ERP料号[" + res.itemCode + "]箱码[" + res.handledPackingCode + "]扫描数量["+res.handledQty+"]大于推荐的数量["+temp.recommendQty+"]"
}
})
if (hint) {
this.showMessage(hint);
} else {
this.finsh(); this.finsh();
}
}, },
@ -469,16 +485,14 @@
that.datacontent.completeTime = getCurrDateTime(); that.datacontent.completeTime = getCurrDateTime();
that.datacontent.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage that.datacontent.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage
.userName_CN; .userName_CN;
that.datacontent.facDetails = that.facDetails; that.datacontent.details = that.details;
let params = JSON.stringify(that.datacontent); let params = JSON.stringify(that.datacontent);
console.log(params) console.log(params)
return
finshUnProducePickJob(that.id, params) finshUnProducePickJob(that.id, params)
.then(res => { .then(res => {
uni.hideLoading(); uni.hideLoading();
if (res != null) { if (res != null) {
that.showCommitSuccessMessage(); that.showCommitSuccessMessage();
that.backJobList(1000);
} }
}) })
.catch(err => { .catch(err => {
@ -518,7 +532,7 @@
}, },
calcScanCount() { calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length; this.scanCount = this.facDetails.filter(r => r.scaned === true).length;
this.closeScanPopup(); this.closeScanPopup();
}, },
@ -537,9 +551,6 @@
} }
}, },
closeScanMessage() {
this.scanPopupGetFocus();
},
scanPopupGetFocus() { scanPopupGetFocus() {
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus();
@ -567,13 +578,14 @@
qtyChanged(value, item, index) { qtyChanged(value, item, index) {
if (value <= 0) { if (value <= 0) {
this.showMessage('领料数量不能小于或等于0') this.showMessage('领料数量不能小于或等于0')
item.handledQty = item.defaultHandleQty item.handledQty = this.currentItem.data.qty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
} else if (value > item.defaultHandleQty) {
item.handledQty = item.defaultHandleQty
this.showMessage("实际领料数量不能大于申请数量")
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
} }
// else if (value > this.currentItem.data.qty) {
// item.handledQty = this.currentItem.data.qty
// this.showMessage("")
// this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
// }
}, },
} }
} }

321
fe/PDA/pages/task/unProducePickWipDetail.vue

@ -3,13 +3,20 @@
<page-meta root-font-size="16px"></page-meta> <page-meta root-font-size="16px"></page-meta>
<view class=""> <view class="">
<view class="top_card"> <view class="top_card">
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount"> <com-job-scan-detail :jobContent="datacontent" :isShowAllCountHint="false" :isShowScanHint="false"
:allCount="allCount" :scanCount="scanCount">
</com-job-scan-detail> </com-job-scan-detail>
</view> </view>
<view class="" style="margin-top: 20rpx; margin-left: 20rpx; margin-right: 20rpx;">
<button type="primary" @click="showRecommend"> 推荐信息</button>
</view>
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" <scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
class="scroll-detail"> class="scroll-detail">
<view class="" style="margin-bottom:120rpx">
<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">
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" :auto-close="false"
@click="swipeClick($event,item,index)" style='background-color: #ffffff;'>
<view class="detail-content"> <view class="detail-content">
<view class="choose_main"> <view class="choose_main">
<view class="ljh_box"> <view class="ljh_box">
@ -21,22 +28,29 @@
</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;" empty-text="">
<uni-tr> <uni-tr>
<!-- <uni-th width="90"></uni-th> <uni-th width="50">数量</text></uni-th>
<uni-th width="100" align="center">推荐</uni-th> <uni-th width="0" align="center">
<uni-th width="100" align="center">实际</uni-th> --> </uni-th>
<uni-th width="50"></uni-th> <uni-th width="270" align="center">
<uni-th width="100" align="center">推荐</uni-th> <view
<uni-th width="140" align="center">实际</uni-th> 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-tr> <uni-tr>
<uni-th width="70">来源库位</uni-th> <uni-th width="70">来源库位</uni-th>
<uni-th width="100" align="center"> <uni-th width="0" align="center">
<view class="text_black">{{ item.recommendFromLocationCode }}</view>
</uni-th> </uni-th>
<uni-th width="140"> <uni-th width="270">
<view class="" v-if="item.scaned" <view class=""
style="display: flex; width: 100%; align-items: center; justify-content: center;"> style="display: flex; width: 100%; align-items: center; justify-content: center;">
<view class="text_black"> <view class="text_black">
{{ item.handledFromLocationCode }} {{ item.handledFromLocationCode }}
@ -50,38 +64,18 @@
</uni-th> </uni-th>
</uni-tr> </uni-tr>
<uni-tr>
<uni-th width="50">数量</text></uni-th>
<uni-th width="100" align="center">
<text class="text_black">{{item.recommendQty}}</text>
<text class="text_black" v-if="item.uom!=''">({{item.uom}})</text>
</uni-th>
<uni-th width="140" 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" v-if="item.uom!=''">({{item.uom}})</text>
</view>
</uni-th>
</uni-tr>
</uni-table> </uni-table>
</view> </view>
</view> </view>
</view>
<view v-if="item.scaned" class="choose_marked_count"
style="background-color: #5FCB94; opacity: 0.65">
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;">
;
</view> </view>
<!-- <image src="@/static/image_marked.svg"></image> -->
</view> </view>
</uni-swipe-action-item>
</uni-swipe-action>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="uni-flex uni-row new_btn_bot"> <view class="uni-flex uni-row new_btn_bot">
<button class="new_clear_btn btn_double" @click="clear()">清空</button> <button class="new_clear_btn btn_double" @click="clear()">清空</button>
@ -95,6 +89,7 @@
<winScanLocationCode ref="location" title="库位" @getLocation="getToLocation"></winScanLocationCode> <winScanLocationCode ref="location" title="库位" @getLocation="getToLocation"></winScanLocationCode>
<win-scan-by-code ref="scanPopupItem" title='ERP料号' @getScanCode='getScanCode'> <win-scan-by-code ref="scanPopupItem" title='ERP料号' @getScanCode='getScanCode'>
</win-scan-by-code> </win-scan-by-code>
<recommendList ref="recommendList" title="推荐信息"></recommendList>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> <com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<wz-select-popup ref="wzSelectPopup" @select="selectCheckbox" /> <wz-select-popup ref="wzSelectPopup" @select="selectCheckbox" />
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()' <com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@ -105,8 +100,8 @@
<script> <script>
import { import {
getUnProducePickDetail, getUnProducePickDetail,
takeIssueJob, takeUnProduceIssueJob,
cancelTakeIssueJob, cancelTakeUnProduceIssueJob,
finshUnProducePickJob, finshUnProducePickJob,
getitems, getitems,
getItemCodeByLike getItemCodeByLike
@ -119,9 +114,12 @@
compareDesc, compareDesc,
compareStr, compareStr,
getCurrDateTime, getCurrDateTime,
getCurrDateTimeAndT,
navigateBack, navigateBack,
scanSuccessAudio, scanSuccessAudio,
scanFailedAudio scanFailedAudio,
guid,
getRemoveOption
} 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'
@ -135,6 +133,7 @@
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue' import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue'; import winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue';
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue' import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue'
import recommendList from '@/mycomponents/popup/recommendList.vue';
export default { export default {
components: { components: {
@ -149,7 +148,8 @@
comNumberBox, comNumberBox,
winScanByProductCode, winScanByProductCode,
winScanLocationCode, winScanLocationCode,
winScanByCode winScanByCode,
recommendList
}, },
data() { data() {
return { return {
@ -168,7 +168,10 @@
names: [], names: [],
values: [], values: [],
origin: [] origin: []
} },
options: [],
facDetails: [],
currentData: null
} }
}, },
filters: { filters: {
@ -184,14 +187,14 @@
}, },
onLoad(param) { onLoad(param) {
this.id = param.id; this.id = param.id;
// if (param.jobStatus == 1) { this.options = getRemoveOption();
// this.receive((callback => { if (param.jobStatus == 1) {
// this.getDetail(); this.receive((callback => {
// })); this.getDetail();
// } else { }));
// this.getDetail(); } else {
// }
this.getDetail(); this.getDetail();
}
}, },
onReady() {}, onReady() {},
// //
@ -205,7 +208,7 @@
// //
onBackPress(e) { onBackPress(e) {
// //
// cancelTakeIssueJob(this.id) // cancelTakeUnProduceIssueJob(this.id)
// .then(res => {}) // .then(res => {})
// .catch(err => { // .catch(err => {
// this.showMessage(err.message); // this.showMessage(err.message);
@ -222,12 +225,11 @@
this.currentItem = item; this.currentItem = item;
this.$refs.location.openScanPopup() this.$refs.location.openScanPopup()
}, },
getToLocation(locationInfo) { getToLocation(locationInfo) {
if (this.currentItem.recommendFromLocationCode != locationInfo.code) { if (this.currentItem.originalLocationCode != locationInfo.code) {
scanFailedAudio() scanFailedAudio()
this.showMessage("扫描库位[" + locationInfo.code + "]与推荐来源库位[" + this.currentItem this.showMessage("扫描库位[" + locationInfo.code + "]与推荐来源库位[" + this.currentItem
.recommendFromLocationCode + "]不一致") .originalLocationCode + "]不一致")
return; return;
} }
scanSuccessAudio() scanSuccessAudio()
@ -236,6 +238,29 @@
this.currentItem.handledFromLocationGroup = locationInfo.locationGroupCode this.currentItem.handledFromLocationGroup = locationInfo.locationGroupCode
this.currentItem.handledFromLocationErpCode = locationInfo.erpLocationCode this.currentItem.handledFromLocationErpCode = locationInfo.erpLocationCode
this.currentItem.handledFromWarehouseCode = locationInfo.warehouseCode this.currentItem.handledFromWarehouseCode = locationInfo.warehouseCode
this.currentItem.recommendFromLocationCode = locationInfo.code;
this.currentItem.recommendFromLocationArea = locationInfo.areaCode
this.currentItem.recommendFromLocationGroup = locationInfo.locationGroupCode
this.currentItem.recommendFromLocationErpCode = locationInfo.erpLocationCode
this.currentItem.recommendFromWarehouseCode = locationInfo.warehouseCode
this.$forceUpdate()
},
swipeClick(e, item, index) {
let {
content
} = e;
if (content.text === '移除') {
uni.showModal({
title: '提示',
content: '是否移除选择的行?',
success: res => {
if (res.confirm) {
this.details.splice(index, 1)
}
}
});
}
}, },
openScanPopup() { openScanPopup() {
@ -248,7 +273,7 @@
openItemScanPopup() { openItemScanPopup() {
this.$refs.scanPopupItem.openScanPopup(); this.$refs.scanPopupItem.openScanPopup();
}, },
queryItemCode(){ queryItemCode() {
this.$refs.wzSelectPopup.open({ this.$refs.wzSelectPopup.open({
mode: 'radio', //radio checkbox mode: 'radio', //radio checkbox
// dataList:[], //dataList使proxyConfig // dataList:[], //dataList使proxyConfig
@ -275,11 +300,15 @@
pageIndex: data.pageIndex, pageIndex: data.pageIndex,
itemCode: data.searchValue, itemCode: data.searchValue,
}; };
return getItemCodeByLike(data.searchValue,data.pageIndex,data.pageSize); return getItemCodeByLike(data.searchValue, data.pageIndex, data.pageSize);
},
selectCheckbox(mode, result) {
this.getScanResult(result, false)
}, },
selectCheckbox(mode, result){ showRecommend() {
this.getScanResult(result,false) this.$refs.recommendList.openScanPopup(this.facDetails)
}, },
// //
@ -300,21 +329,8 @@
uni.hideLoading(); uni.hideLoading();
console.log('item', item); console.log('item', item);
that.datacontent = item; that.datacontent = item;
that.details = item.details; that.facDetails = item.facDetails
if (that.details != null) { that.details = [];
that.details.forEach(
r => {
r.scaned = false;
r.scanDate = new Date()
}
);
that.ispending = item.jobStatus === 2;
// if (that.toLocation === '') {
// that.toLocation = item.details[0].requestLocationCode;
// }
this.allCount = that.details.length;
this.scanCount = 0;
}
}) })
.catch(err => { .catch(err => {
uni.hideLoading(); uni.hideLoading();
@ -330,10 +346,10 @@
getitems(code).then((res) => { getitems(code).then((res) => {
uni.hideLoading(); uni.hideLoading();
if (res) { if (res) {
var result ={ var result = {
itemCode:res.code itemCode: res.code
} }
this.getScanResult(result,false) this.getScanResult(result, false)
} else { } else {
scanFailedAudio() scanFailedAudio()
this.showMessage('未查找到ERP料号【' + code + '】'); this.showMessage('未查找到ERP料号【' + code + '】');
@ -345,52 +361,96 @@
}, },
getScanResult(result,isMesCode=true) { getScanResult(result, isMesCode = true) {
// AH240321AM0153 AH240321AM0198 AH240321AM0199 // AH240321AM0153 AH240321AM0198 AH240321AM0199
let item = this.details.find(r => { let item = this.facDetails.find(r => {
return r.itemCode == result.itemCode return r.itemCode == result.itemCode
}); });
if (item) {
if (item == undefined) { this.currentData = item;
if(isMesCode){ let scanItem = this.details.find(r => r.itemCode === result.itemCode)
scanFailedAudio() //
this.showMessage('在任务详情中,单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描'); if (scanItem) {
}else { if (isMesCode) {
this.showMessage('在任务详情中,没有找到ERP料号[' + result.itemCode+"]的信息,请重新扫描");
}
return;
}
if (item.scaned) {
if(isMesCode){
scanFailedAudio()
this.showMessage('单件码[' + result.scanCode + "]已经扫描") this.showMessage('单件码[' + result.scanCode + "]已经扫描")
}else { } else {
this.showMessage('ERP料号[' + result.itemCode + "]已经扫描") this.showMessage('ERP料号[' + result.itemCode + "]已经扫描")
} }
} else { } else {
scanSuccessAudio() scanSuccessAudio()
item.scaned = true; var addItem = this.setItemInfo(result, item)
item.scanDate = new Date() this.details.unshift(addItem)
this.details.sort(compareDesc('scanDate'));
item.handledQty = item.recommendQty;
this.calcScanCount()
this.$forceUpdate() this.$forceUpdate()
} }
} else {
if (isMesCode) {
this.showMessage('单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描');
} else {
this.showMessage('没有找到ERP料号[' + result.itemCode + "]的信息,请重新扫描");
}
}
},
setItemInfo(result, item) {
var item = {
id: guid(),
itemCode: item.itemCode,
itemName: item.itemName,
itemDesc1: item.itemDesc1,
itemDesc2: item.itemDesc2,
stdPackQty: item.stdPackQty,
masterID: this.datacontent.id,
recommendContainerCode: "",
recommendPackingCode: "",
recommendSupplierBatch: "",
recommendArriveDate: getCurrDateTimeAndT(),
recommendProduceDate: getCurrDateTimeAndT(),
recommendExpireDate: getCurrDateTimeAndT(),
recommendLot: "",
originalLocationCode: item.recommendFromLocationCode,
recommendQty: item.qty,
uom: item.uom,
handledContainerCode: "",
handledPackingCode: "",
handledSupplierBatch: "",
handledArriveDate: getCurrDateTimeAndT(),
handledProduceDate: getCurrDateTimeAndT(),
handledExpireDate: getCurrDateTimeAndT(),
handledLot: "",
handledQty: item.recommendQty,
creatorId: guid(),
creationTime: getCurrDateTimeAndT(),
tenantId: guid(),
lastModificationTime: getCurrDateTimeAndT(),
lastModifierId: guid(),
number: this.datacontent.number,
remark: "",
status: 2,
reasonCode: "",
caseCode: "",
projCapacityCode: "",
onceBusiCode: "",
explain: "",
}
return item;
}, },
qtyChanged(value, item, index) { qtyChanged(value, item, index) {
if (value == 0) { if (value == 0) {
this.showMessage('领料数量必须大于0') this.showMessage('领料数量必须大于0')
item.handledQty = item.recommendQty item.handledQty = this.currentData.recommendQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
return; return;
} }
if (value > item.recommendQty) { if (value > this.currentData.recommendQty) {
this.showMessage("实际领料数量不能大于申请数量") this.showMessage("实际领料数量不能大于申请数量")
this.$refs['comNumberBox_' + index][0].setValue(item.recommendQty); this.$refs['comNumberBox_' + index][0].setValue(this.currentData.recommendQty);
return; return;
} }
@ -401,7 +461,7 @@
let params = { let params = {
id: this.id id: this.id
}; };
takeIssueJob(params) takeUnProduceIssueJob(params)
.then(res => { .then(res => {
callback(true); callback(true);
}) })
@ -412,17 +472,38 @@
}, },
submit() { submit() {
if (this.datacontent.details.length === 0) { if (this.details.length == 0) {
this.showMessage('该任务没有选择的零件'); this.showMessage('扫描列表为0,请先扫描');
return; return;
} }
let items = this.details.filter(r => { var locationHint = ""
return r.scaned && r.handledQty != 0 && r.handledFromLocationCode != null this.details.forEach(res => {
if (!res.handledFromLocationCode) {
locationHint += "物料[" + res.itemCode + "]请扫描来源库位"
}
}) })
if (items.length == this.details.length) {
this.finsh(); if(locationHint){
this.showMessage(locationHint);
return
}
var hint = ""
this.details.forEach(res => {
var temp = this.facDetails.find(fac => {
if (res.itemCode == fac.itemCode) {
return fac
}
})
if (temp && temp.recommendQty < res.handledQty) {
hint += "物料[" + res.itemCode + "]箱码[" + res.handledPackingCode + "]扫描数量[" + res
.handledQty + "]大于推荐的数量[" + temp.recommendQty + "]"
}
})
if (hint) {
this.showMessage(hint);
} else { } else {
this.showMessage("还有未扫描的ERP物料或库位") this.finsh();
} }
}, },
@ -434,23 +515,6 @@
title: "提交中...", title: "提交中...",
mask: true mask: true
}); });
that.details.forEach(res => {
res.recommendContainerCode = ""
res.handledContainerCode = ""
res.recommendPackingCode = ""
res.handledPackingCode = ""
res.recommendSupplierBatch = ""
res.recommendArriveDate = res.recommendFromArriveDate
res.recommendProduceDate = res.recommendFromProduceDate
res.recommendExpireDate = res.recommendFromExpireDate
res.recommendLot = ""
res.handledSupplierBatch = ""
res.handledArriveDate = res.handledToArriveDate
res.handledProduceDate = res.handledToProduceDate
res.handledExpireDate = res.handledToExpireDate
res.handledLot = ""
})
that.datacontent.completeUserId = localStorage.getItem('userId') that.datacontent.completeUserId = localStorage.getItem('userId')
that.datacontent.completeUserName = localStorage.getItem('userName_CN') that.datacontent.completeUserName = localStorage.getItem('userName_CN')
that.datacontent.completeTime = getCurrDateTime(); that.datacontent.completeTime = getCurrDateTime();
@ -503,11 +567,6 @@
this.$refs.scanPopupItem.getfocus(); this.$refs.scanPopupItem.getfocus();
}, },
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.closeScanPopup();
},
showCommitSuccessMessage() { showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess(); this.$refs.comMessage.showCommitSuccess();
}, },

1
fe/PDA/pages/task/unProduceReturnDetail.vue

@ -475,7 +475,6 @@
uni.hideLoading(); uni.hideLoading();
if (res != null) { if (res != null) {
that.showCommitSuccessMessage(); that.showCommitSuccessMessage();
that.backJobList(1000);
} }
}) })
.catch(err => { .catch(err => {

53
fe/PDA/pages/task/unProduceReturnWipDetail.vue

@ -40,7 +40,7 @@
style='width: 100px;' style='width: 100px;'
@change="qtyChanged($event,item,index)"> @change="qtyChanged($event,item,index)">
</com-number-box> </com-number-box>
<text v-if="false" class="text_black">({{item.uom}})</text> <text class="text_black">({{item.uom}})</text>
</view> </view>
</uni-th> </uni-th>
</uni-tr> </uni-tr>
@ -282,6 +282,7 @@
console.log('item', item); console.log('item', item);
that.datacontent = item; that.datacontent = item;
that.jobStatus = item.jobStatus; that.jobStatus = item.jobStatus;
that.details=[]
that.scanCount = 0 that.scanCount = 0
that.locationInfo = null; that.locationInfo = null;
if (that.$refs.comCollapseLocation) { if (that.$refs.comCollapseLocation) {
@ -306,9 +307,7 @@
if (res.confirm) { if (res.confirm) {
this.details.splice(index, 1) this.details.splice(index, 1)
this.scanCount = 0; this.scanCount = 0;
var tempQty =Number(this.datacontent.qty)/Number(this.details.length)
this.details.forEach(res => { this.details.forEach(res => {
res.handledQty =tempQty
this.scanCount += res.handledQty this.scanCount += res.handledQty
}) })
} }
@ -326,7 +325,11 @@
uni.hideLoading(); uni.hideLoading();
if (res) { if (res) {
var result = { var result = {
itemCode: res.code itemCode: res.code,
itemName:res.name,
itemDesc1: res.desc1,
stdPackQty:res.stdPackQty,
uom:res.basicUom
} }
this.getScanResult(result, false) this.getScanResult(result, false)
} else { } else {
@ -343,9 +346,7 @@
getScanResult(result, isMesCode = true) { getScanResult(result, isMesCode = true) {
// AH240321AM0153 AH240321AM0198 AH240321AM0199 // AH240321AM0153 AH240321AM0198 AH240321AM0199
let item = this.details.find(r => {
return r.itemCode == result.itemCode
});
if (result.itemCode != this.datacontent.itemCode) { if (result.itemCode != this.datacontent.itemCode) {
if (isMesCode) { if (isMesCode) {
@ -360,7 +361,7 @@
// //
if (scanItem) { if (scanItem) {
if (isMesCode) { if (isMesCode) {
this.showMessage('单件码[' + result.scanCode + "]已经扫描") this.showMessage('单件码[' + result.scanCode + "]对应的ERP料号["+result.itemCode+"]已经扫描")
} else { } else {
this.showMessage('ERP料号[' + result.itemCode + "]已经扫描") this.showMessage('ERP料号[' + result.itemCode + "]已经扫描")
} }
@ -370,15 +371,14 @@
itemCode: result.itemCode, itemCode: result.itemCode,
itemName: this.datacontent.itemName, itemName: this.datacontent.itemName,
itemDesc1: this.datacontent.itemDesc1, itemDesc1: this.datacontent.itemDesc1,
handledQty: Number(this.datacontent.qty) handledQty: Number(this.datacontent.qty),
uom:result.uom
} }
this.setParam(addItem, result) this.setParam(addItem, result)
this.details.push(addItem) this.details.push(addItem)
var tempQty = Number(this.datacontent.qty) / Number(this.details.length)
this.scanCount = 0; this.scanCount = 0;
this.details.forEach(res => { this.details.forEach(res => {
res.handledQty = tempQty
this.scanCount += res.handledQty this.scanCount += res.handledQty
}) })
this.$forceUpdate() this.$forceUpdate()
@ -395,11 +395,11 @@
item.masterID = this.datacontent.id item.masterID = this.datacontent.id
item.number = this.datacontent.number item.number = this.datacontent.number
item.remark = "" item.remark = ""
item.itemName = result.itemName item.itemName = item.itemName
item.itemDesc1 = result.itemDesc1 item.itemDesc1 = item.itemDesc1
item.itemDesc2 = result.itemDesc2 item.itemDesc2 = item.itemDesc2
item.itemCode = result.itemCode item.itemCode = item.itemCode
item.stdPackQty = result.stdPackQty item.stdPackQty = item.stdPackQty
item.status = 2 item.status = 2
item.recommendContainerCode = "" item.recommendContainerCode = ""
item.recommendPackingCode = "" item.recommendPackingCode = ""
@ -414,7 +414,7 @@
item.recommendToLocationErpCode = "" item.recommendToLocationErpCode = ""
item.recommendToWarehouseCode = "" item.recommendToWarehouseCode = ""
item.recommendQty = item.handledQty item.recommendQty = item.handledQty
item.uom = result.uom item.uom = item.uom
item.handledContainerCode = "" item.handledContainerCode = ""
item.handledPackingCode = "" item.handledPackingCode = ""
@ -468,18 +468,27 @@
}, },
submit() { submit() {
if (this.details.length == 0) {
this.showMessage('扫描列表为0,请先扫描');
return;
}
if (!this.locationInfo) { if (!this.locationInfo) {
this.showMessage('请先扫描目标库位'); this.showMessage('请先扫描目标库位');
return; return;
} }
if (this.details.length == 0) {
showConfirmMsg("扫描数量为0,是否继续提交?", res => {
if (res) {
this.finsh(); this.finsh();
}
})
return;
}else {
if(this.scanCount>this.datacontent.qty){
this.showMessage('提交的数量大于扫描的数量,不可以提交');
}else {
this.finsh();
}
}
}, },
finsh() { finsh() {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({

Loading…
Cancel
Save