From f0341c48295cfc2b7a8aa0f0f0942b22e1152019 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期五, 25 十一月 2022 16:01:40 +0800
Subject: [PATCH] 卡口管理

---
 src/views/operate/car/myIndex/index.vue |  128 ++++++++++++++++++++++++++++--------------
 1 files changed, 86 insertions(+), 42 deletions(-)

diff --git a/src/views/operate/car/myIndex/index.vue b/src/views/operate/car/myIndex/index.vue
index 5bd43a7..769a0da 100644
--- a/src/views/operate/car/myIndex/index.vue
+++ b/src/views/operate/car/myIndex/index.vue
@@ -5,7 +5,11 @@
                 <div class="search">
                     <span>杞﹁締鎼滅储:</span>
                     <div class="option">
-                        <el-input 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">
@@ -26,32 +30,28 @@
                     @selection-change="tableChange">
                     <el-table-column type="selection" min-width="5">
                     </el-table-column>
-                    <el-table-column prop="code" label="杞︾墝鍙�" min-width="10">
-                        <template slot-scope="scope">
-                            <el-link @click="JumpView(scope.row)">{{scope.row.code}}</el-link>
-                        </template>
+                    <el-table-column prop="carNumber" label="杞︾墝鍙�" min-width="10">
                     </el-table-column>
-                    <el-table-column prop="code" label="杞﹀瀷" min-width="10" v-if="mystatus===2">
+                    <el-table-column prop="carModel" label="杞﹀瀷" min-width="10" v-if="mystatus===2">
                     </el-table-column>
-                    <el-table-column prop="eventSource" label="杞︿富濮撳悕" min-width="10">
-                        <template slot-scope="scope">
-                            <span>{{scope.row.eventSource === 2 ? '浜哄伐涓婃姤' : '瑙嗛涓婁紶'}}</span>
-                        </template>
+                    <el-table-column :prop="mystatus ===1 ? 'ownerName':'carOwner'" label="杞︿富濮撳悕" min-width="10">
                     </el-table-column>
-                    <el-table-column prop="category" 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="type" label="鑱旂郴鏂瑰紡" min-width="10">
+                    <el-table-column :prop="mystatus ===1 ? 'contact' : 'phone' " label="鑱旂郴鏂瑰紡" min-width="10">
                     </el-table-column>
-                    <el-table-column prop="actionCause" :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="site" :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="handleReset(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>
@@ -60,14 +60,27 @@
                 <el-dialog :visible.sync="dialogAdd" width="60%" title="鏂板杞﹁締"
                     v-if="dialogAdd" :before-close="handleClose">
                     <Mycreate v-if="mystatus === 1"  @closeDialog="closeDialog"></Mycreate>
+                    <MySoil v-else @closeDialog="closeDialog"></MySoil>
+                </el-dialog>
+                <!-- 鏌ョ湅 -->
+                <el-dialog :visible.sync="dialogView" width="60%" title="鏌ョ湅杞﹁締淇℃伅"
+                    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">
                     <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">
@@ -90,24 +103,31 @@
     </div>
 </template>
 <script>
-import Mycreate from './createUser'
+import Mycreate from './create/law'
+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
+        Mycreate,MySoil,MyViewLaw,
+        MyViewSoil,MyEditLaw,MyEditSoil
     },
     data() {
         return {
             tableData: [],
             context: "",
             dialogAdd:false,
-            info: {},
+            dialogView:false,
+            dialogEdit:false,
+            info: '',
             totalNum: null,
             pageSize: 10,
             currentPage: 1,
             all: false,
             unsame: false,
             myIdx: 0,
-            preMyIdx:0,
             options: [
                 {
                     value: 0,
@@ -142,12 +162,27 @@
             ],
             mystatus:1,
             caseId:'',
+            timer:null,
         }
     },
     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.getCarList();
+            },1000);
+        },
         // 娣诲姞杞﹁締
         handleAddCar(){
             this.dialogAdd = true;
@@ -175,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){
@@ -205,7 +239,6 @@
             }else{
                 arr = await this.getSoilCarList(currentPage, pageSize, context)
             }
-            console.log(arr);
             this.tableData = arr.records;
             this.totalNum = arr.total;
         },
@@ -243,7 +276,7 @@
                 }
             })
             this.mystatus = idx + 1;
-            this.getUserList();
+            this.getCarList();
         },
         // 璁剧疆琛ㄦ牸鏂戦┈绾�
         tableRowClassName({ row, rowIndex }) {
@@ -257,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('纭鍏抽棴锛�')
@@ -279,14 +312,24 @@
         async JumpView(data){
             await this.getEventInfo(data.code);
         },
+        handleNoClose(done){
+            done();
+        },
         opernDialog(data){
             this.dialogAdd = true;
             this.caseId = data.id;
-            // console.log(data); 
         },
-        // 鍏抽棴涓婁紶鐣岄潰
-        closeDialog({flag}){
+        // 鍏抽棴鐣岄潰
+        closeDialog({flag,index}){
             this.dialogAdd = flag;
+            this.dialogEdit = flag
+            if(index===1){
+                this.getCarList();
+            }
+        },
+        handleView(data){
+            this.info = data;
+            this.dialogView = true;
         }
     }
 }
@@ -391,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