Browse Source

非生产退料

pda_nev
李俊城 7 months ago
parent
commit
4c416a665f
  1. 17
      fe/PDA/api/index.js
  2. 10
      fe/PDA/common/basic.js
  3. 105
      fe/PDA/mycomponents/comjob/comJobUnScanDetail.vue
  4. 3
      fe/PDA/mycomponents/common/comMessage.vue
  5. 40
      fe/PDA/mycomponents/coms/task/comUnProduce.vue
  6. 2
      fe/PDA/pages.json
  7. 3
      fe/PDA/pages/task/unProducePickDetail.vue
  8. 6
      fe/PDA/pages/task/unProduceReturn.vue
  9. 490
      fe/PDA/pages/task/unProduceReturnDetail.vue
  10. 2
      fe/PDA/pages/task/unProduceReturnWip.vue
  11. 397
      fe/PDA/pages/task/unProduceReturnWipDetail.vue

17
fe/PDA/api/index.js

@ -761,10 +761,23 @@ export const getUnProduceReturnDetail = (params) => request(
data: {}, data: {},
method: "get" method: "get"
}); });
//非生产退料 承接任务
export const takeUnProduceReturnJob = (params) => request(
devUrl + "/api/pda/job/unplanned-receipt/take/" + params.id, { //
data: {},
method: "post"
});
//非生产退料 取消承接任务
export const cancelTakeUnProduceReturnJob = (id) => request(
devUrl + "/api/pda/job/unplanned-receipt/cancel-take/" + id, { //
data: {},
method: "post"
});
//完成非生产退料任务 //完成非生产退料任务
export const finshUnProduceReturnJob = (id, params) => request( export const finshUnProduceReturnJob = (id,jobNumber,worker ,params) => request(
devUrl + "/api/pda/job/unplanned-receipt/finish/" + id, { // devUrl + "/api/pda/job/unplanned-receipt/finish/"+id+"?jobNumber="+jobNumber+"&worker="+worker, { //
data: params, data: params,
method: "post" method: "post"
}) })

10
fe/PDA/common/basic.js

@ -483,3 +483,13 @@ export function getIssueJobState(val) {
else if (val == 1) return 'Open' else if (val == 1) return 'Open'
else if (val == 2) return 'Wait' else if (val == 2) return 'Wait'
} }
const S4 = function() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
};
export function guid() {
return (S4() + S4() +'-' +S4() +'-' +S4() +'-' +S4() +'-' +S4() +S4() +S4()
);
}

105
fe/PDA/mycomponents/comjob/comJobUnScanDetail.vue

@ -0,0 +1,105 @@
<!-- 收货任务详情 -->
<template>
<view class="device-detail" style="padding-bottom: 0 !important;">
<com-job-top-info :jobContent="jobContent"></com-job-top-info>
<!-- <view class="ljh_box nopad">
<text class="state-style fl margin_xs_top" :class="jobContent.jobStatus | statusStyle">
{{ jobContent.jobStatus | statusColor }}
</text>
<text class="tit_ljh">{{ jobContent.number }}</text>
</view> -->
<view class="label_order">
<text >ERP储位</text>
<text style="font-weight: bold; color:black" >{{jobContent.fromErpLocationCode}}</text>
</view>
<view class="label_order">
<text >料号</text>
<text style="font-weight: bold; color:black" >{{jobContent.itemCode}}</text>
</view>
<view class="label_order">
<text >名称</text>
<text style="font-weight: bold; color:black" >{{jobContent.itemName}}</text>
</view>
<view class="label_order">
<text >描述1</text>
<text style="font-weight: bold; color:black" >{{jobContent.itemDesc1}}</text>
</view>
<view class="label_order">
<text >描述2</text>
<text style="font-weight: bold; color:black" >{{jobContent.itemDesc2}}</text>
</view>
<view class="label_order">
<text >需求数量</text>
<text style="font-weight: bold; color:black" >{{jobContent.qty}}</text>
</view>
<view class="label_order">
<text >扫描数量</text>
<text style="font-weight: bold; color:black" >{{scanCount}}</text>
</view>
</view>
</template>
<script>
import {
getJobStatuStyle,
getJobStatuDesc,
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue'
export default {
name: 'comJobScanDetail',
components: {
comJobTopInfo
},
props: {
jobContent: {
type: Object,
default: {}
},
allCount: {
type: Number,
default: 0
},
scanCount: {
type: Number,
default: 0
},
},
data() {
return {
};
},
filters: {
statusStyle: function(val) {
return getJobStatuStyle(val);
},
statusColor: function(val) {
return getJobStatuDesc(val);
}
},
mounted() {
},
methods: {
calcCount(a,b){
return calc.sub(a,b)
}
}
}
</script>
<style scoped lang="scss">
</style>

3
fe/PDA/mycomponents/common/comMessage.vue

@ -105,7 +105,10 @@
closeMessage() { closeMessage() {
this.confirmResult = false; this.confirmResult = false;
clearInterval(this.timer) //timer clearInterval(this.timer) //timer
if(this.$refs.popupMessage){
this.$refs.popupMessage.close(); this.$refs.popupMessage.close();
}
this.afterClose(); this.afterClose();
}, },

40
fe/PDA/mycomponents/coms/task/comUnProduce.vue

@ -9,18 +9,37 @@
</view> </view>
<view class="margin_xs_bottom" style="clear: both;"> <view class="margin_xs_bottom" style="clear: both;">
<view class="label_order"> <view class="label_order">
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> <!-- <image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image> -->
<text>单号</text>
<text v-if="fromType=='pick'">{{dataContent.unplannedIssueRequestNumber}}</text> <text style="font-weight: bold; color:black" v-if="fromType=='pick'">{{dataContent.unplannedIssueRequestNumber}}</text>
<!-- <text>申请单{{dataContent.materialRequestNumber}}</text> --> <!-- <text>申请单{{dataContent.materialRequestNumber}}</text> -->
<text v-else>{{dataContent.unplannedReceiptRequestNumber}}</text> <text style="font-weight: bold; color:black" v-else>{{dataContent.unplannedReceiptRequestNumber}}</text>
</view>
<view class="label_order">
<text >ERP储位</text>
<text style="font-weight: bold; color:black" >{{dataContent.fromErpLocationCode}}</text>
</view>
<view class="label_order">
<text >料号</text>
<text style="font-weight: bold; color:black" >{{dataContent.itemCode}}</text>
</view>
<view class="label_order">
<text >名称</text>
<text style="font-weight: bold; color:black" >{{dataContent.itemName}}</text>
</view>
<view class="label_order">
<text >描述1</text>
<text style="font-weight: bold; color:black" >{{dataContent.itemDesc1}}</text>
</view>
<view class="label_order">
<text >描述2</text>
<text style="font-weight: bold; color:black" >{{dataContent.itemDesc2}}</text>
</view> </view>
<!-- <view class="label_order">
<image class="icon_normal" src="@/static/icons_ui/icon_prod_line.svg"></image>
<text>{{dataContent.prodLine}}</text>
<text>生产线{{dataContent.prodLine}}</text>
</view> -->
</view> </view>
<view class="uni-flex uni-row receipt_bot"> <view class="uni-flex uni-row receipt_bot">
<view class="label_order"> <view class="label_order">
@ -29,6 +48,9 @@
<text <text
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text> class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text>
</view> </view>
<view class="">
{{dataContent.worker}}
</view>
</view> </view>
</view> </view>
</template> </template>

2
fe/PDA/pages.json

@ -588,7 +588,7 @@
"path": "pages/task/unProduceReturnDetail", "path": "pages/task/unProduceReturnDetail",
"style": { "style": {
"navigationBarTitleText": "非生产退料详情", "navigationBarTitleText": "非生产退料详情",
"enablePullDownRefresh": true "enablePullDownRefresh": false
} }
}, },

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

@ -308,6 +308,7 @@
dyIssue(result, scaned) { dyIssue(result, scaned) {
let that = this; let that = this;
result.data.lot ='20240717'
var itemCode = that.details.find(r => { var itemCode = that.details.find(r => {
return r.itemCode === result.data.itemCode && return r.itemCode === result.data.itemCode &&
r.scaned === scaned r.scaned === scaned
@ -574,6 +575,8 @@
.userName_CN; .userName_CN;
that.datacontent.details = that.details; that.datacontent.details = that.details;
let params = JSON.stringify(that.datacontent); let params = JSON.stringify(that.datacontent);
console.log(params)
return
finshUnProducePickJob(that.id, params) finshUnProducePickJob(that.id, params)
.then(res => { .then(res => {
uni.hideLoading(); uni.hideLoading();

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

@ -70,6 +70,10 @@
mounted() { mounted() {
}, },
onPullDownRefresh() {
this.getList('refresh');
},
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
@ -147,7 +151,7 @@
openDetail(item) { openDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: './unProduceReturnDetail?id=' + item.id url: './unProduceReturnDetail?id=' + item.id+ '&jobStatus=' + item.jobStatus
}); });
}, },

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

@ -3,13 +3,17 @@
<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"> <comJobUnScanDetail :jobContent="datacontent" :scanCount="scanCount">
</com-job-scan-detail> </comJobUnScanDetail>
</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 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">
@ -22,62 +26,40 @@
<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;">
<uni-tr>
<!-- <uni-th width="90"></uni-th>
<uni-th width="100" align="center">推荐</uni-th>
<uni-th width="100" align="center">实际</uni-th> -->
<uni-th width="50"></uni-th>
<uni-th width="120" align="center">推荐</uni-th>
<uni-th width="120" align="center">实际</uni-th>
</uni-tr>
<uni-tr> <uni-tr>
<uni-th width="50">数量</text></uni-th> <uni-th width="50">数量</text></uni-th>
<uni-th width="120" align="center"> <uni-th width="0" align="center">
<text class="text_black">{{item.recommendQty}}({{item.uom}})</text>
</uni-th> </uni-th>
<uni-th width="120" align="center"> <uni-th width="360" align="center">
<view v-if="item.scaned" <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 v-if="false" class="text_black">({{item.uom}})</text>
</view> </view>
</uni-th> </uni-th>
</uni-tr> </uni-tr>
<uni-tr> <uni-tr>
<uni-th width="50">箱码</uni-th> <uni-th width="50">箱码</uni-th>
<uni-th width="120" align="center"> <uni-th width="0" align="center">
<view class="text_packingCode">
{{ item.recommendPackingCode }}
</view>
</uni-th> </uni-th>
<uni-th width="120" align="center"> <uni-th width="360" align="center">
<view v-if="item.scaned" class="text_packingCode"> <view class="text_packingCode">
{{ item.handledPackingCode }} {{ item.handledPackingCode }}
</view> </view>
</uni-th> </uni-th>
</uni-tr> </uni-tr>
<uni-tr> <uni-tr>
<uni-th width="50">批次</uni-th> <uni-th width="50">批次</uni-th>
<uni-th width="120" align="center"> <uni-th width="0" align="center">
<view class="text_black">{{item.recommendLot }}</view>
</uni-th> </uni-th>
<uni-th width="120" align="center"> <uni-th width="360" align="center">
<view v-if="item.scaned" class="text_black">{{item.handledLot }}</view> <view class="text_black">{{item.handledLot }}</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="70">目标库位</uni-th>
<uni-th width="100" align="center">
<view class="text_black">{{ item.recommendToLocationCode }}</view>
</uni-th>
<uni-th width="100" align="center">
<view class="text_black" v-if="item.scaned">
{{ item.toLocationCode }}
</view>
</uni-th> </uni-th>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
@ -92,12 +74,20 @@
<!-- <image src="@/static/image_marked.svg"></image> --> <!-- <image src="@/static/image_marked.svg"></image> -->
</view> </view>
</view> </view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view> </view>
</scroll-view> </scroll-view>
<view class="uni-flex uni-row new_btn_bot"> <view class="new_bot_box">
<win-collapse-location ref='comCollapseLocation' @getLocationCode='getToLocation' @clear='clearLocation'>
</win-collapse-location>
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="clear()">清空</button> <button class="new_clear_btn btn_double" @click="clear()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button> <button class="new_save_btn btn_double" @click="submit()">提交</button>
</view> </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> <win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack>
@ -111,9 +101,10 @@
<script> <script>
import { import {
getUnProduceReturnDetail, getUnProduceReturnDetail,
takeIssueJob, takeUnProduceReturnJob,
cancelTakeIssueJob, cancelTakeUnProduceReturnJob,
finshUnProduceReturnJob, finshUnProduceReturnJob,
locations
} from '@/api/index.js'; } from '@/api/index.js';
import { import {
getJobStatuStyle, getJobStatuStyle,
@ -123,16 +114,20 @@
compareDesc, compareDesc,
compareStr, compareStr,
getCurrDateTime, getCurrDateTime,
getCurrDateTimeAndT,
scanSuccessAudio, scanSuccessAudio,
scanFailedAudio scanFailedAudio,
getRemoveOption,
guid
} 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 winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comBalance from '@/mycomponents/common/comBalance.vue' import comBalance from '@/mycomponents/common/comBalance.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue' import comJobUnScanDetail from '@/mycomponents/comjob/comJobUnScanDetail.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue' import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
export default { export default {
components: { components: {
@ -140,15 +135,16 @@
winScanButton, winScanButton,
winMulitScan, winMulitScan,
comBalance, comBalance,
comJobScanDetail, comJobUnScanDetail,
winScanByPack, winScanByPack,
comNumberBox comNumberBox,
winCollapseLocation
}, },
data() { data() {
return { return {
id: "", id: "",
datacontent: {}, datacontent: {},
details: {}, details: [],
toLocation: '', toLocation: '',
scrollTop: 0, scrollTop: 0,
old: { old: {
@ -162,6 +158,9 @@
scanCount: 0, scanCount: 0,
isPack: true, isPack: true,
titleArray: ['箱标签'], titleArray: ['箱标签'],
options: [],
locationInfo:null,
jobStatus: "",
} }
}, },
filters: { filters: {
@ -177,14 +176,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() {},
// //
@ -198,11 +197,19 @@
// //
onBackPress(e) { onBackPress(e) {
// //
// cancelTakeIssueJob(this.id) if (e.from == 'backbutton') {
// .then(res => {}) if (this.jobStatus == 2) {
// .catch(err => { //
// this.showMessage(err.message); cancelTakeUnProduceReturnJob(this.id).then(res => {
// }); uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
}, },
mounted() { mounted() {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
@ -220,6 +227,7 @@
}, },
// //
getDetail() { getDetail() {
let that = this; let that = this;
if (that.id == undefined) { if (that.id == undefined) {
return; return;
@ -235,180 +243,171 @@
.then(item => { .then(item => {
console.log('item', item); console.log('item', item);
that.datacontent = item; that.datacontent = item;
that.details = item.details; that.jobStatus = item.jobStatus;
if (that.details != null) { that.scanCount = 0
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;
}
uni.hideLoading(); uni.hideLoading();
}) })
.catch(err => { .catch(err => {
this.showMessage('未查找到详细信息') this.showMessage('未查找到详细信息')
uni.hideLoading(); uni.hideLoading();
}); });
}, },
getScanResult(result) { swipeClick(e, item, index) {
let {
let item = this.details.find(r => r.recommendPackingCode === result.data.packingCode && r content
.scanPackingCode != result.data.packingCode); } = e;
if (content.text === '移除') {
if (item != undefined && item.scaned) { uni.showModal({
scanFailedAudio() title: '提示',
showConfirmMsg('扫描的箱码【' + result.data.packingCode + '】匹配到任务中的【' + item.scanPackingCode + content: '是否移除选择的行?',
'】箱,是否要重新匹配任务中的【' + item.scanPackingCode + '】箱?', success: res => {
confirm => { if (res.confirm) {
if (confirm) { this.details.splice(index, 1)
this.handledPackCode(result, true); this.scanCount = 0;
} else { var tempQty =Number(this.datacontent.qty)/Number(this.details.length)
return; this.details.forEach(res => {
} res.handledQty =tempQty
this.scanCount += res.handledQty
}) })
} else {
if (this.allCount === this.scanCount) {
scanFailedAudio()
this.showMessage("零件已经全部扫描完成");
return;
} }
this.handledPackCode(result, false);
} }
this.scrollToTop(); });
}
// //
// let item = this.details.find(r => r.recommendPackingCode === result.data.packingCode && r
// .scanPackingCode != result.data.packingCode);
// if (item != undefined && item.scaned) {
// showConfirmMsg('' + result.data.packingCode + '' + item.scanPackingCode +
// ',' + item.scanPackingCode + '?',
// confirm => {
// if (confirm) {
// this.handledPackCode(result, true);
// } else {
// return;
// }
// })
// } else {
// if (this.allCount === this.scanCount) {
// this.showMessage("");
// return;
// }
// this.handledPackCode(result, false);
// }
// this.scrollToTop();
}, },
// getScanResult(result) {
//scaned
handledPackCode(result, scaned) { if (result.data.itemCode != this.datacontent.itemCode) {
// this.showScanMessage('扫描箱码【' + result.data.code + '】对应的物料\n【' + result.data.itemCode + '】与任务中的料号不一致');
let that = this; return
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 scanItem = this.details.find(r => r.itemCode === result.data.itemCode &&
let that = this; r.handledPackingCode === result.data.code)
var itemCode = that.details.find(r => {
return r.itemCode === result.data.itemCode && if (scanItem) {
r.scaned === scaned this.showScanMessage('箱码【' + result.data.code + '】已经扫描');
})
if (itemCode == undefined) {
that.showScanMessage('所扫描的箱码【' + result.data.code + '】对应的物料【' + result.data.itemCode + '】不在任务中');
} else { } else {
//ERP // if (this.scanCount == this.datacontent.qty) {
var itemCode1 = that.details.find(r => { // this.showMessage("")
return r.itemCode === result.data.itemCode && // return;
r.recommendPackingCode === result.data.code
r.scaned === scaned
})
//ERP
if (itemCode1 == undefined) {
var itemCode2 = that.details.find(r => {
return r.itemCode === result.data.itemCode &&
r.recommendLot === result.data.lot &&
r.scaned === scaned
})
//ERP
if (itemCode2 == undefined) {
//ERP
console.log("ERP料号相同、箱码不相同、批次不相同")
that.currentItem = itemCode;
that.afterScanPackLabel(result);
// setTimeout(res => {
// showConfirmMsg(itemCode.recommendPackingCode+',?', confirm => {
// if (confirm) {
// that.currentItem = itemCode;
// that.afterScanPackLabel(result);
// } else {
// that.scanPopupGetFocus();
// } // }
// });
// }, 100)
} else { var item = {
console.log("ERP料号相同、箱码不相同、批次相同") itemCode: result.data.itemCode,
//ERP handledPackingCode: result.data.code,
that.currentItem = itemCode2; handledLot: result.data.lot,
that.afterScanPackLabel(result); handledQty: Number(this.datacontent.qty)
} }
this.setParam(item,result)
this.details.push(item)
var tempQty =Number(this.datacontent.qty)/Number(this.details.length)
this.scanCount = 0;
} else { this.details.forEach(res => {
//ERP res.handledQty =tempQty
var itemCode3 = that.details.find(r => { this.scanCount += res.handledQty
return r.itemCode === result.data.itemCode &&
r.recommendPackingCode === result.data.code &&
r.recommendLot === result.data.lot &&
r.scaned === scaned
}) })
if (itemCode3 == undefined) { this.$forceUpdate()
//ERP }
console.log("ERP料号相同、箱码相同、批次不同")
that.currentItem = itemCode1;
that.afterScanPackLabel(result);
// setTimeout(res => {
// showConfirmMsg(itemCode1.recommendPackingCode+',?', confirm => {
// if (confirm) {
// that.currentItem = itemCode1;
// that.afterScanPackLabel(result);
// } else {
// that.scanPopupGetFocus();
// }
// });
// }, 100)
} else { },
console.log("ERP料号相同、箱码相同、批次相同")
//ERP getToLocation(code) {
that.currentItem = itemCode3; if (code == '') {
that.afterScanPackLabel(result); this.showMessage('目标库位不能为空');
return;
} }
uni.showLoading({
title: "扫描中",
mask: true
});
let that = this;
locations(code).then(res => {
if (res == null) {
scanFailedAudio()
that.showMessage('目标库位【' + code + '】不存在');
this.$refs.comCollapseLocation.clearLocation();
} else {
if (that.datacontent.fromErpLocationCode != res.erpLocationCode) {
scanFailedAudio()
that.showMessage('目标库位的ERP储位【' + res.erpLocationCode + '】与【' +
this.datacontent.fromErpLocationCode +
'】不是同一ERP储位,请重新扫描');
this.$refs.comCollapseLocation.clearLocation();
} else {
scanSuccessAudio()
this.locationInfo=res
} }
} }
uni.hideLoading();
}).catch(err => {
scanFailedAudio()
that.locationInfo = null;
that.showMessage(err.message);
uni.hideLoading();
})
},
clearLocation() {
this.locationInfo = null;
},
setParam(item, result) {
item.id = guid(),
item.creationTime = getCurrDateTimeAndT()
item.creatorId =guid()
item.lastModificationTime = getCurrDateTimeAndT()
item.lastModifierId = guid()
item.masterID = this.datacontent.id
item.number = this.datacontent.number
item.remark = ""
item.itemName = result.data.itemName
item.itemDesc1 = result.data.itemDesc1
item.itemDesc2 = result.data.itemDesc2
item.itemCode = result.data.itemCode
item.stdPackQty = result.data.stdPackQty
item.status = 2
item.recommendContainerCode = ""
item.recommendPackingCode = result.data.packingCode
item.recommendSupplierBatch = result.data.supplierBatch
item.recommendArriveDate = result.data.arriveDate
item.recommendProduceDate = result.data.produceDate
item.recommendExpireDate = result.data.expireDate
item.recommendLot = result.data.lot
item.recommendToLocationCode = ""
item.recommendToLocationArea = ""
item.recommendToLocationGroup = ""
item.recommendToLocationErpCode = ""
item.recommendToWarehouseCode = ""
item.recommendQty = item.handledQty
item.uom = result.data.uom
item.handledContainerCode = result.data.containerCode
item.handledPackingCode = result.data.packingCode
item.handledSupplierBatch = result.data.supplierBatch
item.handledArriveDate = result.data.arriveDate
item.handledProduceDate = result.data.produceDate
item.handledExpireDate = result.data.expireDate
item.handledLot = result.data.lot
item.handledToLocationCode = ""
item.handledToLocationArea = ""
item.handledToLocationGroup = ""
item.handledToLocationErpCode = ""
item.handledToWarehouseCode = ""
item.handledQty = item.handledQty
item.extraProperties= {
additionalProp1: "",
additionalProp2: "",
additionalProp3: ""
}
}, },
setParams(item, result) { setParams(item, result) {
item.scaned = true; item.scaned = true;
item.scanDate = new Date() // item.scanDate = new Date() //
@ -423,8 +422,8 @@
item.handledBatch = result.data.batch; item.handledBatch = result.data.batch;
item.handledLot = result.data.lot; item.handledLot = result.data.lot;
item.defaultHandleQty = result.data.qty>item.recommendQty?item.recommendQty:result.data.qty; item.defaultHandleQty = result.data.qty > item.recommendQty ? item.recommendQty : result.data.qty;
item.handledQty = result.data.qty>item.recommendQty?item.recommendQty:result.data.qty; item.handledQty = result.data.qty > item.recommendQty ? item.recommendQty : result.data.qty;
item.handledFromLocationCode = ""; item.handledFromLocationCode = "";
item.handledFromLocationArea = ""; item.handledFromLocationArea = "";
item.handledFromLocationGroup = ""; item.handledFromLocationGroup = "";
@ -470,7 +469,7 @@
let params = { let params = {
id: this.id id: this.id
}; };
takeIssueJob(params) takeUnProduceReturnJob(params)
.then(res => { .then(res => {
callback(true); callback(true);
}) })
@ -481,46 +480,18 @@
}, },
submit() { submit() {
let that = this;
if (that.datacontent.details.length === 0) { if (this.details.length == 0) {
this.showMessage('该任务没有选择的零件'); this.showMessage('扫描列表为0,请先扫描');
return; return;
} }
let checkItems = that.details.filter(r => r.scaned === true); if (!this.locationInfo) {
if (checkItems.length < that.details.length) { this.showMessage('请先扫描目标库位');
showConfirmMsg('还有未扫描的零件,是否提交?', confirm => { return;
if (confirm) {
that.finsh();
}
});
} else {
that.finsh();
} }
this.finsh();
}, },
//
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() { finsh() {
let that = this; let that = this;
@ -533,10 +504,22 @@
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.details.forEach(res => {
res.recommendToLocationCode = this.locationInfo.code
res.recommendToLocationArea = this.locationInfo.areaCode
res.recommendToLocationGroup = this.locationInfo.locationGroupCode
res.recommendToLocationErpCode = this.locationInfo.erpLocationCode
res.handledToLocationCode =this.locationInfo.code
res.handledToLocationArea=this.locationInfo.areaCode
res.handledToLocationGroup =this.locationInfo.locationGroupCode
res.handledToLocationErpCode =this.locationInfo.erpLocationCode
})
that.datacontent.details = that.details; that.datacontent.details = that.details;
let params = JSON.stringify(that.datacontent); let params = JSON.stringify(that.details);
console.log("提交", params) console.log("提交", params)
finshUnProduceReturnJob(that.id, params) finshUnProduceReturnJob(that.id,this.datacontent.number,localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN, params)
.then(res => { .then(res => {
uni.hideLoading(); uni.hideLoading();
if (res != null) { if (res != null) {
@ -600,9 +583,6 @@
} }
}, },
closeScanMessage() {
this.scanPopupGetFocus();
},
scanPopupGetFocus() { scanPopupGetFocus() {
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus();
@ -630,12 +610,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 this.scanCount = this.datacontent.qty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); this.$refs['comNumberBox_' + index][0].setValue(this.scanCount);
} else if (value > item.defaultHandleQty) { } else if (value > this.datacontent.qty) {
item.handledQty = item.defaultHandleQty this.scanCount = this.datacontent.qty
this.showMessage("实际退料数量不能大于申请数量") this.showMessage("实际退料数量不能大于申请数量")
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); this.$refs['comNumberBox_' + index][0].setValue(this.scanCount);
}else {
this.scanCount=value;
} }
}, },
} }

2
fe/PDA/pages/task/unProduceReturnWip.vue

@ -147,7 +147,7 @@
openDetail(item) { openDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: './unProduceReturnWipDetail?id=' + item.id url: './unProduceReturnWipDetail?id=' + item.id+ '&jobStatus=' + item.jobStatus
}); });
}, },

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

@ -3,13 +3,17 @@
<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"> <comJobUnScanDetail :jobContent="datacontent" :scanCount="scanCount">
</com-job-scan-detail> </comJobUnScanDetail>
</view> </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,72 +25,43 @@
</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;" emptyText="">
<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="50">目标库位</uni-th>
<uni-th width="100" align="center">
<view class="text_black">{{ item.recommendToLocationCode }}</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.handledToLocationCode }}
</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-tr>
<uni-th width="50">数量</text></uni-th> <uni-th width="50">数量</text></uni-th>
<uni-th width="100" align="center"> <uni-th width="0" align="center">
<text class="text_black">{{item.recommendQty}}</text>
<text class="text_black" v-if="item.uom!=''">({{item.uom}})</text>
</uni-th> </uni-th>
<uni-th width="140" align="center"> <uni-th width="360" align="center">
<view v-if="item.scaned" <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"
:max="99999" :min="0" style='width: 100px;' <com-number-box :ref="'comNumberBox_'+index"
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" v-if="item.uom!=''">({{item.uom}})</text> <text v-if="false" class="text_black">({{item.uom}})</text>
</view> </view>
</uni-th> </uni-th>
</uni-tr> </uni-tr>
</uni-table> </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> </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="new_bot_box">
<win-collapse-location ref='comCollapseLocation' @getLocationCode='getToLocation' @clear='clearLocation'>
</win-collapse-location>
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="clear()">清空</button> <button class="new_clear_btn btn_double" @click="clear()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button> <button class="new_save_btn btn_double" @click="submit()">提交</button>
</view> </view>
</view>
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance> <com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance>
<win-scan-button @goScan='openScanPopup' title="单件码"></win-scan-button> <win-scan-button @goScan='openScanPopup' title="单件码"></win-scan-button>
<winScanButtonTop @goScan='openItemScanPopup' title="ERP料号"></winScanButtonTop> <winScanButtonTop @goScan='openItemScanPopup' title="ERP料号"></winScanButtonTop>
@ -105,11 +80,12 @@
<script> <script>
import { import {
getUnProduceReturnDetail, getUnProduceReturnDetail,
takeIssueJob, takeUnProduceReturnJob,
cancelTakeIssueJob, cancelTakeUnProduceReturnJob,
finshUnProduceReturnJob, finshUnProduceReturnJob,
getitems, getitems,
getItemCodeByLike getItemCodeByLike,
locations
} from '@/api/index.js'; } from '@/api/index.js';
import { import {
getJobStatuStyle, getJobStatuStyle,
@ -119,9 +95,12 @@
compareDesc, compareDesc,
compareStr, compareStr,
getCurrDateTime, getCurrDateTime,
getCurrDateTimeAndT,
navigateBack, navigateBack,
scanSuccessAudio, scanSuccessAudio,
scanFailedAudio scanFailedAudio,
getRemoveOption,
guid
} 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 +114,8 @@
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 comJobUnScanDetail from '@/mycomponents/comjob/comJobUnScanDetail.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
export default { export default {
components: { components: {
@ -149,13 +130,15 @@
comNumberBox, comNumberBox,
winScanByProductCode, winScanByProductCode,
winScanLocationCode, winScanLocationCode,
winScanByCode winScanByCode,
comJobUnScanDetail,
winCollapseLocation
}, },
data() { data() {
return { return {
id: "", id: "",
datacontent: {}, datacontent: {},
details: {}, details: [],
toLocation: '', toLocation: '',
ispending: false, ispending: false,
balancesItem: null, balancesItem: null,
@ -168,8 +151,13 @@
names: [], names: [],
values: [], values: [],
origin: [] origin: []
},
options: [],
locationInfo: null,
jobStatus: "",
} }
}
}, },
filters: { filters: {
statusStyle: function(val) { statusStyle: function(val) {
@ -184,14 +172,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 => {
// }));
// } else {
// this.getDetail();
// }
this.getDetail(); this.getDetail();
}));
} else {
this.getDetail();
}
}, },
onReady() {}, onReady() {},
// //
@ -205,11 +193,19 @@
// //
onBackPress(e) { onBackPress(e) {
// //
// cancelTakeIssueJob(this.id) if (e.from == 'backbutton') {
// .then(res => {}) if (this.jobStatus == 2) {
// .catch(err => { //
// this.showMessage(err.message); cancelTakeUnProduceReturnJob(this.id).then(res => {
// }); uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
}, },
mounted() { mounted() {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
@ -223,17 +219,6 @@
this.$refs.location.openScanPopup() this.$refs.location.openScanPopup()
}, },
getToLocation(locationInfo) {
if(this.currentItem.recommendToLocationCode!=locationInfo.code){
this.showMessage("扫描库位["+locationInfo.code+"]与推荐目标库位["+this.currentItem.recommendToLocationCode+"]不一致")
return;
}
this.currentItem.handledToLocationCode = locationInfo.code;
this.currentItem.handledToLocationArea = locationInfo.areaCode
this.currentItem.handledToLocationGroup = locationInfo.locationGroupCode
this.currentItem.handledToLocationErpCode = locationInfo.erpLocationCode
this.currentItem.handledToWarehouseCode = locationInfo.warehouseCode
},
openScanPopup() { openScanPopup() {
// if (this.allCount === this.scanCount) { // if (this.allCount === this.scanCount) {
@ -245,7 +230,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
@ -272,11 +257,11 @@
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){ selectCheckbox(mode, result) {
this.getScanResult(result,false) this.getScanResult(result, false)
}, },
// //
getDetail() { getDetail() {
@ -296,21 +281,8 @@
uni.hideLoading(); uni.hideLoading();
console.log('item', item); console.log('item', item);
that.datacontent = item; that.datacontent = item;
that.details = item.details; that.jobStatus = item.jobStatus;
if (that.details != null) { that.scanCount = 0
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();
@ -318,6 +290,29 @@
}); });
}, },
swipeClick(e, item, index) {
let {
content
} = e;
if (content.text === '移除') {
uni.showModal({
title: '提示',
content: '是否移除选择的行?',
success: res => {
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
})
}
}
});
}
},
getScanCode(code) { getScanCode(code) {
if (code == "") { if (code == "") {
this.showMessage('ERP料号不能为空') this.showMessage('ERP料号不能为空')
@ -326,10 +321,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 + '】');
@ -342,53 +337,113 @@
}, },
getScanResult(result,isMesCode=true) { getScanResult(result, isMesCode = true) {
// AH240321AM0153 AH240321AM0198 AH240321AM0199 // AH240321AM0153 AH240321AM0198 AH240321AM0199
let item = this.details.find(r => { let item = this.details.find(r => {
return r.itemCode == result.itemCode return r.itemCode == result.itemCode
}); });
if (item == undefined) { if (result.itemCode != this.datacontent.itemCode) {
if(isMesCode){ if (isMesCode) {
scanFailedAudio() this.showMessage('单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描');
this.showMessage('在任务详情中,单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描'); } else {
}else { this.showMessage('没有找到ERP料号[' + result.itemCode + "]的信息,请重新扫描");
this.showMessage('在任务详情中,没有找到ERP料号[' + result.itemCode+"]的信息,请重新扫描");
} }
return; return;
} }
if (item.scaned) {
if(isMesCode){ let scanItem = this.details.find(r => r.itemCode === result.itemCode)
scanFailedAudio() //
if (scanItem) {
if (isMesCode) {
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 = {
item.scanDate = new Date() itemCode: result.itemCode,
this.details.sort(compareDesc('scanDate')); itemName: this.datacontent.itemName,
item.handledQty = item.recommendQty; itemDesc1: this.datacontent.itemDesc1,
this.calcScanCount() handledQty: Number(this.datacontent.qty)
}
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() this.$forceUpdate()
} }
}, },
qtyChanged(value, item, index) { setParam(item, result) {
if (value == 0) { item.id = guid(),
this.showMessage('退料数量必须大于0') item.creationTime = getCurrDateTimeAndT()
item.handledQty = item.recommendQty item.creatorId = guid()
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); item.lastModificationTime = getCurrDateTimeAndT()
return; item.lastModifierId = guid()
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.status = 2
item.recommendContainerCode = ""
item.recommendPackingCode = ""
item.recommendSupplierBatch = ""
item.recommendArriveDate = getCurrDateTimeAndT()
item.recommendProduceDate = getCurrDateTimeAndT()
item.recommendExpireDate = getCurrDateTimeAndT()
item.recommendLot = ""
item.recommendToLocationCode = ""
item.recommendToLocationArea = ""
item.recommendToLocationGroup = ""
item.recommendToLocationErpCode = ""
item.recommendToWarehouseCode = ""
item.recommendQty = item.handledQty
item.uom = result.uom
item.handledContainerCode = ""
item.handledPackingCode = ""
item.handledSupplierBatch = ""
item.handledArriveDate = getCurrDateTimeAndT()
item.handledProduceDate = getCurrDateTimeAndT()
item.handledExpireDate = getCurrDateTimeAndT()
item.handledLot = ""
item.handledToLocationCode = ""
item.handledToLocationArea = ""
item.handledToLocationGroup = ""
item.handledToLocationErpCode = ""
item.handledToWarehouseCode = ""
item.handledQty = item.handledQty
item.extraProperties = {
additionalProp1: "",
additionalProp2: "",
additionalProp3: ""
} }
if (value > item.recommendQty) { },
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('退料数量不能小于或等于0')
this.scanCount = this.datacontent.qty
this.$refs['comNumberBox_' + index][0].setValue(this.scanCount);
} else if (value > this.datacontent.qty) {
this.scanCount = this.datacontent.qty
this.showMessage("实际退料数量不能大于申请数量") this.showMessage("实际退料数量不能大于申请数量")
this.$refs['comNumberBox_' + index][0].setValue(item.recommendQty); this.$refs['comNumberBox_' + index][0].setValue(this.scanCount);
return; } else {
this.scanCount = value;
} }
}, },
@ -398,7 +453,7 @@
let params = { let params = {
id: this.id id: this.id
}; };
takeIssueJob(params) takeUnProduceReturnJob(params)
.then(res => { .then(res => {
callback(true); callback(true);
}) })
@ -409,19 +464,15 @@
}, },
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 => { if (!this.locationInfo) {
return r.scaned && r.handledQty != 0 && r.handledToLocationCode != null this.showMessage('请先扫描目标库位');
}) return;
if (items.length == this.details.length) {
this.finsh();
} else {
this.showMessage("还有未扫描的单件码或库位")
} }
this.finsh();
}, },
@ -432,26 +483,21 @@
mask: true mask: true
}); });
that.details.forEach(res => { that.details.forEach(res => {
res.recommendToLocationCode = this.locationInfo.code
res.recommendToLocationArea = this.locationInfo.areaCode
res.recommendToLocationGroup = this.locationInfo.locationGroupCode
res.recommendToLocationErpCode = this.locationInfo.erpLocationCode
res.recommendContainerCode = "" res.handledToLocationCode = this.locationInfo.code
res.handledContainerCode = "" res.handledToLocationArea = this.locationInfo.areaCode
res.recommendPackingCode = "" res.handledToLocationGroup = this.locationInfo.locationGroupCode
res.handledPackingCode = "" res.handledToLocationErpCode = this.locationInfo.erpLocationCode
res.recommendSupplierBatch = ""
res.recommendLot = ""
res.handledSupplierBatch = ""
res.handledLot = ""
}) })
that.datacontent.completeUserId = localStorage.getItem('userId') let params = JSON.stringify(that.details);
that.datacontent.completeUserName = localStorage.getItem('userName_CN') var worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN
that.datacontent.completeTime = getCurrDateTime();
that.datacontent.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage
.userName_CN;
that.datacontent.details = that.details;
let params = JSON.stringify(that.datacontent);
console.log("提交", params); console.log("提交", params);
finshUnProduceReturnJob(that.id, params) finshUnProduceReturnJob(that.id, this.datacontent.number, worker, params)
.then(res => { .then(res => {
uni.hideLoading(); uni.hideLoading();
if (res != null) { if (res != null) {
@ -495,10 +541,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();
@ -509,13 +551,44 @@
uni.hideLoading(); uni.hideLoading();
}, },
closeScanPopup() { getToLocation(code) {
if (this.allCount == this.scanCount) { if (code == '') {
this.$refs.scanPackPopup.closeScanPopup(); this.showMessage('目标库位不能为空');
this.$refs.scanPopupItem.closeScanPopup(); return;
}
uni.showLoading({
title: "扫描中",
mask: true
});
let that = this;
locations(code).then(res => {
if (res == null) {
scanFailedAudio()
that.showMessage('目标库位【' + code + '】不存在');
this.$refs.comCollapseLocation.clearLocation();
} else {
if (that.datacontent.fromErpLocationCode != res.erpLocationCode) {
scanFailedAudio()
that.showMessage('目标库位的ERP储位【' + res.erpLocationCode + '】与【' +
this.datacontent.fromErpLocationCode +
'】不是同一ERP储位,请重新扫描');
this.$refs.comCollapseLocation.clearLocation();
} else {
scanSuccessAudio()
this.locationInfo = res
}
} }
uni.hideLoading();
}).catch(err => {
scanFailedAudio()
that.locationInfo = null;
that.showMessage(err.message);
uni.hideLoading();
})
}, },
} }
} }
</script> </script>

Loading…
Cancel
Save