From 8ea9463705d26f07a279bab974769a5ceed43415 Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期一, 06 五月 2024 14:23:01 +0800
Subject: [PATCH] 最新版本

---
 admin/src/views/business/internalCompany.vue |   55 ++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/admin/src/views/business/internalCompany.vue b/admin/src/views/business/internalCompany.vue
index e486966..141cb20 100644
--- a/admin/src/views/business/internalCompany.vue
+++ b/admin/src/views/business/internalCompany.vue
@@ -16,9 +16,11 @@
 <!--        </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('鏂板缓浼佷笟',null,null)">鏂板缓</el-button></li>
+              <li><el-button @click="sort('top')" :loading="isWorking.sort" icon="el-icon-sort-up" v-permissions="['business:company:sort']">涓婄Щ</el-button></li>
+              <li><el-button @click="sort('bottom')" :loading="isWorking.sort" icon="el-icon-sort-down" v-permissions="['business:company:sort']">涓嬬Щ</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,19 +28,28 @@
                 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 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 prop="name" label="缁勭粐绫诲瀷" min-width="100px">
+                  <template scope="{row}">
+                      <span v-if="row.type == 0">鐩稿叧鏂圭粍缁�</span>
+                      <span v-if="row.type == 1">鍐呴儴缁勭粐</span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="companyPath" label="缁勭粐璺緞" min-width="100px"></el-table-column>
+              <el-table-column prop="editorName" 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="$refs.OperaInternalCompanyWindow.open('缂栬緫浼佷笟淇℃伅',{  id: row.parentId,name:row.parentName,companyPath:row.parentCompanyPath}, row)" icon="el-icon-edit" v-permissions="['business:company:update']">缂栬緫</el-button>
+                        <el-button type="text" @click="$refs.OperaInternalCompanyWindow.open('鏂板缓瀛愮骇',  row,null)" 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>
@@ -52,7 +63,7 @@
 <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'
 export default {
   name: 'internalCompany',
@@ -61,8 +72,9 @@
   data () {
     return {
       // 鎼滅储
+      loading:false,
       searchForm: {
-        type: 1
+        // type: 1
       },
       list: [],
       total: 0
@@ -92,13 +104,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