Browse Source

病案指标

yuwandanmian 2 năm trước cách đây
mục cha
commit
96aa9ddd0b

+ 22 - 10
src/views/allcase/caseIndex.vue

@@ -38,7 +38,12 @@
             </el-form-item>
             <el-form-item>
               <el-button type="primary" @click="onSearch">查询</el-button>
-              <el-button v-if="$route.query.type === 'children'" type="text" @click="onBack">返回</el-button>
+            </el-form-item>
+            <el-form-item v-if="greenColorMenus.includes(ruleId) && tableData.length" style="float: right;">
+              <el-button @click="onChangeValue">编辑</el-button>
+            </el-form-item>
+            <el-form-item style="float: right;">
+              <el-button v-if="$route.query.type === 'children'" @click="onBack">返回</el-button>
             </el-form-item>
           </el-form>
           <el-table :data="tableData" style="width: 100%">
@@ -46,7 +51,7 @@
             <el-table-column prop="time" label="日期" width="200"></el-table-column>
             <el-table-column prop="" label="数据" width="200">
               <template slot-scope="scope">
-                <span v-if="ruleId > 100" class="link" @click="toCaseIndexPage(scope.row)">{{ scope.row[judgeNum] }}</span>
+                <span v-if="ruleId > 100" class="link" :class="{'pointer': scope.row.source !== '人工录入'}" @click="toCaseIndexPage(scope.row)">{{ scope.row[judgeNum] }}</span>
                 <span v-else>{{ (scope.row.res * 100).toFixed(2) + '%' }}</span>
               </template>
             </el-table-column>
@@ -56,15 +61,11 @@
               </template>
             </el-table-column>
             <el-table-column prop="" label="操作" width="120">
-              <template slot="header" v-if="greenColorMenus.includes(ruleId)">
-                <span>操作</span>
-                <i class="el-icon-edit" @click="onChangeValue" style="margin-left: 15px;"></i>
-              </template>
               <template slot-scope="scope">
                 <!-- 全年不可修改 -->
                 <!-- 非人工录入不可修改 -->
                 <!-- 菜单未标记的不可修改 -->
-                <el-button type="text" @click="onChangeValue(scope.row)" v-if="scope.row.source === '人工录入' && scope.row.time !== '全年' && greenColorMenus.includes(this.ruleId)">修改</el-button>
+                <el-button type="text" @click="onChangeValue(scope.row)" v-if="scope.row.source === '人工录入' && scope.row.time !== '全年'">修改</el-button>
                 <span v-else>--</span>
               </template>
             </el-table-column>
@@ -72,7 +73,7 @@
         </div>
       </el-col>
     </el-row>
-    <ChangeCaseIndexValueDialogVue v-if="dialogData.bSwitch" :data="dialogData" />
+    <ChangeCaseIndexValueDialogVue v-if="dialogData.bSwitch" :data="dialogData" @refresh="getList" />
   </div>
 </template>
 
@@ -553,6 +554,9 @@ export default {
     },
     menuList() {
       return this.$route.query.type === 'children' ? this.cMenus : this.menus
+    },
+    judgeEdit() {
+      return this.greenColorMenus.includes(this.ruleId)
     }
   },
   watch: {
@@ -570,7 +574,7 @@ export default {
           month: time.split('-')[1],
           flag: Number(this.ruleId.toString().slice(0, 2)),
           type: this.judgeNum,
-          num: row[this.judgeNum]
+          num: row[this.judgeNum],
         }
         // 先清空在赋值,防止重复
         this.$set(this.dialogData, 'rows', [])
@@ -578,7 +582,6 @@ export default {
       } else {
         // 批量修改
         // 先清空在赋值,防止重复
-          console.log(this.tableData)
         this.$set(this.dialogData, 'rows', [])
         this.tableData.map(item => {
           const { time, source } = item
@@ -630,10 +633,16 @@ export default {
         year,
         type: Number(`${this.ruleId}`.slice(0, 2)),
       };
+      if (this.ruleId < 100) {
+        params.request_source = 1
+      } else {
+        params.request_source = this.judgeNum === 'denominator' ? 2 : 3
+      }
       this.$axios2.post('/get_assessment_indicators', params).then(res => {
         if (Array.isArray(res.data)) {
           res.data.map(item => {
             item.name = this.ruleName;
+            item.ruleId = this.ruleId
           });
           this.tableData = res.data;
         } else {
@@ -662,6 +671,9 @@ export default {
 .link {
   font-weight: 600;
   color: #409eff;
+}
+
+.pointer {
   cursor: pointer;
 }
 .box {

+ 11 - 10
src/views/allcase/components/ChangeCaseIndexValueDialog.vue

@@ -39,16 +39,17 @@
     },
     methods: {
       onSubmit() {
-        // this.$axios2.post('/get_assessment_indicators', params).then(res => {
-        //   if (Array.isArray(res.data)) {
-        //     res.data.map(item => {
-        //       item.name = this.ruleName;
-        //     });
-        //     this.tableData = res.data;
-        //   } else {
-        //     this.tableData = [];
-        //   }
-        // });
+        const params = {
+          save_data: JSON.parse(JSON.stringify(this.data.rows))
+        }
+        params.save_data.map(item => {
+          item.num = this.num
+        })
+        this.$axios2.post('/add_zb', params).then(res => {
+          this.$message.success('修改成功')
+          this.data.bSwitch = false
+          this.$emit('refresh')
+        });
       }
     }
   }