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