|
@@ -5,16 +5,15 @@
|
|
:width="1000"
|
|
:width="1000"
|
|
:footer="null"
|
|
:footer="null"
|
|
:destroyOnClose="true"
|
|
:destroyOnClose="true"
|
|
- @cancel="isShow=false"
|
|
|
|
- v-model="isShow">
|
|
|
|
|
|
+ @cancel="isShow = false"
|
|
|
|
+ v-model="isShow"
|
|
|
|
+ >
|
|
<!-- 表单 -->
|
|
<!-- 表单 -->
|
|
<a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
|
|
<a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
|
|
<a-row :gutter="20">
|
|
<a-row :gutter="20">
|
|
<a-row>
|
|
<a-row>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
- <a-form-model-item label="网点名称" prop="name">
|
|
|
|
- <a-input v-model="form.name" :maxLength="20" placeholder="请输入网店名称,20个字以内" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
|
|
+ <a-form-model-item label="网点名称" prop="name"><a-input v-model="form.name" :maxLength="20" placeholder="请输入网店名称,20个字以内" /></a-form-model-item>
|
|
<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="8">
|
|
<a-col :span="8">
|
|
@@ -53,9 +52,7 @@
|
|
listType="picture-card"
|
|
listType="picture-card"
|
|
upText="上传图片"></Upload>
|
|
upText="上传图片"></Upload>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :span="16">
|
|
|
|
- <p class="pic-remarks">(尺寸为100*100px)</p>
|
|
|
|
- </a-col>
|
|
|
|
|
|
+ <a-col :span="16"><p class="pic-remarks">(尺寸为100*100px)</p></a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -72,13 +69,13 @@
|
|
<a-tag v-if="form.deviceDTOList.length > 0" color="blue">{{ deviceNo }}</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" v-if="pageType != 'edit'" @click="openEquipmentModal = true">选择</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</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="featuredServiceLabel" :rules="{required: true, message: '请选择网点标签', trigger: 'change'}">
|
|
|
|
|
|
+ <a-form-model-item label="网点标签" prop="featuredServiceLabel" :rules="{ required: true, message: '请选择网点标签', trigger: 'change' }">
|
|
<v-select
|
|
<v-select
|
|
ref="featuredServiceLabel"
|
|
ref="featuredServiceLabel"
|
|
v-model="featuredServiceLabel"
|
|
v-model="featuredServiceLabel"
|
|
@@ -86,15 +83,14 @@
|
|
mode="multiple"
|
|
mode="multiple"
|
|
placeholder="请选择网点标签"
|
|
placeholder="请选择网点标签"
|
|
showArrow
|
|
showArrow
|
|
- code="STORE_LABEL"></v-select>
|
|
|
|
|
|
+ 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="lng" 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-input-number v-model="form.lng" :min="0" :max="999" placeholder="请输入经度坐标" class="input-number-all" />
|
|
|
|
- </a-col>
|
|
|
|
|
|
+ <a-col :span="17"><a-input-number v-model="form.lng" :min="-180" :max="180" placeholder="请输入经度坐标" class="input-number-all" /></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">
|
|
<a-button type="primary" size="small" icon="search" class="small-btn">查询坐标</a-button>
|
|
<a-button type="primary" size="small" icon="search" class="small-btn">查询坐标</a-button>
|
|
@@ -105,7 +101,7 @@
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
<a-form-model-item label="纬度" prop="lat">
|
|
<a-form-model-item label="纬度" prop="lat">
|
|
- <a-input-number v-model="form.lat" :min="0" :max="999" placeholder="请输入纬度坐标" class="input-number-all" />
|
|
|
|
|
|
+ <a-input-number v-model="form.lat" :min="-90" :max="90" placeholder="请输入纬度坐标" class="input-number-all" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
@@ -120,13 +116,25 @@
|
|
<a-row :gutter="20">
|
|
<a-row :gutter="20">
|
|
<a-col :span="11">
|
|
<a-col :span="11">
|
|
<a-form-model-item prop="beginTime">
|
|
<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-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="isResetstoreItemPriceDTOList('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>
|
|
@@ -136,7 +144,11 @@
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
<a-form-model-item :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }" prop="storeItemPriceDTOList">
|
|
<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>
|
|
@@ -145,20 +157,27 @@
|
|
<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="'storeItemPriceDTOList.'+ ind + '.beginTime'" :rules="{required: true, message: '请选择开始时间', trigger: 'change'}">
|
|
|
|
|
|
+ <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-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="'storeItemPriceDTOList.'+ ind + '.endTime'" :rules="{required: true, message: '请选择结束时间', trigger: 'change'}">
|
|
|
|
|
|
+ <a-form-model-item
|
|
|
|
+ :prop="'storeItemPriceDTOList.' + ind + '.endTime'"
|
|
|
|
+ :rules="{ required: true, message: '请选择结束时间', trigger: 'change' }"
|
|
|
|
+ >
|
|
<a-time-picker
|
|
<a-time-picker
|
|
v-model="item.endTime"
|
|
v-model="item.endTime"
|
|
:default-open-value="item.beginTime"
|
|
:default-open-value="item.beginTime"
|
|
@change="isResetBelowstoreItemPriceDTOList($event, ind)"
|
|
@change="isResetBelowstoreItemPriceDTOList($event, ind)"
|
|
format="HH:mm"
|
|
format="HH:mm"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
- class="time-picker" />
|
|
|
|
|
|
+ class="time-picker"
|
|
|
|
+ />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -166,24 +185,29 @@
|
|
<a-col :span="14">
|
|
<a-col :span="14">
|
|
<a-row :gutter="20">
|
|
<a-row :gutter="20">
|
|
<a-col :span="8" v-for="(priceItem, subInd) in item.currentPrices" :key="subInd">
|
|
<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-form-model-item
|
|
|
|
+ :prop="'storeItemPriceDTOList.' + ind + '.currentPrices.' + subInd + '.price'"
|
|
|
|
+ :rules="{ required: true, message: `请输入【${priceItem.name}】单价`, trigger: 'blur' }"
|
|
|
|
+ >
|
|
<a-input-number
|
|
<a-input-number
|
|
v-model="priceItem.price"
|
|
v-model="priceItem.price"
|
|
:min="0"
|
|
:min="0"
|
|
:max="999999"
|
|
:max="999999"
|
|
:precision="2"
|
|
:precision="2"
|
|
- :placeholder="'【'+ priceItem.name +'】单价'"
|
|
|
|
- class="input-number-s" />
|
|
|
|
|
|
+ :placeholder="'【' + priceItem.name + '】单价'"
|
|
|
|
+ class="input-number-s"
|
|
|
|
+ />
|
|
<span class="unit">元</span>
|
|
<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-icon type="delete" title="删除" @click="delstoreItemPriceDTOList(ind)" :style="{ fontSize: '20px', color: 'red' }" />
|
|
|
|
- </a-col>
|
|
|
|
|
|
+ <a-col :span="1"><a-icon type="delete" title="删除" @click="delstoreItemPriceDTOList(ind)" :style="{ fontSize: '20px', color: 'red' }" /></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>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<!-- 时段价格设置 end -->
|
|
<!-- 时段价格设置 end -->
|
|
@@ -207,11 +231,7 @@
|
|
</a-form-model>
|
|
</a-form-model>
|
|
|
|
|
|
<!-- 选择设备 -->
|
|
<!-- 选择设备 -->
|
|
- <choose-equipment
|
|
|
|
- :openEquipmentModal="openEquipmentModal"
|
|
|
|
- @close="closeChooseEquipment"
|
|
|
|
- />
|
|
|
|
-
|
|
|
|
|
|
+ <choose-equipment :openEquipmentModal="openEquipmentModal" @close="closeChooseEquipment" />
|
|
</a-modal>
|
|
</a-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -226,15 +246,18 @@ export default {
|
|
name: 'AddCarWashModal',
|
|
name: 'AddCarWashModal',
|
|
components: { VSelect, Upload, Editor, ChooseEquipment },
|
|
components: { VSelect, Upload, Editor, ChooseEquipment },
|
|
props: {
|
|
props: {
|
|
- openModal: { // 弹框是否展示
|
|
|
|
|
|
+ openModal: {
|
|
|
|
+ // 弹框是否展示
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false
|
|
default: false
|
|
},
|
|
},
|
|
- pageType: { // 页面类型
|
|
|
|
|
|
+ pageType: {
|
|
|
|
+ // 页面类型
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
},
|
|
},
|
|
- carWashId: { // 网点id
|
|
|
|
|
|
+ carWashId: {
|
|
|
|
+ // 网点id
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
}
|
|
}
|
|
@@ -264,45 +287,28 @@ export default {
|
|
reminder: '' // 温馨提示
|
|
reminder: '' // 温馨提示
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- icon: [
|
|
|
|
- { required: true, message: '请选择网店照片', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- name: [
|
|
|
|
- { required: true, message: '请输入网店名称', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- addrProvince: [
|
|
|
|
- { required: true, message: '请选择所在省份', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- addrCity: [
|
|
|
|
- { required: true, message: '请选择所在市', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- addrDistrict: [
|
|
|
|
- { required: true, message: '请选择所在区县', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- addrDetail: [
|
|
|
|
- { required: true, message: '请输入详细地址', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- deviceDTOList: [
|
|
|
|
- { required: true, message: '请选择设备', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
|
|
+ icon: [{ required: true, message: '请选择网店照片', trigger: 'change' }],
|
|
|
|
+ name: [{ required: true, message: '请输入网店名称', trigger: 'blur' }],
|
|
|
|
+ addrProvince: [{ required: true, message: '请选择所在省份', trigger: 'change' }],
|
|
|
|
+ addrCity: [{ required: true, message: '请选择所在市', trigger: 'change' }],
|
|
|
|
+ addrDistrict: [{ required: true, message: '请选择所在区县', trigger: 'change' }],
|
|
|
|
+ addrDetail: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
|
|
|
|
+ deviceDTOList: [{ required: true, message: '请选择设备', trigger: 'change' }],
|
|
lng: [
|
|
lng: [
|
|
- { required: true, message: '请输入经度', trigger: 'blur' }
|
|
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ pattern: /^[\\-\\+]?(0?\d{1,2}\.\d{1,8}|1[0-7]?\d{1}\.\d{1,8}|180\.0{1,8})$/,
|
|
|
|
+ message: '请输入正确的经度,整数部分为0~180,必须输入1到8位小数',
|
|
|
|
+ trigger: 'blur'
|
|
|
|
+ }
|
|
],
|
|
],
|
|
lat: [
|
|
lat: [
|
|
- { required: true, message: '请输入纬度', trigger: 'blur' }
|
|
|
|
- ],
|
|
|
|
- serviceType: [
|
|
|
|
- { required: true, message: '请选择服务类型', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- beginTime: [
|
|
|
|
- { required: true, message: '请选择开始时间', trigger: 'change' }
|
|
|
|
|
|
+ { required: true, pattern: /^[\\-\\+]?([0-8]?\d{1}\.\d{1,8}|90\.0{1,8})$/, message: '请输入正确的纬度,整数部分为0~90,必须输入1到8位小数', trigger: 'blur' }
|
|
],
|
|
],
|
|
- endTime: [
|
|
|
|
- { required: true, message: '请选择结束时间', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- storeItemPriceDTOList: [
|
|
|
|
- { required: true, message: '请设置时段价格', trigger: 'change' }
|
|
|
|
- ]
|
|
|
|
|
|
+ serviceType: [{ required: true, message: '请选择服务类型', trigger: 'change' }],
|
|
|
|
+ beginTime: [{ required: true, message: '请选择开始时间', trigger: 'change' }],
|
|
|
|
+ endTime: [{ required: true, message: '请选择结束时间', trigger: 'change' }],
|
|
|
|
+ storeItemPriceDTOList: [{ required: true, message: '请设置时段价格', trigger: 'change' }]
|
|
},
|
|
},
|
|
openEquipmentModal: false, // 选择设备 弹框展示状态
|
|
openEquipmentModal: false, // 选择设备 弹框展示状态
|
|
serviceType: [], // 服务类型 change前的值
|
|
serviceType: [], // 服务类型 change前的值
|
|
@@ -339,9 +345,21 @@ export default {
|
|
},
|
|
},
|
|
// 表单赋值
|
|
// 表单赋值
|
|
setVal (item) {
|
|
setVal (item) {
|
|
- const _this = this
|
|
|
|
- console.log(item)
|
|
|
|
- const arr = [ 'id', 'icon', 'name', 'addrProvince', 'addrProvinceName', 'addrCityName', 'addrDistrictName', 'featuredServiceLabel', 'lng', 'lat', 'serviceType', 'guidance', 'reminder' ]
|
|
|
|
|
|
+ const arr = [
|
|
|
|
+ 'id',
|
|
|
|
+ 'icon',
|
|
|
|
+ 'name',
|
|
|
|
+ 'addrProvince',
|
|
|
|
+ 'addrProvinceName',
|
|
|
|
+ 'addrCityName',
|
|
|
|
+ 'addrDistrictName',
|
|
|
|
+ 'featuredServiceLabel',
|
|
|
|
+ 'lng',
|
|
|
|
+ 'lat',
|
|
|
|
+ 'serviceType',
|
|
|
|
+ 'guidance',
|
|
|
|
+ 'reminder'
|
|
|
|
+ ]
|
|
arr.map(k => {
|
|
arr.map(k => {
|
|
this.form[k] = item[k]
|
|
this.form[k] = item[k]
|
|
})
|
|
})
|
|
@@ -357,8 +375,9 @@ export default {
|
|
this.form.beginTime = moment(item.beginTime, 'HH:mm') // 营业时间 开始时间
|
|
this.form.beginTime = moment(item.beginTime, 'HH:mm') // 营业时间 开始时间
|
|
this.form.endTime = moment(item.endTime, 'HH:mm') // 营业时间 结束时间
|
|
this.form.endTime = moment(item.endTime, 'HH:mm') // 营业时间 结束时间
|
|
this.setPeriodPrice(item.storeItemPriceDTOList) // 时段价格
|
|
this.setPeriodPrice(item.storeItemPriceDTOList) // 时段价格
|
|
- this.isShow ? this.$refs.editor.setHtml(item.guidance) : null // 文本编辑器赋值
|
|
|
|
- console.log(this.form, '----赋值后的表单')
|
|
|
|
|
|
+ if (this.isShow) {
|
|
|
|
+ this.$refs.editor.setHtml(item.guidance) // 文本编辑器赋值
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 时段价格 赋值处理
|
|
// 时段价格 赋值处理
|
|
setPeriodPrice (storeItemPriceDTOList) {
|
|
setPeriodPrice (storeItemPriceDTOList) {
|
|
@@ -385,7 +404,7 @@ export default {
|
|
const formData = JSON.parse(JSON.stringify(_this.form))
|
|
const formData = JSON.parse(JSON.stringify(_this.form))
|
|
// 校验营业时间结束时间是否与时段价格一致
|
|
// 校验营业时间结束时间是否与时段价格一致
|
|
const endTime = formData.storeItemPriceDTOList[formData.storeItemPriceDTOList.length - 1].endTime
|
|
const endTime = formData.storeItemPriceDTOList[formData.storeItemPriceDTOList.length - 1].endTime
|
|
- if (_this.timeFormat(formData.endTime) != _this.timeFormat(endTime)) {
|
|
|
|
|
|
+ if (_this.timeFormat(formData.endTime) !== _this.timeFormat(endTime)) {
|
|
_this.$message.error('时段价格与营业时间不一致,请修改后再保存!')
|
|
_this.$message.error('时段价格与营业时间不一致,请修改后再保存!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -446,8 +465,11 @@ export default {
|
|
this.deviceNo = '' // 已选设备序列号
|
|
this.deviceNo = '' // 已选设备序列号
|
|
// this.$refs.ruleForm.resetFields() // 无效
|
|
// this.$refs.ruleForm.resetFields() // 无效
|
|
this.form.id = null
|
|
this.form.id = null
|
|
- this.form.icon = '' // 网点照片
|
|
|
|
- this.$refs.showPicture ? this.$refs.showPicture.setFileList('') : null
|
|
|
|
|
|
+ this.form.icon = ''
|
|
|
|
+ if (this.$refs.showPicture) {
|
|
|
|
+ // 网点照片
|
|
|
|
+ this.$refs.showPicture.setFileList('')
|
|
|
|
+ }
|
|
this.form.name = '' // 网点名称
|
|
this.form.name = '' // 网点名称
|
|
this.form.addrProvince = undefined // 省 编码
|
|
this.form.addrProvince = undefined // 省 编码
|
|
this.form.addrProvinceName = '' // 省
|
|
this.form.addrProvinceName = '' // 省
|
|
@@ -472,20 +494,24 @@ export default {
|
|
// type: serviceType 服务类型 beginTime 营业时间 开始时间 endTime 营业时间 结束时间
|
|
// type: serviceType 服务类型 beginTime 营业时间 开始时间 endTime 营业时间 结束时间
|
|
const _this = this
|
|
const _this = this
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- if (_this.form.storeItemPriceDTOList.length != 0) {
|
|
|
|
|
|
+ if (_this.form.storeItemPriceDTOList.length !== 0) {
|
|
_this.$confirm({
|
|
_this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '更改后已设置的时段价格将会全部清空,确定要更改吗?',
|
|
content: '更改后已设置的时段价格将会全部清空,确定要更改吗?',
|
|
onOk () {
|
|
onOk () {
|
|
- type == 'serviceType' ? _this.serviceType = val : type == 'beginTime' ? _this.beginTime = val : _this.endTime = val
|
|
|
|
|
|
+ type === 'serviceType' ? (_this.serviceType = val) : type === 'beginTime' ? (_this.beginTime = val) : (_this.endTime = val)
|
|
_this.form.storeItemPriceDTOList = []
|
|
_this.form.storeItemPriceDTOList = []
|
|
},
|
|
},
|
|
onCancel () {
|
|
onCancel () {
|
|
- type == 'serviceType' ? _this.form.serviceType = _this.serviceType : type == 'beginTime' ? _this.form.beginTime = _this.beginTime : _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 == 'beginTime' ? _this.beginTime = val : _this.endTime = val
|
|
|
|
|
|
+ type === 'serviceType' ? (_this.serviceType = val) : type === 'beginTime' ? (_this.beginTime = val) : (_this.endTime = val)
|
|
}
|
|
}
|
|
}, 0)
|
|
}, 0)
|
|
},
|
|
},
|
|
@@ -523,7 +549,7 @@ export default {
|
|
},
|
|
},
|
|
// 设置时段价格
|
|
// 设置时段价格
|
|
setTimeInterval () {
|
|
setTimeInterval () {
|
|
- if (this.form.serviceType.length == 0) {
|
|
|
|
|
|
+ if (this.form.serviceType.length === 0) {
|
|
this.$message.error('请先选择服务类型')
|
|
this.$message.error('请先选择服务类型')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -538,7 +564,7 @@ export default {
|
|
const arr = {}
|
|
const arr = {}
|
|
// 时段价格开始时间
|
|
// 时段价格开始时间
|
|
let timeStr = ''
|
|
let timeStr = ''
|
|
- if (this.form.storeItemPriceDTOList.length == 0) {
|
|
|
|
|
|
+ if (this.form.storeItemPriceDTOList.length === 0) {
|
|
timeStr = this.form.beginTime.format('HH:mm')
|
|
timeStr = this.form.beginTime.format('HH:mm')
|
|
} else {
|
|
} else {
|
|
timeStr = this.form.storeItemPriceDTOList[this.form.storeItemPriceDTOList.length - 1].endTime
|
|
timeStr = this.form.storeItemPriceDTOList[this.form.storeItemPriceDTOList.length - 1].endTime
|
|
@@ -551,7 +577,7 @@ export default {
|
|
arr.endTime = null
|
|
arr.endTime = null
|
|
arr.currentPrices = []
|
|
arr.currentPrices = []
|
|
this.form.serviceType.map((item, index) => {
|
|
this.form.serviceType.map((item, index) => {
|
|
- const i = this.itemQueryList.findIndex(k => k.id == item)
|
|
|
|
|
|
+ const i = this.itemQueryList.findIndex(k => Number(k.id) === Number(item))
|
|
arr.currentPrices.push({ name: this.itemQueryList[i].itemName, price: '', itemId: item })
|
|
arr.currentPrices.push({ name: this.itemQueryList[i].itemName, price: '', itemId: item })
|
|
})
|
|
})
|
|
this.form.storeItemPriceDTOList.push(arr)
|
|
this.form.storeItemPriceDTOList.push(arr)
|
|
@@ -559,7 +585,7 @@ export default {
|
|
// 删除时段价格
|
|
// 删除时段价格
|
|
delstoreItemPriceDTOList (ind) {
|
|
delstoreItemPriceDTOList (ind) {
|
|
const _this = this
|
|
const _this = this
|
|
- const msg = Number(ind + 1) == _this.form.storeItemPriceDTOList.length ? '确定要删除该时段吗?' : '确定要删除该时段以及其之后已设置的时段吗?'
|
|
|
|
|
|
+ const msg = Number(ind + 1) === _this.form.storeItemPriceDTOList.length ? '确定要删除该时段吗?' : '确定要删除该时段以及其之后已设置的时段吗?'
|
|
_this.$confirm({
|
|
_this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: msg,
|
|
content: msg,
|
|
@@ -585,7 +611,7 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 获取省列表'
|
|
|
|
|
|
+ // 获取省列表
|
|
getProvinceList () {
|
|
getProvinceList () {
|
|
const _this = this
|
|
const _this = this
|
|
getProvince().then(res => {
|
|
getProvince().then(res => {
|
|
@@ -603,11 +629,11 @@ export default {
|
|
this.form.addrCity = undefined
|
|
this.form.addrCity = undefined
|
|
this.form.addrDistrict = undefined
|
|
this.form.addrDistrict = undefined
|
|
this.form.addrDetail = ''
|
|
this.form.addrDetail = ''
|
|
- if (val == null || val == '') {
|
|
|
|
|
|
+ if (val == null || val === '') {
|
|
this.form.addrProvinceName = ''
|
|
this.form.addrProvinceName = ''
|
|
} else {
|
|
} else {
|
|
for (let i = 0; i < this.addrProvinceList.length; i++) {
|
|
for (let i = 0; i < this.addrProvinceList.length; i++) {
|
|
- if (this.addrProvinceList[i].id == val) {
|
|
|
|
|
|
+ if (Number(this.addrProvinceList[i].id) === Number(val)) {
|
|
this.form.addrProvinceName = this.addrProvinceList[i].name
|
|
this.form.addrProvinceName = this.addrProvinceList[i].name
|
|
break
|
|
break
|
|
}
|
|
}
|
|
@@ -630,11 +656,11 @@ export default {
|
|
this.addrDistrictList = []
|
|
this.addrDistrictList = []
|
|
this.form.addrDistrict = undefined
|
|
this.form.addrDistrict = undefined
|
|
this.form.addrDetail = ''
|
|
this.form.addrDetail = ''
|
|
- if (val == null || val == '') {
|
|
|
|
|
|
+ if (val == null || val === '') {
|
|
this.form.addrCityName = ''
|
|
this.form.addrCityName = ''
|
|
} else {
|
|
} else {
|
|
for (let i = 0; i < this.addrCityList.length; i++) {
|
|
for (let i = 0; i < this.addrCityList.length; i++) {
|
|
- if (this.addrCityList[i].id == val) {
|
|
|
|
|
|
+ if (Number(this.addrCityList[i].id) === Number(val)) {
|
|
this.form.addrCityName = this.addrCityList[i].name
|
|
this.form.addrCityName = this.addrCityList[i].name
|
|
break
|
|
break
|
|
}
|
|
}
|
|
@@ -654,11 +680,11 @@ export default {
|
|
},
|
|
},
|
|
// 区县变更
|
|
// 区县变更
|
|
areaCharged (val) {
|
|
areaCharged (val) {
|
|
- if (val == null || val == '') {
|
|
|
|
|
|
+ if (val == null || val === '') {
|
|
this.form.addrDistrictName = ''
|
|
this.form.addrDistrictName = ''
|
|
} else {
|
|
} else {
|
|
for (let i = 0; i < this.addrDistrictList.length; i++) {
|
|
for (let i = 0; i < this.addrDistrictList.length; i++) {
|
|
- if (this.addrDistrictList[i].id == val) {
|
|
|
|
|
|
+ if (Number(this.addrDistrictList[i].id) === Number(val)) {
|
|
this.form.addrDistrictName = this.addrDistrictList[i].name
|
|
this.form.addrDistrictName = this.addrDistrictList[i].name
|
|
break
|
|
break
|
|
}
|
|
}
|
|
@@ -693,68 +719,70 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
- .CarWashModal{
|
|
|
|
- .default-form-item{
|
|
|
|
- margin-bottom: 0;
|
|
|
|
- }
|
|
|
|
- .form-item-label{
|
|
|
|
- display: inline-block;
|
|
|
|
- cursor: pointer;
|
|
|
|
- }
|
|
|
|
- .form-item-required{
|
|
|
|
- .ant-form-item-label{
|
|
|
|
- label:before{
|
|
|
|
- display: inline-block;
|
|
|
|
- margin-right: 4px;
|
|
|
|
- color: #f5222d;
|
|
|
|
- font-size: 14px;
|
|
|
|
- font-family: SimSun, sans-serif;
|
|
|
|
- line-height: 1;
|
|
|
|
- content: '*';
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .pic-remarks{
|
|
|
|
- font-size: 12px;
|
|
|
|
- color: #f5222d;
|
|
|
|
- margin: 55px 0 0;
|
|
|
|
- }
|
|
|
|
- .small-btn{
|
|
|
|
- background-color: #19be6b;
|
|
|
|
- font-size: 13px;
|
|
|
|
- }
|
|
|
|
- .small-btn.ant-btn-primary:focus, .small-btn.ant-btn-primary:hover{
|
|
|
|
- background-color: #19be6b;
|
|
|
|
- }
|
|
|
|
- .time-picker{
|
|
|
|
- width: 100%;
|
|
|
|
- }
|
|
|
|
- .btn-cont{
|
|
|
|
- text-align: center;
|
|
|
|
- .cancel{
|
|
|
|
- margin-left: 10px;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .setTimeInterval{
|
|
|
|
- width: 40%;
|
|
|
|
- color: #19be6b;
|
|
|
|
- }
|
|
|
|
- .input-number-all{
|
|
|
|
- width: 100%;
|
|
|
|
- }
|
|
|
|
- .input-number-s{
|
|
|
|
- width: 90%;
|
|
|
|
- }
|
|
|
|
- .unit{
|
|
|
|
- display: inline-block;
|
|
|
|
- width: 10%;
|
|
|
|
- text-align: right;
|
|
|
|
- padding-left: 5px;
|
|
|
|
- box-sizing: border-box;
|
|
|
|
- }
|
|
|
|
- .upload-file .ant-upload.ant-upload-select-picture-card, .upload-file .ant-upload-list-picture-card .ant-upload-list-item{
|
|
|
|
- width: 100px;
|
|
|
|
- height: 100px;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+.CarWashModal {
|
|
|
|
+ .default-form-item {
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
+ }
|
|
|
|
+ .form-item-label {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ .form-item-required {
|
|
|
|
+ .ant-form-item-label {
|
|
|
|
+ label:before {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ margin-right: 4px;
|
|
|
|
+ color: #f5222d;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ font-family: SimSun, sans-serif;
|
|
|
|
+ line-height: 1;
|
|
|
|
+ content: '*';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .pic-remarks {
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #f5222d;
|
|
|
|
+ margin: 55px 0 0;
|
|
|
|
+ }
|
|
|
|
+ .small-btn {
|
|
|
|
+ background-color: #19be6b;
|
|
|
|
+ font-size: 13px;
|
|
|
|
+ }
|
|
|
|
+ .small-btn.ant-btn-primary:focus,
|
|
|
|
+ .small-btn.ant-btn-primary:hover {
|
|
|
|
+ background-color: #19be6b;
|
|
|
|
+ }
|
|
|
|
+ .time-picker {
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+ .btn-cont {
|
|
|
|
+ text-align: center;
|
|
|
|
+ .cancel {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .setTimeInterval {
|
|
|
|
+ width: 40%;
|
|
|
|
+ color: #19be6b;
|
|
|
|
+ }
|
|
|
|
+ .input-number-all {
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+ .input-number-s {
|
|
|
|
+ width: 90%;
|
|
|
|
+ }
|
|
|
|
+ .unit {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 10%;
|
|
|
|
+ text-align: right;
|
|
|
|
+ padding-left: 5px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ }
|
|
|
|
+ .upload-file .ant-upload.ant-upload-select-picture-card,
|
|
|
|
+ .upload-file .ant-upload-list-picture-card .ant-upload-list-item {
|
|
|
|
+ width: 100px;
|
|
|
|
+ height: 100px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|