1185 lines
39 KiB
Vue
Executable File
1185 lines
39 KiB
Vue
Executable File
<template>
|
||
<!-- 正在拣货 -->
|
||
<view class="pickPage" style="">
|
||
<opsoft-dialog-notice
|
||
:dialogNoticeShow="showDialog"
|
||
:dialogNoticeType="dialogNoticeType"
|
||
:dialogNoticeTitle="dialogNoticeTitle"
|
||
:dialogNoticeContent="dialogNoticeContent"
|
||
@dialogNoticeConfirmClick="dialogNoticeConfirmClick"
|
||
>
|
||
</opsoft-dialog-notice>
|
||
<view class="nav">
|
||
<view class="nav-left">
|
||
<view v-for="(item, index) in navInfo">
|
||
{{ item }}
|
||
<span
|
||
v-if="index !== navInfo.length - 1"
|
||
style="display: inline-block; margin: 0 2px"
|
||
>
|
||
 >
|
||
</span>
|
||
</view>
|
||
</view>
|
||
<view class="nav-back" @click="turnBack">返回</view>
|
||
</view>
|
||
|
||
<view class="content">
|
||
<template v-if="currentTag === 'info'">
|
||
<view class="currentTask">
|
||
<view class="currentTask-top">拣货信息</view>
|
||
</view>
|
||
<!-- base info -->
|
||
<view class="pickInfo">
|
||
<view class="left">
|
||
<view class="left-item">
|
||
产品名称: {{ pickInfo.FMATERIALNAME }}
|
||
</view>
|
||
<view class="left-item">
|
||
产品代码: {{ pickInfo.FMATERIALNUMBER }}
|
||
</view>
|
||
<view class="left-item">
|
||
规格型号: {{ pickInfo.FSPECIFICATION }}
|
||
</view>
|
||
<view class="left-item">
|
||
批次: {{ this.stockArr[this.stockIndex].FLOT }}
|
||
</view>
|
||
<view class="left-item">
|
||
辅助属性: {{ pickInfo.FAUXPROPNAME }}
|
||
</view>
|
||
</view>
|
||
<view class="pic">
|
||
<view class="" v-if="pickInfo.FPICTUREBASE64" style="width:100%;height:100%">
|
||
<image :src="'data:image/png;base64,' + pickInfo.FPICTUREBASE64" style="width:100%;height:100%"></image>
|
||
</view>
|
||
<view v-else>
|
||
暂无图片
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 一些扫描 填写操作 -->
|
||
<view class="currentTask-bottom">
|
||
<!-- 拣货库位 会 当前仓位数组 index一样 -->
|
||
<view style="display: flex" class="pick-scan" :style="currentScan === 'position' ? 'background-color: #d5e7b7' : ''">
|
||
<view>
|
||
拣货库位: {{ noUndefined(stockArr[stockIndex].FSTOCKNAME) + "-" + noUndefined(stockArr[stockIndex].FSTOCKLOCNAME) }}
|
||
</view>
|
||
<span class="pick-info-unit" style="min-width: 200rpx;">{{ " " + noUndefined(stockArr[stockIndex].FQTY) + " " + noUndefined(stockArr[stockIndex].FUNITNAME) }}</span>
|
||
</view>
|
||
<view style="display: flex">
|
||
<view class="pick-scan" :style="currentScan === 'barcode' ? 'background-color: #d5e7b7' : ''">
|
||
<view class="text">条码:</view>
|
||
<input
|
||
type="text"
|
||
v-model="barcode"
|
||
class="pick-scan-input"
|
||
@confirm="barcodeConfirm"
|
||
:focus="barcodeInputFocus"
|
||
/>
|
||
<image src="../../../static/img/scan-blue.png" class="img"
|
||
@click="scan('barcode')" ></image>
|
||
</view>
|
||
<view class="pick-info-unit">{{ " " + noUndefined(barcodeNumber) + " " + noUndefined(pickInfo.FUNITNAME) }}</view>
|
||
</view>
|
||
|
||
<!-- 拣货数量 已拣数量 条码数量 -->
|
||
<view
|
||
class="currentTask-bottom-text"
|
||
style="justify-content: space-between;"
|
||
>
|
||
<view>
|
||
<!-- 当前库位的数量 -->
|
||
已拣数量:  
|
||
<span style="color: red">
|
||
{{ " " + noUndefined(hasPick) + " " + noUndefined(pickInfo.FUNITNAME) }}
|
||
</span>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="pick-barcode flex-center" :style="currentScan === 'number' ? 'background-color: #d5e7b7' : ''">
|
||
<!-- 默认由条码数量带出-->
|
||
<input type="text" placeholder="请输入实际拣货数量"
|
||
v-model="realPickNumber"
|
||
@confirm="numberConfirm"
|
||
:focus="numberInputFocus"
|
||
/>
|
||
{{ noUndefined(pickInfo.FUNITNAME) }}
|
||
</view>
|
||
|
||
<view class="currentTask-bottom-text">下一库位: {{ noUndefined(stockArr[stockIndex + 1] ? stockArr[stockIndex + 1].FSTOCKNAME + '-' + stockArr[stockIndex + 1].FSTOCKLOCNAME : "")}}</view>
|
||
|
||
<!-- 更多 下一个 按钮 -->
|
||
<view class="bottom-button flex-center">
|
||
<view class="button" disabled @click="currentTag = 'morePage'">
|
||
更多
|
||
</view>
|
||
<view class="button" :style="!nextDisabled ? '' : 'background-color: #d7d7d7' "
|
||
@click="nextEvent" :disabled="nextDisabled">
|
||
下一个
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<!-- 更多页面 涉及打印参数设置 和 异常上报 -->
|
||
<template v-else-if="currentTag === 'morePage'">
|
||
<view class="currentTask">
|
||
<view class="currentTask-top">异常上报</view>
|
||
</view>
|
||
|
||
<view class="morePage-item">
|
||
<view class="morePage-item-input">
|
||
<view class="label">产品缺货:</view>
|
||
<view class="input">
|
||
<input
|
||
type="number"
|
||
placeholder="请输入缺货数量"
|
||
v-model="qty"
|
||
/>
|
||
</view>
|
||
<view class="text" style="margin-left: 20rpx">件</view>
|
||
</view>
|
||
<view class="morePage-item-input">
|
||
<view class="label">其他:</view>
|
||
<view class="input">
|
||
<input
|
||
type="text"
|
||
placeholder="请输入异常信息"
|
||
v-model="errorInfo"
|
||
/>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="currentTask">
|
||
<view class="currentTask-top">拆包打印</view>
|
||
</view>
|
||
|
||
<view class="pickHead">
|
||
<view
|
||
class="pickHead-item"
|
||
:style="printTag === 'info' ? 'background-color: #fff' : '' "
|
||
@click="printTag = 'info'"
|
||
>
|
||
拆包详情
|
||
</view>
|
||
<view class="pickHead-item"
|
||
:style="printTag === 'print' ? 'background-color: #fff' : ''"
|
||
@click="printTag = 'print'"
|
||
>
|
||
打印设置
|
||
</view>
|
||
<view
|
||
class="pickHead-item"
|
||
:style="
|
||
printTag === 'bluetooth'
|
||
? 'background-color: #fff'
|
||
: ''
|
||
"
|
||
@click="printTag = 'bluetooth'"
|
||
>
|
||
蓝牙设置
|
||
</view>
|
||
</view>
|
||
|
||
<template v-if="printTag === 'info'">
|
||
<view class="pickInfo">
|
||
<view class="left">
|
||
<!-- 条码数量 -->
|
||
<view class="left-item">拆包条码: {{ barcode }}</view>
|
||
<view class="left-item">需求数量: {{splitNumber}}</view>
|
||
<!--<input type="text" v-model="splitNumber"-->
|
||
<!-- style="border: 1px solid;" disabled>-->
|
||
<view class="print">
|
||
<view @click="splitClickHandler('print')" style="margin-right: 20px" class="print-button">普通拆分打印</view>
|
||
<view @click="splitClickHandler('bluetooth')" class="print-button">蓝牙拆分打印</view>
|
||
</view>
|
||
</view>
|
||
|
||
</view>
|
||
</template>
|
||
|
||
<template v-if="printTag === 'print'">
|
||
<view class="print-main-pick">
|
||
<NetworkPrintTab
|
||
prgkey="STK_SellPicking"
|
||
:printInfo="newIntelID"
|
||
ref="networkPrintTab"
|
||
:orgId="companyId"
|
||
:baseUrl="baseUrl"
|
||
/>
|
||
</view>
|
||
</template>
|
||
|
||
<!-- 蓝牙打印 -->
|
||
<template v-if="printTag === 'bluetooth'">
|
||
<view class="print-main-pick">
|
||
<BluetoothPrintTab
|
||
ref="bluetoothPrintTab"
|
||
currentTranType="STK_SellPicking"
|
||
/>
|
||
</view>
|
||
</template>
|
||
|
||
<view class="bottom-button flex-center">
|
||
<view class="button" @click="currentTag = 'info'">
|
||
返回
|
||
</view>
|
||
<view class="button" @click="errorReport">确认</view>
|
||
</view>
|
||
</template>
|
||
</view>
|
||
|
||
<!-- 全部完成后显示 拣货成功 -->
|
||
<view class="opsoft-card-dialog card-shadow" v-show="dialogShow">
|
||
<view class="opsoft-card-title">
|
||
<view class="text">任务完成</view>
|
||
<view class="icon" @click="dialogShow = false">x</view>
|
||
</view>
|
||
|
||
<view class="opsoft-card-content">
|
||
<view class="box" style="line-height: 80rpx;">{{ ifSeed ? '请您将物品移至分播区' : '请您将物品移至包装复核区出库' }}</view>
|
||
</view>
|
||
|
||
<view class="opsoft-card-footer">
|
||
<!-- <view class="button" @click="noDocker">不使用容器</view> -->
|
||
<view class="button" @click="finishPick">结束拣货</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
// http://localhost:8066/#/pages/views/STK_PickPlatform/STK_SellPicking?companyId=12
|
||
import NetworkPrintTab from "@/components/network-print-tab/network-print-tab.vue"
|
||
import BluetoothPrintTab from "@/components/bluetooth-print-tab/bluetooth-print-tab.vue"
|
||
import opsoftDialogNotice from '@/components/opsoft-dialog-notice/opsoft-dialog-notice.vue';
|
||
import errorStrUntil from '@/common/errorStrUntil.js';
|
||
export default {
|
||
props: {},
|
||
components: {
|
||
NetworkPrintTab,
|
||
BluetoothPrintTab,
|
||
opsoftDialogNotice
|
||
|
||
},
|
||
data() {
|
||
return {
|
||
dialogNoticeContent:'',
|
||
dialogNoticeTitle:'',
|
||
dialogNoticeType:'',
|
||
showDialog:false,
|
||
|
||
ifSeed: false,
|
||
baseUrl: '',
|
||
newIntelID: '',
|
||
// 组织 id
|
||
companyId: "",
|
||
// 容器内码
|
||
dockerId: "",
|
||
navInfo: ["拣货平台", "销售拣货", "当前任务", "正在拣货"],
|
||
/**
|
||
* @type {'info' | 'morePage'}
|
||
*/
|
||
currentTag: "info",
|
||
dialogShow: false,
|
||
// 所有行信息
|
||
pickInfoArr: [],
|
||
// 当前行
|
||
pickInfo: {},
|
||
// pickInfo 对应 pickInfoArr里的index
|
||
pickIndex: 0,
|
||
// 拣货数量 废弃
|
||
pickNumber: "",
|
||
// 实际拣货数量
|
||
realPickNumber: "",
|
||
/**
|
||
* @typedef {('position'| 'barcode' | 'number')} ScanType
|
||
*/
|
||
/**
|
||
* 当前扫描的是 仓位 条码 或 数量 , 控制背景颜色切换
|
||
* @type {'position'| 'barcode' | 'number'}
|
||
*/
|
||
currentScan: "barcode",
|
||
// info, config, bluetooth 打印页签
|
||
printTag: "info",
|
||
// 条码
|
||
barcode: "",
|
||
// 条码数量
|
||
barcodeNumber: "",
|
||
// 条码类型, 批次条码: 3
|
||
barcodeType: '',
|
||
// 条码是否聚焦
|
||
barcodeInputFocus: false,
|
||
// 实际数量是否聚焦
|
||
numberInputFocus: false,
|
||
// 缺货数量
|
||
qty: null,
|
||
// 异常信息
|
||
errorInfo: "",
|
||
// 当前仓位数量扫完后,才可下一步 ; 值为true: 不能编辑
|
||
nextDisabled: true,
|
||
// 拆分出来的新条码的数量
|
||
splitNumber: '',
|
||
/**
|
||
* 仓位信息
|
||
* @typedef {object} stockObj
|
||
* @property {string} FSTOCKLOCNAME - 仓位名
|
||
* @property {number} FQTY - 仓位数量
|
||
*/
|
||
/**
|
||
* @type {stockObj[] | object[]}
|
||
*/
|
||
stockArr: [{}],
|
||
// 当前仓位数组 index
|
||
stockIndex: 0,
|
||
// 当前仓位已拣货的数量, 等于拣货数量时 才能做 下一个 操作
|
||
hasPick: 0,
|
||
FUnitID: '', // 拆分条码需要
|
||
type: 1,
|
||
currentBarcodeInfo: {}
|
||
}
|
||
},
|
||
onLoad(e) {
|
||
console.log("当前任务 页面参数", e)
|
||
this.ifSeed = e.ifSeed === '1'
|
||
this.companyId = e.companyId
|
||
this.dockerId = e.dockerId
|
||
this.type = Number(e.type)
|
||
this.navInfo[1] = this.type === 1 ? '销售拣货' : '生产拣货'
|
||
this.baseUrl = uni.getStorageSync('RequestUrl');
|
||
},
|
||
onReady() {
|
||
if (this.$refs.bluetoothPrintTab) {
|
||
this.$refs.bluetoothPrintTab.orgId = this.companyId
|
||
}
|
||
},
|
||
mounted() {
|
||
this.pickInfoArr = this.$store.state.currentPickArr // 拣货信息
|
||
this.pickIndex = 0;
|
||
if (this.pickInfoArr.length > 0) {
|
||
this.pickInfo = this.pickInfoArr[this.pickIndex]
|
||
// 获取第一行的仓位信息1
|
||
this.getStockInfo(this.pickInfo.FDETAILID)
|
||
} else {
|
||
this.pickInfo = {}
|
||
}
|
||
|
||
this.barcodeInputFocus = false
|
||
this.numberInputFocus = false
|
||
this.$nextTick(() => {
|
||
this.barcodeInputFocus = true
|
||
this.numberInputFocus = false
|
||
})
|
||
|
||
},
|
||
|
||
methods: {
|
||
dialogNoticeConfirmClick(){
|
||
this.showDialog = false;
|
||
},
|
||
dialogNoticeProps(err,type){
|
||
err = errorStrUntil.handle(err);
|
||
this.showDialog = true;
|
||
this.dialogNoticeType = 'error';
|
||
this.dialogNoticeTitle = '异常提示';
|
||
if(type=='success'){
|
||
this.dialogNoticeType = 'success';
|
||
this.dialogNoticeTitle = '执行成功';
|
||
}
|
||
this.dialogNoticeContent = err;
|
||
},
|
||
|
||
noUndefined(str) {
|
||
return (str === undefined || str === null )? "" : str
|
||
},
|
||
// 获取当前行 的 库存信息, 一行最多关联3个仓位
|
||
getStockInfo(id) {
|
||
// https://www.tapd.cn/36031001/markdown_wikis/show/#1136031001001000917
|
||
this.$request.get('/PickInventory/PickTaskGetInventoryInfo', {
|
||
params: {
|
||
taskSubRowDetailId: id // 拣货任务单明细行内码
|
||
}
|
||
}).then((res) => {
|
||
this.stockArr = res || [{}]
|
||
// 更新已拣数量
|
||
this.hasPick = this.stockArr[0].FPICKEDQTY
|
||
// 若已拣等于需拣 开放下一个按钮
|
||
if (this.hasPick === this.stockArr[0].FQTY) {
|
||
this.nextDisabled = false
|
||
}
|
||
this.stockIndex = 0;
|
||
}).catch(err => {
|
||
uni.hideLoading();
|
||
this.dialogNoticeProps(err,'error')
|
||
})
|
||
},
|
||
turnBack() {
|
||
uni.navigateBack()
|
||
},
|
||
scan(type) {
|
||
uni.scanCode({
|
||
success: (result) => {
|
||
if (type === "position") {
|
||
// // 和当前库位一致 才可扫条码 不需要扫描了
|
||
// if ( result === this.stockArr[this.stockIndex].FSTOCKLOCNAME ) {
|
||
// // 行变色
|
||
// this.currentScan = "barcode"
|
||
//
|
||
// // 聚焦 条码框
|
||
// this.$nextTick(() => {
|
||
// this.barcodeInputFocus = true
|
||
// })
|
||
// } else {
|
||
// uni.showToast({
|
||
// title: `扫描结果${result}与所需库位不符`,
|
||
// icon: "none",
|
||
// duration: 3500
|
||
// })
|
||
// }
|
||
} else if (type === "barcode") {
|
||
this.barcode = result.result
|
||
console.log('扫描结果: ', result.result)
|
||
this.barcodeConfirm()
|
||
}
|
||
},
|
||
})
|
||
},
|
||
// 条码回车, 带出条码数量
|
||
barcodeConfirm() {
|
||
let barcode = this.barcode
|
||
|
||
if (this.stockArr[this.stockIndex].FISCOMPLETED) {
|
||
uni.showToast({
|
||
title: "该仓位已拣完,请切换下一个仓位",
|
||
icon: "none",
|
||
})
|
||
this.barcode = ""
|
||
return
|
||
}
|
||
|
||
if (!barcode) {
|
||
uni.showToast({
|
||
title: "请扫描条码",
|
||
icon: "none",
|
||
})
|
||
return
|
||
}
|
||
|
||
uni.showLoading({
|
||
title: "加载中",
|
||
mask: true,
|
||
})
|
||
this.$request
|
||
.get("/PickInventory/PickTaskQueryBarcode", {
|
||
params: {
|
||
companyId: this.companyId,
|
||
barcode: barcode,
|
||
}
|
||
})
|
||
.then((res) => {
|
||
uni.hideLoading();
|
||
let result = res;
|
||
this.currentBarcodeInfo = res
|
||
// 记录条码 类型
|
||
this.barcodeType = result.FBARTYPE;
|
||
// 聚焦到实际数量
|
||
this.currentScan = 'number';
|
||
|
||
// console.log("拣货任务单:扫码获取条码信息", res)
|
||
this.barcodeNumber = result.FQTY;
|
||
|
||
// 实际拣货数量 默认是条码数量
|
||
this.realPickNumber = this.barcodeNumber;
|
||
this.FUnitID = result.FUNITID;
|
||
|
||
// 30
|
||
let currentStockInfo = this.stockArr[this.stockIndex]
|
||
let remainNumber = Number(currentStockInfo.FQTY) - this.hasPick
|
||
|
||
if (result.FMATERIALNUMBER !== this.pickInfo.FMATERIALNUMBER ) {
|
||
// todo 判断条件
|
||
uni.showToast({
|
||
title: '物料编码不符合',
|
||
icon: 'none'
|
||
})
|
||
this.barcode = ''
|
||
this.realPickNumber = ''
|
||
this.currentScan = 'barcode';
|
||
this.barcodeNumber = ''
|
||
} else if (result.FLOT !== currentStockInfo.FLOT ) {
|
||
// 扫描结果的批次和 当前仓位的批次进行比较
|
||
uni.showToast({
|
||
title: '物料批次不符合',
|
||
icon: 'none'
|
||
})
|
||
this.barcode = ''
|
||
this.realPickNumber = ''
|
||
this.currentScan = 'barcode';
|
||
this.barcodeNumber = ''
|
||
} else if (result.FAUXPROPID !== currentStockInfo.FAUXPROPID ) {
|
||
// todo 判断条件
|
||
uni.showToast({
|
||
title: '物料辅助属性不符合',
|
||
icon: 'none'
|
||
})
|
||
this.barcode = ''
|
||
this.realPickNumber = ''
|
||
this.currentScan = 'barcode';
|
||
this.barcodeNumber = ''
|
||
} else if (result.FSTOCKNUMBER !== currentStockInfo.FSTOCKNUMBER || result.FSTOCKLOCNAME !== currentStockInfo.FSTOCKLOCNAME) {
|
||
uni.showToast({
|
||
title: '库位不一致',
|
||
icon: 'none'
|
||
})
|
||
this.barcode = ''
|
||
this.realPickNumber = ''
|
||
this.currentScan = 'barcode';
|
||
this.barcodeNumber = ''
|
||
} else if ( this.barcodeNumber > remainNumber && Number(this.barcodeType) !== 3) {
|
||
// 非批次条码 数量过大提示拆包
|
||
this.splitNumber = remainNumber
|
||
uni.showToast({
|
||
title: '该条码需要拆包',
|
||
icon: 'none'
|
||
})
|
||
} else {
|
||
// 实际拣货数量输入框 变色
|
||
this.currentScan = 'number';
|
||
// 聚焦到实际数量
|
||
this.barcodeInputFocus = false
|
||
this.numberInputFocus = false
|
||
this.$nextTick(() => {
|
||
this.barcodeInputFocus = false
|
||
this.numberInputFocus = true
|
||
})
|
||
}
|
||
|
||
|
||
|
||
})
|
||
.catch((err) => {
|
||
debugger
|
||
this.barcode = ""
|
||
this.dialogNoticeProps(err,'error')
|
||
uni.hideLoading();
|
||
console.log(err)
|
||
})
|
||
},
|
||
|
||
// 数量回车
|
||
numberConfirm() {
|
||
if (!this.realPickNumber) {
|
||
uni.showToast({
|
||
title: "请输入实际拣货数量",
|
||
icon: "none",
|
||
})
|
||
return
|
||
}
|
||
|
||
if (this.realPickNumber !== this.currentBarcodeInfo.FQTY && Number(this.barcodeType) !== 3) {
|
||
uni.showToast({
|
||
title: "非批次条码不可编辑数量",
|
||
icon: "none",
|
||
})
|
||
return
|
||
}
|
||
|
||
// 剩余数量
|
||
let remainNumber = Number(this.stockArr[this.stockIndex].FQTY) - this.hasPick
|
||
|
||
if (Number(this.realPickNumber) > remainNumber ) {
|
||
uni.showToast({
|
||
title: '当前拣货数量过大, 需要拆包',
|
||
icon: 'none',
|
||
})
|
||
return
|
||
}
|
||
|
||
// 批次条码 直接录入
|
||
if (Number(this.barcodeType) === 3) {
|
||
this.upBarcode(this.barcode, this.realPickNumber)
|
||
} else {
|
||
this.upBarcode(this.barcode, this.realPickNumber)
|
||
}
|
||
},
|
||
/**
|
||
* 录入条码
|
||
* @param {String} barcode
|
||
* @param {Number} number
|
||
*/
|
||
upBarcode(barcode, number) {
|
||
//
|
||
// this.realPickNumber = ''
|
||
// this.hasPick += Number(number);
|
||
// // 已拣数量不够, 需要继续扫描条码
|
||
// if ( this.hasPick < this.stockArr[this.stockIndex].FQTY) {
|
||
// this.currentScan = 'barcode';
|
||
//
|
||
// this.barcodeInputFocus = false
|
||
// this.numberInputFocus = false
|
||
// this.$nextTick(() => {
|
||
// this.barcodeInputFocus = true
|
||
// this.numberInputFocus = false
|
||
// })
|
||
// } else if (this.hasPick === this.stockArr[this.stockIndex].FQTY) {
|
||
// // 可进行下一步
|
||
// this.nextDisabled = false
|
||
// }
|
||
//
|
||
// this.barcode = ""
|
||
// this.barcodeNumber = ""
|
||
//
|
||
// return
|
||
|
||
|
||
// https://www.tapd.cn/36031001/markdown_wikis/show/#1136031001001000918
|
||
uni.showLoading({
|
||
title: "加载中",
|
||
mask: true,
|
||
})
|
||
this.$request.post('/PickInventory/PickTaskScanBarcode', {
|
||
// 组织内码 固定
|
||
CompanyId: this.companyId,
|
||
// 容器内码 固定
|
||
ContainerId: this.dockerId,
|
||
// 库存信息行内码
|
||
InventoryRowDetailId: this.stockArr[this.stockIndex].FDETAILID, //this.pickInfo.FDETAILID,
|
||
// 条码
|
||
Barcode: barcode,
|
||
// 数量
|
||
Qty: number,
|
||
}).then((res) => {
|
||
uni.hideLoading()
|
||
let msg = res;
|
||
this.hasPick += Number(number);
|
||
this.realPickNumber = ''
|
||
this.barcode = ""
|
||
this.barcodeNumber = ""
|
||
|
||
// 已拣数量不够, 需要继续扫描条码
|
||
if ( this.hasPick < this.stockArr[this.stockIndex].FQTY) {
|
||
this.currentScan = 'barcode';
|
||
|
||
this.barcodeInputFocus = false
|
||
this.numberInputFocus = false
|
||
this.$nextTick(() => {
|
||
this.barcodeInputFocus = true
|
||
this.numberInputFocus = false
|
||
})
|
||
} else if (this.hasPick === this.stockArr[this.stockIndex].FQTY) {
|
||
// 可进行下一步
|
||
this.nextDisabled = false
|
||
}
|
||
|
||
|
||
// 显示成功信息
|
||
uni.showToast({
|
||
title: msg,
|
||
icon: 'none'
|
||
})
|
||
}).catch(err => {
|
||
uni.hideLoading();
|
||
this.dialogNoticeProps(err,'error')
|
||
})
|
||
},
|
||
// 填完异常信息后, 点击确认按钮调用
|
||
errorReport() {
|
||
if (!(this.qty || this.errorInfo)) {
|
||
uni.showToast({
|
||
title: "请填写异常信息",
|
||
icon: 'none'
|
||
})
|
||
return;
|
||
}
|
||
if (Number(this.qty) <= 0) {
|
||
uni.showToast({
|
||
title: "产品缺货数量需大于0",
|
||
icon: 'none'
|
||
})
|
||
return;
|
||
}
|
||
|
||
uni.showLoading({
|
||
title: "加载中",
|
||
mask: true,
|
||
})
|
||
this.$request
|
||
.post("/PickInventory/PickTaskErrorReport", {
|
||
// 拣货任务单内码
|
||
TaskId: this.pickInfo.FINTERID,
|
||
// 拣货任务单行内码
|
||
TaskDetailId: this.pickInfo.FDETAILID,
|
||
// 异常数量
|
||
OOSQty: Number(this.qty),
|
||
// 原因
|
||
Reason: this.errorInfo,
|
||
// 组织内码
|
||
CompanyId: this.companyId,
|
||
})
|
||
.then((res) => {
|
||
let msg = res
|
||
this.currentTag = "info"
|
||
// 清空信息
|
||
this.qty = null
|
||
this.errorInfo = ""
|
||
|
||
this.currentTag = 'info'
|
||
uni.hideLoading()
|
||
uni.showToast({
|
||
title: msg,
|
||
icon: "none",
|
||
})
|
||
})
|
||
.catch(err => {
|
||
uni.hideLoading();
|
||
this.dialogNoticeProps(err,'error')
|
||
})
|
||
},
|
||
// 下一个
|
||
nextEvent() {
|
||
if ( this.nextDisabled ) {
|
||
return
|
||
}
|
||
console.log('nextEvent')
|
||
// if (this.realPickNumber) {
|
||
// return
|
||
// } else if (this.realPickNumber > this.pickNumber) {
|
||
// uni.showToast({
|
||
// title: "实际拣货数量不能大于需求数量",
|
||
// icon: "none",
|
||
// })
|
||
// return
|
||
// }
|
||
if (this.hasPick !== this.stockArr[this.stockIndex].FQTY) {
|
||
// 已拣数量 和 仓位数量一致时才可下一步操作
|
||
return
|
||
} else if (this.stockIndex < this.stockArr.length - 1) {
|
||
// 切换当前行的下一个仓位
|
||
this.stockIndex++
|
||
this.barcodeNumber = ""
|
||
this.barcode = ""
|
||
// this.hasPick = this.stockArr[this.stockIndex].FQTY;
|
||
this.hasPick = this.stockArr[this.stockIndex].FPICKEDQTY;
|
||
this.splitNumber = '';
|
||
this.nextDisabled = true;
|
||
|
||
// 聚焦到 仓位扫描栏
|
||
this.currentScan = 'barcode'
|
||
} else if (this.pickIndex < this.pickInfoArr.length - 1) {
|
||
// 没到最后一行的最后一个
|
||
// 处理下一行 清空数量条码
|
||
// 显示下一个的拣货信息
|
||
this.pickIndex++;
|
||
this.pickInfo = this.pickInfoArr[this.pickIndex];
|
||
|
||
this.barcodeNumber = ""
|
||
this.barcode = ""
|
||
this.hasPick = 0;
|
||
this.splitNumber = '';
|
||
this.nextDisabled = true;
|
||
|
||
// 聚焦到 仓位扫描栏
|
||
this.currentScan = 'barcode'
|
||
|
||
// 获取仓位
|
||
this.getStockInfo(this.pickInfo.FDETAILID)
|
||
// this.realPickNumber = this.realPickNumber + 1;
|
||
} else if (this.pickIndex === this.pickInfoArr.length - 1) {
|
||
// 到最后一个了
|
||
// 显示拣货完成
|
||
this.dialogShow = true
|
||
}
|
||
},
|
||
// 结束拣货
|
||
finishPick() {
|
||
if (this.type === 1) {
|
||
uni.navigateTo({
|
||
url: `/pages/views/STK_PICKTAST/STK_PICKTAST`,
|
||
})
|
||
} else {
|
||
uni.navigateTo({
|
||
url: `/pages/views/STK_PICKTAST_MO/STK_PICKTAST_MO`,
|
||
})
|
||
}
|
||
|
||
},
|
||
/**
|
||
* @param {'print' | 'bluetooth' | 'none'} type
|
||
*/
|
||
splitClickHandler(type) {
|
||
if (this.barcode && this.barcodeNumber && this.splitNumber) {
|
||
// todo change printType
|
||
this.splitEvent(this.barcode, this.barcodeNumber, this.splitNumber, type)
|
||
}
|
||
},
|
||
/**
|
||
* 条码拆分
|
||
* @param barcode
|
||
* @param number 被拆前数量
|
||
* @param splitNumber 拆出来条码的数量
|
||
* @param {'print' | 'bluetooth' | 'none'} printType 拆分后的打印类型; 蓝牙或普通
|
||
*/
|
||
splitEvent(barcode, number, splitNumber, printType) {
|
||
// https://www.tapd.cn/36031001/markdown_wikis/show/#1136031001001000512
|
||
let requestParams = {
|
||
"RemainQty": number - splitNumber, //条码剩余数量
|
||
"Barcode": barcode,
|
||
"SplitInfo": [
|
||
{
|
||
Barcode: barcode,
|
||
Qty: number // 被拆前数量
|
||
},
|
||
{
|
||
Barcode: "",
|
||
Qty: splitNumber // 拆掉的数量
|
||
}
|
||
],
|
||
TranType: "STK_BARCODESPLIT",
|
||
"CurrentUnitId": this.FUnitID,
|
||
};
|
||
|
||
// debugger
|
||
|
||
uni.showLoading({
|
||
icon:'loading',
|
||
title:'加载中……',
|
||
mask:true
|
||
});
|
||
|
||
this.$request.post('/Barcode/SplitBarcode',requestParams).then(res => {
|
||
this.isCommitBtnDisable = false;
|
||
uni.hideLoading();
|
||
|
||
let data = res;
|
||
if (data && data.length === 1) {
|
||
uni.showToast({
|
||
title: '拆分成功, 请扫描新条码' + data[0],
|
||
icon: 'none',
|
||
duration: 4000,
|
||
})
|
||
this.currentTag = 'info';
|
||
return data[0] // 被拆出来的条码 就一个
|
||
}
|
||
}).then((barcode) => {
|
||
if (printType === 'print') {
|
||
this.$refs.networkPrintTab.printBarcode([barcode]);
|
||
} else if ( printType === 'bluetooth') {
|
||
this.$refs.networkPrintTab.printBarcode([barcode]);
|
||
}
|
||
})
|
||
}
|
||
},
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
$pagePadding: 20px;
|
||
$primaryColor: #4662ff;
|
||
.pickPage {
|
||
background-color: #f2f2f2;
|
||
height: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.flex-center {
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
|
||
.nav {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
height: 60rpx;
|
||
padding: 0 $pagePadding;
|
||
background-color: #fff;
|
||
|
||
.nav-left {
|
||
display: flex;
|
||
}
|
||
|
||
.nav-back {
|
||
color: #02a7f0;
|
||
}
|
||
}
|
||
|
||
.content {
|
||
margin: 0 $pagePadding;
|
||
flex: 1;
|
||
position: relative;
|
||
min-height: 500px;
|
||
overflow: auto;
|
||
}
|
||
|
||
.currentTask-top {
|
||
background-color: #fff;
|
||
height: 60rpx;
|
||
line-height: 60rpx;
|
||
font-weight: 600;
|
||
border-radius: 4px;
|
||
padding-left: 10px;
|
||
margin-top: 20rpx;
|
||
border-bottom: 1px solid #f2f2f2;
|
||
}
|
||
|
||
.pickHead {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
margin-bottom: 1px;
|
||
|
||
.pickHead-item {
|
||
flex-grow: 1;
|
||
text-align: center;
|
||
height: 60rpx;
|
||
line-height: 60rpx;
|
||
}
|
||
}
|
||
|
||
.print-main-pick {
|
||
background-color: #fff;
|
||
padding-top: 1px;
|
||
|
||
.print-content-class {
|
||
// margin-top: 0;
|
||
}
|
||
}
|
||
|
||
.pickInfo {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
background-color: #fff;
|
||
border-bottom: 1px solid #f2f2f2;
|
||
|
||
.left {
|
||
flex-grow: 1;
|
||
padding: 10rpx 40rpx;
|
||
|
||
.left-item {
|
||
font-size: 30rpx;
|
||
line-height: 70rpx;
|
||
}
|
||
|
||
.print {
|
||
display: flex;
|
||
width: 100%;
|
||
flex-grow: 1;
|
||
align-items: center;
|
||
justify-content: space-around;
|
||
//width: 40%;
|
||
color: #fff;
|
||
//
|
||
border-radius: 8rpx;
|
||
margin-top: 40rpx;
|
||
//margin-right: 40rpx;
|
||
margin-bottom: 40rpx;
|
||
|
||
.print-button {
|
||
padding: 4px;
|
||
border-radius: 4px;
|
||
background-color: $primaryColor;
|
||
}
|
||
}
|
||
}
|
||
|
||
.pic {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
width: 40%;
|
||
color: #aab1c3;
|
||
background-color: #f2f2f2;
|
||
margin-top: 40rpx;
|
||
margin-right: 40rpx;
|
||
margin-bottom: 40rpx;
|
||
}
|
||
|
||
|
||
}
|
||
|
||
.currentTask-bottom {
|
||
background-color: #fff;
|
||
padding: 10px;
|
||
|
||
.pick-scan {
|
||
flex-grow: 1;
|
||
height: 80rpx;
|
||
background-color: #f2f2f2;
|
||
border-radius: 10rpx;
|
||
font-size: 38rpx;
|
||
font-weight: 600;
|
||
|
||
margin-bottom: 15rpx;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
font-size: 38rpx;
|
||
|
||
.text {
|
||
font-size: 38rpx;
|
||
margin-left: 20rpx;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.pick-scan-input {
|
||
text-align: center;
|
||
}
|
||
|
||
.img {
|
||
width: 60rpx;
|
||
height: 60rpx;
|
||
}
|
||
}
|
||
|
||
.pick-info-unit {
|
||
color: red;
|
||
height: 80rpx;
|
||
line-height: 80rpx;
|
||
min-width: 100rpx;
|
||
text-align: right;
|
||
font-weight: 600;
|
||
word-break: break-all;
|
||
word-wrap: break-word;
|
||
white-space: pre-wrap;
|
||
}
|
||
|
||
.pick-barcode {
|
||
height: 80rpx;
|
||
background-color: #f2f2f2;
|
||
border-radius: 10rpx;
|
||
font-size: 38rpx;
|
||
}
|
||
|
||
.currentTask-bottom-text {
|
||
padding-left: 40rpx;
|
||
font-weight: 600;
|
||
height: 80rpx;
|
||
line-height: 80rpx;
|
||
display: flex;
|
||
}
|
||
}
|
||
|
||
.bottom-button {
|
||
position: absolute;
|
||
height: 100rpx;
|
||
width: 100%;
|
||
left: 50%;
|
||
bottom: 30rpx;
|
||
transform: translateX(-50%);
|
||
|
||
display: flex;
|
||
justify-content: space-around;
|
||
align-items: center;
|
||
|
||
.button {
|
||
background-color: $primaryColor;
|
||
color: #fff;
|
||
height: 80rpx;
|
||
width: 240rpx;
|
||
text-align: center;
|
||
line-height: 80rpx;
|
||
border-radius: 8rpx;
|
||
}
|
||
}
|
||
|
||
.morePage-item {
|
||
background-color: #fff;
|
||
padding: 40rpx;
|
||
.morePage-item-input {
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: 20rpx;
|
||
|
||
.label {
|
||
width: 200rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
input {
|
||
border: 1px solid black;
|
||
border-radius: 8rpx;
|
||
padding-left: 20rpx;
|
||
}
|
||
}
|
||
}
|
||
|
||
.opsoft-card-dialog {
|
||
position: fixed;
|
||
margin: auto auto;
|
||
width: 550rpx;
|
||
top: 50%;
|
||
left: 50%;
|
||
transform: translate(-50%, -50%);
|
||
|
||
min-height: 200px;
|
||
background-color: #fff;
|
||
border-radius: 16px;
|
||
/* width: 434.78rpx; */
|
||
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-between;
|
||
|
||
.opsoft-card-title {
|
||
text-align: left;
|
||
padding: 0 30rpx;
|
||
|
||
height: 72.46rpx;
|
||
// line-height: 72.46rpx;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
border-bottom: 1px solid #d7d7d7;
|
||
|
||
.text {
|
||
font-size: 32.61rpx;
|
||
}
|
||
}
|
||
|
||
.opsoft-card-content {
|
||
margin: 10px;
|
||
font-size: 25.36rpx;
|
||
|
||
.box {
|
||
// border: 1px solid #d7d7d7;
|
||
text-align: center;
|
||
height: 150rpx;
|
||
line-height: 150rpx;
|
||
font-size: 40rpx;
|
||
// color: #d7d7d7;
|
||
}
|
||
}
|
||
|
||
.opsoft-card-footer {
|
||
display: flex;
|
||
// flex: 1;
|
||
justify-content: space-around;
|
||
margin-bottom: 15rpx;
|
||
|
||
.button {
|
||
// width: 50%;
|
||
padding: 0 15rpx;
|
||
text-align: center;
|
||
height: 72.46rpx;
|
||
line-height: 66.23rpx;
|
||
border-radius: 0;
|
||
background-color: #4662ff;
|
||
color: #fff;
|
||
border-radius: 15rpx;
|
||
// border: 0.5px solid rgba(235, 237, 240, 1);
|
||
font-family: 思源黑体;
|
||
}
|
||
}
|
||
}
|
||
|
||
.card-shadow {
|
||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.12);
|
||
}
|
||
</style>
|
||
|
||
<style></style>
|