Browse Source

Merge branch 'master' into 'master'

慢病和字典优化

See merge request lighter/vue-intergration-platform!74
huangshuhua 1 year ago
parent
commit
3882f88b8e

+ 48 - 9
src/views/clinic/chronicDisease/ChronicDiseaseRegister.vue

@@ -489,7 +489,30 @@
                                 </el-col>
                                 <el-col :span="6">
                                     <el-form-item label="建档医生" prop="creatId">
-                                        <el-input :value="userName" readonly placeholder="系统登录人为创建人" />
+                                        <div v-if="ruleForm.creatId !== '99999'">
+                                            <el-select-v2 disabled v-model="ruleForm.creatId" clearable remote
+                                                style="width: 100%" filterable :options="empList" :remote-method="empMethod"
+                                                placeholder="请选择建档医生">
+                                                <template #default="{ item }">
+                                                    <span style="margin-right: 8px">{{ item.label }}</span>
+                                                    <span style="color: var(--el-text-color-secondary); font-size: 13px">
+                                                        {{ item.value }}
+                                                    </span>
+                                                </template>
+                                            </el-select-v2>
+                                        </div>
+                                        <div v-else>
+                                            <el-select-v2 v-model="ruleForm.creatId" clearable remote style="width: 100%"
+                                                filterable :options="empList" :remote-method="empMethod"
+                                                placeholder="请选择建档医生">
+                                                <template #default="{ item }">
+                                                    <span style="margin-right: 8px">{{ item.label }}</span>
+                                                    <span style="color: var(--el-text-color-secondary); font-size: 13px">
+                                                        {{ item.value }}
+                                                    </span>
+                                                </template>
+                                            </el-select-v2>
+                                        </div>
                                     </el-form-item>
                                 </el-col>
                                 <el-col :span="6">
@@ -552,6 +575,7 @@ onMounted(async () => {
         cityData.value = cityList
         countyData.value = countyList
         empMethod('')
+        ruleForm.value.creatId = userCode
     })
 
 })
@@ -608,6 +632,7 @@ interface RuleForm {
     chronicDiseaseTypeArr: string[]
     createDate: string
     creatId: string
+    userName: string
     provinceCode: string
     cityCode: string
     detailAdress: string
@@ -678,7 +703,8 @@ const ruleForm = ref<RuleForm>({
     chronicDiseaseType: '',
     chronicDiseaseTypeArr: [],
     createDate: now,
-    creatId: userCode,
+    creatId: '',
+    userName: '',
     provinceCode: '430000',
     cityCode: '430100',
     detailAdress: '',
@@ -752,25 +778,25 @@ const rulesAll = reactive<FormRules<RuleForm>>({
         { required: true, message: '请选择下次随访时间', trigger: 'change' },
     ],
     height: [
-        { min: 0, max: 10, message: '不超过10个字符', trigger: 'blur' },
+        { max: 10, message: '不超过10个字符', trigger: 'blur' },
     ],
     weight: [
-        { min: 0, max: 10, message: '不超过10个字符', trigger: 'blur' },
+        { max: 10, message: '不超过10个字符', trigger: 'blur' },
     ],
     temperature: [
-        { min: 0, max: 10, message: '不超过10个字符', trigger: 'blur' },
+        { max: 10, message: '不超过10个字符', trigger: 'blur' },
     ],
     bloodSugar: [
-        { min: 0, max: 10, message: '不超过10个字符', trigger: 'blur' },
+        { max: 10, message: '不超过10个字符', trigger: 'blur' },
     ],
     heartRate: [
-        { min: 0, max: 10, message: '不超过10个字符', trigger: 'blur' },
+        { max: 10, message: '不超过10个字符', trigger: 'blur' },
     ],
     bloodPressureLow: [
-        { min: 0, max: 10, message: '不超过10个字符', trigger: 'blur' },
+        { max: 10, message: '不超过10个字符', trigger: 'blur' },
     ],
     bloodPressureHigh: [
-        { min: 0, max: 10, message: '不超过10个字符', trigger: 'blur' },
+        { max: 10, message: '不超过10个字符', trigger: 'blur' },
     ],
 })
 
@@ -791,6 +817,7 @@ const queryCmr = async () => {
     isQueryBrInfo.value = false
     try {
         await selectCrmPatientMiByCode(code).then((res: any) => {
+            console.log(res)
             ruleForm.value = res
         })
     } catch (error) {
@@ -857,11 +884,22 @@ const addForm = (formEl: FormInstance | undefined) => {
         isEditForm.value = false
     }
     keyCode.value = ''
+    ruleForm.value.creatId = userCode
 }
 
 const editForm = (formEl: FormInstance | undefined) => {
     if (!formEl) return
 
+    if (ruleForm.value.creatId !== '99999' && ruleForm.value.creatId !== userCode) {
+        ElMessage({
+            type: "info",
+            message: '您没有权限修改他人登记的病人信息!',
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
     if (isEditForm.value === true) {
         isEditForm.value = false
     }
@@ -905,6 +943,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
         isEditForm.value = false
     }
     keyCode.value = ''
+    ruleForm.value.creatId = userCode
 }
 
 const provinceCharge = async () => {

+ 67 - 25
src/views/dictionary/personnel/PersonnelDict.vue

@@ -42,25 +42,35 @@
                     </el-table>
                 </el-tab-pane>
                 <el-tab-pane key="empPosition" label="行政职务字典" name="empPosition">
-                    <el-table :data="positionData" border style="width: 100%" stripe highlight-current-row
-                        :key="empPositionKey">
+                    <el-table :data="positionData" border style="width: 100%" height="calc(100% - 1px)" stripe
+                        highlight-current-row :key="empPositionKey" class="position-table normal-size">
                         <el-table-column type="index" label="序号" width="100" />
-                        <el-table-column prop="code" label="分类编码" width="200">
+                        <el-table-column prop="code" label="分类编码" width="160">
                             <template v-slot="scope">
                                 <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
                                 <span v-else>{{ scope.row.code }}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column prop="name" label="名称" width="280">
+                        <el-table-column prop="name" label="名称" width="240">
                             <template v-slot="scope">
                                 <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
                                 <span v-else>{{ scope.row.name }}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column prop="delFlag" label="是否无效(无效填1)" width="200">
+                        <el-table-column prop="delFlag" label="是否无效" width="160">
                             <template v-slot="scope">
-                                <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.delFlag"></el-input>
-                                <span v-else>{{ scope.row.delFlag }}</span>
+                                <div v-if="scope.row.isEdit">
+                                    <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否无效">
+                                        <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
+                                            :value="option.code"></el-option>
+                                    </el-select>
+                                </div>
+                                <div v-else>
+                                    <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
+                                        <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
+                                            :value="option.code"></el-option>
+                                    </el-select>
+                                </div>
                             </template>
                         </el-table-column>
                         <el-table-column prop="pyCode" label="拼音码" width="200" />
@@ -83,8 +93,8 @@
                     </el-table>
                 </el-tab-pane>
                 <el-tab-pane key="empTitle" label="专业技术职称" name="empTitle">
-                    <el-table :data="empTitleData" border style="width: 100%" stripe highlight-current-row
-                        :key="empTitleKey">
+                    <el-table :data="empTitleData" border style="width: 100%" height="calc(100% - 1px)" stripe
+                        highlight-current-row :key="empTitleKey" class="emp-title-table normal-size">
                         <el-table-column type="index" label="序号" width="70" />
                         <el-table-column prop="code" label="分类编码" width="140">
                             <template v-slot="scope">
@@ -110,10 +120,20 @@
                                 <span v-else>{{ scope.row.orderCode }}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column prop="delFlag" label="是否无效(无效填1)" width="160">
+                        <el-table-column prop="delFlag" label="是否无效" width="140">
                             <template v-slot="scope">
-                                <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.delFlag"></el-input>
-                                <span v-else>{{ scope.row.delFlag }}</span>
+                                <div v-if="scope.row.isEdit">
+                                    <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否无效">
+                                        <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
+                                            :value="option.code"></el-option>
+                                    </el-select>
+                                </div>
+                                <div v-else>
+                                    <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
+                                        <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
+                                            :value="option.code"></el-option>
+                                    </el-select>
+                                </div>
                             </template>
                         </el-table-column>
                         <el-table-column prop="pyCode" label="拼音码" width="160" />
@@ -139,22 +159,32 @@
                     <el-table :data="educationData" border style="width: 100%" stripe highlight-current-row
                         :key="educationKey">
                         <el-table-column type="index" label="序号" width="100" />
-                        <el-table-column prop="code" label="分类编码" width="200">
+                        <el-table-column prop="code" label="分类编码" width="140">
                             <template v-slot="scope">
                                 <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
                                 <span v-else>{{ scope.row.code }}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column prop="name" label="名称" width="280">
+                        <el-table-column prop="name" label="名称" width="240">
                             <template v-slot="scope">
                                 <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
                                 <span v-else>{{ scope.row.name }}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column prop="delFlag" label="是否无效(无效填1)" width="200">
+                        <el-table-column prop="delFlag" label="是否无效" width="140">
                             <template v-slot="scope">
-                                <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.delFlag"></el-input>
-                                <span v-else>{{ scope.row.delFlag }}</span>
+                                <div v-if="scope.row.isEdit">
+                                    <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否无效">
+                                        <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
+                                            :value="option.code"></el-option>
+                                    </el-select>
+                                </div>
+                                <div v-else>
+                                    <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
+                                        <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
+                                            :value="option.code"></el-option>
+                                    </el-select>
+                                </div>
                             </template>
                         </el-table-column>
                         <el-table-column prop="pyCode" label="拼音码" width="200" />
@@ -214,19 +244,19 @@
                     <el-table :data="empInmarkData" border style="width: 100%" stripe highlight-current-row
                         :key="empInmarkKey">
                         <el-table-column type="index" label="序号" width="100" />
-                        <el-table-column prop="code" label="分类编码" width="200">
+                        <el-table-column prop="code" label="分类编码" width="160">
                             <template v-slot="scope">
                                 <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
                                 <span v-else>{{ scope.row.code }}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column prop="name" label="名称" width="280">
+                        <el-table-column prop="name" label="名称" width="240">
                             <template v-slot="scope">
                                 <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
                                 <span v-else>{{ scope.row.name }}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column prop="mark" label="标识" width="200">
+                        <el-table-column prop="mark" label="标识" width="150">
                             <template v-slot="scope">
                                 <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.mark"></el-input>
                                 <span v-else>{{ scope.row.mark }}</span>
@@ -270,6 +300,7 @@ import {
 
 const editableTabsValue = ref('deptClass')
 const megTip = '分类编码(code)有变更,原始字典记录存在关联,请谨慎做更改,是否确认!!!'
+const delFlagOptions = [{ code: '0', name: '有效' }, { code: '1', name: '无效' }]
 
 let deptClassKey = ref(1)
 let empPositionKey = ref(1)
@@ -414,6 +445,14 @@ const onAddItem = () => {
             isEdit: true,
             isAdd: true,
         })
+        const el = document.querySelector('.position-table .el-scrollbar__wrap')
+        const el2 = document.querySelector('.position-table .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
     } else if (editableTabsValue.value === 'empTitle') {
         empTitleData.value.push({
             code: '',
@@ -426,6 +465,14 @@ const onAddItem = () => {
             isEdit: true,
             isAdd: true,
         })
+        const el = document.querySelector('.emp-title-table .el-scrollbar__wrap')
+        const el2 = document.querySelector('.emp-title-table .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
     } else if (editableTabsValue.value === 'education') {
         educationData.value.push({
             code: '',
@@ -464,7 +511,6 @@ const editDeptClass = (row) => {
     // 备份原始数据
     row['oldRow'] = JSON.parse(JSON.stringify(row))
     row.isEdit = true
-    deptClassKey.value = Math.random()
 }
 // 取消
 const cancelDeptClass = (row, index) => {
@@ -599,7 +645,6 @@ const editEmpPosition = (row) => {
     // 备份原始数据
     row['oldRow'] = JSON.parse(JSON.stringify(row))
     row.isEdit = true
-    empPositionKey.value = Math.random()
 }
 // 取消
 const cancelEmpPosition = (row, index) => {
@@ -612,7 +657,6 @@ const cancelEmpPosition = (row, index) => {
             row[i] = row.oldRow[i]
         }
     }
-    empPositionKey.value = Math.random()
 }
 // 保存
 const updateEmpPosition = (row) => {
@@ -734,7 +778,6 @@ const editEmpTitle = (row) => {
     // 备份原始数据
     row['oldRow'] = JSON.parse(JSON.stringify(row))
     row.isEdit = true
-    empTitleKey.value = Math.random()
 }
 // 取消
 const cancelEmpTitle = (row, index) => {
@@ -747,7 +790,6 @@ const cancelEmpTitle = (row, index) => {
             row[i] = row.oldRow[i]
         }
     }
-    empTitleKey.value = Math.random()
 }
 // 保存
 const updateEmpTitle = (row) => {