haifeng.zhang пре 1 недеља
родитељ
комит
1beee31ce4

+ 6 - 6
pnpm-lock.yaml

@@ -1415,8 +1415,8 @@ packages:
   caniuse-api@3.0.0:
     resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==}
 
-  caniuse-lite@1.0.30001600:
-    resolution: {integrity: sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==}
+  caniuse-lite@1.0.30001677:
+    resolution: {integrity: sha512-fmfjsOlJUpMWu+mAAtZZZHz7UEwsUxIIvu1TJfO1HqFQvB/B+ii0xr9B5HpbZY/mC4XZ8SvjHJqtAY6pDPQEog==}
 
   cfb@1.2.2:
     resolution: {integrity: sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==}
@@ -4981,7 +4981,7 @@ snapshots:
   autoprefixer@10.4.19(postcss@8.4.38):
     dependencies:
       browserslist: 4.23.0
-      caniuse-lite: 1.0.30001600
+      caniuse-lite: 1.0.30001677
       fraction.js: 4.3.7
       normalize-range: 0.1.2
       picocolors: 1.0.0
@@ -5030,7 +5030,7 @@ snapshots:
 
   browserslist@4.23.0:
     dependencies:
-      caniuse-lite: 1.0.30001600
+      caniuse-lite: 1.0.30001677
       electron-to-chromium: 1.4.719
       node-releases: 2.0.14
       update-browserslist-db: 1.0.13(browserslist@4.23.0)
@@ -5077,11 +5077,11 @@ snapshots:
   caniuse-api@3.0.0:
     dependencies:
       browserslist: 4.23.0
-      caniuse-lite: 1.0.30001600
+      caniuse-lite: 1.0.30001677
       lodash.memoize: 4.1.2
       lodash.uniq: 4.5.0
 
-  caniuse-lite@1.0.30001600: {}
+  caniuse-lite@1.0.30001677: {}
 
   cfb@1.2.2:
     dependencies:

+ 15 - 2
src/components/UserPageTable/index.vue

@@ -7,6 +7,7 @@ import { ElMessageBox, ElMessage } from "element-plus";
 import { Search } from "@element-plus/icons-vue";
 import { postOrganizationUserPage } from "@/api/userSetting";
 import { useRoute } from "vue-router";
+import dayjs from "dayjs";
 const $route: any = useRoute();
 const tableData = reactive({
   list: [],
@@ -57,6 +58,14 @@ defineExpose({
   postOrganizationUserPageApi,
   tableData
 });
+
+// 时间戳转换
+const getTime = day => {
+  if (day) {
+    return dayjs(day).format("YYYY-MM-DD");
+  }
+  return "";
+};
 </script>
 
 <template>
@@ -84,10 +93,14 @@ defineExpose({
       <el-table-column prop="hospitalCode" label="工号" />
       <el-table-column
         v-if="$route.name != 'users'"
-        prop="address"
+        prop="gender"
         label="性别"
       />
-      <el-table-column prop="address" label="年龄" />
+      <el-table-column label="年龄">
+        <template #default="{ row }">
+          <span>{{ getTime(row.birth) }}</span>
+        </template>
+      </el-table-column>
       <el-table-column prop="jobTitle" label="职称" />
       <el-table-column prop="dept" label="部门" />
       <el-table-column label="操作">

+ 20 - 6
src/views/background/framework/proson/components/addPerson.vue

@@ -3,6 +3,7 @@ import { ref, reactive, nextTick } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import { postDeptUserAdd, postListTree } from "@/api/department";
 import { getFromSelectDictRankApi, selectRank } from "@/api/select";
+import dayjs from "dayjs";
 const dialogVisibleAdd = ref(false);
 const treeSelectRef = ref(null);
 const postOrganizationUserPage = ref(null);
@@ -13,8 +14,16 @@ const form = reactive({
   deptCode: "",
   gender: "",
   jobTitle: "",
-  phone: ""
+  phone: "",
+  birth: null
 });
+const dayBirth = ref("");
+
+// 出生日期
+const birthChange = day => {
+  form.birth = dayjs(day).valueOf();
+};
+
 const formRef = ref();
 const deptTree = ref([]);
 const handleClose = () => {
@@ -63,11 +72,13 @@ const open = (row, postOrganizationUserPageApi) => {
     deptCode: "",
     gender: "",
     jobTitle: "",
-    phone: ""
+    phone: "",
+    birth: null
   });
   if (row.deptCode) {
     // console.log("11111", row);
     form.deptCode = row.deptCode;
+    form.deptName = row.deptName;
     dialogVisibleAdd.value = true;
     postOrganizationUserPage.value = postOrganizationUserPageApi;
     postListTreeApi();
@@ -149,14 +160,17 @@ defineExpose({
         </el-form-item>
         <el-form-item label="性别">
           <el-select v-model="form.gender" placeholder="请选择性别">
-            <el-option label="男" value="" />
+            <el-option label="男" value="" />
             <el-option label="女" value="女" />
           </el-select>
         </el-form-item>
         <el-form-item label="出生日期">
-          <!-- <el-input /> -->
-          <!-- v-model="form.gender" -->
-          <el-date-picker type="date" placeholder="请选择出生日期" />
+          <el-date-picker
+            v-model="dayBirth"
+            type="date"
+            placeholder="请选择出生日期"
+            @change="birthChange"
+          />
         </el-form-item>
         <el-form-item label="职称">
           <el-select v-model="form.jobTitle" placeholder="请选择职称">

+ 14 - 34
src/views/background/framework/proson/components/changeRole.vue

@@ -6,27 +6,11 @@ import { postPageRole } from "@/api/roles";
 import { postAssignmentUser } from "@/api/userSetting";
 const formRef = ref();
 const form = reactive({
-  name: "",
-  region: "",
-  date1: "",
-  date2: "",
-  delivery: false,
-  type: [],
-  resource: "",
-  desc: ""
+  region: ""
 });
 const handleClose = () => {
+  form.region = "";
   dialogVisibleAdd.value = !dialogVisibleAdd.value;
-  // ElMessageBox.confirm("确认关闭弹窗吗?")
-  //   .then(() => {
-  //     ElMessage({
-  //       message: "已关闭",
-  //       type: "success"
-  //     });
-  //   })
-  //   .catch(() => {
-  //     // catch error
-  //   });
 };
 const rolesList = reactive({
   list: [],
@@ -34,9 +18,8 @@ const rolesList = reactive({
     sourceCodes: [],
     targetCodes: [],
     linkAction: "link",
-    correlatedModel: "deptRole"
-  },
-  rolesName: ""
+    correlatedModel: "userRole" // 人员角色关联
+  }
 });
 const postAddUserGroupApi = async () => {
   const { code, msg } = await postAssignmentUser(rolesList.assignmentParams);
@@ -63,28 +46,24 @@ const rolesData = async () => {
     rolesList.list = data.records;
   }
 };
-const changeRoles = () => {
-  rolesList.assignmentParams.sourceCodes = [];
-  rolesList.assignmentParams.sourceCodes.push(rolesList.rolesName);
+const changeRoles = (val = []) => {
+  rolesList.assignmentParams.targetCodes = [];
+  val.forEach(item => {
+    rolesList.assignmentParams.targetCodes.push(item);
+  });
 };
 // 添加部门保存
 const saveDepartment = () => {
-  // formRef.value.validate(valid => {
-  //   if (valid) {
-
-  //   }
-  // });
   postAddUserGroupApi();
 };
 const open = (item, user) => {
   dialogVisibleAdd.value = true;
   if (user == "用户") {
-    console.log("item", item);
-    rolesList.assignmentParams.targetCodes = [];
-    rolesList.assignmentParams.targetCodes.push(item.userCode);
+    rolesList.assignmentParams.sourceCodes = [];
+    rolesList.assignmentParams.sourceCodes.push(item.userCode);
   } else {
-    rolesList.assignmentParams.targetCodes = [];
-    rolesList.assignmentParams.targetCodes.push(item.data.deptCode);
+    rolesList.assignmentParams.sourceCodes = [];
+    rolesList.assignmentParams.sourceCodes.push(item.data.deptCode);
   }
   rolesData();
 };
@@ -111,6 +90,7 @@ defineExpose({
           <el-select
             v-model="form.region"
             placeholder="请选择角色"
+            multiple
             @change="changeRoles"
           >
             <el-option

+ 8 - 10
src/views/background/framework/proson/components/newDepartment.vue

@@ -11,7 +11,8 @@ const form = reactive({
   deptName: "",
   deptCode: "",
   leader: "",
-  parentCode: ""
+  parentCode: "",
+  hospitalCode: ""
 });
 const optiones = reactive({
   parentOptions: [],
@@ -49,20 +50,15 @@ const postUserListApi = async () => {
     optiones.leaderOptions = data;
   }
 };
-postUserListApi();
 const handleClose = () => {
   formRef.value.clearValidate(); // 清除验证错误
   formRef.value.resetFields(); // 重置表单字段
   dialogVisibleAdd.value = !dialogVisibleAdd.value;
   form.deptName = "";
   form.deptCode = "";
+  form.hospitalCode = "";
   form.leader = "";
   form.parentCode = "";
-  // ElMessageBox.confirm("确认关闭弹窗吗?")
-  //   .then(() => {})
-  //   .catch(() => {
-  //     // catch error
-  //   });
 };
 // 添加部门保存
 const saveDepartment = () => {
@@ -76,11 +72,13 @@ const saveDepartment = () => {
 };
 const open = node => {
   dialogVisibleAdd.value = true;
+  postUserListApi();
   postListTreeApi();
   if (node) {
     // form.leader
     form.deptName = "";
     form.deptCode = "";
+    form.hospitalCode = "";
     form.leader = "";
     form.parentCode = "";
     optiones.parentOptions = [];
@@ -121,7 +119,7 @@ defineExpose({
           <el-input v-model="form.deptName" placeholder="请填写部门名称" />
         </el-form-item>
         <el-form-item label="部门编号">
-          <el-input v-model="form.deptCode" placeholder="请输入部门编号" />
+          <el-input v-model="form.hospitalCode" placeholder="请输入部门编号" />
         </el-form-item>
         <el-form-item label="上级部门">
           <el-tree-select
@@ -138,7 +136,7 @@ defineExpose({
             placeholder="请选择部门"
           />
         </el-form-item>
-        <el-form-item label="部门负责人">
+        <!-- <el-form-item label="部门负责人">
           <el-select v-model="form.leader" placeholder="请选择部门负责人">
             <el-option
               v-for="item in optiones.leaderOptions"
@@ -147,7 +145,7 @@ defineExpose({
               :value="item.userCode"
             />
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
       </el-form>
       <template #footer>
         <div class="dialog-footer">

+ 101 - 19
src/views/background/framework/proson/components/personDetailsDrawer.vue

@@ -1,8 +1,11 @@
 <script setup lang="ts">
-import { ref, reactive } from "vue";
+import { ref, reactive, nextTick } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import { postUpdateUserInfo } from "@/api/userSetting";
 import type { DrawerProps, FormItemProps, FormProps } from "element-plus";
+import { postListTree } from "@/api/department";
+import dayjs from "dayjs";
+import { selectRank } from "@/api/select";
 // const itemLabelPosition = ref<FormItemProps["labelPosition"]>("");
 const drawer = ref(false);
 const formRef = ref();
@@ -15,12 +18,14 @@ const formLabelAlign = reactive({
   userCode: "",
   userName: "",
   phone: "",
+  gender: "",
+  birth: null,
   remark: "",
   headUrl: "",
   token: "",
   menuRole: "",
   columnRole: "",
-  dept: "",
+  deptCode: "",
   group: "",
   jobTitle: ""
 });
@@ -70,10 +75,10 @@ const postUpdateUserInfoApi = async () => {
 };
 const open = (row, postOrganizationUserPageApi) => {
   drawer.value = true;
-  console.log("111", row);
   postOrganizationUserPage.value = postOrganizationUserPageApi;
   Object.assign(formLabelAlign, row);
-  console.log("formLabelAlign", formLabelAlign);
+  dayBirth.value = row.birth ? dayjs(row.birth).format("YYYY-MM-DD") : "";
+  postListTreeApi();
 };
 const editShow = ref(true);
 // 编辑
@@ -84,7 +89,57 @@ const editClick = () => {
 defineExpose({
   open
 });
-const timer = ref("");
+
+// 部门
+const treeSelectRef = ref(null);
+const openTreeFocus = async () => {
+  nextTick(() => {
+    if (formLabelAlign.deptCode && treeSelectRef.value) {
+      const node = treeSelectRef.value.getNode(formLabelAlign.deptCode); // 获取节点
+      if (node) {
+        treeSelectRef.value.setCurrentKey(formLabelAlign.deptCode); // 选中节点
+      }
+    }
+  });
+};
+const deptTree = ref([]);
+const postListTreeApi = async () => {
+  const { code, data } = await postListTree();
+  if (code == 200) {
+    deptTree.value = data;
+  }
+};
+
+// 出生日期
+const dayBirth = ref("");
+const birthChange = day => {
+  formLabelAlign.birth = dayjs(day).valueOf();
+};
+
+// 校验
+const rules = reactive({
+  realName: [
+    {
+      required: true,
+      message: "请填写姓名",
+      trigger: "blur"
+    }
+  ],
+  hospitalCode: [
+    {
+      required: true,
+      message: "请填写工号",
+      trigger: "blur"
+    }
+  ],
+  deptCode: [
+    {
+      required: true,
+      message: "请选择部门",
+      trigger: "blur"
+    }
+  ]
+});
 </script>
 
 <template>
@@ -104,43 +159,70 @@ const timer = ref("");
             label-position="top"
             label-width="auto"
             :model="formLabelAlign"
+            :rules="rules"
           >
-            <el-form-item label="姓名" label-position="top">
+            <el-form-item label="姓名" prop="realName" label-position="top">
               <el-input
                 v-model="formLabelAlign.realName"
                 :disabled="disabledValue"
               />
             </el-form-item>
-            <el-form-item label="工号" label-position="top">
+            <el-form-item label="工号" prop="hospitalCode" label-position="top">
               <el-input
                 v-model="formLabelAlign.hospitalCode"
                 :disabled="disabledValue"
               />
             </el-form-item>
-            <el-form-item label="员工ID" label-position="top">
-              <el-input :disabled="disabledValue" />
-            </el-form-item>
-            <el-form-item label="部门" label-position="top">
-              <el-input
-                v-model="formLabelAlign.dept"
+            <el-form-item label="部门" prop="deptCode" label-position="top">
+              <el-tree-select
+                ref="treeSelectRef"
+                v-model="formLabelAlign.deptCode"
+                :data="deptTree"
                 :disabled="disabledValue"
+                :props="{
+                  label: 'deptName',
+                  value: 'deptCode',
+                  children: 'childrenRes'
+                }"
+                filterable
+                check-strictly
+                :render-after-expand="false"
+                node-key="deptCode"
+                @focus="openTreeFocus"
               />
             </el-form-item>
             <el-form-item label="性别" label-position="top">
-              <el-input :disabled="disabledValue" />
+              <el-select
+                v-model="formLabelAlign.gender"
+                placeholder="请选择性别"
+                :disabled="disabledValue"
+              >
+                <el-option label="男" value="男" />
+                <el-option label="女" value="女" />
+              </el-select>
             </el-form-item>
-            <!-- <el-form-item label="年龄" label-position="top">
+            <el-form-item label="出生日期" label-position="top">
               <el-date-picker
+                v-model="dayBirth"
                 type="date"
-                placeholder="请选择出生年月"
                 :disabled="disabledValue"
+                placeholder="请选择出生日期"
+                @change="birthChange"
               />
-            </el-form-item> -->
+            </el-form-item>
             <el-form-item label="职称" label-position="top">
-              <el-input
+              <el-select
                 v-model="formLabelAlign.jobTitle"
+                placeholder="请选择职称"
                 :disabled="disabledValue"
-              />
+              >
+                <el-option
+                  v-for="(item, index) in selectRank"
+                  :key="index"
+                  :label="item.dictValue"
+                  :value="item.dictValue"
+                />
+              </el-select>
             </el-form-item>
             <el-form-item label="手机号" label-position="top">
               <el-input

+ 40 - 4
src/views/background/framework/proson/components/prosonEditDrawer.vue

@@ -3,6 +3,8 @@ import { ref, reactive } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import type { DrawerProps, FormItemProps, FormProps } from "element-plus";
 import { postUpdateDept, postListTree } from "@/api/department";
+import { postUserList } from "@/api/userSetting";
+import { encryption } from "@/utils/encrypt";
 // const itemLabelPosition = ref<FormItemProps["labelPosition"]>("");
 const drawer = ref(false);
 const disabledValue = ref(true);
@@ -13,8 +15,31 @@ const formLabelAlign = reactive({
   deptCode: "",
   type: "",
   parentCode: "",
+  hospitalCode: "",
   leader: ""
 });
+
+// 部门负责人
+const optiones = reactive({
+  leaderOptions: []
+});
+const userList = ref({
+  username: "",
+  password: "",
+  deptCode: ""
+});
+const postUserListApi = async () => {
+  // @ts-ignore
+  userList.value.username = encryption(localStorage.getItem("rolesName"));
+  // @ts-ignore
+  userList.value.password = encryption(localStorage.getItem("password"));
+  userList.value.deptCode = formLabelAlign.deptCode;
+  const { code, data } = await postUserList(userList.value);
+  if (code === 200) {
+    optiones.leaderOptions = data;
+  }
+};
+
 const handleClose = (done: () => void) => {
   // ElMessageBox.confirm("配置项未保存,确认关闭", {
   //   type: "warning"
@@ -55,14 +80,17 @@ function confirmClick() {
   });
 }
 const open = row => {
+  console.log(row, "0000000");
   // formLabelAlign = row.data;
   formLabelAlign.deptName = row.data.deptName;
   formLabelAlign.deptCode = row.data.deptCode;
+  formLabelAlign.hospitalCode = row.data.hospitalCode;
   formLabelAlign.parentCode = row.data.parentCode;
   formLabelAlign.leader = row.data.leader;
   // console.log("数据", row.data);
   console.log("数据", row);
   postListTreeApi();
+  postUserListApi();
   drawer.value = true;
 };
 
@@ -122,7 +150,7 @@ const timer = ref("");
             </el-form-item>
             <el-form-item label="部门编号" label-position="top">
               <el-input
-                v-model="formLabelAlign.deptCode"
+                v-model="formLabelAlign.hospitalCode"
                 :disabled="disabledValue"
               />
             </el-form-item>
@@ -133,7 +161,7 @@ const timer = ref("");
                 :data="parentOptions"
                 check-strictly
                 filterable
-                :disabled="disabledValue"
+                disabled
                 :props="{
                   label: 'deptName',
                   value: 'deptCode',
@@ -143,10 +171,18 @@ const timer = ref("");
               />
             </el-form-item>
             <el-form-item label="部门负责人" label-position="top">
-              <el-input
+              <el-select
                 v-model="formLabelAlign.leader"
+                placeholder="请选择部门负责人"
                 :disabled="disabledValue"
-              />
+              >
+                <el-option
+                  v-for="item in optiones.leaderOptions"
+                  :key="item.value"
+                  :label="item.userName"
+                  :value="item.userCode"
+                />
+              </el-select>
             </el-form-item>
           </el-form>
         </div>

+ 0 - 1
src/views/background/framework/proson/prosonDepartment.vue

@@ -14,7 +14,6 @@ import changeRole from "./components/changeRole.vue";
 import { postListTree, postDelDept } from "@/api/department";
 import { postOrganizationUserPage, getDeleteUserApi } from "@/api/userSetting";
 import UserPageTable from "@/components/UserPageTable/index.vue";
-import type Node from "element-plus/es/components/tree/src/model/node";
 // 添加部门
 const newDepartmentRef = ref(null);
 const newDepartmentShow = ref(false);

+ 3 - 3
src/views/background/framework/users/components/addUsers.vue

@@ -11,7 +11,7 @@ const dialogTitle = ref("");
 const dialogForm = ref(false);
 const form = reactive({
   groupName: "",
-  groupCode: "",
+  hospitalCode: "",
   leaderCode: ""
 });
 const rolesList = reactive({
@@ -88,7 +88,7 @@ const open = item => {
     dialogTitle.value = "配置角色";
     // console.log("部门", item);
     rolesList.assignmentParams.targetCodes = [];
-    rolesList.assignmentParams.targetCodes.push(item.groupCode);
+    rolesList.assignmentParams.targetCodes.push(item.hospitalCode);
     form.groupName = item.groupName;
     dialogForm.value = false;
   } else {
@@ -133,7 +133,7 @@ defineExpose({
           <el-input v-model="form.groupName" placeholder="请输入" />
         </el-form-item>
         <el-form-item label="用户组编号">
-          <el-input v-model="form.groupCode" placeholder="请输入" />
+          <el-input v-model="form.hospitalCode" placeholder="请输入" />
         </el-form-item>
         <el-form-item label="用户组负责人">
           <el-select v-model="form.leaderCode" placeholder="请选择">

+ 1 - 4
src/views/background/framework/users/components/editPerson.vue

@@ -103,13 +103,10 @@ const timer = ref("");
             </el-form-item>
             <el-form-item label="用户组编号" label-position="top">
               <el-input
-                v-model="formLabelAlign.groupCode"
+                v-model="formLabelAlign.hospitalCode"
                 :disabled="disabledValue"
               />
             </el-form-item>
-            <el-form-item label="用户组ID" label-position="top">
-              <el-input v-model="formLabelAlign.hospitalCode" disabled />
-            </el-form-item>
             <el-form-item label="用户组负责人" label-position="top">
               <el-input
                 v-model="formLabelAlign.leaderCode"