From 9c2dd43fb70b6cdeaba40aa0173d4ceb759cd46a Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 22 十一月 2023 16:57:46 +0800
Subject: [PATCH] 1.开报工放出  销售订单查询  条件

---
 src/views/basicSettings/userList.vue |   32 +++++++++++++++++++++++---------
 1 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/src/views/basicSettings/userList.vue b/src/views/basicSettings/userList.vue
index acb3481..2094b52 100644
--- a/src/views/basicSettings/userList.vue
+++ b/src/views/basicSettings/userList.vue
@@ -6,7 +6,7 @@
         <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
 
         <div style="display: flex">
-          <el-button v-waves icon="el-icon-menu" @click="workingTramClick">鐢熶骇鐝粍</el-button>
+          <!--          <el-button v-waves icon="el-icon-menu" @click="workingTramClick">鐢熶骇鐝粍</el-button>-->
           <el-button v-waves icon="el-icon-download" @click="upload">瀵煎叆</el-button>
         </div>
       </div>
@@ -323,7 +323,7 @@
                   />
                 </el-tooltip>
                 <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
-                  <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row.id)" />
+                  <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />
                 </el-tooltip>
               </div>
             </template>
@@ -973,6 +973,7 @@
       dialogVisibleRoles: false,
       dialogFormRoles: {
         stu_torgcode: '', // 鎵�灞炵粍缁�
+        description: '', // 鎵�灞炵粍缁囩被鍨�
         username: '', // 鐢ㄦ埛鍚嶇О
         usercode: '', // 鐢ㄦ埛缂栫爜
         rolesArr: [], // 瑙掕壊绫诲瀷闆嗗悎
@@ -1109,17 +1110,17 @@
       this.usergroupArr = res
     },
     // 鏂板鎸夐挳
-    add(operation) {
+    async add(operation) {
       this.operation = operation
       this.dialogVisible = true
 
       // this.dialogForm.StuOrg = getCookie('stu_torgcode')
       // this.$refs.dialogCascader.checkedValue = [getCookie('stu_torgcode')]
 
-      this.getUserOrganization2()
+      await this.getUserOrganization2()
 
       if (this.$store.state.settings.orgType !== '') {
-        this.getStorgGroupSelect(getCookie('stu_torgcode'), this.StuOrgArr2.find(i => i.code === getCookie('stu_torgcode')) ? 'D' : 'W')
+        await this.getStorgGroupSelect(getCookie('stu_torgcode'), this.StuOrgArr2.find(i => i.code === getCookie('stu_torgcode')) ? 'D' : 'W')
       }
     },
     // 淇敼鎸夐挳
@@ -1145,13 +1146,16 @@
       this.getUserOrganization2()
     },
     // 鍒犻櫎鎸夐挳
-    async del(id) {
+    async del(row) {
+      if (getCookie('admin') === row.usercode) {
+        return this.$message.info('鏃犳硶鍒犻櫎鐢ㄦ埛鏈韩锛�')
+      }
       this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then(() => {
-        DeleteUser({ Userid: id }).then(res => {
+        DeleteUser({ Userid: row.id }).then(res => {
           if (res.code === '200') {
             this.$message.success('鍒犻櫎鎴愬姛!')
             if (this.form.page > 1 && this.tableData.length === 1) {
@@ -1243,11 +1247,13 @@
 
       this.dialogFormRoles.rolesArrSelectedArr = []
       this.dialogFormRoles.rolesArr = []
+      this.dialogFormRoles.roleTree = []
       this.dialogFormRoles.roleTreeSelectedArr = []
 
       this.dialogFormRoles.username = row.username
       this.dialogFormRoles.usercode = row.usercode
       this.dialogFormRoles.stu_torgcode = row.stu_torgcode
+      this.dialogFormRoles.description = row.description
       UserAssociationRole({ usercode: row.usercode, stu_torgcode: row.stu_torgcode, description: row.description }).then(res => {
         if (res.code === '200') {
           setTimeout(() => {
@@ -1311,7 +1317,10 @@
     // 鐢ㄦ埛鍏宠仈瀵硅瘽妗嗙‘璁や簨浠�
     async rolesDialogVisibleConfirm() {
       this.$store.state.app.buttonIsDisabled = true
-      const res = await SaveUserAssoctRole(this.dialogFormRoles.roleTreeSelectedArr, this.dialogFormRoles.usercode, this.dialogFormRoles.stu_torgcode)
+      this.dialogFormRoles.roleTreeSelectedArr.forEach(i => {
+        i.Data = [...new Set(i.Data)]
+      })
+      const res = await SaveUserAssoctRole(this.dialogFormRoles.roleTreeSelectedArr, this.dialogFormRoles.usercode, this.dialogFormRoles.stu_torgcode, this.dialogFormRoles.description)
       if (res.code === '200') {
         this.dialogVisibleRoles = false
         this.$message.success('淇濆瓨鎴愬姛锛�')
@@ -1375,12 +1384,17 @@
               } else {
                 this.dialogFormRoles.roleTreeSelectedArr.forEach((i, ind) => { // 褰撻�夊瓙code鏃舵墽琛�
                   if (i.Code === checkedFatherCode) {
+                    let flag = true
                     this.dialogFormRoles.roleTreeSelectedArr[ind].Data.forEach((i1, ind2) => {
                       if (i1 === a[0]) {
                         // this.dialogFormRoles.roleTreeSelectedArr[ind].Data.splice(ind2, 1)// 褰撳瓙code涓庣幇鍦ㄧ殑code鐩稿悓鏃舵墽琛�
                         this.dialogFormRoles.roleTreeSelectedArr[ind].Data = this.dialogFormRoles.roleTreeSelectedArr[ind].Data.filter(i2 => i2 !== a[0])
+                        flag = false
                       } else {
-                        this.dialogFormRoles.roleTreeSelectedArr[ind].Data.push(a[0])// //褰撳瓙code涓庣幇鍦ㄧ殑code涓嶇浉鍚屾椂鎵ц
+                        if (flag) {
+                          console.log('鎵ц浜�')
+                          this.dialogFormRoles.roleTreeSelectedArr[ind].Data.push(a[0])// //褰撳瓙code涓庣幇鍦ㄧ殑code涓嶇浉鍚屾椂鎵ц
+                        }
                       }
                     })
                     // this.dialogFormRoles.roleTreeSelectedArr[ind].Data.filter((i1, ind2) => i1 !== a[0])// 杩囨护鎺夐�変腑鐩稿悓鐨�

--
Gitblit v1.9.3