This commit is contained in:
aihe 2024-07-16 21:25:55 +08:00
parent 5ceb922ffb
commit 8be13768ab
9 changed files with 181 additions and 150 deletions

View File

@ -69,10 +69,11 @@ export const getCaculteSendSite = (data = {})=> {
} }
// 仓库列表 // 仓库列表
export const getListBindSalesmen = (data = {})=> { export const getLisWarehouse = (data = {})=> {
return coreRequest(url.getListBindSalesmen, data, {}, "GET") return coreRequest(url.getLisWarehouse, data, {}, "GET")
} }
// 计算运费 // 计算运费
export const calcWaybillFee = (data = {})=> { export const calcWaybillFee = (data = {})=> {
return coreRequest(url.calcWaybillFee, data, {}) return coreRequest(url.calcWaybillFee, data, {})

View File

@ -30,11 +30,13 @@ export default {
getMonthpayAccountList: `/oms2c/emisMonthpayAccount/listSimple`, // 月结账号列表 -- DONE getMonthpayAccountList: `/oms2c/emisMonthpayAccount/listSimple`, // 月结账号列表 -- DONE
getCaculteDestSite: `/oms2c/emisDestination/getDestSite`, // 自动计算目的地 -- DONE getCaculteDestSite: `/oms2c/emisDestination/getDestSite`, // 自动计算目的地 -- DONE
getCaculteSendSite: `/oms2c/emisDestination/getSendSite`, // 自动计算寄件网点 -- DONE getCaculteSendSite: `/oms2c/emisDestination/getSendSite`, // 自动计算寄件网点 -- DONE
getListBindSalesmen: `/oms2c/emisWaybill/listBindSalesmen`, // 仓库列表 -- DONE getLisWarehouse: `/oms2c/emisWaybill/listWmsWarehouse`, // 仓库列表 -- DONE
getListBindSalesmen: `/oms2c/emisWaybill/listBindSalesmen`, // 绑定业务员列表 -- DONE
bindSalesmen: `/oms2c/emisWaybill/bindSalesmen`, // 绑定业务员 -- DONE
getSendSiteList: `/oms2c/emisSite/listSimple`, // 出发地-网点列表 getSendSiteList: `/oms2c/emisSite/listSimple`, // 出发地-网点列表
calcWaybillFee: `/oms2c/emisWaybill/calcWaybillFee`, // 计算运费 calcWaybillFee: `/oms2c/emisWaybill/calcWaybillFee`, // 计算运费
warehouseInList: `/oms2c/emisWarehouseIn/listSimple`, // 下单-进仓单列表 warehouseInList: `/oms2c/emisWarehouseIn/listSimple`, // 下单-进仓单列表
getOrderList: `/oms2c/emisWaybill/listSimple`, // 订单列表 getOrderList: `/oms2c/emisWaybill/listSimple`, // 订单列表 -- DONE
getOrderDetail: `/oms2c/emisWaybill/getWaybillDetail`, // 订单详情 getOrderDetail: `/oms2c/emisWaybill/getWaybillDetail`, // 订单详情
scanRecord: `/oms2c/emisTmsScanRecord/scan`, // 扫描- 揽收 scanRecord: `/oms2c/emisTmsScanRecord/scan`, // 扫描- 揽收
getRealGetWaybillPrintData: `/oms2c/emisWaybill/realGetPrintList`, // 运单 打印数据 getRealGetWaybillPrintData: `/oms2c/emisWaybill/realGetPrintList`, // 运单 打印数据

View File

@ -17,3 +17,13 @@ export const getInfoByApp = (data = {}, option = {})=> {
return coreRequest(url.getInfoByApp, data, option, 'GET') return coreRequest(url.getInfoByApp, data, option, 'GET')
} }
// 绑定业务员列表
export const getListBindSalesmen = (data = {})=> {
return coreRequest(url.getListBindSalesmen, data, {}, "GET")
}
// 绑定业务员
export const bindSalesmen = (data = {})=> {
return coreRequest(url.bindSalesmen, data, {})
}

View File

@ -179,6 +179,17 @@ const textDecoder = (input)=> {
return decodeURIComponent(escape(String.fromCharCode(...[input]))); return decodeURIComponent(escape(String.fromCharCode(...[input])));
} }
const getQueryObject = (url)=> {
var query = url.split('?')[1];
var obj = {};
query = query.split('&');
query.forEach(query => {
var item = query.split('=');
obj[item[0]] = item[1]; // 当然如果有中文/Unicode字符可以在这里用URIencode方法转码一下
});
return obj;
}
export { export {
getAddressDetail, getAddressDetail,
@ -192,4 +203,5 @@ export {
throttle, throttle,
textEncoder, textEncoder,
textDecoder, textDecoder,
getQueryObject,
} }

View File

@ -1,4 +1,5 @@
<template> <template>
<u-row>
<u-input :placeholder="placeholder" :fontSize="fontSize" :modelValue="value" <u-input :placeholder="placeholder" :fontSize="fontSize" :modelValue="value"
:custom-style="`border-radius: 10rpx;padding: 11rpx 20rpx;${customStyle};`" :custom-style="`border-radius: 10rpx;padding: 11rpx 20rpx;${customStyle};`"
@change="handleInputChange" @change="handleInputChange"
@ -11,6 +12,11 @@
<u-icon @click="handleScan" name="scan" :size="fontSize*1.5"></u-icon> <u-icon @click="handleScan" name="scan" :size="fontSize*1.5"></u-icon>
</template> </template>
</u-input> </u-input>
<view v-if="showConfirm" @click="handleConfirm" class="ml-10">
<u-button custom-style="height: 70rpx;" :plain="true">确认</u-button>
</view>
</u-row>
<tpx-physics-scan @onChange="handleScanChange"></tpx-physics-scan> <tpx-physics-scan @onChange="handleScanChange"></tpx-physics-scan>
</template> </template>
@ -50,6 +56,11 @@
return '' return ''
} }
}, },
showConfirm:{
default () {
return false
}
},
}, },
data() { data() {
}, },
@ -77,6 +88,9 @@
handleScanChange(val){ handleScanChange(val){
this.$emit('scanChange', val) this.$emit('scanChange', val)
this.handleChange(val) this.handleChange(val)
},
handleConfirm(){
this.$emit('confirmClick')
} }
} }
} }

View File

@ -26,7 +26,9 @@
watch: { watch: {
searchParam: { searchParam: {
handler: function(cval, oval) { handler: function(cval, oval) {
if(this.autoReload) {
this.getDataList(true) this.getDataList(true)
}
}, },
deep: true deep: true
} }
@ -41,6 +43,11 @@
} }
}, },
props: { props: {
autoReload: {
default () {
return true
}
},
searchParam: { searchParam: {
default () { default () {
return {} return {}

View File

@ -45,7 +45,7 @@
<view v-if="submitParam.pickupMethod == 1 || submitParam.pickupMethod == 3" class="yunf-input-item"> <view v-if="submitParam.pickupMethod == 1 || submitParam.pickupMethod == 3" class="yunf-input-item">
<tpx-select v-model:value="submitParam.intoWarehouseCode" v-model:text="submitParam.intoWarehouseName" v-model:resObject="wareRes" <tpx-select v-model:value="submitParam.intoWarehouseCode" v-model:text="submitParam.intoWarehouseName" v-model:resObject="wareRes"
:getListFun="getListBindSalesmen" :transKeyVal="{valKey: 'lineCode',titleKey: 'lineName'}" :getListFun="getLisWarehouse" :transKeyVal="{valKey: 'code',titleKey: 'name'}"
:searchParam="wareSearchParam" placeholder="请选择仓库" :searchParam="wareSearchParam" placeholder="请选择仓库"
> >
<tpx-text-item label="仓库" :value="submitParam.intoWarehouseName"></tpx-text-item> <tpx-text-item label="仓库" :value="submitParam.intoWarehouseName"></tpx-text-item>
@ -229,7 +229,7 @@
}, },
methods: { methods: {
getTransLineList: apiService.getTransLineList, getTransLineList: apiService.getTransLineList,
getListBindSalesmen: apiService.getListBindSalesmen, getLisWarehouse: apiService.getLisWarehouse,
getMonthpayAccountList: apiService.getMonthpayAccountList, getMonthpayAccountList: apiService.getMonthpayAccountList,
getDefaultData() { // data的默认数据 getDefaultData() { // data的默认数据
return { return {

View File

@ -5,15 +5,15 @@
<view class="customer_nav_bar"> <view class="customer_nav_bar">
<view class="com-jianju" style="width: 490rpx;"> <view class="com-jianju" style="width: 490rpx;">
<!-- 关键字搜索框 --> <!-- 关键字搜索框 -->
<tpx-search placeholder="请输入运单号/订单号" v-model:value="searchParam.keyword" @change="handleSearchParamChange()" bgColor="#FFF" :timelyTrigger="false"></tpx-search> <tpx-search placeholder="请输入运单号/订单号" v-model:value="searchParam.keyword" @change="handleSearch" bgColor="#FFF" :timelyTrigger="false"></tpx-search>
</view> </view>
<view class="com-jianju" style="padding-top: 40rpx;"> <view class="com-jianju" style="padding-top: 40rpx;">
<u-row justify="between" align="top"> <u-row justify="between" align="top">
<u-col span="9"> <u-col span="9">
<!-- 订单状态 --> <!-- 订单状态 -->
<tpx-tabs :list="dicData.emis_order_status" v-model:value="searchParam.ordStatus" <tpx-tabs :list="dicData.emis_order_status" v-model:value="searchParam.params.waybillStatType"
@tabchange="(val)=> { handleSearchParamChange() }" mode="info" v-slot="curOrdTab" mode="info" v-slot="curOrdTab"
> >
<text slot> <text slot>
(<text>{{curOrdTab.item.val}}</text>) (<text>{{curOrdTab.item.val}}</text>)
@ -22,7 +22,7 @@
</u-col> </u-col>
<u-col span="2"> <u-col span="2">
<!-- 更多查询条件 --> <!-- 更多查询条件 -->
<u-button @click="handleSearchMoreBtn()" :hairline="false" shape="circle" size="mini" custom-style="border-radius: 23rpx;font-size: 26rpx;height: 50rpx;"> <u-button :hairline="false" shape="circle" size="mini" custom-style="border-radius: 23rpx;font-size: 26rpx;height: 50rpx;">
<u-row justify="center"> <u-row justify="center">
<view :style="'padding-right: 4rpx;white-space: nowrap;' + (hasExtSchParam?'color: #B12D29;':'color: #666;')"> <view :style="'padding-right: 4rpx;white-space: nowrap;' + (hasExtSchParam?'color: #B12D29;':'color: #666;')">
{{hasExtSchParam?'已':''}}筛选 {{hasExtSchParam?'已':''}}筛选
@ -147,28 +147,42 @@
}, },
searchParam: { searchParam: {
keyword: '', keyword: '',
ordStatus: dicData.emis_order_status?.[0]?.val _date: [],
params: {
waybillStatType: dicData.emis_order_status?.[0]?.val,
}
}, },
queryOption: { queryOption: {
}, },
resData: { resData: { list: [] }
list: []
}
} }
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
} }
}, },
onShow(){
this.triggerListReload()
this.initData()
},
onLoad(option) { onLoad(option) {
this.queryOption = option this.queryOption = option
this.initData();
}, },
onUnload() { onUnload() {
}, },
methods: { methods: {
getListFun: apiService.getOrderList, transSearchPm(param){
let cpParam = JSON.parse(JSON.stringify(param))
cpParam.params.beginDate = cpParam?._date?.[0]
cpParam.params.endDate = cpParam?._date?.[1]
return cpParam
},
async getListFun(param){
let cpParam = this.transSearchPm(param)
let res = await apiService.getOrderList(cpParam)
return res
},
initData(){ initData(){
}, },
@ -191,9 +205,14 @@
break; break;
} }
}, },
handleSearchParamChange() { handleSearch(){
setTimeout(()=> {
} this.triggerListReload()
}, 300)
},
triggerListReload(){
this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据
},
} }
} }
</script> </script>

View File

@ -1,15 +1,18 @@
<template> <template>
<tpx-page>
<tpx-layout> <tpx-layout>
<template v-slot:header> <template v-slot:header>
</template> </template>
<template v-slot:body> <template v-slot:body>
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom()" class="pos-abt-all" <view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
ref="listRef"
> >
<view class="pgb-header"> <view class="pgb-header">
<view class="com-jianju"> <view class="com-jianju">
<!-- 关键字搜索框 --> <!-- 关键字搜索框 -->
<tpx-search placeholder="请输入工号或手机号码" v-model:value="searchParam.keyword" @change="handleSearchParamChange()" ></tpx-search> <tpx-search placeholder="请输入工号或手机号码" v-model:value="searchParam.searchValue"></tpx-search>
</view> </view>
</view> </view>
@ -17,7 +20,7 @@
<!-- 列表数据 --> <!-- 列表数据 -->
<!-- --> <!-- -->
<view> <view>
<view v-for="(item) in dataList" class="blcok-white radius-20 mb-20" style="margin-top: 0;" <view v-for="(item) in resData.list" class="blcok-white radius-20 mb-20" style="margin-top: 0;"
> >
<view> <view>
@ -46,17 +49,9 @@
</view> </view>
</view> </view>
<!-- 加载更多 -->
<u-loadmore icon-size="28" font-size="28" margin-top="30" v-if="showLoadMore || loadedAll"
:status="loadedAll ? 'nomore' : 'loading'" />
<!-- 空数据页 -->
<view v-if="dataList.length == 0" style="padding-top: 100rpx;">
<u-empty text="无数据" :icon="getCdnUrl('kong.png')" textSize="28" width="86" height="97">
</u-empty>
</view> </view>
</tpx-scroll-view>
</view> </view>
</scroll-view>
</template> </template>
<template v-slot:footer> <template v-slot:footer>
@ -75,18 +70,16 @@
</template> </template>
</tpx-layout> </tpx-layout>
</tpx-page>
</template> </template>
<script> <script>
import getCdnUrl from "@/common/getCdnUrl" import { scanCode } from "@/common/untool"
import { goto, goBack, scanCode, setClipboardData, confirmModal, showLoading } from "@/common/untool" import * as apiService from "@/common/api"
import { getQueryObject } from "@/common/util"
export default { export default {
props: { props: {
// hasLeftWin: {
// type: Boolean
// }
}, },
computed: { computed: {
@ -94,14 +87,10 @@
data() { data() {
return { return {
searchParam: { searchParam: {
keyword: '', searchValue: '',
}, },
queryOption: {}, queryOption: {},
dataList: [ resData: { list: [] },
{},{},{},{},{},{},{},{}
],
showLoadMore: false,
loadedAll: false
} }
}, },
onShareAppMessage() { onShareAppMessage() {
@ -112,54 +101,31 @@
}, },
onLoad(queryOption) { onLoad(queryOption) {
this.queryOption = queryOption this.queryOption = queryOption
this.searchParam.tabType = queryOption.tab || tabList[0].val
this.initData(); this.initData();
}, },
onUnload() { onUnload() {
}, },
methods: { methods: {
goto, getListFun: apiService.getListBindSalesmen,
setClipboardData,
getCdnUrl,
initData(){ initData(){
// showLoading()
setTimeout(() => {
uni.stopPullDownRefresh();
}, 300);
},
setListData() {
}, },
triggerListReload(){
onScrollBottom() { this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据
console.log("onScrollBottom");
if (this.loadedAll) {
return;
}
this.showLoadMore = true;
setTimeout(() => {
this.setListData();
}, 300);
},
handleSearchMoreBtn(){
if(!this.showLoadMore) {
// 回显更多条件
Object.keys(this.tmpSearchParam).map(t=> {
this.tmpSearchParam[t] = this.searchParam[t] || ''
})
}
this.showSearchMore = !this.showSearchMore
}, },
handleItemClick(item){ handleItemClick(item){
if(this.queryOption.type == "choose") { if(this.queryOption.type == "choose") {
goBack() this.goBack()
} else { } else {
goto(`post/post?bindUserId=${item.id}`) this.goto(`post/post?bindUserId=${item.id}`)
} }
}, },
async handleScan() { async handleScan() {
const res = await scanCode() const resData = await scanCode()
debugger let params = getQueryObject(resData)
await apiService.bindSalesmen(params)
this.showToast('绑定成功')
this.triggerListReload()
} }
} }
} }