|
|
@ -153,6 +153,20 @@ |
|
|
<Button type="primary" :loading="deliverySwitchLoading" @click="saveDeliverySwitch">保存</Button> |
|
|
<Button type="primary" :loading="deliverySwitchLoading" @click="saveDeliverySwitch">保存</Button> |
|
|
</FormItem> |
|
|
</FormItem> |
|
|
</Form> |
|
|
</Form> |
|
|
|
|
|
<Form v-if="isTargetTransferRegion" ref="transferDeliverySwitchForm" :model="transferDeliverySwitchForm" :label-width="130" style="width: 520px;"> |
|
|
|
|
|
<FormItem label="中转配送设置"> |
|
|
|
|
|
<i-switch v-model="transferDeliverySwitchForm.transferDeliveryEnabled" size="large" :true-value="1" :false-value="0"> |
|
|
|
|
|
<span slot="open">开启</span> |
|
|
|
|
|
<span slot="close">关闭</span> |
|
|
|
|
|
</i-switch> |
|
|
|
|
|
<div style="color: #999; font-size: 12px; line-height: 22px; margin-top: 8px;"> |
|
|
|
|
|
开启后,用户可以选择送到宿舍,由中转配送完成;关闭后,只能选择送到大门。 |
|
|
|
|
|
</div> |
|
|
|
|
|
</FormItem> |
|
|
|
|
|
<FormItem> |
|
|
|
|
|
<Button type="primary" :loading="transferDeliverySwitchLoading" @click="saveTransferDeliverySwitch">保存</Button> |
|
|
|
|
|
</FormItem> |
|
|
|
|
|
</Form> |
|
|
</div> |
|
|
</div> |
|
|
<Row v-if="isOrderTab" v-show="openSearch"> |
|
|
<Row v-if="isOrderTab" v-show="openSearch"> |
|
|
<Form ref="searchForm" :model="activeSearchForm" inline :label-width="90" autocomplete="off" |
|
|
<Form ref="searchForm" :model="activeSearchForm" inline :label-width="90" autocomplete="off" |
|
|
@ -284,12 +298,15 @@ |
|
|
saveBaseDeliveryFeeSetting as saveBaseDeliveryFeeSettingApi, |
|
|
saveBaseDeliveryFeeSetting as saveBaseDeliveryFeeSettingApi, |
|
|
getShopAreaDeliverySwitch, |
|
|
getShopAreaDeliverySwitch, |
|
|
saveShopAreaDeliverySwitch, |
|
|
saveShopAreaDeliverySwitch, |
|
|
|
|
|
getShopAreaTransferDeliverySwitch, |
|
|
|
|
|
saveShopAreaTransferDeliverySwitch, |
|
|
} from "@/api/index"; |
|
|
} from "@/api/index"; |
|
|
import addEdit from "./addEdit.vue"; |
|
|
import addEdit from "./addEdit.vue"; |
|
|
import logisticsAddress from "@/views/app/business/logistics/logisticsAddress"; |
|
|
import logisticsAddress from "@/views/app/business/logistics/logisticsAddress"; |
|
|
import shopAreaTreeChoose from "@/views/my-components/hiver/shopArea-tree-choose"; |
|
|
import shopAreaTreeChoose from "@/views/my-components/hiver/shopArea-tree-choose"; |
|
|
import { SEARCH_HISTORY_KEYS, getSearchHistory, saveSearchHistory } from "@/libs/searchHistory"; |
|
|
import { SEARCH_HISTORY_KEYS, getSearchHistory, saveSearchHistory } from "@/libs/searchHistory"; |
|
|
|
|
|
|
|
|
|
|
|
const TARGET_TRANSFER_DELIVERY_REGION_ID = "2110300467664916480"; |
|
|
const HALL_TYPE_MAP = { |
|
|
const HALL_TYPE_MAP = { |
|
|
waimai: 1, |
|
|
waimai: 1, |
|
|
kuaidi: 2, |
|
|
kuaidi: 2, |
|
|
@ -335,6 +352,7 @@ |
|
|
customerServiceLoading: false, |
|
|
customerServiceLoading: false, |
|
|
baseDeliveryFeeLoading: false, |
|
|
baseDeliveryFeeLoading: false, |
|
|
deliverySwitchLoading: false, |
|
|
deliverySwitchLoading: false, |
|
|
|
|
|
transferDeliverySwitchLoading: false, |
|
|
transferOrder: false, |
|
|
transferOrder: false, |
|
|
workerOrderVisible: false, |
|
|
workerOrderVisible: false, |
|
|
workerOrderTab: "daiqu", |
|
|
workerOrderTab: "daiqu", |
|
|
@ -396,6 +414,10 @@ |
|
|
regionId: regionId, |
|
|
regionId: regionId, |
|
|
deliveryEnabled: 1 |
|
|
deliveryEnabled: 1 |
|
|
}, |
|
|
}, |
|
|
|
|
|
transferDeliverySwitchForm: { |
|
|
|
|
|
regionId: regionId, |
|
|
|
|
|
transferDeliveryEnabled: 1 |
|
|
|
|
|
}, |
|
|
workerOrderForm: { |
|
|
workerOrderForm: { |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 10 |
|
|
pageSize: 10 |
|
|
@ -453,6 +475,9 @@ |
|
|
deliveryTotalCount() { |
|
|
deliveryTotalCount() { |
|
|
return this.toNumber(this.deliveryCounts.daiqu) + this.toNumber(this.deliveryCounts.daisong); |
|
|
return this.toNumber(this.deliveryCounts.daiqu) + this.toNumber(this.deliveryCounts.daisong); |
|
|
}, |
|
|
}, |
|
|
|
|
|
isTargetTransferRegion() { |
|
|
|
|
|
return String(this.currentRegionId) === TARGET_TRANSFER_DELIVERY_REGION_ID; |
|
|
|
|
|
}, |
|
|
workerOrderTitle() { |
|
|
workerOrderTitle() { |
|
|
const name = this.selectedWorker.workerName || "配送员"; |
|
|
const name = this.selectedWorker.workerName || "配送员"; |
|
|
const phone = this.selectedWorker.workerPhone ? "(" + this.selectedWorker.workerPhone + ")" : ""; |
|
|
const phone = this.selectedWorker.workerPhone ? "(" + this.selectedWorker.workerPhone + ")" : ""; |
|
|
@ -470,6 +495,7 @@ |
|
|
this.getCustomerServiceSetting(); |
|
|
this.getCustomerServiceSetting(); |
|
|
this.getBaseDeliveryFeeSetting(); |
|
|
this.getBaseDeliveryFeeSetting(); |
|
|
this.getDeliverySwitch(); |
|
|
this.getDeliverySwitch(); |
|
|
|
|
|
this.getTransferDeliverySwitch(); |
|
|
}, |
|
|
}, |
|
|
loadSearchHistory() { |
|
|
loadSearchHistory() { |
|
|
this.searchHistory.shopName = getSearchHistory(SEARCH_HISTORY_KEYS.shopName); |
|
|
this.searchHistory.shopName = getSearchHistory(SEARCH_HISTORY_KEYS.shopName); |
|
|
@ -499,6 +525,7 @@ |
|
|
this.getBaseDeliveryFeeSetting(); |
|
|
this.getBaseDeliveryFeeSetting(); |
|
|
} else if (this.tabName === "deliverySwitch") { |
|
|
} else if (this.tabName === "deliverySwitch") { |
|
|
this.getDeliverySwitch(); |
|
|
this.getDeliverySwitch(); |
|
|
|
|
|
this.getTransferDeliverySwitch(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
buildWorkerColumns() { |
|
|
buildWorkerColumns() { |
|
|
@ -695,6 +722,7 @@ |
|
|
} |
|
|
} |
|
|
if (v === "deliverySwitch") { |
|
|
if (v === "deliverySwitch") { |
|
|
this.getDeliverySwitch(); |
|
|
this.getDeliverySwitch(); |
|
|
|
|
|
this.getTransferDeliverySwitch(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
this.total = 0; |
|
|
this.total = 0; |
|
|
@ -1221,6 +1249,30 @@ |
|
|
this.deliverySwitchLoading = false; |
|
|
this.deliverySwitchLoading = false; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
getTransferDeliverySwitch() { |
|
|
|
|
|
if (!this.isTargetTransferRegion) return; |
|
|
|
|
|
getShopAreaTransferDeliverySwitch({ |
|
|
|
|
|
regionId: this.transferDeliverySwitchForm.regionId |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.transferDeliverySwitchForm.transferDeliveryEnabled = res.result == null ? 1 : Number(res.result); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
saveTransferDeliverySwitch() { |
|
|
|
|
|
if (!this.isTargetTransferRegion) return; |
|
|
|
|
|
this.transferDeliverySwitchLoading = true; |
|
|
|
|
|
saveShopAreaTransferDeliverySwitch({ |
|
|
|
|
|
regionId: this.transferDeliverySwitchForm.regionId, |
|
|
|
|
|
transferDeliveryEnabled: this.transferDeliverySwitchForm.transferDeliveryEnabled |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.$Message.success("保存成功"); |
|
|
|
|
|
} |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.transferDeliverySwitchLoading = false; |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
goTransferOrder(item) { |
|
|
goTransferOrder(item) { |
|
|
if (!item || !item.workerId) { |
|
|
if (!item || !item.workerId) { |
|
|
this.$Message.warning("请选择配送员"); |
|
|
this.$Message.warning("请选择配送员"); |
|
|
|