|
@@ -13,28 +13,22 @@
|
|
<a-row :gutter="20">
|
|
<a-row :gutter="20">
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
<a-form-model-item prop="addrProvince">
|
|
<a-form-model-item prop="addrProvince">
|
|
- <a-select v-model="form.addrProvince" placeholder="请选择省">
|
|
|
|
- <a-select-option value="shanghai">
|
|
|
|
- Zone one
|
|
|
|
- </a-select-option>
|
|
|
|
|
|
+ <a-select v-model="form.addrProvince" placeholder="请选择省" @change="getCityList">
|
|
|
|
+ <a-select-option v-for="item in addrProvinceList" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
<a-form-model-item prop="addrCity">
|
|
<a-form-model-item prop="addrCity">
|
|
- <a-select v-model="form.addrCity" placeholder="请选择市">
|
|
|
|
- <a-select-option value="shanghai">
|
|
|
|
- Zone one
|
|
|
|
- </a-select-option>
|
|
|
|
|
|
+ <a-select v-model="form.addrCity" placeholder="请选择市" @change="getAreaList">
|
|
|
|
+ <a-select-option v-for="item in addrCityList" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-col :span="8">
|
|
<a-form-model-item prop="addrDistrict">
|
|
<a-form-model-item prop="addrDistrict">
|
|
- <a-select v-model="form.addrDistrict" placeholder="请选择区">
|
|
|
|
- <a-select-option value="shanghai">
|
|
|
|
- Zone one
|
|
|
|
- </a-select-option>
|
|
|
|
|
|
+ <a-select v-model="form.addrDistrict" placeholder="请选择区" @change="areaCharged">
|
|
|
|
+ <a-select-option v-for="item in addrDistrictList" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -47,10 +41,10 @@
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
- <a-form-model-item label="设备ID" prop="equipment" class="default-form-item">
|
|
|
|
|
|
+ <a-form-model-item label="设备ID" prop="deviceDTOList" class="default-form-item">
|
|
<a-row :gutter="20">
|
|
<a-row :gutter="20">
|
|
<a-col :span="19">
|
|
<a-col :span="19">
|
|
- <a-tag v-if="equipmentName" color="blue">{{equipmentName}}</a-tag>
|
|
|
|
|
|
+ <a-tag v-if="form.deviceDTOList.length > 0" color="blue">{{deviceNo}}</a-tag>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="5">
|
|
<a-col :span="5">
|
|
<a-button type="primary" size="small" class="small-btn" @click="openEquipmentModal=true">选择</a-button>
|
|
<a-button type="primary" size="small" class="small-btn" @click="openEquipmentModal=true">选择</a-button>
|
|
@@ -59,15 +53,15 @@
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
- <a-form-model-item label="网点标签" prop="sign">
|
|
|
|
- <v-select ref="sign" v-model="form.sign" mode="multiple" placeholder="请选择网点标签" showArrow code="CHECK_ENABLE_STATE"></v-select>
|
|
|
|
|
|
+ <a-form-model-item label="网点标签" prop="featuredServiceLabel" :rules="{required: true, message: '请选择网点标签', trigger: 'change'}">
|
|
|
|
+ <v-select ref="featuredServiceLabel" v-model="featuredServiceLabel" @change="featuredServiceLabelChange" mode="multiple" placeholder="请选择网点标签" showArrow code="STORE_LABEL"></v-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
- <a-form-model-item label="经度" prop="longitude" class="default-form-item">
|
|
|
|
|
|
+ <a-form-model-item label="经度" prop="lng" class="default-form-item">
|
|
<a-row :gutter="20">
|
|
<a-row :gutter="20">
|
|
<a-col :span="17">
|
|
<a-col :span="17">
|
|
- <a-input v-model="form.longitude" placeholder="请输入经度坐标" />
|
|
|
|
|
|
+ <a-input v-model="form.lng" placeholder="请输入经度坐标" />
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
<a href="https://lbs.qq.com/tool/getpoint/" target="_blank">
|
|
<a href="https://lbs.qq.com/tool/getpoint/" target="_blank">
|
|
@@ -78,27 +72,29 @@
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
- <a-form-model-item label="纬度" prop="latitude">
|
|
|
|
- <a-input v-model="form.latitude" placeholder="请输入纬度坐标" />
|
|
|
|
|
|
+ <a-form-model-item label="纬度" prop="lat">
|
|
|
|
+ <a-input v-model="form.lat" placeholder="请输入纬度坐标" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
<a-form-model-item label="服务类型" prop="serviceType">
|
|
<a-form-model-item label="服务类型" prop="serviceType">
|
|
- <v-select ref="serviceType" v-model="form.serviceType" @change="isResetPeriodPrice('serviceType', $event)" showArrow mode="multiple" placeholder="请选择服务类型" code="CHECK_ENABLE_STATE"></v-select>
|
|
|
|
|
|
+ <a-select v-model="form.serviceType" placeholder="请选择服务类型" @change="isResetstoreItemPriceDTOList('serviceType', $event)" showArrow mode="multiple">
|
|
|
|
+ <a-select-option v-for="item in itemQueryList" :key="item.id" :value="item.id">{{item.itemName}}</a-select-option>
|
|
|
|
+ </a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
<a-form-model-item label="营业时间" class="default-form-item form-item-required">
|
|
<a-form-model-item label="营业时间" class="default-form-item form-item-required">
|
|
<a-row :gutter="20">
|
|
<a-row :gutter="20">
|
|
<a-col :span="11">
|
|
<a-col :span="11">
|
|
- <a-form-model-item prop="startTime">
|
|
|
|
- <a-time-picker v-model="form.startTime" @change="isResetPeriodPrice('startTime', $event)" format="HH:mm" placeholder="请选择开始时间" class="time-picker" />
|
|
|
|
|
|
+ <a-form-model-item prop="beginTime">
|
|
|
|
+ <a-time-picker v-model="form.beginTime" @change="isResetstoreItemPriceDTOList('beginTime', $event)" format="HH:mm" placeholder="请选择开始时间" class="time-picker" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="2">至</a-col>
|
|
<a-col :span="2">至</a-col>
|
|
<a-col :span="11">
|
|
<a-col :span="11">
|
|
<a-form-model-item prop="endTime">
|
|
<a-form-model-item prop="endTime">
|
|
- <a-time-picker v-model="form.endTime" @change="isResetPeriodPrice('endTime', $event)" format="HH:mm" placeholder="请选择结束时间" class="time-picker" />
|
|
|
|
|
|
+ <a-time-picker v-model="form.endTime" @change="isResetstoreItemPriceDTOList('endTime', $event)" format="HH:mm" placeholder="请选择结束时间" class="time-picker" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -106,40 +102,42 @@
|
|
</a-col>
|
|
</a-col>
|
|
<!-- 时段价格设置 start -->
|
|
<!-- 时段价格设置 start -->
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
- <a-form-model-item :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }" prop="periodPrice">
|
|
|
|
|
|
+ <a-form-model-item :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }" prop="storeItemPriceDTOList">
|
|
<div slot="label" class="form-item-label">
|
|
<div slot="label" class="form-item-label">
|
|
<a-tooltip placement="right" arrow-point-at-center title="时段价格是指车主在不同时段洗车需要支付不同的价格,主要用于日间服务和夜间服务的差异化管理,达到调节流量、集客引流的效果。不同时段区间采用起始时间包含,结束时间不包含原则。例如:时段区间为06:00(含)-22:00(不含),普通洗车10元;时间区间为22:00(含)-06:00(不含),普通洗车8元。客户在6点00分01秒普通洗车为10元,客户在22点00分01秒普通洗车为8元。">
|
|
<a-tooltip placement="right" arrow-point-at-center title="时段价格是指车主在不同时段洗车需要支付不同的价格,主要用于日间服务和夜间服务的差异化管理,达到调节流量、集客引流的效果。不同时段区间采用起始时间包含,结束时间不包含原则。例如:时段区间为06:00(含)-22:00(不含),普通洗车10元;时间区间为22:00(含)-06:00(不含),普通洗车8元。客户在6点00分01秒普通洗车为10元,客户在22点00分01秒普通洗车为8元。">
|
|
时段价格
|
|
时段价格
|
|
<a-icon :style="{ fontSize: '18px', color: '#1890ff', verticalAlign: 'sub' }" type="question-circle" />
|
|
<a-icon :style="{ fontSize: '18px', color: '#1890ff', verticalAlign: 'sub' }" type="question-circle" />
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
</div>
|
|
</div>
|
|
- <a-row :gutter="20" v-for="(item, ind) in form.periodPrice" :key="ind">
|
|
|
|
|
|
+ <a-row :gutter="20" v-for="(item, ind) in form.storeItemPriceDTOList" :key="ind">
|
|
<a-col :span="9">
|
|
<a-col :span="9">
|
|
<a-row :gutter="20">
|
|
<a-row :gutter="20">
|
|
<a-col :span="11">
|
|
<a-col :span="11">
|
|
- <a-form-model-item :prop="'periodPrice.'+ ind + '.startTime'" :rules="{required: true, message: '请选择开始时间', trigger: 'change'}">
|
|
|
|
- <a-time-picker v-model="item.startTime" disabled format="HH:mm" placeholder="请选择" class="time-picker" />
|
|
|
|
|
|
+ <a-form-model-item :prop="'storeItemPriceDTOList.'+ ind + '.beginTime'" :rules="{required: true, message: '请选择开始时间', trigger: 'change'}">
|
|
|
|
+ <a-time-picker v-model="item.beginTime" disabled format="HH:mm" placeholder="请选择" class="time-picker" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="2">至</a-col>
|
|
<a-col :span="2">至</a-col>
|
|
<a-col :span="11">
|
|
<a-col :span="11">
|
|
- <a-form-model-item :prop="'periodPrice.'+ ind + '.endTime'" :rules="{required: true, message: '请选择结束时间', trigger: 'change'}">
|
|
|
|
- <a-time-picker v-model="item.endTime" :default-open-value="item.startTime" @change="isResetBelowPeriodPrice($event, ind)" format="HH:mm" placeholder="请选择" class="time-picker" />
|
|
|
|
|
|
+ <a-form-model-item :prop="'storeItemPriceDTOList.'+ ind + '.endTime'" :rules="{required: true, message: '请选择结束时间', trigger: 'change'}">
|
|
|
|
+ <a-time-picker v-model="item.endTime" :default-open-value="item.beginTime" @change="isResetBelowstoreItemPriceDTOList($event, ind)" format="HH:mm" placeholder="请选择" class="time-picker" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :span="13">
|
|
|
|
|
|
+ <a-col :span="14">
|
|
<a-row :gutter="20">
|
|
<a-row :gutter="20">
|
|
- <a-col :span="8" v-for="(priceItem, subInd) in item.price" :key="subInd">
|
|
|
|
- <a-form-model-item :prop="'periodPrice.'+ ind +'.price.'+ subInd + '.value'" :rules="{required: true, message: `请输入【${priceItem.name}】单价`, trigger: 'blur'}">
|
|
|
|
- <a-input v-model="priceItem.value" :placeholder="'【'+ priceItem.name +'】单价'" suffix="元" />
|
|
|
|
|
|
+ <a-col :span="8" v-for="(priceItem, subInd) in item.currentPrices" :key="subInd">
|
|
|
|
+ <a-form-model-item :prop="'storeItemPriceDTOList.'+ ind +'.currentPrices.'+ subInd + '.price'" :rules="{required: true, message: `请输入【${priceItem.name}】单价`, trigger: 'blur'}">
|
|
|
|
+ <!-- <a-input v-model="priceItem.price" :placeholder="'【'+ priceItem.name +'】单价'" suffix="元" /> -->
|
|
|
|
+ <a-input-number v-model="priceItem.price" :min="0" :max="999999" :placeholder="'【'+ priceItem.name +'】单价'" class="input-number-s" />
|
|
|
|
+ <span class="unit">元</span>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="1">
|
|
<a-col :span="1">
|
|
- <a-icon type="delete" title="删除" @click="delPeriodPrice(ind)" :style="{ fontSize: '20px', color: 'red' }" />
|
|
|
|
|
|
+ <a-icon type="delete" title="删除" @click="delstoreItemPriceDTOList(ind)" :style="{ fontSize: '20px', color: 'red' }" />
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<a-button type="dashed" @click="setTimeInterval" class="setTimeInterval"><a-icon type="plus" />添加时段</a-button>
|
|
<a-button type="dashed" @click="setTimeInterval" class="setTimeInterval"><a-icon type="plus" />添加时段</a-button>
|
|
@@ -147,8 +145,8 @@
|
|
</a-col>
|
|
</a-col>
|
|
<!-- 时段价格设置 end -->
|
|
<!-- 时段价格设置 end -->
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
- <a-form-model-item label="路线指引" prop="routeGuidance" :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }">
|
|
|
|
- <editor ref="editor" @on-change="editorChange" :cache="false" v-model="form.routeGuidance"></editor>
|
|
|
|
|
|
+ <a-form-model-item label="路线指引" prop="guidance" :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }">
|
|
|
|
+ <editor ref="editor" @on-change="editorChange" :cache="false" v-model="form.guidance"></editor>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
@@ -179,6 +177,8 @@
|
|
import ChooseEquipment from './ChooseEquipment.vue'
|
|
import ChooseEquipment from './ChooseEquipment.vue'
|
|
import Editor from '@/components/WEeditor'
|
|
import Editor from '@/components/WEeditor'
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
|
|
+ import { getProvince, getCityByPro, getDistrictByCity } from '@/api/lookup'
|
|
|
|
+ import { itemQuery, storeSave } from '@/api/car-wash'
|
|
export default{
|
|
export default{
|
|
name: 'AddCarWashModal',
|
|
name: 'AddCarWashModal',
|
|
components: { VSelect, Editor, ChooseEquipment },
|
|
components: { VSelect, Editor, ChooseEquipment },
|
|
@@ -190,6 +190,10 @@
|
|
mtitle: { // 弹框标题
|
|
mtitle: { // 弹框标题
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
|
|
+ },
|
|
|
|
+ carWashInfo: { // 网点详情
|
|
|
|
+ type: Object,
|
|
|
|
+ default: ()=>{}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data(){
|
|
data(){
|
|
@@ -197,19 +201,22 @@
|
|
isShow: this.openModal, // 弹框是否展示
|
|
isShow: this.openModal, // 弹框是否展示
|
|
form: {
|
|
form: {
|
|
name: '', // 网点名称
|
|
name: '', // 网点名称
|
|
- addrProvince: undefined, // 省
|
|
|
|
- addrCity: undefined, // 市
|
|
|
|
- addrDistrict: undefined, // 区
|
|
|
|
|
|
+ addrProvince: undefined, // 省 编码
|
|
|
|
+ addrProvinceName: '', // 省
|
|
|
|
+ addrCity: undefined, // 市 编码
|
|
|
|
+ addrCityName: '', // 市
|
|
|
|
+ addrDistrict: undefined, // 区 编码
|
|
|
|
+ addrDistrictName: '', // 区
|
|
addrDetail: '', // 详细地址
|
|
addrDetail: '', // 详细地址
|
|
- equipment: '', // 设备
|
|
|
|
- sign: [], // 网点标签
|
|
|
|
- longitude: '', // 经度
|
|
|
|
- latitude: '', // 纬度
|
|
|
|
|
|
+ deviceDTOList: [], // 设备序列号
|
|
|
|
+ featuredServiceLabel: '', // 网点标签
|
|
|
|
+ lng: '', // 经度
|
|
|
|
+ lat: '', // 纬度
|
|
serviceType: [], // 服务类型
|
|
serviceType: [], // 服务类型
|
|
- startTime: null, // 营业时间开始时间
|
|
|
|
|
|
+ beginTime: null, // 营业时间开始时间
|
|
endTime: null, // 营业时间结束时间
|
|
endTime: null, // 营业时间结束时间
|
|
- periodPrice: [], // 时段价格
|
|
|
|
- routeGuidance: '', // 路线指引
|
|
|
|
|
|
+ storeItemPriceDTOList: [], // 时段价格
|
|
|
|
+ guidance: '', // 路线指引
|
|
reminder: '' // 温馨提示
|
|
reminder: '' // 温馨提示
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
@@ -228,61 +235,123 @@
|
|
addrDetail: [
|
|
addrDetail: [
|
|
{ required: true, message: '请输入详细地址', trigger: 'blur' }
|
|
{ required: true, message: '请输入详细地址', trigger: 'blur' }
|
|
],
|
|
],
|
|
- equipment: [
|
|
|
|
|
|
+ deviceDTOList: [
|
|
{ required: true, message: '请选择设备', trigger: 'change' }
|
|
{ required: true, message: '请选择设备', trigger: 'change' }
|
|
],
|
|
],
|
|
- sign: [
|
|
|
|
- { required: true, message: '请选择网点标签', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- longitude: [
|
|
|
|
|
|
+ lng: [
|
|
{ required: true, message: '请输入经度', trigger: 'blur' }
|
|
{ required: true, message: '请输入经度', trigger: 'blur' }
|
|
],
|
|
],
|
|
- latitude: [
|
|
|
|
|
|
+ lat: [
|
|
{ required: true, message: '请输入纬度', trigger: 'blur' }
|
|
{ required: true, message: '请输入纬度', trigger: 'blur' }
|
|
],
|
|
],
|
|
serviceType: [
|
|
serviceType: [
|
|
{ required: true, message: '请选择服务类型', trigger: 'change' }
|
|
{ required: true, message: '请选择服务类型', trigger: 'change' }
|
|
],
|
|
],
|
|
- startTime: [
|
|
|
|
|
|
+ beginTime: [
|
|
{ required: true, message: '请选择开始时间', trigger: 'change' }
|
|
{ required: true, message: '请选择开始时间', trigger: 'change' }
|
|
],
|
|
],
|
|
endTime: [
|
|
endTime: [
|
|
{ required: true, message: '请选择结束时间', trigger: 'change' }
|
|
{ required: true, message: '请选择结束时间', trigger: 'change' }
|
|
],
|
|
],
|
|
- periodPrice: [
|
|
|
|
|
|
+ storeItemPriceDTOList: [
|
|
{ required: true, message: '请设置时段价格', trigger: 'change' }
|
|
{ required: true, message: '请设置时段价格', trigger: 'change' }
|
|
]
|
|
]
|
|
},
|
|
},
|
|
openEquipmentModal: false ,// 选择设备 弹框展示状态
|
|
openEquipmentModal: false ,// 选择设备 弹框展示状态
|
|
- equipmentName: '', // 选中的设备 名称
|
|
|
|
serviceType: [], // 服务类型 change前的值
|
|
serviceType: [], // 服务类型 change前的值
|
|
- startTime: null, // 营业时间开始时间 change前的值
|
|
|
|
|
|
+ beginTime: null, // 营业时间开始时间 change前的值
|
|
endTime: null, // 营业时间结束时间 change前的值
|
|
endTime: null, // 营业时间结束时间 change前的值
|
|
- subEndTime: [], // 时段价格 时段区间结束时间 change前的值
|
|
|
|
|
|
+ subendTime: [], // 时段价格 时段区间结束时间 change前的值
|
|
|
|
+ featuredServiceLabel: [], // 网点标签
|
|
|
|
+ addrProvinceList: [], // 省列表数据
|
|
|
|
+ addrCityList: [], // 市列表数据
|
|
|
|
+ addrDistrictList: [], // 区县列表数据
|
|
|
|
+ itemQueryList: [], // 服务类型列表数据
|
|
|
|
+ deviceNo: '', // 已选设备序列号
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
moment,
|
|
moment,
|
|
// 文本编辑器 change
|
|
// 文本编辑器 change
|
|
editorChange (html, text) {
|
|
editorChange (html, text) {
|
|
- this.form.name = html
|
|
|
|
|
|
+ console.log(html, text,'===')
|
|
|
|
+ this.form.guidance = html
|
|
// 点击查看详情时给文本编辑器赋值
|
|
// 点击查看详情时给文本编辑器赋值
|
|
- // this.$refs.editor.setHtml(this.formData.content)
|
|
|
|
|
|
+ },
|
|
|
|
+ // 表单赋值
|
|
|
|
+ setVal(item){
|
|
|
|
+ const _this = this
|
|
|
|
+ console.log(item)
|
|
|
|
+ let arr = [
|
|
|
|
+ 'name',
|
|
|
|
+ 'addrProvince',
|
|
|
|
+ 'addrProvinceName',
|
|
|
|
+ // 'addrCity',
|
|
|
|
+ 'addrCityName',
|
|
|
|
+ // 'addrDistrict',
|
|
|
|
+ 'addrDistrictName',
|
|
|
|
+ // 'addrDetail',
|
|
|
|
+ // 'deviceDTOList',
|
|
|
|
+ 'featuredServiceLabel',
|
|
|
|
+ 'lng',
|
|
|
|
+ 'lat',
|
|
|
|
+ 'serviceType',
|
|
|
|
+ // 'beginTime',
|
|
|
|
+ // 'endTime',
|
|
|
|
+ // 'storeItemPriceDTOList',
|
|
|
|
+ 'guidance',
|
|
|
|
+ 'reminder'
|
|
|
|
+ ]
|
|
|
|
+ arr.map(k => {
|
|
|
|
+ this.form[k] = item[k]
|
|
|
|
+ })
|
|
|
|
+ // this.form.addrProvince = item.addrProvince
|
|
|
|
+ this.getCityList(item.addrProvince) // 获取市区下拉数据
|
|
|
|
+ this.form.addrCity = item.addrCity // 市区赋值
|
|
|
|
+ this.getAreaList(item.addrCity) // 获取区县下拉数据
|
|
|
|
+ this.form.addrDistrict = item.addrDistrict // 区县赋值
|
|
|
|
+ this.form.addrDetail = item.addrDetail // 详细地址赋值
|
|
|
|
+ this.form.deviceDTOList = [{id: item.deviceVOList[0].id}] // 设备
|
|
|
|
+ this.deviceNo = item.deviceVOList[0].deviceNo // 设备序列号
|
|
|
|
+ this.featuredServiceLabel = item.featuredServiceLabel.split(',') // 网点标签
|
|
|
|
+ this.form.serviceType =
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.$refs.editor.setHtml(item.guidance) // 文本编辑器赋值
|
|
},
|
|
},
|
|
// 保存
|
|
// 保存
|
|
onSubmit(formName){
|
|
onSubmit(formName){
|
|
- console.log(this.form, '表单数据')
|
|
|
|
- this.$refs[formName].validate(valid => {
|
|
|
|
|
|
+ const _this = this
|
|
|
|
+ _this.$refs[formName].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- let formData = JSON.parse(JSON.stringify(this.form))
|
|
|
|
|
|
+ let formData = JSON.parse(JSON.stringify(_this.form))
|
|
// 校验营业时间结束时间是否与时段价格一致
|
|
// 校验营业时间结束时间是否与时段价格一致
|
|
- let endTime = formData.periodPrice[formData.periodPrice.length - 1].endTime
|
|
|
|
- if(this.timeFormat(formData.endTime) != this.timeFormat(endTime)){
|
|
|
|
- this.$message.error('时段价格与营业时间不一致,请修改后再保存!')
|
|
|
|
|
|
+ let endTime = formData.storeItemPriceDTOList[formData.storeItemPriceDTOList.length - 1].endTime
|
|
|
|
+ if(_this.timeFormat(formData.endTime) != _this.timeFormat(endTime)){
|
|
|
|
+ _this.$message.error('时段价格与营业时间不一致,请修改后再保存!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ formData.beginTime = _this.timeFormat(formData.beginTime) + ':00'
|
|
|
|
+ formData.endTime = _this.timeFormat(formData.endTime) + ':00'
|
|
|
|
+ formData.storeItemPriceDTOList.map(item => {
|
|
|
|
+ item.beginTime = _this.timeFormat(item.beginTime) + ':00'
|
|
|
|
+ item.endTime = _this.timeFormat(item.endTime) + ':00'
|
|
|
|
+ let arr = []
|
|
|
|
+ item.currentPrices.map(k => {
|
|
|
|
+ arr.push(Number(k.price))
|
|
|
|
+ })
|
|
|
|
+ item.currentPrices = arr
|
|
|
|
+ })
|
|
// 提交前时间格式还需转换
|
|
// 提交前时间格式还需转换
|
|
- console.log(formData,'-----提交的表单数据')
|
|
|
|
|
|
+ delete formData.serviceType
|
|
|
|
+ storeSave(formData).then(res => {
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.$emit('success')
|
|
|
|
+ }else{
|
|
|
|
+ _this.$message.error(res.message)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
@@ -306,52 +375,52 @@
|
|
this.isShow = false
|
|
this.isShow = false
|
|
},
|
|
},
|
|
// 是否重置时段价格 (更改服务类型、营业开始结束时间)
|
|
// 是否重置时段价格 (更改服务类型、营业开始结束时间)
|
|
- isResetPeriodPrice(type, val){
|
|
|
|
- // type: serviceType 服务类型 startTime 营业时间 开始时间 endTime 营业时间 结束时间
|
|
|
|
|
|
+ isResetstoreItemPriceDTOList(type, val){
|
|
|
|
+ // type: serviceType 服务类型 beginTime 营业时间 开始时间 endTime 营业时间 结束时间
|
|
const _this = this
|
|
const _this = this
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
- if(_this.form.periodPrice.length != 0){
|
|
|
|
|
|
+ if(_this.form.storeItemPriceDTOList.length != 0){
|
|
_this.$confirm({
|
|
_this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '更改后已设置的时段价格将会全部清空,确定要更改吗?',
|
|
content: '更改后已设置的时段价格将会全部清空,确定要更改吗?',
|
|
onOk() {
|
|
onOk() {
|
|
- type == 'serviceType' ? _this.serviceType = val : type == 'startTime' ? _this.startTime = val : _this.endTime = val
|
|
|
|
- _this.form.periodPrice = []
|
|
|
|
|
|
+ type == 'serviceType' ? _this.serviceType = val : type == 'beginTime' ? _this.beginTime = val : _this.endTime = val
|
|
|
|
+ _this.form.storeItemPriceDTOList = []
|
|
},
|
|
},
|
|
onCancel() {
|
|
onCancel() {
|
|
- type == 'serviceType' ? _this.form.serviceType = _this.serviceType : type == 'startTime' ? _this.form.startTime = _this.startTime : _this.form.endTime = _this.endTime
|
|
|
|
|
|
+ type == 'serviceType' ? _this.form.serviceType = _this.serviceType : type == 'beginTime' ? _this.form.beginTime = _this.beginTime : _this.form.endTime = _this.endTime
|
|
},
|
|
},
|
|
})
|
|
})
|
|
}else{
|
|
}else{
|
|
- type == 'serviceType' ? _this.serviceType = val : type == 'startTime' ? _this.startTime = val : _this.endTime = val
|
|
|
|
|
|
+ type == 'serviceType' ? _this.serviceType = val : type == 'beginTime' ? _this.beginTime = val : _this.endTime = val
|
|
}
|
|
}
|
|
},0)
|
|
},0)
|
|
},
|
|
},
|
|
// 是否重置时段价格 (更改时段价格区间结束时间)
|
|
// 是否重置时段价格 (更改时段价格区间结束时间)
|
|
- isResetBelowPeriodPrice(val, ind){
|
|
|
|
|
|
+ isResetBelowstoreItemPriceDTOList(val, ind){
|
|
const _this = this
|
|
const _this = this
|
|
// 更改已设置过的时段时间(因为有下一个时段的前提是当前时段结束时间已设置)
|
|
// 更改已设置过的时段时间(因为有下一个时段的前提是当前时段结束时间已设置)
|
|
- if(this.form.periodPrice[ind + 1]){
|
|
|
|
|
|
+ if(this.form.storeItemPriceDTOList[ind + 1]){
|
|
_this.$confirm({
|
|
_this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '更改已设置过的时段区间,其之后的时段区间将会被清空,确定要更改吗?',
|
|
content: '更改已设置过的时段区间,其之后的时段区间将会被清空,确定要更改吗?',
|
|
onOk() {
|
|
onOk() {
|
|
- _this.subEndTime[ind] = val
|
|
|
|
- _this.form.periodPrice.splice(ind + 1, _this.form.periodPrice.length - Number(ind + 1))
|
|
|
|
|
|
+ _this.subendTime[ind] = val
|
|
|
|
+ _this.form.storeItemPriceDTOList.splice(ind + 1, _this.form.storeItemPriceDTOList.length - Number(ind + 1))
|
|
},
|
|
},
|
|
onCancel() {
|
|
onCancel() {
|
|
- _this.form.periodPrice[ind].endTime = _this.subEndTime[ind]
|
|
|
|
|
|
+ _this.form.storeItemPriceDTOList[ind].endTime = _this.subendTime[ind]
|
|
},
|
|
},
|
|
})
|
|
})
|
|
}else{
|
|
}else{
|
|
- _this.subEndTime[ind] = val
|
|
|
|
|
|
+ _this.subendTime[ind] = val
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 选择设备
|
|
// 选择设备
|
|
- closeChooseEquipment(val, name){
|
|
|
|
|
|
+ closeChooseEquipment(val, no){
|
|
if(val){
|
|
if(val){
|
|
- this.form.equipment = val
|
|
|
|
- this.equipmentName = name
|
|
|
|
|
|
+ this.form.deviceDTOList = [{id: val}]
|
|
|
|
+ this.deviceNo = no
|
|
}
|
|
}
|
|
this.openEquipmentModal = false
|
|
this.openEquipmentModal = false
|
|
},
|
|
},
|
|
@@ -361,7 +430,7 @@
|
|
this.$message.error('请先选择服务类型')
|
|
this.$message.error('请先选择服务类型')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!this.form.startTime){
|
|
|
|
|
|
+ if(!this.form.beginTime){
|
|
this.$message.error('请先选择营业时间开始时间')
|
|
this.$message.error('请先选择营业时间开始时间')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -372,35 +441,134 @@
|
|
let arr = {}
|
|
let arr = {}
|
|
// 时段价格开始时间
|
|
// 时段价格开始时间
|
|
let timeStr = ''
|
|
let timeStr = ''
|
|
- if(this.form.periodPrice.length == 0){
|
|
|
|
- timeStr = this.form.startTime.format('HH:mm')
|
|
|
|
|
|
+ if(this.form.storeItemPriceDTOList.length == 0){
|
|
|
|
+ timeStr = this.form.beginTime.format('HH:mm')
|
|
}else{
|
|
}else{
|
|
- timeStr = this.form.periodPrice[this.form.periodPrice.length - 1].endTime
|
|
|
|
|
|
+ timeStr = this.form.storeItemPriceDTOList[this.form.storeItemPriceDTOList.length - 1].endTime
|
|
if(!timeStr){
|
|
if(!timeStr){
|
|
- this.$message.error('请先选择时段价格 - 第'+ this.form.periodPrice.length +'个时段的结束时间')
|
|
|
|
|
|
+ this.$message.error('请先选择时段价格 - 第'+ this.form.storeItemPriceDTOList.length +'个时段的结束时间')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- arr.startTime = moment(timeStr, 'HH:mm')
|
|
|
|
|
|
+ arr.beginTime = moment(timeStr, 'HH:mm')
|
|
arr.endTime = null
|
|
arr.endTime = null
|
|
- arr.price = []
|
|
|
|
|
|
+ arr.itemIds = this.form.serviceType
|
|
|
|
+ arr.currentPrices = []
|
|
this.form.serviceType.map((item, index) => {
|
|
this.form.serviceType.map((item, index) => {
|
|
- arr.price.push({ name: this.$refs.serviceType.getNameByCode(item), value: '' })
|
|
|
|
|
|
+ let i = this.itemQueryList.findIndex(k => k.id == item)
|
|
|
|
+ arr.currentPrices.push({ name: this.itemQueryList[i].itemName, price: '' })
|
|
})
|
|
})
|
|
- this.form.periodPrice.push(arr)
|
|
|
|
|
|
+ this.form.storeItemPriceDTOList.push(arr)
|
|
},
|
|
},
|
|
// 删除时段价格
|
|
// 删除时段价格
|
|
- delPeriodPrice(ind){
|
|
|
|
|
|
+ delstoreItemPriceDTOList(ind){
|
|
const _this = this
|
|
const _this = this
|
|
- let msg = Number(ind + 1) == _this.form.periodPrice.length ? '确定要删除该时段吗?' : '确定要删除该时段以及其之后已设置的时段吗?'
|
|
|
|
|
|
+ let msg = Number(ind + 1) == _this.form.storeItemPriceDTOList.length ? '确定要删除该时段吗?' : '确定要删除该时段以及其之后已设置的时段吗?'
|
|
_this.$confirm({
|
|
_this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: msg,
|
|
content: msg,
|
|
onOk() {
|
|
onOk() {
|
|
- _this.form.periodPrice.splice(ind, _this.form.periodPrice.length - ind)
|
|
|
|
|
|
+ _this.form.storeItemPriceDTOList.splice(ind, _this.form.storeItemPriceDTOList.length - ind)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ },
|
|
|
|
+ // 网点标签 change
|
|
|
|
+ featuredServiceLabelChange(val){
|
|
|
|
+ this.form.featuredServiceLabel = val.join(',')
|
|
|
|
+ },
|
|
|
|
+ // 获取服务类型列表
|
|
|
|
+ getItemQuery(){
|
|
|
|
+ itemQuery({
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 1000
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ this.itemQueryList = res.data.list || []
|
|
|
|
+ }else{
|
|
|
|
+ this.itemQueryList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 获取省列表'
|
|
|
|
+ getProvinceList() {
|
|
|
|
+ const _this = this
|
|
|
|
+ getProvince().then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.addrProvinceList = res.data || []
|
|
|
|
+ } else {
|
|
|
|
+ _this.addrProvinceList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 获取城市列表
|
|
|
|
+ getCityList (val) {
|
|
|
|
+ this.addrCityList = []
|
|
|
|
+ this.addrDistrictList = []
|
|
|
|
+ this.form.addrCity = undefined
|
|
|
|
+ this.form.addrDistrict = undefined
|
|
|
|
+ this.form.addrDetail = ''
|
|
|
|
+ if (val == null || val == '') {
|
|
|
|
+ this.form.addrProvinceName = ''
|
|
|
|
+ } else {
|
|
|
|
+ for (let i = 0; i < this.addrProvinceList.length; i++) {
|
|
|
|
+ if (this.addrProvinceList[i].id == val) {
|
|
|
|
+ this.form.addrProvinceName = this.addrProvinceList[i].name
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.getCityListRequest(val)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getCityListRequest (val) {
|
|
|
|
+ const _this = this
|
|
|
|
+ getCityByPro({id: val}).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.addrCityList = res.data || []
|
|
|
|
+ } else {
|
|
|
|
+ _this.addrCityList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 获取区县列表
|
|
|
|
+ getAreaList (val) {
|
|
|
|
+ this.addrDistrictList = []
|
|
|
|
+ this.form.addrDistrict = undefined
|
|
|
|
+ this.form.addrDetail = ''
|
|
|
|
+ if (val == null || val == '') {
|
|
|
|
+ this.form.addrCityName = ''
|
|
|
|
+ } else {
|
|
|
|
+ for (let i = 0; i < this.addrCityList.length; i++) {
|
|
|
|
+ if (this.addrCityList[i].id == val) {
|
|
|
|
+ this.form.addrCityName = this.addrCityList[i].name
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.getAreaListRequest(val)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getAreaListRequest (val) {
|
|
|
|
+ const _this = this
|
|
|
|
+ getDistrictByCity({id: val}).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.addrDistrictList = res.data || []
|
|
|
|
+ } else {
|
|
|
|
+ _this.addrDistrictList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 区县变更
|
|
|
|
+ areaCharged (val) {
|
|
|
|
+ if (val == null || val == '') {
|
|
|
|
+ this.form.addrDistrictName = ''
|
|
|
|
+ } else {
|
|
|
|
+ for (let i = 0; i < this.addrDistrictList.length; i++) {
|
|
|
|
+ if (this.addrDistrictList[i].id == val) {
|
|
|
|
+ this.form.addrDistrictName = this.addrDistrictList[i].name
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.form.addrDetail = ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -412,7 +580,17 @@
|
|
isShow (val){
|
|
isShow (val){
|
|
if (!val){
|
|
if (!val){
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
|
|
+ }else{
|
|
|
|
+ this.getProvinceList() // 获取省下拉
|
|
|
|
+ this.getItemQuery() // 服务类型 列表
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ // 网点详情 数据
|
|
|
|
+ carWashInfo: {
|
|
|
|
+ handler: function (item) {
|
|
|
|
+ this.setVal(item)
|
|
|
|
+ },
|
|
|
|
+ deep: true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -460,5 +638,13 @@
|
|
width: 40%;
|
|
width: 40%;
|
|
color: #19be6b;
|
|
color: #19be6b;
|
|
}
|
|
}
|
|
|
|
+ .input-number-s{
|
|
|
|
+ width: 90%;
|
|
|
|
+ }
|
|
|
|
+ .unit{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 10%;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|