|
@@ -2,19 +2,25 @@
|
|
|
<div class="relative h-full">
|
|
|
<hc-new-card title="中期支付证书列表">
|
|
|
<template #extra>
|
|
|
+ <hc-tooltip keys="debit_pay_admin_certificate_recalculate_btn">
|
|
|
+ <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn type="warning" :loading="recalculateLoading" @click="recalculateClick">重新计算</el-button>
|
|
|
+ </hc-tooltip>
|
|
|
<el-button hc-btn type="primary" @click="addModalClick">
|
|
|
<hc-icon name="add" />
|
|
|
<span>新增</span>
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-new :index-style="{ width: 60 }">
|
|
|
+ <hc-table
|
|
|
+ :column="tableColumn" :datas="tableData" :loading="tableLoading" :index-style="{ width: 60 }"
|
|
|
+ is-check :check-style="{ width: 29 }" @selection-change="tableSelectionChange"
|
|
|
+ >
|
|
|
<template #action="{ row }">
|
|
|
<el-link type="primary" :disabled="!row.rawUrl" @click="rowViewRawPdf(row)">查看电签报表</el-link>
|
|
|
<el-link type="primary" @click="rowViewPdf(row)">查看报表</el-link>
|
|
|
<el-link type="primary" :disabled="row.approveStatus === 0" @click="eVisaRowClick(row)">查看电签流程</el-link>
|
|
|
<el-link type="success" :disabled="row.isLock === 1" @click="rowEditClick(row)">修改</el-link>
|
|
|
<el-link type="danger" :disabled="row.isLock === 1" @click="rowDelClick(row)">删除</el-link>
|
|
|
- <el-link v-loading="row?.recalculateLoading" :disabled="row.isLock === 1" @click="rowRecalculateClick(row)">重新计算</el-link>
|
|
|
+ <el-link v-loading="row?.recalculateLoading" :disabled="row.isLock === 1 || row.approveStatus !== 0" @click="rowRecalculateClick(row)">重新计算</el-link>
|
|
|
<el-link type="warning" @click="rowLockingClick(row)">{{ row.isLock === 1 ? '取消锁定' : '锁定' }}</el-link>
|
|
|
</template>
|
|
|
</hc-table>
|
|
@@ -114,6 +120,11 @@ const addModalFinish = () => {
|
|
|
getTableData()
|
|
|
}
|
|
|
|
|
|
+//多选
|
|
|
+const tableCheckedKeys = ref([])
|
|
|
+const tableSelectionChange = (rows) => {
|
|
|
+ tableCheckedKeys.value = rows
|
|
|
+}
|
|
|
|
|
|
//修改
|
|
|
const editModalShow = ref(false)
|
|
@@ -154,22 +165,52 @@ const rowLockingClick = async (row) => {
|
|
|
window.$message.error(msg ?? '操作失败')
|
|
|
}
|
|
|
}
|
|
|
-//重新计算报表
|
|
|
|
|
|
+//重新计算
|
|
|
+const recalculateLoading = ref(false)
|
|
|
+const recalculateClick = async () => {
|
|
|
+ const rows = tableCheckedKeys.value
|
|
|
+ if (rows.length <= 0) {
|
|
|
+ window.$message.warning('请先勾选一条数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (rows.length > 1) {
|
|
|
+ window.$message.warning('目前仅支持选择一条数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ recalculateLoading.value = true
|
|
|
+ const isRes = await postRecalculateApi(rows[0])
|
|
|
+ recalculateLoading.value = false
|
|
|
+ if (isRes) {
|
|
|
+ editModalIds.value = false
|
|
|
+ getTableData().then()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//重新计算报表
|
|
|
const rowRecalculateClick = async (row) => {
|
|
|
row.recalculateLoading = true
|
|
|
+ const isRes = await postRecalculateApi(row)
|
|
|
+ row.recalculateLoading = false
|
|
|
+ if (isRes) {
|
|
|
+ editModalIds.value = false
|
|
|
+ getTableData().then()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//发起重新计算请求
|
|
|
+const postRecalculateApi = async ({ id }) => {
|
|
|
const { error, code, msg } = await mainApi.recalculate({
|
|
|
- reportId: row.id,
|
|
|
- type:0,
|
|
|
+ reportId: id,
|
|
|
+ type: 0,
|
|
|
taskType: 1,
|
|
|
})
|
|
|
- row.recalculateLoading = false
|
|
|
if (!error && code === 200) {
|
|
|
window.$message.success('操作成功')
|
|
|
- editModalIds.value = false
|
|
|
- getTableData().then()
|
|
|
+ return true
|
|
|
} else {
|
|
|
window.$message.error(msg ?? '操作失败')
|
|
|
+ return false
|
|
|
}
|
|
|
}
|
|
|
|