Commit edc38b57a9400ca219e8aff6a7cdc54122921861

Authored by 王富生
1 parent 5ab16151

提交bug

src/api/mycar.js
@@ -18,7 +18,7 @@ export function boundCarNum(params) { @@ -18,7 +18,7 @@ export function boundCarNum(params) {
18 return request({ 18 return request({
19 url: '/personCarNumPc/boundCarNum', 19 url: '/personCarNumPc/boundCarNum',
20 method: 'post', 20 method: 'post',
21 - params 21 + data:params
22 }) 22 })
23 } 23 }
24 24
@@ -26,10 +26,11 @@ export function boundCarNum(params) { @@ -26,10 +26,11 @@ export function boundCarNum(params) {
26 * 解绑车牌 26 * 解绑车牌
27 * @param params 27 * @param params
28 */ 28 */
29 -export function unboundCarNum() { 29 +export function unboundCarNum(params) {
30 return request({ 30 return request({
31 url: '/personCarNumPc/unboundCarNum', 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,7 +31,7 @@
31 </el-form-item> 31 </el-form-item>
32 </el-col> 32 </el-col>
33 <el-col :span="12"> 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 </el-col> 35 </el-col>
36 </el-row> 36 </el-row>
37 37
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 </el-card> 40 </el-card>
41 </el-col> 41 </el-col>
42 <el-col :span="12"> 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 <div slot="header" class="clearfix"> 44 <div slot="header" class="clearfix">
45 <span>解绑车牌</span> 45 <span>解绑车牌</span>
46 </div> 46 </div>
@@ -106,13 +106,46 @@ @@ -106,13 +106,46 @@
106 106
107 }, 107 },
108 methods: { 108 methods: {
109 - /**绑定车牌*/  
110 - bondCarNum:function(formName){ 109 + /**校验是否已经绑定*/
  110 + checkCarNum(formName){
  111 + debugger
  112 + //checkBoundCarNum
111 let that = this; 113 let that = this;
112 let custId = this.form.custId; 114 let custId = this.form.custId;
113 let carNum = this.bondform.carNum; 115 let carNum = this.bondform.carNum;
  116 + let existFlg = false;
114 this.$refs[formName].validate((valid) => { 117 this.$refs[formName].validate((valid) => {
115 if (valid) { 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 let req ={ 149 let req ={
117 custId:custId, 150 custId:custId,
118 carNumber:carNum, 151 carNumber:carNum,
@@ -126,14 +159,12 @@ @@ -126,14 +159,12 @@
126 type: 'success', 159 type: 'success',
127 message: '车牌绑定成功!' 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 getPersonCarNumPC:function () { 170 getPersonCarNumPC:function () {
@@ -161,6 +192,7 @@ @@ -161,6 +192,7 @@
161 sysCode:'1001', 192 sysCode:'1001',
162 carBindingStatus:2, //解绑 193 carBindingStatus:2, //解绑
163 }; 194 };
  195 + debugger
164 unboundCarNum(req).then(response =>{ 196 unboundCarNum(req).then(response =>{
165 if(response.code ='8888'){ 197 if(response.code ='8888'){
166 this.$message({ 198 this.$message({
src/views/order/index.vue
@@ -37,6 +37,9 @@ @@ -37,6 +37,9 @@
37 <p class="table-title">订单详情</p> 37 <p class="table-title">订单详情</p>
38 <el-table 38 <el-table
39 :data="orderData" 39 :data="orderData"
  40 + v-loading="loading"
  41 + element-loading-text="数据加载中..."
  42 + element-loading-spinner="el-icon-loading"
40 style="width: 100%;" 43 style="width: 100%;"
41 :show-overflow-tooltip="true"> 44 :show-overflow-tooltip="true">
42 <el-table-column 45 <el-table-column
@@ -125,6 +128,7 @@ export default { @@ -125,6 +128,7 @@ export default {
125 carNum: null, 128 carNum: null,
126 129
127 }, 130 },
  131 + loading:false,
128 total: 0, 132 total: 0,
129 currentPage: 1, 133 currentPage: 1,
130 pageSize: 6, 134 pageSize: 6,
@@ -158,6 +162,7 @@ export default { @@ -158,6 +162,7 @@ export default {
158 * 查询订单信息 162 * 查询订单信息
159 */ 163 */
160 queryOwnerParkRecord: function() { 164 queryOwnerParkRecord: function() {
  165 + this.loading=true;
161 let req = this.getQueryParams(); 166 let req = this.getQueryParams();
162 167
163 req.baseRequest={ 168 req.baseRequest={
@@ -166,6 +171,7 @@ export default { @@ -166,6 +171,7 @@ export default {
166 }, 171 },
167 queryOwnerParkRecord (req).then(response =>{ 172 queryOwnerParkRecord (req).then(response =>{
168 if(response.code=='8888'){ 173 if(response.code=='8888'){
  174 + this.loading=false;
169 this.orderData = response.data.dataList; 175 this.orderData = response.data.dataList;
170 this.total = response.data.pageTotals; 176 this.total = response.data.pageTotals;
171 }else{ 177 }else{