uu
This commit is contained in:
parent
224449d74d
commit
aaaa63663f
@ -7,9 +7,13 @@
|
|||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
let title = this.value
|
let title = this.value
|
||||||
!this.value && this.list && (title = '-');
|
let val = this.value
|
||||||
if(this.value && this.list) {
|
!val && this.list && (title = '-');
|
||||||
title = this.list.filter(t=> t.val == this.value || this.value.indexOf(t.val) > -1).map(t=> t.title).join(",")
|
if(val && this.list) {
|
||||||
|
if(!Array.isArray() && val.split) {
|
||||||
|
val = val.split(",")
|
||||||
|
}
|
||||||
|
title = this.list.filter(t=> t.val == val || (val.indexOf && val.indexOf(t.val) > -1)).map(t=> t.title).join(",")
|
||||||
}
|
}
|
||||||
return title
|
return title
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,9 +22,13 @@
|
|||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
let title = this.value
|
let title = this.value
|
||||||
!this.value && this.list && (title = '请选择');
|
let val = this.value
|
||||||
if(this.value && this.list) {
|
!val && this.list && (title = '请选择');
|
||||||
title = this.list.filter(t=> t.val == this.value || this.value.indexOf(t.val) > -1).map(t=> t.title).join(",")
|
if(val && this.list) {
|
||||||
|
if(!Array.isArray() && val.split) {
|
||||||
|
val = val.split(",")
|
||||||
|
}
|
||||||
|
title = this.list.filter(t=> t.val == val || (val.indexOf && val.indexOf(t.val) > -1)).map(t=> t.title).join(",")
|
||||||
}
|
}
|
||||||
return title
|
return title
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,15 +3,15 @@
|
|||||||
<tpx-layout>
|
<tpx-layout>
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<view class="blcok-white-noradius" style="margin-top: 0;">
|
<view class="blcok-white-noradius" style="margin-top: 0;">
|
||||||
<u-row justify="between">
|
<u-row v-if="submitParam.dispatchOrSendManCode" justify="between">
|
||||||
<view style="flex:1;">
|
<view style="flex:1;">
|
||||||
<tpx-scan-input v-model:value="orderNo" placeholder="请输入或扫码"
|
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
|
||||||
@change="handleScanValChange" iconPos="left"></tpx-scan-input>
|
@change="handleScanValChange" iconPos="left"></tpx-scan-input>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row custom-style="margin-top:20rpx;">
|
<u-row custom-style="margin-top:20rpx;">
|
||||||
<view style="flex: 1;">
|
<view style="flex: 1;">
|
||||||
<tpx-select placeholder="派件员" :isWhite="true"></tpx-select>
|
<tpx-select v-model:value="submitParam.dispatchOrSendManCode" v-model:resObject="paiRes" :getListFun="getRSDStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择派件员" :isWhite="true"></tpx-select>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</u-row>
|
||||||
<view class="mt-20 clr-sub">
|
<view class="mt-20 clr-sub">
|
||||||
@ -50,10 +50,10 @@
|
|||||||
<view v-for="(item, index) in resData.list" class="yditem">
|
<view v-for="(item, index) in resData.list" class="yditem">
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col span="8">
|
<u-col span="8">
|
||||||
<text class="">T2919292</text>
|
<text class="">{{item.billCode}}</text>
|
||||||
</u-col>
|
</u-col>
|
||||||
<u-col span="4">
|
<u-col span="4">
|
||||||
<text class="clr-sub">12-18 13:18</text>
|
<text class="clr-sub">{{item.scanDate}}</text>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</view>
|
</view>
|
||||||
@ -67,7 +67,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</tpx-layout>
|
</tpx-layout>
|
||||||
</tpx-page>
|
</tpx-page>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -75,6 +74,7 @@
|
|||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
|
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "./scanUtil"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp },
|
components:{ BoOperatorTmp },
|
||||||
@ -86,7 +86,11 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderNo: '',
|
paiRes: { list: [] } ,
|
||||||
|
submitParam: {
|
||||||
|
billCode: '',
|
||||||
|
dispatchOrSendManCode: '',
|
||||||
|
},
|
||||||
pageLoading: true,
|
pageLoading: true,
|
||||||
queryOption: {
|
queryOption: {
|
||||||
billCode: '', // 运单id
|
billCode: '', // 运单id
|
||||||
@ -99,8 +103,7 @@
|
|||||||
},
|
},
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
return {
|
return {
|
||||||
// title: '',
|
|
||||||
// path: 'TODO'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
@ -111,12 +114,32 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getRSDStaffList: apiService.getRSDStaffList,
|
||||||
initData() {
|
initData() {
|
||||||
this.orderNo = this.queryOption.billCode || this.queryOption.orderSn
|
this.submitParam.billCode = this.queryOption.billCode || this.queryOption.orderSn
|
||||||
|
},
|
||||||
|
async handleSubmit(val) {
|
||||||
|
let extParam = {}
|
||||||
|
val && (extParam.billCode = val);
|
||||||
|
let daoParam = getScanParams(scanTypeEnum.daoJian, { ...this.submitParam, ...extParam })
|
||||||
|
let daoRes = await apiService.scanRecord({...daoParam, _loading: true})
|
||||||
|
let { bl: daoBl, resItem: daoResItem } = ansScanResponse({ res: daoRes })
|
||||||
|
if(daoBl) {
|
||||||
|
let paiParam = getScanParams(scanTypeEnum.paiJian, { ...this.submitParam, ...extParam })
|
||||||
|
let paiRes = await apiService.scanRecord({...paiParam, _loading: true})
|
||||||
|
let { bl, resItem } = ansScanResponse({ res: paiRes, title: "到派件" })
|
||||||
|
if(bl) {
|
||||||
|
this.resData.list.push({ ...resItem })
|
||||||
|
this.resetForm()
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleScanValChange: debounce(function(val){
|
handleScanValChange: debounce(function(val){
|
||||||
val
|
val && (this.handleSubmit(val))
|
||||||
}),
|
}),
|
||||||
|
resetForm() {
|
||||||
|
this.submitParam.billCode = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<view class="blcok-white-noradius" style="margin-top: 0;">
|
<view class="blcok-white-noradius" style="margin-top: 0;">
|
||||||
<u-row justify="between">
|
<u-row justify="between">
|
||||||
<view style="flex:1;">
|
<view style="flex:1;">
|
||||||
<tpx-scan-input v-model:value="orderNo" placeholder="请输入或扫码"
|
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
|
||||||
@change="handleScanValChange" iconPos="left"></tpx-scan-input>
|
@change="handleScanValChange" iconPos="left"></tpx-scan-input>
|
||||||
</view>
|
</view>
|
||||||
<view style="">
|
<view style="">
|
||||||
@ -40,10 +40,10 @@
|
|||||||
<view v-for="(item, index) in resData.list" class="yditem">
|
<view v-for="(item, index) in resData.list" class="yditem">
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col span="8">
|
<u-col span="8">
|
||||||
<text class="">T2919292</text>
|
<text class="">{{item.billCode}}</text>
|
||||||
</u-col>
|
</u-col>
|
||||||
<u-col span="4">
|
<u-col span="4">
|
||||||
<text class="clr-sub">12-18 13:18</text>
|
<text class="clr-sub">{{item.scanDate}}</text>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</view>
|
</view>
|
||||||
@ -64,6 +64,7 @@
|
|||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
|
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "./scanUtil"
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp },
|
components:{ BoOperatorTmp },
|
||||||
props: {
|
props: {
|
||||||
@ -74,7 +75,9 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderNo: '',
|
submitParam: {
|
||||||
|
billCode: ''
|
||||||
|
},
|
||||||
pageLoading: true,
|
pageLoading: true,
|
||||||
queryOption: {
|
queryOption: {
|
||||||
billCode: '', // 运单id
|
billCode: '', // 运单id
|
||||||
@ -100,11 +103,25 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData() {
|
initData() {
|
||||||
this.orderNo = this.queryOption.billCode || this.queryOption.orderSn
|
this.submitParam.billCode = this.queryOption.billCode || this.queryOption.orderSn
|
||||||
|
},
|
||||||
|
async handleSubmit(val) {
|
||||||
|
let extParam = {}
|
||||||
|
val && (extParam.billCode = val);
|
||||||
|
let scnParam = getScanParams(scanTypeEnum.daoJian, { ...this.submitParam, ...extParam })
|
||||||
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
|
let { bl, resItem } = ansScanResponse({ res, title: "到件" })
|
||||||
|
if(bl) {
|
||||||
|
this.resData.list.push({ ...resItem })
|
||||||
|
this.resetForm()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleScanValChange: debounce(function(val){
|
handleScanValChange: debounce(function(val){
|
||||||
val
|
val && (this.handleSubmit(val))
|
||||||
}),
|
}),
|
||||||
|
resetForm() {
|
||||||
|
this.submitParam.billCode = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -3,15 +3,15 @@
|
|||||||
<tpx-layout>
|
<tpx-layout>
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<view class="blcok-white-noradius" style="margin-top: 0;">
|
<view class="blcok-white-noradius" style="margin-top: 0;">
|
||||||
<u-row justify="between">
|
<u-row v-if="submitParam.dispatchOrSendManCode" justify="between">
|
||||||
<view style="flex:1;">
|
<view style="flex:1;">
|
||||||
<tpx-scan-input v-model:value="orderNo" placeholder="请输入或扫码"
|
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入或扫码"
|
||||||
@change="handleScanValChange" iconPos="left"></tpx-scan-input>
|
@change="handleScanValChange" iconPos="left"></tpx-scan-input>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row custom-style="margin-top:20rpx;">
|
<u-row custom-style="margin-top:20rpx;">
|
||||||
<view style="flex: 1;">
|
<view style="flex: 1;">
|
||||||
<tpx-select placeholder="派件员" :isWhite="true"></tpx-select>
|
<tpx-select v-model:value="submitParam.dispatchOrSendManCode" v-model:resObject="paiRes" :getListFun="getRSDStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择派件员" :isWhite="true"></tpx-select>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</u-row>
|
||||||
<view class="mt-20 clr-sub">
|
<view class="mt-20 clr-sub">
|
||||||
@ -50,10 +50,10 @@
|
|||||||
<view v-for="(item, index) in resData.list" class="yditem">
|
<view v-for="(item, index) in resData.list" class="yditem">
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col span="8">
|
<u-col span="8">
|
||||||
<text class="">T2919292</text>
|
<text class="">{{item.billCode}}</text>
|
||||||
</u-col>
|
</u-col>
|
||||||
<u-col span="4">
|
<u-col span="4">
|
||||||
<text class="clr-sub">12-18 13:18</text>
|
<text class="clr-sub">{{item.scanDate}}</text>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</view>
|
</view>
|
||||||
@ -74,6 +74,8 @@
|
|||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
|
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "./scanUtil"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp },
|
components:{ BoOperatorTmp },
|
||||||
props: {
|
props: {
|
||||||
@ -84,7 +86,11 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderNo: '',
|
paiRes: { list: [] } ,
|
||||||
|
submitParam: {
|
||||||
|
billCode: '',
|
||||||
|
dispatchOrSendManCode: '',
|
||||||
|
},
|
||||||
pageLoading: true,
|
pageLoading: true,
|
||||||
queryOption: {
|
queryOption: {
|
||||||
billCode: '', // 运单id
|
billCode: '', // 运单id
|
||||||
@ -108,12 +114,27 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getRSDStaffList: apiService.getRSDStaffList,
|
||||||
initData() {
|
initData() {
|
||||||
this.orderNo = this.queryOption.billCode || this.queryOption.orderSn
|
this.submitParam.billCode = this.queryOption.billCode || this.queryOption.orderSn
|
||||||
|
},
|
||||||
|
async handleSubmit(val) {
|
||||||
|
let extParam = {}
|
||||||
|
val && (extParam.billCode = val);
|
||||||
|
let scnParam = getScanParams(scanTypeEnum.paiJian, { ...this.submitParam, ...extParam })
|
||||||
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
|
let { bl, resItem } = ansScanResponse({ res, title: "派件" })
|
||||||
|
if(bl) {
|
||||||
|
this.resData.list.push({ ...resItem })
|
||||||
|
this.resetForm()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleScanValChange: debounce(function(val){
|
handleScanValChange: debounce(function(val){
|
||||||
val
|
val && (this.handleSubmit(val))
|
||||||
}),
|
}),
|
||||||
|
resetForm() {
|
||||||
|
this.submitParam.billCode = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -73,6 +73,7 @@
|
|||||||
import BoDetailTmp from "@/components/buns-order-templates/bo-detail-tmp"
|
import BoDetailTmp from "@/components/buns-order-templates/bo-detail-tmp"
|
||||||
import BpeGoodsizeTmp from "@/components/buns-post-edit-templates/bpe-goodsize-tmp"
|
import BpeGoodsizeTmp from "@/components/buns-post-edit-templates/bpe-goodsize-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "./scanUtil"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { BpeAddressjiamiTmp, BpeGooditemEditTmp, BpeGoodphotoTmp, BoDetailTmp, BpeGoodsizeTmp },
|
components: { BpeAddressjiamiTmp, BpeGooditemEditTmp, BpeGoodphotoTmp, BoDetailTmp, BpeGoodsizeTmp },
|
||||||
@ -131,17 +132,19 @@
|
|||||||
},
|
},
|
||||||
async handleLanShou() {
|
async handleLanShou() {
|
||||||
await apiService.submitOrder({...this.submitParam, _loading: true})
|
await apiService.submitOrder({...this.submitParam, _loading: true})
|
||||||
let scnParam = {
|
let scnParam = getScanParams(scanTypeEnum.lanShou, {
|
||||||
scanType: 10, // 揽收
|
billCode: this.submitParam.billCode,
|
||||||
opType: 2,
|
dispatchOrSendManCode: this.submitParam.dispatchOrSendManCode,
|
||||||
scanData: [{
|
})
|
||||||
billCode: this.submitParam.billCode,
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
dispatchOrSendManCode: this.submitParam.dispatchOrSendManCode,
|
let { bl, resItem } = ansScanResponse({ res, title: "揽收" })
|
||||||
scanDate: dayjs().format("YYYY-MM-DD HH:mm:ss")
|
if(bl) {
|
||||||
}]
|
this.resetForm()
|
||||||
}
|
}
|
||||||
await apiService.scanRecord({...scnParam, _loading: true})
|
},
|
||||||
this.showToast('揽收成功')
|
resetForm() {
|
||||||
|
this.submitParam = {}
|
||||||
|
this.orderNo = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,6 +71,8 @@
|
|||||||
import dayjs from "dayjs"
|
import dayjs from "dayjs"
|
||||||
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
|
import BoOperatorTmp from "@/components/buns-order-templates/bo-operator-tmp"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
|
import { scanTypeEnum, getScanParams, ansScanResponse } from "./scanUtil"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{ BoOperatorTmp },
|
components:{ BoOperatorTmp },
|
||||||
props: {
|
props: {
|
||||||
@ -115,29 +117,22 @@
|
|||||||
this.submitParam.billCode = this.queryOption.billCode || this.queryOption.orderSn
|
this.submitParam.billCode = this.queryOption.billCode || this.queryOption.orderSn
|
||||||
},
|
},
|
||||||
async handleSubmit(val) {
|
async handleSubmit(val) {
|
||||||
this.submitParam.scanDate = dayjs().format("YYYY-MM-DD HH:mm:ss")
|
let extParam = {}
|
||||||
let scnParam = {
|
val && (extParam.billCode = val);
|
||||||
scanType: 20, // 发件
|
let scnParam = getScanParams(scanTypeEnum.faJian, { ...this.submitParam, ...extParam })
|
||||||
opType: 2,
|
|
||||||
scanData: [{
|
|
||||||
...this.submitParam
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
val && (scnParam.billCode = val);
|
|
||||||
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
let res = await apiService.scanRecord({...scnParam, _loading: true})
|
||||||
let result = res?.data?.scanResult?.[0]?.result
|
let { bl, resItem } = ansScanResponse({ res, title: "发件" })
|
||||||
if(result == "success") {
|
if(bl) {
|
||||||
this.resData.list.push({
|
this.resData.list.push({ ...resItem })
|
||||||
...this.submitParam
|
this.resetForm()
|
||||||
})
|
|
||||||
this.showToast('发件成功')
|
|
||||||
} else {
|
|
||||||
this.showToast(res?.data?.scanResult?.[0]?.message || '发件失败')
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleScanValChange: debounce(function(val){
|
handleScanValChange: debounce(function(val){
|
||||||
this.handleSubmit(val)
|
val && (this.handleSubmit(val))
|
||||||
}),
|
}),
|
||||||
|
resetForm() {
|
||||||
|
this.submitParam.billCode = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
36
pages/deliveryDeal/scanUtil.js
Normal file
36
pages/deliveryDeal/scanUtil.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import dayjs from "dayjs"
|
||||||
|
import { showToast } from "@/common/untool"
|
||||||
|
|
||||||
|
export const scanTypeEnum = {
|
||||||
|
lanShou: 10, // 揽收
|
||||||
|
faJian: 20, // 发件
|
||||||
|
daoJian: 30, // 到件
|
||||||
|
paiJian: 40, // 派件
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getScanParams = (type, model = {})=> {
|
||||||
|
return {
|
||||||
|
scanType: type, // 扫描类型
|
||||||
|
opType: 2, // 确认 动作
|
||||||
|
scanData: [{
|
||||||
|
...model,
|
||||||
|
scanDate: dayjs().format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ansScanResponse = ({ res, title })=> {
|
||||||
|
let resItem = res?.data?.scanResult?.[0] || {}
|
||||||
|
let result = resItem?.result
|
||||||
|
let bl = false
|
||||||
|
if(result == "success") {
|
||||||
|
bl = true
|
||||||
|
title && showToast(`${title}成功`)
|
||||||
|
} else {
|
||||||
|
this.showToast(res?.data?.scanResult?.[0]?.message || `${title}失败`)
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
bl,
|
||||||
|
resItem,
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user