update
This commit is contained in:
parent
b4204aea94
commit
5e5baa2c55
32
src/api/sameCityTransport/sameCityTransport.js
Normal file
32
src/api/sameCityTransport/sameCityTransport.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
import { URL } from '@/config'
|
||||||
|
|
||||||
|
|
||||||
|
export function getSameCityTransport(params){
|
||||||
|
return request({
|
||||||
|
url: URL.shop.store.sameCityTransport.getSameCityTransport,
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delectArea(params){
|
||||||
|
return request({
|
||||||
|
url: URL.shop.store.sameCityTransport.delectArea,
|
||||||
|
method: 'post',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function saveSameCityTransport(params){
|
||||||
|
params = JSON.stringify(params)
|
||||||
|
return request({
|
||||||
|
url: URL.shop.store.sameCityTransport.saveSameCityTransport,
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data:params,
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -8,10 +8,11 @@ import BaiduMap from './../components/baidu_Map_xiufu'
|
|||||||
// ak: 'uwBrIUOZuTDMHsuRGm0hdmeG9sosN8sQ',
|
// ak: 'uwBrIUOZuTDMHsuRGm0hdmeG9sosN8sQ',
|
||||||
// })
|
// })
|
||||||
|
|
||||||
|
//xSeK5okwxCQbcwdGoOufv2EMuMdvsVFI
|
||||||
|
|
||||||
Vue.use(BaiduMap, {
|
Vue.use(BaiduMap, {
|
||||||
// ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
|
// ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
|
||||||
ak: 'xSeK5okwxCQbcwdGoOufv2EMuMdvsVFI',
|
ak: 'chsSzRvFcU1uXYoDHAHlsF98NkTVbzvE',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1029,6 +1029,11 @@ let url = {
|
|||||||
updatePrnterStatus: api_url + '/admin/shop/store/printer/status/update',
|
updatePrnterStatus: api_url + '/admin/shop/store/printer/status/update',
|
||||||
//商家端-测试打印
|
//商家端-测试打印
|
||||||
testPrinter:api_url + '/admin/shop/store/printer/print/order'
|
testPrinter:api_url + '/admin/shop/store/printer/print/order'
|
||||||
|
},
|
||||||
|
sameCityTransport:{
|
||||||
|
getSameCityTransport: api_url + '/admin/shop/store/same-city-transport/detail',
|
||||||
|
saveSameCityTransport: api_url + '/admin/shop/store/same-city-transport/save',
|
||||||
|
delectArea:api_url + '/admin/shop/store/same-city-transport/delete/area'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
user: {
|
user: {
|
||||||
|
|||||||
@ -422,9 +422,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="配送区域" prop="">
|
<el-form-item label="配送区域" prop="">
|
||||||
<el-radio-group v-model="form.dispensingArea">
|
<el-radio-group v-model="form.dispensingArea">
|
||||||
<el-radio :label="0">按不同区域</el-radio>
|
<el-radio :label="0" disabled>按不同区域</el-radio>
|
||||||
<el-radio :label="1">按不同距离</el-radio>
|
<el-radio :label="1">按不同距离</el-radio>
|
||||||
<el-radio :label="2">按行政区域</el-radio>
|
<el-radio :label="2" disabled>按行政区域</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@ -463,8 +463,8 @@
|
|||||||
v-if="form.dispensingArea != 2"
|
v-if="form.dispensingArea != 2"
|
||||||
>
|
>
|
||||||
<el-radio-group v-model="form.divideType">
|
<el-radio-group v-model="form.divideType">
|
||||||
<el-radio :label="0">半径</el-radio>
|
<el-radio :label="1">半径</el-radio>
|
||||||
<el-radio :label="1">自定义</el-radio>
|
<el-radio :label="2" disabled>自定义</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@ -483,7 +483,10 @@
|
|||||||
<label slot="append">kg</label>
|
<label slot="append">kg</label>
|
||||||
</el-input>
|
</el-input>
|
||||||
<label class="distance-lable">内,配送费用</label>
|
<label class="distance-lable">内,配送费用</label>
|
||||||
<el-input class="distance-input" v-model="form.distance.weightNum">
|
<el-input
|
||||||
|
class="distance-input"
|
||||||
|
v-model="form.distance.distributionFreightNum"
|
||||||
|
>
|
||||||
<label slot="append">元</label>
|
<label slot="append">元</label>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -535,7 +538,7 @@
|
|||||||
<div class="map-box">
|
<div class="map-box">
|
||||||
<div class="areas-block">
|
<div class="areas-block">
|
||||||
<div class="areas-conetn">
|
<div class="areas-conetn">
|
||||||
<div v-if="form.divideType == 0">
|
<div v-if="form.divideType == 1">
|
||||||
<div
|
<div
|
||||||
:class="[
|
:class="[
|
||||||
'areas-item',
|
'areas-item',
|
||||||
@ -554,7 +557,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="btn-delect"
|
class="btn-delect"
|
||||||
@click="delectRadiusItem(index)"
|
@click="delectRadiusItem(index, item)"
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</div>
|
</div>
|
||||||
@ -677,7 +680,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="form.divideType == 1">
|
<div v-if="form.divideType == 2">
|
||||||
<div
|
<div
|
||||||
:class="[
|
:class="[
|
||||||
'areas-item',
|
'areas-item',
|
||||||
@ -809,7 +812,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="areas-conetn-footer" @click="addRadiusItem()">
|
<div class="areas-conetn-footer" @click="addRadiusItem()">
|
||||||
+添加配送区域{{
|
+添加配送区域{{
|
||||||
form.divideType == 0
|
form.divideType == 1
|
||||||
? mapForm.radiusList.length
|
? mapForm.radiusList.length
|
||||||
: mapForm.customList.length
|
: mapForm.customList.length
|
||||||
}}/10
|
}}/10
|
||||||
@ -827,10 +830,10 @@
|
|||||||
@ready="handlerBaiduMap"
|
@ready="handlerBaiduMap"
|
||||||
>
|
>
|
||||||
<bm-navigation anchor="BMAP_ANCHOR_TOP_LEFT"></bm-navigation>
|
<bm-navigation anchor="BMAP_ANCHOR_TOP_LEFT"></bm-navigation>
|
||||||
<div class="radius-block" v-if="form.divideType == 0">
|
<div class="radius-block" v-if="form.divideType == 1">
|
||||||
<template v-for="(item, index) of this.mapForm.radiusList">
|
<template v-for="(item, index) of this.mapForm.radiusList">
|
||||||
<bm-circle
|
<bm-circle
|
||||||
v-if="mapReady && form.divideType == 0"
|
v-if="mapReady && form.divideType == 1"
|
||||||
:key="'circle-' + index"
|
:key="'circle-' + index"
|
||||||
:center="item.circlePath.center"
|
:center="item.circlePath.center"
|
||||||
:radius="item.circlePath.radius"
|
:radius="item.circlePath.radius"
|
||||||
@ -853,7 +856,7 @@
|
|||||||
"
|
"
|
||||||
:key="'marker-' + index"
|
:key="'marker-' + index"
|
||||||
:position="item.circlePath.center"
|
:position="item.circlePath.center"
|
||||||
:dragging="mapForm.showRadiusDragging"
|
:dragging="false"
|
||||||
@click="onClickMarker"
|
@click="onClickMarker"
|
||||||
:icon="{
|
:icon="{
|
||||||
url: require('@/assets/dd-via.png'),
|
url: require('@/assets/dd-via.png'),
|
||||||
@ -882,7 +885,7 @@
|
|||||||
</bm-marker>
|
</bm-marker>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div class="custom-block" v-if="form.divideType == 1">
|
<div class="custom-block" v-if="form.divideType == 2">
|
||||||
<template v-for="(item, index) of this.mapForm.customList">
|
<template v-for="(item, index) of this.mapForm.customList">
|
||||||
<bm-polygon
|
<bm-polygon
|
||||||
:key="'polygon-' + index"
|
:key="'polygon-' + index"
|
||||||
@ -1122,6 +1125,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { get } from '@/api/store/base'
|
import { get } from '@/api/store/base'
|
||||||
|
import {
|
||||||
|
getSameCityTransport,
|
||||||
|
saveSameCityTransport,
|
||||||
|
delectArea,
|
||||||
|
} from '@/api/sameCityTransport/sameCityTransport'
|
||||||
import { ChineseDistricts } from '@/components/VabArea/city-picker.data'
|
import { ChineseDistricts } from '@/components/VabArea/city-picker.data'
|
||||||
import {
|
import {
|
||||||
distributionOpction,
|
distributionOpction,
|
||||||
@ -1312,8 +1320,8 @@ export default {
|
|||||||
],
|
],
|
||||||
inAdvanceTime: 0,
|
inAdvanceTime: 0,
|
||||||
shopAddress: '',
|
shopAddress: '',
|
||||||
dispensingArea: 0,
|
dispensingArea: 1,
|
||||||
divideType: 0,
|
divideType: 1,
|
||||||
distance: {
|
distance: {
|
||||||
distanceNum: null,
|
distanceNum: null,
|
||||||
weightNum: null,
|
weightNum: null,
|
||||||
@ -1350,40 +1358,8 @@ export default {
|
|||||||
customActive: 0,
|
customActive: 0,
|
||||||
showCustomEditing: false,
|
showCustomEditing: false,
|
||||||
showCustomDragging: false,
|
showCustomDragging: false,
|
||||||
radiusList: [
|
radiusList: [],
|
||||||
{
|
customList: [],
|
||||||
id: 0,
|
|
||||||
areaNum: 1,
|
|
||||||
minPriceType: 0,
|
|
||||||
minPrice: null,
|
|
||||||
deliveryCostAmount: null,
|
|
||||||
freightReliefType: 0,
|
|
||||||
freightReliefAmout: null,
|
|
||||||
derateAmout: null,
|
|
||||||
circlePath: {
|
|
||||||
center: {
|
|
||||||
lng: 0,
|
|
||||||
lat: 0,
|
|
||||||
},
|
|
||||||
// center:[],
|
|
||||||
radius: 300,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
customList: [
|
|
||||||
{
|
|
||||||
areaNum: 0,
|
|
||||||
oldCenter: {},
|
|
||||||
polygonPath: [],
|
|
||||||
areaNum: 1,
|
|
||||||
minPriceType: 0,
|
|
||||||
minPrice: null,
|
|
||||||
deliveryCostAmount: null,
|
|
||||||
freightReliefType: 0,
|
|
||||||
freightReliefAmout: null,
|
|
||||||
derateAmout: null,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
BMap: null,
|
BMap: null,
|
||||||
center: { lng: 0, lat: 0 },
|
center: { lng: 0, lat: 0 },
|
||||||
@ -1420,6 +1396,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.ChineseDistricts = ChineseDistricts
|
this.ChineseDistricts = ChineseDistricts
|
||||||
|
this.getSameCityTransport()
|
||||||
this.getCompanyInfo()
|
this.getCompanyInfo()
|
||||||
this.goodsTypeList = Object.keys(this.goodsTypeData).map((key) => ({
|
this.goodsTypeList = Object.keys(this.goodsTypeData).map((key) => ({
|
||||||
label: this.goodsTypeData[key],
|
label: this.goodsTypeData[key],
|
||||||
@ -1428,6 +1405,44 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeDestroy() {},
|
beforeDestroy() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
async getSameCityTransport() {
|
||||||
|
let res = await getSameCityTransport()
|
||||||
|
if (res && res.status == 200) {
|
||||||
|
let transportBase = res.data.transportBase
|
||||||
|
let transportList = res.data.transportList
|
||||||
|
this.form.dispensingArea = transportBase.area_type
|
||||||
|
|
||||||
|
this.form.distance.distanceNum = transportBase.distance_base
|
||||||
|
this.form.distance.weightNum = transportBase.weight_base
|
||||||
|
this.form.distance.distributionFreightNum =
|
||||||
|
transportBase.delivery_base_fee
|
||||||
|
|
||||||
|
this.form.distanceAdd.distanceNum = transportBase.distance_increase_km
|
||||||
|
this.form.distanceAdd.FreightAddNum =
|
||||||
|
transportBase.distance_increase_fee
|
||||||
|
|
||||||
|
this.form.weightAdd.weightAddNum = transportBase.weight_increase_kg
|
||||||
|
this.form.weightAdd.FreightAddNum = transportBase.weight_increase_fee
|
||||||
|
|
||||||
|
let arr = transportList.map((item, index) => {
|
||||||
|
let obj = {
|
||||||
|
areaNum: index + 1,
|
||||||
|
transport_id: item.transport_id,
|
||||||
|
circlePath: {
|
||||||
|
radius: item.max_delivery_radius,
|
||||||
|
center: this.center,
|
||||||
|
},
|
||||||
|
minPriceType: item.min_delivery_amount_type - 1,
|
||||||
|
minPrice: item.min_delivery_amount,
|
||||||
|
freightReliefType: item.delivery_discount_type - 1,
|
||||||
|
freightReliefAmout: item.min_delivery_discount_amount,
|
||||||
|
derateAmout: item.delivery_discount,
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
this.mapForm.radiusList = arr
|
||||||
|
}
|
||||||
|
},
|
||||||
handleSkip() {
|
handleSkip() {
|
||||||
this.$router.push({ path: '/setupshop' })
|
this.$router.push({ path: '/setupshop' })
|
||||||
},
|
},
|
||||||
@ -1618,7 +1633,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
addRadiusItem() {
|
addRadiusItem() {
|
||||||
if (this.form.divideType == 0) {
|
if (this.form.divideType == 1) {
|
||||||
if (this.mapForm.radiusList.length >= 10) return
|
if (this.mapForm.radiusList.length >= 10) return
|
||||||
|
|
||||||
let areaNum = this.mapForm.radiusList.length + 1
|
let areaNum = this.mapForm.radiusList.length + 1
|
||||||
@ -1643,7 +1658,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
if (this.mapForm.customList.length >= 10) return
|
if (this.mapForm.customList.length >= 10) return
|
||||||
|
|
||||||
let areaNum = this.mapForm.radiusList.length + 1
|
let areaNum = this.mapForm.customList.length + 1
|
||||||
|
|
||||||
let { lng, lat } = this.center
|
let { lng, lat } = this.center
|
||||||
// 正方形的边长(米)
|
// 正方形的边长(米)
|
||||||
@ -1664,9 +1679,9 @@ export default {
|
|||||||
]
|
]
|
||||||
|
|
||||||
let obj = {
|
let obj = {
|
||||||
|
transport_id: 0,
|
||||||
areaNum: areaNum,
|
areaNum: areaNum,
|
||||||
polygonPath: polygonPath,
|
polygonPath: polygonPath,
|
||||||
areaNum: areaNum,
|
|
||||||
minPriceType: 0,
|
minPriceType: 0,
|
||||||
minPrice: null,
|
minPrice: null,
|
||||||
deliveryCostAmount: null,
|
deliveryCostAmount: null,
|
||||||
@ -1681,8 +1696,12 @@ export default {
|
|||||||
|
|
||||||
// this.creatCircle(obj)
|
// this.creatCircle(obj)
|
||||||
},
|
},
|
||||||
delectRadiusItem(index) {
|
async delectRadiusItem(index, item) {
|
||||||
if (this.form.divideType == 0) {
|
let res = await delectArea({ transport_id: item.transport_id })
|
||||||
|
if (res && res.status == 200) {
|
||||||
|
this.$baseMessage('删除成功', 'success')
|
||||||
|
}
|
||||||
|
if (this.form.divideType == 1) {
|
||||||
if (this.mapForm.radiusList.length == 0) return
|
if (this.mapForm.radiusList.length == 0) return
|
||||||
|
|
||||||
this.mapForm.radiusList.splice(index, 1)
|
this.mapForm.radiusList.splice(index, 1)
|
||||||
@ -1732,30 +1751,72 @@ export default {
|
|||||||
|
|
||||||
this.center.lng = Number(this.shopInfoData.store_longitude)
|
this.center.lng = Number(this.shopInfoData.store_longitude)
|
||||||
this.center.lat = Number(this.shopInfoData.store_latitude)
|
this.center.lat = Number(this.shopInfoData.store_latitude)
|
||||||
this.mapForm.radiusList[0].circlePath.center.lng = Number(
|
|
||||||
this.shopInfoData.store_longitude
|
|
||||||
)
|
|
||||||
this.mapForm.radiusList[0].circlePath.center.lat = Number(
|
|
||||||
this.shopInfoData.store_latitude
|
|
||||||
)
|
|
||||||
this.mapForm.customList[0].oldCenter = this.center
|
|
||||||
let { lng, lat } = this.center
|
|
||||||
// 正方形的边长(米)
|
|
||||||
var side_length = 300
|
|
||||||
|
|
||||||
// 每度纬度的距离(米)
|
if (this.mapForm.radiusList.length == 0) {
|
||||||
var lat_distance_per_degree = 111000
|
let obj = {
|
||||||
|
areaNum: 1,
|
||||||
|
minPriceType: 0,
|
||||||
|
minPrice: null,
|
||||||
|
deliveryCostAmount: null,
|
||||||
|
freightReliefType: 0,
|
||||||
|
freightReliefAmout: null,
|
||||||
|
derateAmout: null,
|
||||||
|
circlePath: {
|
||||||
|
center: {
|
||||||
|
lng: 0,
|
||||||
|
lat: 0,
|
||||||
|
},
|
||||||
|
// center:[],
|
||||||
|
radius: 300,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
var deltaLat = side_length / lat_distance_per_degree
|
this.mapForm.radiusList.push(obj)
|
||||||
|
|
||||||
var deltaLng = deltaLat
|
this.mapForm.radiusList[0].circlePath.center.lng = Number(
|
||||||
|
this.shopInfoData.store_longitude
|
||||||
|
)
|
||||||
|
this.mapForm.radiusList[0].circlePath.center.lat = Number(
|
||||||
|
this.shopInfoData.store_latitude
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
this.mapForm.customList[0].polygonPath = [
|
if (this.mapForm.customList.length == 0) {
|
||||||
{ lng: lng + deltaLng, lat: lat + deltaLat },
|
let areaNum = this.mapForm.radiusList.length + 1
|
||||||
{ lng: lng + deltaLng, lat: lat - deltaLat },
|
|
||||||
{ lng: lng - deltaLng, lat: lat - deltaLat },
|
let obj = {
|
||||||
{ lng: lng - deltaLng, lat: lat + deltaLat },
|
transport_id: 0,
|
||||||
]
|
areaNum: areaNum,
|
||||||
|
polygonPath: [],
|
||||||
|
minPriceType: 0,
|
||||||
|
minPrice: null,
|
||||||
|
deliveryCostAmount: null,
|
||||||
|
freightReliefType: 0,
|
||||||
|
freightReliefAmout: null,
|
||||||
|
derateAmout: null,
|
||||||
|
oldCenter: this.center,
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mapForm.customList.push(obj)
|
||||||
|
|
||||||
|
let { lng, lat } = this.center
|
||||||
|
// 正方形的边长(米)
|
||||||
|
var side_length = 300
|
||||||
|
|
||||||
|
// 每度纬度的距离(米)
|
||||||
|
var lat_distance_per_degree = 111000
|
||||||
|
|
||||||
|
var deltaLat = side_length / lat_distance_per_degree
|
||||||
|
|
||||||
|
var deltaLng = deltaLat
|
||||||
|
|
||||||
|
this.mapForm.customList[0].polygonPath = [
|
||||||
|
{ lng: lng + deltaLng, lat: lat + deltaLat },
|
||||||
|
{ lng: lng + deltaLng, lat: lat - deltaLat },
|
||||||
|
{ lng: lng - deltaLng, lat: lat - deltaLat },
|
||||||
|
{ lng: lng - deltaLng, lat: lat + deltaLat },
|
||||||
|
]
|
||||||
|
}
|
||||||
this.mapReady = true
|
this.mapReady = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1818,14 +1879,14 @@ export default {
|
|||||||
this.mapForm.showCircleEditing = true
|
this.mapForm.showCircleEditing = true
|
||||||
},
|
},
|
||||||
onClickMarker() {
|
onClickMarker() {
|
||||||
if (this.form.divideType == 0) {
|
if (this.form.divideType == 1) {
|
||||||
this.mapForm.showRadiusDragging = true
|
this.mapForm.showRadiusDragging = true
|
||||||
} else {
|
} else {
|
||||||
this.mapForm.showCustomDragging = true
|
this.mapForm.showCustomDragging = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleDragging(e, index) {
|
handleDragging(e, index) {
|
||||||
if (this.form.divideType == 0) {
|
if (this.form.divideType == 1) {
|
||||||
this.mapForm.radiusList[index].circlePath.center = e.point
|
this.mapForm.radiusList[index].circlePath.center = e.point
|
||||||
|
|
||||||
let divs = document.querySelectorAll('.BMap_vectex_node')
|
let divs = document.querySelectorAll('.BMap_vectex_node')
|
||||||
@ -1862,7 +1923,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleMarkerMouseovert() {
|
handleMarkerMouseovert() {
|
||||||
if (this.form.divideType == 0) {
|
if (this.form.divideType == 1) {
|
||||||
this.mapForm.showRadiusDragging = true
|
this.mapForm.showRadiusDragging = true
|
||||||
} else {
|
} else {
|
||||||
this.mapForm.showCustomDragging = true
|
this.mapForm.showCustomDragging = true
|
||||||
@ -1980,7 +2041,57 @@ export default {
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
// },
|
// },
|
||||||
handerSubmit() {},
|
async handerSubmit() {
|
||||||
|
if (
|
||||||
|
!this.form.distance.distanceNum ||
|
||||||
|
!this.form.distance.weightNum ||
|
||||||
|
!this.form.distance.distributionFreightNum ||
|
||||||
|
!this.form.distanceAdd.distanceNum ||
|
||||||
|
!this.form.distanceAdd.FreightAddNum ||
|
||||||
|
!this.form.weightAdd.weightAddNum ||
|
||||||
|
!this.form.weightAdd.FreightAddNum
|
||||||
|
) {
|
||||||
|
this.$baseMessage('请填写完整的信息', 'error')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let list =
|
||||||
|
this.mapForm.radiusList.map((item) => {
|
||||||
|
let obj = {
|
||||||
|
transport_id: item.transport_id || null,
|
||||||
|
area_type: this.form.divideType,
|
||||||
|
max_delivery_radius: item.circlePath.radius,
|
||||||
|
min_delivery_amount_type: item.minPriceType + 1,
|
||||||
|
min_delivery_amount: item.minPrice,
|
||||||
|
delivery_discount_type: item.freightReliefType + 1,
|
||||||
|
min_delivery_discount_amount: item.freightReliefAmout,
|
||||||
|
delivery_discount: item.derateAmout,
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj
|
||||||
|
}) || []
|
||||||
|
|
||||||
|
let params = {
|
||||||
|
transportBase: {
|
||||||
|
transport_base_id: null,
|
||||||
|
area_type: this.form.dispensingArea,
|
||||||
|
basis: 1,
|
||||||
|
distance_base: this.form.distance.distanceNum || 0,
|
||||||
|
weight_base: this.form.distance.weightNum || 0,
|
||||||
|
delivery_base_fee: this.form.distance.distributionFreightNum || 0,
|
||||||
|
distance_increase_km: this.form.distanceAdd.distanceNum || 0,
|
||||||
|
distance_increase_fee: this.form.distanceAdd.FreightAddNum || 0,
|
||||||
|
weight_increase_kg: this.form.weightAdd.weightAddNum || 0,
|
||||||
|
weight_increase_fee: this.form.weightAdd.FreightAddNum || 0,
|
||||||
|
},
|
||||||
|
transportList: list,
|
||||||
|
}
|
||||||
|
|
||||||
|
let res = await saveSameCityTransport(params)
|
||||||
|
if (res && res.status == 200) {
|
||||||
|
this.$baseMessage('保存成功', 'success')
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user