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.

341 lines
8.8 KiB

1 year ago
<template>
12 months ago
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-blank-view @goScan='openScanPopup' v-if="itemList.length==0"></win-blank-view>
<view class="top_wrap" v-if="itemList.length>0">
<view class="top_card">
1 year ago
12 months ago
<view class="device-detail">
<view class="list-style nopad">
<view class="ljh_box nopad">
<view class="tit_ljh uni-flex">
<text class="font_xl text_black text_bold">位置码 : {{dataContent.code}}</text>
</view>
1 year ago
12 months ago
</view>
</view>
</view>
1 year ago
12 months ago
</view>
1 year ago
</view>
<view class="uni-list" v-if="itemList.length>0">
<view class=""
style="font-size: 40rpx; font-weight: bold; align-items: center; display: flex; justify-content: center; margin-bottom: 20rpx; ">
工位关系
</view>
<view class="uni-flex" style="flex-wrap: wrap;justify-content: space-between; margin: 10rpx;" >
<view style="width: 50%; display: flex; flex-direction: row;" v-for="(item, index) in workStationList" :key="item.value">
<view class="uni-flex" style="flex-direction: row; margin: 12rpx;" @click="checkeClick(item.value)">
<view class="">
<checkbox :value="item.value" :checked="item.checked" />
</view>
<view class="">
{{item.name}}
</view>
</view>
</view>
</view>
</view>
1 year ago
12 months ago
<scroll-view scroll-y="true" @scroll="scroll" class="scroll-detail">
1 year ago
12 months ago
<view class="detail-list margin_top" v-for="(item, index) in itemList" :key="item.id">
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.partCode }}</view>
<view class="ljh_left desc_ljh">
<view class="font_xs text_lightblue">{{ item.partName }}</view>
<view class="font_xs text_lightblue">{{ item.partDesc }}</view>
</view>
</view>
<view class="list_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;">
<uni-tr>
12 months ago
<uni-th width="80">库位</uni-th>
12 months ago
<uni-th width="240" align="center">
<view class="text_packingCode">
{{ item.locationCode }}({{item.locationName}})
</view>
</uni-th>
</uni-tr>
<uni-tr>
12 months ago
<uni-th width="80">箱数/数量</text></uni-th>
12 months ago
<uni-th width="240" align="center">
<view
style="display: flex;flex-direction: row;justify-content:center;align-items: center;">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty"
:max="999999" :min="0" style='width: 100px;'
@change="qtyChanged($event,item,index)">
</com-number-box>
</view>
</uni-th>
</uni-tr>
<uni-tr>
12 months ago
<uni-th width="80">单位</uni-th>
12 months ago
<uni-th width="240" align="center">
<view class="text_packingCode">
{{ item.basicUom }}
</view>
</uni-th>
</uni-tr>
</uni-table>
1 year ago
12 months ago
</view>
</view>
</view>
<view class="choose_marked" v-if="item.scaned">
<image src="@/static/image_marked.svg"></image>
</view>
1 year ago
</view>
12 months ago
</view>
</scroll-view>
1 year ago
12 months ago
<div class="new_bot_box" v-show="itemList.length>0">
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="clear()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
</div>
1 year ago
12 months ago
<!-- <win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button> -->
<winScanByPosition ref="scanPopup" @getScanResult='getScanResult' codeType="1"></winScanByPosition>
12 months ago
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan'
@afterCloseCommitMessage='closeCommitMessage'>
</com-message>
1 year ago
</view>
</template>
12 months ago
1 year ago
<script>
import {
injectionIssueRequest,
getWorkStationByLocation
1 year ago
} from '@/api/index.js';
1 year ago
1 year ago
import {
1 year ago
showConfirmMsg,
12 months ago
goHome,
getRemoveOption,
getISODateTime,
scanSuccessAudio,
scanFailedAudio
1 year ago
} from '@/common/basic.js';
1 year ago
12 months ago
import winBlankView from '@/mycomponents/wincom/winBlankView.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winScanByPosition from '@/mycomponents/wincom/winScanByPosition.vue'
1 year ago
import comMessage from '@/mycomponents/common/comMessage.vue'
12 months ago
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
1 year ago
export default {
12 months ago
name: 'purchasePutaway',
1 year ago
components: {
12 months ago
winBlankView,
1 year ago
comMessage,
12 months ago
winScanButton,
winScanByPosition,
comNumberBox
1 year ago
},
data() {
return {
12 months ago
itemList: [],
dataContent: {},
workStationList: [],
1 year ago
};
},
12 months ago
props: {
// locationTypes: {
// type: [Array, String, Number],
// value: ''
// },
1 year ago
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
12 months ago
mounted: function() {
this.options = getRemoveOption();
this.openScanPopup();
},
1 year ago
methods: {
checkeClick(value) {
for (let i = 0; i < this.workStationList.length; i++) {
this.workStationList[i].checked = false
}
for (let i = 0; i < this.workStationList.length; i++) {
if (this.workStationList[i].value === value) {
if (this.workStationList[i].checked == true) {
this.workStationList[i].checked = false
} else {
this.workStationList[i].checked = true
}
}
}
this.$forceUpdate()
},
12 months ago
openScanPopup() {
this.$refs.scanPopup.openScanPopup()
1 year ago
},
12 months ago
getScanResult(result) {
this.dataContent = result;
result.qty = result.stdPackQty;
result.defaultHandleQty = result.qty
12 months ago
this.itemList.push(result)
this.$forceUpdate()
// result.locationCode APA
getWorkStationByLocation(result.locationCode).then(res => {
if (res && res.length > 0) {
this.workStationList = []
res.forEach(item => {
this.workStationList.push({
value: item.code,
name: item.name,
checked: false
})
})
scanSuccessAudio()
} else {
scanFailedAudio()
this.showMessage("获取工位失败")
}
12 months ago
}).catch(error => {
scanFailedAudio()
this.showMessage("获取工位失败")
})
12 months ago
},
clear() {
this.itemList = [];
this.dataContent = {}
},
submit() {
let that = this;
if (that.itemList.length === 0) {
that.showMessage('请扫描位置码');
return;
}
1 year ago
uni.showLoading({
12 months ago
title: "提交中....",
1 year ago
mask: true
});
12 months ago
var params = this.setParams();
console.log(JSON.stringify(params))
injectionIssueRequest(params).then(res => {
1 year ago
uni.hideLoading();
12 months ago
this.showMessage("提交成功")
this.clear();
}).catch(error => {
1 year ago
uni.hideLoading();
12 months ago
this.showMessage(error.message);
1 year ago
})
12 months ago
1 year ago
},
12 months ago
setParams() {
var workStation = this.workStationList.find(r => r.checked == true)
12 months ago
var param = {
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
remark: workStation ? workStation.value : "",
12 months ago
extraProperties: {},
activeDate: getISODateTime(),
autoSubmit: true,
autoAgree: false,
autoHandle: false,
autoCompleteJob: false,
directCreateNote: true,
issueRequestType: 4,
useOnTheWayLocation: false,
details: []
1 year ago
}
12 months ago
this.itemList.forEach(res => {
var data = {
remark: workStation ? workStation.value : "",
qty: res.qty,
12 months ago
itemCode: res.partCode,
itemName: res.partName,
itemDesc1: res.itemDesc2,
uom: res.basicUom,
12 months ago
stdPackQty: res.stdPackQty,
toLocationCode: res.locationCode,
12 months ago
prodLine: null,
requestStatus: 1,
issuedQty: res.qty,
receivedQty: 0,
status: 1,
positionCode: this.dataContent.code,
recommendType: 0,
boxQty: res.qty
12 months ago
}
param.details.push(data)
1 year ago
})
12 months ago
return param;
1 year ago
},
12 months ago
qtyChanged(value, item, index) {
if (value <= 0) {
item.qty = item.defaultHandleQty
this.$refs['comNumberBox_' + index][0].setValue(item.qty);
12 months ago
this.showMessage('发料数量不能小于或等于0')
return;
}
},
1 year ago
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
12 months ago
showConfirmMessage(message) {
this.$refs.comMessage.showConfirmMessage(message);
},
showCommitSuccess() {
1 year ago
this.$refs.comMessage.showCommitSuccess();
},
12 months ago
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
showRescanMessage(message) {
this.$refs.comMessage.showRescanMessage(message);
1 year ago
},
12 months ago
closeScanMessage() {
this.scanPopupGetFocus();
},
1 year ago
12 months ago
closeCommitMessage() {
// this.openScanPopup();
},
scanPopupGetFocus() {
this.$refs.scanPopup.getfocus();
},
scanPopupLoseFocus(message) {
this.$refs.scanPopup.losefocus();
1 year ago
},
}
};
12 months ago
</script>
<style scoped lang="scss">
</style>