| | |
| | | v-model="queryParams.deptName"
|
| | | placeholder="请输入部门名称"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 200px"
|
| | | @keyup.enter="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="状态" prop="status">
|
| | | <el-select v-model="queryParams.status" placeholder="部门状态" clearable size="small">
|
| | | <el-select v-model="queryParams.status" placeholder="部门状态" clearable style="width: 200px">
|
| | | <el-option
|
| | | v-for="dict in sys_normal_disable"
|
| | | :key="dict.value"
|
| | |
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="Search" size="mini" @click="handleQuery">搜索</el-button>
|
| | | <el-button icon="Refresh" size="mini" @click="resetQuery">重置</el-button>
|
| | | <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | |
| | | type="primary"
|
| | | plain
|
| | | icon="Plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:dept:add']"
|
| | | >新增</el-button>
|
| | |
| | | type="info"
|
| | | plain
|
| | | icon="Sort"
|
| | | size="mini"
|
| | | @click="toggleExpandAll"
|
| | | >展开/折叠</el-button>
|
| | | </el-col>
|
| | |
| | | </el-table-column>
|
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
| | | <template #default="scope">
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="Edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:dept:edit']"
|
| | | >修改</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="Plus"
|
| | | @click="handleAdd(scope.row)"
|
| | | v-hasPermi="['system:dept:add']"
|
| | | >新增</el-button>
|
| | | <el-button
|
| | | v-if="scope.row.parentId != 0"
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="Delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:dept:remove']"
|
| | | >删除</el-button>
|
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dept:edit']">修改</el-button>
|
| | | <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:dept:add']">新增</el-button>
|
| | | <el-button v-if="scope.row.parentId != 0" link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dept:remove']">删除</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
| | | <el-row>
|
| | | <el-col :span="24" v-if="form.parentId !== 0">
|
| | | <el-form-item label="上级部门" prop="parentId">
|
| | | <tree-select
|
| | | v-model:value="form.parentId"
|
| | | :options="deptOptions"
|
| | | :objMap="{ value: 'deptId', label: 'deptName', children: 'children' }"
|
| | | <el-tree-select
|
| | | v-model="form.parentId"
|
| | | :data="deptOptions"
|
| | | :props="{ value: 'deptId', label: 'deptName', children: 'children' }"
|
| | | value-key="deptId"
|
| | | placeholder="选择上级部门"
|
| | | check-strictly
|
| | | />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | |
| | | parentId: [{ required: true, message: "上级部门不能为空", trigger: "blur" }],
|
| | | deptName: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
|
| | | orderNum: [{ required: true, message: "显示排序不能为空", trigger: "blur" }],
|
| | | email: [{ type: "email", message: "'请输入正确的邮箱地址", trigger: ["blur", "change"] }],
|
| | | email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }],
|
| | | phone: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }]
|
| | | },
|
| | | });
|
| | |
| | | loading.value = false;
|
| | | });
|
| | | }
|
| | |
|
| | | /** 取消按钮 */
|
| | | function cancel() {
|
| | | open.value = false;
|
| | | reset();
|
| | | }
|
| | |
|
| | | /** 表单重置 */
|
| | | function reset() {
|
| | | form.value = {
|
| | |
| | | };
|
| | | proxy.resetForm("deptRef");
|
| | | }
|
| | |
|
| | | /** 搜索按钮操作 */
|
| | | function handleQuery() {
|
| | | getList();
|
| | | }
|
| | |
|
| | | /** 重置按钮操作 */
|
| | | function resetQuery() {
|
| | | proxy.resetForm("queryRef");
|
| | | handleQuery();
|
| | | }
|
| | |
|
| | | /** 新增按钮操作 */
|
| | | async function handleAdd(row) {
|
| | | function handleAdd(row) {
|
| | | reset();
|
| | | await listDept().then(response => {
|
| | | listDept().then(response => {
|
| | | deptOptions.value = proxy.handleTree(response.data, "deptId");
|
| | | });
|
| | | if (row != undefined) {
|
| | |
| | | open.value = true;
|
| | | title.value = "添加部门";
|
| | | }
|
| | |
|
| | | /** 展开/折叠操作 */
|
| | | function toggleExpandAll() {
|
| | | refreshTable.value = false;
|
| | |
| | | refreshTable.value = true;
|
| | | });
|
| | | }
|
| | |
|
| | | /** 修改按钮操作 */
|
| | | async function handleUpdate(row) {
|
| | | function handleUpdate(row) {
|
| | | reset();
|
| | | await listDeptExcludeChild(row.deptId).then(response => {
|
| | | listDeptExcludeChild(row.deptId).then(response => {
|
| | | deptOptions.value = proxy.handleTree(response.data, "deptId");
|
| | | });
|
| | | getDept(row.deptId).then(response => {
|
| | |
| | | title.value = "修改部门";
|
| | | });
|
| | | }
|
| | |
|
| | | /** 提交按钮 */
|
| | | function submitForm() {
|
| | | proxy.$refs["deptRef"].validate(valid => {
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /** 删除按钮操作 */
|
| | | function handleDelete(row) {
|
| | | proxy.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
|