doum
2025-12-30 46e8af542c02d801bea9fa8cf8f55974dcfa8554
admin/src/views/business/internalCompany.vue
@@ -23,36 +23,44 @@
            v-permissions="['business:company:sort']">上移</el-button></li>
        <li><el-button @click="sort('bottom')" :loading="sorting" 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>
<!--        <li><el-button type="primary" v-permissions="['business:company:sync']" :loading="loading"
            @click="synchronous()">同步</el-button></li>-->
        <li><el-button type="primary" v-permissions="['business:company:create']" :loading="loading"
            @click="synchronousDingding()">同步钉钉</el-button></li>
            @click="synchronous()">同步</el-button></li>
      </ul>
      <el-table :max-height="tableHeight" v-loading="isWorking.search" :data="list" stripe
        :tree-props="{ children: 'childList', hasChildren: 'hasChildren' }" row-key="id"
        @selection-change="handleSelectionChange" default-expand-all>
        <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="name" label="组织名称" min-width="200px"></el-table-column>
        <el-table-column prop="name" label="组织类型" min-width="80px">
          <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="companyNamePath" label="组织路径" min-width="100px"></el-table-column>
        <el-table-column label="海康同步状态" min-width="100px" align="center">
          <template slot-scope="{row}">
            <span v-if="row.hkStatus == 0" style="color: #435EBE">待同步</span>
            <span v-if="row.hkStatus == 1" style="color: green">同步成功</span>
            <span v-if="row.hkStatus == 2" style="color: red">同步失败</span>
            <span v-if="row.hkStatus == 3" style="color: red">不符合下发条件</span>
          </template>
        </el-table-column>
        <el-table-column prop="sortnum" align="center" label="排序码" min-width="80px"></el-table-column>
        <el-table-column prop="companyNamePath" label="组织路径" min-width="200px"></el-table-column>
        <el-table-column prop="editorName" label="操作人" width="100px"></el-table-column>
        <el-table-column prop="editDate" label="最后更新时间" min-width="100px"></el-table-column>
        <el-table-column prop="editDate" label="最后更新时间" min-width="150px"></el-table-column>
        <el-table-column label="操作" width="230" fixed="right">
          <template slot-scope="{row}">
<!--            v-if="row.type ==0"-->
            <el-button type="text"
              @click="$refs.OperaInternalCompanyWindow.open('编辑企业信息', { id: row.parentId, name: row.parentName, type: row.parentType, companyPath: row.parentCompanyPath }, row, 'edit')"
              icon="el-icon-edit" v-permissions="['business:company:update']">编辑</el-button>
              icon="el-icon-edit" v-permissions="['business:company:update']" v-if="sysConfig && sysConfig.orgUserDataOrigin ==3 && row.type !=1 ">编辑</el-button>
            <el-button type="text" @click="$refs.OperaInternalCompanyWindow.open('新建子级', row, null, 'add')"
              icon="el-icon-plus">新建子级</el-button>
            <el-button type="text" @click="deleteById(row)" style="color: red" icon="el-icon-delete"
              v-permissions="['business:company:delete']" v-if="row.type !== -1">删除</el-button>
              v-permissions="['business:company:delete']" v-if="sysConfig && sysConfig.orgUserDataOrigin ==3 && row.type ==0 ">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -76,11 +84,17 @@
      // 搜索
      loading: false,
      sorting: false,
      sysConfig: null,
      searchForm: {
        // type: 1
      },
      list: [],
      total: 0
    }
  },
  provide() {
    return {
      sysConfig: () => this.sysConfig
    }
  },
  created() {
@@ -91,6 +105,10 @@
      'field.main': 'id'
    })
    this.search()
    this.api.getSysConfig()
      .then(res => {
        this.sysConfig = res
      })
  },
  mounted() {
    this.$nextTick(() => {