From c46189c4f6749602c71eb7cb5bab89823fe9b1e1 Mon Sep 17 00:00:00 2001 From: “dzb” <2632970487@qq.com> Date: 星期五, 21 十月 2022 14:03:40 +0800 Subject: [PATCH] 修改车辆管理bug --- src/views/operate/car/myIndex/index.vue | 52 ++++++++++++++++++++++++++++++++++------------------ 1 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/views/operate/car/myIndex/index.vue b/src/views/operate/car/myIndex/index.vue index c3de32e..8ecdd43 100644 --- a/src/views/operate/car/myIndex/index.vue +++ b/src/views/operate/car/myIndex/index.vue @@ -45,7 +45,9 @@ <div class="btn"> <span @click="handleView(scope.row)">鏌ョ湅</span> <span class="line">|</span> - <span>鍒犻櫎</span> + <span @click="handleEdit(scope.row)">缂栬緫</span> + <span class="line">|</span> + <span @click="handleDelete(scope.row)">鍒犻櫎</span> </div> </template> </el-table-column> @@ -61,6 +63,12 @@ v-if="dialogView" :before-close="handleNoClose"> <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"> @@ -95,10 +103,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 +116,7 @@ context: "", dialogAdd:false, dialogView:false, + dialogEdit:false, info: '', totalNum: null, pageSize: 10, @@ -113,7 +124,6 @@ all: false, unsame: false, myIdx: 0, - preMyIdx:0, options: [ { value: 0, @@ -152,16 +162,22 @@ } }, created() { - this.getUserList(); + this.getCarList(); }, methods: { + // 缂栬緫杞﹁締 + handleEdit(data){ + console.log(data) + this.dialogEdit = true + this.info = data; + }, // 鎼滅储杞﹁締 handleSearch(val){ if(this.timer){ clearTimeout(this.timer); } this.timer = setTimeout(()=>{ - this.getUserList(); + this.getCarList(); },1000); }, // 娣诲姞杞﹁締 @@ -191,14 +207,14 @@ }) }, // 鍒犻櫎鍗曟潯鏁版嵁 - 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); @@ -207,13 +223,13 @@ message: res.message }) - this.getUserList(); + this.getCarList(); }) }) .catch(_ => { console.log(2) }); }, - // 鑾峰彇鐢ㄦ埛鍒楄〃 - async getUserList() { + // 鑾峰彇杞﹁締鍒楄〃 + async getCarList() { const { currentPage, pageSize, context, mystatus } = this; let arr =[]; if(mystatus===1){ @@ -221,7 +237,6 @@ }else{ arr = await this.getSoilCarList(currentPage, pageSize, context) } - console.log(arr); this.tableData = arr.records; this.totalNum = arr.total; }, @@ -260,7 +275,7 @@ } }) this.mystatus = idx + 1; - this.getUserList(); + this.getCarList(); }, // 璁剧疆琛ㄦ牸鏂戦┈绾� tableRowClassName({ row, rowIndex }) { @@ -274,17 +289,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('纭鍏抽棴锛�') @@ -306,8 +321,9 @@ // 鍏抽棴鐣岄潰 closeDialog({flag,index}){ this.dialogAdd = flag; + this.dialogEdit = flag if(index===1){ - this.getUserList(); + this.getCarList(); } }, handleView(data){ -- Gitblit v1.8.0