11
WXL
2024-03-25 6b25c4004057242d40568a06036643792b66b987
11
已修改2个文件
131 ■■■■ 文件已修改
src/views/project/fund/applyDetail/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/fund/performancedetails/index.vue 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/fund/applyDetail/index.vue
@@ -2681,7 +2681,15 @@
                this.$modal.msgWarning(
                  "服务项目表中,第" +
                    (k + 1).toString() +
                    "行的服务人员姓名为选择,请选择人员后再提交保存!"
                    "行的人员姓名为空,请选择人员后再提交保存!"
                );
                return;
              }
              if (tempDetail.unitname == null) {
                this.$modal.msgWarning(
                  "服务项目表中,第" +
                    (k + 1).toString() +
                    "行的专家单位为空,请选择单位后再提交保存!"
                );
                return;
              }
@@ -3528,6 +3536,17 @@
            ) {
              this.accountlist.map(res => {
                if (res.id == this.accountselectform.accountname) {
                  console.log(res, "res");
                  const hasIdOne = this.rbDetails.some(
                    obj => obj.beneficiaryname == res.username
                  );
                  if (hasIdOne) {
                    this.$modal.msgWarning(
                      "服务项目表中,人员名称:" +
                        res.username +
                        "重复,请注意核对信息!"
                    );
                  }
                  this.rbDetails[tempIndex].beneficiaryno = res.userno;
                  this.rbDetails[tempIndex].beneficiaryname = res.username;
                  this.rbDetails[tempIndex].depositbank = res.depositbank;
src/views/project/fund/performancedetails/index.vue
@@ -141,6 +141,8 @@
            max-height="800"
            border
            highlight-current-row
            :summary-method="getSummaries"
            show-summary
          >
            <el-table-column
              prop="orderno"
@@ -204,7 +206,7 @@
              </template>
            </el-table-column>
            <el-table-column
              prop="amount"
              prop="jxrq"
              align="center"
              label="绩效日期"
              width="260"
@@ -228,11 +230,21 @@
                <el-input
                  v-model="scope.row.amount"
                  placeholder="税前金额"
                  @blur="
                    val => {
                      calculateTax(scope.row, 'A');
                    }
                  "
                  @blur="chargeSum"
                />
              </template>
            </el-table-column>
            <el-table-column
              prop="taxamount"
              align="center"
              label="扣税金额"
              width="120"
            >
              <template slot-scope="scope">
                <el-input
                  @blur="chargeSum"
                  v-model="scope.row.taxamount"
                  placeholder="扣税金额"
                />
              </template>
            </el-table-column>
@@ -246,27 +258,11 @@
                <el-input
                  v-model="scope.row.taxedamount"
                  placeholder="税后金额"
                  @blur="
                    val => {
                      calculateTax(scope.row, 'B');
                    }
                  "
                  @blur="queenchargeSum"
                />
              </template>
            </el-table-column>
            <el-table-column
              prop="taxamount"
              align="center"
              label="扣税金额"
              width="120"
            >
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.taxamount"
                  placeholder="扣税金额"
                />
              </template>
            </el-table-column>
            <el-table-column
              prop="beneficiaryname"
              align="center"
@@ -2050,17 +2046,37 @@
      }
    },
    //计算金额
    calculateTax(row, type) {
    //税前扣税算税后
    chargeSum(row, type) {
      let targetValue = 0;
      for (let i = 0; i < this.rbDetails.length; i++) {
        if (!this.rbDetails[i].amount) {
          this.rbDetails[i].amount = 0;
        }
        if (!this.rbDetails[i].taxamount) {
          this.rbDetails[i].taxamount = 0;
        }
        this.rbDetails[i].taxedamount =
          parseFloat(this.rbDetails[i].amount) -
          parseFloat(this.rbDetails[i].taxamount);
        targetValue += parseFloat(this.rbDetails[i].amount); // 假设每个对象中的特定值存储在'specificValue'属性下
      }
      console.log(targetValue, "合计");
      this.form.pretaxcost = targetValue;
    },
    //税后扣税算税前
    queenchargeSum(row, type) {
      for (let i = 0; i < this.rbDetails.length; i++) {
        if (!this.rbDetails[i].amount) {
          this.rbDetails[i].amount = 0;
        }
        if (!this.rbDetails[i].taxamount) {
          this.rbDetails[i].taxamount = 0;
        }
        this.rbDetails[i].amount =
          parseFloat(this.rbDetails[i].taxamount) +
          parseFloat(this.rbDetails[i].taxedamount);
      }
    },
    unsave() {
@@ -2807,6 +2823,48 @@
    Downloadfile(row) {
      console.log(row);
      window.location.href = this.Networkheader + "/prod-api" + row.url;
    },
    //表格合计
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      var columnnames = [
        "applytype",
        "itemid",
        "jxrq",
        "beneficiaryname",
        "idcardno",
        "depositbank",
        "bankcardno",
        "remark",
      ];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
        }
        //去除部分字段计算
        if (columnnames.indexOf(column.property) > -1) {
          return;
        }
        const values = data.map(item => Number(item[column.property]));
        if (!values.every(value => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0);
          sums[index] = sums[index].toFixed(2); // 保留2位小数,解决小数合计列;
        } else {
          sums[index] = "";
        }
      });
      return sums;
    }
  },