From 22d9bd7152c6de2d71afade6ab7b5f788d023578 Mon Sep 17 00:00:00 2001 From: Oliver <1070107765@qq.com> Date: 星期一, 12 十二月 2022 18:07:39 +0800 Subject: [PATCH] fix bug --- src/views/operate/car/myIndex/index.vue | 85 +++++++++++++++++++++++++----------------- 1 files changed, 51 insertions(+), 34 deletions(-) diff --git a/src/views/operate/car/myIndex/index.vue b/src/views/operate/car/myIndex/index.vue index 0f0b869..df8191b 100644 --- a/src/views/operate/car/myIndex/index.vue +++ b/src/views/operate/car/myIndex/index.vue @@ -5,11 +5,15 @@ <div class="search"> <span>杞﹁締鎼滅储:</span> <div class="option"> - <el-input @input="handleSearch" v-model="context" placeholder="璇疯緭鍏ヨ溅鐗屽彿"></el-input> + <el-input v-model="context" placeholder="璇疯緭鍏ヨ溅鐗屽彿"></el-input> + </div> + + <div class="findBtn"> + <el-button type="primary" @click="handleSearch">鏌ヨ</el-button> </div> </div> <div class="addCar"> - <el-button type="primary" class="addBtn" @click="handleAddCar">娣诲姞杞﹁締</el-button> + <el-button type="primary" class="addBtn button-addition" @click="handleAddCar">娣诲姞杞﹁締</el-button> </div> </div> </header> @@ -30,22 +34,24 @@ </el-table-column> <el-table-column prop="carModel" label="杞﹀瀷" min-width="10" v-if="mystatus===2"> </el-table-column> - <el-table-column prop="ownerName" label="杞︿富濮撳悕" min-width="10"> + <el-table-column :prop="mystatus ===1 ? 'ownerName':'carOwner'" label="杞︿富濮撳悕" min-width="10"> </el-table-column> - <el-table-column prop="vehicleUser" label="杞﹁締浣跨敤浜哄憳" min-width="10"> + <el-table-column v-if="mystatus ===2" :prop="mystatus ===1 ? 'vehicleUser' : 'carUser'" label="杞﹁締浣跨敤浜哄憳" min-width="10"> </el-table-column> - <el-table-column prop="contact" label="鑱旂郴鏂瑰紡" min-width="10"> + <el-table-column :prop="mystatus ===1 ? 'contact' : 'phone' " label="鑱旂郴鏂瑰紡" min-width="10"> </el-table-column> - <el-table-column :prop="mystatus===1 ? 'belong' : 'geographicPosition'" :label="mystatus === 1 ? '鎵�灞為儴闂�':'鏂藉伐鍦板潃'" min-width="10"> + <el-table-column :prop="mystatus===1 ? 'pdepartName' : 'geographicPosition'" :label="mystatus === 1 ? '鎵�灞為儴闂�':'鏂藉伐鍦板潃'" min-width="10"> </el-table-column> - <el-table-column :prop="mystatus===1 ? 'depart' : 'constructionOrg'" :label="mystatus === 1 ? '鎵�灞炲ぇ闃�' : '鏂藉伐鍗曚綅'" min-width="10"> + <el-table-column :prop="mystatus===1 ? 'departName' : 'constructionOrg'" :label="mystatus === 1 ? '鎵�灞炲ぇ闃�' : '鏂藉伐鍗曚綅'" min-width="10"> </el-table-column> <el-table-column prop="operation" label="鎿嶄綔" min-width="20"> <template slot-scope="scope"> <div class="btn"> - <span @click="handleView(scope.row)">鏌ョ湅</span> + <!-- <span @click="handleView(scope.row)">鏌ョ湅</span> + <span class="line">|</span> --> + <span @click="handleEdit(scope.row)">缂栬緫</span> <span class="line">|</span> - <span>鍒犻櫎</span> + <span @click="handleDelete(scope.row)">鍒犻櫎</span> </div> </template> </el-table-column> @@ -62,13 +68,19 @@ <MyViewLaw v-if="mystatus === 1" :info="info"></MyViewLaw> <MyViewSoil v-else :info="info"></MyViewSoil> </el-dialog> + <!-- 缂栬緫 --> + <el-dialog :visible.sync="dialogEdit" width="60%" title="缂栬緫杞﹁締淇℃伅" + v-if="dialogEdit" :before-close="handleClose"> + <MyEditLaw v-if="mystatus === 1" @closeDialog="closeDialog" :info="info"></MyEditLaw> + <MyEditSoil v-else @closeDialog="closeDialog" :info="info"></MyEditSoil> + </el-dialog> <!-- tools --> <div class="tools"> <div class="funs"> - <div class="funsItem"> + <div class="funsItem funs-sp"> <el-checkbox v-model="all" @change="selectAll()">鍏ㄩ��</el-checkbox> </div> - <div class="funsItem"> + <div class="funsItem funs-sp"> <el-checkbox v-model="unsame" @change="disSame(tableData)">鍙嶉��</el-checkbox> </div> <div class="funsItem"> @@ -95,10 +107,12 @@ import MySoil from './create/soil' import MyViewLaw from './update/law' import MyViewSoil from './update/soil' +import MyEditLaw from './edit/law' +import MyEditSoil from './edit/soil' export default { components: { Mycreate,MySoil,MyViewLaw, - MyViewSoil + MyViewSoil,MyEditLaw,MyEditSoil }, data() { return { @@ -106,6 +120,7 @@ context: "", dialogAdd:false, dialogView:false, + dialogEdit:false, info: '', totalNum: null, pageSize: 10, @@ -113,7 +128,6 @@ all: false, unsame: false, myIdx: 0, - preMyIdx:0, options: [ { value: 0, @@ -152,16 +166,21 @@ } }, created() { - this.getUserList(); + this.getCarList(); }, methods: { + // 缂栬緫杞﹁締 + handleEdit(data){ + this.dialogEdit = true + this.info = data; + }, // 鎼滅储杞﹁締 handleSearch(val){ if(this.timer){ clearTimeout(this.timer); } this.timer = setTimeout(()=>{ - this.getUserList(); + this.getCarList(); },1000); }, // 娣诲姞杞﹁締 @@ -191,29 +210,28 @@ }) }, // 鍒犻櫎鍗曟潯鏁版嵁 - handleDelete({ number }) { - console.log(number); + handleDelete({id}) { this.$confirm('纭鍒犻櫎锛�') .then(_ => { - console.log(1); + const {mystatus} = this + let myurl = mystatus === 1 ? 'deletion_enforce':'deletion_slag' this.$axios({ method: 'delete', - url: `sccg/violations/delete?id=${number}`, + url: `/sccg/car_Manage/${myurl}?id=${id}`, }) .then(res => { - console.log(res); this.$message({ type: res.code === 200 ? 'success' : 'warning', message: res.message }) - this.getUserList(); + this.getCarList(); }) }) - .catch(_ => { console.log(2) }); + .catch(_ => { }); }, - // 鑾峰彇鐢ㄦ埛鍒楄〃 - async getUserList() { + // 鑾峰彇杞﹁締鍒楄〃 + async getCarList() { const { currentPage, pageSize, context, mystatus } = this; let arr =[]; if(mystatus===1){ @@ -221,7 +239,6 @@ }else{ arr = await this.getSoilCarList(currentPage, pageSize, context) } - console.log(arr); this.tableData = arr.records; this.totalNum = arr.total; }, @@ -233,7 +250,6 @@ url:`sccg/car_Manage/query_enforce?current=${currentPage}&size=${pageSize}&carNum=${carNum}`, }) .then(res=>{ - console.log(res); arr = res.data; }) return arr; @@ -260,7 +276,7 @@ } }) this.mystatus = idx + 1; - this.getUserList(); + this.getCarList(); }, // 璁剧疆琛ㄦ牸鏂戦┈绾� tableRowClassName({ row, rowIndex }) { @@ -274,17 +290,17 @@ // 褰撳墠椤垫敼鍙樿Е鍙戜簨浠� changeCurrentPage(page) { this.currentPage = page; - this.getUserList(); + this.getCarList(); }, // 涓婁竴椤电偣鍑讳簨浠� handlePrev(page) { this.currentPage = page; - this.getUserList(); + this.getCarList(); }, // 涓嬩竴椤电偣鍑讳簨浠� handleNext(page) { this.currentPage = page; - this.getUserList(); + this.getCarList(); }, handleClose(done) { this.$confirm('纭鍏抽棴锛�') @@ -302,13 +318,13 @@ opernDialog(data){ this.dialogAdd = true; this.caseId = data.id; - // console.log(data); }, // 鍏抽棴鐣岄潰 closeDialog({flag,index}){ this.dialogAdd = flag; + this.dialogEdit = flag if(index===1){ - this.getUserList(); + this.getCarList(); } }, handleView(data){ @@ -418,12 +434,13 @@ .funs { display: flex; - + .funs-sp{ + border: 1px solid #17324c; + } .funsItem { line-height: 28px; display: flex; align-items: center; - border: 1px solid #17324c; border-radius: 4px; font-size: 12px; margin-left: 10px; -- Gitblit v1.8.0