diff --git a/src/api/common/index.ts b/src/api/common/index.ts index 4d6aa173..f7cd96d4 100644 --- a/src/api/common/index.ts +++ b/src/api/common/index.ts @@ -100,7 +100,7 @@ enum Api { // 获取往来单位银行信息下拉 GetClientBank = '/mainApi/ClientCommon/GetClientBank', // 根据用户列导出Excel文件流 (Auth) - ExportExcelByColumn = '/mainApi/Excel/ExportExcelByColumn', + ExportExcelByColumn = '/mainApi/Excel/ExportExcelStreamByColumn', } // 所有往来单位下拉数据 export function GetAllClientList(params) { @@ -543,6 +543,7 @@ export function ExportExcelByColumn(data: LoginParams) { url: Api.ExportExcelByColumn, method: 'post', data, + responseType: 'arraybuffer', }) } diff --git a/src/views/ContainerManagement/CustFeeDui/TenantAuditStepModal.vue b/src/views/ContainerManagement/CustFeeDui/TenantAuditStepModal.vue index 48488713..8f8b5ce4 100644 --- a/src/views/ContainerManagement/CustFeeDui/TenantAuditStepModal.vue +++ b/src/views/ContainerManagement/CustFeeDui/TenantAuditStepModal.vue @@ -23,10 +23,10 @@ 从账单删除 - +
{ console.log(res) + const xlsUrl = window.URL.createObjectURL( + new Blob([res], { + type: 'application/vnd.ms-excel;charset=utf-8', + }), + ) + const fname = getFieldsValue().billno + const link = document.createElement('a') + link.href = xlsUrl + link.setAttribute('download', fname) + document.body.appendChild(link) + link.click() }) } function FnClickDel() { diff --git a/src/views/ContainerManagement/SellCtn/TenantAuditStepModal.vue b/src/views/ContainerManagement/SellCtn/TenantAuditStepModal.vue index 83334b02..6aaf7872 100644 --- a/src/views/ContainerManagement/SellCtn/TenantAuditStepModal.vue +++ b/src/views/ContainerManagement/SellCtn/TenantAuditStepModal.vue @@ -788,7 +788,7 @@ data: 'ctnValue_SellPrice', type: 'numeric', format: '0', - readOnly: true, + readOnly: false, }, { title: '提箱港口', diff --git a/src/views/baseinfo/infoclient/ClientStakeholder/TenantAuditStepModal.vue b/src/views/baseinfo/infoclient/ClientStakeholder/TenantAuditStepModal.vue index 8b8ef1cf..cecbd1b6 100644 --- a/src/views/baseinfo/infoclient/ClientStakeholder/TenantAuditStepModal.vue +++ b/src/views/baseinfo/infoclient/ClientStakeholder/TenantAuditStepModal.vue @@ -42,7 +42,8 @@ import { BasicModal, useModalInner } from '/@/components/Modal' import { BasicForm, useForm } from '/@/components/Form/index' import { formSchema } from './columns' - import { ApiEdit, ApiGet } from './api' + import { ApiEdit, ApiBulkEdit, ApiGet } from './api' + import { GetUserList } from '/@/api/common' import { useMessage } from '/@/hooks/web/useMessage' // 声明Emits const emit = defineEmits(['success', 'register']) @@ -83,11 +84,24 @@ try { const values = await validate() setModalProps({ confirmLoading: true, loading: true }) - // TODO custom api - console.log(values) - // loading.value = true; - const res: API.DataResult = await ApiEdit(values) - console.log(res) + let res: any = null + if (values.id) { + res = await ApiEdit(values) + } else { + const Usedata = await GetUserList() + let ApiData: any = [] + console.log(values) + values.userId.forEach((item, index) => { + let userName = '' + Usedata.data.forEach((e) => { + if (e.value == item) { + userName = e.label + } + }) + ApiData[index] = { ...values, userId: item, userName } + }) + res = await ApiBulkEdit(ApiData) + } if (res.succeeded) { createMessage.success(res.message) emit('success') diff --git a/src/views/baseinfo/infoclient/ClientStakeholder/api.ts b/src/views/baseinfo/infoclient/ClientStakeholder/api.ts index dc5b9a29..68412429 100644 --- a/src/views/baseinfo/infoclient/ClientStakeholder/api.ts +++ b/src/views/baseinfo/infoclient/ClientStakeholder/api.ts @@ -6,6 +6,7 @@ enum Api { Audit = '/mainApi/ClientStakeholder/Audit', Get = '/mainApi/ClientStakeholder/Get', edit = '/mainApi/ClientStakeholder/Edit', + bulkEdit = '/mainApi/ClientStakeholder/BulkEdit', Del = '/mainApi/ClientStakeholder/Delete', } @@ -41,6 +42,15 @@ export function ApiEdit(data) { data, }) } +// 【批量】创建/更新客户干系人 (Auth) +export function ApiBulkEdit(data) { + return request({ + url: Api.bulkEdit, + method: 'post', + data, + }) +} + // 删除干系人 (Auth) export function ApiDel(data) { return request({ diff --git a/src/views/baseinfo/infoclient/ClientStakeholder/columns.tsx b/src/views/baseinfo/infoclient/ClientStakeholder/columns.tsx index 879ab8e4..deae06f2 100644 --- a/src/views/baseinfo/infoclient/ClientStakeholder/columns.tsx +++ b/src/views/baseinfo/infoclient/ClientStakeholder/columns.tsx @@ -80,7 +80,6 @@ export const formSchema: FormSchema[] = [ field: 'userId', component: 'ApiSelect', required: false, - defaultValue: null, dynamicDisabled: false, colProps: { span: 24 }, componentProps: ({ formModel }) => { @@ -89,6 +88,9 @@ export const formSchema: FormSchema[] = [ labelField: 'label', valueField: 'value', resultField: 'data', + allowClear: true, + mode: formModel.id ? '' : 'multiple', + class: formModel.id ? '' : 'NoLimitHeight', getPopupContainer: () => document.body, onChange: (e, obj) => { if (e && obj) { diff --git a/src/views/baseinfo/infoclient/EditColumns.tsx b/src/views/baseinfo/infoclient/EditColumns.tsx index 96863f01..8018baef 100644 --- a/src/views/baseinfo/infoclient/EditColumns.tsx +++ b/src/views/baseinfo/infoclient/EditColumns.tsx @@ -194,7 +194,7 @@ export const EditformSchema: FormSchema[] = [ field: 'registeredCapital', label: '注册资金', component: 'DEdit', - defaultValue: '', + defaultValue: 0, colProps: { span: 4 }, componentProps: (e) => { return { diff --git a/src/views/baseinfo/infoclient/TenantAuditStepModal.vue b/src/views/baseinfo/infoclient/TenantAuditStepModal.vue index 7ff7e8df..fa362f34 100644 --- a/src/views/baseinfo/infoclient/TenantAuditStepModal.vue +++ b/src/views/baseinfo/infoclient/TenantAuditStepModal.vue @@ -308,6 +308,7 @@ IsAvailable, Create, } from './api' + import { getUser } from '/@/api/system/user' import { ApiAudit } from '/@/views/baseinfo/infoclientAudit/api' import { ApiClientStakeholderAudit } from '/@/views/baseinfo/infoclient/ClientStakeholder/api' @@ -407,6 +408,8 @@ ChangeArrclientTag(false) }) function ChangeArrclientTag(type) { + console.log(type, 11111111111111) + // 委托单位 国外发货人 通知人 经营单位 国内发货人 国内同行 国外同行 国内直客,国外直客、指定货发货人 个人 约主 const ArrclientTagList = [ 'isController', @@ -427,7 +430,7 @@ field: 'ArrclientTag', component: 'ApiSelect', colProps: { span: 12 }, - defaultValue: ['isController'], + defaultValue: [], componentProps: () => { return { api: () => { @@ -495,7 +498,7 @@ field: 'ArrclientTag', component: 'ApiSelect', colProps: { span: 12 }, - defaultValue: ['isController'], + defaultValue: [], componentProps: ({ formModel }) => { return { api: () => { @@ -870,10 +873,60 @@ IsAvailableDisabled.value = true notification.success({ message: '校验成功', duration: 3 }) }) - .catch((err) => { + .catch(async (err) => { + const clientRes = await getCodeGoodsTypeInfo({ id: unref(rowId) }) + let clientTagData: any = '' + if (clientRes.data.clientTag) { + values.clientTag = {} + let ClientTag = await getDictOption('infoclient-ArrclientTag') + Object.keys(clientRes.data.clientTag).forEach((item, index) => { + ClientTag.forEach((e) => { + if (item == e.value && clientRes.data.clientTag[item]) { + clientTagData = clientTagData == '' ? e.name : `${clientTagData},${e.name}` + } + }) + }) + } + + let SaleData: any = '' + if (clientRes.data.saleId) { + const UserRes = await getUser({ id: clientRes.data.saleId }) + SaleData = h('div', { class: 'UserRes' }, [ + h( + 'span', + { style: { width: '50%', display: 'inline-block' } }, + `销售名称:${UserRes.data.userName ? UserRes.data.userName : '-'} `, + ), + h( + 'span', + { style: { width: '50%', display: 'inline-block' } }, + ` 英文名称:${UserRes.data.userEnName ? UserRes.data.userEnName : '-'}`, + ), + h( + 'span', + { style: { width: '50%', display: 'inline-block' } }, + `联系方式:${UserRes.data.officePhone ? UserRes.data.officePhone : '-'} `, + ), + h( + 'span', + { style: { width: '50%', display: 'inline-block' } }, + `QQ:${UserRes.data.QQ ? UserRes.data.QQ : '-'}`, + ), + h( + 'span', + { style: { width: '50%', display: 'inline-block' } }, + `邮箱:${UserRes.data.email ? UserRes.data.email : '-'}`, + ), + ]) + } + Modal.confirm({ title: '客户已存在', - content: '是否申请共享此客户?', + content: h('div', {}, [ + h('p', '是否申请共享此客户?'), + h('p', `客户属性:${clientTagData ? clientTagData : '-'}`), + SaleData, + ]), class: 'ds-modal-small', okText: '申请共享', cancelText: '取消', @@ -881,7 +934,6 @@ Create({ clientId: err.clientId }).then((res) => { notification.success({ message: '已发起申请!', duration: 3 }) }) - // notification.success({ message: '待开发', duration: 3 }) }, onCancel() {}, }) @@ -1047,6 +1099,12 @@ }