Browse Source

Merge branch 'new_web2.0' of http://39.108.172.131:3000/Shannon_mu/SmartCommunity into new_web2.0

Shannon_mu 2 years ago
parent
commit
36adec9e7d

+ 1 - 1
smart/src/views/rechargeRecord/index.js

@@ -12,7 +12,7 @@ export default {
                 // },
                 {
                     label: '车牌号',
-                    prop: 'platNo'
+                    prop: 'fullCarNoStr'
                 },
                 {
                     label: '车牌类型',

+ 2 - 2
smart/src/views/temporaryStopCharge/index.vue

@@ -161,8 +161,8 @@ export default {
     },
     // 导出
     exportExcel () {
-      // this.__exportExcel('/sc-community-web/parkingCar/getCarInfoExcel', this.mixins_query);
-      alert('暂无');
+      this.__exportExcel('/sc-community-web/parkingCar/getPayInfoExcel', this.mixins_query);
+      // alert('暂无');
     }
   },
   created () {

+ 4 - 4
smart/src/views/vehicleInformation/index.js

@@ -43,10 +43,10 @@ export default {
                     label: '车场名称',
                     prop: 'parkName'
                 },
-                //   {
-                //     label: '可停区域',
-                //     prop: '11'
-                // },
+                {
+                    label: '可停区域',
+                    prop: 'areaName'
+                },
                 // {
                 //     label: '占用车位数',
                 //     prop: 'parkingNumber'

+ 5 - 3
smart/src/views/vehicleInformation/index.vue

@@ -85,7 +85,7 @@
     </div>
     <zz-table
       :cols="cols"
-      :settings="{ showCheckbox: true, showIndex: true, stripe: true }"
+      :settings="{ showCheckbox: false, showIndex: true, stripe: true }"
       :data="mixins_list"
       :pageset="mixins_pageset"
       @page-change="pageChange"
@@ -167,8 +167,10 @@ export default {
           type: 'success',
           message: '删除成功!'
         });
-        this.$http.get('/sc-community-web/parkingCar/deleteVehicleInfor', { id: row.cardId, parkId: row.parkId }).then(({ data, msg, status }) => { }).catch(() => { });
-        this.mixins_search();
+        this.$http.get('/sc-community-web/parkingCar/deleteVehicleInfor', { id: row.cardId, parkId: row.parkId }).then(({ data, msg, status }) => {
+          this.mixins_search();
+        }).catch(() => { });
+
       }).catch(() => {
         this.$message({
           type: 'info',

+ 155 - 110
smart/src/views/vehicleInformation/setpPage/details.vue

@@ -64,6 +64,26 @@
             ></el-input>
           </el-form-item>
         </el-col>
+
+      </el-row>
+      <el-row>
+        <el-col :span="9">
+          <el-form-item label="车位设置">
+            <el-select
+              placeholder="请选择停车场"
+              clearable
+              v-model="formDate.parkId"
+            >
+              <el-option
+                v-for="(item,index) in nameParkingLot"
+                :key="index"
+                :value="item.label"
+                :label="item.name"
+                @click.native="parkingLot(item.name)"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
 
       <div class="formContent-item_title">内部车信息</div>
@@ -166,7 +186,7 @@
             :span="8"
             style="margin-top: -5px;"
           >
-            <el-select
+            <!-- <el-select
               placeholder="请选择停车场"
               clearable
               v-model="formDate.parkId"
@@ -179,7 +199,7 @@
                 :label="item.name"
                 @click.native="parkingLot(item.name)"
               ></el-option>
-            </el-select>
+            </el-select> -->
           </el-col>
         </el-row>
         <el-row>
@@ -398,6 +418,7 @@ export default {
   props: ['params'],
   data () {
     return {
+      areaNamed: [],
       formDate: {
         userName: '',
         // tel: '17688920088',
@@ -410,7 +431,8 @@ export default {
         beginTime: '',
         parkId: '',
         id: '',
-        sort: ''
+        sort: '',
+        areaName: ''
       },
       tableData: [
         {
@@ -602,7 +624,9 @@ export default {
 
 
     parked (item) {
-      this.tableData.areaName = item.label;
+      debugger
+      this.areaNamed.push(item.label);
+      // this.tableData.areaName = item.label;
       this.formDate.sort = item.startDate;
       // console.log(this.tableData.areaName)
     },
@@ -710,6 +734,7 @@ export default {
           title: '选择车位'
         });
       }).then((data) => {
+        debugger
         var id = data[0].id;
         this.tableData[id].positionInformation = data[0].positionInformation;
         this.tableData[id].parkingId = data[0].value;
@@ -793,136 +818,156 @@ export default {
       })
     },
     submit () {
-      var table = [];
-      for (let i = 0; i < this.tableData.length; i++) {
-        table.push({
-          areaId: [this.tableData[i].parkingArea],
-          areaName: this.tableData.areaName,
-          lotCount: this.num,
-          lotName: this.tableData[i].positionInformation,
-          // ruleId: this.formDate.ruleId,//暂无
-          parkingId: this.tableData[i].parkingId,
-          lotName: '',
-          carType: '',
-          ruleId: this.formDate.ruleId,
-          sequence: this.formDate.sort,
+      debugger
+      this.$refs.formDate.validate((valid) => {
+        console.log('valid', valid);
+        if (valid) {
+          var table = [];
+          debugger
+          this.tableData.areaName = (Array.from(new Set(this.areaNamed))).join(',');
+          debugger
+          for (let i = 0; i < this.tableData.length; i++) {
+            table.push({
+              areaId: [this.tableData[i].parkingArea],
+              areaName: this.tableData[i].areaName,
+              lotCount: this.num,
+              lotName: this.tableData[i].positionInformation,
+              // ruleId: this.formDate.ruleId,//暂无
+              parkingId: this.tableData[i].parkingId,
+              lotName: '',
+              carType: '',
+              ruleId: this.formDate.ruleId,
+              sequence: this.formDate.sort,
 
-        })
-      }
-      var parkingSpace = [];
-      for (let k = 0; k < this.parkingSpaceSetting.length; k++) {
-        parkingSpace.push({
-          carNo: this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license,
-          cardNo: this.parkingSpaceSetting[k].accessCredentials,
-          enable: this.parkingSpaceSetting[k].state,
-          remark: this.parkingSpaceSetting[k].remarks,
-
-          carType: this.formDate.carType,
-          carNoColor: this.form[k].vehicleColor,
-          carColor: this.form[k].vehicleColors,
-          carBrand: this.form[k].vehicleBrand,
 
-        });
-        this.fullCarNoStr = this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license;
-        this.plateNoInfo.push((this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license));
 
-        for (let j = 0; j < table.length; j++) {
-          table[j].lotName = this.parkingSpaceSetting[k].license;
-          table[j].carType = this.formDate.carType;
+            })
+            this.formDate.areaName = this.tableData[i].areaName
+          }
+          var parkingSpace = [];
+          for (let k = 0; k < this.parkingSpaceSetting.length; k++) {
+            parkingSpace.push({
+              carNo: this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license,
+              cardNo: this.parkingSpaceSetting[k].accessCredentials,
+              enable: this.parkingSpaceSetting[k].state,
+              remark: this.parkingSpaceSetting[k].remarks,
 
-        }
 
+              carType: this.formDate.carType,
+              carNoColor: this.form[k].vehicleColor,
+              carColor: this.form[k].vehicleColors,
+              carBrand: this.form[k].vehicleBrand,
 
-      }
-      this.$http.post('/sc-community-web/parkingCar/addVehicleInfor', {
-        cardName: this.formDate.userName,
-        userName: this.formDate.userName,
-        tel: this.formDate.tel,
-        houseId: this.formDate.residentId,
-        residentId: this.formDate.id,
-        remark: this.formDate.remark,
-        cardType: this.formDate.carTypes,
-        beginTime: this.formDate.beginTime,
-        parkId: this.formDate.parkId,
+            });
+            this.fullCarNoStr = this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license;
+            this.plateNoInfo.push((this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license));
 
+            for (let j = 0; j < table.length; j++) {
+              table[j].lotName = this.parkingSpaceSetting[k].license;
+              table[j].carType = this.formDate.carType;
 
-        carLotList: table,
-        parkCarDetails: parkingSpace,
+            }
 
 
-        fullCarNoStr: this.fullCarNoStr,
-        plateNoInfo: this.plateNoInfo,
+          }
+          this.$http.post('/sc-community-web/parkingCar/addVehicleInfor', {
+            cardName: this.formDate.userName,
+            userName: this.formDate.userName,
+            tel: this.formDate.tel,
+            houseId: this.formDate.residentId,
+            residentId: this.formDate.id,
+            remark: this.formDate.remark,
+            cardType: this.formDate.carTypes,
+            beginTime: this.formDate.beginTime,
+            parkId: this.formDate.parkId,
+            areaName: this.formDate.areaName,
 
 
-      }).then(({ data, status, msg }) => {
-        this.params.callback();
-      })
-      this.$emit('close');
-    },
-  },
-  created () {
-    this.nameParking();
+            carLotList: table,
+            parkCarDetails: parkingSpace,
 
 
-    this.params.cardId;
-    this.$http.get('/sc-community-web/parkingCar/getVehicleInfor', { id: this.params.cardId }).then(({ data, msg, status }) => {
-      console.log(data);
-      this.formDate.userName = data.userName
-      this.formDate.tel = data.tel
-      this.formDate.resDate = data.houseId
-      this.formDate.remark = data.remark
-      this.formDate.carTypes = data.cardType == 0 ? '临时车'
-        : data.cardType == 1 ? 'VIP车'
-          : data.cardType == 2 ? '月租车'
-            : data.cardType == 3 ? '充时车'
-              : data.cardType == 4 ? '时租车'
-                : data.cardType == 5 ? '产全车'
-                  : data.cardType == 6 ? '计次车'
-                    : data.cardType == 7 ? '贵宾卡'
-                      : '员工卡'
+            fullCarNoStr: this.fullCarNoStr,
+            plateNoInfo: this.plateNoInfo,
 
 
+          }).then(({ data, status, msg }) => {
+            this.params.callback();
+          })
+          this.$emit('close');
+        } else {
+          return false;
+        }
+      })
 
+    },
+  },
+  created () {
+    this.nameParking();
 
-      this.nameParkingLotName = '1';//随便
+    if (this.params.cardId != undefined) {
+      this.params.cardId;
+      this.$http.get('/sc-community-web/parkingCar/getVehicleInfor', { id: this.params.cardId }).then(({ data, msg, status }) => {
+        console.log(data);
+        this.formDate.userName = data.userName
+        this.formDate.tel = data.tel
+        this.formDate.resDate = data.houseId
+        this.formDate.remark = data.remark
+        this.formDate.carTypes = data.cardType == 0 ? '临时车'
+          : data.cardType == 1 ? 'VIP车'
+            : data.cardType == 2 ? '月租车'
+              : data.cardType == 3 ? '充时车'
+                : data.cardType == 4 ? '时租车'
+                  : data.cardType == 5 ? '产全车'
+                    : data.cardType == 6 ? '计次车'
+                      : data.cardType == 7 ? '贵宾卡'
+                        : '员工卡'
+
+
+
+
+        this.nameParkingLotName = '1';//随便
+
+        this.formDate.beginTime = data.beginTime
+        this.formDate.parkId = data.parkId
+        var carLotStr = JSON.parse(data.carLotStr)
+        for (let i = 0; i < carLotStr.length; i++) {
+          debugger
+          // this.tableData[i].parkingArea = carLotStr[i].areaId
+          this.tableData[i].areaName = carLotStr[i].areaName
+          this.tableData[i].carType = data.cardType
+          this.tableData[i].lotCount = carLotStr[i].lotCount
+          this.tableData[i].positionInformation = carLotStr[i].lotName
+          // this.formDate.ruleId = carLotStr.ruleId
+          this.formDate.sort = carLotStr.sequence
+        }
+        for (let k = 0; k < data.parkCarDetails.length; k++) {
+          this.parkingSpaceSetting[k].licensePlate = (data.fullCarNoStr).substr(0, 1)
+          this.parkingSpaceSetting[k].license = (data.fullCarNoStr).substr(1)
+          this.parkingSpaceSetting[k].state = data.parkCarDetails[k].enable == 0 ? '启用' : '禁用'
+          this.parkingSpaceSetting[k].remarks = data.parkCarDetails[k].remark
+
+          this.formDate.carType = data.cardType
+          this.form[k].vehicleColor = data.parkCarDetails[k].carNoColor
+          this.form[k].vehicleColors = data.parkCarDetails[k].carColor
+          this.form[k].vehicleBrand = data.parkCarDetails[k].carBrand
+        }
 
-      this.formDate.beginTime = data.beginTime
-      this.formDate.parkId = data.parkId
-      var carLotStr = JSON.parse(data.carLotStr)
-      for (let i = 0; i < carLotStr.length; i++) {
-        debugger
-        // this.tableData[i].parkingArea = carLotStr[i].areaId
-        this.tableData[i].areaName = carLotStr[i].areaName
-        this.tableData[i].carType = data.cardType
-        this.tableData[i].lotCount = carLotStr[i].lotCount
-        this.tableData[i].positionInformation = carLotStr[i].lotName
-        // this.formDate.ruleId = carLotStr.ruleId
-        this.formDate.sort = carLotStr.sequence
-      }
-      for (let k = 0; k < data.parkCarDetails.length; k++) {
-        this.parkingSpaceSetting[k].licensePlate = (data.fullCarNoStr).substr(0, 1)
-        this.parkingSpaceSetting[k].license = (data.fullCarNoStr).substr(1)
-        this.parkingSpaceSetting[k].state = data.parkCarDetails[k].enable == 0 ? '启用' : '禁用'
-        this.parkingSpaceSetting[k].remarks = data.parkCarDetails[k].remark
-
-        this.formDate.carType = data.cardType
-        this.form[k].vehicleColor = data.parkCarDetails[k].carNoColor
-        this.form[k].vehicleColors = data.parkCarDetails[k].carColor
-        this.form[k].vehicleBrand = data.parkCarDetails[k].carBrand
-      }
 
+        this.rechargeRules();
+        this.nameParking();
+        this.region();
 
-      this.rechargeRules();
-      this.nameParking();
-      this.region();
 
+        for (let i = 0; i < carLotStr.length; i++) {
+          debugger
+          this.tableData[i].parkingArea = Number(carLotStr[i].areaId)
+          this.formDate.ruleId = carLotStr[i].ruleId
+        }
 
-      for (let i = 0; i < carLotStr.length; i++) {
-        this.tableData[i].parkingArea = Number(carLotStr[i].areaId)
-        this.formDate.ruleId = carLotStr.ruleId
-      }
+      });
+    }
 
-    });
 
 
   }

+ 43 - 22
smart/src/views/vehicleInformation/setpPage/recharge.vue

@@ -16,8 +16,9 @@
               <el-option
                 v-for="(item,index) in recharge"
                 :key="index"
-                :value="item.value"
+                :value="item.label"
                 :label="item.name"
+                @click.native="rechargeDates(item)"
               >
               </el-option>
             </el-select>
@@ -47,7 +48,6 @@
                 disabled
                 :placeholder='valueselect'
               >
-
               </el-select>
             </el-col>
           </el-col>
@@ -174,10 +174,42 @@ export default {
       valueselectName: "",
       chargeNumber: '',
       timeValue1: '',
-      timeValue2: ''
+      timeValue2: '',
+      rechargeDate: [],
     }
   },
   methods: {
+    rechargeDates (item) {
+      debugger
+      // item.nameId
+      // this.rechargeDate[item.nameId]
+      // this.valueselected = '';
+      this.rechargeDays = '';
+      this.valueselect = '';
+      this.valueselectName = '';
+      this.idType = '';
+      this.chargeAmount = '';
+      this.chargeNumber = '';
+
+      this.RechargeDaysed = [];
+      this.complimentaryDays = [];
+
+      this.RechargeDaysed.push({
+        label: this.rechargeDate[item.nameId].rechargeAmount * (this.rechargeDate[item.nameId].rechargeType == 0 ? (1 * 1 / 100) : this.rechargeDate[item.nameId].rechargeType == 1 ? (1 * 1) : this.rechargeDate[item.nameId].rechargeType == 2 ? (1 * 1) : this.rechargeDate[item.nameId].rechargeType == 3 ? (1 * 1) : (1 * 1)) + (this.rechargeDate[item.nameId].rechargeType == 0 ? '元' : this.rechargeDate[item.nameId].rechargeType == 1 ? '月' : this.rechargeDate[item.nameId].rechargeType == 2 ? '天' : this.rechargeDate[item.nameId].rechargeType == 3 ? '小时' : '次'),
+        name: this.rechargeDate[item.nameId].rechargeAmount * (this.rechargeDate[item.nameId].rechargeType == 0 ? (1 * 1 / 100) : this.rechargeDate[item.nameId].rechargeType == 1 ? (1 * 1) : this.rechargeDate[item.nameId].rechargeType == 2 ? (1 * 1) : this.rechargeDate[item.nameId].rechargeType == 3 ? (1 * 1) : (1 * 1)),
+        id: item.nameId,
+      })
+
+
+      this.complimentaryDays.push({
+        idType: this.rechargeDate[item.nameId].rechargeType,
+        name: this.rechargeDate[item.nameId].sentAmount * (this.rechargeDate[item.nameId].sentType == 0 ? (1 * 1 / 100) : this.rechargeDate[item.nameId].sentType == 1 ? (1 * 1) : this.rechargeDate[item.nameId].sentType == 2 ? (1 * 1) : this.rechargeDate[item.nameId].sentType == 3 ? (1 * 1) : (1 * 1)),
+        label: this.rechargeDate[item.nameId].sentAmount * (this.rechargeDate[item.nameId].sentType == 0 ? (1 * 1 / 100) : this.rechargeDate[item.nameId].sentType == 1 ? (1 * 1) : this.rechargeDate[item.nameId].sentType == 2 ? (1 * 1) : this.rechargeDate[item.nameId].sentType == 3 ? (1 * 1) : (1 * 1)) + (this.rechargeDate[item.nameId].sentType == 0 ? '元' : this.rechargeDate[item.nameId].sentType == 1 ? '月' : this.rechargeDate[item.nameId].sentType == 2 ? '天' : this.rechargeDate[item.nameId].sentType == 3 ? '小时' : '次'),
+        chargeAmount: this.rechargeDate[item.nameId].basicMoney
+      })
+      debugger
+
+    },
     datePicker () {
 
       // valueselect赠送
@@ -215,38 +247,27 @@ export default {
         .get('/sc-community-web/parkingCar/queryRechargeRules', { carType: this.cardType, parkingId: this.parkId })
         .then(({ data, msg, status }) => {
           console.log('data', data);
-
+          this.rechargeDate = data;
           for (let i = 0; i < data.length; i++) {
             this.recharge.push({
               name: data[i].ruleName,
-              label: data[i].ruleId
-            })
-            this.RechargeDaysed.push({
-              label: data[i].rechargeAmount * (data[i].rechargeType == 0 ? (1 * 1 / 100) : data[i].rechargeType == 1 ? (1 * 1) : data[i].rechargeType == 2 ? (1 * 1) : data[i].rechargeType == 3 ? (1 * 1) : (1 * 1)) + (data[i].rechargeType == 0 ? '元' : data[i].rechargeType == 1 ? '月' : data[i].rechargeType == 2 ? '天' : data[i].rechargeType == 3 ? '小时' : '次'),
-              name: data[i].rechargeAmount * (data[i].rechargeType == 0 ? (1 * 1 / 100) : data[i].rechargeType == 1 ? (1 * 1) : data[i].rechargeType == 2 ? (1 * 1) : data[i].rechargeType == 3 ? (1 * 1) : (1 * 1)),
-              id: i,
-            })
-            console.log(this.RechargeDaysed);
-
-            this.complimentaryDays.push({
-              idType: data[i].rechargeType,
-              name: data[i].sentAmount * (data[i].sentType == 0 ? (1 * 1 / 100) : data[i].sentType == 1 ? (1 * 1) : data[i].sentType == 2 ? (1 * 1) : data[i].sentType == 3 ? (1 * 1) : (1 * 1)),
-              label: data[i].sentAmount * (data[i].sentType == 0 ? (1 * 1 / 100) : data[i].sentType == 1 ? (1 * 1) : data[i].sentType == 2 ? (1 * 1) : data[i].sentType == 3 ? (1 * 1) : (1 * 1)) + (data[i].sentType == 0 ? '元' : data[i].sentType == 1 ? '月' : data[i].sentType == 2 ? '月' : data[i].sentType == 3 ? '小时' : '次'),
-              chargeAmount: data[i].basicMoney
+              label: data[i].ruleId,
+              nameId: i
             })
 
           }
 
+
         })
         .catch(() => { });
     },
     recharges (item) {
       debugger
       this.id = item.id;
-      this.valueselect = this.complimentaryDays[this.id].label;
-      this.valueselectName = this.complimentaryDays[this.id].name;
-      this.idType = this.complimentaryDays[this.id].idType;
-      this.chargeAmount = this.complimentaryDays[this.id].chargeAmount;
+      this.valueselect = this.complimentaryDays[0].label;
+      this.valueselectName = this.complimentaryDays[0].name;
+      this.idType = this.complimentaryDays[0].idType;
+      this.chargeAmount = this.complimentaryDays[0].chargeAmount;
       this.chargeNumber = item.name;
     },
     submit () {