Browse Source

YT-2530直接发料改为扫描生产线代码;标签管理中增加生产线标签

intex_online20250418
张立 4 days ago
parent
commit
58b792bb96
  1. 64
      src/mycomponents/location/requiredProductionLine.vue
  2. 155
      src/mycomponents/scan/winScanProductionLine.vue
  3. 67
      src/pages/issue/record/directIssueByBatch.vue

64
src/mycomponents/location/requiredProductionLine.vue

@ -0,0 +1,64 @@
<template>
<view class="uni-flex u-col-center" style="padding-top: 15rpx;
padding-bottom: 15rpx;
padding-left: 10rpx;
padding-right: 10rpx;
font-size:32rpx;">
<view class="uni-flex uni-row u-col-center" @click="showProductionLine">
<view>
{{title}}
<text style="font-size: 35rpx;color:#3FBAFF;" v-if="!productionLine&&isShowEdit==true">&nbsp 请扫描</text>
<text style="font-size: 35rpx;color:#3FBAFF;">&nbsp {{productionLine}}</text>
</view>
<image v-if="isShowEdit" style="width:45rpx;height: 45rpx;" src="/static/icons/icons_edit.svg"></image>
</view>
<win-scan-production-line ref="scanProductionLineRef" :title="title+'标签'" @getProductionLine='getProductionLine'></win-scan-production-line>
</view>
</template>
<script>
import winScanProductionLine from "@/mycomponents/scan/winScanProductionLine.vue"
export default {
components: {
winScanProductionLine
},
data() {
return {
defaultproductionLine: ""
}
},
props: {
title: {
type: String,
default: "生产线"
},
productionLine: {
type: String,
default: ""
},
isShowEdit: {
type: Boolean,
default: true
},
},
watch: {
},
methods: {
showProductionLine() {
if (this.isShowEdit) {
this.$refs.scanProductionLineRef.openScanPopup();
}
},
//
getProductionLine(productionLine, code) {
this.$emit("getProductionLine", productionLine, code)
}
}
}
</script>
<style>
</style>

155
src/mycomponents/scan/winScanProductionLine.vue

@ -0,0 +1,155 @@
<template>
<uni-popup ref="popup" :maskClick='false'>
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view>
<image class=" icons_scan_close" src="/static/icons/icons_scan_close.svg" @click="closeScanPopup()">
</image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="true"
:isShowHistory="isShowHistory" headerType="">
</win-com-scan>
</view>
</view>
</view>
</uni-popup>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :clearResult="true" :boxFocus="true" :isShowHistory="false" headerType=""></win-com-scan>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import {
workstationByLocation,
} from '@/api/request2.js';
import {
checkDirectoryItemExist
} from '@/common/directory.js';
import winComScan from '@/mycomponents/scan/winComScan.vue'
export default {
components: {
winComScan,
},
emits: ["getProductionLine","clearProductionLine"],
props: {
title: {
type: String,
default: ''
},
isShowHistory: {
type: Boolean,
default: false
}
},
data() {
return {
code: '',
productionLine: {}
}
},
created() {
},
methods: {
openScanPopup() {
this.$refs.popup.open('bottom')
setTimeout(res => {
this.getfocus()
}, 500)
},
closeScanPopup() {
this.losefocus()
if(this.$refs.popup){
this.$refs.popup.close()
}
},
scanClick() {
this.$refs.scan.clickScanMsg();
},
cancelClick() {
this.$refs.scan.clearScanValue();
},
getScanResult(result) {
uni.showLoading({
title: '扫描中...',
mask: true
});
let label = result.label;
if (label.barType === 'QRCode') {
this.code = label.locationCode;
} else if (label.barType === 'BarCode') {
this.code = label.code;
}
if(this.code==undefined){
uni.hideLoading();
this.showErrorMessage("扫描库位为空,请输入正确的库位")
return
}
const params={
pageNo: 1,
pageSize: 20,
sort: "",
by: "ASC",
filters : [{
action: "like",
column: "productionLineCode",
value: this.code
},{
action: "==",
column: "available",
value: 'TRUE'
}]
}
workstationByLocation(params).then(res => {
uni.hideLoading();
if (res.data.total > 0) {
let result = res.data.list[0];
this.productionLine = result;
this.callBack();
} else {
this.showErrorMessage('未查询到生产线[' + this.code + '],请重新扫描')
this.$emit('clearProductionLine',this.code)
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
},
callBack() {
this.closeScanPopup();
this.$emit("getProductionLine", this.productionLine, this.code);
},
getfocus() {
if(this.$refs.scan){
this.$refs.scan.getfocus();
}
},
losefocus() {
if(this.$refs.scan){
this.$refs.scan.losefocus();
}
},
showErrorMessage(message) {
setTimeout(r => {
this.losefocus();
this.$refs.comMessage.showErrorMessage(message, res => {
this.code = '';
this.getfocus();
})
})
}
}
}
</script>
<style>
</style>

67
src/pages/issue/record/directIssueByBatch.vue

@ -25,17 +25,16 @@
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :isShowEdit="true"
:locationAreaTypeList="toLocationAreaTypeList"></requiredLocation>
<view class="uni-row uni-flex u-p-l-10" style="font-size: 32rpx;" v-if="positionInfo">
<requiredProductionLine ref='comScanLocation' title="生产线" :productionLine="positionInfo"
@getProductionLine='scanProductionLine' :isShowEdit="true"></requiredProductionLine>
<!-- <view class="uni-row uni-flex u-p-l-10" style="font-size: 32rpx;" v-if="positionInfo">
<text>&nbsp;&nbsp;&nbsp;&nbsp;线</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
{{positionInfo}}
</view>
</view>
</view>
</view> -->
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -101,7 +100,7 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import requiredProductionLine from '@/mycomponents/location/requiredProductionLine.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
@ -116,7 +115,7 @@
components: {
winScanButton,
winScanPack,
requiredLocation,
requiredProductionLine,
comBlankView,
winScanLocation,
winScanPackAndLocation,
@ -250,6 +249,7 @@
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.itemName = balance.itemName
newDetail.packingNumber = pack.number
newDetail.handleQty =label.qty
newDetail.supplierCode =label.supplierCode
@ -423,48 +423,17 @@
}
},
async scanLocationCode(location, code) {
const params = {
pageNo: 1,
pageSize: 100,
filters:[{action: "==",
column: "rawLocationCode",
value:code,
}]
}
// 线
const res = await workstationByLocation(params)
if(res.code == 0){
if(res.data&&res.data.list&&res.data.list.length>0){
const array = res.data.list.filter(item=>item.available == 'TRUE')
if(array.length>0){
this.positionInfo = array[0].productionLineCode
this.workStationCode = array[0].workshopCode
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
detail.productionLineCode = this.positionInfo
detail.workStationCode = this.workStationCode
})
})
}else{
this.showErrorMessage("未查询到库位对应的生产线,请重新扫描。")
}
}else{
this.showErrorMessage("未查询到库位对应的生产线,请重新扫描。")
this.positionInfo = ''
this.workStationCode = ''
return
}
}else{
this.positionInfo = ''
this.workStationCode = ''
this.showErrorMessage(res.mag)
return
}
async scanProductionLine(productionLine, code) {
this.positionInfo = productionLine.productionLineCode
this.workStationCode = productionLine.workshopCode
this.toLocationCode = productionLine.rawLocationCode
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = this.toLocationCode
detail.productionLineCode = this.positionInfo
detail.workStationCode = this.workStationCode
})
})
},
commit() {

Loading…
Cancel
Save