This commit is contained in:
aihe 2024-07-31 01:50:29 +08:00
parent 2d2e099e0d
commit b295488901
4 changed files with 64 additions and 13 deletions

View File

@ -49,6 +49,11 @@ export default {
getPreStationList: `/oms2c/emisTmsScanRecord/getPreStationList`, // 获取-扫描上一网点 getPreStationList: `/oms2c/emisTmsScanRecord/getPreStationList`, // 获取-扫描上一网点
preCalcWaybillFee: `/oms2c/emisWaybill/preCalcWaybillFee`, // 报价试算 -- DONE preCalcWaybillFee: `/oms2c/emisWaybill/preCalcWaybillFee`, // 报价试算 -- DONE
calcProductFee: `/oms2c/emisWaybill/calcProductFee`, // 下单-报价试算 -- DONE calcProductFee: `/oms2c/emisWaybill/calcProductFee`, // 下单-报价试算 -- DONE
deleteBindSalemen: `/oms2c/emisWaybill/deleteBindSalemen`, // 删除绑定快递员 -- DONE
setDefaultBindSalesmen: `/oms2c/emisWaybill/setDefaultBindSalesmen`, // 设置默认快递员 -- DONE
queryWaybillTraceInfo: `/oms2c/emisTmsScanRecord/queryWaybillTraceInfo`, // 物流轨迹 -- DONE queryWaybillTraceInfo: `/oms2c/emisTmsScanRecord/queryWaybillTraceInfo`, // 物流轨迹 -- DONE
queryProblemTypeList: `/oms2c/emisProblemType/listSimple`, // 问题件类型列表 queryProblemTypeList: `/oms2c/emisProblemType/listSimple`, // 问题件类型列表
registerProblemInfo: `/oms2c/emisWaybillProblemInfo/registerProblemInfo`, // 问题件登记 registerProblemInfo: `/oms2c/emisWaybillProblemInfo/registerProblemInfo`, // 问题件登记

View File

@ -32,3 +32,13 @@ export const queryNewSalesmen = (data = {})=> {
export const bindSalesmen = (data = {})=> { export const bindSalesmen = (data = {})=> {
return coreRequest(url.bindSalesmen, data, {}, "GET") return coreRequest(url.bindSalesmen, data, {}, "GET")
} }
// 删除绑定快递员
export const deleteBindSalemen = (data = {})=> {
return coreRequest(url.deleteBindSalemen, data, {})
}
// 设置默认快递员
export const setDefaultBindSalesmen = (data = {})=> {
return coreRequest(url.setDefaultBindSalesmen, data, {})
}

View File

@ -49,7 +49,7 @@
<u-row custom-style="margin-top:20rpx;" justify="between"> <u-row custom-style="margin-top:20rpx;" justify="between">
<u-row> <u-row>
<text class="pr-20 clr-sub">默认地址</text> <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-row> <u-row>
<u-text @click="handleEditItem(item)" text="编辑" prefixIcon="edit-pen" size="26"></u-text> <u-text @click="handleEditItem(item)" text="编辑" prefixIcon="edit-pen" size="26"></u-text>
@ -166,14 +166,18 @@
} }
}, },
async handleDefaultSwitch(item) { async handleDefaultSwitch(item) {
setTimeout(async ()=> {
let blDefaultFlag = item.blDefaultFlag
try{ try{
await apiService.setDefaultAddressById({ id: item.id, defaultFlag: Number(!!item.blDefaultFlag), _loading: true }) await apiService.setDefaultAddressById({ id: item.id, defaultFlag: blDefaultFlag, _loading: true })
this.showToast('操作成功') this.showToast('操作成功')
this.$refs.listRef.getDataList(true) // 重置到第一页数据 this.$refs.listRef.getDataList(true) // 重置到第一页数据
}catch(e){ }catch(e){
// 操作失败,切回按钮状态 // 操作失败,切回按钮状态
item.blDefaultFlag = !item.blDefaultFlag item.blDefaultFlag = Number(!Number(blDefaultFlag)) + ''
} }
},300)
}, },
} }
} }

View File

@ -43,6 +43,19 @@
custom-style="height: 54rpx; width:120rpx;margin-left: 12rpx;white-space: nowrap;">去发货</u-button> custom-style="height: 54rpx; width:120rpx;margin-left: 12rpx;white-space: nowrap;">去发货</u-button>
</u-row> </u-row>
</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> </view>
</view> </view>
@ -157,8 +170,6 @@
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
// title: '',
// path: 'TODO'
} }
}, },
onLoad(queryOption) { onLoad(queryOption) {
@ -187,6 +198,27 @@
this.goto(`post/post?bindEmpCode=${item.empCode}&bindEmpName=${item.empName}`) 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() { async handleScan() {
const resData = await scanCode() const resData = await scanCode()
let params = getQueryObject(resData) let params = getQueryObject(resData)
@ -211,7 +243,7 @@
this.bindModal.show = false this.bindModal.show = false
this.bindSearchModal.show = false this.bindSearchModal.show = false
this.triggerListReload() this.triggerListReload()
} },
} }
} }