trade:优化门店的 list 列表,新增是否自提的配置项
This commit is contained in:
parent
a9bbbc7b0a
commit
ab95d87c68
@ -64,6 +64,9 @@
|
|||||||
商城商品满多少金额即可包邮,单位:元
|
商城商品满多少金额即可包邮,单位:元
|
||||||
</el-text>
|
</el-text>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="启用门店自提" prop="deliveryPickUpEnabled">
|
||||||
|
<el-switch v-model="formData.deliveryPickUpEnabled" style="user-select: none" />
|
||||||
|
</el-form-item>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- 分销 -->
|
<!-- 分销 -->
|
||||||
<el-tab-pane label="分销">
|
<el-tab-pane label="分销">
|
||||||
@ -206,7 +209,6 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as ConfigApi from '@/api/mall/trade/config'
|
import * as ConfigApi from '@/api/mall/trade/config'
|
||||||
import { BrokerageBindModeEnum, BrokerageEnabledConditionEnum } from '@/utils/constants'
|
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
defineOptions({ name: 'TradeConfig' })
|
defineOptions({ name: 'TradeConfig' })
|
||||||
@ -221,6 +223,7 @@ const formData = ref({
|
|||||||
afterSaleReturnReasons: [],
|
afterSaleReturnReasons: [],
|
||||||
deliveryExpressFreeEnabled: false,
|
deliveryExpressFreeEnabled: false,
|
||||||
deliveryExpressFreePrice: 0,
|
deliveryExpressFreePrice: 0,
|
||||||
|
deliveryPickUpEnabled: false,
|
||||||
brokerageEnabled: false,
|
brokerageEnabled: false,
|
||||||
brokerageEnabledCondition: undefined,
|
brokerageEnabledCondition: undefined,
|
||||||
brokerageBindMode: undefined,
|
brokerageBindMode: undefined,
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="门店所在地区" prop="areaId">
|
<el-form-item label="门店所在地区" prop="areaId">
|
||||||
<el-cascader v-model="formData.areaId" :options="areaList" :props="areaTreeProps" />
|
<el-cascader v-model="formData.areaId" :options="areaList" :props="defaultProps" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -99,7 +99,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="获取经纬度">
|
<el-form-item label="获取经纬度">
|
||||||
<el-button type="primary" @click="mapDialogVisible.value = true">获取</el-button>
|
<el-button type="primary" @click="mapDialogVisible = true">获取</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -121,8 +121,9 @@
|
|||||||
import * as DeliveryPickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore'
|
import * as DeliveryPickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore'
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import { CommonStatusEnum } from '@/utils/constants'
|
import { CommonStatusEnum } from '@/utils/constants'
|
||||||
|
import { defaultProps } from '@/utils/tree'
|
||||||
import { getAreaTree } from '@/api/system/area'
|
import { getAreaTree } from '@/api/system/area'
|
||||||
import * as ConfigApi from '@/api/infra/config'
|
import * as ConfigApi from '@/api/mall/trade/config'
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@ -161,12 +162,6 @@ const formRules = reactive({
|
|||||||
status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }]
|
status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const areaTreeProps = {
|
|
||||||
children: 'children',
|
|
||||||
label: 'name',
|
|
||||||
value: 'id',
|
|
||||||
emitPath: false
|
|
||||||
}
|
|
||||||
const areaList = ref() // 区域树
|
const areaList = ref() // 区域树
|
||||||
const tencentLbsUrl = ref('') // 腾讯位置服务 url
|
const tencentLbsUrl = ref('') // 腾讯位置服务 url
|
||||||
|
|
||||||
@ -244,16 +239,8 @@ const selectAddress = function (loc: any): void {
|
|||||||
mapDialogVisible.value = false
|
mapDialogVisible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 初始化数据 */
|
/** 初始化腾讯地图 */
|
||||||
const initData = async () => {
|
const initTencentLbsMap = async () => {
|
||||||
formLoading.value = true
|
|
||||||
try {
|
|
||||||
const data = await getAreaTree()
|
|
||||||
areaList.value = data
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
// TODO @jason:要不创建一个 initTencentLbsMap
|
|
||||||
window.selectAddress = selectAddress
|
window.selectAddress = selectAddress
|
||||||
window.addEventListener(
|
window.addEventListener(
|
||||||
'message',
|
'message',
|
||||||
@ -267,17 +254,16 @@ const initData = async () => {
|
|||||||
},
|
},
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
const data = await ConfigApi.getConfigKey('tencent.lbs.key')
|
const data = await ConfigApi.getTradeConfig()
|
||||||
let key = ''
|
const key = data.tencentLbsKey
|
||||||
if (data && data.length > 0) {
|
|
||||||
key = data
|
|
||||||
}
|
|
||||||
tencentLbsUrl.value = `https://apis.map.qq.com/tools/locpicker?type=1&key=${key}&referer=myapp`
|
tencentLbsUrl.value = `https://apis.map.qq.com/tools/locpicker?type=1&key=${key}&referer=myapp`
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
initData()
|
areaList.value = await getAreaTree()
|
||||||
|
// 加载地图
|
||||||
|
await initTencentLbsMap()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -65,16 +65,21 @@
|
|||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column label="编号" prop="id" />
|
<el-table-column label="编号" min-width="80" prop="id" />
|
||||||
<el-table-column label="门店 logo" prop="logo">
|
<el-table-column label="门店 logo" min-width="100" prop="logo">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<img v-if="scope.row.logo" :src="scope.row.logo" alt="门店 logo" class="h-100px" />
|
<img v-if="scope.row.logo" :src="scope.row.logo" alt="门店 logo" class="h-50px" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="门店名称" prop="name" />
|
<el-table-column label="门店名称" min-width="150" prop="name" />
|
||||||
<el-table-column label="门店手机" prop="phone" />
|
<el-table-column label="门店手机" min-width="100" prop="phone" />
|
||||||
<el-table-column align="center" label="门店详细地址" prop="detailAddress" />
|
<el-table-column label="地址" min-width="100" prop="detailAddress" />
|
||||||
<el-table-column align="center" label="开启状态" prop="status">
|
<el-table-column label="营业时间" min-width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.openingTime }} ~ {{ scope.row.closingTime }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="开启状态" min-width="100" prop="status">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user