| | |
| | | <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> |
| | |
| | | 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"> |
| | |
| | | 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 { |
| | |
| | | context: "", |
| | | dialogAdd:false, |
| | | dialogView:false, |
| | | dialogEdit:false, |
| | | info: '', |
| | | totalNum: null, |
| | | pageSize: 10, |
| | |
| | | all: false, |
| | | unsame: false, |
| | | myIdx: 0, |
| | | preMyIdx:0, |
| | | options: [ |
| | | { |
| | | value: 0, |
| | |
| | | } |
| | | }, |
| | | 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); |
| | | }, |
| | | // 添加车辆 |
| | |
| | | }) |
| | | }, |
| | | // 删除单条数据 |
| | | 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); |
| | |
| | | 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){ |
| | |
| | | }else{ |
| | | arr = await this.getSoilCarList(currentPage, pageSize, context) |
| | | } |
| | | console.log(arr); |
| | | this.tableData = arr.records; |
| | | this.totalNum = arr.total; |
| | | }, |
| | |
| | | } |
| | | }) |
| | | this.mystatus = idx + 1; |
| | | this.getUserList(); |
| | | this.getCarList(); |
| | | }, |
| | | // 设置表格斑马纹 |
| | | tableRowClassName({ row, rowIndex }) { |
| | |
| | | // 当前页改变触发事件 |
| | | 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('确认关闭?') |
| | |
| | | // 关闭界面 |
| | | closeDialog({flag,index}){ |
| | | this.dialogAdd = flag; |
| | | this.dialogEdit = flag |
| | | if(index===1){ |
| | | this.getUserList(); |
| | | this.getCarList(); |
| | | } |
| | | }, |
| | | handleView(data){ |