coys vor 2 Jahren
Ursprung
Commit
14ec5d19bc

+ 4 - 3
.env.development

@@ -10,12 +10,13 @@ ENV = 'development'
 #罗俊
 # VUE_APP_BASE_API = 'http://10.87.10.49:8080'
 #罗伟
-VUE_APP_BASE_API = 'http://10.87.10.47:8080'
+# VUE_APP_BASE_API = 'http://10.87.10.47:8080'
 #高雄
 #VUE_APP_BASE_API = 'http://10.87.11.94:8080'
-VUE_APP_BASE_API = 'http://localhost:8080'
+# VUE_APP_BASE_API = 'http://localhost:8080'
 # 55环境
-VUE_APP_BASE_API = 'http://10.87.10.55:8080'
+VUE_APP_BASE_API = 'http://10.87.11.173:8080'
+
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 49 - 0
src/api/evaluateRule/rule.js

@@ -0,0 +1,49 @@
+import request from "@/utils/request";
+//安全指标配置
+// 查询列表
+export function list(query) {
+  return request({
+    url: "/core/safetyIndexRule/list",
+    method: "get",
+    params: query,
+  });
+}
+// 指标分类数据列表
+export function getTargetList() {
+  return request({
+    url: "/core/safetyDict/list",
+    method: "get",
+  });
+}
+// 新增规则配置
+export function addTargetEvaluate(data) {
+  return request({
+    url: "/core/safetyIndexRule",
+    method: "post",
+    data
+  });
+}
+// 编辑规则配置
+export function editTargetEvaluate(data) {
+  return request({
+    url: "/core/safetyIndexRule",
+    method: "put",
+    data
+  });
+}
+// 获取详情
+export function getEvaluateById(id) {
+  return request({
+    url: `/core/safetyIndexRule/${id}`,
+    method: "get",
+    
+  });
+}
+// 删除
+export function delelteEvaluate(id) {
+  return request({
+    url: `/core/safetyIndexRule/${id}`,
+    method: "delete",
+    
+  });
+}

+ 194 - 0
src/api/tool/tree.js

@@ -0,0 +1,194 @@
+/**
+ * 树形数据处理
+ * tree-tool
+ */
+
+const DEFAULT_CONFIG = {
+  id: 'id',
+  children: 'children',
+  pid: 'pid'
+}
+
+const getConfig = (config) => Object.assign({}, DEFAULT_CONFIG, config)
+
+/**
+ * 列表结构转树结构
+ * @param {array} list 列表数据
+ * @param {object} config 键名配置
+ * @returns
+ */
+export function toTree(list, config = {}) {
+  config = getConfig(config)
+  const nodeMap = new Map(),
+    result = [],
+    { id, children, pid } = config
+  // 第一遍循环生成nodeMap
+  for (const node of list) {
+    nodeMap.set(node[id], node)
+  }
+  // 第二遍循环将【每项放到对应的父级下】,如果没有则父级放到result
+  for (const node of list) {
+    const parent = nodeMap.get(node[pid])
+    if (parent) {
+      if (parent[children]) {
+        parent[children].push(node)
+      } else {
+        parent[children] = [node]
+      }
+    } else {
+      result.push(node)
+    }
+  }
+  return result
+}
+
+/**
+ * 树结构转列表结构
+ * @param {array} tree 树状数据
+ * @param {object} config 键名配置
+ * @returns
+ */
+export function toList(tree, config = {}) {
+  config = getConfig(config)
+  // 先放入第一层
+  const { children } = config,
+    result = [...tree]
+  for (let i = 0; i < result.length; i++) {
+    if (!result[i][children]) continue
+    result.splice(i + 1, 0, ...result[i][children])
+    delete result[i][children]
+  }
+  return result
+}
+
+/**
+ * 查询节点路径
+ * @param {array} tree
+ * @param {function} func
+ * @param {object} config
+ * @returns
+ */
+export function treeFindPath(tree, func, config = {}, path = []) {
+  config = getConfig(config)
+  if (!tree) return []
+  for (const data of tree) {
+    path.push(data[config.id])
+    if (func(data)) return path
+    if (data[config.children]) {
+      const findChildren = treeFindPath(
+        data[config.children],
+        func,
+        config,
+        path
+      )
+      if (findChildren.length) return findChildren
+    }
+    path.pop()
+  }
+  return []
+}
+
+/**
+ * 查找符合条件的单个节点
+ * @param {array} tree 树型数据
+ * @param {function} func 判断函数
+ * @param {any} config 配置参数
+ * @returns
+ */
+export function findNode(tree, func, config = {}) {
+  config = getConfig(config)
+  const { children } = config,
+    list = [...tree]
+  for (let node of list) {
+    if (func(node)) return node
+    node[children] && list.push(...node[children])
+  }
+  return null
+}
+
+/**
+ * 查找符合条件的所有节点
+ * @param {array} tree 树型数据
+ * @param {function} func 判断函数
+ * @param {any} config 配置参数
+ * @returns
+ */
+export function findNodeAll(tree, func, config = {}) {
+  config = getConfig(config)
+  const { children } = config,
+    list = [...tree],
+    result = []
+  for (let node of list) {
+    func(node) && result.push(node)
+    node[children] && list.push(...node[children])
+  }
+  return result
+}
+
+/**
+ * 深度优先查询
+ * @param {array} tree
+ * @param {function} func
+ * @returns
+ */
+export function deepQuery(tree, func, config = {}) {
+  config = getConfig(config)
+  const { children } = config
+  var stark = []
+  stark = stark.concat(tree)
+  while (stark.length) {
+    var temp = stark.shift()
+    if (temp[children]) {
+      stark = temp[children].concat(stark)
+    }
+
+    if (func(temp)) return temp
+  }
+}
+
+/**
+ * 广度优先查询
+ * @param {array} tree
+ * @param {function} func
+ * @returns
+ */
+export function breadthQuery(tree, func, config = {}) {
+  config = getConfig(config)
+  const { children } = config
+  var stark = []
+  stark = stark.concat(tree)
+  while (stark.length) {
+    var temp = stark.shift()
+    if (temp[children]) {
+      stark = stark.concat(temp[children])
+    }
+    if (func(temp)) return temp
+  }
+}
+export function wjforTreegetId() {}
+export function funclist(list) {
+  let newList = []
+  list.forEach((item) => {
+    if (item.hierarchy == '/') {
+      item.mid = '/'
+      item.pid = '0'
+      // newList.push(item)
+    } else {
+      let str = item.hierarchy
+      item.mid = item.hierarchy
+      item.pid = str.substring(0, str.length - 5)
+      newList.push(item)
+    }
+  })
+  return newList
+}
+// 获取包含根的树形数据
+export function getgenFunclist(list) {
+  return list.map((e) => {
+    const s = e.hierarchy
+    const isRoot = s == '/'
+    e.mid = isRoot ? '/' : s
+    e.pid = isRoot ? '0' : s.substring(0, s.length - 5)
+    return e
+  })
+}

+ 129 - 0
src/views/evaluationRule/addEvaluate.vue

@@ -0,0 +1,129 @@
+<template>
+  <div>
+    <DialogCom
+      :visible.sync="isShow"
+      :width="'500px'"
+      :title="`${id ? '编辑' : '新增'}扣分规则`"
+      @close="closeHandler"
+      destroy-on-close
+    >
+      <el-form
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="100px"
+        class="demo-ruleForm"
+      >
+        <el-form-item label="计算项目" prop="indicatorNote">
+          <el-input
+            placeholder="请输入计算项目"
+            v-model="ruleForm.indicatorNote"
+            clearable
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item label="计算类型">
+          <!-- 1累计数,2连续数,3 分类,4 固化值 -->
+          <el-radio-group v-model="ruleForm.calculateType">
+            <el-radio :label="1">累计数</el-radio>
+            <el-radio :label="2">连续数</el-radio>
+            <el-radio :label="3">分类</el-radio>
+            <el-radio :label="4">固化值</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item
+          label="连续数"
+          v-if="ruleForm.calculateType == 2"
+          prop="indicatorDays"
+        >
+          <el-input
+            placeholder="请输入连续数"
+            v-model.number="ruleForm.indicatorDays"
+            clearable
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item label="系数" prop="itemValue">
+          <el-input
+            placeholder="请输入系数"
+            v-model.number="ruleForm.itemValue"
+            clearable
+          >
+          </el-input>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button @click="resetFormHandler('ruleForm')">取消</el-button>
+          <el-button type="primary" @click="submitForm('ruleForm')"
+            >确定</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </DialogCom>
+  </div>
+</template>
+<script>
+import { guid } from "@/utils/index.js";
+export default {
+  name: "SocWebAddEvaluate",
+  dicts: ["evaluate_type"],
+  data() {
+    return {
+      ruleForm: {
+        calculateType: 1,
+        indicatorDays: "",
+        itemValue: "",
+        indicatorNote: "",
+      },
+      rules: {
+        indicatorNote: [{ required: true, message: "请选择评价类型" }],
+        indicatorDays: [
+          { type: "number", message: "连续数只能为数字" },
+          { required: true, message: "请输入连续数" },
+        ],
+        itemValue: [{ required: true, message: "请输入系数" }],
+      },
+      id: "", //编辑时候ID
+      isShow: false,
+    };
+  },
+
+  mounted() {},
+
+  methods: {
+    show() {
+      this.isShow = true;
+    },
+    resetFormHandler() {
+      this.isShow = false;
+    },
+    closeHandler() {
+      this.ruleForm = {};
+    },
+
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+      
+          if (this.ruleForm.uid) {
+          
+            //当前是编辑
+          } else {
+            //当前是新增
+            this.ruleForm.uid = guid();
+          }
+          this.$emit("submitHandler", this.ruleForm);
+          this.isShow = false;
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.el-select {
+  width: 100%;
+}
+</style>

+ 406 - 0
src/views/evaluationRule/editEvaluationRuleDialog.vue

@@ -0,0 +1,406 @@
+<template>
+  <div class="rule-type">
+    <DialogCom
+      @colse="onHide"
+      :title="`${id ? '编辑' : '新增'}评价规则`"
+      :visible.sync="isShow"
+      width="900px"
+      destroy-on-close
+    >
+      <div class="page-body">
+        <el-form
+          :model="queryParams"
+          :rules="formDataRules"
+          size="small"
+          ref="form"
+          label-position="right"
+          label-width="130px"
+          label-prefix=":"
+        >
+          <el-row>
+            <el-col :span="12">
+              <el-form-item prop="orgType" label="机构类型:">
+                <el-select
+                  label="机构类型"
+                  name="orgType"
+                  v-model="queryParams.orgType"
+                  placeholder="请选择机构类型"
+                  @change="onOrgTypeChanged"
+                  clearable
+                >
+                  <el-option
+                    v-for="item in dict.type.sys_org_type"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item prop="typeCode" label="指标类型:">
+                <el-select
+                  label="指标类型"
+                  v-model="queryParams.typeCode"
+                  placeholder="请选择指标类型"
+                  @change="changeTargetList"
+                >
+                  <el-option
+                    v-for="item in targetList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.code"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item prop="projectCode" label="指标项目:">
+                <el-select
+                  label="指标项目"
+                  v-model="queryParams.projectCode"
+                  placeholder="请选择指标项目"
+                  @change="changeTargetListChild"
+                >
+                  <el-option
+                    v-for="item in targetListChild"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.code"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item prop="pointCode" label="指标要点:">
+                <el-select
+                  label="指标要点"
+                  v-model="queryParams.pointCode"
+                  placeholder="请选择指标要点"
+                >
+                  <el-option
+                    v-for="item in targetListGrandson"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.code"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="扣分方式:">
+                <el-radio-group v-model="queryParams.deductionType">
+                  <el-radio :label="1">直接扣分</el-radio>
+                  <el-radio :label="2">最高扣分</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item prop="score" label="分值:">
+                <el-input
+                  placeholder="请输入分值"
+                  v-model.number="queryParams.score"
+                  clearable
+                >
+                </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <el-form-item prop="formula" label="公式说明:">
+                <el-input
+                  v-model="queryParams.formula"
+                  clearable
+                  type="textarea"
+                  :autosize="{ minRows: 2, maxRows: 4 }"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <el-form-item label="备注:">
+                <el-input
+                  v-model="queryParams.remark"
+                  type="textarea"
+                  :autosize="{ minRows: 2, maxRows: 4 }"
+                  clearable
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <el-button @click="openSelect">新增扣分规则</el-button>
+
+        <el-table :data="tableData" style="width: 100%" height="400px">
+          <el-table-column label="序号" type="index" width="50">
+          </el-table-column>
+          <el-table-column prop="indicatorNote" label="计算项目">
+          </el-table-column>
+          <el-table-column
+            prop="calculateType"
+            label="计算类型"
+            :formatter="formatterCalculateType"
+          >
+          </el-table-column>
+          <el-table-column prop="indicatorDays" label="连续数">
+          </el-table-column>
+          <el-table-column prop="itemValue" label="系数"> </el-table-column>
+          <el-table-column label="操作">
+            <template v-slot="{ row }">
+              <el-button type="text" @click="removeRow(row)">移除</el-button>
+              <el-button type="text" @click="editRow(row)">编辑</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="onHide">取消</el-button>
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+      </div>
+    </DialogCom>
+    <DialogSelect
+      ref="dialogEvaluate"
+      :orgType="queryParams.orgType"
+      @submitHandler="onSelect"
+    ></DialogSelect>
+  </div>
+</template>
+
+<script>
+import dayjs from "dayjs";
+import { mapGetters } from "vuex";
+import { targetChange } from "./targetChangeMixins.js";
+import { findAllRole } from "@/api/system/role";
+import DialogSelect from "./addEvaluate.vue";
+import { guid } from "@/utils/index.js";
+import {
+  addTargetEvaluate,
+  getEvaluateById,
+  editTargetEvaluate,
+} from "@/api/evaluateRule/rule.js";
+
+export default {
+  mixins: [targetChange],
+  dicts: ["evaluate_cycle", "sys_org_type"],
+  data() {
+    return {
+      input: "",
+      evaluateName: null,
+      planType: null,
+      typeCode: null,
+      planStatus: null,
+      orgType: null,
+      roleNames: null,
+
+      tableData: [],
+      id: null,
+      isShow: false,
+      queryParams: {
+        pointCode: "",
+        typeCode: "",
+        orgType: "",
+        projectCode: "",
+        deductionType: 1,
+        formula: "",
+        score:'',
+        remark:'',
+      },
+      formDataRules: {
+        pointCode: [{ required: true, message: "请选择指标要点" }],
+        score: [
+          { type: "number", message: "分值只能为数字" },
+          { required: true, message: "请输入分值" },
+        ],
+        orgType: [{ required: true, message: "请选择评价机构类型" }],
+        typeCode: [{ required: true, message: "请选择指标类型" }],
+        projectCode: [{ required: true, message: "请选择指标项目" }],
+      },
+    };
+  },
+  props: {
+    targetList: {
+      type: Array,
+    },
+  },
+  watch: {},
+  computed: {
+    ...mapGetters(["orgId", "orgName"]),
+  },
+  mounted() {},
+  components: { DialogSelect },
+  methods: {
+    //数据格式化
+    formatterCalculateType(row) {
+      switch (row.calculateType) {
+        case 1:
+          return "累计数";
+          break;
+        case 2:
+          return "连续数";
+          break;
+        case 3:
+          return "分类";
+          break;
+        case 4:
+          return "固化值";
+          break;
+
+        default:
+          break;
+      }
+    },
+
+    onSelect(form) {
+      let isAdd = true;
+      this.tableData?.forEach((item) => {
+        if (item.uid == form.uid) {
+          Object.assign(item, form);
+          //当前是编辑
+          isAdd = false;
+        }
+      });
+      if (isAdd || this.tableData.length == 0) {
+        this.tableData.push(form);
+      }
+      console.log(this.tableData);
+    },
+    onOrgTypeChanged() {},
+    async show(id = "", other = {}) {
+      this.id = id;
+      this.tableData = [];
+
+      // await this.refresh(id, other);
+
+      if (id) {
+        await getEvaluateById(id).then((res) => {
+          let { code, msg, data } = res;
+          if (code == 200) {
+            Object.assign(this.queryParams, data);
+            this.changeTargetList(this.queryParams.typeCode,1)
+            this.changeTargetListChild(this.queryParams.projectCode,1)
+            this.tableData = data.itemList;
+            this.tableData.forEach(item=>{
+              item.uid=guid()
+            })
+            delete this.queryParams.itemList;
+            console.log(this.queryParams);
+          } else {
+            this.$message.error(msg);
+          }
+        });
+      }
+      this.isShow = true;
+    },
+    removeRow(row) {
+      this.$modal
+        .confirm("是否确认删除?")
+        .then(function () {})
+        .then(() => {
+          this.tableData = this.tableData.filter(
+            (item) => item.uid !== row.uid
+          );
+          this.$modal.msgSuccess("删除成功");
+        });
+    },
+    editRow(row) {
+      this.$refs.dialogEvaluate.show();
+      this.$refs.dialogEvaluate.ruleForm = JSON.parse(JSON.stringify(row));
+    },
+    // 事件
+    onHide() {
+      this.$refs.form.resetFields();
+      this.isShow = false;
+      this.queryParams = {
+        pointCode: "",
+        typeCode: "",
+        orgType: "",
+        score:'',
+        projectCode: "",
+        deductionType: 1,
+        formula: "",
+        remark:'',
+      };
+
+      this.tableData = [];
+    },
+
+    openSelect() {
+      this.$refs.dialogEvaluate.show();
+    },
+    onSubmit() {
+      this.$refs.form.validate(async (isValidate) => {
+        if (isValidate) {
+          if (this.tableData.length == 0) {
+            return this.$message.error("扣分规则项不能为空");
+          }
+
+          let obj = {
+            ...this.queryParams,
+            itemList: this.tableData,
+          };
+
+          if (this.queryParams.id) {
+            //编辑
+
+            editTargetEvaluate(obj).then((res) => {
+              let { code, msg } = res;
+              if (code == 200) {
+                this.$message.success(msg);
+                this.$emit("success");
+                this.onHide();
+              } else {
+                this.$message.error(msg);
+              }
+            });
+          } else {
+            //新增
+            addTargetEvaluate(obj).then((res) => {
+              let { code, msg } = res;
+              if (code == 200) {
+                this.$message.success(msg);
+                this.$emit("success");
+                this.onHide();
+              } else {
+                this.$message.error(msg);
+              }
+            });
+          }
+          // this.$emit("success");
+          // this.onHide();
+        }
+      });
+    },
+
+    // 事件
+    //apimark//
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+.form-item-comment {
+  font-size: 12px;
+  color: #999;
+  height: 10px;
+}
+.el-select {
+  width: 100%;
+}
+</style>

+ 370 - 0
src/views/evaluationRule/index.vue

@@ -0,0 +1,370 @@
+<template>
+  <div class="app-container">
+    <el-row slot="rightBar">
+      <!--用户数据-->
+      <el-col>
+        <!--    搜索条件    -->
+        <el-form
+          :model="queryParams"
+          ref="queryForm"
+          size="small"
+          :inline="true"
+          v-show="showSearch"
+          label-width="100px"
+        >
+          <el-form-item label="机构类型">
+            <el-select
+              @change="cleanExecOrgList"
+              prop="orgType"
+              label="机构类型"
+              v-model="queryParams.orgType"
+              placeholder="请选择机构类型"
+              clearable
+            >
+              <el-option
+                v-for="item in dict.type.sys_org_type"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+
+          <el-form-item label="指标分类">
+            <el-select
+              v-model="queryParams.typeCode"
+              clearable
+              placeholder="请选择指标分类"
+              @change="changeTargetList"
+            >
+              <el-option
+                v-for="item in targetList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.code"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="指标项目">
+            <el-form-item>
+              <el-select
+                v-model="queryParams.projectCode"
+                placeholder="请选择指标项目"
+                clearable
+                @change="changeTargetListChild"
+              >
+                <el-option
+                  v-for="item in targetListChild"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.code"
+                />
+              </el-select>
+            </el-form-item>
+          </el-form-item>
+          <el-form-item label="指标要点">
+            <el-form-item>
+              <el-select
+                v-model="queryParams.pointCode"
+                placeholder="请选择指标要点"
+                clearable
+              >
+                <el-option
+                  v-for="item in targetListGrandson"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.code"
+                />
+              </el-select>
+            </el-form-item>
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              size="mini"
+              @click="handleQuery"
+              >搜索</el-button
+            >
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+              >重置</el-button
+            >
+          </el-form-item>
+        </el-form>
+
+        <!--    按纽    -->
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              icon="el-icon-plus"
+              size="mini"
+              @click="handleAdd"
+              v-hasPermi="['system:user:add']"
+              >新增</el-button
+            >
+          </el-col>
+        </el-row>
+        <el-table
+          border
+          height="650"
+          size="small"
+          v-loading="loading"
+          :data="dataList"
+          align="center"
+          fixed
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column
+            label="序号"
+            type="index"
+            width="50"
+          ></el-table-column>
+          <el-table-column label="机构类型" prop="orgTypeText" />
+          <el-table-column label="指标分类" prop="typeCodeText" />
+          <el-table-column label="指标项目" prop="projectCodeText" />
+          <el-table-column label="指标要点" prop="pointCodeText" />
+          <el-table-column
+            label="扣分方式"
+            prop="evaluateCycle"
+            :formatter="formatterScore"
+          />
+          <el-table-column label="分值" prop="score" />
+
+          <el-table-column
+            label="操作"
+            width="180"
+            fixed="right"
+            class-name="small-padding fixed-width"
+          >
+            <template slot-scope="{ row }">
+              <el-button
+                size="mini"
+                @click="editHandler(row)"
+                type="text"
+                icon="el-icon-plus"
+                >编辑</el-button
+              ><el-button
+                size="mini"
+                @click="deleteHandler(row)"
+                type="text"
+                icon="el-icon-plus"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </el-col>
+    </el-row>
+
+    <editEvaluate ref="Evaluate" :targetList="targetList" @success="getList()"></editEvaluate>
+  </div>
+</template>
+<script>
+import { mapGetters } from "vuex";
+import { findAllRole } from "@/api/system/role";
+import { list, getTargetList ,delelteEvaluate} from "@/api/evaluateRule/rule.js";
+import OrgTree from "@/components/orgTree";
+import { toTree } from "@/api/tool/tree.js";
+import editEvaluate from "./editEvaluationRuleDialog.vue";
+import {targetChange} from './targetChangeMixins.js'
+
+export default {
+  name: "SocWebIndex",
+  dicts: ["sys_org_type", "plan_status"],
+  mixins:[targetChange],
+  components: {
+    OrgTree,
+    editEvaluate,
+  },
+  data() {
+    const { params, query } = this.$route;
+    return {
+      targetList: [],
+      targetListChild: [],
+      targetListGrandson: [],
+      loading: false,
+      selectedValues: [],
+      planRoles: [],
+
+      queryParams: {
+        orgType: null,
+        typeCode: null,
+        projectCode: null,
+        pointCode: null,
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 显示搜索条件
+      showSearch: true,
+      total: 0,
+      dataList: [],
+    };
+  },
+  created() {
+    this.getList();
+    this.getTargetListHandler();
+  },
+  mounted() {},
+  computed: {
+    ...mapGetters(["orgId"]),
+  },
+  methods: {
+    formatterScore({ deductionType }) {
+      switch (deductionType) {
+        case 1:
+          return "直接扣分";
+          break;
+        case 2:
+          return "最高扣分";
+          break;
+
+        default:
+          break;
+      }
+    },
+    //获取指标列表
+    getTargetListHandler() {
+      getTargetList().then((res) => {
+        let { msg, code, rows } = res;
+        if (code == 200) {
+          this.targetList = toTree(rows, {
+            id: "code",
+            children: "children",
+            pid: "parentCode",
+          });
+        }
+      });
+    },
+    
+    //获取列表
+    getList() {
+      this.loading = true;
+      // this.queryParams.orgId=this.orgId
+      list(this.queryParams).then((res) => {
+        this.dataList = res?.rows || [];
+        this.total = res?.total || [];
+        this.loading = false;
+      });
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {},
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.$refs.Evaluate.show();
+    },
+    editHandler(row) {
+     
+      this.$refs.Evaluate.show(row.id);
+    },
+
+    deleteHandler(row) {
+      this.$modal
+        .confirm("是否确认删除?")
+        .then(function () {})
+        .then(() => {
+          delelteEvaluate(row.id).then((res) => {
+            let { code, msg } = res;
+            if (code == 200) {
+              this.getList();
+              this.$modal.msgSuccess("删除成功");
+            } else {
+              this.$modal.msgSuccess(msg);
+            }
+          });
+        });
+    },
+    //单选框状态改变
+    checkChange(state) {
+      this.queryParams.checkSub = state;
+      this.getList();
+    },
+    // 节点单击事件
+    clickTreeNode(data) {
+      this.queryParams.orgId = data.id;
+      this.getList();
+    },
+    getRolesByOrg() {
+      let params = {
+        orgType: null,
+      };
+      findAllRole(params).then((res) => {
+        this.planRoles = res.data;
+      });
+    },
+    cleanExecOrgList() {
+      this.execOrgIds = null;
+      this.queryParams.execOrgList = [];
+    },
+    handleRolesChange(val) {
+      this.selectedValues = val.toString().split(",");
+    },
+    getDefaultKey(key) {
+      this.queryParams.orgId = key;
+      this.getList();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams = {
+        orgType: null,
+        typeCode: null,
+        projectCode: null,
+        pointCode: null,
+        pageNum: 1,
+        pageSize: 10,
+      };
+
+      this.getList();
+    },
+    //树形数据点击事件
+    handleNodeClick() {},
+    reset() {
+      return {
+        planName: null,
+        planType: null,
+        planCycle: null,
+        planStatus: null,
+        orgType: null,
+        roleNames: null,
+        count: null,
+        description: null,
+        tableData: null,
+        itemList: null,
+        planExec: null,
+        count: 0,
+        note: null,
+        planCreateOrgId: null,
+        planCreateOrgName: null,
+        roleList: null,
+        roleId: null,
+        execOrg: null,
+        checkOrg: null,
+        buildTaskNow: false,
+        checkOrgList: [],
+        execOrgList: [],
+        rulePointList: null,
+        checkOrgIds: null,
+        execOrgIds: null,
+        rulePointIds: null,
+        checkOrgType: null,
+        checkType: null,
+      };
+    },
+  },
+};
+</script>
+<style lang="scss" scoped></style>

+ 37 - 0
src/views/evaluationRule/targetChangeMixins.js

@@ -0,0 +1,37 @@
+export const targetChange = {
+  data() {
+    return {
+        targetListChild: [],
+      targetListGrandson: [],
+    };
+  },
+  methods: {
+    //指标分类点击变化事件
+    changeTargetList(id, val = "") {
+        console.log(this.queryParams);
+      if (!val) {
+        this.queryParams.projectCode = "";
+        this.queryParams.pointCode = "";
+        this.targetListChild = [];
+        this.targetListGrandson = [];
+      }
+      this.targetList.forEach((item) => {
+        if (item.code == id) {
+          this.targetListChild = item.children || [];
+        }
+      });
+    },
+    //指标项目点击变化事件
+    changeTargetListChild(id, val = "") {
+      if (!val) {
+        this.queryParams.pointCode = "";
+        this.targetListGrandson = [];
+      }
+      this.targetListChild.forEach((item) => {
+        if (item.code == id) {
+          this.targetListGrandson = item.children || [];
+        }
+      });
+    },
+  },
+};

+ 40 - 29
src/views/resumption/evaluate/index.vue

@@ -68,7 +68,6 @@
                   label="评价角色"
                   v-model="queryParams.roleId"
                   placeholder="请选择评价角色"
-                  
                   filterable
                   @change="handleRolesChange"
                 >
@@ -91,9 +90,6 @@
               <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
                 >重置</el-button
               >
-              <!-- <span style="margin-left: 50px">只显示管理人员:</span>
-              <el-switch v-model="queryParams.onlyManager" active-text="是">
-              </el-switch> -->
             </el-form-item>
           </el-form>
 
@@ -152,14 +148,26 @@
               fixed="right"
               class-name="small-padding fixed-width"
             >
-              <template slot-scope="{row}">
+              <template slot-scope="{ row }">
                 <!-- publishEvaluate -->
-                <el-button size="mini" @click="publishHandler(row)" type="text" icon="el-icon-plus"
+                <el-button
+                  size="mini"
+                  @click="publishHandler(row)"
+                  type="text"
+                  icon="el-icon-plus"
                   >发布</el-button
                 >
-                <el-button size="mini" @click="editHandler(row)" type="text" icon="el-icon-plus"
+                <el-button
+                  size="mini"
+                  @click="editHandler(row)"
+                  type="text"
+                  icon="el-icon-plus"
                   >编辑</el-button
-                ><el-button size="mini" @click="deleteHandler(row)"  type="text" icon="el-icon-plus"
+                ><el-button
+                  size="mini"
+                  @click="deleteHandler(row)"
+                  type="text"
+                  icon="el-icon-plus"
                   >删除</el-button
                 >
               </template>
@@ -182,7 +190,12 @@
 <script>
 import { mapGetters } from "vuex";
 import { findAllRole } from "@/api/system/role";
-import { list, swtichHandler,delelteEvaluate,publishEvaluate } from "@/api/resumption/outsourcing.js";
+import {
+  list,
+  swtichHandler,
+  delelteEvaluate,
+  publishEvaluate,
+} from "@/api/resumption/outsourcing.js";
 import OrgTree from "@/components/orgTree";
 import editEvaluate from "./editDialog.vue";
 export default {
@@ -231,7 +244,7 @@ export default {
         let { code, msg } = res;
         if (code == 200) {
           this.$message.success(msg);
-          this.getList()
+          this.getList();
         } else {
           this.$message.error(msg);
         }
@@ -239,12 +252,12 @@ export default {
     },
     //获取列表
     getList() {
-      this.loading=true
+      this.loading = true;
       // this.queryParams.orgId=this.orgId
       list(this.queryParams).then((res) => {
         this.dataList = res?.rows || [];
         this.total = res?.total || [];
-        this.loading=false
+        this.loading = false;
       });
     },
     // 多选框选中数据
@@ -253,43 +266,41 @@ export default {
     handleAdd() {
       this.$refs.Evaluate.show();
     },
-    editHandler(row){
+    editHandler(row) {
       this.$refs.Evaluate.show(row.id);
     },
     //发布
-    publishHandler(row){
+    publishHandler(row) {
       // publishEvaluate
       this.$modal
         .confirm("是否确认发布?")
         .then(function () {})
         .then(() => {
-          publishEvaluate(row.id).then(res=>{
-            let {code,msg}=res
-            if(code==200){
-              this.getList()
+          publishEvaluate(row.id).then((res) => {
+            let { code, msg } = res;
+            if (code == 200) {
+              this.getList();
               this.$modal.msgSuccess("发布成功");
-            }else{
+            } else {
               this.$modal.msgSuccess(msg);
-
             }
-          })
+          });
         });
     },
-    deleteHandler(row){
+    deleteHandler(row) {
       this.$modal
         .confirm("是否确认删除?")
         .then(function () {})
         .then(() => {
-          delelteEvaluate(row.id).then(res=>{
-            let {code,msg}=res
-            if(code==200){
-              this.getList()
+          delelteEvaluate(row.id).then((res) => {
+            let { code, msg } = res;
+            if (code == 200) {
+              this.getList();
               this.$modal.msgSuccess("删除成功");
-            }else{
+            } else {
               this.$modal.msgSuccess(msg);
-
             }
-          })
+          });
         });
     },
     //单选框状态改变