|
@@ -0,0 +1,172 @@
|
|
|
+<template>
|
|
|
+ <div class="org-manage home">
|
|
|
+ <view-header class="home-header"></view-header>
|
|
|
+ <div class="home-body">
|
|
|
+ <div class="home-main">
|
|
|
+ <div class="part-box-head">
|
|
|
+ <h2 class="part-box-head-left">机构管理</h2>
|
|
|
+ <div class="part-box-head-right">
|
|
|
+ <Button
|
|
|
+ size="small"
|
|
|
+ type="success"
|
|
|
+ icon="recode-white icon"
|
|
|
+ shape="circle"
|
|
|
+ @click="toAdd"
|
|
|
+ >新增机构</Button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="org-table">
|
|
|
+ <table class="table-block">
|
|
|
+ <tr>
|
|
|
+ <th>机构ID号</th>
|
|
|
+ <th>机构名称/项目经理</th>
|
|
|
+ <th>账号</th>
|
|
|
+ <th>密码</th>
|
|
|
+ <th>启用/禁用</th>
|
|
|
+ <th>设置</th>
|
|
|
+ <th>操作</th>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <template v-for="org in orgs">
|
|
|
+ <tr :key="org.markUsers[0].id">
|
|
|
+ <td rowspan="2">{{ org.abbreviation }}</td>
|
|
|
+ <td>{{ org.markUsers[0].name }}</td>
|
|
|
+ <td>{{ org.markUsers[0].loginName }}</td>
|
|
|
+ <td>{{ org.markUsers[0].password }}</td>
|
|
|
+ <td class="table-action">
|
|
|
+ <i
|
|
|
+ :class="[
|
|
|
+ 'icon',
|
|
|
+ 'ivu-icon',
|
|
|
+ org.markUsers[0].enabled
|
|
|
+ ? 'ivu-icon-enable'
|
|
|
+ : 'ivu-icon-disable'
|
|
|
+ ]"
|
|
|
+ :title="org.markUsers[0].enabled ? '禁用' : '启用'"
|
|
|
+ @click="toAble(org.markUsers[0])"
|
|
|
+ ></i>
|
|
|
+ </td>
|
|
|
+ <td class="table-action">
|
|
|
+ <i
|
|
|
+ :class="[
|
|
|
+ 'ivu-icon',
|
|
|
+ 'ivu-icon-md-create',
|
|
|
+ { 'btn-disabled': !org.markUsers[0].enabled }
|
|
|
+ ]"
|
|
|
+ title="编辑"
|
|
|
+ @click="toEdit(org.markUsers[0])"
|
|
|
+ ></i>
|
|
|
+ </td>
|
|
|
+ <td rowspan="2" class="table-action">
|
|
|
+ <i
|
|
|
+ class="ivu-icon ivu-icon-md-trash icon-danger"
|
|
|
+ title="删除"
|
|
|
+ @click="toDelete(org)"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ class="ivu-icon ivu-icon-md-arrow-round-forward"
|
|
|
+ title="进入"
|
|
|
+ @click="toDetail(org)"
|
|
|
+ ></i>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr :key="org.markUsers[1].id">
|
|
|
+ <td>{{ org.markUsers[1].name }}</td>
|
|
|
+ <td>{{ org.markUsers[1].loginName }}</td>
|
|
|
+ <td>{{ org.markUsers[1].password }}</td>
|
|
|
+ <td class="table-action">
|
|
|
+ <i
|
|
|
+ :class="[
|
|
|
+ 'icon',
|
|
|
+ 'ivu-icon',
|
|
|
+ org.markUsers[1].enabled
|
|
|
+ ? 'ivu-icon-enable'
|
|
|
+ : 'ivu-icon-disable'
|
|
|
+ ]"
|
|
|
+ :title="org.markUsers[1].enabled ? '禁用' : '启用'"
|
|
|
+ @click="toAble(org.markUsers[1])"
|
|
|
+ ></i>
|
|
|
+ </td>
|
|
|
+ <td class="table-action">
|
|
|
+ <i
|
|
|
+ :class="[
|
|
|
+ 'ivu-icon',
|
|
|
+ 'ivu-icon-md-create',
|
|
|
+ { 'btn-disabled': !org.markUsers[1].enabled }
|
|
|
+ ]"
|
|
|
+ title="编辑"
|
|
|
+ @click="toEdit(org.markUsers[1])"
|
|
|
+ ></i>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </template>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <view-footer></view-footer>
|
|
|
+
|
|
|
+ <modify-org
|
|
|
+ :instance="curUsers"
|
|
|
+ @modified="getList"
|
|
|
+ ref="ModifyOrg"
|
|
|
+ ></modify-org>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { orgList, enableOrgUser, deleteOrg } from "@/api";
|
|
|
+import ModifyOrg from "./components/ModifyOrg";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "org-manage",
|
|
|
+ components: { ModifyOrg },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ orgs: [],
|
|
|
+ curUsers: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getList() {
|
|
|
+ const data = await orgList();
|
|
|
+ this.orgs = data;
|
|
|
+ },
|
|
|
+ toAdd() {
|
|
|
+ this.curUsers = [];
|
|
|
+ this.$refs.ModifyOrg.open();
|
|
|
+ },
|
|
|
+ toEdit(user) {
|
|
|
+ this.curUsers = [user];
|
|
|
+ this.$refs.ModifyOrg.open();
|
|
|
+ },
|
|
|
+ async toAble(user) {
|
|
|
+ await enableOrgUser(user.id);
|
|
|
+ user.enabled = !user.enabled;
|
|
|
+ },
|
|
|
+ toDetail(row) {
|
|
|
+ this.$ls.set("organizationId", row.id, this.GLOBAL.authTimeout);
|
|
|
+ this.$router.push({ name: "WorkManage" });
|
|
|
+ },
|
|
|
+ toDelete(row) {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ content: "确定要删除当前机构吗?",
|
|
|
+ onOk: () => {
|
|
|
+ this.toDel(row.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async toDel(id) {
|
|
|
+ await deleteOrg(id);
|
|
|
+ this.$Message.success("删除成功!");
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|