Jelajahi Sumber

评估配置

chenying2100 1 bulan lalu
induk
melakukan
47299aedba

+ 12 - 0
src/api/system/screeningAssessmentConfig/index.ts

@@ -51,6 +51,18 @@ export const updateScreeningAssessmentConfig = (data: ScreeningAssessmentConfigF
   });
 };
 
+export const changeConfigStatus = (configId: string | number, status: string) => {
+  const data = {
+    configId,
+    status
+  };
+  return request({
+    url: '/system/screeningAssessmentConfig/changeStatus',
+    method: 'put',
+    data: data
+  });
+};
+
 /**
  * 删除筛查/评估配置
  * @param configId

+ 44 - 14
src/api/system/screeningAssessmentConfig/types.ts

@@ -38,15 +38,20 @@ export interface ScreeningAssessmentConfigVO {
    * 状态(0正常 1停用)
    */
   status: string;
-
 }
 
 export interface QuestionAttrVO {
+  labelFlag?: boolean;
   label: string;
-  value: string;
+  value?: string;
   nameEn: string;
   formType?: string;
   score?: string;
+  img?: string;
+  allowFillBlank?: boolean;
+  unit?: string;
+  optionContent?: string;
+  optionFlag?: boolean;
 }
 
 export interface QuestionVO {
@@ -65,18 +70,44 @@ export interface QuestionVO {
    */
   questionType: string;
 
-  required?:boolean
+  /**
+   * 子题型
+   */
+  questionChildType?: string;
 
-  arrangement?:string
+  /**
+   * 系统参数-other类型:
+   */
+  lastType?: string;
+
+  /**
+   * 是否必填
+   */
+  required?: boolean;
+
+  /**
+   * 横向排列、竖向排列
+   */
+  arrangement?: string;
+
+  /**
+   * 累计选项得分、按最高分、按最低分
+   */
+  scoreMethod?: string;
 
   /**
    * 内容
-  */
+   */
   content: string;
 
-  selected?: boolean;   
+  /**
+   * 是否被选择
+   */
+  selected?: boolean;
 
   contentList: Array<QuestionAttrVO>;
+
+  increment?: number;
 }
 
 export interface ScreeningAssessmentConfigForm extends BaseEntity {
@@ -120,10 +151,12 @@ export interface ScreeningAssessmentConfigForm extends BaseEntity {
    */
   status?: string;
 
+  baseInfo: QuestionVO;
+
+  otherInfo: QuestionVO[];
 }
 
 export interface ScreeningAssessmentConfigQuery extends PageQuery {
-
   /**
    * 量表类型
    */
@@ -154,11 +187,8 @@ export interface ScreeningAssessmentConfigQuery extends PageQuery {
    */
   status?: string;
 
-    /**
-     * 日期范围参数
-     */
-    params?: any;
+  /**
+   * 日期范围参数
+   */
+  params?: any;
 }
-
-
-

File diff ditekan karena terlalu besar
+ 650 - 197
src/views/system/screeningAssessmentConfig/add.vue


+ 43 - 20
src/views/system/screeningAssessmentConfig/index.vue

@@ -4,8 +4,8 @@
       <div v-show="showSearch" class="mb-[10px]">
         <el-card shadow="hover">
           <el-form ref="queryFormRef" :model="queryParams" :inline="true">
-            <el-form-item label="模板类型" prop="gender">
-              <el-select v-model="queryParams.gender" placeholder="请选择" clearable>
+            <el-form-item label="模板类型" prop="type">
+              <el-select v-model="queryParams.type" placeholder="请选择" clearable>
                 <el-option v-for="dict in scale_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
               </el-select>
             </el-form-item>             
@@ -43,23 +43,26 @@
       <el-table v-loading="loading" border :data="screeningAssessmentConfigList" >
         <!-- <el-table-column type="selection" width="55" align="center" />        @selection-change="handleSelectionChange" -->
         <el-table-column label="模板名称" align="center" prop="name" />
-        <el-table-column label="模板类型" align="center" prop="type" />
-        <el-table-column label="模板类型" align="center" prop="type" />
-        <el-table-column label="创建人" align="center" prop="createBy" />
-        <el-table-column label="状态" align="center" prop="status" />
+        <el-table-column label="模板类型" align="center" prop="typeName" />        
+        <el-table-column label="创建人" align="center" prop="createByName" />
+        <el-table-column label="状态" align="center" width="100">
+          <template #default="scope">
+            <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template #default="scope">
-            <el-tooltip content="预览" placement="top">
-              <el-button link type="primary" icon="View" @click="handleUpdate(scope.row)">预览</el-button>
-            </el-tooltip>
+            <!-- <el-tooltip content="预览" placement="top">
+              <el-button link type="primary" icon="View" @click="handleView(scope.row)">预览</el-button>
+            </el-tooltip> -->
             <el-tooltip content="编辑" placement="top">
-              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:screeningAssessmentConfig:edit']">编辑</el-button>
+              <el-button link type="primary" icon="Edit" @click="handleUpdate(false,scope.row)" v-hasPermi="['system:screeningAssessmentConfig:edit']">编辑</el-button>
             </el-tooltip>
             <el-tooltip content="删除" placement="top">
               <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:screeningAssessmentConfig:remove']">删除</el-button>
             </el-tooltip>
             <el-tooltip content="修改结论" placement="top">
-              <el-button link type="primary" icon="Edit" @click="handleDelete(scope.row)">修改结论</el-button>
+              <el-button link type="primary" icon="Edit" @click="handleReviseConclusion(scope.row)">修改结论</el-button>
             </el-tooltip>
           </template>
         </el-table-column>
@@ -97,11 +100,11 @@
 </template>
 
 <script setup name="ScreeningAssessmentConfig" lang="ts">
-import { listScreeningAssessmentConfig, getScreeningAssessmentConfig, delScreeningAssessmentConfig, addScreeningAssessmentConfig, updateScreeningAssessmentConfig } from '@/api/system/screeningAssessmentConfig';
+import { listScreeningAssessmentConfig,changeConfigStatus, getScreeningAssessmentConfig, delScreeningAssessmentConfig, addScreeningAssessmentConfig, updateScreeningAssessmentConfig } from '@/api/system/screeningAssessmentConfig';
 import { ScreeningAssessmentConfigVO, ScreeningAssessmentConfigQuery, ScreeningAssessmentConfigForm } from '@/api/system/screeningAssessmentConfig/types';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const {scale_type } = toRefs<any>(proxy?.useDict('scale_type'));
+const {scale_type} = toRefs<any>(proxy?.useDict('scale_type'));
 
 const screeningAssessmentConfigList = ref<ScreeningAssessmentConfigVO[]>([]);
 const buttonLoading = ref(false);
@@ -224,6 +227,20 @@ const handleUpdate = async (disabled:boolean,row?: ScreeningAssessmentConfigVO)
   } 
 }
 
+/** 修改结论 */
+const handleReviseConclusion = async (row?: ScreeningAssessmentConfigVO) => { 
+  const _configId = row?.configId || ids.value[0]
+   
+}
+
+/** 预览 */
+const handleView = async (row?: ScreeningAssessmentConfigVO) => { 
+  const _configId = row?.configId || ids.value[0]
+   
+}
+
+
+
 /** 提交按钮 */
 const submitForm = () => {
   screeningAssessmentConfigFormRef.value?.validate(async (valid: boolean) => {
@@ -244,18 +261,24 @@ const submitForm = () => {
 /** 删除按钮操作 */
 const handleDelete = async (row?: ScreeningAssessmentConfigVO) => {
   const _configIds = row?.configId || ids.value;
-  await proxy?.$modal.confirm('是否确认删除筛查/评估配置编号为"' + _configIds + '"的数据项?').finally(() => loading.value = false);
+  await proxy?.$modal.confirm('是否确认删除模版名称为"' + row.name + '"的数据项?').finally(() => loading.value = false);
   await delScreeningAssessmentConfig(_configIds);
   proxy?.$modal.msgSuccess("删除成功");
   await getList();
 }
+ 
 
-/** 导出按钮操作 */
-const handleExport = () => {
-  proxy?.download('system/screeningAssessmentConfig/export', {
-    ...queryParams.value
-  }, `screeningAssessmentConfig_${new Date().getTime()}.xlsx`)
-}
+
+const handleStatusChange = async (row: ScreeningAssessmentConfigVO) => {
+  const text = row.status === '0' ? '启用' : '停用';
+  try {
+    await proxy?.$modal.confirm('确认要"' + text + '""' + row.name + '"模版名称吗?');
+    await changeConfigStatus(row.configId, row.status);
+    proxy?.$modal.msgSuccess(text + '成功');
+  } catch {
+    row.status = row.status === '0' ? '1' : '0';
+  }
+};
 
 onMounted(() => {
   getList();

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini