uu
This commit is contained in:
parent
2d2e099e0d
commit
b295488901
@ -49,6 +49,11 @@ export default {
|
||||
getPreStationList: `/oms2c/emisTmsScanRecord/getPreStationList`, // 获取-扫描上一网点
|
||||
preCalcWaybillFee: `/oms2c/emisWaybill/preCalcWaybillFee`, // 报价试算 -- DONE
|
||||
calcProductFee: `/oms2c/emisWaybill/calcProductFee`, // 下单-报价试算 -- DONE
|
||||
|
||||
deleteBindSalemen: `/oms2c/emisWaybill/deleteBindSalemen`, // 删除绑定快递员 -- DONE
|
||||
setDefaultBindSalesmen: `/oms2c/emisWaybill/setDefaultBindSalesmen`, // 设置默认快递员 -- DONE
|
||||
|
||||
|
||||
queryWaybillTraceInfo: `/oms2c/emisTmsScanRecord/queryWaybillTraceInfo`, // 物流轨迹 -- DONE
|
||||
queryProblemTypeList: `/oms2c/emisProblemType/listSimple`, // 问题件类型列表
|
||||
registerProblemInfo: `/oms2c/emisWaybillProblemInfo/registerProblemInfo`, // 问题件登记
|
||||
|
||||
@ -31,4 +31,14 @@ export const queryNewSalesmen = (data = {})=> {
|
||||
// 绑定业务员
|
||||
export const bindSalesmen = (data = {})=> {
|
||||
return coreRequest(url.bindSalesmen, data, {}, "GET")
|
||||
}
|
||||
}
|
||||
|
||||
// 删除绑定快递员
|
||||
export const deleteBindSalemen = (data = {})=> {
|
||||
return coreRequest(url.deleteBindSalemen, data, {})
|
||||
}
|
||||
|
||||
// 设置默认快递员
|
||||
export const setDefaultBindSalesmen = (data = {})=> {
|
||||
return coreRequest(url.setDefaultBindSalesmen, data, {})
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
<u-row custom-style="margin-top:20rpx;" justify="between">
|
||||
<u-row>
|
||||
<text class="pr-20 clr-sub">默认地址</text>
|
||||
<u-switch v-model="item.blDefaultFlag" @change="handleDefaultSwitch(item)" activeValue="1" active-color="#B12D29" size="34"></u-switch>
|
||||
<u-switch v-model="item.blDefaultFlag" @change="handleDefaultSwitch(item)" activeValue="1" inactiveValue="0" active-color="#B12D29" size="34"></u-switch>
|
||||
</u-row>
|
||||
<u-row>
|
||||
<u-text @click="handleEditItem(item)" text="编辑" prefixIcon="edit-pen" size="26"></u-text>
|
||||
@ -166,14 +166,18 @@
|
||||
}
|
||||
},
|
||||
async handleDefaultSwitch(item) {
|
||||
try{
|
||||
await apiService.setDefaultAddressById({ id: item.id, defaultFlag: Number(!!item.blDefaultFlag), _loading: true })
|
||||
this.showToast('操作成功')
|
||||
this.$refs.listRef.getDataList(true) // 重置到第一页数据
|
||||
}catch(e){
|
||||
// 操作失败,切回按钮状态
|
||||
item.blDefaultFlag = !item.blDefaultFlag
|
||||
}
|
||||
setTimeout(async ()=> {
|
||||
let blDefaultFlag = item.blDefaultFlag
|
||||
try{
|
||||
await apiService.setDefaultAddressById({ id: item.id, defaultFlag: blDefaultFlag, _loading: true })
|
||||
this.showToast('操作成功')
|
||||
this.$refs.listRef.getDataList(true) // 重置到第一页数据
|
||||
}catch(e){
|
||||
// 操作失败,切回按钮状态
|
||||
item.blDefaultFlag = Number(!Number(blDefaultFlag)) + ''
|
||||
}
|
||||
},300)
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,6 +43,19 @@
|
||||
custom-style="height: 54rpx; width:120rpx;margin-left: 12rpx;white-space: nowrap;">去发货</u-button>
|
||||
</u-row>
|
||||
</u-row>
|
||||
|
||||
<u-line color="#DEDEDE" margin="30rpx 0 0 0"></u-line>
|
||||
|
||||
<u-row custom-style="margin-top:20rpx;" justify="between">
|
||||
<u-row>
|
||||
<text class="pr-20 clr-sub">默认</text>
|
||||
<u-switch v-model="item.defaultFlag" @change="handleDefaultSwitch(item)" activeValue="1" inactiveValue="0" active-color="#B12D29" size="34"></u-switch>
|
||||
</u-row>
|
||||
<u-row>
|
||||
<u-text @click="handleDelItem(item)" text="删除" prefixIcon="trash" size="26" margin="0 0 0 20rpx"></u-text>
|
||||
</u-row>
|
||||
</u-row>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -157,8 +170,6 @@
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
// title: '',
|
||||
// path: 'TODO'
|
||||
}
|
||||
},
|
||||
onLoad(queryOption) {
|
||||
@ -187,6 +198,27 @@
|
||||
this.goto(`post/post?bindEmpCode=${item.empCode}&bindEmpName=${item.empName}`)
|
||||
}
|
||||
},
|
||||
async handleDelItem(item) {
|
||||
let bl = await this.confirmModal('确认要删除吗?')
|
||||
if(bl) {
|
||||
await apiService.deleteBindSalemen({ empCode: item.empCode, _loading: true })
|
||||
this.showToast('操作成功')
|
||||
this.$refs.listRef.getDataList(true) // 重置到第一页数据
|
||||
}
|
||||
},
|
||||
async handleDefaultSwitch(item) {
|
||||
setTimeout(async ()=> {
|
||||
let defaultFlag = item.defaultFlag
|
||||
try{
|
||||
await apiService.setDefaultBindSalesmen({ empCode: item.empCode, defaultFlag, _loading: true })
|
||||
this.showToast('操作成功')
|
||||
this.$refs.listRef.getDataList(true) // 重置到第一页数据
|
||||
}catch(e){
|
||||
// 操作失败,切回按钮状态
|
||||
item.defaultFlag = Number(!Number(defaultFlag)) + ''
|
||||
}
|
||||
}, 300)
|
||||
},
|
||||
async handleScan() {
|
||||
const resData = await scanCode()
|
||||
let params = getQueryObject(resData)
|
||||
@ -211,7 +243,7 @@
|
||||
this.bindModal.show = false
|
||||
this.bindSearchModal.show = false
|
||||
this.triggerListReload()
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user