From 0411eeb918e0e09aa15cbefd0f9179932375757b Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 13 五月 2024 17:18:57 +0800
Subject: [PATCH] 最新版本

---
 admin/src/views/business/internalMember.vue |  142 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 119 insertions(+), 23 deletions(-)

diff --git a/admin/src/views/business/internalMember.vue b/admin/src/views/business/internalMember.vue
index 19184f5..0777433 100644
--- a/admin/src/views/business/internalMember.vue
+++ b/admin/src/views/business/internalMember.vue
@@ -31,6 +31,9 @@
                     <el-option label="鍚屾澶辫触" value="2"></el-option>
                 </el-select>
             </el-form-item>
+          <el-form-item label=""  >
+              <el-checkbox style="font-size: 12px"  label="1" v-model="searchForm.includeChild" key="1"  >鏄惁鍖呭惈涓嬬骇缁勭粐</el-checkbox>
+          </el-form-item>
             <section>
                 <el-button type="primary" @click="search">鎼滅储</el-button>
                 <el-button @click="reset">閲嶇疆</el-button>
@@ -76,7 +79,36 @@
                         <span v-if="row.status == 2" style="color: red">鎷夐粦/鍐荤粨</span>
                     </template>
                 </el-table-column>
-                <el-table-column prop="code" label="宸ュ彿" min-width="100px"></el-table-column>
+              <el-table-column label="閮ㄩ棬绫诲瀷" min-width="100px">
+                <template slot-scope="{row}">
+                  <span v-if="row.companyType == 0">鐩稿叧鏂圭粍缁�</span>
+                  <span v-if="row.companyType == 1">鍐呴儴缁勭粐</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="鍦ㄨ亴鐘舵��">
+              <template slot-scope="{row}">
+                <el-switch
+                    @change="changeWorkStatus($event, row)"
+                    v-model="row.workStatus"
+                    active-color="#13ce66"
+                    inactive-color="#ff4949"
+                    :active-value="0"
+                    :inactive-value="1">
+                </el-switch>
+              </template>
+            </el-table-column>
+              <el-table-column label="鏄惁鍙嫓璁�">
+                <template slot-scope="{row}">
+                  <el-switch
+                      @change="changeCanvisit($event, row)"
+                      v-model="row.canVisit"
+                      active-color="#13ce66"
+                      inactive-color="#ff4949"
+                      :active-value="1"
+                      :inactive-value="0">
+                  </el-switch>
+                </template>
+              </el-table-column>
                 <el-table-column label="鍙嫓璁�" min-width="100px">
                     <template slot-scope="{row}">
                         <span v-if="row.canVisit != 1">鍚�</span>
@@ -91,11 +123,25 @@
                         <span v-if="row.hkStatus == 3" style="color: red">涓嶇鍚堜笅鍙戞潯浠�</span>
                 </template>
                 </el-table-column>
+                <el-table-column label="鏄惁鎺堟潈" min-width="100px">
+                  <template slot-scope="{row}">
+                    <span v-if="row.authStatus == 1" style="color: green">鏄�</span>
+                    <span v-if="row.authStatus == 0" style="color: red">鍚�</span>
+                  </template>
+                </el-table-column>
                 <el-table-column label="闂ㄧ瑙掕壊" min-width="100px">
                     <template slot-scope="{row}">
-                        <span>{{row.roleNames.join(',')}}</span>
+                        <span>{{(row.roleNames && row.roleNames.length) ?row.roleNames.join(','): '-'}}</span>
                     </template>
                 </el-table-column>
+              <el-table-column prop="code" label="宸ュ彿" min-width="100px"></el-table-column>
+              <el-table-column label="鍗$墖" min-width="80px">
+                <template slot-scope="{row}">
+                  <el-button @click="$refs.cardOpeningRecord.open('寮�鍗¤褰�', row.id)" type="text">{{row.memberCardCount || '0'}}</el-button>
+                </template>
+              </el-table-column>
+              <el-table-column prop="editorName" label="鎿嶄綔浜�" min-width="100px"></el-table-column>
+              <el-table-column prop="editDate" label="鏈�鍚庢搷浣滄椂闂�" min-width="150px"></el-table-column>
                 <el-table-column fixed="right" label="浜鸿劯淇℃伅" min-width="100px">
                     <template slot-scope="{row}">
                         <el-image
@@ -106,21 +152,18 @@
                         </el-image>
                     </template>
                 </el-table-column>
-                <el-table-column fixed="right" label="鍗$墖淇℃伅" min-width="100px">
-                    <template slot-scope="{row}">
-                        <el-button @click="$refs.cardOpeningRecord.open('寮�鍗¤褰�', row.id)" type="text">{{row.memberCardCount || '0'}}</el-button>
-                    </template>
-                </el-table-column>
                 <el-table-column
                     v-if="containPermissions(['business:member:update', 'business:member:delete','business:empower:create'])"
                     label="鎿嶄綔"
-                    min-width="120"
+                    min-width="280"
                     fixed="right"
                 >
                     <template slot-scope="{row}">
                         <el-button type="text" icon="el-icon-edit" @click="$refs.OperaMemberWindow.open('缂栬緫鍛樺伐淇℃伅',row,department)" v-permissions="['business:empower:update']">缂栬緫</el-button>
-                        <el-button type="text" icon="el-icon-delete" @click="empower(row.id)" v-permissions="['business:empower:delete']">鍒犻櫎</el-button>
+                        <el-button type="text" :loading="heading" icon="el-icon-delete" @click="updateHead(row,0)" v-if="row.headStatus ==1 " v-permissions="['business:member:head']">鍙栨秷涓荤</el-button>
+                        <el-button type="text" :loading="heading"  icon="el-icon-edit" @click="updateHead(row,1)"  v-if="row.headStatus  == 0"  v-permissions="['business:member:head']">璁句负涓荤</el-button>
                         <el-button type="text"  icon="el-icon-plus" @click="empower(row.id)" v-permissions="['business:empower:create']">閲嶆柊鎺堟潈</el-button>
+                        <el-button  type="text"  icon="el-icon-delete" @click="empower(row.id)" v-permissions="['business:empower:delete']">鍒犻櫎</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -145,11 +188,11 @@
 import Tree from '@/components/common/Tree'
 import OperaMemberWindow from '@/components/business/OperaMemberWindow'
 import { fetchList } from '@/api/business/company'
-import { memberSync, roleAuth } from '@/api/business/member'
+import { memberSync, roleAuth, updateCanVisit, updateHead, updateWorkStatus } from '@/api/business/member'
 export default {
   name: 'internalMember',
   extends: BaseTable,
-  components: { TableLayout1, Pagination, Tree, cardOpeningRecord,OperaMemberWindow },
+  components: { TableLayout1, Pagination, Tree, cardOpeningRecord, OperaMemberWindow },
   data () {
     return {
       TreeList: [],
@@ -158,6 +201,7 @@
         name: '',
         status: '',
         hkStatus: '',
+        includeChild: false,
         canVisit: '',
         keyword: '',
         type: 2,
@@ -165,9 +209,12 @@
         companyId: '',
         hasFace: ''
       },
-      loading:false,
+      loading: false,
+      heading: false,
+      working: false,
+      canvisiting: false,
       companyTree: [],
-      department:[]
+      department: []
     }
   },
   created () {
@@ -181,7 +228,7 @@
     this.getfindCompanyTreePage()
   },
   methods: {
-    empower(id) {
+    empower (id) {
       var that = this
       this.$confirm('纭畾閲嶆柊鎺堟潈鍚�?', '鎻愮ず', {
         confirmButtonText: '纭畾',
@@ -190,11 +237,12 @@
       }).then(() => {
         roleAuth(id)
           .then(res => {
+            this.$tip.apiSuccess(res || '鎿嶄綔鎴愬姛')
             that.search()
           })
       }).catch(() => {
-
-      });
+        this.$tip.apiSuccess(  '鎿嶄綔澶辫触')
+      })
     },
     // 鑾峰彇缁勭粐鏍�
     getfindCompanyTreePage () {
@@ -209,22 +257,22 @@
           }
         })
     },
-    getDepartmentTree(tree) {
-      if(tree ==null){
+    getDepartmentTree (tree) {
+      if (tree == null) {
         return []
       }
       return tree.map(item => {
-        let newItem = {...item}
-        if(newItem){
-          newItem.children=newItem.childList
+        const newItem = { ...item }
+        if (newItem) {
+          newItem.children = newItem.childList
         }
         if (item.children && item.children.length == 0) {
-          this.$delete( newItem, 'children' )
+          this.$delete(newItem, 'children')
         } else {
           newItem.children = this.getDepartmentTree(newItem.children)
         }
         return newItem
-      });
+      })
     },
     // 鍚屾淇℃伅
     async synchronous () {
@@ -245,6 +293,54 @@
         })
         .catch(() => {})
     },
+    async updateHead (row, type) {
+      this.$dialog.actionConfirm('鎮ㄧ‘璁よ繘琛屽綋鍓嶆搷浣滃悧锛�', '閮ㄩ棬涓荤璁剧疆鎿嶄綔鎻愮ず')
+          .then(() => {
+        this.heading = true
+        updateHead({ id: row.id, headStatus: type })
+          .then(res => {
+            this.$tip.apiSuccess(res || '鎿嶄綔鎴愬姛')
+            this.search()
+          })
+          .catch(e => {
+            this.$tip.apiFailed(e)
+          })
+          .finally(() => {
+            this.heading = false
+          })
+          .catch(() => {})
+          })
+    },
+    changeWorkStatus (e, row) {
+      this.working = true
+      updateWorkStatus({ id: row.id, workStatus: e })
+        .then(res => {
+          this.$tip.apiSuccess(res || '鎿嶄綔鎴愬姛')
+          this.search()
+        })
+        .catch(e => {
+          this.$tip.apiFailed(e)
+        })
+        .finally(() => {
+          this.working = false
+        })
+        .catch(() => {})
+    },
+     changeCanvisit (e, row) {
+      this.canvisiting = true
+      updateCanVisit({ id: row.id, canVisit: e })
+        .then(res => {
+          this.$tip.apiSuccess(res || '鎿嶄綔鎴愬姛')
+          this.search()
+        })
+        .catch(e => {
+          this.$tip.apiFailed(e)
+        })
+        .finally(() => {
+          this.canvisiting = false
+        })
+        .catch(() => {})
+    },
     callback (row) {
       this.searchForm.erpOrgId = row.erpId
       this.searchForm.companyId = row.id

--
Gitblit v1.9.3