xiangpei
2024-04-26 84562e1978146f396c6976c75dc931c12b188982
核算报告功能完善
2个文件已修改
113 ■■■■■ 已修改文件
src/api/platform/calculate-report.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/calculate/report/index.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/platform/calculate-report.js
@@ -68,3 +68,11 @@
    data: data
  })
}
// 修改发布状态
export const updatePublishStatus = (data) => {
  return axios({
    url: "/calculate-report/status/" + data,
    method: "PUT",
  })
}
src/views/system/calculate/report/index.vue
@@ -1,54 +1,7 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item label="核算对象" prop="checkUnitId">
        <el-input
          v-model="queryParams.checkUnitName"
          placeholder="请输入核算对象"
          clearable
          @clear="handleQuery"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="核算时间">
        <el-date-picker
          v-model="daterangeCheckTime"
          style="width: 240px"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <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:checkResult:add']"-->
<!--        >新增</el-button>-->
<!--      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
        >删除</el-button>
      </el-col>
    <el-row style="margin-left: 10px" :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="warning"
@@ -56,7 +9,7 @@
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
        >导出</el-button>
        >导出所有数据</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
@@ -67,12 +20,14 @@
        <el-button style="float: right; padding: 3px 0" type="text" @click="handleDetail(item)">核算</el-button>
      </div>
      <div class="text item">合同<span class="time">{{ item.contractName }}</span></div>
      <div class="text item">扣减金额<span class="time">{{ item.deductMoney }}</span></div>
      <div class="text item">最新核算时间
        <span class="time">{{ item.whichYear }}年{{ item.whichMonth }}月</span>
      <div class="text item">最近扣减金额<span class="time">{{ item.latestDeductMoney }}</span></div>
      <div class="text item">累计扣减金额<span class="time">{{ item.deductMoney }}</span></div>
      <div class="text item">最近核算月份
        <span v-if="item.latestTime" class="time">{{ new Date(item.latestTime).getFullYear() }}年{{ new Date(item.latestTime).getMonth() }}月</span>
        <span v-else class="time">暂无</span>
      </div>
      <el-button size="small" round style="float: right;margin-bottom: 18px;" @click="handlePublish(item)" v-show="item.publish != 1"  v-hasPermi="['result:contract:publish']">确认发布</el-button>
      <el-button size="small" round style="float: right;margin-bottom: 18px;" @click="handlePublish(item)" v-show="item.publish == 1"  v-hasPermi="['result:contract:publish']">已发布</el-button>
      <el-button size="small" round style="float: right;margin-bottom: 18px;" @click="handlePublish(item)" v-if="item.status === 'not_publish'" :disabled="!item.canPublish" v-hasPermi="['system:calculate:report:status']">确认发布</el-button>
      <el-button size="small" round style="float: right;margin-bottom: 18px;" @click="handlePublish(item)" v-if="item.status === 'published'" v-hasPermi="['system:calculate:report:status']">取消发布</el-button>
    </el-card>
    <pagination
@@ -135,7 +90,9 @@
            prop="deductMoney"
            width="180">
            <template slot-scope="scope">
              <el-input type="number"
              <el-input
                :disabled="!scope.row.latest"
                type="number"
                :precision="2" :step="0.1"
                :min="0" :max="1000000"
                v-model="scope.row.deductMoney"
@@ -163,7 +120,7 @@
</template>
<script>
import { getCalculateReports, getCalculateReportById, backfill } from "@/api/platform/calculate-report";
import { getCalculateReports, getCalculateReportById, backfill, updatePublishStatus } from "@/api/platform/calculate-report";
export default {
  name: "CheckResult",
@@ -288,13 +245,14 @@
      })
    },
    handlePublish(row) {
      let text = row.publish == 1 ? '取消发布' : '发布';
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认' + text + '考核结果编号为"' + ids + '"的数据项?').then(function() {
      let text = row.status === 'published' ? '取消发布' : '发布';
      this.$modal.confirm('确认要【' + text + "】【" + row.contractName + "】【" + new Date(row.latestTime).getMonth() + "月】" + '的核算报告吗?').then(function() {
        // return publishCheckResult(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess(text + "成功");
        updatePublishStatus(row.id).then(res => {
          this.getList();
          this.$modal.msgSuccess(text + "成功");
        })
      }).catch(() => {});
    },
@@ -313,15 +271,20 @@
    submitForm() {
      let data = {
        id: this.detail.id,
        recordList: this.detail.recordList
        recordList: this.detail.recordList.filter(item => item.latest)
      }
      backfill(data).then(res => {
        if (res.code === 200) {
          this.$message.success("操作成功");
          this.detailOpen = false;
          this.getList();
        }
      })
      if (data.recordList.length > 0) {
        backfill(data).then(res => {
          if (res.code === 200) {
            this.$message.success("操作成功");
            this.detailOpen = false;
            this.getList();
          }
        })
      } else {
        this.detailOpen = false;
      }
    },
    /** 导出按钮操作 */
    handleExport() {
@@ -338,7 +301,7 @@
          sums[index] = '合计';
          return;
        }
        const values = data.map(item => Number(item[column.property]));
        if (!values.every(value => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
@@ -353,7 +316,7 @@
            sums[index] = '-';
          }
          if (column.property === 'deductMoney') {
            sums[index] += '元';
            sums[index] += ' 元';
          }
        } else {
          sums[index] = '-';