Jelajahi Sumber

修改指标

yuwandanmian 2 tahun lalu
induk
melakukan
89b6d9ea56

+ 76 - 11
src/views/allcase/caseIndex.vue

@@ -14,7 +14,11 @@
             :filter-node-method="filterNode"
             ref="tree"
             @node-click="handleNodeClick"
-          ></el-tree>
+          >
+             <span class="custom-tree-node" slot-scope="{ node, data }">
+              <span :class="{'green': greenColorMenus.includes(data.id)}">{{ node.label }}</span>
+            </span>
+          </el-tree>
         </div>
       </el-col>
       <!-- 右侧列表 -->
@@ -46,16 +50,38 @@
                 <span v-else>{{ (scope.row.res * 100).toFixed(2) + '%' }}</span>
               </template>
             </el-table-column>
-            <el-table-column prop="source" label="来源" width="200"></el-table-column>
+            <el-table-column prop="" label="来源" width="200">
+              <template slot-scope="scope">
+                <span :class="{'green': scope.row.source === '人工录入' }">{{ scope.row.source }}</span>
+              </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>
+                <span v-else>--</span>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
       </el-col>
     </el-row>
+    <ChangeCaseIndexValueDialogVue v-if="dialogData.bSwitch" :data="dialogData" />
   </div>
 </template>
 
 <script>
+import ChangeCaseIndexValueDialogVue from './components/ChangeCaseIndexValueDialog.vue';
 export default {
+  components: {
+    ChangeCaseIndexValueDialogVue
+  },
   data() {
     return {
       menus: [
@@ -504,6 +530,11 @@ export default {
           return year < timeYear;
         },
       },
+      greenColorMenus: [11, 112, 12, 121, 122, 13, 132],
+      dialogData: {
+        bSwitch: false,
+        rows: []
+      }
     };
   },
   computed: {
@@ -527,23 +558,54 @@ export default {
   watch: {
     filterText(val) {
       this.$refs.tree.filter(val);
-    },
-    $route(to, from) {
-      if (to.query.type === 'children' || from.query.type === 'children') {
-      }
-      // if (from.path == '/caseIndexList' && from.query.ruleId == 33) {
-      //   this.$router.go(0)
-      // }
-    },
+    }
   },
   methods: {
+    onChangeValue(row) {
+      if (row.time) {
+        // 单个修改
+        const { time } = row
+        const obj = {
+          year: time.split('-')[0],
+          month: time.split('-')[1],
+          flag: Number(this.ruleId.toString().slice(0, 2)),
+          type: this.judgeNum,
+          num: row[this.judgeNum]
+        }
+        // 先清空在赋值,防止重复
+        this.$set(this.dialogData, 'rows', [])
+        this.dialogData.rows.push(obj)
+      } else {
+        // 批量修改
+        // 先清空在赋值,防止重复
+          console.log(this.tableData)
+        this.$set(this.dialogData, 'rows', [])
+        this.tableData.map(item => {
+          const { time, source } = item
+          if (source === '人工录入') {
+            const obj = {
+              year: time.split('-')[0],
+              month: time.split('-')[1],
+              flag: Number(this.ruleId.toString().slice(0, 2)),
+              type: this.judgeNum,
+              num: item[this.judgeNum]
+            }
+            this.dialogData.rows.push(obj)
+          }
+        })
+      }
+      this.dialogData.bSwitch = true
+    },
     // 返回
     onBack() {
       this.$router.go(-1)
     },
     // 病案指标列表跳转
     toCaseIndexPage(row) {
-      const { time } = row;
+      const { time, source } = row;
+      if ( source === '人工录入') {
+        return
+      }
       this.$router.push({ path: '/caseIndexList', query: { time, ruleId: Number(`${this.ruleId}`.slice(0, 2)), type: this.judgeNum } });
     },
     // 菜单筛选
@@ -635,4 +697,7 @@ export default {
 ::v-deep.el-table .el-table__header tr th:nth-child(3) {
   border-radius: 0px 5px 5px 0px;
 }
+.green {
+  color: #67C23A;
+}
 </style>

+ 64 - 0
src/views/allcase/components/ChangeCaseIndexValueDialog.vue

@@ -0,0 +1,64 @@
+<template>
+  <div>
+    <el-dialog
+      title="修改"
+      :visible.sync="data.bSwitch"
+      width="400px">
+      <span style="line-height: 40px;">请输入指标数据</span>
+      <el-input-number v-model="num" :min="0" label="请输入" :controls="false" style="width: 100%;"></el-input-number>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="data.bSwitch = false">取 消</el-button>
+        <el-button type="primary" @click="onSubmit">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  export default {
+    props: {
+      data: {
+        type: Object,
+        default() {
+          return {
+            bSwitch: false,
+            rows: []
+          }
+        }
+      }
+    },
+    data() {
+      return {
+        num: 0
+      }
+    },
+    created() {
+      if (this.data.rows.length === 1) {
+      this.num = this.data.rows[0].num
+      }
+    },
+    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 = [];
+        //   }
+        // });
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-dialog__body {
+  padding: 10px 20px;
+}
+::v-deep .el-input-number .el-input__inner {
+  text-align: left;
+}
+</style>