龚焕茏
2024-04-26 b046b693b02a0ae00dec69e94063120460590f3d
考核结果应用规则(算钱)新增、展示
2个文件已修改
58 ■■■■ 已修改文件
src/api/platform/calculate-money-rule.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/contract/index.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/platform/calculate-money-rule.js
@@ -9,6 +9,14 @@
  })
}
// 根据合同id查询违约规则列表
export function getMoneyRulesByContractId(data) {
  return request({
    url: '/system/contract/selectMoneyRules?contractId=' + data,
    method: 'get'
  })
}
// 查询核算规则详细
export function getRule(id) {
  return request({
src/views/system/contract/index.vue
@@ -1,7 +1,7 @@
<template>
  <div class="app-container">
    <el-row>
    <el-row v-loading="loading">
      <el-col :span="8" v-for="(item, index) in contractList" :key="index" style="margin: 10px;width: 30%;">
        <el-card :body-style="{ padding: '0px' }">
          <el-image style="width: 420px;height: 187px;"
@@ -38,6 +38,18 @@
                <span>{{ item.ruleCondition }}<br/></span>
                <!-- {{ item.deductCategory }} {{ item.calcFraction }}{{ item.calcUnit ? "/" + item.calcUnit : ''  }} -->
            </el-tooltip>
            </div>
          </el-collapse-item>
          <el-collapse-item title="考核结果应用规则" :name="ruleData.length">
            <div class="inline-input-container">
                <span v-for="(item, index) in moneyRules" :key="index">
                    <div>
                      <span>{{ item.scoreCondition }}</span>
                      <el-tooltip class="item" effect="dark" :content="item.description" placement="top">
                        <span style="margin-left: 20px;">{{ item.description }}</span>
                      </el-tooltip>
                    </div>
                </span>
            </div>
          </el-collapse-item>
          <el-form-item label="合同附件" prop="attachment" class="top">
@@ -79,9 +91,9 @@
            <div class="row-right" style="margin-left: 80px;">
              <div class="margin-5">
                <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
                  :action="upload.url + '?unitId=' + upload.unitId + '&startTime=' + upload.startTime + '&endTime=' + upload.endTime + '&name=' + upload.name"
                  :action="upload.url"
                  :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
                  :file-list="upload.fileList"
                  :data="upload"
                  :auto-upload="false" drag style="text-align: center;">
                  <i class="el-icon-upload"></i>
                  <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
@@ -128,8 +140,9 @@
</template>
<script>
import { listContract, getContract, updateContract, addContract } from "@/api/platform/contract";
import { listContract, getContract, updateContract } from "@/api/platform/contract";
import { getRuleListByContractId } from "../../../api/platform/calculate-rule";
import { getMoneyRulesByContractId } from "../../../api/platform/calculate-money-rule";
import { unitSelect } from "../../../api/platform/unit";
import { deptSelect } from "../../../api/system/dept";
import { getToken } from "@/utils/auth";
@@ -138,6 +151,7 @@
  name: "Contract",
  data() {
    return {
      loading: false,
      contractInfo: {},
      // 合同导入参数
      upload: {
@@ -152,7 +166,6 @@
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/system/contract/importData",
        ruleList: [],
        fileList: [],
        unitId: '',
        startTime: '',
        endTime: ''
@@ -191,6 +204,7 @@
      // 是否显示详情
      detail: false,
      ruleData: [],
      moneyRules: [],
      // 表单参数
      form: {
      },
@@ -267,14 +281,13 @@
      let that = this;
      this.$refs["form"].validate(valid => {
        if (valid) {
          addContract(this.upload).then (response => {
            if (response.code != 200) {
              this.$message.error("操作失败");
            } else {
              this.$message.success("操作成功");
            }
          that.upload.ruleList = JSON.stringify(this.upload.ruleList);
          that.loading = true;
          that.upload.open = false;
          that.$refs.upload.submit().then(() => {
            that.loading = false;
            that.reset();
          });
          // that.$refs.upload.submit();
        }
      })
    },
@@ -318,6 +331,9 @@
        this.form.id = item.id;
        this.contractInfo = item;
      });
      getMoneyRulesByContractId(item.id).then(response => {
        this.moneyRules = response.data;
      });
    },
    /** 新增按钮操作 */
    handleAdd() {
@@ -344,6 +360,16 @@
    /** 下载按钮操作 */
    handleDownload (data) {
      this.$download.resource(data);
    },
    reset () {
      this.upload = {
        open: false,
        name: undefined,
        unitId: undefined,
        timezone: undefined,
        ruleList: []
      };
      this.resetForm("form");
    }
  }
};