From 13a31edf7f569cdcf15d3c43a476a2c947f47fbf Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 09 十一月 2025 22:33:24 +0800
Subject: [PATCH] feat: 增加hospdata表,同步sqlserver过来
---
ruoyi-ui/src/views/system/user/index.vue | 105 +++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 99 insertions(+), 6 deletions(-)
diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue
index 2d09ee4..f479f46 100644
--- a/ruoyi-ui/src/views/system/user/index.vue
+++ b/ruoyi-ui/src/views/system/user/index.vue
@@ -59,7 +59,7 @@
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
- <el-table-column label="鐢ㄦ埛缂栧彿" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
+
<!-- OA鐢ㄦ埛ID鍒楀凡闅愯棌锛屽彧鍦ㄧ紪杈戣〃鍗曚腑鏄剧ず -->
<el-table-column label="鐢ㄦ埛鍚嶇О" align="center" key="userName" prop="userName" v-if="columns[2].visible" width="150" />
<el-table-column label="鐢ㄦ埛鏄电О" align="center" key="nickName" prop="nickName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
@@ -75,7 +75,7 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
- <el-table-column label="鎿嶄綔" align="center" width="160" class-name="small-padding fixed-width">
+ <el-table-column label="鎿嶄綔" align="center" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope" v-if="scope.row.userId !== 1">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">淇敼</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">鍒犻櫎</el-button>
@@ -84,6 +84,8 @@
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="handleResetPwd" icon="el-icon-key" v-hasPermi="['system:user:resetPwd']">閲嶇疆瀵嗙爜</el-dropdown-item>
<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check" v-hasPermi="['system:user:edit']">鍒嗛厤瑙掕壊</el-dropdown-item>
+ <!-- 鏂板锛氱鐞嗗垎鍏徃閰嶇疆鍏ュ彛 -->
+ <el-dropdown-item command="handleManageBranch" icon="el-icon-office-building" v-hasPermi="['system:user:edit']">绠$悊鍒嗗叕鍙�</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@@ -115,6 +117,16 @@
<el-col :span="12">
<el-form-item label="OA鐢ㄦ埛ID" prop="oaUserId">
<el-input v-model="form.oaUserId" placeholder="OA绯荤粺鐨勭敤鎴稩D" type="number" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="鍙鐞嗗垎鍏徃">
+ <div>
+ <el-tag v-for="bc in userBranchCompanies" :key="bc.deptId" type="info" size="small" style="margin-right:6px;margin-bottom:6px">{{ bc.deptName }}</el-tag>
+ <span v-if="userBranchCompanies.length === 0" style="color:#999">鏆傛棤鍒嗗叕鍙�</span>
+ </div>
</el-form-item>
</el-col>
</el-row>
@@ -206,6 +218,21 @@
<el-button @click="upload.open = false">鍙� 娑�</el-button>
</div>
</el-dialog>
+
+ <!-- 鏂板锛氱敤鎴风鐞嗗垎鍏徃閰嶇疆瀵硅瘽妗� -->
+ <el-dialog title="閰嶇疆绠$悊鍒嗗叕鍙�" :visible.sync="branchDialog.open" width="500px" append-to-body>
+ <el-form label-width="100px">
+ <el-form-item label="鍙鐞嗗垎鍏徃">
+ <div>
+ <el-tag v-for="bc in branchDialog.companies" :key="bc.deptId" type="info" size="small" style="margin-right:6px;margin-bottom:6px">{{ bc.deptName }}</el-tag>
+ <span v-if="branchDialog.companies.length === 0" style="color:#999">鏆傛棤鍒嗗叕鍙�</span>
+ </div>
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="branchDialog.open = false">鍏� 闂�</el-button>
+ </div>
+ </el-dialog>
</div>
</template>
@@ -216,6 +243,8 @@
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { Splitpanes, Pane } from "splitpanes";
import "splitpanes/dist/splitpanes.css";
+import request from "@/utils/request";
+import { listDept, listBranchByUser } from "@/api/system/dept";
export default {
name: "User",
@@ -308,7 +337,7 @@
password: [
{ required: true, message: "鐢ㄦ埛瀵嗙爜涓嶈兘涓虹┖", trigger: "blur" },
{ min: 5, max: 20, message: '鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿', trigger: 'blur' },
- { pattern: /^[^<>"'|\\]+$/, message: "涓嶈兘鍖呭惈闈炴硶瀛楃锛�< > \" ' \\\ |", trigger: "blur" }
+ { pattern: /^[^<>"'|\\]+$/, message: "涓嶈兘鍖呭惈闈炴硶瀛楃锛�< > \" ' \\\\ |", trigger: "blur" }
],
email: [
{
@@ -324,7 +353,17 @@
trigger: "blur"
}
]
- }
+ },
+ // 鏂板锛氬垎鍏徃閰嶇疆瀵硅瘽妗嗘暟鎹�
+ branchDialog: {
+ open: false,
+ userId: null,
+ deptOptions: [],
+ selectedDeptIds: [],
+ companies: []
+ },
+ // 鍩轰簬 oa_order_class 璁$畻鐨勫垎鍏徃鍒楄〃锛堝彧璇诲睍绀猴級
+ userBranchCompanies: []
};
},
watch: {
@@ -404,6 +443,7 @@
userName: undefined,
nickName: undefined,
oaUserId: undefined,
+ oaOrderClass: undefined,
password: undefined,
phonenumber: undefined,
email: undefined,
@@ -443,6 +483,9 @@
case "handleAuthRole":
this.handleAuthRole(row);
break;
+ case "handleManageBranch":
+ this.handleManageBranch(row);
+ break;
default:
break;
}
@@ -471,8 +514,38 @@
this.open = true;
this.title = "淇敼鐢ㄦ埛";
this.form.password = "";
+ this.loadUserBranchCompanies();
});
},
+ // 鏍规嵁 form.oaOrderClass 璁$畻鍒嗗叕鍙稿垪琛紙service/dispatch 缂栫爜鍖归厤锛�
+ loadUserBranchCompanies() {
+ this.userBranchCompanies = [];
+ const codesStr = this.form.oaOrderClass || '';
+ const codes = codesStr.split(',').map(s => s.trim()).filter(s => s);
+ if (codes.length === 0) {
+ return;
+ }
+ listDept({ parentId: 100 }).then(res => {
+ const all = res.data || [];
+ const codeSet = new Set(codes);
+ const list = [];
+ const seen = new Set();
+ all.forEach(d => {
+ const s = d.serviceOrderClass || '';
+ const dis = d.dispatchOrderClass || '';
+ if ((s && codeSet.has(s)) || (dis && codeSet.has(dis))) {
+ if (!seen.has(d.deptId)) {
+ seen.add(d.deptId);
+ list.push({ deptId: d.deptId, deptName: d.deptName });
+ }
+ }
+ });
+ this.userBranchCompanies = list;
+ }).catch(() => {
+ this.userBranchCompanies = [];
+ });
+ },
+
/** 閲嶇疆瀵嗙爜鎸夐挳鎿嶄綔 */
handleResetPwd(row) {
this.$prompt('璇疯緭鍏�"' + row.userName + '"鐨勬柊瀵嗙爜', "鎻愮ず", {
@@ -483,7 +556,7 @@
inputErrorMessage: "鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿",
inputValidator: (value) => {
if (/<|>|"|'|\||\\/.test(value)) {
- return "涓嶈兘鍖呭惈闈炴硶瀛楃锛�< > \" ' \\\ |"
+ return "涓嶈兘鍖呭惈闈炴硶瀛楃锛�< > \" ' \\\\ |"
}
},
}).then(({ value }) => {
@@ -497,6 +570,26 @@
const userId = row.userId;
this.$router.push("/system/user-auth/role/" + userId);
},
+ /** 绠$悊鍒嗗叕鍙搁厤缃叆鍙� */
+ handleManageBranch(row) {
+ const userId = row.userId;
+ this.branchDialog.userId = userId;
+ // 鍔犺浇鍒嗗叕鍙稿垪琛紙OA鑷姩鎺у埗锛屽彧璇诲睍绀猴級
+ listBranchByUser(userId).then(res => {
+ const list = res.data || [];
+ this.branchDialog.companies = (list || []).map(d => ({ deptId: d.deptId, deptName: d.deptName }));
+ this.branchDialog.open = true;
+ }).catch(() => {
+ this.$modal.msgError('鍔犺浇鍒嗗叕鍙搁厤缃け璐�');
+ });
+ },
+ /** 淇濆瓨鍒嗗叕鍙搁厤缃� */
+ // 宸插彇娑堜繚瀛橈紝OA鑷姩鎺у埗锛堜粎鍙灞曠ず锛�
+ // submitBranchCompanies() {
+ // const userId = this.branchDialog.userId;
+ // const deptIds = this.branchDialog.selectedDeptIds || [];
+ // // 淇濈暀鍗犱綅锛岄伩鍏嶈璋冪敤
+ // },
/** 鎻愪氦鎸夐挳 */
submitForm: function() {
this.$refs["form"].validate(valid => {
@@ -561,4 +654,4 @@
}
}
};
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.9.1