|
@@ -3,12 +3,12 @@
|
|
|
<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="120px" class="drawer-form">
|
|
|
<el-form-item label="伙伴商编号" prop="partnerNo">
|
|
<el-form-item label="伙伴商编号" prop="partnerNo">
|
|
|
- <el-input v-model="queryParams.partnerNo" placeholder="例如:请输入" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
|
|
+ <el-input v-model="queryParams.partnerNo" placeholder="请输入" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="伙伴商名称" prop="partnerName">
|
|
<el-form-item label="伙伴商名称" prop="partnerName">
|
|
|
- <el-input v-model="queryParams.partnerName" placeholder="例如:请输入" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
|
|
+ <el-input v-model="queryParams.partnerName" placeholder="请输入" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
@@ -304,52 +304,35 @@
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
|
|
|
|
<!-- 资质管理对话框组件 -->
|
|
<!-- 资质管理对话框组件 -->
|
|
|
- <QualificationDialog
|
|
|
|
|
- v-model:visible="qualificationDialog.visible"
|
|
|
|
|
- v-model:form-data="qualificationForm"
|
|
|
|
|
- @submit="handleQualificationSubmit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <QualificationDialog v-model:visible="qualificationDialog.visible" v-model:form-data="qualificationForm" @submit="handleQualificationSubmit" />
|
|
|
|
|
|
|
|
<!-- 银行账户对话框组件 -->
|
|
<!-- 银行账户对话框组件 -->
|
|
|
- <BankDialog
|
|
|
|
|
- v-model:visible="financialDialog.visible"
|
|
|
|
|
- v-model:form-data="bankForm"
|
|
|
|
|
- @submit="handleBankSubmit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <BankDialog v-model:visible="financialDialog.visible" v-model:form-data="bankForm" @submit="handleBankSubmit" />
|
|
|
|
|
|
|
|
<!-- 用户账号对话框组件 -->
|
|
<!-- 用户账号对话框组件 -->
|
|
|
- <UserDialog
|
|
|
|
|
- v-model:visible="accountDialog.visible"
|
|
|
|
|
- v-model:form-data="userForm"
|
|
|
|
|
- @submit="handleUserSubmit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <UserDialog v-model:visible="accountDialog.visible" v-model:form-data="userForm" @submit="handleUserSubmit" />
|
|
|
|
|
|
|
|
<!-- 联系人对话框组件 -->
|
|
<!-- 联系人对话框组件 -->
|
|
|
- <ContactDialog
|
|
|
|
|
- v-model:visible="contactDialog.visible"
|
|
|
|
|
- v-model:form-data="contactForm"
|
|
|
|
|
- @submit="handleContactSubmit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <ContactDialog v-model:visible="contactDialog.visible" v-model:form-data="contactForm" @submit="handleContactSubmit" />
|
|
|
|
|
|
|
|
<!-- 合同对话框组件 -->
|
|
<!-- 合同对话框组件 -->
|
|
|
- <ContractDialog
|
|
|
|
|
- v-model:visible="companyDialog.visible"
|
|
|
|
|
- v-model:form-data="contractForm"
|
|
|
|
|
- @submit="handleContractSubmit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <ContractDialog v-model:visible="companyDialog.visible" v-model:form-data="contractForm" @submit="handleContractSubmit" />
|
|
|
|
|
|
|
|
<!-- 仓库管理对话框组件 -->
|
|
<!-- 仓库管理对话框组件 -->
|
|
|
- <WarehouseDialog
|
|
|
|
|
- v-model:visible="financeDialog.visible"
|
|
|
|
|
- v-model:form-data="warehouseForm"
|
|
|
|
|
- @submit="handleWarehouseSubmit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <WarehouseDialog v-model:visible="financeDialog.visible" v-model:form-data="warehouseForm" @submit="handleWarehouseSubmit" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="PartnerMerchant" lang="ts">
|
|
<script setup name="PartnerMerchant" lang="ts">
|
|
|
import { PartnerMerchantVO, PartnerMerchantForm, PartnerMerchantQuery } from '@/api/partner/merchant/types';
|
|
import { PartnerMerchantVO, PartnerMerchantForm, PartnerMerchantQuery } from '@/api/partner/merchant/types';
|
|
|
-import { listPartnerMerchant, getPartnerMerchant, addPartnerMerchant, updatePartnerMerchant, delPartnerMerchant, exportPartnerMerchant } from '@/api/partner/merchant';
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ listPartnerMerchant,
|
|
|
|
|
+ getPartnerMerchant,
|
|
|
|
|
+ addPartnerMerchant,
|
|
|
|
|
+ updatePartnerMerchant,
|
|
|
|
|
+ delPartnerMerchant,
|
|
|
|
|
+ exportPartnerMerchant
|
|
|
|
|
+} from '@/api/partner/merchant';
|
|
|
import WarehouseDialog from './components/WarehouseDialog.vue';
|
|
import WarehouseDialog from './components/WarehouseDialog.vue';
|
|
|
import QualificationDialog from './components/QualificationDialog.vue';
|
|
import QualificationDialog from './components/QualificationDialog.vue';
|
|
|
import BankDialog from './components/BankDialog.vue';
|
|
import BankDialog from './components/BankDialog.vue';
|
|
@@ -394,7 +377,7 @@ const activeTab = ref('basic');
|
|
|
// 监听标签页切换,实现懒加载
|
|
// 监听标签页切换,实现懒加载
|
|
|
watch(activeTab, (newTab) => {
|
|
watch(activeTab, (newTab) => {
|
|
|
if (!currentPartnerId.value) return;
|
|
if (!currentPartnerId.value) return;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
switch (newTab) {
|
|
switch (newTab) {
|
|
|
case 'qualification':
|
|
case 'qualification':
|
|
|
if (qualificationList.value.length === 0) loadQualificationList();
|
|
if (qualificationList.value.length === 0) loadQualificationList();
|
|
@@ -572,15 +555,17 @@ const warehouseRules = {
|
|
|
|
|
|
|
|
const getList = () => {
|
|
const getList = () => {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
- listPartnerMerchant(queryParams.value).then((response: any) => {
|
|
|
|
|
- console.log('列表数据返回:', response);
|
|
|
|
|
- merchantList.value = response.rows || [];
|
|
|
|
|
- total.value = response.total || 0;
|
|
|
|
|
- loading.value = false;
|
|
|
|
|
- }).catch((error) => {
|
|
|
|
|
- console.error('获取列表失败:', error);
|
|
|
|
|
- loading.value = false;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ listPartnerMerchant(queryParams.value)
|
|
|
|
|
+ .then((response: any) => {
|
|
|
|
|
+ console.log('列表数据返回:', response);
|
|
|
|
|
+ merchantList.value = response.rows || [];
|
|
|
|
|
+ total.value = response.total || 0;
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error) => {
|
|
|
|
|
+ console.error('获取列表失败:', error);
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const cancel = () => {
|
|
const cancel = () => {
|
|
@@ -640,23 +625,23 @@ const handleSelectionChange = (selection: PartnerMerchantVO[]) => {
|
|
|
|
|
|
|
|
const handleUpdate = async (row?: PartnerMerchantVO) => {
|
|
const handleUpdate = async (row?: PartnerMerchantVO) => {
|
|
|
const id = row?.id || ids.value[0];
|
|
const id = row?.id || ids.value[0];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (!id) {
|
|
if (!id) {
|
|
|
proxy?.$modal.msgError('请选择要修改的数据');
|
|
proxy?.$modal.msgError('请选择要修改的数据');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
const response: any = await getPartnerMerchant(id);
|
|
const response: any = await getPartnerMerchant(id);
|
|
|
const responseData = response.data || response.rows?.[0] || response;
|
|
const responseData = response.data || response.rows?.[0] || response;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (!responseData) {
|
|
if (!responseData) {
|
|
|
throw new Error('未获取到数据');
|
|
throw new Error('未获取到数据');
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 先设置标签页为基本信息(在打开抽屉之前)
|
|
// 先设置标签页为基本信息(在打开抽屉之前)
|
|
|
activeTab.value = 'basic';
|
|
activeTab.value = 'basic';
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 设置表单数据
|
|
// 设置表单数据
|
|
|
form.value = {
|
|
form.value = {
|
|
|
id: responseData.id,
|
|
id: responseData.id,
|
|
@@ -672,9 +657,9 @@ const handleUpdate = async (row?: PartnerMerchantVO) => {
|
|
|
remark: responseData.remark || '',
|
|
remark: responseData.remark || '',
|
|
|
status: responseData.status || '0'
|
|
status: responseData.status || '0'
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
currentPartnerId.value = responseData.id;
|
|
currentPartnerId.value = responseData.id;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 清空所有子项列表,确保数据干净
|
|
// 清空所有子项列表,确保数据干净
|
|
|
qualificationList.value = [];
|
|
qualificationList.value = [];
|
|
|
bankList.value = [];
|
|
bankList.value = [];
|
|
@@ -682,14 +667,14 @@ const handleUpdate = async (row?: PartnerMerchantVO) => {
|
|
|
contractList.value = [];
|
|
contractList.value = [];
|
|
|
userList.value = [];
|
|
userList.value = [];
|
|
|
warehouseList.value = [];
|
|
warehouseList.value = [];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 打开抽屉
|
|
// 打开抽屉
|
|
|
dialog.visible = true;
|
|
dialog.visible = true;
|
|
|
dialog.title = '修改伙伴商';
|
|
dialog.title = '修改伙伴商';
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 使用nextTick确保DOM更新后再加载基本信息标签页的数据(如果需要)
|
|
// 使用nextTick确保DOM更新后再加载基本信息标签页的数据(如果需要)
|
|
|
await nextTick();
|
|
await nextTick();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 不再一次性加载所有子项数据,改为在切换标签页时按需加载
|
|
// 不再一次性加载所有子项数据,改为在切换标签页时按需加载
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('获取详情失败:', error);
|
|
console.error('获取详情失败:', error);
|
|
@@ -708,15 +693,15 @@ const submitForm = () => {
|
|
|
} else {
|
|
} else {
|
|
|
await addPartnerMerchant(form.value);
|
|
await addPartnerMerchant(form.value);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存所有子项数据(新增和修改)
|
|
// 保存所有子项数据(新增和修改)
|
|
|
const savePromises = [];
|
|
const savePromises = [];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存资质数据
|
|
// 保存资质数据
|
|
|
for (const item of qualificationList.value) {
|
|
for (const item of qualificationList.value) {
|
|
|
const itemAny = item as any;
|
|
const itemAny = item as any;
|
|
|
console.log('资质数据:', item, 'id类型:', typeof item.id);
|
|
console.log('资质数据:', item, 'id类型:', typeof item.id);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 判断是新增还是修改:只有以temp_开头的ID才是新增,其他都是修改
|
|
// 判断是新增还是修改:只有以temp_开头的ID才是新增,其他都是修改
|
|
|
if (String(item.id).startsWith('temp_')) {
|
|
if (String(item.id).startsWith('temp_')) {
|
|
|
// 新增数据:删除临时ID
|
|
// 新增数据:删除临时ID
|
|
@@ -749,7 +734,7 @@ const submitForm = () => {
|
|
|
savePromises.push(updatePartnerQualification(data));
|
|
savePromises.push(updatePartnerQualification(data));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存银行账户数据
|
|
// 保存银行账户数据
|
|
|
for (const item of bankList.value) {
|
|
for (const item of bankList.value) {
|
|
|
const itemAny = item as any;
|
|
const itemAny = item as any;
|
|
@@ -786,7 +771,7 @@ const submitForm = () => {
|
|
|
savePromises.push(updatePartnerBank(data));
|
|
savePromises.push(updatePartnerBank(data));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存联系人数据
|
|
// 保存联系人数据
|
|
|
for (const item of contactList.value) {
|
|
for (const item of contactList.value) {
|
|
|
const itemAny = item as any;
|
|
const itemAny = item as any;
|
|
@@ -815,7 +800,7 @@ const submitForm = () => {
|
|
|
savePromises.push(updatePartnerContacts(data));
|
|
savePromises.push(updatePartnerContacts(data));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存合同数据
|
|
// 保存合同数据
|
|
|
for (const item of contractList.value) {
|
|
for (const item of contractList.value) {
|
|
|
const itemAny = item as any;
|
|
const itemAny = item as any;
|
|
@@ -870,7 +855,7 @@ const submitForm = () => {
|
|
|
savePromises.push(updatePartnerContract(data));
|
|
savePromises.push(updatePartnerContract(data));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存用户账号数据
|
|
// 保存用户账号数据
|
|
|
for (const item of userList.value) {
|
|
for (const item of userList.value) {
|
|
|
const itemAny = item as any;
|
|
const itemAny = item as any;
|
|
@@ -907,7 +892,7 @@ const submitForm = () => {
|
|
|
savePromises.push(updatePartnerUser(data));
|
|
savePromises.push(updatePartnerUser(data));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 保存仓库数据
|
|
// 保存仓库数据
|
|
|
for (const item of warehouseList.value) {
|
|
for (const item of warehouseList.value) {
|
|
|
const itemAny = item as any;
|
|
const itemAny = item as any;
|
|
@@ -944,7 +929,7 @@ const submitForm = () => {
|
|
|
savePromises.push(updatePartnerWarehouse(data));
|
|
savePromises.push(updatePartnerWarehouse(data));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 等待所有子项保存完成
|
|
// 等待所有子项保存完成
|
|
|
if (savePromises.length > 0) {
|
|
if (savePromises.length > 0) {
|
|
|
await Promise.all(savePromises);
|
|
await Promise.all(savePromises);
|
|
@@ -952,7 +937,7 @@ const submitForm = () => {
|
|
|
} else {
|
|
} else {
|
|
|
proxy?.$modal.msgSuccess(form.value.id ? '修改成功' : '新增成功');
|
|
proxy?.$modal.msgSuccess(form.value.id ? '修改成功' : '新增成功');
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
cancel();
|
|
cancel();
|
|
|
if (!form.value.id) {
|
|
if (!form.value.id) {
|
|
|
queryParams.value.pageNum = 1;
|
|
queryParams.value.pageNum = 1;
|
|
@@ -975,13 +960,15 @@ const handleDelete = async (row?: PartnerMerchantVO) => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
const handleExport = () => {
|
|
const handleExport = () => {
|
|
|
- proxy?.$modal.confirm('是否确认导出所有伙伴商数据?').then(() => {
|
|
|
|
|
- return exportPartnerMerchant(queryParams.value);
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- proxy?.$modal.msgSuccess('导出成功');
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ proxy?.$modal
|
|
|
|
|
+ .confirm('是否确认导出所有伙伴商数据?')
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ return exportPartnerMerchant(queryParams.value);
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ proxy?.$modal.msgSuccess('导出成功');
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 通用子项提交函数
|
|
// 通用子项提交函数
|
|
@@ -997,11 +984,11 @@ const submitSubItem = <T extends { id?: string | number; partnerId?: string | nu
|
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果提供了formRef,先进行表单验证
|
|
// 如果提供了formRef,先进行表单验证
|
|
|
const doSubmit = () => {
|
|
const doSubmit = () => {
|
|
|
- const existingIndex = list.value.findIndex(item => item.id === form.value.id);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const existingIndex = list.value.findIndex((item) => item.id === form.value.id);
|
|
|
|
|
+
|
|
|
if (existingIndex !== -1) {
|
|
if (existingIndex !== -1) {
|
|
|
// 编辑模式
|
|
// 编辑模式
|
|
|
const updatedItem: any = { ...form.value };
|
|
const updatedItem: any = { ...form.value };
|
|
@@ -1020,11 +1007,11 @@ const submitSubItem = <T extends { id?: string | number; partnerId?: string | nu
|
|
|
list.value.push(newItem);
|
|
list.value.push(newItem);
|
|
|
proxy?.$modal.msgSuccess(`添加成功,请点击保存按钮保存到数据库`);
|
|
proxy?.$modal.msgSuccess(`添加成功,请点击保存按钮保存到数据库`);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
dialog.visible = false;
|
|
dialog.visible = false;
|
|
|
form.value = { ...formReset };
|
|
form.value = { ...formReset };
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (formRef?.value) {
|
|
if (formRef?.value) {
|
|
|
formRef.value.validate((valid: boolean) => {
|
|
formRef.value.validate((valid: boolean) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
@@ -1215,12 +1202,12 @@ const handleAddWarehouse = () => {
|
|
|
|
|
|
|
|
// 编辑和删除处理函数
|
|
// 编辑和删除处理函数
|
|
|
const handleEditQualification = (row: PartnerQualificationVO) => {
|
|
const handleEditQualification = (row: PartnerQualificationVO) => {
|
|
|
- qualificationForm.value = { ...row };
|
|
|
|
|
|
|
+ qualificationForm.value = { ...row } as any;
|
|
|
qualificationDialog.visible = true;
|
|
qualificationDialog.visible = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleDeleteQualification = async (row: PartnerQualificationVO) => {
|
|
const handleDeleteQualification = async (row: PartnerQualificationVO) => {
|
|
|
- const index = qualificationList.value.findIndex(item => item.id === row.id);
|
|
|
|
|
|
|
+ const index = qualificationList.value.findIndex((item) => item.id === row.id);
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
|
// 如果是新增的数据(临时ID),直接从列表中删除
|
|
// 如果是新增的数据(临时ID),直接从列表中删除
|
|
|
if ((row as any)._isNew) {
|
|
if ((row as any)._isNew) {
|
|
@@ -1237,12 +1224,12 @@ const handleDeleteQualification = async (row: PartnerQualificationVO) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleEditBank = (row: PartnerBankVO) => {
|
|
const handleEditBank = (row: PartnerBankVO) => {
|
|
|
- bankForm.value = { ...row };
|
|
|
|
|
|
|
+ bankForm.value = { ...row } as any;
|
|
|
financialDialog.visible = true;
|
|
financialDialog.visible = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleDeleteBank = async (row: PartnerBankVO) => {
|
|
const handleDeleteBank = async (row: PartnerBankVO) => {
|
|
|
- const index = bankList.value.findIndex(item => item.id === row.id);
|
|
|
|
|
|
|
+ const index = bankList.value.findIndex((item) => item.id === row.id);
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
|
if ((row as any)._isNew) {
|
|
if ((row as any)._isNew) {
|
|
|
bankList.value.splice(index, 1);
|
|
bankList.value.splice(index, 1);
|
|
@@ -1257,12 +1244,12 @@ const handleDeleteBank = async (row: PartnerBankVO) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleEditUser = (row: PartnerUserVO) => {
|
|
const handleEditUser = (row: PartnerUserVO) => {
|
|
|
- userForm.value = { ...row };
|
|
|
|
|
|
|
+ userForm.value = { ...row } as any;
|
|
|
accountDialog.visible = true;
|
|
accountDialog.visible = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleDeleteUser = async (row: PartnerUserVO) => {
|
|
const handleDeleteUser = async (row: PartnerUserVO) => {
|
|
|
- const index = userList.value.findIndex(item => item.id === row.id);
|
|
|
|
|
|
|
+ const index = userList.value.findIndex((item) => item.id === row.id);
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
|
if ((row as any)._isNew) {
|
|
if ((row as any)._isNew) {
|
|
|
userList.value.splice(index, 1);
|
|
userList.value.splice(index, 1);
|
|
@@ -1277,12 +1264,12 @@ const handleDeleteUser = async (row: PartnerUserVO) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleEditContact = (row: PartnerContactsVO) => {
|
|
const handleEditContact = (row: PartnerContactsVO) => {
|
|
|
- contactForm.value = { ...row };
|
|
|
|
|
|
|
+ contactForm.value = { ...row } as any;
|
|
|
contactDialog.visible = true;
|
|
contactDialog.visible = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleDeleteContact = async (row: PartnerContactsVO) => {
|
|
const handleDeleteContact = async (row: PartnerContactsVO) => {
|
|
|
- const index = contactList.value.findIndex(item => item.id === row.id);
|
|
|
|
|
|
|
+ const index = contactList.value.findIndex((item) => item.id === row.id);
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
|
if ((row as any)._isNew) {
|
|
if ((row as any)._isNew) {
|
|
|
contactList.value.splice(index, 1);
|
|
contactList.value.splice(index, 1);
|
|
@@ -1297,12 +1284,12 @@ const handleDeleteContact = async (row: PartnerContactsVO) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleEditContract = (row: PartnerContractVO) => {
|
|
const handleEditContract = (row: PartnerContractVO) => {
|
|
|
- contractForm.value = { ...row };
|
|
|
|
|
|
|
+ contractForm.value = { ...row } as any;
|
|
|
companyDialog.visible = true;
|
|
companyDialog.visible = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleDeleteContract = async (row: PartnerContractVO) => {
|
|
const handleDeleteContract = async (row: PartnerContractVO) => {
|
|
|
- const index = contractList.value.findIndex(item => item.id === row.id);
|
|
|
|
|
|
|
+ const index = contractList.value.findIndex((item) => item.id === row.id);
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
|
if ((row as any)._isNew) {
|
|
if ((row as any)._isNew) {
|
|
|
contractList.value.splice(index, 1);
|
|
contractList.value.splice(index, 1);
|
|
@@ -1317,12 +1304,12 @@ const handleDeleteContract = async (row: PartnerContractVO) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleEditWarehouse = (row: PartnerWarehouseVO) => {
|
|
const handleEditWarehouse = (row: PartnerWarehouseVO) => {
|
|
|
- warehouseForm.value = { ...row };
|
|
|
|
|
|
|
+ warehouseForm.value = { ...row } as any;
|
|
|
financeDialog.visible = true;
|
|
financeDialog.visible = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleDeleteWarehouse = async (row: PartnerWarehouseVO) => {
|
|
const handleDeleteWarehouse = async (row: PartnerWarehouseVO) => {
|
|
|
- const index = warehouseList.value.findIndex(item => item.id === row.id);
|
|
|
|
|
|
|
+ const index = warehouseList.value.findIndex((item) => item.id === row.id);
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
|
if ((row as any)._isNew) {
|
|
if ((row as any)._isNew) {
|
|
|
warehouseList.value.splice(index, 1);
|
|
warehouseList.value.splice(index, 1);
|
|
@@ -1341,7 +1328,7 @@ const handleQualificationSubmit = (formData: PartnerQualificationForm) => {
|
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const existingIndex = qualificationList.value.findIndex(item => item.id === formData.id);
|
|
|
|
|
|
|
+ const existingIndex = qualificationList.value.findIndex((item) => item.id === formData.id);
|
|
|
if (existingIndex !== -1) {
|
|
if (existingIndex !== -1) {
|
|
|
const updatedItem: any = { ...formData };
|
|
const updatedItem: any = { ...formData };
|
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
@@ -1367,7 +1354,7 @@ const handleBankSubmit = (formData: PartnerBankForm) => {
|
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const existingIndex = bankList.value.findIndex(item => item.id === formData.id);
|
|
|
|
|
|
|
+ const existingIndex = bankList.value.findIndex((item) => item.id === formData.id);
|
|
|
if (existingIndex !== -1) {
|
|
if (existingIndex !== -1) {
|
|
|
const updatedItem: any = { ...formData };
|
|
const updatedItem: any = { ...formData };
|
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
@@ -1393,7 +1380,7 @@ const handleUserSubmit = (formData: PartnerUserForm) => {
|
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const existingIndex = userList.value.findIndex(item => item.id === formData.id);
|
|
|
|
|
|
|
+ const existingIndex = userList.value.findIndex((item) => item.id === formData.id);
|
|
|
if (existingIndex !== -1) {
|
|
if (existingIndex !== -1) {
|
|
|
const updatedItem: any = { ...formData };
|
|
const updatedItem: any = { ...formData };
|
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
@@ -1419,7 +1406,7 @@ const handleContactSubmit = (formData: PartnerContactsForm) => {
|
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const existingIndex = contactList.value.findIndex(item => item.id === formData.id);
|
|
|
|
|
|
|
+ const existingIndex = contactList.value.findIndex((item) => item.id === formData.id);
|
|
|
if (existingIndex !== -1) {
|
|
if (existingIndex !== -1) {
|
|
|
const updatedItem: any = { ...formData };
|
|
const updatedItem: any = { ...formData };
|
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
@@ -1445,7 +1432,7 @@ const handleContractSubmit = (formData: PartnerContractForm) => {
|
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const existingIndex = contractList.value.findIndex(item => item.id === formData.id);
|
|
|
|
|
|
|
+ const existingIndex = contractList.value.findIndex((item) => item.id === formData.id);
|
|
|
if (existingIndex !== -1) {
|
|
if (existingIndex !== -1) {
|
|
|
const updatedItem: any = { ...formData };
|
|
const updatedItem: any = { ...formData };
|
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
updatedItem.partnerId = currentPartnerId.value;
|
|
@@ -1472,9 +1459,9 @@ const handleWarehouseSubmit = (formData: PartnerWarehouseForm) => {
|
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
proxy?.$modal.msgError('请先选择伙伴商');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- const existingIndex = warehouseList.value.findIndex(item => item.id === formData.id);
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const existingIndex = warehouseList.value.findIndex((item) => item.id === formData.id);
|
|
|
|
|
+
|
|
|
if (existingIndex !== -1) {
|
|
if (existingIndex !== -1) {
|
|
|
// 编辑模式
|
|
// 编辑模式
|
|
|
const updatedItem: any = { ...formData };
|
|
const updatedItem: any = { ...formData };
|
|
@@ -1493,7 +1480,7 @@ const handleWarehouseSubmit = (formData: PartnerWarehouseForm) => {
|
|
|
warehouseList.value.push(newItem);
|
|
warehouseList.value.push(newItem);
|
|
|
proxy?.$modal.msgSuccess('添加成功,请点击保存按钮保存到数据库');
|
|
proxy?.$modal.msgSuccess('添加成功,请点击保存按钮保存到数据库');
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 关闭对话框
|
|
// 关闭对话框
|
|
|
financeDialog.visible = false;
|
|
financeDialog.visible = false;
|
|
|
// 重置表单
|
|
// 重置表单
|