|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
|
|
|
|
|
|
|
+ <div class="app-container dept-page">
|
|
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" class="dept-query-form">
|
|
|
<el-form-item label="部门名称" prop="deptName">
|
|
<el-form-item label="部门名称" prop="deptName">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="queryParams.deptName"
|
|
v-model="queryParams.deptName"
|
|
@@ -29,7 +29,7 @@
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
<el-button
|
|
|
- plain
|
|
|
|
|
|
|
+ plain
|
|
|
type="primary"
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
size="mini"
|
|
@@ -47,18 +47,40 @@
|
|
|
row-key="deptId"
|
|
row-key="deptId"
|
|
|
default-expand-all
|
|
default-expand-all
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
|
+ class="dept-table"
|
|
|
>
|
|
>
|
|
|
-
|
|
|
|
|
- <el-table-column prop="deptId" label="部门编号" width="260"></el-table-column>
|
|
|
|
|
- <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
|
|
|
|
- <el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
|
|
|
|
|
- <el-table-column prop="status" label="状态" :formatter="statusFormat" width="100"></el-table-column>
|
|
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
|
|
|
|
|
|
+ <el-table-column prop="deptName" label="部门名称" min-width="220" show-overflow-tooltip />
|
|
|
|
|
+ <el-table-column prop="deptId" label="部门编号" width="100" align="center" />
|
|
|
|
|
+ <el-table-column prop="orderNum" label="排序" width="70" align="center" />
|
|
|
|
|
+ <el-table-column prop="status" label="状态" width="80" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-tag :type="scope.row.status === '0' ? 'success' : 'info'" size="mini">
|
|
|
|
|
+ {{ statusFormat(scope.row) }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="主要小程序" min-width="160" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-tag v-if="scope.row.miniAppMaster" type="primary" size="mini" effect="plain">
|
|
|
|
|
+ {{ getMiniAppName(scope.row.miniAppMaster) }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ <span v-else class="text-muted">跟随公司</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="备用小程序" min-width="160" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-tag v-if="scope.row.miniAppServer" type="warning" size="mini" effect="plain">
|
|
|
|
|
+ {{ getMiniAppName(scope.row.miniAppServer) }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ <span v-else class="text-muted">跟随公司</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" width="170">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
|
|
+ <el-table-column label="操作" align="center" width="200" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
<el-button
|
|
|
size="mini"
|
|
size="mini"
|
|
@@ -79,6 +101,7 @@
|
|
|
size="mini"
|
|
size="mini"
|
|
|
type="text"
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
|
|
|
+ class="danger-text"
|
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['company:dept:remove']"
|
|
v-hasPermi="['company:dept:remove']"
|
|
|
>删除</el-button>
|
|
>删除</el-button>
|
|
@@ -86,56 +109,112 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
- <!-- 添加或修改部门对话框 -->
|
|
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
- <el-row>
|
|
|
|
|
- <el-col :span="24" v-if="form.parentId !== 0">
|
|
|
|
|
- <el-form-item label="上级部门" prop="parentId">
|
|
|
|
|
- <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="部门名称" prop="deptName">
|
|
|
|
|
- <el-input v-model="form.deptName" placeholder="请输入部门名称" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="显示排序" prop="orderNum">
|
|
|
|
|
- <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="负责人" prop="leader">
|
|
|
|
|
- <el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="联系电话" prop="phone">
|
|
|
|
|
- <el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="邮箱" prop="email">
|
|
|
|
|
- <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="部门状态">
|
|
|
|
|
- <el-radio-group v-model="form.status">
|
|
|
|
|
- <el-radio
|
|
|
|
|
- v-for="dict in statusOptions"
|
|
|
|
|
- :key="dict.dictValue"
|
|
|
|
|
- :label="dict.dictValue"
|
|
|
|
|
- >{{dict.dictLabel}}</el-radio>
|
|
|
|
|
- </el-radio-group>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="720px" append-to-body class="dept-dialog">
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px" class="dept-form">
|
|
|
|
|
+ <div class="form-section">
|
|
|
|
|
+ <div class="form-section-title">基本信息</div>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="24" v-if="form.parentId !== 0">
|
|
|
|
|
+ <el-form-item label="上级部门" prop="parentId">
|
|
|
|
|
+ <treeselect
|
|
|
|
|
+ v-model="form.parentId"
|
|
|
|
|
+ :options="deptOptions"
|
|
|
|
|
+ :normalizer="normalizer"
|
|
|
|
|
+ placeholder="选择上级部门"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="部门名称" prop="deptName">
|
|
|
|
|
+ <el-input v-model="form.deptName" placeholder="请输入部门名称" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="显示排序" prop="orderNum">
|
|
|
|
|
+ <el-input-number v-model="form.orderNum" controls-position="right" :min="0" style="width: 100%" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="负责人" prop="leader">
|
|
|
|
|
+ <el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="联系电话" prop="phone">
|
|
|
|
|
+ <el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="邮箱" prop="email">
|
|
|
|
|
+ <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="部门状态">
|
|
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
|
|
+ <el-radio
|
|
|
|
|
+ v-for="dict in statusOptions"
|
|
|
|
|
+ :key="dict.dictValue"
|
|
|
|
|
+ :label="dict.dictValue"
|
|
|
|
|
+ >{{ dict.dictLabel }}</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-section">
|
|
|
|
|
+ <div class="form-section-title">小程序配置</div>
|
|
|
|
|
+ <p class="form-section-tip">不选择时,SOP 发课将使用公司级主备小程序配置</p>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="主要小程序">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="form.miniAppMaster"
|
|
|
|
|
+ placeholder="请选择主要小程序"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ filterable
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in companyMiniAppList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.appid || item.appId"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
|
|
+ <span class="option-appid">{{ item.appid || item.appId }}</span>
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="备用小程序">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="form.miniAppServer"
|
|
|
|
|
+ placeholder="请选择备用小程序"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ filterable
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in companyMiniAppList"
|
|
|
|
|
+ :key="'backup-' + item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.appid || item.appId"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
|
|
+ <span class="option-appid">{{ item.appid || item.appId }}</span>
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </div>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</div>
|
|
</div>
|
|
@@ -143,6 +222,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/company/companyDept";
|
|
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/company/companyDept";
|
|
|
|
|
+import { getCompanyMiniAppList } from "@/api/company/companyConfig";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
|
|
@@ -151,28 +231,20 @@ export default {
|
|
|
components: { Treeselect },
|
|
components: { Treeselect },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- // 遮罩层
|
|
|
|
|
loading: true,
|
|
loading: true,
|
|
|
- // 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
showSearch: true,
|
|
|
- // 表格树数据
|
|
|
|
|
deptList: [],
|
|
deptList: [],
|
|
|
- // 部门树选项
|
|
|
|
|
deptOptions: [],
|
|
deptOptions: [],
|
|
|
- // 弹出层标题
|
|
|
|
|
title: "",
|
|
title: "",
|
|
|
- // 是否显示弹出层
|
|
|
|
|
open: false,
|
|
open: false,
|
|
|
- // 状态数据字典
|
|
|
|
|
statusOptions: [],
|
|
statusOptions: [],
|
|
|
- // 查询参数
|
|
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
deptName: undefined,
|
|
deptName: undefined,
|
|
|
status: undefined
|
|
status: undefined
|
|
|
},
|
|
},
|
|
|
- // 表单参数
|
|
|
|
|
form: {},
|
|
form: {},
|
|
|
- // 表单校验
|
|
|
|
|
|
|
+ companyMiniAppList: [],
|
|
|
|
|
+ miniAppNameMap: {},
|
|
|
rules: {
|
|
rules: {
|
|
|
parentId: [
|
|
parentId: [
|
|
|
{ required: true, message: "上级部门不能为空", trigger: "blur" }
|
|
{ required: true, message: "上级部门不能为空", trigger: "blur" }
|
|
@@ -186,7 +258,7 @@ export default {
|
|
|
email: [
|
|
email: [
|
|
|
{
|
|
{
|
|
|
type: "email",
|
|
type: "email",
|
|
|
- message: "'请输入正确的邮箱地址",
|
|
|
|
|
|
|
+ message: "请输入正确的邮箱地址",
|
|
|
trigger: ["blur", "change"]
|
|
trigger: ["blur", "change"]
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
@@ -202,12 +274,34 @@ export default {
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
this.getList();
|
|
this.getList();
|
|
|
|
|
+ this.loadCompanyMiniAppList();
|
|
|
this.getDicts("sys_normal_disable").then(response => {
|
|
this.getDicts("sys_normal_disable").then(response => {
|
|
|
this.statusOptions = response.data;
|
|
this.statusOptions = response.data;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- /** 查询部门列表 */
|
|
|
|
|
|
|
+ loadCompanyMiniAppList() {
|
|
|
|
|
+ getCompanyMiniAppList().then(res => {
|
|
|
|
|
+ this.companyMiniAppList = res.data || [];
|
|
|
|
|
+ const map = {};
|
|
|
|
|
+ this.companyMiniAppList.forEach(item => {
|
|
|
|
|
+ const appId = item.appid || item.appId;
|
|
|
|
|
+ if (appId) {
|
|
|
|
|
+ map[appId] = item.name || appId;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ this.miniAppNameMap = map;
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.companyMiniAppList = [];
|
|
|
|
|
+ this.miniAppNameMap = {};
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ getMiniAppName(appId) {
|
|
|
|
|
+ if (!appId) {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ return this.miniAppNameMap[appId] || appId;
|
|
|
|
|
+ },
|
|
|
getList() {
|
|
getList() {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
listDept(this.queryParams).then(response => {
|
|
listDept(this.queryParams).then(response => {
|
|
@@ -215,7 +309,6 @@ export default {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- /** 转换部门数据结构 */
|
|
|
|
|
normalizer(node) {
|
|
normalizer(node) {
|
|
|
if (node.children && !node.children.length) {
|
|
if (node.children && !node.children.length) {
|
|
|
delete node.children;
|
|
delete node.children;
|
|
@@ -226,16 +319,13 @@ export default {
|
|
|
children: node.children
|
|
children: node.children
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- // 字典状态字典翻译
|
|
|
|
|
- statusFormat(row, column) {
|
|
|
|
|
|
|
+ statusFormat(row) {
|
|
|
return this.selectDictLabel(this.statusOptions, row.status);
|
|
return this.selectDictLabel(this.statusOptions, row.status);
|
|
|
},
|
|
},
|
|
|
- // 取消按钮
|
|
|
|
|
cancel() {
|
|
cancel() {
|
|
|
this.open = false;
|
|
this.open = false;
|
|
|
this.reset();
|
|
this.reset();
|
|
|
},
|
|
},
|
|
|
- // 表单重置
|
|
|
|
|
reset() {
|
|
reset() {
|
|
|
this.form = {
|
|
this.form = {
|
|
|
deptId: undefined,
|
|
deptId: undefined,
|
|
@@ -245,44 +335,43 @@ export default {
|
|
|
leader: undefined,
|
|
leader: undefined,
|
|
|
phone: undefined,
|
|
phone: undefined,
|
|
|
email: undefined,
|
|
email: undefined,
|
|
|
- status: "0"
|
|
|
|
|
|
|
+ status: "0",
|
|
|
|
|
+ miniAppMaster: undefined,
|
|
|
|
|
+ miniAppServer: undefined
|
|
|
};
|
|
};
|
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
|
},
|
|
},
|
|
|
- /** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
|
- /** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
this.handleQuery();
|
|
|
},
|
|
},
|
|
|
- /** 新增按钮操作 */
|
|
|
|
|
handleAdd(row) {
|
|
handleAdd(row) {
|
|
|
this.reset();
|
|
this.reset();
|
|
|
|
|
+ this.loadCompanyMiniAppList();
|
|
|
if (row != undefined) {
|
|
if (row != undefined) {
|
|
|
this.form.parentId = row.deptId;
|
|
this.form.parentId = row.deptId;
|
|
|
}
|
|
}
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
this.title = "添加部门";
|
|
this.title = "添加部门";
|
|
|
listDept().then(response => {
|
|
listDept().then(response => {
|
|
|
- this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
|
|
|
|
+ this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
this.reset();
|
|
|
|
|
+ this.loadCompanyMiniAppList();
|
|
|
getDept(row.deptId).then(response => {
|
|
getDept(row.deptId).then(response => {
|
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
this.title = "修改部门";
|
|
this.title = "修改部门";
|
|
|
});
|
|
});
|
|
|
listDeptExcludeChild(row.deptId).then(response => {
|
|
listDeptExcludeChild(row.deptId).then(response => {
|
|
|
- this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
|
|
|
|
+ this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- /** 提交按钮 */
|
|
|
|
|
submitForm: function() {
|
|
submitForm: function() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
@@ -306,19 +395,84 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- /** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
|
this.$confirm('是否确认删除名称为"' + row.deptName + '"的数据项?', "警告", {
|
|
this.$confirm('是否确认删除名称为"' + row.deptName + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
|
- type: "warning"
|
|
|
|
|
- }).then(function() {
|
|
|
|
|
- return delDept(row.deptId);
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- this.getList();
|
|
|
|
|
- this.msgSuccess("删除成功");
|
|
|
|
|
- }).catch(function() {});
|
|
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }).then(function() {
|
|
|
|
|
+ return delDept(row.deptId);
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
|
|
+ }).catch(function() {});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+.dept-page {
|
|
|
|
|
+ .dept-table {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .text-muted {
|
|
|
|
|
+ color: #c0c4cc;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .danger-text {
|
|
|
|
|
+ color: #f56c6c;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.dept-dialog {
|
|
|
|
|
+ ::v-deep .el-dialog__body {
|
|
|
|
|
+ padding: 16px 24px 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.dept-form {
|
|
|
|
|
+ .form-section {
|
|
|
|
|
+ margin-bottom: 8px;
|
|
|
|
|
+
|
|
|
|
|
+ &:not(:last-child) {
|
|
|
|
|
+ padding-bottom: 4px;
|
|
|
|
|
+ border-bottom: 1px solid #ebeef5;
|
|
|
|
|
+ margin-bottom: 16px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-section-title {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #303133;
|
|
|
|
|
+ margin-bottom: 12px;
|
|
|
|
|
+ padding-left: 8px;
|
|
|
|
|
+ border-left: 3px solid #409eff;
|
|
|
|
|
+ line-height: 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-section-tip {
|
|
|
|
|
+ margin: 0 0 12px 8px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ color: #909399;
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .el-form-item {
|
|
|
|
|
+ margin-bottom: 18px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .el-form-item__label {
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.option-appid {
|
|
|
|
|
+ float: right;
|
|
|
|
|
+ color: #909399;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|