| | |
| | | <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" |
| | |
| | | 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> |
| | |
| | | <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 |
| | |
| | | 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" |
| | |
| | | </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", |
| | |
| | | }) |
| | | }, |
| | | 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(() => {}); |
| | | |
| | | }, |
| | |
| | | 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() { |
| | |
| | | sums[index] = '合计'; |
| | | return; |
| | | } |
| | | |
| | | |
| | | const values = data.map(item => Number(item[column.property])); |
| | | if (!values.every(value => isNaN(value))) { |
| | | sums[index] = values.reduce((prev, curr) => { |
| | |
| | | sums[index] = '-'; |
| | | } |
| | | if (column.property === 'deductMoney') { |
| | | sums[index] += '元'; |
| | | sums[index] += ' 元'; |
| | | } |
| | | } else { |
| | | sums[index] = '-'; |