Эх сурвалжийг харах

指标权重,获取指标详情信息

gks 1 жил өмнө
parent
commit
1e569f6279

+ 44 - 21
src/views/norm/feeindex.vue

@@ -4,7 +4,7 @@
       <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
         <el-form-item label="是否启用" prop="status">
           <el-select v-model="queryParams.status" placeholder="请选择是否启用" clearable filterable>
-            <el-option v-for="dict in dict.type.dictType" :key="dict.value" :label="dict.label" :value="dict.value" />
+            <el-option v-for="(item,index) in 2" :key="index" :label="item== 1 ? '启用' : '不启用'" :value="item== 1 ? 1 : 0" />
           </el-select>
         </el-form-item>
         <el-form-item>
@@ -33,7 +33,7 @@
         <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
       </el-row>
 
-      <el-table  v-loading="loading" :data="normData" @selection-change="handleSelectionChange">
+      <el-table v-loading="loading" :data="normData" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="分类占比" align="center" prop="normRatio" />
         <el-table-column label="指标参数名称" align="center" prop="fname" />
@@ -67,7 +67,7 @@
       <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
         <el-form ref="form" :model="form" :rules="rules" label-width="80px">
           <el-form-item label="权数" prop="fnumber">
-            <el-input v-model.number="form.fnumber"></el-input>
+            <el-input v-model="form.fnumber" aria-placeholder="请输入数值"></el-input>
           </el-form-item>
 
           <el-form-item label="分类占比" prop="normRatio">
@@ -90,22 +90,20 @@
             <el-input v-model="form.fvalue"></el-input>
           </el-form-item>
 
-
-
           <el-form-item label="上下公差占比" prop='dfRetio'>
             <el-input v-model="form.dfRetio"></el-input>
           </el-form-item>
 
           <el-form-item label="明细类型" prop='type'>
             <template>
-              <el-radio  v-model="form.type" label="1">采集分类</el-radio>
-              <el-radio  v-model="form.type" label="2">绩效分类</el-radio>
+              <el-radio v-model="form.type" label="1">采集分类</el-radio>
+              <el-radio v-model="form.type" label="2">绩效分类</el-radio>
             </template>
           </el-form-item>
 
-          <el-form-item  :label="form.type == 2 ? '绩效参考值' : '采集参考值'">
-            <el-input v-model="form.meritsValue" key="2"  v-if="form.type == 2"></el-input>
-            <el-input v-model="form.collValue" key="11"  v-if="form.type == 1"></el-input>
+          <el-form-item :label="form.type == 2 ? '绩效参考值' : '采集参考值'">
+            <el-input v-model="form.meritsValue" key="2" v-if="form.type == 2"></el-input>
+            <el-input v-model="form.collValue" key="11" v-if="form.type == 1"></el-input>
           </el-form-item>
 
           <!-- <el-form-item v-if="form.type == 1" key="1" label="采集参考值">
@@ -130,6 +128,8 @@ import { listNORMFEE, getNORMFEE, delNORMFEE, addNORMFEE, updateNORMFEE } from "
 
 import { listData } from '@/api/system/dict/data';
 
+import { formatDate } from "@/utils/index";
+
 export default {
   name: "NORMFEE",
   props: {
@@ -205,7 +205,7 @@ export default {
       // 表单校验
       rules: {
         fnumber: [
-          { required: true, type: "number", message: "权数为数值", trigger: "blur" }
+          { required: true, message: "权数为数值", trigger: "blur" },
         ],
         normRatio: [
           { required: true, message: "分类占比不能为空", trigger: "blur" }
@@ -220,7 +220,7 @@ export default {
           { required: true, message: "指标参数不能为空", trigger: "blur" }
         ],
         dfRetio: [
-          { required: true,  message: "公差占比", trigger: "blur" }
+          { required: true, message: "公差占比", trigger: "blur" }
         ],
         type: [
           { required: true, message: "明细类型", trigger: "blur" }
@@ -244,11 +244,15 @@ export default {
     /** 查询指标权重明细列表 */
     getList() {
       this.loading = true;
-      this.queryParams.id = this.normId;
+      this.queryParams.normId = this.normId;
       listNORMFEE(this.queryParams).then(response => {
+        response.rows.forEach((item, index) => {
+          response.rows[index].status = item.status == 0 ? false : true;
+        });
         this.NORMFEEList = response.rows;
         this.total = response.total;
         this.loading = false;
+        this.$emit("dataHandler", response.rows);
       });
     },
     // 取消按钮
@@ -277,6 +281,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      // console.log(this.queryParams.status);
       this.queryParams.pageNum = 1;
       this.getList();
     },
@@ -311,22 +316,23 @@ export default {
         this.form = response.data;
         this.open = true;
         this.form = row;
-        console.log(this.form);
-
+        console.log(response);
         this.title = "修改指标权重明细";
       });
     },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
+
+        
         this.form.status = 1;
-        if(this.form.type ==2){
-          this.form.collValue=null;
-        }else{
-          this.form.meritsValue=null;
+        if (this.form.type == 2) {
+          this.form.collValue = null;
+        } else {
+          this.form.meritsValue = null;
         }
         if (valid) {
-          this.form.id = this.normId;
+          this.form.normId = this.normId;
           this.form.status = 1;
           // if (this.form.id != null) {
           //   updateNORMFEE(this.form).then(response => {
@@ -356,7 +362,7 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('business/NORMFEE/export', {
+      this.download('/normFee/export', {
         ...this.queryParams
       }, `NORMFEE_${new Date().getTime()}.xlsx`)
     },
@@ -370,6 +376,23 @@ export default {
     // 选择单位处理
     selUnitHandler(val) {
       this.form.funit = val;
+    },
+
+    changeSwitchHandler(data) {
+      let id = data.id;
+      if (data.status) {
+        updateNORMFEE({
+          id,
+          startTime: formatDate(new Date()),
+          status: 1
+        })
+      } else {
+        updateNORMFEE({
+          id,
+          stopTime: formatDate(new Date()),
+          status: 0
+        })
+      }
     }
   },
   // watch:{

+ 12 - 5
src/views/norm/index.vue

@@ -93,7 +93,7 @@
       </div>
     </el-dialog>
 
-    <feeindex @closeHandler="closeHandler" :normData="normData" :normId="normId" :isShowNormDialog="isShowNormDialog" />
+    <feeindex @closeHandler="closeHandler" @dataHandler="dataHandler" :normData="normData" reset :normId="normId" :isShowNormDialog="isShowNormDialog" />
 
 
   </div>
@@ -158,13 +158,14 @@ export default {
         remark: null,
       },
 
+      normData:[],
+
       pageParams: {
         page: 1,
         pageSize: 10,
       },
 
-      // 指标列表每项Id获取到的数据集合
-      normData: [],
+ 
 
       // 指标列表每项Id
       normId: null,
@@ -330,9 +331,11 @@ export default {
     // 表格行点击事件处理
     tableBdClick(row) {
       this.normId = row.id;
-      listNORMFEE({ id: this.normId, ...this.pageParams }).then((res) => {
+      listNORMFEE({ normId:this.normId, ...this.pageParams }).then((res) => {
+        res.rows.forEach((item, index) => {
+          res.rows[index].status = item.status == 0 ? false : true;
+        });
         this.normData = res.rows;
-        console.log(res);
       })
       this.isShowNormDialog = !this.isShowNormDialog;
     },
@@ -344,6 +347,10 @@ export default {
       updateNORM({ id: data.id, status }).then((res) => {
 
       });
+    },
+
+    dataHandler(data){
+      this.normData = data;
     }
   },
 };