fix: 挂账管理更新,耗材盘点更新,代客下单更新

This commit is contained in:
2025-03-11 16:13:22 +08:00
parent 0fa409ecc5
commit 14af62538f
17 changed files with 164 additions and 95 deletions

View File

@@ -3,12 +3,14 @@
<div>
<el-dialog
:show-close="false"
:visible.sync="dialogVisible"
v-model="dialogVisible"
:close-on-click-modal="false"
width="30%"
center
>
<div slot="title" class="dialog-title">挂账还款</div>
<template #title>
<div class="dialog-title">挂账还款</div>
</template>
<div class="content">
<div v-if="form.repaymentMethod == 'total' && !form.creditBuyerId" class="credit_info">
<div>挂账人{{ form.debtor }}</div>
@@ -22,12 +24,7 @@
style="width: 100%"
>
<el-radio-group v-model="form.repaymentMethod">
<el-radio
v-for="item in repaymentMethodList"
v-if="form.repaymentMethod == item.value"
:key="item.value"
:label="item.value"
>
<el-radio v-for="item in repaymentMethodList" :key="item.value" :label="item.value">
{{ item.label }}
</el-radio>
</el-radio-group>
@@ -38,7 +35,7 @@
placeholder=""
oninput="value= value.replace(/[^\d|\.]/g, '')"
>
<template slot="prepend"></template>
<template #prepend></template>
</el-input>
</el-form-item>
<el-form-item label="支付方式" prop="paymentMethod" style="width: 100%">
@@ -49,18 +46,25 @@
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" :loading="loading" @click="onSubmitHandle"> </el-button>
</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" :loading="loading" @click="onSubmitHandle"> </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
import creditApi from "@/api/order/credit";
import creditOrderApi from "@/api/order/credit-order";
import { ElMessage, ElMessageBox } from "element-plus";
import _ from "lodash";
const $repaymentMethodList = [
{ label: "按总金额还款", value: "total" },
{ label: "按订单还款", value: "order" },
];
export default {
// eslint-disable-next-line vue/require-prop-types
props: ["couponId"],
@@ -68,10 +72,7 @@ export default {
return {
dialogVisible: false,
loading: false,
repaymentMethodList: [
{ label: "按总金额还款", value: "total" },
{ label: "按订单还款", value: "order" },
],
repaymentMethodList: $repaymentMethodList,
form: {
id: "",
creditBuyerId: "",
@@ -116,11 +117,11 @@ export default {
// if (!this.form.shopId) { this.form.shopId = localStorage.getItem('shopId') }
let res;
if (this.form.repaymentMethod === "total") {
res = await creditRePayment(this.form);
res = await creditApi.repayment(this.form);
} else {
res = await creditPayment(this.form);
res = await creditOrderApi.pay(this.form);
}
this.$notify({
ElMessage({
title: "成功",
message: res.repaymentMsg,
type: "success",
@@ -149,6 +150,9 @@ export default {
this.form.id = row.id;
}
this.form.repaymentMethod = row.repaymentMethod;
this.repaymentMethodList = $repaymentMethodList.filter(
(item) => item.value === row.repaymentMethod
);
this.form.debtor = row.debtor;
this.form.owedAmount = row.owedAmount;
this.form.accountBalance = row.accountBalance;

View File

@@ -16,7 +16,9 @@ const contentConfig: IContentConfig = {
indexAction: function (params) {
return creditApi.getList(params);
},
deleteAction: creditApi.delete,
deleteAction: function (params) {
return creditApi.delete(params)
},
// modifyAction: function (data) {
// // return creditApi.edit(data);
// },

View File

@@ -42,12 +42,7 @@
</page-content>
<!-- 新增 -->
<page-modal
ref="addModalRef"
@form-data-change="handleFormDataChange"
:modal-config="addModalConfig"
@submit-click="handleSubmitClick"
>
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
<template #formFooter>
<el-form-item label="" label-width="140">
<p>一经创建无法更改还款方式</p>
@@ -61,11 +56,17 @@
:modal-config="editModalConfig"
@submit-click="handleSubmitClick"
></page-modal>
<!-- 还款 -->
<huanKuan ref="refHuanKuan" @success="refresh"></huanKuan>
<!-- 还款记录 -->
<huanKuanRecord ref="refHuanKuanRecord"></huanKuanRecord>
</div>
</template>
<script setup lang="ts">
import creditApi from "@/api/order/credit";
import huanKuan from "./components/detail/credit_repayment.vue";
import huanKuanRecord from "./components/detail/credit_RePaymentRecord.vue";
import type { IObject, IOperatData } from "@/components/CURD/types";
import usePage from "@/components/CURD/usePage";
import addModalConfig from "./config/add";
@@ -74,19 +75,6 @@ import editModalConfig from "./config/edit";
import searchConfig from "./config/search";
import { returnOptionsLabel } from "./config/config";
let version = ref<string | number>("");
function handleFormDataChange(type: string, value: string | number) {
version.value = value;
if (type === "version" && value !== "") {
addModalConfig.formItems[5].hidden = false;
return;
}
if (type === "version" && value == "") {
addModalConfig.formItems[5].hidden = true;
}
}
const refVersionFile = ref<any>();
const {
searchRef,
contentRef,
@@ -116,12 +104,16 @@ async function handleEditClick(row: IObject) {
console.log({ ...row });
editModalRef.value?.setFormData({ ...row, url: [row.url] });
}
function refresh() {
contentRef.value?.fetchPageData();
}
const router = useRouter();
// 其他工具栏
function handleToolbarClick(name: string, row: any) {}
function handleToolbarClick(name: string) {}
// 其他操作列
async function handleOperatClick(data: IOperatData) {
console.log(data);
if (data.name == "detail") {
router.push({
path: "/credit-detail",
@@ -132,6 +124,23 @@ async function handleOperatClick(data: IOperatData) {
});
return;
}
console.log(data);
if (data.name == "huankuan") {
refHuanKuanShow(data.row, {});
return;
}
if (data.name == "huankuan_detail") {
refHuanKuanRecordShow(data.row, {});
return;
}
}
// 还款
const refHuanKuan = ref();
function refHuanKuanShow(row: any, order: any) {
refHuanKuan.value.show(row, order);
}
const refHuanKuanRecord = ref();
function refHuanKuanRecordShow(row: any, order: any) {
refHuanKuanRecord.value.show(row, order);
}
</script>