[update] 缴费凭证编辑删除

This commit is contained in:
zhaoxiao
2021-12-16 19:37:18 +08:00
parent 694d5f19cd
commit 73aa835880
3 changed files with 34 additions and 7 deletions
+29 -2
View File
@@ -60,7 +60,7 @@
<a @click="viewProof(record)"
v-if="record.paymentStatus === 'toBeReviewed' || record.paymentStatus === 'completed'">查看</a>
<a @click="editProof(record)" v-if="record.paymentStatus === 'rejected'">编辑</a>
<a @click="handleDelete(record.id)" v-if="record.paymentStatus === 'rejected'">删除</a>
<a @click="handleDelete(record)" v-if="record.paymentStatus === 'rejected'">删除</a>
</span>
</a-table>
</div>
@@ -158,7 +158,7 @@
<script>
import { JeroListMixin } from '@/mixins/JeroListMixin'
import PaymentVoucherModal from '@views/MessagePage/modules/PaymentVoucherModal'
import { getAction } from '@api/manage'
import { getAction, postAction } from '@api/manage'
import PreviewImgModal from '@views/MessagePage/modules/PreviewImgModal'
import ProofInfoModal from '@views/MessagePage/modules/ProofInfoModal'
import { getAuditProofRecords } from '@api/incomePaymentsApi'
@@ -277,6 +277,31 @@ export default {
this.loading = false
})
},
handleDelete(record) {
if(!this.url.delete){
this.$message.error('请设置url.delete属性!')
return
}
var that = this
this.$confirm({
title: '确认删除',
content: '确定要删除此条数据吗?',
onOk: function() {
postAction(that.url.delete, {id: record.id, paymentStatus: record.paymentStatus}).then((res) => {
if (res.success) {
that.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) {
that.ipagination.current -= 1
}
that.loadData()
} else {
that.$message.warning(res.message)
}
})
}
})
},
/**
* 添加阶段
*/
@@ -314,6 +339,8 @@ export default {
* @param record
*/
editProof(record) {
this.$refs.stageModal.projectId = this.$route.query.projectId
this.$refs.stageModal.projectType = this.$route.query.projectType
this.$refs.stageModal.title = '编辑阶段'
this.$refs.stageModal.edit(record)
},
@@ -123,8 +123,8 @@ export default {
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
values.projectId = this.projectId || values.projectId
values.projectType = this.projectType || values.projectType
values.projectId = this.projectId
values.projectType = this.projectType
const formData = Object.assign(this.model, values)
let url
if (this.model.id) {