[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
+3 -3
View File
@@ -4,7 +4,7 @@
* data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除
*/
import {filterObj} from '@/utils/util'
import {deleteAction, downloadFile, getAction, getFileAccessHttpUrl} from '@/api/manage'
import { deleteAction, downloadFile, getAction, getFileAccessHttpUrl, postAction } from '@/api/manage'
import Vue from 'vue'
import {ACCESS_TOKEN, TENANT_ID} from '@/store/mutation-types'
import store from '@/store'
@@ -186,7 +186,7 @@ export const JeroListMixin = {
content: '是否删除选中数据?',
onOk: function () {
that.loading = true
that.deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
postAction(that.url.deleteBatch, {ids: ids}).then((res) => {
if (res.success) {
that.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的全部数据,如果是的话页码减一
@@ -217,7 +217,7 @@ export const JeroListMixin = {
title: '确认删除',
content: '确定要删除此条数据吗?',
onOk: function() {
that.deleteAction(that.url.delete, {id: id}).then((res) => {
postAction(that.url.delete, {id: id}).then((res) => {
if (res.success) {
that.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
+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) {