From 2ae60f81bbef5b2de4a9cc3e90bbedf19e8e4446 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 07 三月 2024 10:24:00 +0800
Subject: [PATCH] mrshi

---
 admin/src/views/business/internalCompany.vue |   58 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 37 insertions(+), 21 deletions(-)

diff --git a/admin/src/views/business/internalCompany.vue b/admin/src/views/business/internalCompany.vue
index e486966..5a065a8 100644
--- a/admin/src/views/business/internalCompany.vue
+++ b/admin/src/views/business/internalCompany.vue
@@ -16,9 +16,9 @@
 <!--        </el-form>-->
         <!-- 琛ㄦ牸鍜屽垎椤� -->
         <template v-slot:table-wrap>
-            <ul class="toolbar" v-permissions="['business:company:create', 'business:company:delete']">
-<!--                <li><el-button type="primary" v-permissions="['business:company:create']" @click="synchronous()">鍚屾</el-button></li>-->
-                <li><el-button type="primary" v-permissions="['business:company:create']" @click="$refs.OperaInternalCompanyWindow.open('鏂板缓浼佷笟')">鏂板缓</el-button></li>
+            <ul class="toolbar" v-permissions="['business:company:create', 'business:company:sync']">
+<!--                <li><el-button type="primary" v-permissions="['business:company:create']" @click="$refs.OperaInternalCompanyWindow.open('鏂板缓浼佷笟')">鏂板缓</el-button></li>-->
+                <li><el-button type="primary"  v-permissions="['business:company:sync']" :loading="loading" @click="synchronous()">鍚屾</el-button></li>
             </ul>
             <el-table
                 v-loading="isWorking.search"
@@ -26,22 +26,23 @@
                 stripe
                 :tree-props="{children: 'childList'}"
                 row-key="id"
+                :expand-row-keys="[list && list.length > 0 ? list[0].id.toString() : '']"
                 @selection-change="handleSelectionChange"
             >
 <!--                <el-table-column type="selection" width="55"></el-table-column>-->
                 <el-table-column prop="name" label="缁勭粐鍚嶇О" min-width="100px"></el-table-column>
                 <el-table-column prop="editDate" label="鏈�鍚庢洿鏂版椂闂�" min-width="100px"></el-table-column>
-                <el-table-column
-                    label="鎿嶄綔"
-                    width="230"
-                    fixed="right"
-                >
-                    <template slot-scope="{row}">
-                        <el-button type="text" @click="$refs.OperaInternalCompanyWindow.open('缂栬緫浼佷笟淇℃伅', row)" icon="el-icon-edit" v-permissions="['business:company:update']">缂栬緫</el-button>
-                        <el-button type="text" @click="$refs.OperaInternalCompanyWindow.open('鏂板缓瀛愮骇', { disable: true, parentId: row.id })" icon="el-icon-plus">鏂板缓瀛愮骇</el-button>
-                        <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:company:delete']">鍒犻櫎</el-button>
-                    </template>
-                </el-table-column>
+<!--                <el-table-column-->
+<!--                    label="鎿嶄綔"-->
+<!--                    width="230"-->
+<!--                    fixed="right"-->
+<!--                >-->
+<!--                    <template slot-scope="{row}">-->
+<!--                        <el-button type="text" @click="$refs.OperaInternalCompanyWindow.open('缂栬緫浼佷笟淇℃伅', row)" icon="el-icon-edit" v-permissions="['business:company:update']">缂栬緫</el-button>-->
+<!--                        <el-button type="text" @click="$refs.OperaInternalCompanyWindow.open('鏂板缓瀛愮骇', { disable: true, parentId: row.id })" icon="el-icon-plus">鏂板缓瀛愮骇</el-button>-->
+<!--                        <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:company:delete']">鍒犻櫎</el-button>-->
+<!--                    </template>-->
+<!--                </el-table-column>-->
             </el-table>
         </template>
         <!-- 鏂板缓/淇敼 -->
@@ -52,8 +53,9 @@
 <script>
 import BaseTable from '@/components/base/BaseTable'
 import TableLayout from '@/layouts/TableLayout'
-// import { companySync } from '@/api/business/company'
+import { companySync } from '@/api/business/company'
 import OperaInternalCompanyWindow from '@/components/business/OperaInternalCompanyWindow'
+import { memberSync } from '@/api/business/member'
 export default {
   name: 'internalCompany',
   extends: BaseTable,
@@ -61,6 +63,7 @@
   data () {
     return {
       // 鎼滅储
+      loading:false,
       searchForm: {
         type: 1
       },
@@ -92,13 +95,26 @@
         .finally(() => {
           this.isWorking.search = false
         })
-    }
+    },
     // 鍚屾淇℃伅
-    // async synchronous () {
-    //   const message = await companySync({})
-    //   this.$message.success(message)
-    //   this.search()
-    // }
+    async synchronous () {
+      this.$dialog.actionConfirm('鎿嶄綔纭鎻愰啋', '鎮ㄧ‘璁ゅ悓姝ュ叏閮ㄤ俊鎭悧锛�')
+        .then(() => {
+          this.loading = true
+          companySync({})
+            .then(res => {
+              this.$tip.apiSuccess(res || '鍚屾鎴愬姛')
+              this.search()
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.loading = false
+            })
+        })
+        .catch(() => {})
+    }
   }
 }
 </script>

--
Gitblit v1.9.3