Browse Source

web-站点人员添加启用禁用功能

liao-sea 10 months ago
parent
commit
ee0f385cb1

+ 2 - 0
doc/待更新脚本

@@ -0,0 +1,2 @@
+--2024.05.11 站点人员新增启用禁用功能
+INSERT INTO  sys_function_code (`FunctionCode`, `FunctionName`, `ParentFunctionCode`, `OrderNo`) VALUES ('T01010307', '启用禁用', 'T010103', 7);

+ 1 - 0
src/main/java/com/hz/employmentsite/vo/baseSettings/SiteUserVo.java

@@ -47,6 +47,7 @@ public class SiteUserVo {
     public String occupationalLevelName;
 
     public String userID;
+    public Integer recordStatus;
     //注意:roleID已用于绑定用户表sys_user中用户类型字典,非角色类型数据
     public Integer roleID;
     public String roleName;

+ 10 - 24
src/main/resources/mapping/cquery/SiteUserCQuery.xml

@@ -6,35 +6,21 @@
         ,inSites.InstitutionID as institutionID,site.regionCode, dic_fullTime.Name as isFullTimeName
         ,occ_cat.OccupationalName as occupationalCategoryName, dic_occ_level.Name as occupationalLevelName
         ,dic_nation.Name as nationName, dic_politicsStatus.Name as politicsStatusName
-        ,dic_culture.Name as cultureRankName, updateUser.Name as updateUserName
+        ,dic_culture.Name as cultureRankName, updateUser.Name as updateUserName,curUser.RecordStatus
         from pc_site_user siteUser
         left join pc_site site on siteUser.siteID = site.siteID
-        left join (select * from sys_dictionary_item where DictionaryCode ='UserType' ) dic_userRole on siteUser.RoleID
-        = dic_userRole.Value
-        left join (select * from sys_dictionary_item where DictionaryCode ='Gender' ) dic_gender on siteUser.Gender =
-        dic_gender.Value
-        left join (select * from sys_dictionary_item where DictionaryCode ='IsFullTime' ) dic_fullTime on
-        siteUser.IsFullTime
-        =
-        dic_fullTime.Value
-        left join pc_occupational occ_cat on
-        siteUser.OccupationalCategory =
-        occ_cat.OccupationalID
-        left join (select * from sys_dictionary_item where DictionaryCode ='OccupationalLevel' ) dic_occ_level on
-        siteUser.OccupationalLevel =
-        dic_occ_level.Value
-        left join (select * from sys_dictionary_item where DictionaryCode ='NationType' ) dic_nation on
-        siteUser.Nation =
-        dic_nation.Value
-        left join (select * from sys_dictionary_item where DictionaryCode ='PoliticsStatus' ) dic_politicsStatus on
-        siteUser.PoliticsStatusID =
-        dic_politicsStatus.Value
-        left join (select * from sys_dictionary_item where DictionaryCode ='HighestDegree' ) dic_culture on
-        siteUser.CultureRank =
-        dic_culture.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='UserType' ) dic_userRole on siteUser.RoleID = dic_userRole.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='Gender' ) dic_gender on siteUser.Gender = dic_gender.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='IsFullTime' ) dic_fullTime on siteUser.IsFullTime = dic_fullTime.Value
+        left join pc_occupational occ_cat on siteUser.OccupationalCategory = occ_cat.OccupationalID
+        left join (select * from sys_dictionary_item where DictionaryCode ='OccupationalLevel' ) dic_occ_level on siteUser.OccupationalLevel = dic_occ_level.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='NationType' ) dic_nation on siteUser.Nation = dic_nation.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='PoliticsStatus' ) dic_politicsStatus on siteUser.PoliticsStatusID = dic_politicsStatus.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='HighestDegree' ) dic_culture on siteUser.CultureRank = dic_culture.Value
         left join pc_site_institution inSites on site.SiteID = inSites.SiteID
         left join pc_institution institution on inSites.institutionID = institution.InstitutionID
         left join sys_user updateUser on siteUser.UpdateBy = updateUser.UserID
+        left join sys_user curUser on siteUser.UserID = curUser.UserID
         where 1=1
         <if test="siteUserIDList!='' and siteUserIDList!=null">
             and siteUserID in (${siteUserIDList})

+ 11 - 1
vue/src/views/baseSettings/siteUser/index.vue

@@ -64,6 +64,7 @@
               </a-button>
               <a-button type="link" size="small"  functioncode="T01010303"  @click='onEdit(record.siteUserID)' >编辑</a-button>
               <a-button type="link" size="small"  functioncode="T01010304"  @click="onDel(record)" >删除</a-button>
+              <a-button type="link" size="small"  functioncode="T01010307"  @click="onChangeStatus(record.userID,record.recordStatus==1?0:1)" >{{ record.recordStatus==1?"禁用":"启用" }}</a-button>
             </div>
           </template>
         </template>
@@ -84,6 +85,7 @@ import {getPaginationTotalTitle} from "@/utils/common";
 import {getSiteList} from "@/api/baseSettings/siteInfo";
 import BImportExcel from "@/components/basic/excel/importExcel/importExcel.vue";
 import type {ImportProps} from "@/components/basic/excel/importExcel/ImportProps";
+import {updateUserStatus} from "@/api/system/user";
 
 export default defineComponent({
   name: 'UserInfoList',
@@ -118,8 +120,11 @@ export default defineComponent({
       {title: '性别', dataIndex: 'genderName', key: 'genderName', align: "center"},
       {title: '联系电话', dataIndex: 'mobile', key: 'mobile', align: "center"},
       {title: '年龄', dataIndex: 'age', key: 'age', align: "center"},
+      {title: '状态', dataIndex: 'recordStatus', key: 'recordStatus', align: "center",
+        customRender:  ({record}) => record.recordStatus == 1?"正常":"禁用"
+      },
       {title: '所属驿站', dataIndex: 'siteName', key: 'siteName', align: "center"},
-      {title: '操作', key: 'operation', fixed: 'right', width: 150, align: "center"},
+      {title: '操作', key: 'operation', fixed: 'right', align: "center"},
     ];
     const importOptions = ref<ImportProps>({
       title: '导入',
@@ -210,6 +215,10 @@ export default defineComponent({
       });
     };
 
+    const onChangeStatus = (userID: any,statusValue:any) => {
+      updateUserStatus({ userId: userID,status:statusValue });
+      loadData();
+    };
 
     const loadData = async function () {
       formState.loading = true;
@@ -246,6 +255,7 @@ export default defineComponent({
       onAdd,
       onEdit,
       onDel,
+      onChangeStatus,
       loadData,
       onDetail,
       importOptions,