فهرست منبع

Merge branch 'deploy' of http://git.chelingzhu.com/chelingzhu-web/qhsxKx-admin-html into deploy

zhangdan 4 سال پیش
والد
کامیت
eb657c7d36

+ 60 - 0
src/api/car-wash.js

@@ -0,0 +1,60 @@
+import { axios } from '@/utils/request'
+
+// 门店设备列表
+export const storeQuery = (params) => {
+  const url = `store/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 门店设备保存
+export const storeSave = (params) => {
+  const url = 'store/save'
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 查询设备
+export const deviceQuery = (params) => {
+  const url = `device/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 网点详情
+export const storeFind = params => {
+  const url = `store/find/${params.id}`
+  return axios.request({
+    url: url,
+    method: 'get'
+  })
+}
+// 查询门店的服务时段价格
+export const findItem = params => {
+  const url = `item/${params.id}`
+  return axios.request({
+    url: url,
+    method: 'get'
+  })
+}
+// 服务列表
+export const itemQuery = (params) => {
+  const url = `item/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 1 - 1
src/api/data.js

@@ -2,7 +2,7 @@ import { axios } from '@/utils/request'
 
 
 export function login (parameter) {
 export function login (parameter) {
   return axios({
   return axios({
-    url: '/auth/login',
+    url: '/login',
     method: 'post',
     method: 'post',
     data: parameter
     data: parameter
   })
   })

+ 2 - 2
src/api/index.js

@@ -1,6 +1,6 @@
 const api = {
 const api = {
-  Login: '/auth/login',
-  Logout: '/auth/logout',
+  Login: '/login',
+  Logout: '/logout',
   ForgePassword: '/auth/forge-password',
   ForgePassword: '/auth/forge-password',
   Register: '/auth/register',
   Register: '/auth/register',
   twoStepCode: '/auth/2step-code',
   twoStepCode: '/auth/2step-code',

+ 23 - 3
src/api/lookup.js

@@ -1,7 +1,7 @@
 import { axios } from '@/utils/request'
 import { axios } from '@/utils/request'
 
 
 export const listLookUp = params => {
 export const listLookUp = params => {
-  let url = `/lookup/queryLike`
+  const url = `/lookup/queryLike`
   return axios({
   return axios({
     url: url,
     url: url,
     data: params,
     data: params,
@@ -25,7 +25,7 @@ export const delLookUp = params => {
 }
 }
 
 
 export const getLookUpItem = (params) => {
 export const getLookUpItem = (params) => {
-  let url = `/lookupItem/query/${params.pageNo}/${params.pageSize}`
+  const url = `/lookupItem/query/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageNo
   delete params.pageSize
   delete params.pageSize
   return axios({
   return axios({
@@ -35,7 +35,6 @@ export const getLookUpItem = (params) => {
   })
   })
 }
 }
 
 
-
 export const delLookUpItem = params => {
 export const delLookUpItem = params => {
   return axios({
   return axios({
     url: `/lookupItem/delete/${params.id}`,
     url: `/lookupItem/delete/${params.id}`,
@@ -49,3 +48,24 @@ export const saveLookUpItem = params => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+// 查询省
+export const getProvince = () => {
+  return axios.request({
+    url: `/area/PROVINCE`,
+    method: 'get'
+  })
+}
+// 查询市
+export const getCityByPro = params => {
+  return axios.request({
+    url: `/area/CITY/${params.id}`,
+    method: 'get'
+  })
+}
+// 查询区
+export const getDistrictByCity = params => {
+  return axios.request({
+    url: `/area/DISTRICT/${params.id}`,
+    method: 'get'
+  })
+}

+ 17 - 11
src/config/router.config.js

@@ -191,19 +191,25 @@ export const asyncRouterMap = [
       path: '/auth',
       path: '/auth',
       redirect: '/auth/userList',
       redirect: '/auth/userList',
       component: PageView,
       component: PageView,
-      meta: { title: '后台权限管理', icon: 'lock', permission: 'M_auth_0' },
+      meta: { title: '后台权限管理', icon: 'lock'
+        // permission: 'M_auth_0' ,
+      },
       children: [
       children: [
         {
         {
           path: '/auth/userList',
           path: '/auth/userList',
           name: 'powerUserList',
           name: 'powerUserList',
           component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
           component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
-          meta: { title: '用户管理', icon: 'user', permission: 'M_auth_userList' }
+          meta: { title: '用户管理', icon: 'user'
+            // permission: 'M_auth_userList' ,
+          }
         },
         },
         {
         {
           path: '/auth/roleList',
           path: '/auth/roleList',
           name: 'powerRoleList',
           name: 'powerRoleList',
           component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
           component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
-          meta: { title: '角色管理', icon: 'solution', permission: 'M_auth_roleList' }
+          meta: { title: '角色管理', icon: 'solution'
+            // permission: 'M_auth_roleList',
+          }
         }
         }
       ]
       ]
     },
     },
@@ -213,8 +219,8 @@ export const asyncRouterMap = [
       component: PageView,
       component: PageView,
       meta: {
       meta: {
         title: '系统设置',
         title: '系统设置',
-        icon: 'setting',
-        permission: 'M_setting_0'
+        icon: 'setting'
+        // permission: 'M_setting_0'
       },
       },
       children: [{
       children: [{
         path: '/setting/dataDictionary',
         path: '/setting/dataDictionary',
@@ -222,8 +228,8 @@ export const asyncRouterMap = [
         component: () => import(/* webpackChunkName: "setting" */ '@/views/power/dataDictionary/dataDictionary.vue'),
         component: () => import(/* webpackChunkName: "setting" */ '@/views/power/dataDictionary/dataDictionary.vue'),
         meta: {
         meta: {
           title: '数据字典管理',
           title: '数据字典管理',
-          icon: 'database',
-          permission: 'M_sys_dataDictionary'
+          icon: 'database'
+          // permission: 'M_sys_dataDictionary'
         }
         }
       },
       },
       {
       {
@@ -232,8 +238,8 @@ export const asyncRouterMap = [
         component: () => import(/* webpackChunkName: "setting" */ '@/views/power/register/register.vue'),
         component: () => import(/* webpackChunkName: "setting" */ '@/views/power/register/register.vue'),
         meta: {
         meta: {
           title: '参数管理',
           title: '参数管理',
-          icon: 'key',
-          permission: 'M_sys_register'
+          icon: 'key'
+          // permission: 'M_sys_register'
         }
         }
       },
       },
       {
       {
@@ -242,8 +248,8 @@ export const asyncRouterMap = [
         component: () => import(/* webpackChunkName: "setting" */ '@/views/power/job/jobs.vue'),
         component: () => import(/* webpackChunkName: "setting" */ '@/views/power/job/jobs.vue'),
         meta: {
         meta: {
           title: '定时器',
           title: '定时器',
-          icon: 'alert',
-          permission: 'M_sys_job'
+          icon: 'alert'
+          // permission: 'M_sys_job'
         }
         }
       }
       }
       ]
       ]

+ 1 - 1
src/permission.js

@@ -18,7 +18,7 @@ router.beforeEach((to, from, next) => {
   to.meta && (typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`))
   to.meta && (typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`))
   let token = store.state.user.token || sessionStorage.getItem(ACCESS_TOKEN)
   let token = store.state.user.token || sessionStorage.getItem(ACCESS_TOKEN)
   token = token != 'undefined' ? token : ''
   token = token != 'undefined' ? token : ''
-  console.log(token)
+  // console.log(token)
   // 已登录
   // 已登录
   if (token) {
   if (token) {
     /* has token */
     /* has token */

+ 1 - 1
src/utils/request.js

@@ -52,7 +52,7 @@ service.interceptors.request.use(config => {
 
 
 // response interceptor
 // response interceptor
 service.interceptors.response.use((response) => {
 service.interceptors.response.use((response) => {
-  console.log(response, 'responseresponseresponse')
+  // console.log(response, 'responseresponseresponse')
   if (response.data.status == '-1') {
   if (response.data.status == '-1') {
     notification.error({
     notification.error({
       message: '提示',
       message: '提示',

+ 282 - 96
src/views/CarWashManagement/AddCarWashModal.vue

@@ -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>

+ 142 - 44
src/views/CarWashManagement/CarWashManagement.vue

@@ -6,27 +6,31 @@
         <a-row :gutter="48">
         <a-row :gutter="48">
           <a-col :span="6">
           <a-col :span="6">
             <a-form-item class="search-item" label="网点名称">
             <a-form-item class="search-item" label="网点名称">
-              <a-input v-model.trim="queryParam.name" placeholder="请输入网点名称" allowClear/>
+              <a-input v-model.trim="queryParam.name" placeholder="请输入网点名称" @pressEnter="$refs.table.refresh(true)" allowClear/>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="6">
           <a-col :span="6">
             <a-form-item class="search-item" label="营业状态">
             <a-form-item class="search-item" label="营业状态">
-              <v-select ref="yyzt" allowClear placeholder="请选择营业状态" v-model="queryParam.yyzt" code="CHECK_ENABLE_STATE"></v-select>
+              <v-select ref="businessStatus" allowClear placeholder="请选择营业状态" v-model="queryParam.businessStatus" code="STORE_BUSINESS_STATUS"></v-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="6">
           <a-col :span="6">
             <a-form-item class="search-item" label="设备状态">
             <a-form-item class="search-item" label="设备状态">
-              <v-select ref="sbzt" allowClear placeholder="请选择设备状态" v-model="queryParam.sbzt" code="CHECK_ENABLE_STATE"></v-select>
+              <v-select ref="deviceStatus" allowClear placeholder="请选择设备状态" v-model="queryParam.deviceDTO.deviceStatus" code="DEVICE_STATUS"></v-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="6">
           <a-col :span="6">
             <a-form-item class="search-item" label="省">
             <a-form-item class="search-item" label="省">
-              <v-select ref="province" allowClear placeholder="请选择省" v-model="queryParam.province" code="CHECK_ENABLE_STATE"></v-select>
+              <a-select v-model="queryParam.addrProvince" placeholder="请选择省" @change="getCityList" allowClear>
+                <a-select-option v-for="item in addrProvinceList" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
+              </a-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="6">
           <a-col :span="6">
             <a-form-item class="search-item" label="市">
             <a-form-item class="search-item" label="市">
-              <v-select ref="city" allowClear placeholder="请选择市" v-model="queryParam.city" code="CHECK_ENABLE_STATE"></v-select>
+              <a-select v-model="queryParam.addrCity" placeholder="请选择市" @change="getAreaList" allowClear>
+                <a-select-option v-for="item in addrCityList" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
+              </a-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="6">
           <a-col :span="6">
@@ -42,6 +46,12 @@
     </div>
     </div>
     <!-- 表格列表 -->
     <!-- 表格列表 -->
     <s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" bordered >
     <s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" bordered >
+      <!-- 营业时间 -->
+      <template slot="businessHours" slot-scope="text, record">{{ record.beginTime.substr(0,5) + '-' + record.endTime.substr(0,5) }}</template>
+      <!-- 设备状态 -->
+      <template slot="deviceStatus" slot-scope="text, record">{{ record.deviceVOList ? $refs.deviceStatus.getNameByCode(record.deviceVOList[0].deviceStatus) : '-' }}</template>
+      <!-- 营业状态 -->
+      <template slot="businessStatus" slot-scope="text, record">{{ record.businessStatus ? $refs.businessStatus.getNameByCode(record.businessStatus) : '-' }}</template>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
         <a-tooltip placement="left" trigger="click" overlayClassName="btn-cont">
         <a-tooltip placement="left" trigger="click" overlayClassName="btn-cont">
@@ -54,9 +64,10 @@
           </template>
           </template>
           <a-icon type="setting" title="设置" :style="{ fontSize: '20px', color: '#19be6b', padding: '0 10px' }" />
           <a-icon type="setting" title="设置" :style="{ fontSize: '20px', color: '#19be6b', padding: '0 10px' }" />
         </a-tooltip>
         </a-tooltip>
-        <a-icon type="edit" title="编辑" :style="{ fontSize: '20px', color: '#1890FF', padding: '0 10px' }" />
-        <a-icon type="eye" title="查看详情" @click="openDetailsModal=true" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" />
+        <a-icon type="edit" title="编辑" @click="modalHandle('edit', record)" :style="{ fontSize: '20px', color: '#1890FF', padding: '0 10px' }" />
+        <a-icon type="eye" title="查看详情" @click="modalHandle('details', record)" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" />
         <a-icon type="delete" title="删除" @click="del(record)" :style="{ fontSize: '20px', color: 'red', padding: '0 10px' }" />
         <a-icon type="delete" title="删除" @click="del(record)" :style="{ fontSize: '20px', color: 'red', padding: '0 10px' }" />
+        <a-icon type="qrcode" title="查看小程序码" @click="isQrCodeModal=true" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" />
       </template>
       </template>
     </s-table>
     </s-table>
     
     
@@ -64,6 +75,8 @@
     <add-car-wash-modal
     <add-car-wash-modal
       :openModal="openModal"
       :openModal="openModal"
       :mtitle="mtitle"
       :mtitle="mtitle"
+      :carWashInfo="carWashInfo"
+      @success="carWashSubmit"
       @close="openModal=false"
       @close="openModal=false"
     />
     />
     <!-- 查看详情 洗车机 -->
     <!-- 查看详情 洗车机 -->
@@ -71,6 +84,10 @@
       :openModal="openDetailsModal"
       :openModal="openDetailsModal"
       @close="openDetailsModal=false"
       @close="openDetailsModal=false"
     />
     />
+    <!-- 查看小程序码 -->
+    <a-modal class="qrCodeModal" title="查看小程序码" :width="500" :footer="null" :destroyOnClose="true" @cancel="isQrCodeModal=false" v-model="isQrCodeModal">
+      <img :src="qrCode" class="qrCode" />
+    </a-modal>
   </a-card>
   </a-card>
 </template>
 </template>
 
 
@@ -78,6 +95,8 @@
   import { STable, VSelect } from '@/components'
   import { STable, VSelect } from '@/components'
   import AddCarWashModal from './AddCarWashModal.vue'
   import AddCarWashModal from './AddCarWashModal.vue'
   import DetailsCarWashModal from './DetailsCarWashModal.vue'
   import DetailsCarWashModal from './DetailsCarWashModal.vue'
+  import { getProvince, getCityByPro } from '@/api/lookup'
+  import { storeQuery, storeFind, findItem } from '@/api/car-wash'
   export default{
   export default{
     name: 'CarWashManagement',
     name: 'CarWashManagement',
     components: { STable, VSelect, AddCarWashModal, DetailsCarWashModal },
     components: { STable, VSelect, AddCarWashModal, DetailsCarWashModal },
@@ -85,54 +104,75 @@
       return{
       return{
         queryParam: {
         queryParam: {
           name: '',  //  网点名称
           name: '',  //  网点名称
-          yyzt: '',  //  营业状态
-          sbzt: '',  //  设备状态
-          province: '',  //  省
-          city: ''  //  市
+          businessStatus: '',  //  营业状态
+          deviceDTO: { deviceStatus: '' },  //  设备状态
+          addrProvince: undefined,  //  省
+          addrCity: undefined  //  市
         },
         },
         columns: [
         columns: [
           { title: '创建时间', dataIndex: 'createDate', width: '100', align: 'center' },
           { title: '创建时间', dataIndex: 'createDate', width: '100', align: 'center' },
-          { title: '设备ID', dataIndex: 'equipment', width: '100', align: 'center' },
+          { title: '设备ID', dataIndex: 'deviceVO.deviceNo', width: '100', align: 'center' },
           { title: '网点名称', dataIndex: 'name', width: '100', align: 'center' },
           { title: '网点名称', dataIndex: 'name', width: '100', align: 'center' },
-          { title: '省', dataIndex: 'addrProvince', width: '100', align: 'center' },
-          { title: '市', dataIndex: 'addrCity', width: '100', align: 'center' },
+          { title: '省', dataIndex: 'addrProvinceName', width: '100', align: 'center' },
+          { title: '市', dataIndex: 'addrCityName', width: '100', align: 'center' },
           { title: '地址', dataIndex: 'addrDetail', width: '100', align: 'center' },
           { title: '地址', dataIndex: 'addrDetail', width: '100', align: 'center' },
-          { title: '营业时间', dataIndex: 'businessHours', width: '100', align: 'center' },
-          { title: '设备状态', dataIndex: 'equipmentStatus', width: '100', align: 'center' },
-          { title: '营业状态', dataIndex: 'businessStatus', width: '100', align: 'center' },
-          { title: '小程序码', dataIndex: 'wechatCode', width: '100', align: 'center' },
-          { title: '操作', scopedSlots: {customRender: 'action'}, width: '200', align: 'center' }
+          { title: '营业时间', scopedSlots: {customRender: 'businessHours'}, width: '100', align: 'center' },
+          { title: '设备状态', scopedSlots: {customRender: 'deviceStatus'}, width: '100', align: 'center' },
+          { title: '营业状态', scopedSlots: {customRender: 'businessStatus'}, width: '100', align: 'center' },
+          { title: '操作', scopedSlots: {customRender: 'action'}, width: '265', align: 'center' }
         ],
         ],
         // 加载数据方法 必须为 Promise 对象
         // 加载数据方法 必须为 Promise 对象
         loadData: parameter => {
         loadData: parameter => {
-          // return activeList(Object.assign(parameter, this.queryParam)).then(res => {
-          //   const no = (res.data.pageNo - 1) * res.data.pageSize
-          //   for (let i = 0; i < res.data.list.length; i++) {
-          //     const _item = res.data.list[i]
-          //     _item.no = no + i + 1
-          //     _item.releaseStatus = _item.releaseStatus + '' === 'FB'
-          //   }
-          //   return res.data
-          // })
-          // let data = [
-          //   { createDate: '2020-07-31 15:09', equipment: 'ID585787887', name: '网点A', addrProvince: '陕西省', addrCity: '西安市', addrDetail: '华帝金座', businessHours: '8:30 - 22:00', equipmentStatus: '在线', businessStatus: '正常营业', wechatCode: '' },
-          //   { createDate: '2020-07-31 15:09', equipment: 'ID585787887', name: '网点A', addrProvince: '陕西省', addrCity: '西安市', addrDetail: '华帝金座', businessHours: '8:30 - 22:00', equipmentStatus: '在线', businessStatus: '正常营业', wechatCode: '' },
-          //   { createDate: '2020-07-31 15:09', equipment: 'ID585787887', name: '网点A', addrProvince: '陕西省', addrCity: '西安市', addrDetail: '华帝金座', businessHours: '8:30 - 22:00', equipmentStatus: '在线', businessStatus: '正常营业', wechatCode: '' },
-          // ]
-          // return new Promise((resolve, reject) => {
-          //   resolve(data)
-          // }).catch(() => console.log('Oops errors!'))
+          return storeQuery(Object.assign(parameter, this.queryParam)).then(res => {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+            }
+            return res.data
+          })
         },
         },
         openModal: false,  //  新增/编辑 洗车机  弹框展示状态
         openModal: false,  //  新增/编辑 洗车机  弹框展示状态
         mtitle: '',  //  新增/编辑 洗车机  弹框标题
         mtitle: '',  //  新增/编辑 洗车机  弹框标题
         openDetailsModal: false,  //  查看详情 洗车机  弹框展示状态
         openDetailsModal: false,  //  查看详情 洗车机  弹框展示状态
+        addrProvinceList: [],  //  省列表数据
+        addrCityList: [],  //  市列表数据
+        isQrCodeModal: false,  //  查看小程序码   弹框展示状态
+        qrCode: '',  //  小程序码
+        carWashInfo: {},  //  网点详情
       }
       }
     },
     },
     methods: {
     methods: {
       //  新建
       //  新建
-      modalHandle(type){
-        this.mtitle = type == 'add' ? '新增' : '编辑'
-        this.openModal = true
+      modalHandle(type, item){
+        this.mtitle = type == 'add' ? '新增' : type == 'edit' ? '编辑' : ''
+        if(type == 'add'){
+          this.openModal = true
+        }else if(type == 'edit'){
+          this.getInfo(item.id)
+          this.openModal = true
+        }else if(type == 'details'){
+          this.getInfo(item.id)
+          this.openDetailsModal = true
+        }
+      },
+      getInfo(id){
+        // 网点详情
+        storeFind({ id: id }).then(res => {
+          if(res.status == 200){
+            // 查询门店的服务时段价格
+            findItem({ id: id }).then(result => {
+              if(result.status == 200){
+                this.carWashInfo = Object.assign(res.data, {storeItemPriceDTOList: result.data})
+              }
+            })
+          }
+        })
+      },
+      // 新增编辑  提交成功
+      carWashSubmit(){
+        this.$refs.table.refresh(true)
+        this.openModal = false
       },
       },
       // 删除
       // 删除
       del(item){
       del(item){
@@ -149,13 +189,66 @@
       reset(){
       reset(){
         this.queryParam = {
         this.queryParam = {
           name: '',  //  网点名称
           name: '',  //  网点名称
-          yyzt: '',  //  营业状态
-          sbzt: '',  //  设备状态
-          province: '',  //  省
-          city: ''  //  市
+          businessStatus: '',  //  营业状态
+          deviceDTO: { deviceStatus: '' },  //  设备状态
+          addrProvince: undefined,  //  省
+          addrCity: undefined  //  市
+        }
+        this.$refs.table.refresh(true)
+      },
+      // 获取省列表
+      getProvinceList() {
+        const _this = this
+        getProvince().then(res => {
+          if (res.status == 200) {
+            _this.addrProvinceList = res.data || []
+          } else {
+            _this.addrProvinceList = []
+          }
+        })
+      },
+      // 获取城市列表
+      getCityList (val) {
+        this.addrCityList = []
+        this.queryParam.addrCity = undefined
+        if (val == null || val == '') {
+          this.addrProvinceName = ''
+        } else {
+          for (let i = 0; i < this.addrProvinceList.length; i++) {
+            if (this.addrProvinceList[i].id == val) {
+              this.addrProvinceName = this.addrProvinceList[i].name
+              break
+            }
+          }
+          this.getCityListRequest(val)
+        }
+      },
+      getCityListRequest (val) {
+        getCityByPro({id: val}).then(res => {
+          if (res.status == 200) {
+            this.addrCityList = res.data || []
+          } else {
+            this.addrCityList = []
+          }
+        })
+      },
+      // 获取区县列表
+      getAreaList (val) {
+        if (val == null || val == '') {
+          this.addrCityName = ''
+        } else {
+          for (let i = 0; i < this.addrCityList.length; i++) {
+            if (this.addrCityList[i].id == val) {
+              this.addrCityName = this.addrCityList[i].name
+              break
+            }
+          }
         }
         }
-        this.$refs.table.refresh()
       }
       }
+    },
+    mounted(){
+      //  获取省下拉
+      this.getProvinceList()
     }
     }
   }
   }
 </script>
 </script>
@@ -167,6 +260,11 @@
         margin-right: 10px;
         margin-right: 10px;
       }
       }
     }
     }
+    .qrCode{
+      display: block;
+      width: 100%;
+      max-width: 100%;
+    }
   }
   }
   .btn-cont{
   .btn-cont{
     .ant-tooltip-inner{
     .ant-tooltip-inner{

+ 37 - 18
src/views/CarWashManagement/ChooseEquipment.vue

@@ -2,19 +2,20 @@
   <a-modal class="CarWashEquipmentModal" title="选择设备" :width="600" :footer="null" :destroyOnClose="true" @cancel="modalIsShow=false" v-model="modalIsShow">
   <a-modal class="CarWashEquipmentModal" title="选择设备" :width="600" :footer="null" :destroyOnClose="true" @cancel="modalIsShow=false" v-model="modalIsShow">
     <a-input-search placeholder="请输入设备序列号" enter-button="查询" @search="onSearch" class="input-search" />
     <a-input-search placeholder="请输入设备序列号" enter-button="查询" @search="onSearch" class="input-search" />
     <a-radio-group v-model="equipment" @change="onChange" class="radio-group">
     <a-radio-group v-model="equipment" @change="onChange" class="radio-group">
-      <a-radio :style="radioStyle" v-for="(item,index) in equipmentList" :key="index" :value="item.value" :disabled="item.bindStatus==1">
+      <a-radio :style="radioStyle" v-for="(item,index) in equipmentList" :key="index" :value="item.id" :disabled="item.binding==1">
         <div class="radio-group-item">
         <div class="radio-group-item">
-          <p class="item-label">{{item.name}}</p>
-          <p :class="['item-status', item.bindStatus == 1 ? 'ybind' : '']">{{item.bindStatus == 0 ? '绑定' : '已绑定'}}</p>
+          <p class="item-label">{{item.deviceNo}}</p>
+          <p :class="['item-status', item.binding == 1 ? 'ybind' : '']">{{item.binding == 0 ? '绑定' : '已绑定'}}</p>
         </div>
         </div>
       </a-radio>
       </a-radio>
     </a-radio-group>
     </a-radio-group>
     <!-- 分页 -->
     <!-- 分页 -->
-    <a-pagination class="pagination-s" show-size-changer :current="pageNo" :pageSize.sync="pageSize" :total="500" @showSizeChange="onShowSizeChange" @change="onShowPageChange" />
+    <a-pagination class="pagination-s" show-size-changer :current="pageNo" :pageSize.sync="pageSize" :total="total" @showSizeChange="onShowSizeChange" @change="onShowPageChange" />
   </a-modal>
   </a-modal>
 </template>
 </template>
 
 
 <script>
 <script>
+  import { deviceQuery } from '@/api/car-wash'
   export default{
   export default{
     name: 'ChooseEquipment',
     name: 'ChooseEquipment',
     props: {
     props: {
@@ -36,40 +37,56 @@
           padding: '10px 15px',
           padding: '10px 15px',
           marginTop: '15px'
           marginTop: '15px'
         },
         },
-        equipment: null,  //  选中的设备
-        equipmentName: '',  //  选中的设备  名称
-        equipmentList: [  //  设备数据列表
-          { name: 'Option A', bindStatus: 0, value: 1 },
-          { name: 'Option B', bindStatus: 0, value: 2 },
-          { name: 'Option C', bindStatus: 0, value: 3 },
-          { name: 'Option D', bindStatus: 1, value: 4 }
-        ],
+        equipment: null,  //  选中的设备 id
+        equipmentNo: '',  //  选中的设备   序列号
+        equipmentList: [],  //  设备数据列表
         pageNo: 1,  //  页码
         pageNo: 1,  //  页码
         pageSize: 10,  //  每页条数
         pageSize: 10,  //  每页条数
+        total: 0,  //  列表总条数
       }
       }
     },
     },
     methods: {
     methods: {
+      // 设备列表
+      getEquipmentList(pageNo){
+        pageNo ? this.pageNo = pageNo : null
+        deviceQuery({
+          pageNo: this.pageNo,
+          pageSize: this.pageSize,
+          deviceNo: this.searchVal,
+        }).then(res => {
+          if(res.status == 200){
+            this.equipmentList = res.data.list || []
+            this.total = res.data.count
+          }else{
+            this.equipmentList = []
+            this.total = 0
+          }
+        })
+      },
       //  查询
       //  查询
       onSearch(value) {
       onSearch(value) {
-        console.log(value)
+        this.searchVal = value
+        this.getEquipmentList(1)
       },
       },
       // 设备  change
       // 设备  change
       onChange(e) {
       onChange(e) {
         const _this = this
         const _this = this
         _this.equipment = e.target.value
         _this.equipment = e.target.value
-        let i = _this.equipmentList.findIndex(item => item.value == _this.equipment)
-        _this.equipmentName = _this.equipmentList[i].name
+        let i = _this.equipmentList.findIndex(item => item.id == _this.equipment)
+        _this.equipmentNo = _this.equipmentList[i].deviceNo
         setTimeout(()=>{
         setTimeout(()=>{
           _this.modalIsShow = false
           _this.modalIsShow = false
         },300)
         },300)
       },
       },
       //  页码  change
       //  页码  change
       onShowPageChange(page, pageSize){
       onShowPageChange(page, pageSize){
-        console.log(page, pageSize,'++++++')
+        this.pageNo = page
+        this.getEquipmentList()
       },
       },
       //  pageSize 变化的回调
       //  pageSize 变化的回调
       onShowSizeChange(current, size){
       onShowSizeChange(current, size){
-        console.log(current, size,'_______')
+        this.pageSize = size
+        this.getEquipmentList()
       }
       }
     },
     },
     watch: {
     watch: {
@@ -80,7 +97,9 @@
       //  重定义的弹框状态
       //  重定义的弹框状态
       modalIsShow (val){
       modalIsShow (val){
         if (!val){
         if (!val){
-          this.$emit('close', this.equipment, this.equipmentName)
+          this.$emit('close', this.equipment, this.equipmentNo)
+        }else{
+          this.getEquipmentList(1)
         }
         }
       }
       }
     }
     }

+ 20 - 5
src/views/CouponCenter/AddCouponModal.vue

@@ -161,7 +161,7 @@
                     已选 <strong>4</strong> 个
                     已选 <strong>4</strong> 个
                   </a-col>
                   </a-col>
                   <a-col :span="12">
                   <a-col :span="12">
-                    <a-button type="primary" size="small" class="small-btn">选择</a-button>
+                    <a-button type="primary" size="small" class="small-btn" @click="openOutletsModal=true">选择</a-button>
                   </a-col>
                   </a-col>
                 </a-row>
                 </a-row>
               </a-col>
               </a-col>
@@ -169,24 +169,30 @@
           </a-form-model-item>
           </a-form-model-item>
         </a-col>
         </a-col>
         <a-col :span="24">
         <a-col :span="24">
-          <a-form-model-item :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }" class="btn-cont">
+          <a-form-model-item :label-col="{ span: 0 }" :wrapper-col="{ span: 24 }" class="btn-cont">
             <a-button type="primary" @click="onSubmit('ruleForm')">保存</a-button>
             <a-button type="primary" @click="onSubmit('ruleForm')">保存</a-button>
             <a-button class="resetForm" @click="resetForm">取消</a-button>
             <a-button class="resetForm" @click="resetForm">取消</a-button>
           </a-form-model-item>
           </a-form-model-item>
         </a-col>
         </a-col>
-        
-        
       </a-row>
       </a-row>
     </a-form-model>
     </a-form-model>
+    
+    <!-- 选择网点 -->
+    <choose-outlets
+      :openOutletsModal="openOutletsModal"
+      @close="closeChooseOutlets"
+    />
+    
   </a-modal>
   </a-modal>
 </template>
 </template>
 
 
 <script>
 <script>
   import { VSelect } from '@/components'
   import { VSelect } from '@/components'
   import moment from 'moment'
   import moment from 'moment'
+  import ChooseOutlets from './ChooseOutlets.vue'
   export default{
   export default{
     name: 'AddCouponModal',
     name: 'AddCouponModal',
-    components: { VSelect },
+    components: { VSelect, ChooseOutlets },
     props: {
     props: {
       openModal: {  //  弹框是否展示
       openModal: {  //  弹框是否展示
         type: Boolean,
         type: Boolean,
@@ -237,6 +243,7 @@
           {dispName: '全部', code: '0'},
           {dispName: '全部', code: '0'},
           {dispName: '部分', code: '1'}
           {dispName: '部分', code: '1'}
         ],
         ],
+        openOutletsModal: false  ,//  选择网点  弹框展示状态
       }
       }
     },
     },
     methods: {
     methods: {
@@ -276,6 +283,14 @@
         this.$refs.ruleForm.resetFields()
         this.$refs.ruleForm.resetFields()
         this.isShow = false
         this.isShow = false
       },
       },
+      //  选择网点
+      closeChooseOutlets(val, name){
+        // if(val){
+        //   this.form.equipment = val
+        //   this.equipmentName = name
+        // }
+        this.openOutletsModal = false
+      },
     },
     },
     watch: {
     watch: {
       //  父页面传过来的弹框状态
       //  父页面传过来的弹框状态

+ 81 - 0
src/views/CouponCenter/ChooseOutlets.vue

@@ -0,0 +1,81 @@
+<template>
+  <a-modal class="CouponOutletsModal" title="选择网点" :width="600" :footer="null" :destroyOnClose="true" @cancel="modalIsShow=false" v-model="modalIsShow">
+    <a-input-search placeholder="请输入网点名称" enter-button="查询" @search="onSearch" class="input-search" />
+    <a-checkbox-group @change="onChange" class="checkbox-group">
+      <a-checkbox value="A" class="checkbox-item">A</a-checkbox>
+      <a-checkbox value="B" class="checkbox-item">B</a-checkbox>
+      <a-checkbox value="C" class="checkbox-item">C</a-checkbox>
+      <a-checkbox value="D" class="checkbox-item">D</a-checkbox>
+    </a-checkbox-group>
+  </a-modal>
+</template>
+
+<script>
+  export default{
+    name: 'ChooseOutlets',
+    props: {
+      openOutletsModal: {  //  弹框是否展示
+        type: Boolean,
+        default: false
+      },
+    },
+    data(){
+      return{
+        modalIsShow: this.openEquipmentModal,  //  弹框是否展示
+        checkedList: [],  //  选中的网点
+        outletsDataList: [  //  网点列表数据
+          { name: '网点1', value: '1' },
+          { name: '网点2', value: '2' },
+          { name: '网点3', value: '3' },
+          { name: '网点4', value: '4' },
+          { name: '网点5', value: '5' },
+          { name: '网点6', value: '6' },
+        ]
+      }
+    },
+    methods: {
+      //  查询
+      onSearch(value) {
+        console.log(value)
+      },
+      //  多选框 change
+      onChange(e){
+        console.log(e)
+        this.checkedList = e
+      },
+    },
+    watch: {
+      //  父页面传过来的弹框状态
+      openOutletsModal (newValue, oldValue) {
+        this.modalIsShow = newValue
+      },
+      //  重定义的弹框状态
+      modalIsShow (val){
+        if (!val){
+          this.$emit('close')
+        }
+      }
+    }
+  }
+</script>
+
+<style lang="less">
+  .CouponOutletsModal{
+    .input-search{
+      margin-bottom: 15px;
+    }
+    .checkbox-group{
+      display: block;
+      .checkbox-item{
+        display: block;
+        margin: 15px 0 0;
+        padding: 10px 15px;
+        border: 1px solid rgb(228, 228, 228);
+        border-radius: 6px;
+        .ant-checkbox{
+          display: none;
+        }
+      }
+    }
+  }
+</style>

+ 1 - 1
src/views/CouponCenter/CreateCoupons.vue

@@ -114,7 +114,7 @@
           name: '',  //  优惠券名称
           name: '',  //  优惠券名称
           type: '',  //  优惠券类型
           type: '',  //  优惠券类型
         }
         }
-        this.$refs.table.refresh()
+        this.$refs.table.refresh(true)
       }
       }
     }
     }
   }
   }