龚焕茏
2024-08-23 4f3e227f703f905c6ee53e45a4f6620355cf70e4
src/views/system/contract/score/index.vue
@@ -289,6 +289,7 @@
      let item = this.$refs['cascader'].getCheckedNodes()[0].data;
      this.calcObj = item;
      this.form.contractId = item.contractId;
      this.form.ruleName = item.ruleName + " / " + item.label;
      this.form.deductCategory = item.deductCategory == '分数乘以数量' ? '扣' + item.calcFraction  + '分*数量 ' : item.deductCategory == '除以数量后乘以分数' ? '扣' + item.calcFraction + '分/' +  item.calcUnit + '小时' : '扣' + item.calcFraction + '分';
      if (item.deductCategory == "扣指定分数") {
        this.needNum = false;
@@ -315,6 +316,24 @@
    handleChangeUnit(value) {
      getRuleListByUnitId(value).then((res) => {
        this.options = this.getTreeData(res.data);
        // 手动树形结构
        if (this.options) {
          let groupedList = {};
          this.options.forEach(item => {
            if (!groupedList[item.ruleName]) {
              groupedList[item.ruleName] = {
                value: 0,
                children: [],
                label: item.ruleName,
                ruleName: item.ruleName,
                contractId: item.contractId
              };
            }
            groupedList[item.ruleName].children.push(item);
          });
          let result = Object.values(groupedList);
          this.options = result;
        }
      })
    },
    getTreeData(data) {
@@ -369,12 +388,17 @@
      if (null != this.daterangeAuditingTime && '' != this.daterangeAuditingTime) {
        this.queryParams["auditingStartTime"] = this.daterangeAuditingTime[0];
        this.queryParams["auditingEndTime"] = this.daterangeAuditingTime[1];
      } else {
        this.queryParams["auditingStartTime"] = null;
        this.queryParams["auditingEndTime"] = null;
      }
      if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
        this.queryParams["createStartTime"] = this.daterangeCreateTime[0];
        this.queryParams["createEndTime"] = this.daterangeCreateTime[1];
      } else {
        this.queryParams["createStartTime"] = null;
        this.queryParams["createEndTime"] = null;
      }
      console.log("this.queryParams", this.queryParams)
      listAuditing(this.queryParams).then(response => {
        this.auditingList = response.rows;
        this.total = response.total;