Преглед на файлове

feat(@six/smart-pharmacy): 智慧药事系统第二版-用户管理点评专家字段新增

cmj преди 2 седмици
родител
ревизия
c41bffcfe8

+ 2 - 0
apps/smart-pharmacy/src/api/method/system.ts

@@ -68,6 +68,8 @@ export namespace SystemModel {
     stateSel?: 0 | 1;
     status?: 0 | 1;
     roleNames?: string;
+    /** 用户类型:01 点评专家 */
+    userType?: string;
     createUser?: string;
     hospitalName?: string;
   }

+ 2 - 0
apps/smart-pharmacy/src/api/model/user.ts

@@ -39,6 +39,7 @@ export function fromUser(data?: TransformData): SystemModel.User {
         )
         .filter(Boolean)
         .join(',') ?? '',
+    userType: data?.userType,
     remark: data?.remark,
     createUser: data?.createBy ?? data?.createUser,
   };
@@ -69,6 +70,7 @@ export function toUser(data?: Partial<SystemModel.User>): TransformData {
     deptId: data?.sititutionId,
     roleIds: roleIds.length > 0 ? roleIds : void 0,
     status,
+    userType: data?.userType,
     remark: data?.remark,
     // 兼容旧接口查询
     pid: userId || void 0,

+ 3 - 1
apps/smart-pharmacy/src/locales/langs/zh-CN/system.json

@@ -24,7 +24,9 @@
     "password": "密码",
     "mobile": "手机号码",
     "status": "状态",
-    "remark": "备注"
+    "remark": "备注",
+    "reviewExpert": "点评专家",
+    "reviewExpertMember": "处方点评专家组成员"
   },
   "organization": {
     "_": "机构",

+ 24 - 0
apps/smart-pharmacy/src/views/system/user/data.ts

@@ -86,6 +86,17 @@ export function useUserTableColumns<T = SystemModel.User>(
         },
       },
     },
+    {
+      field: 'userType',
+      title: $t('system.user.reviewExpert'),
+      minWidth: 100,
+      slots: {
+        default: ({ row }) => {
+          const user = row as SystemModel.User;
+          return user.userType === '01' ? '是' : '否';
+        },
+      },
+    },
     {
       field: 'createUser',
       title: $t('system.organization.createUser'),
@@ -209,6 +220,19 @@ export function useUserFormSchema(mode: 'add' | 'edit' = 'add'): VbenFormSchema[
       label: $t('system.role._'),
       rules: 'selectRequired',
     },
+    {
+      component: 'RadioGroup',
+      componentProps: {
+        options: [
+          { label: '是', value: '01' },
+          { label: '否', value: '00' },
+        ],
+      },
+      defaultValue: '00',
+      fieldName: 'userType',
+      label: $t('system.user.reviewExpertMember'),
+      rules: 'selectRequired',
+    },
     {
       component: 'Input',
       fieldName: 'remark',

+ 4 - 0
apps/smart-pharmacy/src/views/system/user/modules/form.vue

@@ -28,6 +28,9 @@ const getTitle = computed(() => {
 });
 
 const [Form, formApi] = useVbenForm({
+  commonConfig: {
+    labelWidth: 135, // 单位 px,按实际文案长度调整
+  },
   schema: useUserFormSchema('add'),
   showDefaultActions: false,
 });
@@ -65,6 +68,7 @@ const [Modal, modalApi] = useVbenModal({
         formData.value.roles = data.roles?.map((role) =>
           typeof role === 'string' ? role : role.id,
         );
+        formData.value.userType = data.userType === '01' ? '01' : '00';
         formApi.setValues(formData.value);
       }
     }