客户组

This commit is contained in:
‘huanghaiixia’
2025-12-17 16:06:44 +08:00
parent 1eee4dcd60
commit a27bf90e9d
16 changed files with 2773 additions and 615 deletions

View File

@ -284,26 +284,7 @@
<span style="font-size: 12px;font-weight: normal;">上传公司财报等附件</span>
</div>
</template>
<Upload v-if="!isDisable" style="margin-bottom: 10px;" :file-list="dataFile" :showUploadList="false"
v-model:value="formState.filePath" v-model:tableName="tableName" v-model:columnName="columnName"
:btnTip="btnTip" @change="changeUplod" :multiple="true" :dataDelete="true"
:showDownloadIcon="false"
/>
<a-table :columns="columnsFile" :data-source="dataFile" >
<template #bodyCell="{ column,record,index, text }">
<template v-if="column.dataIndex === 'fileOrg'">
<a @click="handleDownload(record)">{{record.fileOrg}}</a>
</template>
<template v-if="column.dataIndex === 'docDesc' && !isDisable">
<a-input :placeholder="t('请输入附件说明')" :disabled="isDisable" v-model:value="record.docDesc" />
</template>
<template v-if="column.dataIndex === 'operation'">
<a style="margin-right: 10px" @click="btnCheck('file', 'delete', record, index)">删除</a>
<ArrowUpOutlined style="margin-right: 10px;" class="btn" @click="btnCheck('file', 'up', record, index)" />
<ArrowDownOutlined class="btn" @click="btnCheck('file', 'down', record, index)" />
</template>
</template>
</a-table>
<UploadList ref="uploadFile" :disabled="isDisable" :file-list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName"/>
</a-card>
</a-form>
</div>
@ -332,15 +313,14 @@
import dayjs from 'dayjs';
import { getAppEnvConfig } from '/@/utils/env';
import { message } from 'ant-design-vue';
import Upload from '/@/components/Form/src/components/Upload.vue';
import { parseDownloadUrl} from '/@/api/system/file';
import { downloadByUrl } from '/@/utils/file/download';
import UploadList from '/@/components/Form/src/components/UploadList.vue';
const tableName = '1';
const columnName = '1'
const formType = ref('2'); // 0 新建 1 修改 2 查看
const formRef = ref();
const uploadFile = ref()
const props = defineProps({
disabled: false,
id: ''
@ -427,12 +407,6 @@
{ title: t('备注'), dataIndex: 'note', sorter: true},
{ title: t('操作'), dataIndex: 'operation', sorter: true},
]);
const columnsFile = ref([
{ title: t('序号'), dataIndex: 'index', sorter: true, customRender: (column) => `${column.index + 1}`},
{ title: t('附件名称'), dataIndex: 'fileOrg', sorter: true},
{ title: t('附件说明'), dataIndex: 'docDesc', sorter: true},
{ title: t('操作'), dataIndex: 'operation', sorter: true},
]);
const dataCertificate= reactive([]);
const dataBank= reactive([]);
const dataFile = ref([]);
@ -468,8 +442,6 @@
idx>-1 && columnsBank.value.splice(idx, 1)
let idx1 = columnsContact.value.findIndex(v =>v.dataIndex == 'operation')
idx1>-1 && columnsContact.value.splice(idx1, 1)
let idx2 = columnsFile.value.findIndex(v =>v.dataIndex == 'operation')
idx2>-1 && columnsFile.value.splice(idx2, 1)
}
},
{
@ -483,11 +455,6 @@
}
});
const handleDownload = (info) => {
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
downloadByUrl({ url, fileName: fileName});
};
async function getList(id) {
spinning.value = true
try {
@ -588,24 +555,6 @@
}
}
// 附件
if (type == 'file') {
if (btn == 'delete') {
dataFile.value.splice(index, 1)
}
if (btn == 'up') {
if (index === 0) {
return
}
dataFile.value[index] = dataFile.value.splice(index-1, 1, dataFile.value[index])[0];
}
if (btn == 'down') {
if (index === dataFile.value.length - 1) {
return
}
dataFile.value[index] = dataFile.value.splice(index+1, 1, dataFile.value[index])[0];
}
}
}
const handleSuccessCertificate = (val) => {
// 编辑
@ -633,16 +582,6 @@
}
dataBank.push(val)
}
function changeUplod (val) {
dataFile.value = []
val.forEach(v => {
v.fileOrg = v.fileOrg || v.fileName,
v.filePath = v.filePath || v.fileUrl,
v.fileSize = v.fileSize
dataFile.value.push(v)
})
console.log(val, 532, dataFile.value)
}
function close() {
tabStore.closeTab(currentRoute.value, router);
}
@ -677,23 +616,16 @@
arrCertificate.forEach(v => {
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom ).format('YYYY-MM-DD HH:mm:ss') : '';
v.dateTo = v.dateTo ? dayjs(v.dateTo ).format('YYYY-MM-DD HH:mm:ss'): '';
(v.fileList || []).forEach(i => {
i.id = ''
})
})
let arrUploadList = JSON.parse(JSON.stringify(dataFile.value))
arrUploadList.forEach(v => {
v.id= ''
})
let file = await uploadFile.value.getFileList()
let obj = {
...formState,
lngCustomerBankList: dataBank,
lngCustomerDocList: arrCertificate,
lngCustomerContactList: dataContact,
lngFileUploadList: arrUploadList
lngFileUploadList: file
}
console.log(arrCertificate, 'arrCertificate')
spinning.value = true;
let request = !formState.id ? addLngCustomer :updateLngCustomer

View File

@ -1,21 +1,21 @@
<template>
<SimpleForm
class="formViewStyle"
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="{}"
:isWorkFlow="props.fromPage!=FromPageType.MENU">
<template #dateFrom="{ formModel }">
<FormItem label="起始日期" :label-col="{ span: 5, offset: 0 }" labelAlign="right" name="dateFrom" class="dateStyle">
<a-date-picker v-model:value="formModel.dateFrom" format="YYYY-MM-DD" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择" />
<a-date-picker v-model:value="formModel.dateFrom" :disabled="isView" format="YYYY-MM-DD" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择" />
</FormItem>
</template>
<template #dateTo="{ formModel }">
<FormItem label="结束日期" labelAlign="right" name="dateTo" class="dateStyle">
<a-date-picker v-model:value="formModel.dateTo" format="YYYY-MM-DD" :disabled-date="disabledDateEnd" style="width: 100%" placeholder="请选择" />
<a-date-picker v-model:value="formModel.dateTo" :disabled="isView" format="YYYY-MM-DD" :disabled-date="disabledDateEnd" style="width: 100%" placeholder="请选择" />
</FormItem>
</template>
</template>
</SimpleForm>
<a-card :bordered="false" >
<template #title>
<div style="display: flex; align-items: center;">
@ -27,15 +27,6 @@
<a-button v-if="!isView" type="primary" style="margin-bottom: 10px;" @click="handleAdd">新增组成员</a-button>
<a-table :columns="columns" :data-source="dataList" :pagination="false">
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'natureCode'">
{{ (optionSelect.natureCodeList.find(v=>v.code == record.natureCode) || {}).name }}
</template>
<template v-if="column.dataIndex === 'typeCode'">
{{ (optionSelect.typeCodeList.find(v=>v.code == record.typeCode) || {}).name }}
</template>
<template v-if="column.dataIndex === 'classCode'">
{{ (optionSelect.classCodeList.find(v=>v.code == record.classCode) || {}).name }}
</template>
<template v-if="column.dataIndex === 'operation'">
<a @click="btnCheck(record, index)">删除</a>
</template>
@ -62,7 +53,7 @@
import { useI18n } from '/@/hooks/web/useI18n';
import { useModal } from '/@/components/Modal';
import customerListModal from './customerListModal.vue';
import { getDictionary } from '/@/api/sales/Customer';
import dayjs from 'dayjs';
const FormItem = Form.Item;
const { t } = useI18n();
@ -99,11 +90,6 @@
{ title: t('操作'), dataIndex: 'operation', width: 120},
]);
const dataList = ref([])
const optionSelect = reactive({
natureCodeList: [],
classCodeList: [],
typeCodeList: []
})
const isView = ref(false)
const disabledDateStart = (startValue) => {
@ -144,15 +130,19 @@
}
})
})
dataList.value = [...dataList.value, ...arr]
dataList.value = unique([...dataList.value, ...arr], 'cuCode')
}
async function getOption() {
optionSelect.natureCodeList = await getDictionary('LNG_ENT_PR')
optionSelect.classCodeList = await getDictionary('LNG_CLASS')
optionSelect.typeCodeList = await getDictionary('LNG_CU_TYP')
function unique(arr, u_key) {
const map = new Map()
arr.forEach((item, index) => {
if (!map.has(item[u_key])) {
map.set(item[u_key], item)
}
})
return [...map.values()]
}
onMounted(async () => {
getOption()
isView.value = currentRoute.value?.fullPath.includes('viewForm')
if (isView.value) {
let idx = columns.value.findIndex(v =>v.dataIndex=='operation')
@ -231,7 +221,9 @@
// 根据行唯一ID查询行数据并设置表单数据 【编辑】
async function setFormDataFromId(rowId, skipUpdate) {
try {
const record = await getLngCustomerGroup(rowId);
let record = await getLngCustomerGroup(rowId);
record.dateFrom = record.dateFrom ? dayjs(record.dateFrom) : null
record.dateTo = record.dateTo ? dayjs(record.dateTo) : null
if (skipUpdate) {
return record;
}

View File

@ -13,6 +13,7 @@ export const searchFormSchema: FormSchema[] = [
componentProps: {
format: 'YYYY-MM-DD',
style: { width: '100%' },
allowClear: true,
getPopupContainer: () => document.body,
},
},
@ -47,7 +48,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'typeCode',
dataIndex: 'typeName',
title: '类型',
componentType: 'select',
align: 'left',

View File

@ -99,12 +99,12 @@
gutter: 16,
},
schemas: customSearchFormSchema,
fieldMapToTime: [['dateFrom', ['dateFromStart', 'dateFromEnd'], 'YYYY-MM-DD HH:mm:ss ', true],
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD HH:mm:ss ', true],
['dateTo', ['dateToStart', 'dateToEnd'], 'YYYY-MM-DD HH:mm:ss ', true],],
showResetButton: true,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
},
afterFetch: (res) => {
clearSelectedRowKeys()