|
@@ -3,20 +3,17 @@
|
|
|
<hc-new-card title="中期支付证书列表">
|
|
|
<template #extra>
|
|
|
<el-button hc-btn type="primary" @click="addModalClick">
|
|
|
- <HcIcon name="add" />
|
|
|
+ <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" is-new :index-style="{ width: 60 }">
|
|
|
<template #action="{ row }">
|
|
|
<el-link type="primary" @click="isReportDrawer = true">查看报表</el-link>
|
|
|
<el-link type="success" @click="rowEditClick(row)">修改</el-link>
|
|
|
- <el-link type="danger">删除</el-link>
|
|
|
+ <el-link type="danger" @click="rowDelClick(row)">删除</el-link>
|
|
|
<el-link>重新计算</el-link>
|
|
|
- <el-link type="warning">锁定</el-link>
|
|
|
+ <el-link type="warning" @click="rowLockingClick(row)">{{ row.isLock === 1 ? '取消锁定' : '锁定' }}</el-link>
|
|
|
</template>
|
|
|
</hc-table>
|
|
|
<template #action>
|
|
@@ -28,7 +25,7 @@
|
|
|
<HcAddModal v-model="addModalShow" @finish="addModalFinish" />
|
|
|
|
|
|
<!-- 中间计量编辑 -->
|
|
|
- <HcEditModal v-model="editModalShow" :ids="editModalIds" />
|
|
|
+ <HcEditModal v-model="editModalShow" :ids="editModalIds" @finish="editModalFinish" />
|
|
|
|
|
|
<!-- 查看报表 -->
|
|
|
<hc-view-report v-model="isReportDrawer" />
|
|
@@ -39,6 +36,7 @@
|
|
|
import { getArrValue } from 'js-fast-way'
|
|
|
import { onMounted, ref } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
+import { delMessage } from '~uti/tools'
|
|
|
import HcAddModal from './components/certificate/addModal.vue'
|
|
|
import HcEditModal from './components/certificate/editModal.vue'
|
|
|
import mainApi from '~api/debit-pay/admin/certificate'
|
|
@@ -111,6 +109,37 @@ const rowEditClick = (row) => {
|
|
|
editModalIds.value = row.id
|
|
|
editModalShow.value = true
|
|
|
}
|
|
|
+const editModalFinish = () => {
|
|
|
+ getTableData()
|
|
|
+}
|
|
|
+
|
|
|
+//删除
|
|
|
+const rowDelClick = (row) => {
|
|
|
+ delMessage(async () => {
|
|
|
+ const { code, msg } = await mainApi.remove({ ids: row.id })
|
|
|
+ if (code === 200) {
|
|
|
+ window.$message.success('删除成功')
|
|
|
+ getTableData().then()
|
|
|
+ } else {
|
|
|
+ window.$message.error(msg ?? '删除失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//锁定还是解锁
|
|
|
+const rowLockingClick = async (row) => {
|
|
|
+ //isLock,是否锁定:0未锁定,1锁定
|
|
|
+ const { code, msg } = await mainApi.setLocking({
|
|
|
+ id: row.id,
|
|
|
+ isLock: row.isLock === 0 ? 1 : 0,
|
|
|
+ })
|
|
|
+ if (code === 200) {
|
|
|
+ window.$message.success('操作成功')
|
|
|
+ getTableData().then()
|
|
|
+ } else {
|
|
|
+ window.$message.error(msg ?? '操作失败')
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|