|
|
|
<template>
|
|
|
|
<!-- <u-navbar title="备货列表" placeholder border=true :autoBack="true" leftIconSize='35'></u-navbar> -->
|
|
|
|
<BasicContainer ref="basicContainer" :option="option">
|
|
|
|
<template #head>
|
|
|
|
<view class="head">
|
|
|
|
<view class="type1">
|
|
|
|
<view>
|
|
|
|
客户:{{details.customer}}
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
备货区域:{{details.stockupArea}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="type1">
|
|
|
|
<view>
|
|
|
|
计划件数:{{details.planNum}}
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
扫描件数:{{details.scanNum}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="type1">
|
|
|
|
<view>
|
|
|
|
库位号:{{details.warehouseArea}}
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
托盘码:{{details.trays}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- <view class="type1">
|
|
|
|
<view>
|
|
|
|
容器件数:300
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
计划件数:300
|
|
|
|
</view>
|
|
|
|
</view> -->
|
|
|
|
<view class="type2">
|
|
|
|
<view>
|
|
|
|
<!-- 完成件数:1 -->
|
|
|
|
</view>
|
|
|
|
<!-- <view>
|
|
|
|
<view>备货托盘:无</view>
|
|
|
|
<view>
|
|
|
|
绑定托盘
|
|
|
|
</view>
|
|
|
|
</view> -->
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template #body>
|
|
|
|
<view class="butbox">
|
|
|
|
<scroll-view scroll-y="true" class="scrollv">
|
|
|
|
<view class="mabxs">
|
|
|
|
<view class="ite" @click="showsdqs" v-for="item in dataList">
|
|
|
|
<view>
|
|
|
|
<view @click.stop="goorderdetail(item)">订单号:{{item.orderCode}}</view>
|
|
|
|
<view>包条码:{{item.packageBarCode}}</view>
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
<view>货物类型:{{item.goodsType==1?'定制品':''}}</view>
|
|
|
|
<view>是否备货:{{item.isScanStr}}</view>
|
|
|
|
</view>
|
|
|
|
<view style="flex: 1;">
|
|
|
|
<view style="flex: 1;">物料名称:{{item.materialName}}</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
<view class="prtbut" @click="prinbut">
|
|
|
|
打印
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
</BasicContainer>
|
|
|
|
<u-navbar title="备货列表" bgColor='#D3832A' leftIconColor='#ffffff' titleStyle='color:#ffffff' placeholder
|
|
|
|
:autoBack="true" leftIconSize='35'></u-navbar>
|
|
|
|
|
|
|
|
<tiplist ref="tiplists"></tiplist>
|
|
|
|
<BluetoothList ref="bluetoothList"></BluetoothList>
|
|
|
|
<saomiao2></saomiao2>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import {
|
|
|
|
onLoad,
|
|
|
|
onShow,
|
|
|
|
onHide,
|
|
|
|
onUnload,
|
|
|
|
onPullDownRefresh
|
|
|
|
} from '@dcloudio/uni-app'
|
|
|
|
import { distributionStockuporderInfo, distributionStockupstockupScan } from '@/api/user.js'
|
|
|
|
import { detailType } from '@/interfaces/pagesHome/StockUplistScandetails'
|
|
|
|
import { reactive, ref, toRefs, inject } from "vue";
|
|
|
|
import utils from '@/utils/utils';
|
|
|
|
import useBluetoothStore from '@/store/useBluetoothStore.js';
|
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
|
// 获取组件实例
|
|
|
|
const bluetoothList = ref(null)
|
|
|
|
const basicContainer = ref(null)
|
|
|
|
|
|
|
|
// 获取Pinia仓库中蓝牙信息
|
|
|
|
const bluetoothStore = useBluetoothStore()
|
|
|
|
const { bluetoothInfo } = storeToRefs(bluetoothStore)
|
|
|
|
|
|
|
|
const option = {
|
|
|
|
ttile: '备货列表',
|
|
|
|
haveData: true,
|
|
|
|
async pullDownRefreshInitPage() {
|
|
|
|
console.log('1231 :>> ', 1231);
|
|
|
|
return await initpage()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let details = reactive<detailType>({
|
|
|
|
dataList: [],
|
|
|
|
stockArticleId: '',
|
|
|
|
orderStatus: '',
|
|
|
|
reservationId: '',
|
|
|
|
stockListId: '',
|
|
|
|
allocation: '',
|
|
|
|
pallet: '',
|
|
|
|
customer: '',
|
|
|
|
stockupArea: '',
|
|
|
|
planNum: '',
|
|
|
|
scanNum: '',
|
|
|
|
trays: '',
|
|
|
|
warehouseArea: '',
|
|
|
|
orderCode: '',
|
|
|
|
scancode: '',
|
|
|
|
stockupId: '',
|
|
|
|
address: '',
|
|
|
|
isscan: false,
|
|
|
|
allocationId: '',
|
|
|
|
status: '',
|
|
|
|
typeService: ''
|
|
|
|
})
|
|
|
|
const tiplists = ref(null)
|
|
|
|
onLoad((op) => {
|
|
|
|
|
|
|
|
|
|
|
|
details.stockArticleId = op.stockArticleId
|
|
|
|
details.status = op.status
|
|
|
|
details.stockupId = op.stockupId
|
|
|
|
details.orderStatus = op.orderStatus
|
|
|
|
details.reservationId = op.reservationId
|
|
|
|
details.allocationId = op.allocationId
|
|
|
|
// details.stockListId=op.stockListId
|
|
|
|
details.allocation = op.allocation
|
|
|
|
details.pallet = op.pallet
|
|
|
|
details.orderCode = op.orderCode
|
|
|
|
details.typeService = op.typeService
|
|
|
|
// #ifdef APP
|
|
|
|
if (Number(details.status) === 0) utils.ttsspke('请按件备货')
|
|
|
|
// #endif
|
|
|
|
})
|
|
|
|
|
|
|
|
onShow(() => {
|
|
|
|
uni.$on('scancodedate', function (code) {
|
|
|
|
if (code) {
|
|
|
|
console.log(code);
|
|
|
|
details.scancode = code
|
|
|
|
scandata()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// 延时调用组件刷新函数
|
|
|
|
const timer = setTimeout(() => {
|
|
|
|
basicContainer.value.startPullDownRefresh()
|
|
|
|
clearTimeout(timer)
|
|
|
|
}, 200)
|
|
|
|
})
|
|
|
|
|
|
|
|
onHide(() => {
|
|
|
|
uni.$off('scancodedate')
|
|
|
|
})
|
|
|
|
|
|
|
|
function goorderdetail(item) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pagesHome/pages/orderDetails/orderDetails?orderCode=' + item.orderCode
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/* onPullDownRefresh(() => {
|
|
|
|
const timer = setTimeout(() => {
|
|
|
|
initpage()
|
|
|
|
// 停止刷新动画
|
|
|
|
uni.stopPullDownRefresh()
|
|
|
|
clearTimeout(timer)
|
|
|
|
}, 500)
|
|
|
|
}) */
|
|
|
|
|
|
|
|
function prinbut() {
|
|
|
|
let list = [], checklist = []
|
|
|
|
details.dataList.map((item, index) => {
|
|
|
|
list.push(item.packageBarCode)
|
|
|
|
checklist.push(index)
|
|
|
|
})
|
|
|
|
tiplists.value.setdetails({
|
|
|
|
title: '请选择需要打印的包条码',
|
|
|
|
isshow: true,
|
|
|
|
tipstate: 2,
|
|
|
|
list,
|
|
|
|
checklist,
|
|
|
|
inputtext: '',
|
|
|
|
confirmTxt: '确认选择',
|
|
|
|
isonecheck: false,
|
|
|
|
success: (deta) => {
|
|
|
|
if (deta.checklist.length == 0) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '请选择包条码',
|
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// #ifdef APP
|
|
|
|
if (!bluetoothInfo.value.name) return bluetoothList.value.setdetails({ isshow: true })
|
|
|
|
let _isReturn = false
|
|
|
|
deta.checklist.forEach(item => {
|
|
|
|
if (_isReturn) return
|
|
|
|
let text = '! 0 200 200 330 1\r\n'
|
|
|
|
text += 'SETBOLD 2\r\n'
|
|
|
|
text += `T 56 0 0 0 ${details.dataList[item]?.orderCode}\r\n`
|
|
|
|
text += 'LINE 0 50 420 50 3\r\n'
|
|
|
|
text += `T 55 0 0 60 客户\r\n`
|
|
|
|
text += 'LINE 40 50 40 110 3\r\n'
|
|
|
|
text += `T 55 0 50 60 ${details.customer}\r\n`
|
|
|
|
text += 'LINE 40 80 420 80 3\r\n'
|
|
|
|
text += `T 55 0 50 90 ${details.address}\r\n`
|
|
|
|
text += 'LINE 0 110 420 110 3\r\n'
|
|
|
|
text += `T 55 0 0 120 物料\r\n`
|
|
|
|
text += 'LINE 40 110 40 140 3\r\n'
|
|
|
|
text += `T 55 0 50 120 ${details.dataList[item]?.materialName}\r\n`
|
|
|
|
text += 'LINE 0 140 420 140 3\r\n'
|
|
|
|
text += 'B QR 150 150 M 2 U 4\r\n'
|
|
|
|
text += `MA,${details.dataList[item]?.packageBarCode}\r\n`
|
|
|
|
text += 'ENDQR\r\n'
|
|
|
|
text += `T 55 0 140 260 ${details.dataList[item]?.packageBarCode}\r\n`
|
|
|
|
text += 'FORM\r\n'
|
|
|
|
text += 'PRINT\r\n'
|
|
|
|
utils.getbl(bluetoothInfo.value, text).catch(() => {
|
|
|
|
bluetoothList.value.setdetails({ isshow: true })
|
|
|
|
_isReturn = true
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if (_isReturn) return
|
|
|
|
// #endif
|
|
|
|
tiplists.value.setdetails({ isshow: false })
|
|
|
|
},
|
|
|
|
cancel: (details) => {
|
|
|
|
tiplists.value.setdetails({ isshow: false })
|
|
|
|
},
|
|
|
|
close: (details) => {
|
|
|
|
tiplists.value.setdetails({ isshow: false })
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
function showsdqs() {
|
|
|
|
tiplists.value.setdetails({
|
|
|
|
isshow: true,
|
|
|
|
tipstate: 1,
|
|
|
|
title: '请输入扫描的码',
|
|
|
|
placeholder: '请输入扫描的码',
|
|
|
|
inputtext: '',
|
|
|
|
success: (detail) => {
|
|
|
|
details.scancode = detail.inputtext
|
|
|
|
scandata()
|
|
|
|
tiplists.value.setdetails({ isshow: false })
|
|
|
|
},
|
|
|
|
cancel: () => {
|
|
|
|
tiplists.value.setdetails({ isshow: false })
|
|
|
|
},
|
|
|
|
close: () => {
|
|
|
|
tiplists.value.setdetails({ isshow: false })
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
async function scandata() {
|
|
|
|
// 查看模式不执行扫描
|
|
|
|
if (Number(details.status) !== 0) return
|
|
|
|
let data = {
|
|
|
|
scanType: 1,
|
|
|
|
orderCode: details.orderCode,
|
|
|
|
packetBarCode: details.scancode,
|
|
|
|
stockupArea: details.stockupArea,
|
|
|
|
reservationId: details.reservationId,
|
|
|
|
allocationId: details.allocationId,
|
|
|
|
stockupId: details.stockupId,
|
|
|
|
typeService: details.typeService
|
|
|
|
}
|
|
|
|
let res = await distributionStockupstockupScan(data)
|
|
|
|
console.log(res);
|
|
|
|
if (res.code == 200) {
|
|
|
|
details.isscan = true
|
|
|
|
// 调用组件刷新函数
|
|
|
|
basicContainer.value.startPullDownRefresh()
|
|
|
|
} else if (res.code === 3001) {
|
|
|
|
// 不在本次任务备货
|
|
|
|
if (res.audio) utils.ttsspke(res.audio)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
async function initpage() {
|
|
|
|
let data = {
|
|
|
|
orderStatus: details.orderStatus,
|
|
|
|
reservationId: details.reservationId,
|
|
|
|
stockArticleId: details.stockArticleId,
|
|
|
|
// stockListId:details.stockListId,
|
|
|
|
allocationId: details.allocationId,
|
|
|
|
allocation: details.allocation,
|
|
|
|
pallet: details.pallet,
|
|
|
|
stockupId: details.stockupId,
|
|
|
|
status: details.status,
|
|
|
|
typeService: details.typeService
|
|
|
|
}
|
|
|
|
let response = await distributionStockuporderInfo(data)
|
|
|
|
if (response.code !== 200) return
|
|
|
|
console.log(response);
|
|
|
|
details.dataList = response.data.packageList
|
|
|
|
details.customer = response.data.customer
|
|
|
|
details.stockupArea = response.data.stockupArea
|
|
|
|
details.planNum = response.data.planNum
|
|
|
|
details.scanNum = response.data.scanNum
|
|
|
|
details.trays = response.data.trays
|
|
|
|
details.warehouseArea = response.data.warehouseArea
|
|
|
|
details.address = response.data.address
|
|
|
|
if (Number(details.scanNum) > 0 && details.isscan) {
|
|
|
|
utils.ttsspke('扫描' + details.scanNum + '件')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const { dataList } = toRefs(details)
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.butbox {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
width: 686upx;
|
|
|
|
margin: auto;
|
|
|
|
margin-top: 20upx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 16upx 0upx;
|
|
|
|
background-color: #ffffff;
|
|
|
|
border-radius: 8upx;
|
|
|
|
|
|
|
|
.scrollv {
|
|
|
|
width: 100%;
|
|
|
|
height: 50vh;
|
|
|
|
// padding: 10upx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
.mabxs {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
padding-top: 5upx;
|
|
|
|
|
|
|
|
.ite {
|
|
|
|
width: 93%;
|
|
|
|
// width: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
padding: 10upx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
border-radius: 8upx;
|
|
|
|
box-shadow: 0upx 2upx 10upx 0upx #e2e2e3;
|
|
|
|
margin-bottom: 20upx;
|
|
|
|
|
|
|
|
>view {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
width: 100%;
|
|
|
|
margin-bottom: 10upx;
|
|
|
|
|
|
|
|
&:nth-last-child(1) {
|
|
|
|
margin-bottom: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
>view {
|
|
|
|
width: 50%;
|
|
|
|
// flex: 1;
|
|
|
|
font-size: 28upx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #092C4D;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.prtbut {
|
|
|
|
margin: auto;
|
|
|
|
margin-top: 20upx;
|
|
|
|
width: 320upx;
|
|
|
|
height: 88upx;
|
|
|
|
background: #D3832A;
|
|
|
|
border-radius: 8upx;
|
|
|
|
font-size: 32upx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #FFFFFF;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.head {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
|
|
|
padding: 20upx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
|
|
|
>.type1 {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
margin: 14upx 0;
|
|
|
|
font-size: 28upx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #092C4D;
|
|
|
|
|
|
|
|
>view {
|
|
|
|
flex: 1;
|
|
|
|
word-wrap: break-word;
|
|
|
|
word-break: break-all;
|
|
|
|
|
|
|
|
&:nth-of-type(1) {
|
|
|
|
margin-right: 30upx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
>.type2 {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin: 14upx 0;
|
|
|
|
font-size: 28upx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #092C4D;
|
|
|
|
|
|
|
|
>view:nth-of-type(2) {
|
|
|
|
width: 50%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
>view:nth-of-type(2) {
|
|
|
|
font-size: 28upx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #0086F1;
|
|
|
|
margin-left: 20upx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|