You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
464 lines
12 KiB
464 lines
12 KiB
<template>
|
|
<page-meta root-font-size="18px"></page-meta>
|
|
<view class="">
|
|
<view class="top_card">
|
|
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount">
|
|
</com-job-scan-detail>
|
|
</view>
|
|
<!-- <view class="uni-flex uni-row" style="background-color: #fff; padding: 20rpx; align-items: center;">
|
|
<view class="" style="font-size: 35rpx; font-weight: bold; margin-right: 10rpx;">
|
|
来源库位 :
|
|
</view>
|
|
<uni-data-select v-model="value" :localdata="range" @change="change" label="来源库位"></uni-data-select>
|
|
</view> -->
|
|
|
|
|
|
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
|
|
class="scroll-detail">
|
|
<view class="uni-flex uni-col" style="flex-direction: column">
|
|
<view class="" v-for="(item, index) in details" :key="index">
|
|
<view class="detail-list margin_top">
|
|
<!-- 单选卡片 -->
|
|
<view class="detail-content">
|
|
<view class="choose_main">
|
|
<view class="ljh_box">
|
|
<view class="tit_ljh">{{ item.itemCode }}</view>
|
|
<view class="ljh_left">
|
|
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
|
|
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
|
|
</view>
|
|
</view>
|
|
<view class="list_form hold_form">
|
|
<view class="uni-container">
|
|
<uni-table style="overflow-x: hidden;">
|
|
<!-- <uni-tr>
|
|
<uni-th width="70"></uni-th>
|
|
<uni-th width="120" align="center">推荐</uni-th>
|
|
<uni-th width="120" align="center"></uni-th>
|
|
</uni-tr> -->
|
|
<uni-tr>
|
|
<uni-th width="70">收容数</uni-th>
|
|
<uni-th width="120" align="center">
|
|
<view class="text_black">{{item.requestQty}}({{item.uom}})</text>
|
|
</view>
|
|
</uni-th>
|
|
<!-- -->
|
|
<!-- <uni-th width="120" align="center">
|
|
<view class="" v-if="item.scaned">
|
|
<com-number-box :ref="'comNumberBox_'+index"
|
|
v-model="item.handledQty" :max="99999" :min="0"
|
|
@change="qtyChanged($event,item,index)">
|
|
</com-number-box>
|
|
</view> -->
|
|
<!-- <view v-if="dataContent.scaned" class="text_black">
|
|
{{dataContent.handledQty}}({{dataContent.uom}})
|
|
</view> -->
|
|
<!-- </uni-th> -->
|
|
</uni-tr>
|
|
<uni-tr>
|
|
<uni-th width="70">来源库位</uni-th>
|
|
<uni-th width="120" align="center">
|
|
<view class="text_black">{{ item.recommendFromLocationCode }}</view>
|
|
</uni-th>
|
|
<!-- <uni-th width="120" align="center">
|
|
<view class="">
|
|
<button v-if="item.scaned" type="primary" size="mini"
|
|
style="margin-left: 30rpx;"
|
|
@click="remove(dataContent,index)">移除</button>
|
|
</view>
|
|
</uni-th> -->
|
|
</uni-tr>
|
|
</uni-table>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="choose_marked" v-if="item.scaned">
|
|
<image src="@/static/image_marked.svg"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
<div class="new_bot_box">
|
|
<!-- <win-collapse-location scanTitle='扫描目标库位' ref='comCollapseLocation' @getLocationCode='getDefaultToLocation'
|
|
@clear='clearDefaultLocation'>
|
|
</win-collapse-location> -->
|
|
<view class="new_btn_bot bot_pos uni-flex">
|
|
<!-- <button class="new_clear_btn btn_double" @click="cancel()">清空</button> -->
|
|
<button class="new_save_btn " style="width: 100%;" @click="submit()">提交</button>
|
|
</view>
|
|
</div>
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button>
|
|
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
|
|
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
getInjectionPlanDetail,
|
|
takeInjectionPlanJob,
|
|
cancelTakeInjectionPlanJob,
|
|
finshInjectionPlanJob,
|
|
locations
|
|
} from '@/api/index.js';
|
|
import {
|
|
showConfirmMsg,
|
|
goHome,
|
|
navigateBack
|
|
} from '@/common/basic.js';
|
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
|
|
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
|
|
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
|
|
import comMessage from '@/mycomponents/common/comMessage.vue'
|
|
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
|
|
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
|
|
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
|
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
|
|
import comProductCode from '@/mycomponents/coms/task/comProductCode.vue';
|
|
|
|
|
|
|
|
export default {
|
|
components: {
|
|
winScanButton,
|
|
winMulitScan,
|
|
winScanByPack,
|
|
comMessage,
|
|
comJobScanDetail,
|
|
winCollapseLocation,
|
|
winScanByProductCode,
|
|
comNumberBox,
|
|
comProductCode
|
|
},
|
|
data() {
|
|
return {
|
|
type: '',
|
|
id: "",
|
|
datacontent: {},
|
|
details: [],
|
|
toLocation: '',
|
|
scrollTop: 0,
|
|
old: {
|
|
scrollTop: 0
|
|
},
|
|
ispending: false,
|
|
balancesItem: {},
|
|
titleArray: ['箱标签', '目标库位'],
|
|
allCount: 0,
|
|
scanCount: 0,
|
|
jobStatus: "",
|
|
toLocationInfo: null,
|
|
value: 0,
|
|
range: [{
|
|
value: 0,
|
|
text: "篮球"
|
|
},
|
|
{
|
|
value: 1,
|
|
text: "足球"
|
|
},
|
|
{
|
|
value: 2,
|
|
text: "游泳"
|
|
},
|
|
{
|
|
value: 0,
|
|
text: "篮球"
|
|
},
|
|
{
|
|
value: 1,
|
|
text: "足球"
|
|
},
|
|
{
|
|
value: 2,
|
|
text: "游泳"
|
|
},
|
|
{
|
|
value: 0,
|
|
text: "篮球"
|
|
},
|
|
{
|
|
value: 1,
|
|
text: "足球"
|
|
},
|
|
{
|
|
value: 2,
|
|
text: "游泳"
|
|
},
|
|
{
|
|
value: 0,
|
|
text: "篮球"
|
|
},
|
|
{
|
|
value: 1,
|
|
text: "足球"
|
|
},
|
|
{
|
|
value: 2,
|
|
text: "游泳"
|
|
},
|
|
],
|
|
}
|
|
},
|
|
onLoad(param) {
|
|
this.id = param.id;
|
|
if (param.jobStatus == 1) {
|
|
this.receive((callback => {
|
|
this.getDetail();
|
|
}));
|
|
} else {
|
|
this.getDetail();
|
|
}
|
|
},
|
|
//返回首页
|
|
onNavigationBarButtonTap(e) {
|
|
if (e.index === 0) {
|
|
goHome();
|
|
} else if (e.index === 1) {
|
|
window.location.reload();
|
|
}
|
|
},
|
|
//拦截返回按钮事件
|
|
onBackPress(e) {
|
|
//已经接收但是没提交任务
|
|
if (e.from == 'backbutton') {
|
|
if (this.jobStatus == 2) {
|
|
//取消承接任务
|
|
cancelTakeInjectionPlanJob(this.id).then(res => {
|
|
uni.navigateBack();
|
|
}).catch(error => {
|
|
uni.navigateBack();
|
|
})
|
|
} else {
|
|
uni.navigateBack();
|
|
}
|
|
return true;
|
|
}
|
|
},
|
|
mounted() {
|
|
uni.setNavigationBarColor({
|
|
frontColor: '#ffffff',
|
|
backgroundColor: "#5A7CF3 !important"
|
|
})
|
|
},
|
|
methods: {
|
|
change(e) {
|
|
console.log("e:", e);
|
|
},
|
|
//扫描默认目标库位
|
|
getDefaultToLocation(locationCode) {
|
|
uni.showLoading({
|
|
title: "扫描中",
|
|
mask: true
|
|
});
|
|
locations(locationCode).then(res => {
|
|
uni.hideLoading();
|
|
if (res) {
|
|
this.toLocationInfo = res
|
|
} else {
|
|
this.showMessage('目标库位【' + locationCode + '】不存在');
|
|
}
|
|
|
|
}).catch(err => {
|
|
uni.hideLoading();
|
|
this.toLocationInfo = null
|
|
this.showMessage(err.message);
|
|
|
|
})
|
|
},
|
|
|
|
clearDefaultLocation() {
|
|
this.toLocationInfo = null
|
|
},
|
|
remove(item, index) {
|
|
showConfirmMsg("是否移除当前【" + item.itemCode + "】扫描信息", res => {
|
|
if (res) {
|
|
item.scaned = false;
|
|
item.handledQty = null;
|
|
this.getScanCount()
|
|
}
|
|
})
|
|
},
|
|
qtyChanged(value, item, index) {
|
|
if (value <= 0) {
|
|
this.showMessage('收货货数量必须大于0')
|
|
item.qty = item.handledQty
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.qty);
|
|
}
|
|
},
|
|
openScanPopup() {
|
|
this.$refs.scanPackPopup.openScanPopup();
|
|
},
|
|
//加载零件信息
|
|
getDetail() {
|
|
let that = this;
|
|
let params = {
|
|
id: that.id,
|
|
};
|
|
getInjectionPlanDetail(params)
|
|
.then(item => {
|
|
console.log('item', item);
|
|
that.datacontent = item;
|
|
that.jobStatus = item.jobStatus
|
|
that.details = item.details;
|
|
that.details.forEach(res => {
|
|
res.scaned = false;
|
|
})
|
|
that.ispending = item.jobStatus === 2;
|
|
that.allCount = item.details.length;
|
|
// that.toLocation = item.details[0].recommendLocationCode;
|
|
})
|
|
.catch(err => {
|
|
this.showMessage('未查找到详细信息')
|
|
});
|
|
},
|
|
//扫描箱标签
|
|
getScanResult(result) {
|
|
let item = this.details.find(r => {
|
|
return r.itemCode == result.itemCode
|
|
});
|
|
|
|
if (item === undefined) {
|
|
this.showMessage('在任务详情中,未找到物料号【' + result.itemCode + '】');
|
|
return;
|
|
} else {
|
|
if (item.scaned) {
|
|
this.showMessage('物料号【' + result.itemCode + '】已经扫描,请扫描下一箱零件');
|
|
return;
|
|
} else {
|
|
item.scaned = true;
|
|
item.handledQty = item.recommendQty;
|
|
this.getScanCount()
|
|
setTimeout(res => {
|
|
this.$forceUpdate()
|
|
}, 1000)
|
|
|
|
}
|
|
}
|
|
|
|
},
|
|
|
|
|
|
getScanCount() {
|
|
this.scanCount = this.datacontent.details.filter(r => r.scaned).length;
|
|
},
|
|
|
|
closeScanPopup() {
|
|
if (this.allCount == this.scanCount) {
|
|
this.$refs.scanPopup.closeScanPopup();
|
|
}
|
|
},
|
|
|
|
cancel() {
|
|
showConfirmMsg("是否清除已经扫描的数据?", res => {
|
|
if (res) {
|
|
this.getDetail();
|
|
}
|
|
})
|
|
|
|
},
|
|
|
|
|
|
//接收
|
|
receive(callback) {
|
|
let params = {
|
|
id: this.id
|
|
};
|
|
takeInjectionPlanJob(params)
|
|
.then(res => {
|
|
callback(true);
|
|
})
|
|
.catch(err => {
|
|
this.showMessage(err.message);
|
|
callback(false);
|
|
});
|
|
},
|
|
|
|
submit() {
|
|
this.finsh();
|
|
},
|
|
|
|
finsh() {
|
|
uni.showLoading({
|
|
title: "提交中..."
|
|
});
|
|
this.setParams();
|
|
let params = JSON.stringify(this.datacontent);
|
|
console.log("提交", params);
|
|
finshInjectionPlanJob(this.id, params)
|
|
.then(res => {
|
|
uni.hideLoading();
|
|
if (res != null) {
|
|
this.showCommitSuccessMessage();
|
|
}
|
|
})
|
|
.catch(err => {
|
|
this.showMessage(err.message);
|
|
uni.hideLoading();
|
|
});
|
|
},
|
|
setParams() {
|
|
this.datacontent.details.forEach(res => {
|
|
res.handledFromContainerCode = res.recommendFromContainerCode;
|
|
res.handledFromPackingCode = res.recommendFromPackingCode;
|
|
res.handledFromSupplierBatch = res.recommendFromSupplierBatch;
|
|
res.handledFromArriveDate = res.recommendFromArriveDate;
|
|
res.handledFromProduceDate =res.recommendFromProduceDate;
|
|
res.handledFromExpireDate = res.recommendFromExpireDate;
|
|
res.handledFromLot = res.recommendFromLot;
|
|
res.handledFromLocationCode = res.recommendFromLocationCode;
|
|
res.handledFromLocationArea = res.recommendFromLocationArea;
|
|
res.handledFromLocationGroup = res.recommendFromLocationGroup;
|
|
res.handledFromLocationErpCode = res.recommendFromLocationErpCode;
|
|
res.handledFromWarehouseCode = res.recommendFromWarehouseCode;
|
|
res.handledFromQty =res.recommendFromQty;
|
|
res.handledToContainerCode = res.recommendToContainerCode;
|
|
res.handledToPackingCode = res.recommendToPackingCode;
|
|
res.handledToSupplierBatch = res.recommendToSupplierBatch;
|
|
res.handledToArriveDate = res.recommendToArriveDate;
|
|
res.handledToProduceDate = res.recommendToProduceDate;
|
|
res.handledToExpireDate =res.recommendToExpireDate;
|
|
res.handledToLot = res.recommendToLot;
|
|
res.handledToLocationCode = res.recommendToLocationCode;
|
|
res.handledToLocationArea = res.recommendToLocationArea;
|
|
res.handledToLocationGroup = res.recommendToLocationGroup;
|
|
res.handledToLocationErpCode = res.recommendToLocationErpCode;
|
|
res.handledToWarehouseCode = res.recommendToWarehouseCode;
|
|
res.handledToQty = res.recommendToQty
|
|
|
|
})
|
|
|
|
},
|
|
|
|
showCommitSuccessMessage() {
|
|
this.$refs.comMessage.showCommitSuccess();
|
|
},
|
|
|
|
closeCommitMessage() {
|
|
navigateBack(1); //点关闭直接返回列表
|
|
uni.hideLoading();
|
|
},
|
|
|
|
|
|
clearScanLocation() {
|
|
// this.$refs.scanLocation.getfocus();
|
|
// this.$refs.scanLocation.clear();
|
|
},
|
|
showMessage(message) {
|
|
this.$refs.comMessage.showMessage(message);
|
|
},
|
|
|
|
scroll: function(e) {
|
|
this.old.scrollTop = e.detail.scrollTop;
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
</style>
|