Hwt 2 年 前
コミット
9f5911d385

+ 1 - 0
smart/src/views/onSiteVehicles/index.vue

@@ -140,6 +140,7 @@ export default {
           title: '车辆通行记录详情'
         });
       }).then(() => {
+        debugger
         this.mixins_search();
       });
     },

+ 0 - 1
smart/src/views/onSiteVehicles/setpPage/details.vue

@@ -214,7 +214,6 @@ export default {
         // console.log(data);
         this.$message.success('成功');
       });
-
     },
     // OnSiteVehicleDetails () {
     // debugger

+ 3 - 3
smart/src/views/parkingSpaceManagement/pageJump/parkingLotSaveEdits.vue

@@ -262,7 +262,6 @@ export default {
     garageAreaListQuery () {
       this.garageAreaList = [];
       let onOption = '';
-      debugger
 
 
 
@@ -270,10 +269,11 @@ export default {
 
 
       console.log(this.ruleForm.garageId);
-      this.$http.post('/sc-community-web/parkingCar/findParkInfo', { parkid: this.ruleForm.garageId }).then((res) => {
+
+      this.$http.post('/sc-community-web/parkingCar/findAreaInfo', { parkid: this.ruleForm.garageId }).then((res) => {
         res.data.map((res) => {
           onOption = {
-            label: res.garageName,
+            label: res.areaName,
             id: res.id
           };
           this.garageAreaList.push(onOption);

+ 3 - 2
smart/src/views/rechargeRecord/setpPage/details.vue

@@ -62,8 +62,9 @@ export default {
         {
           name: '收费类型',
           label: '-'//0
-        }, {
-          name: '收费类型',
+        },
+        {
+          name: '车牌类型',
           label: '-'//1
         }, {
           name: '充值数额',

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

@@ -29,11 +29,11 @@
       >
         <el-option
           label="正常"
-          :value="1"
+          :value="2"
         ></el-option>
         <el-option
           label="已过期"
-          :value="2"
+          :value="1"
         ></el-option>
       </el-select>
       <el-button

+ 115 - 62
smart/src/views/vehicleInformation/setpPage/details.vue

@@ -183,61 +183,58 @@
           </el-form-item>
         </el-col> -->
       </el-row>
-    </el-form>
 
-    <div class="formContent-item_title">
-      <el-row>
-        <el-col :span="2">车位设置</el-col>
-        <el-col
-          :span="8"
-          style="margin-top: -5px;"
-        >
-        </el-col>
-      </el-row>
-      <el-row>
-        <el-col-2>
-          <el-button
-            type="primary"
-            @click="addTime"
-          >新增</el-button>
-        </el-col-2>
-      </el-row>
-      <el-form
-        ref="tableData"
-        :rules="ruled"
-        :model="tableData"
-      >
+      <div class="formContent-item_title">
+        <el-row>
+          <el-col :span="2">车位设置</el-col>
+          <el-col
+            :span="8"
+            style="margin-top: -5px;"
+          >
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col-2>
+            <el-button
+              type="primary"
+              @click="addTime"
+            >新增</el-button>
+          </el-col-2>
+        </el-row>
+
         <el-table
           :data="tableData"
           border
           style="width: 100%"
           :cell-style="{'text-align':'center'}"
         >
-          <el-form-item prop="parkingArea">
-            <el-table-column
-              label="可停区域"
-              align="center"
-            >
-              <template slot-scope="scope">
-                <el-form-item prop="parkingArea">
-                  <el-select
-                    placeholder="请选择"
-                    v-model="tableData[scope.$index].parkingArea"
-                    @click.native="parking"
-                  >
-                    <el-option
-                      v-for="(item,index) in eloption"
-                      :key="index"
-                      :value='item.value'
-                      :label="item.label"
-                      @click.native="parked(item)"
-                    ></el-option>
-                  </el-select>
-                </el-form-item>
 
-              </template>
-            </el-table-column>
-          </el-form-item>
+          <el-table-column
+            label="可停区域"
+            align="center"
+          >
+            <template slot-scope="scope">
+              <el-form-item
+                prop="parkingArea"
+                ref="againValue"
+              >
+                <el-select
+                  placeholder="请选择"
+                  v-model="tableData[scope.$index].parkingArea"
+                  @click.native="parking"
+                >
+                  <el-option
+                    v-for="(item,index) in eloption"
+                    :key="index"
+                    :value='item.value'
+                    :label="item.label"
+                    @click.native="parked(item)"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+
+            </template>
+          </el-table-column>
 
           <el-table-column
             label="占用车位"
@@ -283,11 +280,9 @@
 
           </el-table-column>
         </el-table>
-      </el-form>
 
-    </div>
+      </div>
 
-    <el-form>
       <div class="formContent-item_title">
         <el-row>
           <el-col :span="2">车位设置</el-col>
@@ -314,22 +309,39 @@
           >
             <template slot-scope="scope">
               <el-col :span="10">
-                <el-select v-model="parkingSpaceSetting[scope.$index].licensePlate">
-                  <el-option
-                    v-for="(item,index) in beforelicense"
-                    :key="index"
-                    :value='item.label'
-                    :label="item.label"
-                  ></el-option>
-                </el-select>
+                <el-form-item
+                  prop="againInput"
+                  ref="againInput"
+                >
+                  <el-select v-model="parkingSpaceSetting[scope.$index].licensePlate">
+
+                    <el-option
+                      v-for="(item,index) in beforelicense"
+                      :key="index"
+                      :value='item.label'
+                      :label="item.label"
+                      @click.native="license"
+                    ></el-option>
+
+                  </el-select>
+                </el-form-item>
               </el-col>
               <el-col :span="14">
+                <!-- <el-form-item
+                  prop="againInput"
+                  ref="againInput"
+                > -->
+                <!-- <input  ref="searchInput" v-focus>
+ -->
                 <el-input
                   placeholder="车牌号"
                   v-model="parkingSpaceSetting[scope.$index].license"
                   clearable
+                  ref="searchInput"
                 >
                 </el-input>
+                <!-- </el-form-item> -->
+
               </el-col>
             </template>
           </el-table-column>
@@ -449,6 +461,10 @@ export default {
         areaName: '',
         idName: '',
         res: '',
+        // 校验
+        parking: false,
+        parkingArea: '',
+        againInput: ''
       },
       tableData: [
         {
@@ -617,6 +633,12 @@ export default {
         ],
         ruleId: [
           { required: true, message: '请选择充值规则', trigger: 'change' }
+        ],
+        parkingArea: [
+          { required: true, message: '请选择可停区域', trigger: 'change' }
+        ],
+        againInput: [
+          { required: true, message: '请选择车牌号', trigger: 'change' },
         ]
 
       },
@@ -641,6 +663,9 @@ export default {
     };
   },
   methods: {
+    clearValidate (formName) {
+      this.$refs[formName].clearValidate();
+    },
     resDate (val) {
       // debugger
       this.formDate.resDate = val.label;
@@ -655,9 +680,30 @@ export default {
 
     parked (item) {
       this.areaNamed.push(item.label);
-      // this.tableData.areaName = item.label;
       this.formDate.sort = item.startDate;
-      // console.log(this.tableData.areaName)
+      if (this.rules.parkingArea[0].required == true && this.formDate.parkingArea == '') {
+        this.formDate.parkingArea = '验证'
+        this.rules.parkingArea[0].required = this.formDate.parking;
+        this.clearValidate('againValue');
+      }
+
+
+      // this.formDate.parkingArea = '验证' this.formDate.againInput = '验证'
+
+    },
+    license () {
+      if (this.rules.againInput[0].required == true && this.formDate.againInput == '') {
+        this.formDate.againInput = '验证'
+        this.rules.againInput[0].required = this.formDate.parking;
+        this.clearValidate('againInput');
+        this.$refs.searchInput.focus();
+      }
+
+      // this.$nextTick( () => {
+      //         this.$refs.searchInput.focus();
+      //   })
+
+
     },
     // 充值规则
     rechargeRules () {
@@ -974,6 +1020,8 @@ export default {
   },
   created () {
     this.nameParking();
+    this.formDate.parkingArea = '验证';
+    this.formDate.againInput = '验证'
     if (this.params.cardId != undefined) {
       this.params.cardId;
       this.$http.get('/sc-community-web/parkingCar/getVehicleInfor', { id: this.params.cardId }).then(({ data, msg, status }) => {
@@ -1042,14 +1090,19 @@ export default {
 
   }
 }
-</script>
+</script >
 
 
-<style lang="scss">
+<style lang="scss" >
 .el-input--small .el-input__inner {
     cursor: pointer;
 }
 .el-row {
     margin: 10px !important;
 }
+tr {
+    .el-form-item__content {
+        margin-left: 0 !important;
+    }
+}
 </style>

+ 269 - 167
smart/src/views/vehicleInformation/setpPage/recharge.vue

@@ -1,152 +1,198 @@
 <template>
   <div class="formContent">
-    <div>
-      <h3>{{this.userName}}</h3>
-      <div class="formContent-item_title">充值信息</div>
-      <el-row>
-        <el-col :span="12">
-          <el-col :span="8">车牌类型</el-col>
-          <el-col :span="12">月租车</el-col>
-        </el-col>
-        <!-- 充值类型 -->
-        <el-col :span="24">
-          <el-col :span="4">充值规则</el-col>
-          <el-col :span="20">
-            <el-select v-model="valueselected">
-              <el-option
-                v-for="(item,index) in recharge"
-                :key="index"
-                :value="item.label"
-                :label="item.name"
-                @click.native="rechargeDates(item)"
+    <el-form
+      ref="formDate"
+      label-width="80px"
+      :rules="rules"
+      :model="formDate"
+    >
+      <div>
+        <h3>{{this.userName}}</h3>
+        <div class="formContent-item_title">充值信息</div>
+        <el-row>
+          <el-col :span="12">
+            <el-col :span="8">车牌类型</el-col>
+            <el-col :span="12">月租车</el-col>
+          </el-col>
+          <!-- 充值类型 -->
+          <el-col :span="24">
+            <el-col
+              :span="0.5"
+              style="content: '*';color: #F56C6C;"
+            >*</el-col>
+            <el-col :span="4">充值规则</el-col>
+            <el-col :span="19">
+              <el-form-item
+                prop="parkingArea"
+                ref="againValue"
               >
-              </el-option>
-            </el-select>
+                <el-select v-model="valueselected">
+                  <el-option
+                    v-for="(item,index) in recharge"
+                    :key="index"
+                    :value="item.label"
+                    :label="item.name"
+                    @click.native="rechargeDates(item)"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
 
+            </el-col>
           </el-col>
-        </el-col>
-        <!-- 充值 -->
-        <el-col :span="24">
-          <el-col :span="12">
-            <el-col :span="8">充值天数</el-col>
-            <el-col :span="16">
-              <el-select v-model="rechargeDays">
-                <el-option
-                  v-for="(itemes,indexes) in RechargeDaysed"
-                  :key="indexes"
-                  :value="itemes.name"
-                  :label="itemes.label"
-                  @click.native="recharges(itemes)"
-                ></el-option>
-              </el-select>
+          <!-- 充值 -->
+          <el-col :span="24">
+            <el-col :span="12">
+              <el-col
+                :span="1"
+                style="content: '*';color: #F56C6C;"
+              >*</el-col>
+              <el-col :span="7">充值天数</el-col>
+              <el-col :span="15">
+                <el-form-item
+                  prop="parkingDays"
+                  ref="againDays"
+                >
+                  <el-select v-model="rechargeDays">
+                    <el-option
+                      v-for="(itemes,indexes) in RechargeDaysed"
+                      :key="indexes"
+                      :value="itemes.name"
+                      :label="itemes.label"
+                      @click.native="recharges(itemes)"
+                    ></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-col>
+            <el-col :span="12">
+              <el-col :span="8">赠送天数</el-col>
+              <el-col :span="16">
+                <el-select
+                  disabled
+                  :placeholder='valueselect'
+                >
+                </el-select>
+              </el-col>
             </el-col>
           </el-col>
-          <el-col :span="12">
-            <el-col :span="8">赠送天数</el-col>
-            <el-col :span="16">
-              <el-select
-                disabled
-                :placeholder='valueselect'
+          <!-- 日期 -->
+          <el-col :span="24">
+            <el-col
+              :span="0.5"
+              style="content: '*';color: #F56C6C;"
+            >*</el-col>
+            <el-col :span="4">开始时间</el-col>
+            <el-col :span="18">
+              <el-form-item
+                prop="parkingPicker"
+                ref="againPicker"
               >
-              </el-select>
+                <el-date-picker
+                  v-model="value1"
+                  type="date"
+                  placeholder="选择日期"
+                  value-format="timestamp"
+                  @change="datePicker"
+                >
+                </el-date-picker>
+              </el-form-item>
+
             </el-col>
           </el-col>
-        </el-col>
-        <!-- 日期 -->
-        <el-col :span="24">
-          <el-col :span="4">开始时间</el-col>
-          <el-col :span="20">
-            <el-date-picker
-              v-model="value1"
-              type="date"
-              placeholder="选择日期"
-              value-format="timestamp"
-              @change="datePicker"
-            >
-            </el-date-picker>
-          </el-col>
-        </el-col>
-        <el-col :span="24">
-          <el-col :span="4">结束时间</el-col>
-          <el-col :span="20">
-            <el-date-picker
-              v-model="value2"
-              type="date"
-              :placeholder="value2"
-              value-format="timestamp"
-              disabled
+          <el-col :span="24">
+            <el-col :span="5">结束时间</el-col>
+            <el-col :span="18">
+              <el-date-picker
+                v-model="value2"
+                type="date"
+                :placeholder="value2"
+                value-format="timestamp"
+                disabled
+              >
+              </el-date-picker>
+            </el-col>
+            <el-col
+              :span="24"
+              v-show="this.carStatus == 2 ? true : false"
             >
-            </el-date-picker>
-          </el-col>
-          <el-col
-            :span="24"
-            v-show="this.carStatus == 2 ? true : false"
-          >
-            <span>车辆未过期,已绑定充值规则,充值开始时间:过期时间+1</span>
+              <span>车辆未过期,已绑定充值规则,充值开始时间:过期时间+1</span>
+            </el-col>
           </el-col>
-        </el-col>
-        <!-- 收费金额 -->
-        <el-col :span="24">
-          <el-col :span="4">收费金额 </el-col>
-          <el-col :span="17">
-            <el-input
-              :placeholder="chargeAmount"
-              :disabled="true"
-            >
-            </el-input>
+          <!-- 收费金额 -->
+          <el-col :span="24">
+            <el-col :span="4">收费金额 </el-col>
+            <el-col :span="17">
+              <el-input
+                :placeholder="chargeAmount"
+                :disabled="true"
+              >
+              </el-input>
+            </el-col>
+            <el-col
+              :span="2"
+              style="margin-left: 5px;"
+            >元 </el-col>
           </el-col>
-          <el-col
-            :span="2"
-            style="margin-left: 5px;"
-          >元 </el-col>
-        </el-col>
-        <!-- 支付方式 -->
-        <el-col :span="24">
-          <el-col :span="4">支付方式</el-col>
-          <el-col :span="20">
-            <el-select
-              v-model="paymentMethod"
-              placeholder="请选择"
-            >
-              <el-option
-                value="1"
-                label="微信"
-              ></el-option>
-              <el-option
-                value="2"
-                label="支付宝"
-              ></el-option>
-              <el-option
-                value="3"
-                label="现金"
-              ></el-option>
-              <el-option
-                value="4"
-                label="预存"
-              ></el-option>
-              <el-option
-                value="5"
-                label="其他"
-              ></el-option>
-            </el-select>
+          <!-- 支付方式 -->
+          <el-col :span="24">
+            <el-col
+              :span="0.5"
+              style="content: '*';color: #F56C6C;"
+            >*</el-col>
+            <el-col :span="4">支付方式</el-col>
+            <el-col :span="18">
+              <el-form-item
+                prop="parkingMethod"
+                ref="againMethod"
+              >
+                <el-select
+                  v-model="paymentMethod"
+                  placeholder="请选择"
+                  @change="method"
+                >
+                  <el-option
+                    value="1"
+                    label="微信"
+                  ></el-option>
+                  <el-option
+                    value="2"
+                    label="支付宝"
+                  ></el-option>
+                  <el-option
+                    value="3"
+                    label="现金"
+                  ></el-option>
+                  <el-option
+                    value="4"
+                    label="预存"
+                  ></el-option>
+                  <el-option
+                    value="5"
+                    label="其他"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+
+            </el-col>
           </el-col>
-        </el-col>
-        <!-- 备注 -->
-        <el-col :span="24">
-          <el-col :span="4">充值备注</el-col>
-          <el-col :span="20">
-            <el-input
-              type="textarea"
-              :rows="3"
-              placeholder="请输入内容"
-              v-model="inputText"
-              maxlength="100"
-              show-word-limit
-            ></el-input>
+          <!-- 备注 -->
+          <el-col :span="24">
+            <el-col :span="4">充值备注</el-col>
+            <el-col :span="20">
+              <el-input
+                type="textarea"
+                :rows="3"
+                placeholder="请输入内容"
+                v-model="inputText"
+                maxlength="100"
+                show-word-limit
+              ></el-input>
+            </el-col>
           </el-col>
-        </el-col>
-      </el-row>
-    </div>
+        </el-row>
+      </div>
+    </el-form>
 
   </div>
 </template>
@@ -160,6 +206,7 @@ export default {
   props: ['params'],
   data () {
     return {
+
       valueselected: '',
       valueselect: '',//天数
       value1: '',//日期时间
@@ -193,16 +240,42 @@ export default {
       ruleNamed: '',
       credit: '',
       rechargeDatesName: '',
-      carStatus: ''
+      carStatus: '',
+      formDate: {
+        parkingArea: '',
+        parkingDays: '',
+        parkingPicker: '',
+        parkingMethod: ''
+      },
+      parking: false,
+      rules: {
+        parkingArea: [{ required: true, message: '请选择充值规则', trigger: 'change' }],
+        parkingDays: [{ required: true, message: '请选择充值天数', trigger: 'change' }],
+        parkingPicker: [{ required: true, message: '请选择充值天数', trigger: 'change' }],
+        parkingMethod: [{ required: true, message: '请选择充值天数', trigger: 'change' }],
+      }
     }
   },
   methods: {
+    method () {
+      if (this.rules.parkingMethod[0].required == true && this.formDate.parkingMethod == '') {
+        this.formDate.parkingMethod = '验证'
+        this.rules.parkingMethod[0].required = this.formDate.parking;
+        this.clearValidate('againMethod');
+      }
+    },
+    clearValidate (formName) {
+      this.$refs[formName].clearValidate();
+    },
     rechargeDates (item) {
-      debugger
+      if (this.rules.parkingArea[0].required == true && this.formDate.parkingArea == '') {
+        this.formDate.parkingArea = '验证'
+        this.rules.parkingArea[0].required = this.formDate.parking;
+        this.clearValidate('againValue');
+      }
       if (item.name != undefined) {
         this.rechargeDatesName = item.name;
       }
-      debugger
       this.rechargeDays = '';
       this.valueselect = '';
       this.valueselectName = '';
@@ -230,6 +303,12 @@ export default {
 
     },
     datePicker () {
+      if (this.rules.parkingPicker[0].required == true && this.formDate.parkingPicker == '') {
+        this.formDate.parkingPicker = '验证'
+        this.rules.parkingPicker[0].required = this.formDate.parking;
+        this.clearValidate('againPicker');
+      }
+
 
       // valueselect赠送
       // rechargeDays 天数
@@ -290,7 +369,13 @@ export default {
         .catch(() => { });
     },
     recharges (item) {
-      debugger
+      if (this.rules.parkingDays[0].required == true && this.formDate.parkingDays == '') {
+        this.formDate.parkingDays = '验证'
+        this.rules.parkingDays[0].required = this.formDate.parking;
+        this.clearValidate('againDays');
+      }
+
+
       this.id = item.id;
       this.valueselect = this.complimentaryDays[0].label;
       this.valueselectName = this.complimentaryDays[0].name;
@@ -299,36 +384,50 @@ export default {
       this.chargeNumber = item.name;
     },
     submit () {
-      this.$http.post('/sc-community-web/parkingCar/carCharge', {
-        amount: this.chargeAmount * 100,
-        carType: this.cardType,
-        cardId: this.cardId,
-        chargeMethod: this.idType,
-        chargeNumber: this.chargeNumber,
-        freeNumber: this.valueselectName,
-        // orderNo: '',
-        parkId: this.parkId,
-        payChannel: this.paymentMethod,
-        payMethod: this.paymentMethod,
-        remark: this.inputText,
-        validFrom: this.timeValue1,
-        validTo: this.timeValue2,
-        platNo: this.fullCarNoStr,
-        userId: this.residentId,
-        // ruleName: '',
-        ruleName: this.rechargeDatesName,
-        credit: this.valueselectName,//充值月份
-        payStatus: this.paymentMethod
-      }).then(({ data, status, msg }) => {
-        if (status == 0) {
-          this.$message.success('成功');
+      this.$refs.formDate.validate((valid) => {
+        if (valid) {
+          this.$http.post('/sc-community-web/parkingCar/carCharge', {
+            amount: this.chargeAmount * 100,
+            carType: this.cardType,
+            cardId: this.cardId,
+            chargeMethod: this.idType,
+            chargeNumber: this.chargeNumber,
+            freeNumber: this.valueselectName,
+            // orderNo: '',
+            parkId: this.parkId,
+            payChannel: this.paymentMethod,
+            payMethod: this.paymentMethod,
+            remark: this.inputText,
+            validFrom: this.timeValue1,
+            validTo: this.timeValue2,
+            platNo: this.fullCarNoStr,
+            userId: this.residentId,
+            // ruleName: '',
+            ruleName: this.rechargeDatesName,
+            credit: this.valueselectName,//充值月份
+            payStatus: this.paymentMethod
+          }).then(({ data, status, msg }) => {
+            if (status == 0) {
+              this.$message.success('成功');
+            }
+          })
+        } else {
+          return false;
         }
       })
-      this.params.callback();
-      this.$emit('close');
+
+
+
+      // this.params.callback();
+      // this.$emit('close');
     },
   },
   created () {
+
+    // this.formDate.parkingArea = '验证'
+    // this.formDate.parkingDays = '验证'
+    // this.formDate.parkingPicker = '验证'
+    // this.formDate.parkingMethod = '验证'
     this.userName = this.params.userName;
     this.cardType = this.params.cardType;
     this.parkId = this.params.parkId;
@@ -348,7 +447,7 @@ export default {
 </script>
 
 
-<style scoped>
+<style lang="scss" scoped>
 h3 {
     margin-bottom: 15px;
     /* text-align: center !important; */
@@ -358,9 +457,9 @@ h3 {
     margin-top: 10px !important;
     line-height: 30px;
 }
-.el-select {
-    width: 90%;
-}
+// .el-select {
+//     width: 90%;
+// }
 .el-col > span {
     font-size: 12px;
     font-weight: 400;
@@ -369,4 +468,7 @@ h3 {
     display: flex;
     justify-content: center;
 }
+/deep/.el-form-item__content {
+    margin-left: 0px !important;
+}
 </style>