fix: 挂账管理列表页面增加还款按钮限制

This commit is contained in:
YeMingfei666 2025-03-13 09:35:23 +08:00
parent dd1e3a61c7
commit 9295b58587
3 changed files with 93 additions and 4 deletions

View File

@ -74,7 +74,8 @@ const contentConfig: IContentConfig = {
align: "center",
fixed: "right",
width: 300,
templet: "tool",
templet: "custom",
slotName: 'tools',
operat: [
{
text: "查看明细",

View File

@ -39,6 +39,76 @@
style="margin-left: 2px"
/>
</template>
<template #tools="scope">
<el-button
type="primary"
link
size="small"
@click="
handleOperatClick({
name: 'detail',
row: scope.row,
column: scope.column,
$index: scope.$index,
})
"
>
查看明细
</el-button>
<el-button type="primary" link size="small" @click="handleEditClick(scope.row)">
编辑
</el-button>
<el-button
type="primary"
link
:style="{ color: scope.row.repaymentMethod == 'order' ? '#999' : '' }"
size="small"
@click="
handleOperatClick({
name: 'huankuan',
row: scope.row,
column: scope.column,
$index: scope.$index,
})
"
>
还款
</el-button>
<el-button
type="primary"
link
size="small"
@click="
handleOperatClick({
name: 'huankuan_detail',
row: scope.row,
column: scope.column,
$index: scope.$index,
})
"
>
还款记录
</el-button>
<el-button
type="primary"
link
size="small"
@click="
handleOperatClick({
name: 'delete',
row: scope.row,
column: scope.column,
$index: scope.$index,
})
"
>
删除
</el-button>
</template>
</page-content>
<!-- 新增 -->
@ -74,7 +144,7 @@ import contentConfig from "./config/content";
import editModalConfig from "./config/edit";
import searchConfig from "./config/search";
import { returnOptionsLabel } from "./config/config";
import { ElMessageBox, ElMessage } from "element-plus";
const {
searchRef,
contentRef,
@ -124,7 +194,7 @@ async function handleOperatClick(data: IOperatData) {
});
return;
}
if (data.name == "huankuan") {
if (data.name == "huankuan" && data.row.repaymentMethod == "total") {
refHuanKuanShow(data.row, {});
return;
}
@ -132,6 +202,23 @@ async function handleOperatClick(data: IOperatData) {
refHuanKuanRecordShow(data.row, {});
return;
}
if (data.name == "delete") {
ElMessageBox.alert("是否删除挂账人" + data.row.debtor + "", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: async (action: string) => {
if (action == "confirm") {
const res = await creditApi.delete(data.row.id);
if (res.code == 200) {
ElMessage.success("删除成功");
refresh();
}
}
},
});
return;
}
}
//

View File

@ -579,7 +579,8 @@ let goodsMapisFinish = ref(false);
async function getGoods() {
const res = await productApi.getPage({
page: 1,
size: 200,
size: 400,
status: "on_sale",
...goods.query,
});
goods.list = res.records;