挂账记录重置更新

This commit is contained in:
GaoHao
2024-11-27 14:01:58 +08:00
parent e62ff19b5f
commit 971cdd8f36
3 changed files with 20 additions and 4 deletions

View File

@@ -38,6 +38,18 @@ export function addCreditBuyer(data) {
}) })
} }
/**
* 编辑挂账人
* @returns
*/
export function editCreditBuyer(data) {
return request({
url: '/api/credit/buyer',
method: 'put',
data
})
}
/** /**
* 还款 * 还款
* @returns * @returns

View File

@@ -127,7 +127,7 @@ export default {
* 重置 * 重置
*/ */
reset() { reset() {
this.query = { ...this.resetQuery } this.query.paymentMethod = ''
this.getTableData() this.getTableData()
} }
} }

View File

@@ -50,7 +50,7 @@
</template> </template>
<script> <script>
import { addCreditBuyer } from '@/api/credit' import { addCreditBuyer, editCreditBuyer } from '@/api/credit'
export default { export default {
// eslint-disable-next-line vue/require-prop-types // eslint-disable-next-line vue/require-prop-types
@@ -131,8 +131,12 @@ export default {
try { try {
this.loading = true this.loading = true
if (!this.form.shopId) { this.form.shopId = localStorage.getItem('shopId') } if (!this.form.shopId) { this.form.shopId = localStorage.getItem('shopId') }
// eslint-disable-next-line no-unused-vars, prefer-const let res
let res = await addCreditBuyer(this.form) if (!this.form.id) {
res = await addCreditBuyer(this.form)
} else {
res = await editCreditBuyer(this.form)
}
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: `${this.form.id ? '编辑' : '添加'}成功`, message: `${this.form.id ? '编辑' : '添加'}成功`,