29 changed files with 2304 additions and 882 deletions
@ -1,45 +1,46 @@
|
||||
export interface pagedetails{ |
||||
export interface pagedetails { |
||||
/**筛选状态中文 |
||||
* */ |
||||
schanvalue:string; |
||||
schanvalue : string; |
||||
/**可筛选状态 |
||||
* */ |
||||
typearr:{ |
||||
value:number; |
||||
label:string; |
||||
typearr : { |
||||
value : number; |
||||
label : string; |
||||
}[]; |
||||
/**订单状态 |
||||
* */ |
||||
orderStatus:number; |
||||
orderStatus : number; |
||||
/**订单状态 |
||||
* */ |
||||
orderType:number; |
||||
orderType : number; |
||||
/**自提单ID |
||||
* */ |
||||
billLadingId:number|string; |
||||
billLadingId : number | string; |
||||
/**返回的数据 |
||||
* */ |
||||
datalist:any; |
||||
datalist : any; |
||||
/**订单自编码,用户输入的 |
||||
* */ |
||||
orderCode:string; |
||||
orderCode : string; |
||||
/**订单总数 |
||||
* */ |
||||
orderNum:string|number; |
||||
orderNum : string | number; |
||||
/**齐套总数 |
||||
* */ |
||||
completeNum:string|number; |
||||
completeNum : string | number; |
||||
/**库存品数 |
||||
* */ |
||||
inventoryNub:string|number; |
||||
inventoryNub : string | number; |
||||
/**自提件数 |
||||
* */ |
||||
planNum:string|number; |
||||
planNum : string | number; |
||||
/**签收总数 |
||||
* */ |
||||
signedNum:string|number; |
||||
signedNum : string | number; |
||||
/**扫描结果 |
||||
* */ |
||||
scancode:string|number; |
||||
|
||||
scancode : string | number; |
||||
/** 是否为扫描后刷新 */ |
||||
isscan : boolean |
||||
} |
@ -0,0 +1,594 @@
|
||||
<template> |
||||
<BasicContainer ref="basicContainer" :option="option"> |
||||
<template #head> |
||||
<view class="hdstop"> |
||||
<view class="khxb"> |
||||
<view>客户:{{items.consignee}}</view> |
||||
<view>地址:{{items.deliveryAddress}}</view> |
||||
<view>电话:{{items.deliveryPhone}}</view> |
||||
<view class="butlur" @click="showsdqs"> |
||||
录入包条码 |
||||
</view> |
||||
</view> |
||||
<view class="tps"> |
||||
<view> |
||||
<view>计划件数</view> |
||||
<view>{{details.Plannednub}}</view> |
||||
</view> |
||||
<view> |
||||
<view>配送件数</view> |
||||
<view>{{items.reservationNum}}</view> |
||||
</view> |
||||
<view> |
||||
<view>签收件数</view> |
||||
<view>{{details.signNub}}</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<template #body> |
||||
<view class="main" @touchmove.stop> |
||||
<!-- 表格表头 --> |
||||
<view class="main_row main_title"> |
||||
<view class=""> |
||||
包条码 |
||||
</view> |
||||
|
||||
<view class=""> |
||||
品类 |
||||
</view> |
||||
|
||||
<view class=""> |
||||
签收状态 |
||||
</view> |
||||
|
||||
<view class=""> |
||||
异常状态 |
||||
</view> |
||||
</view> |
||||
|
||||
<view :style="{height: details.jpScorllViewHeight}" code="id" class="jpScorllView"> |
||||
<block v-for="item in datalist" :key="item.orderCode"> |
||||
<view class="main_row"> |
||||
<view class=""> |
||||
{{item.orderPackageCode}} |
||||
</view> |
||||
|
||||
<view class=""> |
||||
{{item.typeName || '库存品'}} |
||||
</view> |
||||
|
||||
<view class=""> |
||||
{{item.orderPackageStatus === '70'?'已签':'未签'}} |
||||
</view> |
||||
|
||||
<view class=""> |
||||
{{item.isAbnnormalSigningName ||item.isAbnormalLoadingName|| '/'}} |
||||
</view> |
||||
</view> |
||||
</block> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
</BasicContainer> |
||||
|
||||
<tips ref="tip"></tips> |
||||
<tiplist ref="tiplists"></tiplist> |
||||
<!-- #ifdef APP --> |
||||
<saomiao2 :ishidestop="scanState !== 0"></saomiao2> |
||||
<!-- #endif --> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import { |
||||
signfororder, |
||||
signforinventory, |
||||
signforsignfor, |
||||
signforsignforIn, |
||||
signforsignforcontinue, |
||||
} from '@/api/user.js' |
||||
import { |
||||
onLoad, |
||||
onShow, |
||||
onPullDownRefresh |
||||
} from '@dcloudio/uni-app' |
||||
import { computed, inject, nextTick, onMounted, reactive, ref, toRefs } from "vue"; |
||||
import useSystemSettingsStore from '@/store/useSystemSettingsStore'; |
||||
import { storeToRefs } from 'pinia'; |
||||
import utils from '@/utils/utils.js'; |
||||
const { scanState } = storeToRefs(useSystemSettingsStore()) |
||||
|
||||
const option = { |
||||
title: '客户包件扫描', |
||||
haveData: true, |
||||
async pullDownRefreshInitPage() { |
||||
return await initpage() |
||||
|
||||
}, |
||||
} |
||||
|
||||
let details = reactive({ |
||||
schanvalue: '', |
||||
typearr: [ |
||||
{ |
||||
value: 3, |
||||
label: '齐套' |
||||
}, |
||||
{ |
||||
value: 2, |
||||
label: '部分扫' |
||||
}, |
||||
{ |
||||
value: 1, |
||||
label: '未扫' |
||||
} |
||||
], |
||||
items: {} as any, |
||||
datalist: [] as any, |
||||
orderArr: [], |
||||
zeroArr: [], |
||||
stockArr: [], |
||||
id: '', |
||||
orderStatus: 1, |
||||
scancode: '', |
||||
deliveryId: '', |
||||
orderType: '' as string | number, |
||||
inputtxt: '', |
||||
listcheckindex: -1, |
||||
scrollHeight: '', |
||||
/** 计划件数 */ |
||||
Plannednub: 0, |
||||
/** 滚动区高度 */ |
||||
jpScorllViewHeight: '', |
||||
/** 签收数 */ |
||||
signNub: 0, |
||||
}) |
||||
const tiplists = ref(null) |
||||
const tip = ref(null) |
||||
|
||||
const ordNub = computed(() => { |
||||
let num = 0 |
||||
num += details.orderArr.length |
||||
num += details.zeroArr.length |
||||
return num |
||||
}) |
||||
|
||||
onLoad(async (op) => { |
||||
console.log('op :>> ', op); |
||||
// #ifdef APP |
||||
utils.ttsspke('请扫描包条码') |
||||
// #endif |
||||
|
||||
// 获取路由中传递数据 |
||||
details.items = JSON.parse(op.item) |
||||
details.id = JSON.parse(op.item).id |
||||
details.deliveryId = op.deliveryId |
||||
}) |
||||
|
||||
onShow(async () => { |
||||
try { |
||||
// #ifdef APP |
||||
uni.$off('scancodedate') |
||||
uni.$on('scancodedate', function (code) { |
||||
if (code) { |
||||
// 关闭弹窗 |
||||
tip.value.setdetails({ isshow: false }) |
||||
|
||||
console.log(code); |
||||
details.scancode = code |
||||
scandata() |
||||
} |
||||
}) |
||||
// #endif |
||||
|
||||
// 初始化请求页面数据 |
||||
let data = { |
||||
reservationId: details.items.id, |
||||
completecode: details.orderType, |
||||
orderCode: details.inputtxt |
||||
} |
||||
details.datalist = [] |
||||
|
||||
const promise1 = signfororder(data, { isShowLoading: false }) |
||||
const promise2 = signforinventory(data, { isShowLoading: false }) |
||||
|
||||
uni.showLoading() |
||||
const [response, response1] = await Promise.all([promise1, promise2]) |
||||
// 零担和定制品 |
||||
// let response = null |
||||
// response = await signfororder(data) |
||||
if (response.code !== 200) return |
||||
details.zeroArr = [] |
||||
details.orderArr = [] |
||||
if (response.data) response.data.forEach(val => { |
||||
// 零担订单 |
||||
if (val.isZero === '1') return details.zeroArr.push(val) |
||||
|
||||
if (val.isZero !== '1') details.datalist = [...details.datalist, ...val.distributionAppParcelListVOS] |
||||
|
||||
// 异常签收 |
||||
val.abnormalSignature = 0 |
||||
// 异常装车 |
||||
val.abnormalLoading = 0 |
||||
val.distributionAppParcelListVOS.forEach(value => { |
||||
if (value.isAbnnormalSigning === 1) val.abnormalSignature += 1 |
||||
if (value.isAbnormalLoading === 1) val.abnormalLoading += 1 |
||||
if (val.isZero !== '1') value.typeName = '定制品' |
||||
}) |
||||
|
||||
details.orderArr.push(val) |
||||
}) |
||||
// 库存品 |
||||
if (response1.code !== 200) return |
||||
if (response1.data) { |
||||
details.stockArr = response1.data || [] |
||||
details.datalist = [...details.datalist, ...details.stockArr] |
||||
} |
||||
|
||||
|
||||
computedNum() |
||||
} catch (err) { |
||||
console.log('err :>> ', err); |
||||
//TODO handle the exception |
||||
} finally { |
||||
await nextTick() |
||||
uni.hideLoading() |
||||
} |
||||
}) |
||||
|
||||
// onHide(() => { |
||||
// uni.$off('scancodedate') |
||||
// }) |
||||
|
||||
onMounted(async () => { |
||||
await nextTick() |
||||
|
||||
details.jpScorllViewHeight = await utils.getViewDistanceFormTop('.jpScorllView') |
||||
}) |
||||
|
||||
function goorderdetail(item) { |
||||
uni.navigateTo({ |
||||
url: '/pagesHome/pages/orderDetails/orderDetails?orderCode=' + item.orderCode |
||||
}) |
||||
} |
||||
|
||||
/** 计算数据 */ |
||||
function computedNum() { |
||||
const _arr = [...details.orderArr, ...details.stockArr] |
||||
|
||||
details.Plannednub = 0 |
||||
details.signNub = 0 |
||||
|
||||
for (let item of _arr) { |
||||
details.Plannednub += item.reservationNum |
||||
details.signNub += item.signforNub |
||||
} |
||||
} |
||||
|
||||
// 页面下拉刷新 |
||||
onPullDownRefresh(async () => { |
||||
await initpage() |
||||
// 关闭下拉动画 |
||||
uni.stopPullDownRefresh() |
||||
|
||||
}) |
||||
async function scandata() { |
||||
let data = { |
||||
barcode: details.scancode, |
||||
deliveryId: details.deliveryId, |
||||
reservationId: details.id, |
||||
} |
||||
// 定制品 |
||||
if (Number(details.orderStatus) == 1) { |
||||
let response = await signforsignfor(data) |
||||
console.log(response); |
||||
if (response.code === 200) { |
||||
// const num = details.datalist.reduce((curr, item) => curr + item.signforNub, 0) |
||||
// #ifdef APP |
||||
// utils.ttsspke(num + '件') |
||||
// #endif |
||||
} |
||||
else if (response.code == 3006) { |
||||
// #ifdef APP |
||||
utils.ttsspke('是否异常签收') |
||||
// #endif |
||||
tip.value.setdetails({ |
||||
isshow: true, |
||||
content: '请确认是否异常签收', |
||||
success: async () => { |
||||
let data = { |
||||
barcode: details.scancode, |
||||
deliveryId: details.deliveryId, |
||||
reservationId: details.id |
||||
} |
||||
let response = await signforsignforcontinue(data) |
||||
if (response.code !== 200) return |
||||
console.log(response); |
||||
uni.showToast({ |
||||
title: response.msg, |
||||
icon: 'none' |
||||
}) |
||||
initpage() |
||||
tip.value.setdetails({ isshow: false }) |
||||
}, |
||||
cancel: () => { |
||||
tip.value.setdetails({ isshow: false }) |
||||
}, |
||||
close: () => { |
||||
tip.value.setdetails({ isshow: false }) |
||||
} |
||||
}) |
||||
|
||||
return |
||||
} else { |
||||
uni.showToast({ |
||||
title: response.msg, |
||||
icon: 'none' |
||||
}) |
||||
} |
||||
} else if (Number(details.orderStatus) === 3) { |
||||
// data.barcode="23072405915-2" |
||||
let response = await signforsignforIn(data) |
||||
console.log(response); |
||||
if (response.code == 3006) { |
||||
tip.value.setdetails({ |
||||
isshow: true, |
||||
content: '请确认是否异常签收', |
||||
success: async () => { |
||||
let data = { |
||||
barcode: details.scancode, |
||||
deliveryId: details.deliveryId, |
||||
reservationId: details.id |
||||
} |
||||
let response = await signforsignforcontinue(data) |
||||
console.log(response); |
||||
if (response.code !== 200) return |
||||
uni.showToast({ |
||||
title: response.msg, |
||||
icon: 'none' |
||||
}) |
||||
initpage() |
||||
tip.value.setdetails({ isshow: false }) |
||||
}, |
||||
cancel: () => { |
||||
tip.value.setdetails({ isshow: false }) |
||||
}, |
||||
close: () => { |
||||
tip.value.setdetails({ isshow: false }) |
||||
} |
||||
}) |
||||
return |
||||
} else { |
||||
uni.showToast({ |
||||
title: response.msg, |
||||
icon: 'none' |
||||
}) |
||||
} |
||||
} |
||||
initpage() |
||||
} |
||||
|
||||
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 initpage() { |
||||
try { |
||||
details.listcheckindex = -1 |
||||
|
||||
let data = { |
||||
reservationId: details.id, |
||||
completecode: details.orderType, |
||||
orderCode: details.inputtxt, |
||||
} |
||||
details.datalist = [] |
||||
let response = null; |
||||
// 定制品和零担 |
||||
if (details.orderStatus == 1 || details.orderStatus === 2) { |
||||
response = await signfororder(data) |
||||
if (response.code !== 200) return |
||||
details.zeroArr = [] |
||||
details.orderArr = [] |
||||
response.data.forEach(val => { |
||||
// 零担订单 |
||||
if (val.isZero === '1') return details.zeroArr.push(val) |
||||
|
||||
// 异常签收 |
||||
val.abnormalSignature = 0 |
||||
// 异常装车 |
||||
val.abnormalLoading = 0 |
||||
val.distributionAppParcelListVOS.forEach(value => { |
||||
if (value.isAbnnormalSigning === 1) val.abnormalSignature += 1 |
||||
if (value.isAbnormalLoading === 1) val.abnormalLoading += 1 |
||||
}) |
||||
|
||||
console.log('val :>> ', val); |
||||
|
||||
details.orderArr.push(val) |
||||
}) |
||||
} |
||||
// 库存品 |
||||
else if (details.orderStatus == 3) { |
||||
response = await signforinventory(data) |
||||
if (response.code !== 200) return |
||||
details.stockArr = response.data || [] |
||||
} |
||||
// 定制品 |
||||
if (details.orderStatus === 1) details.datalist = details.orderArr |
||||
// 零担 |
||||
else if (details.orderStatus === 2) details.datalist = details.zeroArr |
||||
// 库存品 |
||||
else details.datalist = details.stockArr |
||||
} catch (err) { |
||||
console.log('err :>> ', err); |
||||
//TODO handle the exception |
||||
} finally { |
||||
computedNum() |
||||
return null |
||||
} |
||||
} |
||||
|
||||
function setcheckindex(index : number) { |
||||
if (details.listcheckindex == index) { |
||||
details.listcheckindex = -1 |
||||
} else { |
||||
details.listcheckindex = index |
||||
} |
||||
|
||||
} |
||||
|
||||
const { listcheckindex, inputtxt, orderStatus, datalist, items, typearr, schanvalue } = toRefs(details) |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.butlur { |
||||
width: 200upx !important; |
||||
height: 64upx !important; |
||||
background: #D3832A; |
||||
border-radius: 8upx; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
font-size: 32upx; |
||||
font-weight: 400; |
||||
color: #FFFFFF; |
||||
} |
||||
|
||||
// 头部 |
||||
.hdstop { |
||||
width: 100%; |
||||
padding: 20upx; |
||||
background-color: #fff; |
||||
box-sizing: border-box; |
||||
font-size: 28upx; |
||||
font-weight: 400; |
||||
color: #092C4D; |
||||
margin-bottom: 20upx; |
||||
|
||||
>.khxb { |
||||
display: flex; |
||||
align-items: flex-start; |
||||
margin-bottom: 10upx; |
||||
flex-wrap: wrap; |
||||
|
||||
>view { |
||||
width: 50%; |
||||
margin-bottom: 20upx; |
||||
} |
||||
} |
||||
|
||||
>.tps { |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-around; |
||||
|
||||
>view { |
||||
display: flex; |
||||
align-items: center; |
||||
flex-direction: column; |
||||
|
||||
&:nth-of-type(1) { |
||||
>view:nth-of-type(2) { |
||||
color: #092C4D; |
||||
} |
||||
} |
||||
|
||||
&:nth-of-type(2) { |
||||
>view:nth-of-type(2) { |
||||
color: #0086F1; |
||||
} |
||||
} |
||||
|
||||
&:nth-of-type(3) { |
||||
>view:nth-of-type(2) { |
||||
color: #3AD8BC; |
||||
} |
||||
} |
||||
|
||||
&:nth-of-type(4) { |
||||
>view:nth-of-type(2) { |
||||
color: #FA8C16; |
||||
} |
||||
} |
||||
|
||||
>view:nth-of-type(2) { |
||||
font-size: 36upx; |
||||
font-weight: 400; |
||||
margin-top: 10upx; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
// 主体内容 |
||||
.main { |
||||
overflow-x: scroll; |
||||
position: relative; |
||||
background: #fff; |
||||
} |
||||
|
||||
.main_title { |
||||
// position: absolute; |
||||
width: 100%; |
||||
|
||||
>view { |
||||
background: #eee; |
||||
} |
||||
} |
||||
|
||||
.main_row { |
||||
display: flex; |
||||
|
||||
>view { |
||||
padding: 10upx 5upx; |
||||
font-size: 0.9rem; |
||||
word-break: break-all; |
||||
text-align: center; |
||||
border-bottom: 1upx dashed #999; |
||||
|
||||
&:nth-child(1) { |
||||
width: 240upx; |
||||
flex: none; |
||||
} |
||||
|
||||
&:nth-child(2) { |
||||
width: 120upx; |
||||
flex: none; |
||||
} |
||||
|
||||
&:nth-child(3) { |
||||
width: 240upx; |
||||
flex: none; |
||||
} |
||||
|
||||
&:nth-child(4) { |
||||
width: 240upx; |
||||
flex: none; |
||||
} |
||||
|
||||
.main_tip {} |
||||
} |
||||
} |
||||
|
||||
// .jpScorllView { |
||||
// overflow-y: scroll; |
||||
// } |
||||
</style> |
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue