diff --git a/src/views/ContainerManagement/TemplatImport/TenantAuditStepModal.vue b/src/views/ContainerManagement/TemplatImport/TenantAuditStepModal.vue index bc9f9e32..67aba9f7 100644 --- a/src/views/ContainerManagement/TemplatImport/TenantAuditStepModal.vue +++ b/src/views/ContainerManagement/TemplatImport/TenantAuditStepModal.vue @@ -166,6 +166,7 @@ async function handleSave(exit) { try { const values = await validate() + values.bodylist = list.value setModalProps({ confirmLoading: true, loading: true }) const res: any = await ApiEdit(values) if (res.succeeded) { @@ -308,7 +309,7 @@ deep: true, }, ) - + const isOnlineDict = ref([]) const columns = [ { data: 'selected', @@ -327,46 +328,56 @@ title: '箱号', width: 120, data: 'cntrno', + readOnly: false, }, { - title: '变动来源', - width: 200, - data: 'changeSource', - }, - { - title: '业务类型', + title: '箱型', width: 120, - data: 'ctnBizState', + data: 'ctnall', }, { title: '箱来源', width: 120, data: 'ctnSource', }, + // { + // title: '是否上线', + // width: 120, + // data: 'isOnline', + // readOnly: false, + // }, { - title: '状态变动', - width: 120, - data: 'ctnFlowState', - }, - { - title: '新旧箱', + title: '是否上线', width: 120, - data: 'usedState', + data: 'isOnline', + type: 'dropdown', + readOnly: false, + // 下拉框数据,可以同步或者异步返回(异步需要process返回) + source: async (query, process) => { + const res = isOnlineDict.value.length + ? isOnlineDict.value + : await getDictOption('CM_IsOnlineEnum') + if (!isOnlineDict.value.length) isOnlineDict.value = res + const dict = res.map((res) => { + return res.label + }) + process(dict) + }, }, { - title: '箱型', - width: 120, - data: 'ctnall', + title: '识别备注', + width: 200, + data: 'dealRemark', }, { - title: '箱状态', + title: '当前箱业务状态', width: 120, - data: 'ctnState', + data: 'ctnBizState', }, { - title: '空重箱', + title: '关联合同号', width: 120, - data: 'isHeavy', + data: 'ctnReleaseNo', }, { title: '当前港口', @@ -374,25 +385,63 @@ data: 'port', }, { - title: '是否上线', + title: '场站/码头', width: 120, - data: 'isOnline', + data: 'depot', }, { - title: '当前箱业务状态', + title: '船名航次', width: 120, - data: 'ctnBizState', + data: 'vesselVoyno', }, { - title: 'DEPOT/TEIMINAL', + title: '业务编号', width: 120, - data: 'depot', + data: 'mblno', }, { - title: 'DATE', + title: '备注', width: 120, - data: 'changeTime', + data: 'remark', }, + + // { + // title: '变动来源', + // width: 200, + // data: 'changeSource', + // }, + // { + // title: '业务类型', + // width: 120, + // data: 'ctnBizState', + // }, + + // { + // title: '状态变动', + // width: 120, + // data: 'ctnFlowState', + // }, + // { + // title: '新旧箱', + // width: 120, + // data: 'usedState', + // }, + + // { + // title: '箱状态', + // width: 120, + // data: 'ctnState', + // }, + // { + // title: '空重箱', + // width: 120, + // data: 'isHeavy', + // }, + // { + // title: 'DATE', + // width: 120, + // data: 'changeTime', + // }, ] const settings = { height: '260', @@ -433,6 +482,18 @@ list.value[changes[0][0]]['fieldName'] = dict?.name list.value[changes[0][0]]['fieldTitle'] = dict?.value } + if (changes[0][1] === 'isOnline') { + const res = isOnlineDict.value.length + ? isOnlineDict.value + : await getDictOption('CM_IsOnlineEnum') + if (!isOnlineDict.value.length) isOnlineDict.value = res + const item = res.filter((item) => { + return item.label === changes[0][3] + }) + if (item) dict = item[0] + list.value[changes[0][0]]['isOnline'] = dict?.label + list.value[changes[0][0]]['isOnlineId'] = dict?.value + } } }, } diff --git a/src/views/baseinfo/infoclient/ClientAccountDateModal.vue b/src/views/baseinfo/infoclient/ClientAccountDateModal.vue index 43aa6da5..945df593 100644 --- a/src/views/baseinfo/infoclient/ClientAccountDateModal.vue +++ b/src/views/baseinfo/infoclient/ClientAccountDateModal.vue @@ -121,7 +121,7 @@ setModalProps({ loading: false }) }) - const getTitle = computed(() => (!unref(isUpdate) ? '新增账期信息' : '编辑账期信息')) + const getTitle = computed(() => (!unref(isUpdate) ? '新增银行/发票信息' : '编辑银行/发票信息')) async function handleSave(exit) { try { diff --git a/src/views/baseinfo/infoclient/EditColumns.tsx b/src/views/baseinfo/infoclient/EditColumns.tsx index e8e1e16c..150197ce 100644 --- a/src/views/baseinfo/infoclient/EditColumns.tsx +++ b/src/views/baseinfo/infoclient/EditColumns.tsx @@ -53,6 +53,7 @@ export const EditformSchema: FormSchema[] = [ field: 'description', label: '客户全称', component: 'DEdit', + slot: '', defaultValue: '', colProps: { span: 4 }, componentProps: (e) => { @@ -69,6 +70,7 @@ export const EditformSchema: FormSchema[] = [ label: '客户简称', required: false, component: 'DEdit', + slot: '', defaultValue: '', colProps: { span: 4 }, componentProps: (e) => { diff --git a/src/views/baseinfo/infoclient/TenantAuditStepModal.vue b/src/views/baseinfo/infoclient/TenantAuditStepModal.vue index 785e01bc..dc05df80 100644 --- a/src/views/baseinfo/infoclient/TenantAuditStepModal.vue +++ b/src/views/baseinfo/infoclient/TenantAuditStepModal.vue @@ -138,8 +138,46 @@ - + + + + +

财务信息

@@ -243,6 +281,9 @@ cbDelete, ApiSubmitAudit, ApiWithdraw, + IsAvailable, + Create, + StakeholderSubmitAudit, } from './api' import { ApiAudit } from '/@/views/baseinfo/infoclientAudit/api' import { GetFormSetListByModule } from '/@/api/common' @@ -261,6 +302,7 @@ const ApproveBtns = defineAsyncComponent(() => import('/@/components/ApproveBtns/index.vue')) // import CustTemplateDetail from './custTemplateDetail/index.vue' import FeeCustTemplate from './FeeCustTemplate/index.vue' + import { Modal } from 'ant-design-vue' import { useModal } from '/@/components/Modal' import CustomerParams from './customerParams/index.vue' import ReleaseType from './ReleaseType/index.vue' @@ -392,6 +434,7 @@ setFieldsValue, clearValidate, validate, + validateFields, updateSchema, appendSchemaByField, }, @@ -552,6 +595,11 @@ async function getData(type) { const res = await getCodeGoodsTypeInfo({ id: unref(rowId) }) if (res.succeeded) { + if (res.data.id) { + IsAvailableDisabled.value = true + } else { + IsAvailableDisabled.value = false + } clientId.value = res.data.id saleId.value = res.data.saleId sourceId.value = res.data.sourceId @@ -624,15 +672,14 @@ const addNum = Math.round(Math.random() * 1000) go(`${route.path}?addNum=${addNum}`) } - // 提交 - async function handleSave() { + const IsAvailableDisabled = ref(false) + // 校验 + async function FnIsAvailable() { // try { - const values = await validate().catch(() => { - notification.warning({ message: '请补全基本信息中必填内容!', duration: 3 }) + const values = await validateFields(['description', 'shortName']).catch(() => { + notification.warning({ message: '请补全客户全称/客户简称!', duration: 3 }) }) if (values) { - // setModalProps({ confirmLoading: true, loading: true }) - // TODO custom api values.clientTag = {} let ClientTag = await getDictOption('infoclient-ArrclientTag') ClientTag.forEach((item) => { @@ -662,34 +709,90 @@ values.isCustomer = false values.isSupplier = true } - // loading.value = true; - const res = await editCodeGoodsType({ + IsAvailable({ ...values, ...getFieldsValue1(), }) - if (res.succeeded) { - if (!rowId.value) { - rowId.value = res.data - clientId.value = res.data - // isUpdate.value = true - // await setFieldsValue({ - // // ...getFieldsValue(), - // id: res.data, - // }) + .then((res) => { + IsAvailableDisabled.value = true + notification.success({ message: '校验成功', duration: 3 }) + }) + .catch((err) => { + Modal.confirm({ + title: '客户已存在', + content: '是否共享客户', + class: 'ds-modal-small', + okText: '申请共享', + cancelText: '取消', + onOk() { + Create().then((res) => { + console.log(res, 1111111111111111111) + StakeholderSubmitAudit().then((res2) => { + console.log(res2, 222222222222) + }) + }) + // notification.success({ message: '待开发', duration: 3 }) + }, + onCancel() {}, + }) + }) + } + } + // 提交 + async function handleSave() { + if (IsAvailableDisabled.value) { + const values = await validate().catch(() => { + notification.warning({ message: '请补全基本信息中必填内容!', duration: 3 }) + }) + if (values) { + values.clientTag = {} + let ClientTag = await getDictOption('infoclient-ArrclientTag') + ClientTag.forEach((item) => { + let type = false + if (values.ArrclientTag) { + values.ArrclientTag.forEach((item2) => { + if (item2 == item.value) { + type = true + } + }) + } + values.clientTag[item.value] = type + }) + + values.clientTag = { ...values.clientTag, ...clientTag_o.value } + + values.clientTag.others = values.others + + values.grade = grade.value + if (CustomerOrSupplier.value == 'isCustomerAndisSupplier') { + values.isCustomer = true + values.isSupplier = true + } else if (CustomerOrSupplier.value == 'isCustomer') { + values.isCustomer = true + values.isSupplier = false + } else if (CustomerOrSupplier.value == 'isSupplier') { + values.isCustomer = false + values.isSupplier = true + } + const res = await editCodeGoodsType({ + ...values, + ...getFieldsValue1(), + }) + if (res.succeeded) { + if (!rowId.value) { + rowId.value = res.data + clientId.value = res.data + } + getData(true) + notification.success({ message: res.message, duration: 3 }) + emit('success') + } else { + notification.error({ message: res.message, duration: 3 }) } - getData(true) - notification.success({ message: res.message, duration: 3 }) - emit('success') - } else { - notification.error({ message: res.message, duration: 3 }) } - - // exit && closeModal() + } else { + notification.warning({ message: '请完成客户校验', duration: 3 }) } - // } finally { - // // loading.value = false; - // // setModalProps({ confirmLoading: false, loading: false }) - // } } const RefActionBar = ref() // 上一票/下一票 diff --git a/src/views/baseinfo/infoclient/api.ts b/src/views/baseinfo/infoclient/api.ts index 1bf9e2f6..7e9c1c94 100644 --- a/src/views/baseinfo/infoclient/api.ts +++ b/src/views/baseinfo/infoclient/api.ts @@ -7,29 +7,22 @@ enum Api { GetCodeGoodsTypeInfo = '/mainApi/ClientInfo/GetClientInfo', Delete = '/mainApi/ClientInfo/Delete', DeleteInvoiceHeader = '/mainApi/ClientInfo/DeleteInvoiceHeader', - - - GetClientFrtSelectList = '/mainApi/Common/GetClientFrtSelectList', GetClientSourceSelectList = '/mainApi/Common/GetClientSourceSelectList', GetClientCountrySelectList = '/mainApi/Common/GetClientCountrySelectList', GetClientStlModeSelectList = '/mainApi/Common/GetClientStlModeSelectList', - GetClientBankList = '/mainApi/ClientBank/GetClientBankList', EditClientBank = '/mainApi/ClientBank/EditClientBank', GetClientBankInfo = '/mainApi/ClientBank/GetClientBankInfo', CBDelete = '/mainApi/ClientBank/Delete', - GetNotifications = '/mainApi/ClientInfo/GetNotifications', - SubmitAudit = '/mainApi/ClientInfo/SubmitAudit', Withdraw = '/mainApi/ClientInfo/Withdraw', - - GetUsage = '/mainApi/ClientInfo/GetUsage', - - - + IsAvailable = '/mainApi/ClientInfo/IsAvailable', + + StakeholderCreate = '/mainApi/ClientStakeholder/Create', + StakeholderSubmitAudit = '/mainApi/ClientStakeholder/SubmitAudit', } // 确定往来单位是否已使用 (Auth) @@ -130,7 +123,6 @@ export function getClientStlModeSelectList(query) { }) } - // 客户银行信息 列表 (Auth) export function getClientBankList(parameter) { return request({ @@ -170,4 +162,29 @@ export function getNotifications() { url: Api.GetNotifications, method: 'get', }) -} \ No newline at end of file +} +// 检查客户信息是否重复 (Auth) +export function IsAvailable(data) { + return request({ + url: Api.IsAvailable, + method: 'post', + data, + }) +} + +// 新增客户干系人 (Auth) +export function Create() { + return request({ + url: Api.StakeholderCreate, + method: 'post', + params: { clientId: 0 }, + }) +} +// 提交审核 (Auth) +export function StakeholderSubmitAudit() { + return request({ + url: Api.StakeholderSubmitAudit, + method: 'post', + params: { clientId: 0 }, + }) +} diff --git a/src/views/baseinfo/infoclient/columns.tsx b/src/views/baseinfo/infoclient/columns.tsx index ce62b375..34c9a4eb 100644 --- a/src/views/baseinfo/infoclient/columns.tsx +++ b/src/views/baseinfo/infoclient/columns.tsx @@ -555,15 +555,17 @@ export const formSchema: FormSchema[] = [ { field: 'description', label: '客户全称', - required: true, component: 'Input', + slot: 'description', + required: true, colProps: { span: 4 }, }, { field: 'shortName', label: '客户简称', - required: true, component: 'Input', + slot: 'shortName', + required: true, colProps: { span: 4 }, }, { diff --git a/src/views/baseinfo/infoclient/tabs3/api.ts b/src/views/baseinfo/infoclient/tabs3/api.ts index 8765952e..9d2bf029 100644 --- a/src/views/baseinfo/infoclient/tabs3/api.ts +++ b/src/views/baseinfo/infoclient/tabs3/api.ts @@ -6,6 +6,8 @@ enum Api { edit = '/mainApi/ClientAccountDate/EditClientAccountDate', info = '/mainApi/ClientAccountDate/GetClientAccountDateInfo', del = '/mainApi/ClientAccountDate/Delete', + + GetTenantBanks = '/mainApi/ClientAccountDate/GetTenantBanks', } // 列表 (Auth) export function ApiList(data: PageRequest) { @@ -38,4 +40,12 @@ export function Delete(data) { method: 'post', data, }) -} \ No newline at end of file +} +// 获取组织机构银行账户列表 (Auth) +export function GetTenantBanks(data: PageRequest) { + return request({ + url: Api.GetTenantBanks, + method: 'post', + params: data, + }) +} diff --git a/src/views/baseinfo/infoclient/tabs3/columns.tsx b/src/views/baseinfo/infoclient/tabs3/columns.tsx index a78e402a..247dd7ff 100644 --- a/src/views/baseinfo/infoclient/tabs3/columns.tsx +++ b/src/views/baseinfo/infoclient/tabs3/columns.tsx @@ -1,6 +1,7 @@ import { BasicColumn, FormSchema } from '/@/components/Table' import { Tag } from 'ant-design-vue' import { getClientSourceSelectList } from '../api' +import { GetTenantBanks } from './api' import { getSaleUserList } from '/@/api/common' import { getDictOption } from '/@/utils/dictUtil' let ClientSourceList = [] @@ -413,6 +414,49 @@ export const formSchema: FormSchema[] = [ max: 31, }, }, + { + field: 'rmbAccountId', + label: '人民币账户', + component: 'ApiSelect', + colProps: { span: 8 }, + defaultValue: '', + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + GetTenantBanks({ currency: 'CNY' }).then((res) => { + resolve(res) + }) + }) + }, + labelField: 'bankName', + valueField: 'id', + resultField: 'data', + } + }, + }, + { + field: 'usdAccountId', + label: '美金账户', + component: 'ApiSelect', + colProps: { span: 8 }, + defaultValue: '', + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + GetTenantBanks({ currency: 'USD' }).then((res) => { + resolve(res) + }) + }) + }, + labelField: 'accountName', + valueField: 'id', + showName: 'accountName', + resultField: 'data', + } + }, + }, { field: 'allowAmount', label: '信用额度',