diff --git a/src/api/sales/CustomerGroup/index.ts b/src/api/sales/CustomerGroup/index.ts index ec4f645..8642d0f 100644 --- a/src/api/sales/CustomerGroup/index.ts +++ b/src/api/sales/CustomerGroup/index.ts @@ -3,10 +3,12 @@ import { defHttp } from '/@/utils/http/axios'; import { ErrorMessageMode } from '/#/axios'; enum Api { - Page = '/sales/customerGroup/page', + // Page = '/sales/customerGroup/page', List = '/sales/customerGroup/list', Info = '/sales/customerGroup/info', LngCustomerGroup = '/sales/customerGroup', + + Page = '/magic-api/sales/customerGroupPage', diff --git a/src/api/supplier/Supplier/index.ts b/src/api/supplier/Supplier/index.ts new file mode 100644 index 0000000..f9fc5ca --- /dev/null +++ b/src/api/supplier/Supplier/index.ts @@ -0,0 +1,121 @@ +import { LngSupplierPageModel, LngSupplierPageParams, LngSupplierPageResult } from './model/SupplierModel'; +import { defHttp } from '/@/utils/http/axios'; +import { ErrorMessageMode } from '/#/axios'; + +enum Api { + Page = '/supplier/supplier/page', + List = '/supplier/supplier/list', + Info = '/supplier/supplier/info', + LngSupplier = '/supplier/supplier', + + + + Enable = '/supplier/supplier/enable', + Disable= '/supplier/supplier/disable', + +} + +/** + * @description: 查询LngSupplier分页列表 + */ +export async function getLngSupplierPage(params: LngSupplierPageParams, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.Page, + params, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 获取LngSupplier信息 + */ +export async function getLngSupplier(id: String, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.Info, + params: { id }, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 新增LngSupplier + */ +export async function addLngSupplier(lngSupplier: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.LngSupplier, + params: lngSupplier, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 更新LngSupplier + */ +export async function updateLngSupplier(lngSupplier: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.put( + { + url: Api.LngSupplier, + params: lngSupplier, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 删除LngSupplier(批量删除) + */ +export async function deleteLngSupplier(ids: string[], mode: ErrorMessageMode = 'modal') { + return defHttp.delete( + { + url: Api.LngSupplier, + data: ids, + }, + { + errorMessageMode: mode, + }, + ); +} + + +/** + * @description: 启用数据LngSupplier + */ +export async function enableLngSupplier(ids: string[], mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.Enable, + data: ids, + }, + { + errorMessageMode: mode, + }, + ); +} +/** + * @description: 作废数据LngSupplier + */ +export async function disableLngSupplier(ids: string[], mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.Disable, + data: ids, + }, + { + errorMessageMode: mode, + }, + ); +} \ No newline at end of file diff --git a/src/api/supplier/Supplier/model/SupplierModel.ts b/src/api/supplier/Supplier/model/SupplierModel.ts new file mode 100644 index 0000000..ac51b19 --- /dev/null +++ b/src/api/supplier/Supplier/model/SupplierModel.ts @@ -0,0 +1,226 @@ +import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; + +/** + * @description: LngSupplier分页参数 模型 + */ +export interface LngSupplierPageParams extends BasicPageParams { + suName: string; + + suSname: string; + + natureCode: string; + + typeCode: string; + + classCode: string; + + dI: string; + + valid: string; + + approCode: string; +} + +/** + * @description: LngSupplier分页返回值模型 + */ +export interface LngSupplierPageModel { + id: string; + + suName: string; + + suSname: string; + + natureCode: string; + + typeCode: string; + + classCode: string; + + dI: string; + + valid: string; + + approCode: string; +} + +/** + * @description: LngSupplier表类型 + */ +export interface LngSupplierModel { + id: number; + + suMcode: string; + + suCode: string; + + suName: string; + + suSname: string; + + dI: string; + + natureCode: string; + + parentName: string; + + creditNo: string; + + tiNo: string; + + representative: string; + + amtReg: string; + + addrReg: string; + + addrMail: string; + + dateEstab: string; + + dateEntry: string; + + classCode: string; + + typeCode: string; + + orgCode: string; + + valid: string; + + approCode: string; + + note: string; + + createUserId: number; + + createDate: string; + + modifyUserId: number; + + modifyDate: string; + + tenantId: number; + + deptId: number; + + ruleUserId: number; + + lngSupplierBankList?: LngSupplierBankModel; + + lngSupplierContactList?: LngSupplierContactModel; + + lngSupplierDocList?: LngSupplierDocModel; +} + +/** + * @description: LngSupplierBank表类型 + */ +export interface LngSupplierBankModel { + id: number; + + suCode: string; + + bankCode: string; + + accountName: string; + + account: string; + + defaultSign: string; + + note: string; + + createUserId: number; + + createDate: string; + + modifyUserId: number; + + modifyDate: string; + + tenantId: number; + + deptId: number; + + ruleUserId: number; +} + +/** + * @description: LngSupplierContact表类型 + */ +export interface LngSupplierContactModel { + id: number; + + suCode: string; + + contactName: string; + + tel: string; + + addrMail: string; + + email: string; + + position: string; + + valid: string; + + note: string; + + createUserId: number; + + createDate: string; + + modifyUserId: number; + + modifyDate: string; + + tenantId: number; + + deptId: number; + + ruleUserId: number; +} + +/** + * @description: LngSupplierDoc表类型 + */ +export interface LngSupplierDocModel { + id: number; + + suCode: string; + + docTypeCode: string; + + docNo: string; + + dateFrom: string; + + dateTo: string; + + sort: number; + + valid: string; + + note: string; + + createUserId: number; + + createDate: string; + + modifyUserId: number; + + modifyDate: string; + + tenantId: number; + + deptId: number; + + ruleUserId: number; +} + +/** + * @description: LngSupplier分页返回值结构 + */ +export type LngSupplierPageResult = BasicFetchResult; \ No newline at end of file diff --git a/src/components/Form/src/components/UploadList.vue b/src/components/Form/src/components/UploadList.vue new file mode 100644 index 0000000..376f9a7 --- /dev/null +++ b/src/components/Form/src/components/UploadList.vue @@ -0,0 +1,138 @@ + + + diff --git a/src/components/Form/src/components/UploadNew.vue b/src/components/Form/src/components/UploadNew.vue deleted file mode 100644 index d457136..0000000 --- a/src/components/Form/src/components/UploadNew.vue +++ /dev/null @@ -1,511 +0,0 @@ - - - diff --git a/src/views/sales/Customer/components/createForm.vue b/src/views/sales/Customer/components/createForm.vue index 9968154..19b8fbf 100644 --- a/src/views/sales/Customer/components/createForm.vue +++ b/src/views/sales/Customer/components/createForm.vue @@ -284,26 +284,7 @@ (上传公司财报等附件) - - - - + @@ -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 diff --git a/src/views/sales/CustomerGroup/components/Form.vue b/src/views/sales/CustomerGroup/components/Form.vue index e88fd48..b9d5b2e 100644 --- a/src/views/sales/CustomerGroup/components/Form.vue +++ b/src/views/sales/CustomerGroup/components/Form.vue @@ -1,21 +1,21 @@ -