123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- <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-option>
- </el-select>
- </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>
- </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="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-date-picker>
- </el-col>
- <el-col :span="24">
- <span>车辆未过期,已绑定充值规则,充值开始时间:过期时间+1</span>
- </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>
- <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-select>
- </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>
- </el-col>
- </el-row>
- </div>
- </div>
- </template>
- <script>
- export default {
- props: ['params'],
- data () {
- return {
- valueselected: '',
- valueselect: '',//天数
- value1: '',//日期时间
- value2: '',
- rechargeDays: '',//充值时间
- chargeAmount: '',//收费金额
- paymentMethod: '',//支付方式
- inputText: '',//备注
- id: '',
- userName: "",
- cardType: "",
- parkId: "",
- cardId: "",
- recharge: [],
- RechargeDaysed: [],
- complimentaryDays: [],
- idType: '',
- valueselectName: "",
- chargeNumber: '',
- timeValue1: '',
- timeValue2: '',
- rechargeDate: [],
- }
- },
- methods: {
- rechargeDates (item) {
- debugger
- // item.nameId
- this.rechargeDate[item.nameId]
- 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赠送
- // rechargeDays 天数
- if (this.idType == 0) {
- var time = this.value1;
- } else if (this.idType == 1) {
- debugger
- var time = ((parseInt(this.valueselectName) + parseInt(this.rechargeDays * 30)) * 86400000) + this.value1;
- } else if (this.idType == 2) {
- var time = ((parseInt(this.valueselectName) + parseInt(this.rechargeDays)) * 86400000) + this.value1;
- } else if (this.idType == 3) {
- var time = ((parseInt(this.valueselectName) + parseInt(this.rechargeDays)) * 3600000) + this.value1;
- } else if (this.idType == 4) {
- var time = this.value1;
- }
- // var time = ((parseInt(this.valueselected) + parseInt(this.rechargeDays)) * 86400000) + this.value1;
- var timeCode = new Date(time);
- var year = timeCode.getFullYear();
- var month = timeCode.getMonth() + 1;
- var date = timeCode.getDate();
- this.value2 = year + "-" + (month.toString().length == 1 ? ('0' + month) : month) + "-" + (date.toString().length == 1 ? ('0' + date) : date);
- var timeCodes = new Date(this.value1);
- var year = timeCodes.getFullYear();
- var month = timeCodes.getMonth() + 1;
- var date = timeCodes.getDate();
- this.timeValue1 = year + "-" + (month.toString().length == 1 ? ('0' + month) : month) + "-" + (date.toString().length == 1 ? ('0' + date) : date) + ' ' + '00:00:00';
- this.timeValue2 = this.value2 + ' ' + '23:59:59';
- },
- // 充值规则
- rechargeRules () {
- // /sc-community-web/parkingCar/queryRechargeRules
- this.$http
- .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,
- nameId: i
- })
- }
- })
- .catch(() => { });
- },
- recharges (item) {
- debugger
- this.id = item.id;
- 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 () {
- this.$http.post('/sc-community-web/parkingCar/carCharge', {
- amount: this.chargeAmount,
- carType: this.cardType,
- cardId: this.cardId,
- chargeMethod: this.idType,
- chargeNumber: this.chargeNumber,
- freeNumber: this.valueselectName,
- // orderNo: '',
- parkId: this.parkId,
- payChannel: this.paymentMethod,
- remark: this.inputText,
- validFrom: this.timeValue1,
- validTo: this.timeValue2
- }).then(({ data, status, msg }) => {
- })
- this.$emit('close');
- },
- },
- created () {
- console.log('11111')
- this.params;
- this.userName = this.params.userName;
- this.cardType = this.params.cardType;
- this.parkId = this.params.parkId;
- this.cardId = this.params.cardId;
- this.rechargeRules();
- }
- }
- </script>
- <style scoped>
- h3 {
- margin-bottom: 15px;
- }
- .el-col {
- margin-top: 10px !important;
- line-height: 30px;
- }
- .el-select {
- width: 90%;
- }
- .el-col > span {
- font-size: 12px;
- font-weight: 400;
- color: #ff7171;
- line-height: 17px;
- display: flex;
- justify-content: center;
- }
- </style>
|