| | |
| | | <!-- 表格和分页 --> |
| | | <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: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" |
| | |
| | | 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> |
| | | <!-- 新建/修改 --> |
| | |
| | | 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, |
| | |
| | | data () { |
| | | return { |
| | | // 搜索 |
| | | loading:false, |
| | | searchForm: { |
| | | type: 1 |
| | | }, |
| | |
| | | }, |
| | | // 同步信息 |
| | | 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(() => {}) |
| | | } |
| | | } |
| | | } |