From 7c20fd15b7fbc2bd5756b39d5ab655cc849ffcc3 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 16 七月 2025 22:39:23 +0800
Subject: [PATCH] 添加时间筛选

---
 src/views/operate/baseSetting/violation/createUser/index.vue |  122 +++++++++++++++++++++++-----------------
 1 files changed, 70 insertions(+), 52 deletions(-)

diff --git a/src/views/operate/baseSetting/violation/createUser/index.vue b/src/views/operate/baseSetting/violation/createUser/index.vue
index 01669a3..218a29d 100644
--- a/src/views/operate/baseSetting/violation/createUser/index.vue
+++ b/src/views/operate/baseSetting/violation/createUser/index.vue
@@ -18,13 +18,16 @@
                     </el-form-item>
                     <!-- 鐖剁骇id -->
                     <el-form-item class="optionItem" label="鐖剁骇:" prop="parentId">
-                        <el-select v-model="things.parentId" placeholder="璇烽�夋嫨鎵�灞炵被鍨�" :disabled="things.level===1">
-                            <!-- <el-option v-for="item in parentList" :key="item.id" :label="item.name" :value="item.id"
-                                v-if="things.level===1">
-                            </el-option> -->
+                        <el-select  ref="projectApplicant" v-model="things.parentId" placeholder="璇烽�夋嫨鎵�灞炵被鍨�" :disabled="things.level===1">
                             <el-option :value="mylabel">
-                                <el-tree ref="tree" :check-strictly="true"  :data="parentList" :props="defaultProps" show-checkbox
-                                    @check-change="handleCheck" default-expand-all node-key="id">
+                                <el-tree ref="tree"
+                                         :check-strictly="true"
+                                         :data="parentList"
+                                         :props="defaultProps"
+                                         @node-click="handleCheck"
+                                         @check-change="handleCheck"
+                                         default-expand-all
+                                         node-key="id">
                                 </el-tree>
                             </el-option>
                         </el-select>
@@ -87,7 +90,7 @@
             },
             levelList: [
                 {
-                    label: "杩濊涓被鍨�",
+                    label: "杩濊绫诲瀷",
                     value: 1,
                 },
                 {
@@ -109,7 +112,12 @@
             },
             defaultProps: {
                 children: 'children',
-                label: 'name'
+                label: 'name',
+                disabled:(data,node)=>{
+                    if (data.level<this.things.level-1) {
+                        return !data.leaf
+                    }
+                }
             },
             mylabel:''
         }
@@ -163,7 +171,6 @@
                 url: 'sccg/violations/query/type_four'
             })
                 .then(res => {
-                    console.log(res);
                     this.parentList = res.data;
                 })
         },
@@ -189,7 +196,6 @@
                         }
                     })
                         .then(res => {
-                            console.log(res);
                             if (res.code === 200) {
                                 this.$message({
                                     type: 'success',
@@ -210,6 +216,7 @@
         },
         // 妗堜欢绾у埆鍙樺寲
         async resetParentList(index) {
+            this.things.parentId=''
             this.selectOrg.orgsid = [];
             if (index === 1) {
                 // this.getTypeThird();
@@ -220,7 +227,7 @@
                     item.children = [];
                 })
             } else if (index === 3) {
-            
+
                 this.parentList = this.addChildren(await this.getTypeThird(), await this.getTypeSecond());
                 console.log(this.parentList);
             } else {
@@ -242,32 +249,43 @@
             return parentArr;
         },
         handleCheck(data, checked) {
+            console.log(this.selectOrg.orgsid,data,checked);
+          //鍙兘鐐瑰嚮鏈�鍚庝竴绾�
+          if(checked.childNodes.length == 0){
             this.things.parentId = data.name;
-            console.log(this.selectOrg.orgsid);
-            // 鑾峰彇褰撳墠閫夋嫨鐨刬d鍦ㄦ暟缁勪腑鐨勭储寮�
-            const indexs = this.selectOrg.orgsid.indexOf(data.id)
-            // 濡傛灉涓嶅瓨鍦ㄦ暟缁勪腑锛屽苟涓旀暟缁勪腑宸茬粡鏈変竴涓猧d骞朵笖checked涓簍rue鐨勬椂鍊欙紝浠h〃涓嶈兘鍐嶆閫夋嫨銆�
-            if (indexs < 0 && this.selectOrg.orgsid.length === 1 && checked) {
-                this.$message({
-                    message: '鍙兘閫夋嫨涓�涓尯鍩燂紒',
-                    type: 'error',
-                    showClose: true
-                })
-                // 璁剧疆宸查�夋嫨鐨勮妭鐐逛负false 寰堥噸瑕�
-                this.$refs.tree.setChecked(data, false)
-            } else if (this.selectOrg.orgsid.length === 0 && checked) {
-                // 鍙戠幇鏁扮粍涓虹┖ 骞朵笖鏄凡閫夋嫨
-                // 闃叉鏁扮粍鏈夊�硷紝棣栧厛娓呯┖锛屽啀push
-                this.selectOrg.orgsid = []
-                this.selectOrg.orgsid.push(data.id)
-            } else if (
-                indexs >= 0 &&
-                this.selectOrg.orgsid.length === 1 &&
-                !checked
-            ) {
-                // 鍐嶆鐩存帴杩涜璧嬪�间负绌烘搷浣�
-                this.selectOrg.orgsid = []
-            }
+            let _this = this;
+            _this.$refs.projectApplicant.blur();
+            this.selectOrg.orgsid = []
+            this.selectOrg.orgsid.push(data.id)
+          }else {
+            return
+          }
+            // // 鑾峰彇褰撳墠閫夋嫨鐨刬d鍦ㄦ暟缁勪腑鐨勭储寮�
+            // const indexs = this.selectOrg.orgsid.indexOf(data.id)
+            // // 濡傛灉涓嶅瓨鍦ㄦ暟缁勪腑锛屽苟涓旀暟缁勪腑宸茬粡鏈変竴涓猧d骞朵笖checked涓簍rue鐨勬椂鍊欙紝浠h〃涓嶈兘鍐嶆閫夋嫨銆�
+            // if (indexs < 0 && this.selectOrg.orgsid.length === 1 && checked) {
+            //     this.$message({
+            //         message: '鍙兘閫夋嫨涓�涓尯鍩燂紒',
+            //         type: 'error',
+            //         showClose: true
+            //     })
+            //     // 璁剧疆宸查�夋嫨鐨勮妭鐐逛负false 寰堥噸瑕�
+            //     this.$refs.tree.setChecked(data, false)
+            // } else if (this.selectOrg.orgsid.length === 0 && checked) {
+            //     // 鍙戠幇鏁扮粍涓虹┖ 骞朵笖鏄凡閫夋嫨
+            //     // 闃叉鏁扮粍鏈夊�硷紝棣栧厛娓呯┖锛屽啀push
+            //     let _this = this;
+            //     _this.$refs.projectApplicant.blur();
+            //     this.selectOrg.orgsid = []
+            //     this.selectOrg.orgsid.push(data.id)
+            // } else if (
+            //     indexs >= 0 &&
+            //     this.selectOrg.orgsid.length === 1 &&
+            //     !checked
+            // ) {
+            //     // 鍐嶆鐩存帴杩涜璧嬪�间负绌烘搷浣�
+            //     this.selectOrg.orgsid = []
+            // }
         },
     },
     props: ['changeDialog']
@@ -276,13 +294,13 @@
 <style lang="scss" scoped>
 .createUser {
     border-radius: 1px;
-    background-color: #09152f;
+    background-color: #fff;
 
     main {
         // border: 1px solid #fff;
         text-align: left;
         padding: 0 55px;
-        background-color: #09152f;
+        background-color: #fff;
         padding-bottom: 50px;
 
         .mainContent {
@@ -323,20 +341,20 @@
         }
     }
 
-    &::v-deep .el-textarea__inner {
-        background-color: #09152f;
-        border: 1px solid #17324c;
-        font-size: 10px;
-    }
+    // &::v-deep .el-textarea__inner {
+    //     // background-color: #09152f;
+    //     border: 1px solid #17324c;
+    //     font-size: 10px;
+    // }
 
-    ::v-deep .el-form-item__label {
-        color: #4b9bb7;
-    }
+    // ::v-deep .el-form-item__label {
+    //     color: #4b9bb7;
+    // }
 
-    ::v-deep .el-input__inner {
-        background-color: #09152f;
-        border: 1px solid #17324c;
-        font-size: 10px;
-    }
+    // ::v-deep .el-input__inner {
+    //     // background-color: #09152f;
+    //     border: 1px solid #17324c;
+    //     font-size: 10px;
+    // }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0