chenrui 4 년 전
부모
커밋
4dc2768b12

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

@@ -58,3 +58,19 @@ export const itemQuery = (params) => {
     method: 'post'
   })
 }
+// 删除网点
+export const storeDel = params => {
+  const url = `store/del/${params.id}`
+  return axios.request({
+    url: url,
+    method: 'get'
+  })
+}
+// 获取当前设备图片
+export const deviceImage = params => {
+  const url = `device/image/${params.id}`
+  return axios.request({
+    url: url,
+    method: 'get'
+  })
+}

+ 2 - 1
src/api/login.js

@@ -57,7 +57,8 @@ export function get2step (parameter) {
 // 修改密码
 export function changePwd (parameter) {
   return axios({
-    url: '/user/changePWD',
+    // url: '/user/changePWD',
+    url: 'employee/changePWD',
     method: 'post',
     data: parameter
   })

+ 108 - 58
src/views/CarWashManagement/AddCarWashModal.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-modal class="CarWashModal" :title="mtitle" :width="1000" :footer="null" :destroyOnClose="true" @cancel="isShow=false" v-model="isShow">
+  <a-modal class="CarWashModal" :title="pageType == 'add' ? '新增' : pageType == 'edit' ? '编辑' : ''" :width="1000" :footer="null" :destroyOnClose="true" @cancel="isShow=false" v-model="isShow">
     <!-- 表单 -->
     <a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
       <a-row :gutter="20">
@@ -61,7 +61,7 @@
           <a-form-model-item label="经度" prop="lng" class="default-form-item">
             <a-row :gutter="20">
               <a-col :span="17">
-                <a-input v-model="form.lng" placeholder="请输入经度坐标" />
+                <a-input-number v-model="form.lng" :min="0" :max="999" placeholder="请输入经度坐标" class="input-number-all" />
               </a-col>
               <a-col :span="6">
                 <a href="https://lbs.qq.com/tool/getpoint/" target="_blank">
@@ -73,7 +73,7 @@
         </a-col>
         <a-col :span="12">
           <a-form-model-item label="纬度" prop="lat">
-            <a-input v-model="form.lat" placeholder="请输入纬度坐标" />
+            <a-input-number v-model="form.lat" :min="0" :max="999" placeholder="请输入纬度坐标" class="input-number-all" />
           </a-form-model-item>
         </a-col>
         <a-col :span="12">
@@ -129,7 +129,6 @@
                 <a-row :gutter="20">
                   <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>
@@ -156,8 +155,8 @@
         </a-col>
         <a-col :span="24">
           <a-form-model-item :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }" class="btn-cont">
-            <a-button type="primary" @click="onSubmit('ruleForm')">保存</a-button>
-            <a-button class="resetForm" @click="resetForm">取消</a-button>
+            <a-button type="primary" @click="onSubmit">保存</a-button>
+            <a-button class="cancel" @click="cancel">取消</a-button>
           </a-form-model-item>
         </a-col>
       </a-row>
@@ -178,7 +177,7 @@
   import Editor from '@/components/WEeditor'
   import moment from 'moment'
   import { getProvince, getCityByPro, getDistrictByCity } from '@/api/lookup'
-  import { itemQuery, storeSave } from '@/api/car-wash'
+  import { itemQuery, storeSave, storeFind, findItem } from '@/api/car-wash'
   export default{
     name: 'AddCarWashModal',
     components: { VSelect, Editor, ChooseEquipment },
@@ -187,13 +186,13 @@
         type: Boolean,
         default: false
       },
-      mtitle: {  //  弹框标题
+      pageType: {  //  页面类型
         type: String,
         default: ''
       },
-      carWashInfo: {  //  网点详情
-        type: Object,
-        default: ()=>{}
+      carWashId: {  //  网点id
+        type: String,
+        default: ''
       }
     },
     data(){
@@ -274,38 +273,30 @@
       moment,
       // 文本编辑器  change
       editorChange (html, text) {
-        console.log(html, text,'===')
         this.form.guidance = html
-        // 点击查看详情时给文本编辑器赋值
+      },
+      // 网点详情
+      getCarWashInfo(id){
+        storeFind({ id: id }).then(res => {
+          if(res.status == 200){
+            // 查询门店的服务时段价格
+            findItem({ id: id }).then(result => {
+              if(result.status == 200){
+                let carWashInfo = Object.assign(res.data, {storeItemPriceDTOList: result.data})
+                this.setVal(carWashInfo)
+              }
+            })
+          }
+        })
       },
       //  表单赋值
       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'
-        ]
+        let arr = [ 'id', 'name', 'addrProvince', 'addrProvinceName', 'addrCityName', 'addrDistrictName', 'featuredServiceLabel', 'lng', 'lat', 'serviceType', '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)  //  获取区县下拉数据
@@ -314,15 +305,36 @@
         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)  //  文本编辑器赋值
+        this.form.beginTime = moment(item.beginTime, 'HH:mm')  //  营业时间  开始时间
+        this.form.endTime = moment(item.endTime, 'HH:mm')  //  营业时间  结束时间
+        this.setPeriodPrice(item.storeItemPriceDTOList)  // 时段价格
+        this.isShow ? this.$refs.editor.setHtml(item.guidance) : null  //  文本编辑器赋值
+      },
+      // 时段价格  赋值处理
+      setPeriodPrice(storeItemPriceDTOList){
+        let arrInd = 0
+        this.form.storeItemPriceDTOList = []
+        for (var key in storeItemPriceDTOList) {
+          if (storeItemPriceDTOList.hasOwnProperty(key)) {
+            this.form.storeItemPriceDTOList.push({
+              beginTime: moment(key.split(',')[0], 'HH:mm'),
+              endTime: moment(key.split(',')[1], 'HH:mm'),
+              currentPrices: []
+            })
+            let idArr = []
+            storeItemPriceDTOList[key].map((k, ind) => {
+              this.form.storeItemPriceDTOList[arrInd].currentPrices.push({ name: k.itemName, price: k.currentPrice, itemId: k.itemId })
+              idArr.push(k.itemId)
+            })
+            this.form.serviceType = idArr  //  服务类型
+            arrInd++
+          }
+        }
       },
       //  保存
-      onSubmit(formName){
+      onSubmit(){
         const _this = this
-        _this.$refs[formName].validate(valid => {
+        _this.$refs.ruleForm.validate(valid => {
           if (valid) {
             let formData = JSON.parse(JSON.stringify(_this.form))
             //  校验营业时间结束时间是否与时段价格一致
@@ -331,17 +343,21 @@
               _this.$message.error('时段价格与营业时间不一致,请修改后再保存!')
               return
             }
-            formData.beginTime = _this.timeFormat(formData.beginTime) + ':00'
-            formData.endTime = _this.timeFormat(formData.endTime) + ':00'
+            formData.beginTime = _this.timeFormat(formData.beginTime)
+            formData.endTime = _this.timeFormat(formData.endTime)
+            let arr = []
             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))
+                arr.push({
+                  beginTime: _this.timeFormat(item.beginTime),
+                  endTime: _this.timeFormat(item.endTime),
+                  itemId: k.itemId,
+                  name: k.name,
+                  currentPrice: k.price
+                })
               })
-              item.currentPrices = arr
             })
+            formData.storeItemPriceDTOList = arr
             //  提交前时间格式还需转换
             delete formData.serviceType
             storeSave(formData).then(res => {
@@ -370,12 +386,42 @@
         return v < 10 ? '0' + v : v
       },
       // 取消
-      resetForm(){
-        this.$refs.ruleForm.resetFields()
+      cancel(){
+        this.resetForm()
         this.isShow = false
       },
+      // 重置表单数据
+      resetForm(){
+        this.serviceType = []  //  服务类型  change前的值
+        this.beginTime = null  //  营业时间开始时间  change前的值
+        this.endTime = null  //  营业时间结束时间  change前的值
+        this.subendTime = []  //  时段价格  时段区间结束时间  change前的值
+        this.featuredServiceLabel = []  //  网点标签
+        this.deviceNo = ''  //  已选设备序列号
+        // this.$refs.ruleForm.resetFields()    无效
+        this.form.id = null
+        this.form.name = ''  //  网点名称
+        this.form.addrProvince = undefined  //  省  编码
+        this.form.addrProvinceName = ''  //  省
+        this.form.addrCity = undefined  //  市  编码
+        this.form.addrCityName = ''  //  市
+        this.form.addrDistrict = undefined  //  区  编码
+        this.form.addrDistrictName = ''  //  区
+        this.form.addrDetail = ''  //  详细地址
+        this.form.deviceDTOList = []  //  设备序列号
+        this.form.featuredServiceLabel = ''  //  网点标签
+        this.form.lng = ''  //  经度
+        this.form.lat = ''  //  纬度
+        this.form.serviceType = []  //  服务类型
+        this.form.beginTime = null  //  营业时间开始时间
+        this.form.endTime = null  //  营业时间结束时间
+        this.form.storeItemPriceDTOList = []  //  时段价格
+        this.form.guidance = ''  //  路线指引
+        this.form.reminder = ''  //  温馨提示
+      },
       // 是否重置时段价格 (更改服务类型、营业开始结束时间)
       isResetstoreItemPriceDTOList(type, val){
+        console.log(type, val)
         // type: serviceType  服务类型  beginTime  营业时间  开始时间  endTime  营业时间  结束时间
         const _this = this
         setTimeout(()=>{
@@ -452,11 +498,10 @@
         }
         arr.beginTime = moment(timeStr, 'HH:mm')
         arr.endTime = null
-        arr.itemIds = this.form.serviceType
         arr.currentPrices = []
         this.form.serviceType.map((item, index) => {
           let i = this.itemQueryList.findIndex(k => k.id == item)
-          arr.currentPrices.push({ name: this.itemQueryList[i].itemName, price: '' })
+          arr.currentPrices.push({ name: this.itemQueryList[i].itemName, price: '', itemId: item })
         })
         this.form.storeItemPriceDTOList.push(arr)
       },
@@ -581,16 +626,16 @@
         if (!val){
           this.$emit('close')
         }else{
+          this.resetForm()  //  重置表单数据
           this.getProvinceList()  //  获取省下拉
           this.getItemQuery()  //  服务类型  列表
         }
       },
-      // 网点详情  数据
-      carWashInfo: {
-        handler: function (item) {
-          this.setVal(item)
-        },
-        deep: true
+      carWashId (newValue, oldValue){
+        console.log(newValue,'-----新增编辑')
+        if(newValue){
+          this.getCarWashInfo(newValue)
+        }
       }
     }
   }
@@ -630,7 +675,7 @@
     }
     .btn-cont{
       text-align: center;
-      .resetForm{
+      .cancel{
         margin-left: 10px;
       }
     }
@@ -638,6 +683,9 @@
       width: 40%;
       color: #19be6b;
     }
+    .input-number-all{
+      width: 100%;
+    }
     .input-number-s{
       width: 90%;
     }
@@ -645,6 +693,8 @@
       display: inline-block;
       width: 10%;
       text-align: right;
+      padding-left: 5px;
+      box-sizing: border-box;
     }
   }
 </style>

+ 28 - 26
src/views/CarWashManagement/CarWashManagement.vue

@@ -74,14 +74,15 @@
     <!-- 新增/编辑 洗车机 -->
     <add-car-wash-modal
       :openModal="openModal"
-      :mtitle="mtitle"
-      :carWashInfo="carWashInfo"
+      :pageType="pageType"
+      :carWashId="carWashId"
       @success="carWashSubmit"
       @close="openModal=false"
     />
     <!-- 查看详情 洗车机 -->
     <details-car-wash-modal
       :openModal="openDetailsModal"
+      :carWashId="carWashId"
       @close="openDetailsModal=false"
     />
     <!-- 查看小程序码 -->
@@ -96,7 +97,7 @@
   import AddCarWashModal from './AddCarWashModal.vue'
   import DetailsCarWashModal from './DetailsCarWashModal.vue'
   import { getProvince, getCityByPro } from '@/api/lookup'
-  import { storeQuery, storeFind, findItem } from '@/api/car-wash'
+  import { storeQuery, storeFind, findItem, storeDel } from '@/api/car-wash'
   export default{
     name: 'CarWashManagement',
     components: { STable, VSelect, AddCarWashModal, DetailsCarWashModal },
@@ -111,7 +112,7 @@
         },
         columns: [
           { title: '创建时间', dataIndex: 'createDate', width: '100', align: 'center' },
-          { title: '设备ID', dataIndex: 'deviceVO.deviceNo', width: '100', align: 'center' },
+          { title: '设备ID', dataIndex: 'deviceVOList[0].deviceNo', width: '100', align: 'center' },
           { title: '网点名称', dataIndex: 'name', width: '100', align: 'center' },
           { title: '省', dataIndex: 'addrProvinceName', width: '100', align: 'center' },
           { title: '市', dataIndex: 'addrCityName', width: '100', align: 'center' },
@@ -133,42 +134,35 @@
           })
         },
         openModal: false,  //  新增/编辑 洗车机  弹框展示状态
-        mtitle: '',  //  新增/编辑 洗车机  弹框标题
+        pageType: '',  //  新增/编辑 洗车机  页面类型
         openDetailsModal: false,  //  查看详情 洗车机  弹框展示状态
         addrProvinceList: [],  //  省列表数据
         addrCityList: [],  //  市列表数据
         isQrCodeModal: false,  //  查看小程序码   弹框展示状态
         qrCode: '',  //  小程序码
-        carWashInfo: {},  //  网点详情
+        carWashId: '',  //  网点id
       }
     },
     methods: {
-      //  新建
+      //  新建/编辑/查看
       modalHandle(type, item){
-        this.mtitle = type == 'add' ? '新增' : type == 'edit' ? '编辑' : ''
+        this.pageType = type
+        // this.carWashId = (type == 'edit' || type == 'details') ? String(item.id) : type == 'add' ? '' : ''
+        // type == 'add' || type == 'edit' ? this.openModal = true : this.openDetailsModal = true
         if(type == 'add'){
+          this.carWashId = ''
           this.openModal = true
+          this.openDetailsModal = false
         }else if(type == 'edit'){
-          this.getInfo(item.id)
+          this.carWashId = String(item.id)
           this.openModal = true
+          this.openDetailsModal = false
         }else if(type == 'details'){
-          this.getInfo(item.id)
+          this.carWashId = String(item.id)
           this.openDetailsModal = true
+          this.openModal = false
         }
       },
-      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)
@@ -176,12 +170,20 @@
       },
       // 删除
       del(item){
-        console.log(item)
-        this.$confirm({
+        const _this = this
+        _this.$confirm({
           title: '提示',
           content: '确定要删除吗?',
           onOk () {
-            
+            storeDel({ id: item.id }).then(res => {
+              console.log(res)
+              if(res.status == 200){
+                _this.$message.success(res.message)
+                _this.$refs.table.refresh(true)
+              }else{
+                _this.$message.error(res.message)
+              }
+            })
           }
         })
       },

+ 175 - 76
src/views/CarWashManagement/DetailsCarWashModal.vue

@@ -1,97 +1,168 @@
 <template>
-  <a-modal class="DetailsCarWashModal" title="查看详情" :width="1000" :footer="null" :destroyOnClose="true" @cancel="isShow=false" v-model="isShow">
-    <a-row :gutter="20">
-      <a-col :span="12" class="item-cont">
-        <p class="item-label">网点名称:</p>
-        <p class="item-main">车领主网络科技有限公司-北二环贞观路口店车领主网络科技有限公司-北二环贞观路口店车领主网络科技有限公司-北二环贞观路口店车领主网络科技有限公司-北二环贞观路口店车领主网络科技有限公司-北二环贞观路口店</p>
-      </a-col>
-      <a-col :span="12" class="item-cont">
-        <p class="item-label">地址:</p>
-        <p class="item-main">陕西省 - 西安市 - 未央区</p>
-      </a-col>
-      <a-col :span="24" class="item-cont">
-        <p class="item-label">详细地址:</p>
-        <p class="item-main">北二环贞观路口华帝金座</p>
-      </a-col>
-      <a-col :span="12" class="item-cont">
-        <p class="item-label">设备ID:</p>
-        <p class="item-main">ID58787878787878787</p>
-      </a-col>
-      <a-col :span="12" class="item-cont">
-        <p class="item-label">网点标签:</p>
-        <p class="item-main">
-          <a-tag color="blue">网点A</a-tag>
-          <a-tag color="blue">网点B</a-tag>
-        </p>
-      </a-col>
-      <a-col :span="12" class="item-cont">
-        <p class="item-label">经度:</p>
-        <p class="item-main">105.45</p>
-      </a-col>
-      <a-col :span="12" class="item-cont">
-        <p class="item-label">纬度:</p>
-        <p class="item-main">187.05</p>
-      </a-col>
-      <a-col :span="12" class="item-cont">
-        <p class="item-label">服务类型:</p>
-        <p class="item-main">
-          <a-tag color="blue">极速洗车</a-tag>
-          <a-tag color="blue">精致洗车</a-tag>
-          <a-tag color="blue">机动洗车</a-tag>
-        </p>
-      </a-col>
-      <a-col :span="12" class="item-cont">
-        <p class="item-label">营业时间:</p>
-        <p class="item-main">08:30 - 22:00</p>
-      </a-col>
-      <a-col :span="24" class="item-cont">
-        <p class="item-label">时段价格:</p>
-        <div class="item-main">
-          <div class="item-period">
-            <p class="period-name">【时段1】</p>
-            <p class="period">08:30 - 11:30</p>
-            <p class="period-price">极速洗车:<strong class="price">15</strong><span class="price-unit">元</span></p>
-            <p class="period-price">精致洗车:<strong class="price">30</strong><span class="price-unit">元</span></p>
-            <p class="period-price">机动洗车:<strong class="price">20</strong><span class="price-unit">元</span></p>
+  <div class="DetailsCarWash">
+    <a-modal class="DetailsCarWashModal" title="查看详情" :width="1000" :footer="null" :destroyOnClose="true" @cancel="isShow=false" v-model="isShow">
+      <v-select v-show="false" ref="featuredServiceLabel" placeholder="请选择网点标签" code="STORE_LABEL"></v-select>
+      <a-row :gutter="20">
+        <a-col :span="12" class="item-cont">
+          <p class="item-label">网点名称:</p>
+          <p class="item-main">{{ carWashInfo.name }}</p>
+        </a-col>
+        <a-col :span="12" class="item-cont">
+          <p class="item-label">地址:</p>
+          <p class="item-main">{{ carWashInfo.addrProvinceName }} - {{ carWashInfo.addrCityName }} - {{ carWashInfo.addrDistrictName }}</p>
+        </a-col>
+        <a-col :span="24" class="item-cont">
+          <p class="item-label">详细地址:</p>
+          <p class="item-main">{{ carWashInfo.addrDetail }}</p>
+        </a-col>
+        <a-col :span="12" class="item-cont">
+          <p class="item-label">设备ID:</p>
+          <p class="item-main">{{ carWashInfo.deviceVOList ? carWashInfo.deviceVOList[0].deviceNo : '' }}</p>
+        </a-col>
+        <a-col :span="12" class="item-cont">
+          <p class="item-label">网点标签:</p>
+          <p class="item-main">
+            <a-tag color="blue" v-for="(item, index) in labelList" :ket="index">{{ item }}</a-tag>
+          </p>
+        </a-col>
+        <a-col :span="12" class="item-cont">
+          <p class="item-label">经度:</p>
+          <p class="item-main">{{ carWashInfo.lng }}</p>
+        </a-col>
+        <a-col :span="12" class="item-cont">
+          <p class="item-label">纬度:</p>
+          <p class="item-main">{{ carWashInfo.lat }}</p>
+        </a-col>
+        <a-col :span="12" class="item-cont">
+          <p class="item-label">服务类型:</p>
+          <p class="item-main">
+            <a-tag color="blue" v-for="(item, index) in serviceType" :key="index">{{ item }}</a-tag>
+          </p>
+        </a-col>
+        <a-col :span="12" class="item-cont">
+          <p class="item-label">营业时间:</p>
+          <p class="item-main">{{ carWashInfo.beginTime ? carWashInfo.beginTime.substr(0,5) : null }} - {{ carWashInfo.endTime ? carWashInfo.endTime.substr(0,5) : null }}</p>
+        </a-col>
+        <a-col :span="24" class="item-cont">
+          <p class="item-label">时段价格:</p>
+          <div class="item-main period-price-con">
+            <div class="item-period" v-for="(item, index) in storeItemPriceDTOList" :key="index">
+              <p class="period" :style="{width: 100/(item.currentPrices.length + 1) + '%'}">{{ item.beginTime }} - {{ item.endTime }}</p>
+              <p class="period-price" :style="{width: 100/(item.currentPrices.length + 1) + '%'}" v-for="(subItem, ind) in item.currentPrices" :key="ind">{{ subItem.name }}:<strong class="price">{{ subItem.price }}</strong><span class="price-unit">元</span></p>
+            </div>
           </div>
-          <div class="item-period">
-            <p class="period-name">【时段2】</p>
-            <p class="period">11:30 - 7:30</p>
-            <p class="period-price">极速洗车:<strong class="price">15</strong><span class="price-unit">元</span></p>
-            <p class="period-price">精致洗车:<strong class="price">30</strong><span class="price-unit">元</span></p>
-            <p class="period-price">机动洗车:<strong class="price">20</strong><span class="price-unit">元</span></p>
-          </div>
-        </div>
-      </a-col>
-      <a-col :span="24" class="item-cont">
-        <p class="item-label">路段指引:</p>
-        <p class="item-main">陕西省西安市未央区北二环贞观路口华帝金座</p>
-      </a-col>
-      <a-col :span="24" class="item-cont">
-        <p class="item-label">温馨提示:</p>
-        <p class="item-main">请注意避过高峰时期</p>
-      </a-col>
-      <a-col :span="24" class="btn-cont">
-        <a-button @click="isShow=false">取消</a-button>
-      </a-col>
-    </a-row>
-  </a-modal>
+        </a-col>
+        <a-col :span="24" class="item-cont">
+          <p class="item-label">路段指引:</p>
+          <p class="item-main" v-html="carWashInfo.guidance"></p>
+        </a-col>
+        <a-col :span="24" class="item-cont">
+          <p class="item-label">温馨提示:</p>
+          <p class="item-main">{{ carWashInfo.reminder }}</p>
+        </a-col>
+        <a-col :span="24" class="item-cont">
+          <p class="item-label">现场照片:</p>
+          <p class="item-main">
+            <img src="../../assets/avatar2.jpg" class="small-pic" @click="isPicModal=true" />
+          </p>
+        </a-col>
+        <a-col :span="24" class="btn-cont">
+          <a-button @click="isShow=false">取消</a-button>
+        </a-col>
+      </a-row>
+    </a-modal>
+    
+    <!-- 查看现场照片 -->
+    <a-modal class="picModal" title="查看现场照片" :width="800" :footer="null" :destroyOnClose="true" @cancel="isPicModal=false" v-model="isPicModal">
+      <img :src="pic" class="pic" />
+    </a-modal>
+  </div>
 </template>
 
 <script>
+  import { VSelect } from '@/components'
+  import moment from 'moment'
+  import { storeFind, findItem } from '@/api/car-wash'
   export default{
     name: 'DetailsCarWashModal',
+    components: { VSelect },
     props: {
       openModal: {  //  弹框是否展示
         type: Boolean,
         default: false
       },
+      carWashId: {  //  网点id
+        type: String,
+        default: ''
+      }
     },
     data(){
       return{
         isShow: this.openModal,  //  弹框是否展示
+        labelList: [],  //  网点标签
+        isPicModal: false,  //  现场照片  弹框是否展示
+        pic: require('../../assets/avatar2.jpg'),  //  现场照片  路径
+        carWashInfo: {}  ,//  网点信息
+        serviceType: [],  //  服务类型
+        storeItemPriceDTOList: [],  //  时段价格
       }
     },
+    methods: {
+      // 网点详情
+      getCarWashInfo(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})
+                console.log(this.carWashInfo)
+                this.setVal()
+              }
+            })
+          }
+        })
+      },
+      //  赋值
+      setVal(){
+        const _this = this
+        // 网点标签
+        setTimeout(()=>{
+          let featuredServiceLabel = this.carWashInfo.featuredServiceLabel.split(',')
+          let arr = []
+          featuredServiceLabel.map(k => {
+            arr.push(_this.$refs.featuredServiceLabel.getNameByCode(k))
+          })
+          _this.labelList = arr
+        },0)
+        // 时段价格
+        console.log(this.carWashInfo)
+        this.setPeriodPrice(this.carWashInfo.storeItemPriceDTOList)
+      },
+      // 时段价格  赋值处理
+      setPeriodPrice(storeItemPriceDTOList){
+        let arrInd = 0
+        this.storeItemPriceDTOList = []
+        for (var key in storeItemPriceDTOList) {
+          if (storeItemPriceDTOList.hasOwnProperty(key)) {
+            this.storeItemPriceDTOList.push({
+              beginTime: key.split(',')[0],
+              endTime: key.split(',')[1],
+              currentPrices: []
+            })
+            let idArr = []
+            storeItemPriceDTOList[key].map((k, ind) => {
+              this.storeItemPriceDTOList[arrInd].currentPrices.push({ name: k.itemName, price: k.currentPrice, itemId: k.itemId })
+              idArr.push(k.itemName)
+            })
+            this.serviceType = idArr  //  服务类型
+            arrInd++
+          }
+        }
+        console.log(this.storeItemPriceDTOList)
+        console.log(this.serviceType)
+      },
+    },
     watch: {
       //  父页面传过来的弹框状态
       openModal (newValue, oldValue) {
@@ -102,6 +173,11 @@
         if (!val){
           this.$emit('close')
         }
+      },
+      carWashId (newValue, oldValue){
+        if(newValue){
+          this.getCarWashInfo(newValue)
+        }
       }
     }
   }
@@ -126,15 +202,38 @@
       .item-main{
         flex-grow: 1;
       }
+      .period-price-con{
+        border-bottom: 1px solid #e8e8e8;
+      }
       .item-period{
         display: flex;
         align-items: center;
         justify-content: space-evenly;
         flex-grow: 1;
+        border: 1px solid #e8e8e8;
+        border-width: 1px 1px 0;
+        text-align: center;
+        .period, .period-price{
+          padding: 5px 0;
+          border-right: 1px solid #e8e8e8;
+        }
+        .period-price:last-child{
+          border-right: none;
+        }
       }
     }
     .btn-cont{
       text-align: center;
     }
+    .small-pic{
+      display: block;
+      cursor: zoom-in;
+      width: 300px;
+    }
+  }
+  .pic{
+    display: block;
+    max-width: 100%;
+    margin: 0 auto;
   }
 </style>

+ 0 - 2
src/views/user/ChangePwd.vue

@@ -114,13 +114,11 @@ export default {
       e.preventDefault()
       const _this = this
       this.form.validateFields((err, values) => {
-        console.log(values, 'values')
         if (!err) {
           changePwd({
             oldPassword: values.formCustom.oldPwd,
             password: values.formCustom.passwd
           }).then(res => {
-            console.log(res, 'res111111')
             if (res.status === '200') {
               _this.$message.success('修改成功, 请重新登录')
               _this.logout()