diff --git a/common/api/url.js b/common/api/url.js index 23e48ce..9550991 100644 --- a/common/api/url.js +++ b/common/api/url.js @@ -32,6 +32,7 @@ export default { getCaculteSendSite: `/oms2c/emisDestination/getSendSite`, // 自动计算寄件网点 -- DONE getLisWarehouse: `/oms2c/emisWaybill/listWmsWarehouse`, // 仓库列表 -- DONE getListBindSalesmen: `/oms2c/emisWaybill/listBindSalesmen`, // 绑定业务员列表 -- DONE + queryNewSalesmen: `/oms2c/emisWaybill/queryNewSalesmen`, // 查询所有业务员-根据手机号等条件 -- DONE bindSalesmen: `/oms2c/emisWaybill/bindSalesmen`, // 绑定业务员 -- DONE getSendSiteList: `/oms2c/emisSite/listSimple`, // 出发地-网点列表 calcWaybillFee: `/oms2c/emisWaybill/calcWaybillFee`, // 计算运费 diff --git a/common/api/user.js b/common/api/user.js index 3fc5cc4..23f55ab 100644 --- a/common/api/user.js +++ b/common/api/user.js @@ -23,6 +23,11 @@ export const getListBindSalesmen = (data = {})=> { return coreRequest(url.getListBindSalesmen, data, {}, "GET") } +// 查询所有业务员-根据手机号等条件 +export const queryNewSalesmen = (data = {})=> { + return coreRequest(url.queryNewSalesmen, data, {}, "GET") +} + // 绑定业务员 export const bindSalesmen = (data = {})=> { return coreRequest(url.bindSalesmen, data, {}, "GET") diff --git a/pages/user/exclusiveCourier.vue b/pages/user/exclusiveCourier.vue index ddeed10..be84206 100644 --- a/pages/user/exclusiveCourier.vue +++ b/pages/user/exclusiveCourier.vue @@ -51,21 +51,76 @@ - + + + + + + + + + + + + + + + + + @@ -90,6 +145,14 @@ type: '', // 'choose' 选择操作 }, resData: { list: [] }, + bindModal: { + show: false, + data: {} + }, + bindSearchModal: { + show: false, + data: {} + } } }, onShareAppMessage() { @@ -127,10 +190,28 @@ async handleScan() { const resData = await scanCode() let params = getQueryObject(resData) - await apiService.bindSalesmen(params) - this.showToast('绑定成功') - this.triggerListReload() + await apiService.bindSalesmen({ ...params, _loading: true }) + this.bindSucceed() }, + handleBindShow(item={}) { + this.bindModal.show = true + this.bindModal.data = {} + }, + async handleBindSearchEmp(item={}) { + let res = await apiService.queryNewSalesmen({ ...this.bindModal.data, _loading: true }) + this.bindSearchModal.show = true + this.bindSearchModal.data = res.data || {} + }, + async handleConfirmBind(){ + let res = await apiService.bindSalesmen({ ...this.bindSearchModal.data, _loading: true }) + this.bindSucceed() + }, + bindSucceed(){ + this.showToast('绑定成功') + this.bindModal.show = false + this.bindSearchModal.show = false + this.triggerListReload() + } } }