Commit edc38b57a9400ca219e8aff6a7cdc54122921861
1 parent
5ab16151
提交bug
Showing
3 changed files
with
51 additions
and
12 deletions
src/api/mycar.js
| ... | ... | @@ -18,7 +18,7 @@ export function boundCarNum(params) { |
| 18 | 18 | return request({ |
| 19 | 19 | url: '/personCarNumPc/boundCarNum', |
| 20 | 20 | method: 'post', |
| 21 | - params | |
| 21 | + data:params | |
| 22 | 22 | }) |
| 23 | 23 | } |
| 24 | 24 | |
| ... | ... | @@ -26,10 +26,11 @@ export function boundCarNum(params) { |
| 26 | 26 | * 解绑车牌 |
| 27 | 27 | * @param params |
| 28 | 28 | */ |
| 29 | -export function unboundCarNum() { | |
| 29 | +export function unboundCarNum(params) { | |
| 30 | 30 | return request({ |
| 31 | 31 | url: '/personCarNumPc/unboundCarNum', |
| 32 | - method: 'post' | |
| 32 | + method: 'post', | |
| 33 | + data:params | |
| 33 | 34 | }) |
| 34 | 35 | } |
| 35 | 36 | ... | ... |
src/views/mycar/index.vue
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | </el-form-item> |
| 32 | 32 | </el-col> |
| 33 | 33 | <el-col :span="12"> |
| 34 | - <el-button type="primary" :loading="bondformBtnVisible" @click="bondCarNum('bondform')">绑定车牌</el-button> | |
| 34 | + <el-button type="primary" :loading="bondformBtnVisible" @click="checkCarNum('bondform')">绑定车牌</el-button> | |
| 35 | 35 | </el-col> |
| 36 | 36 | </el-row> |
| 37 | 37 | |
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | </el-card> |
| 41 | 41 | </el-col> |
| 42 | 42 | <el-col :span="12"> |
| 43 | - <el-card class="box-card" style="height: 300px"> | |
| 43 | + <el-card class="box-card" style="min-height: 300px"> | |
| 44 | 44 | <div slot="header" class="clearfix"> |
| 45 | 45 | <span>解绑车牌</span> |
| 46 | 46 | </div> |
| ... | ... | @@ -106,13 +106,46 @@ |
| 106 | 106 | |
| 107 | 107 | }, |
| 108 | 108 | methods: { |
| 109 | - /**绑定车牌*/ | |
| 110 | - bondCarNum:function(formName){ | |
| 109 | + /**校验是否已经绑定*/ | |
| 110 | + checkCarNum(formName){ | |
| 111 | + debugger | |
| 112 | + //checkBoundCarNum | |
| 111 | 113 | let that = this; |
| 112 | 114 | let custId = this.form.custId; |
| 113 | 115 | let carNum = this.bondform.carNum; |
| 116 | + let existFlg = false; | |
| 114 | 117 | this.$refs[formName].validate((valid) => { |
| 115 | 118 | if (valid) { |
| 119 | + getPersonCarNumPC().then(response =>{ | |
| 120 | + if(response.code ='8888'){ | |
| 121 | + let data = response.data; | |
| 122 | + data.forEach(function(item,index){ | |
| 123 | + if(item.carNumber ==carNum){ | |
| 124 | + existFlg=true; | |
| 125 | + } | |
| 126 | + }); | |
| 127 | + if(data.length >=3){ | |
| 128 | + this.$message({ | |
| 129 | + type: 'error', | |
| 130 | + message: '最多只能绑定3个车牌' | |
| 131 | + }); | |
| 132 | + }else if(existFlg){ | |
| 133 | + this.$message({ | |
| 134 | + type: 'error', | |
| 135 | + message: '该车牌已经绑定!' | |
| 136 | + }); | |
| 137 | + }else { | |
| 138 | + that.bondCarNum(custId,carNum); | |
| 139 | + } | |
| 140 | + | |
| 141 | + } | |
| 142 | + }); | |
| 143 | + } | |
| 144 | + }); | |
| 145 | + }, | |
| 146 | + /**绑定车牌*/ | |
| 147 | + bondCarNum:function(custId,carNum){ | |
| 148 | + let that =this; | |
| 116 | 149 | let req ={ |
| 117 | 150 | custId:custId, |
| 118 | 151 | carNumber:carNum, |
| ... | ... | @@ -126,14 +159,12 @@ |
| 126 | 159 | type: 'success', |
| 127 | 160 | message: '车牌绑定成功!' |
| 128 | 161 | }); |
| 162 | + that.getPersonCarNumPC(); | |
| 129 | 163 | |
| 130 | 164 | } |
| 131 | 165 | }); |
| 132 | - } else { | |
| 133 | - console.log('error submit!!'); | |
| 134 | - return false; | |
| 135 | - } | |
| 136 | - }); | |
| 166 | + | |
| 167 | + | |
| 137 | 168 | }, |
| 138 | 169 | /**获取车牌.*/ |
| 139 | 170 | getPersonCarNumPC:function () { |
| ... | ... | @@ -161,6 +192,7 @@ |
| 161 | 192 | sysCode:'1001', |
| 162 | 193 | carBindingStatus:2, //解绑 |
| 163 | 194 | }; |
| 195 | + debugger | |
| 164 | 196 | unboundCarNum(req).then(response =>{ |
| 165 | 197 | if(response.code ='8888'){ |
| 166 | 198 | this.$message({ | ... | ... |
src/views/order/index.vue
| ... | ... | @@ -37,6 +37,9 @@ |
| 37 | 37 | <p class="table-title">订单详情</p> |
| 38 | 38 | <el-table |
| 39 | 39 | :data="orderData" |
| 40 | + v-loading="loading" | |
| 41 | + element-loading-text="数据加载中..." | |
| 42 | + element-loading-spinner="el-icon-loading" | |
| 40 | 43 | style="width: 100%;" |
| 41 | 44 | :show-overflow-tooltip="true"> |
| 42 | 45 | <el-table-column |
| ... | ... | @@ -125,6 +128,7 @@ export default { |
| 125 | 128 | carNum: null, |
| 126 | 129 | |
| 127 | 130 | }, |
| 131 | + loading:false, | |
| 128 | 132 | total: 0, |
| 129 | 133 | currentPage: 1, |
| 130 | 134 | pageSize: 6, |
| ... | ... | @@ -158,6 +162,7 @@ export default { |
| 158 | 162 | * 查询订单信息 |
| 159 | 163 | */ |
| 160 | 164 | queryOwnerParkRecord: function() { |
| 165 | + this.loading=true; | |
| 161 | 166 | let req = this.getQueryParams(); |
| 162 | 167 | |
| 163 | 168 | req.baseRequest={ |
| ... | ... | @@ -166,6 +171,7 @@ export default { |
| 166 | 171 | }, |
| 167 | 172 | queryOwnerParkRecord (req).then(response =>{ |
| 168 | 173 | if(response.code=='8888'){ |
| 174 | + this.loading=false; | |
| 169 | 175 | this.orderData = response.data.dataList; |
| 170 | 176 | this.total = response.data.pageTotals; |
| 171 | 177 | }else{ | ... | ... |