Browse Source

非生产领料

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

4
fe/PDA/pages.json

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

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

@ -12,77 +12,79 @@
</view>
<scroll-view :scroll-top="scrollTop" scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower"
@scroll="scroll" class="scroll-detail">
<view class="detail-list margin_top" v-for="(item, index) in facDetails" :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 desc_ljh">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view>
</view>
<view class="list_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;">
<uni-tr>
<uni-th width="50">数量</text></uni-th>
<uni-th width="0" align="center">
</uni-th>
<uni-th width="270" align="center">
<view
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="0" align="center">
</uni-th>
<uni-th width="270" align="center">
<view class="text_packingCode">
{{ item.handledPackingCode }}
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">批次</uni-th>
<uni-th width="0" align="center">
</uni-th>
<uni-th width="270" align="center">
<view class="text_black">{{item.handledLot }}</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="70">来源库位</uni-th>
<uni-th width="0" align="center">
</uni-th>
<uni-th width="270" align="center">
<view class="text_black">
{{ item.handledFromLocationCode }}
</view>
</uni-th>
</uni-tr>
</uni-table>
<view class="" style="margin-bottom:120rpx">
<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="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.itemCode }}</view>
<view class="ljh_left desc_ljh">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view>
</view>
<view class="list_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;">
<uni-tr>
<uni-th width="50">数量</text></uni-th>
<uni-th width="0" align="center">
</uni-th>
<uni-th width="270" align="center">
<view
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="0" align="center">
</uni-th>
<uni-th width="270" align="center">
<view class="text_packingCode">
{{ item.handledPackingCode }}
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">批次</uni-th>
<uni-th width="0" align="center">
</uni-th>
<uni-th width="270" align="center">
<view class="text_black">{{item.handledLot }}</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="70">来源库位</uni-th>
<uni-th width="0" align="center">
</uni-th>
<uni-th width="270" align="center">
<view class="text_black">
{{ item.handledFromLocationCode }}
</view>
</uni-th>
</uni-tr>
</uni-table>
</view>
</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>
<!-- <image src="@/static/image_marked.svg"></image> -->
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</scroll-view>
<view class="uni-flex uni-row new_btn_bot">
<button class="new_clear_btn btn_double" @click="clear()">清空</button>
@ -117,7 +119,8 @@
getCurrDateTimeAndT,
scanSuccessAudio,
scanFailedAudio,
guid
guid,
getRemoveOption
} from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
@ -142,8 +145,8 @@
return {
id: "",
datacontent: {},
details: [],
facDetails: [],
details: [], //
facDetails: [],//
toLocation: '',
scrollTop: 0,
old: {
@ -157,6 +160,8 @@
scanCount: 0,
isPack: true,
titleArray: ['箱标签'],
options:[],
recommendQty:0
}
},
@ -173,6 +178,7 @@
},
onLoad(param) {
this.id = param.id;
this.options = getRemoveOption();
if (param.jobStatus == 1) {
this.receive((callback => {
this.getDetail();
@ -215,6 +221,23 @@
})
},
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() {
// if (this.allCount === this.scanCount) {
// this.showMessage("");
@ -238,8 +261,10 @@
getUnProducePickDetail(params)
.then(item => {
that.datacontent = item;
that.details = item.details;
that.facDetails=item.facDetails
that.details = [];
uni.hideLoading();
})
.catch(err => {
this.showMessage('未查找到详细信息')
@ -248,18 +273,17 @@
},
showRecommend() {
this.$refs.recommendList.openScanPopup(this.details)
this.$refs.recommendList.openScanPopup(this.facDetails)
},
getScanResult(result) {
this.currentItem =result;
//
let item = this.details.find(r => r.itemCode == result.data.itemCode);
this.currentItem = result;
//ERP
let item = this.facDetails.find(r => r.itemCode == result.data.itemCode);
//
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) {
scanFailedAudio()
this.showMessage('扫描箱码[' + result.data.code + "]已经在列表中,请勿重复扫描")
@ -269,11 +293,18 @@
this.balancesItem = res.items[0];
if (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储位")
}else {
this.facDetails.push(addItem)
} else {
if(item.recommendPackingCode!= result.data.code){
showConfirmMsg("扫描的箱码[" + result.data.code+"]与任务中的箱码["+item.recommendPackingCode+"]不一致,是否添加到列表中",res=>{
if(res){
this.details.unshift(addItem)
}
})
}else {
this.details.unshift(addItem)
}
}
}
} else {
@ -285,7 +316,7 @@
} else {
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) {
var addItem = this.setItemInfo(this.currentItem, this.balancesItem)
if( item.recommendFromLocationErpCode !=addItem.handledFromLocationErpCode){
this.showMessage('扫描箱码[' + this.currentItem.data.code + "]的ERP储位与推荐的不在同一个ERP储位")
}else {
this.facDetails.push(addItem)
var addItem = this.setItemInfo(result, this.balancesItem)
if (item.recommendFromLocationErpCode != addItem.handledFromLocationErpCode) {
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 {
this.details.unshift(addItem)
}
}
},
@ -453,7 +453,23 @@
this.showMessage('扫描列表为0,请先扫描');
return;
}
this.finsh();
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();
}
},
@ -469,16 +485,14 @@
that.datacontent.completeTime = getCurrDateTime();
that.datacontent.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage
.userName_CN;
that.datacontent.facDetails = that.facDetails;
that.datacontent.details = that.details;
let params = JSON.stringify(that.datacontent);
console.log(params)
return
finshUnProducePickJob(that.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
that.showCommitSuccessMessage();
that.backJobList(1000);
}
})
.catch(err => {
@ -518,7 +532,7 @@
},
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.scanCount = this.facDetails.filter(r => r.scaned === true).length;
this.closeScanPopup();
},
@ -537,9 +551,6 @@
}
},
closeScanMessage() {
this.scanPopupGetFocus();
},
scanPopupGetFocus() {
this.$refs.scanPopup.getfocus();
@ -567,13 +578,14 @@
qtyChanged(value, item, index) {
if (value <= 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);
}
}
// else if (value > this.currentItem.data.qty) {
// item.handledQty = this.currentItem.data.qty
// this.showMessage("")
// this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
// }
},
}
}

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

@ -3,85 +3,79 @@
<page-meta root-font-size="16px"></page-meta>
<view class="">
<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>
</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"
class="scroll-detail">
<view class="" style="margin-bottom:120rpx">
<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="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.itemCode }}</view>
<view class="ljh_left desc_ljh">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view>
</view>
<view class="list_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;" empty-text="">
<uni-tr>
<uni-th width="50">数量</text></uni-th>
<uni-th width="0" align="center">
</uni-th>
<uni-th width="270" align="center">
<view
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="70">来源库位</uni-th>
<uni-th width="0" align="center">
</uni-th>
<uni-th width="270">
<view class=""
style="display: flex; width: 100%; align-items: center; justify-content: center;">
<view class="text_black">
{{ item.handledFromLocationCode }}
</view>
<view class="" style="margin-left: 20rpx;">
<button size="mini" type="primary"
@click="showLocation(item)">扫描库位</button>
</view>
</view>
<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 desc_ljh">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view>
</view>
<view class="list_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="100" align="center">推荐</uni-th>
<uni-th width="140" align="center">实际</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="70">来源库位</uni-th>
<uni-th width="100" align="center">
<view class="text_black">{{ item.recommendFromLocationCode }}</view>
</uni-th>
<uni-th width="140">
<view class="" v-if="item.scaned"
style="display: flex; width: 100%; align-items: center; justify-content: center;">
<view class="text_black">
{{ item.handledFromLocationCode }}
</view>
<view class="" style="margin-left: 20rpx;">
<button size="mini" type="primary"
@click="showLocation(item)">扫描库位</button>
</view>
</view>
</uni-th>
</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-th>
</uni-tr>
</uni-table>
</view>
</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>
<!-- <image src="@/static/image_marked.svg"></image> -->
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</scroll-view>
<view class="uni-flex uni-row new_btn_bot">
<button class="new_clear_btn btn_double" @click="clear()">清空</button>
@ -95,18 +89,19 @@
<winScanLocationCode ref="location" title="库位" @getLocation="getToLocation"></winScanLocationCode>
<win-scan-by-code ref="scanPopupItem" title='ERP料号' @getScanCode='getScanCode'>
</win-scan-by-code>
<recommendList ref="recommendList" title="推荐信息"></recommendList>
<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()'
@afterCloseScanMessage='closeScanMessage' @afterClose="closeScanMessage"></com-message>
@afterCloseScanMessage='closeScanMessage' @afterClose="closeScanMessage"></com-message>
</view>
</template>
<script>
import {
getUnProducePickDetail,
takeIssueJob,
cancelTakeIssueJob,
takeUnProduceIssueJob,
cancelTakeUnProduceIssueJob,
finshUnProducePickJob,
getitems,
getItemCodeByLike
@ -119,9 +114,12 @@
compareDesc,
compareStr,
getCurrDateTime,
getCurrDateTimeAndT,
navigateBack,
scanSuccessAudio,
scanFailedAudio
scanFailedAudio,
guid,
getRemoveOption
} from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
@ -135,6 +133,7 @@
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue';
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue'
import recommendList from '@/mycomponents/popup/recommendList.vue';
export default {
components: {
@ -149,7 +148,8 @@
comNumberBox,
winScanByProductCode,
winScanLocationCode,
winScanByCode
winScanByCode,
recommendList
},
data() {
return {
@ -168,7 +168,10 @@
names: [],
values: [],
origin: []
}
},
options: [],
facDetails: [],
currentData: null
}
},
filters: {
@ -184,14 +187,14 @@
},
onLoad(param) {
this.id = param.id;
// if (param.jobStatus == 1) {
// this.receive((callback => {
// this.getDetail();
// }));
// } else {
// this.getDetail();
// }
this.getDetail();
this.options = getRemoveOption();
if (param.jobStatus == 1) {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
},
onReady() {},
//
@ -205,7 +208,7 @@
//
onBackPress(e) {
//
// cancelTakeIssueJob(this.id)
// cancelTakeUnProduceIssueJob(this.id)
// .then(res => {})
// .catch(err => {
// this.showMessage(err.message);
@ -222,12 +225,11 @@
this.currentItem = item;
this.$refs.location.openScanPopup()
},
getToLocation(locationInfo) {
if (this.currentItem.recommendFromLocationCode != locationInfo.code) {
if (this.currentItem.originalLocationCode != locationInfo.code) {
scanFailedAudio()
this.showMessage("扫描库位[" + locationInfo.code + "]与推荐来源库位[" + this.currentItem
.recommendFromLocationCode + "]不一致")
.originalLocationCode + "]不一致")
return;
}
scanSuccessAudio()
@ -236,6 +238,29 @@
this.currentItem.handledFromLocationGroup = locationInfo.locationGroupCode
this.currentItem.handledFromLocationErpCode = locationInfo.erpLocationCode
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() {
@ -248,7 +273,7 @@
openItemScanPopup() {
this.$refs.scanPopupItem.openScanPopup();
},
queryItemCode(){
queryItemCode() {
this.$refs.wzSelectPopup.open({
mode: 'radio', //radio checkbox
// dataList:[], //dataList使proxyConfig
@ -265,23 +290,27 @@
value: 'code'
}
})
},
reqGetList(data) {
let params = {
pageSize: data.pageSize,
pageIndex: data.pageIndex,
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){
this.getScanResult(result,false)
showRecommend() {
this.$refs.recommendList.openScanPopup(this.facDetails)
},
//
getDetail() {
let that = this;
@ -300,21 +329,8 @@
uni.hideLoading();
console.log('item', item);
that.datacontent = item;
that.details = item.details;
if (that.details != null) {
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;
}
that.facDetails = item.facDetails
that.details = [];
})
.catch(err => {
uni.hideLoading();
@ -330,10 +346,10 @@
getitems(code).then((res) => {
uni.hideLoading();
if (res) {
var result ={
itemCode:res.code
var result = {
itemCode: res.code
}
this.getScanResult(result,false)
this.getScanResult(result, false)
} else {
scanFailedAudio()
this.showMessage('未查找到ERP料号【' + code + '】');
@ -345,52 +361,96 @@
},
getScanResult(result,isMesCode=true) {
getScanResult(result, isMesCode = true) {
// AH240321AM0153 AH240321AM0198 AH240321AM0199
let item = this.details.find(r => {
let item = this.facDetails.find(r => {
return r.itemCode == result.itemCode
});
if (item == undefined) {
if(isMesCode){
scanFailedAudio()
this.showMessage('在任务详情中,单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描');
}else {
this.showMessage('在任务详情中,没有找到ERP料号[' + result.itemCode+"]的信息,请重新扫描");
}
return;
}
if (item.scaned) {
if(isMesCode){
scanFailedAudio()
this.showMessage('单件码[' + result.scanCode + "]已经扫描")
}else {
this.showMessage('ERP料号[' + result.itemCode + "]已经扫描")
if (item) {
this.currentData = item;
let scanItem = this.details.find(r => r.itemCode === result.itemCode)
//
if (scanItem) {
if (isMesCode) {
this.showMessage('单件码[' + result.scanCode + "]已经扫描")
} else {
this.showMessage('ERP料号[' + result.itemCode + "]已经扫描")
}
} else {
scanSuccessAudio()
var addItem = this.setItemInfo(result, item)
this.details.unshift(addItem)
this.$forceUpdate()
}
} else {
scanSuccessAudio()
item.scaned = true;
item.scanDate = new Date()
this.details.sort(compareDesc('scanDate'));
item.handledQty = item.recommendQty;
this.calcScanCount()
this.$forceUpdate()
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) {
if (value == 0) {
this.showMessage('领料数量必须大于0')
item.handledQty = item.recommendQty
item.handledQty = this.currentData.recommendQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
return;
}
if (value > item.recommendQty) {
if (value > this.currentData.recommendQty) {
this.showMessage("实际领料数量不能大于申请数量")
this.$refs['comNumberBox_' + index][0].setValue(item.recommendQty);
this.$refs['comNumberBox_' + index][0].setValue(this.currentData.recommendQty);
return;
}
@ -401,7 +461,7 @@
let params = {
id: this.id
};
takeIssueJob(params)
takeUnProduceIssueJob(params)
.then(res => {
callback(true);
})
@ -412,17 +472,38 @@
},
submit() {
if (this.datacontent.details.length === 0) {
this.showMessage('该任务没有选择的零件');
if (this.details.length == 0) {
this.showMessage('扫描列表为0,请先扫描');
return;
}
let items = this.details.filter(r => {
return r.scaned && r.handledQty != 0 && r.handledFromLocationCode != null
var locationHint = ""
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 {
this.showMessage("还有未扫描的ERP物料或库位")
this.finsh();
}
},
@ -434,23 +515,6 @@
title: "提交中...",
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.completeUserName = localStorage.getItem('userName_CN')
that.datacontent.completeTime = getCurrDateTime();
@ -503,11 +567,6 @@
this.$refs.scanPopupItem.getfocus();
},
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.closeScanPopup();
},
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},

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

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

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

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

Loading…
Cancel
Save