|
@@ -3,7 +3,7 @@
|
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
|
<el-card shadow="hover">
|
|
<el-card shadow="hover">
|
|
|
- <el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
|
|
|
|
|
+ <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
|
|
|
<el-form-item label="开票编号" prop="statementInvoiceNo">
|
|
<el-form-item label="开票编号" prop="statementInvoiceNo">
|
|
|
<el-input v-model="queryParams.statementInvoiceNo" placeholder="请输入发票编号" clearable @keyup.enter="handleQuery" />
|
|
<el-input v-model="queryParams.statementInvoiceNo" placeholder="请输入发票编号" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -17,20 +17,20 @@
|
|
|
value-format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="客户名称" prop="customerId">
|
|
|
|
|
|
|
+ <el-form-item label="伙伴商名称" prop="customerId">
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="queryParams.customerId"
|
|
v-model="queryParams.customerId"
|
|
|
filterable
|
|
filterable
|
|
|
remote
|
|
remote
|
|
|
reserve-keyword
|
|
reserve-keyword
|
|
|
- placeholder="请输入客户名称"
|
|
|
|
|
- :remote-method="remoteSearchCustomer"
|
|
|
|
|
|
|
+ placeholder="请输入伙伴商名称"
|
|
|
|
|
+ :remote-method="remoteSearchPartner"
|
|
|
:loading="customerLoading"
|
|
:loading="customerLoading"
|
|
|
clearable
|
|
clearable
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
- @change="handleCustomerChange"
|
|
|
|
|
|
|
+ @change="handlePartnerChange"
|
|
|
>
|
|
>
|
|
|
- <el-option v-for="item in customerOptions" :key="item.id" :label="item.customerName" :value="item.id" />
|
|
|
|
|
|
|
+ <el-option v-for="item in partnerOptions" :key="item.id" :label="item.partnerName" :value="item.id" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="订单编号" prop="orderNo">
|
|
<el-form-item label="订单编号" prop="orderNo">
|
|
@@ -72,7 +72,7 @@
|
|
|
<span>{{ parseTime(scope.row.invoiceTime, '{y}-{m}-{d}') }}</span>
|
|
<span>{{ parseTime(scope.row.invoiceTime, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="客户名称" align="center" prop="customerName" />
|
|
|
|
|
|
|
+ <el-table-column label="伙伴商名称" align="center" prop="customerName" />
|
|
|
<el-table-column label="开票金额" align="center" prop="invoiceAmount">
|
|
<el-table-column label="开票金额" align="center" prop="invoiceAmount">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<span>{{ Number(scope.row.invoiceAmount).toFixed(2) }}</span>
|
|
<span>{{ Number(scope.row.invoiceAmount).toFixed(2) }}</span>
|
|
@@ -108,6 +108,8 @@ import { listStatementInvoice, getStatementInvoice, changeStatus } from '@/api/b
|
|
|
import { StatementInvoiceVO, StatementInvoiceQuery, StatementInvoiceForm } from '@/api/bill/statementInvoice/types';
|
|
import { StatementInvoiceVO, StatementInvoiceQuery, StatementInvoiceForm } from '@/api/bill/statementInvoice/types';
|
|
|
import { getListBycustomerName } from '@/api/customer/customerFile/customerInfo';
|
|
import { getListBycustomerName } from '@/api/customer/customerFile/customerInfo';
|
|
|
import { CustomerInfoVO } from '@/api/customer/customerFile/customerInfo/types';
|
|
import { CustomerInfoVO } from '@/api/customer/customerFile/customerInfo/types';
|
|
|
|
|
+import { getListByPartnerName } from '@/api/partner/merchant';
|
|
|
|
|
+import { PartnerMerchantVO } from '@/api/partner/merchant/types';
|
|
|
import AddDrawer from './addDrawer.vue';
|
|
import AddDrawer from './addDrawer.vue';
|
|
|
import DetailDrawer from './detailDrawer.vue';
|
|
import DetailDrawer from './detailDrawer.vue';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
@@ -127,6 +129,7 @@ const queryFormRef = ref<ElFormInstance>();
|
|
|
const statementInvoiceFormRef = ref<ElFormInstance>();
|
|
const statementInvoiceFormRef = ref<ElFormInstance>();
|
|
|
const customerLoading = ref(false);
|
|
const customerLoading = ref(false);
|
|
|
const customerOptions = ref<CustomerInfoVO[]>([]);
|
|
const customerOptions = ref<CustomerInfoVO[]>([]);
|
|
|
|
|
+const partnerOptions = ref<PartnerMerchantVO[]>([]);
|
|
|
const dialog = reactive<DialogOption>({
|
|
const dialog = reactive<DialogOption>({
|
|
|
visible: false,
|
|
visible: false,
|
|
|
title: ''
|
|
title: ''
|
|
@@ -221,6 +224,38 @@ const handleCustomerChange = async (customerId: string | number) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/** 远程搜索伙伴商 */
|
|
|
|
|
+const remoteSearchPartner = async (query: string) => {
|
|
|
|
|
+ if (query) {
|
|
|
|
|
+ customerLoading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await getListByPartnerName(query);
|
|
|
|
|
+ partnerOptions.value = res.data;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error(error);
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ customerLoading.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ customerOptions.value = [];
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/** 伙伴商变更 */
|
|
|
|
|
+const handlePartnerChange = async (customerId: string | number) => {
|
|
|
|
|
+ if (customerId) {
|
|
|
|
|
+ const partner = partnerOptions.value.find((item) => item.id === customerId);
|
|
|
|
|
+ if (partner) {
|
|
|
|
|
+ form.value.customerName = partner.partnerName;
|
|
|
|
|
+ form.value.customerNo = partner.partnerNo;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 预加载订单列表
|
|
|
|
|
+ } else {
|
|
|
|
|
+ form.value.customerName = undefined;
|
|
|
|
|
+ form.value.customerNo = undefined;
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
/** 表单重置 */
|
|
/** 表单重置 */
|
|
|
const reset = () => {
|
|
const reset = () => {
|
|
|
form.value = { ...initFormData };
|
|
form.value = { ...initFormData };
|