jiangping
2024-02-29 6b6f00cae647a1dae999a4a1a3b87512f16c76f6
admin/src/views/business/internalCompany.vue
@@ -18,7 +18,7 @@
        <template v-slot:table-wrap>
            <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']" @click="synchronous()">同步</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,6 +26,7 @@
                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>-->
@@ -54,6 +55,7 @@
import TableLayout from '@/layouts/TableLayout'
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
      },
@@ -95,9 +98,22 @@
    },
    // 同步信息
    async synchronous () {
      const message = await companySync({})
      this.$message.success(message)
      this.search()
      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(() => {})
    }
  }
}