diff --git a/src/views/baseinfo/ClientStakeholder/api.ts b/src/views/baseinfo/ClientStakeholder/api.ts new file mode 100644 index 00000000..e83bd6bd --- /dev/null +++ b/src/views/baseinfo/ClientStakeholder/api.ts @@ -0,0 +1,24 @@ +// @ts-ignore +import { request } from '/@/utils/request' +import { DataResult, PageRequest } from '/@/api/model/baseModel' +enum Api { + list = '/mainApi/ClientStakeholder/GetList', + Audit = '/mainApi/ClientStakeholder/Audit', +} + +// 列表 (Auth) +export function ApiList(data: PageRequest) { + return request({ + url: Api.list, + method: 'post', + data, + }) +} +// 执行审核 (Auth) +export function ApiAudit(data: PageRequest) { + return request({ + url: Api.Audit, + method: 'post', + data, + }) +} diff --git a/src/views/baseinfo/ClientStakeholder/columns.tsx b/src/views/baseinfo/ClientStakeholder/columns.tsx new file mode 100644 index 00000000..fb80c8d9 --- /dev/null +++ b/src/views/baseinfo/ClientStakeholder/columns.tsx @@ -0,0 +1,113 @@ +import { BasicColumn, FormSchema } from '/@/components/Table' +import { + getClientFrtSelectList, + getClientSourceSelectList, + getClientCountrySelectList, +} from '/@/views/baseinfo/infoclient/api' + +import { + getOperatorUserList, + getVouchingClerkList, + getSaleUserList, + getCustomerServiceList, + getDeptList, +} from '/@/api/common' +let DeptList: any = [] +const res10: API.DataResult = await getDeptList() +if (res10.succeeded) { + DeptList = [] + res10.data.forEach((e) => { + DeptList.push({ label: e.orgName, value: e.id }) + }) +} +let ClientCountryList: any = [] +const res4: API.DataResult = await getClientCountrySelectList() +if (res4.succeeded) { + ClientCountryList = [] + res4.data.forEach((e) => { + ClientCountryList.push({ label: e.countryName, value: e.id }) + }) +} +let ClientSourceList: any = [] +const res3: API.DataResult = await getClientSourceSelectList() +if (res3.succeeded) { + ClientSourceList = [] + res3.data.forEach((e) => { + ClientSourceList.push({ label: e.sourceName, value: e.id }) + }) +} +let SaleUserList: any = [] +const res8: API.DataResult = await getSaleUserList() +if (res8.succeeded) { + SaleUserList = [] + res8.data.forEach((e) => { + SaleUserList.push({ label: e.userName, value: e.id }) + }) +} +let OperatorUserList: any = [] +const res6: API.DataResult = await getOperatorUserList() +if (res6.succeeded) { + OperatorUserList = [] + res6.data.forEach((e) => { + OperatorUserList.push({ label: e.userName, value: e.id }) + }) +} +let VouchingClerkList: any = [] +const res7: API.DataResult = await getVouchingClerkList() +if (res7.succeeded) { + VouchingClerkList = [] + res7.data.forEach((e) => { + VouchingClerkList.push({ label: e.userName, value: e.id }) + }) +} +let CustomerServiceList: any = [] +const res9: API.DataResult = await getCustomerServiceList() +if (res9.succeeded) { + CustomerServiceList = [] + res9.data.forEach((e) => { + CustomerServiceList.push({ label: e.userName, value: e.id }) + }) +} +let ClientFrtList: any = [] +const res: API.DataResult = await getClientFrtSelectList() +if (res.succeeded) { + ClientFrtList = [] + res.data.forEach((e) => { + ClientFrtList.push({ label: e.cnName, value: e.id }) + }) +} +export const columns: BasicColumn[] = [ + { + title: '干系人姓名', + dataIndex: 'createByName', + sorter: true, + width: 150, + }, + { + title: '生效日期', + dataIndex: 'startDate', + sorter: true, + width: 150, + }, + { + title: '失效日期', + dataIndex: 'endDate', + sorter: true, + width: 150, + }, + { + title: '备注', + dataIndex: 'remark', + sorter: true, + width: 150, + }, +] + +export const searchFormSchema: FormSchema[] = [ + { + field: 'createByName', + label: '干系人姓名', + component: 'Input', + colProps: { span: 4 }, + }, +] diff --git a/src/views/baseinfo/ClientStakeholder/index.vue b/src/views/baseinfo/ClientStakeholder/index.vue new file mode 100644 index 00000000..7f60a810 --- /dev/null +++ b/src/views/baseinfo/ClientStakeholder/index.vue @@ -0,0 +1,106 @@ + + diff --git a/src/views/baseinfo/infoclient/ClientStakeholder/TenantAuditStepModal.vue b/src/views/baseinfo/infoclient/ClientStakeholder/TenantAuditStepModal.vue new file mode 100644 index 00000000..2c05ca94 --- /dev/null +++ b/src/views/baseinfo/infoclient/ClientStakeholder/TenantAuditStepModal.vue @@ -0,0 +1,123 @@ + + diff --git a/src/views/baseinfo/infoclient/ClientStakeholder/api.ts b/src/views/baseinfo/infoclient/ClientStakeholder/api.ts new file mode 100644 index 00000000..c2904cd6 --- /dev/null +++ b/src/views/baseinfo/infoclient/ClientStakeholder/api.ts @@ -0,0 +1,51 @@ +// @ts-ignore +import { request } from '/@/utils/request' +import { DataResult, PageRequest } from '/@/api/model/baseModel' +enum Api { + list = '/mainApi/ClientStakeholder/GetList', + Audit = '/mainApi/ClientStakeholder/Audit', + Get = '/mainApi/ClientStakeholder/Get', + edit = '/mainApi/ClientStakeholder/Edit', + info = '/mainApi/ClientStakeholder/Info', +} + +// 列表 (Auth) +export function ApiList(data: PageRequest) { + return request({ + url: Api.list, + method: 'post', + data, + }) +} +// 执行审核 (Auth) +export function ApiClientStakeholderAudit(data: PageRequest) { + return request({ + url: Api.Audit, + method: 'post', + data, + }) +} +// 获取客户干系人 (Auth) +export function ApiGet(query) { + return request({ + url: Api.Get, + method: 'get', + params: query, + }) +} +// 获取客户干系人 (Auth) +export function ApiEdit(query) { + return request({ + url: Api.edit, + method: 'get', + params: query, + }) +} +// 详情 (Auth) +export function ApiInfo(query) { + return request({ + url: Api.info, + method: 'get', + params: query, + }) +} diff --git a/src/views/baseinfo/infoclient/ClientStakeholder/columns.tsx b/src/views/baseinfo/infoclient/ClientStakeholder/columns.tsx new file mode 100644 index 00000000..defd34ee --- /dev/null +++ b/src/views/baseinfo/infoclient/ClientStakeholder/columns.tsx @@ -0,0 +1,84 @@ +import { BasicColumn, FormSchema } from '/@/components/Table' + +export const columns: BasicColumn[] = [ + { + title: '干系人姓名', + dataIndex: 'createByName', + sorter: true, + width: 150, + }, + { + title: '生效日期', + dataIndex: 'startDate', + sorter: true, + width: 150, + }, + { + title: '失效日期', + dataIndex: 'endDate', + sorter: true, + width: 150, + }, + { + title: '备注', + dataIndex: 'remark', + sorter: true, + width: 150, + }, +] + +export const searchFormSchema: FormSchema[] = [ + { + field: 'createByName', + label: '干系人姓名', + component: 'Input', + colProps: { span: 4 }, + }, +] + +export const formSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + defaultValue: '', + show: false, + }, + { + field: 'carrierId', + label: '', + component: 'Input', + show: false, + }, + { + field: 'startDate', + label: '生效日期', + component: 'DatePicker', + required: true, + colProps: { span: 20 }, + defaultValue: '', + componentProps: { + style: 'width:100%', + }, + }, + { + field: 'endDate', + label: '失效日期', + component: 'DatePicker', + required: true, + colProps: { span: 20 }, + defaultValue: '', + componentProps: { + style: 'width:100%', + }, + }, + { + field: 'note', + label: '备注', + component: 'InputTextArea', + colProps: { span: 24 }, + componentProps: { + rows: 2, + }, + }, +] diff --git a/src/views/baseinfo/infoclient/ClientStakeholder/index.vue b/src/views/baseinfo/infoclient/ClientStakeholder/index.vue new file mode 100644 index 00000000..fdfa400a --- /dev/null +++ b/src/views/baseinfo/infoclient/ClientStakeholder/index.vue @@ -0,0 +1,162 @@ + + diff --git a/src/views/baseinfo/infoclient/TenantAuditStepModal.vue b/src/views/baseinfo/infoclient/TenantAuditStepModal.vue index dc05df80..328c65fc 100644 --- a/src/views/baseinfo/infoclient/TenantAuditStepModal.vue +++ b/src/views/baseinfo/infoclient/TenantAuditStepModal.vue @@ -94,6 +94,7 @@ :class="CustomerOrSupplier" :bordered="false" v-model:value="CustomerOrSupplier" + @change="ChangeCustomerOrSupplier" > @@ -249,6 +250,9 @@ + + + @@ -261,6 +265,18 @@ :id="rowId" businessType="1" status="INFO_CLIENT_AUDIT" + v-if="route.query.status == 'INFO_CLIENT_AUDIT'" + > + + @@ -283,9 +299,10 @@ ApiWithdraw, IsAvailable, Create, - StakeholderSubmitAudit, } from './api' import { ApiAudit } from '/@/views/baseinfo/infoclientAudit/api' + import { ApiClientStakeholderAudit } from '/@/views/baseinfo/infoclient/ClientStakeholder/api' + import { GetFormSetListByModule } from '/@/api/common' import { ApiList } from './menu2/api' // 引入表格权限信息(包含id和name) @@ -298,6 +315,8 @@ import Tabs3 from './tabs3/index.vue' import Menus2 from './menu2/index.vue' import Menus3 from './menu3/index.vue' + import ClientStakeholder from './ClientStakeholder/index.vue' + // 审批组件 const ApproveBtns = defineAsyncComponent(() => import('/@/components/ApproveBtns/index.vue')) // import CustTemplateDetail from './custTemplateDetail/index.vue' @@ -354,7 +373,7 @@ if (route.query && route.query.id) { rowId.value = route.query.id activeKey.value = '2' - getData(true) + await getData(true) } else { clientId.value = '' clientTag_o.value = { @@ -377,7 +396,120 @@ CustomerOrSupplier.value = 'isSupplier' } } + ChangeArrclientTag() }) + function ChangeArrclientTag() { + // 委托单位 国外发货人 通知人 经营单位 国内发货人 国内同行 国外同行 国内直客,国外直客、指定货发货人 个人 约主 + const ArrclientTagList = [ + 'isController', + 'isShipper', + 'isNotifyParty', + 'isEnterprise', + 'isShipperCn', + 'isDomesticPeers', + 'isForeignCounterparts', + 'isDirectCustomerCn', + 'isDirectCustomer', + 'isShipperZDH', + 'isPersonal', + 'isContract', + ] + if (CustomerOrSupplier.value == 'isCustomer') { + console.log('客户') + updateSchema({ + label: '客户属性', + field: 'ArrclientTag', + component: 'ApiSelect', + colProps: { span: 12 }, + defaultValue: 'isController', + componentProps: () => { + return { + api: () => { + return new Promise((resolve) => { + let RData: any = [] + getDictOption('infoclient-ArrclientTag').then((res) => { + res.forEach((item) => { + if (ArrclientTagList.includes(item.value)) { + RData.push(item) + } + }) + resolve(RData) + }) + }) + }, + labelField: 'label', + valueField: 'value', + resultField: 'data', + allowClear: true, + mode: 'multiple', + class: 'NoLimitHeight', + } + }, + }) + } else if (CustomerOrSupplier.value == 'isSupplier') { + console.log('供应商') + updateSchema({ + label: '客户属性', + field: 'ArrclientTag', + component: 'ApiSelect', + colProps: { span: 12 }, + defaultValue: null, + componentProps: () => { + return { + api: () => { + return new Promise((resolve) => { + let RData: any = [] + getDictOption('infoclient-ArrclientTag').then((res) => { + res.forEach((item) => { + if (!ArrclientTagList.includes(item.value)) { + RData.push(item) + } + }) + resolve(RData) + }) + }) + }, + labelField: 'label', + valueField: 'value', + resultField: 'data', + allowClear: true, + mode: 'multiple', + class: 'NoLimitHeight', + } + }, + }) + } else if (CustomerOrSupplier.value == 'isCustomerAndisSupplier') { + console.log('供应商及客户') + updateSchema({ + label: '客户属性', + field: 'ArrclientTag', + component: 'ApiSelect', + colProps: { span: 12 }, + defaultValue: 'isController', + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + getDictOption('infoclient-ArrclientTag').then((res) => { + resolve(res) + }) + }) + }, + labelField: 'label', + valueField: 'value', + resultField: 'data', + allowClear: true, + mode: 'multiple', + class: 'NoLimitHeight', + } + }, + }) + } + } + function ChangeCustomerOrSupplier() { + setFieldsValue({ ArrclientTag: [] }) + ChangeArrclientTag() + } watch(activeKey, (nval, oval) => { if (Number(nval) > 2 && !rowId.value) { activeKey.value = oval @@ -720,16 +852,13 @@ .catch((err) => { Modal.confirm({ title: '客户已存在', - content: '是否共享客户', + content: '是否申请共享此客户?', class: 'ds-modal-small', okText: '申请共享', cancelText: '取消', onOk() { - Create().then((res) => { - console.log(res, 1111111111111111111) - StakeholderSubmitAudit().then((res2) => { - console.log(res2, 222222222222) - }) + Create({ clientId: err.clientId }).then((res) => { + notification.success({ message: '已发起申请!', duration: 3 }) }) // notification.success({ message: '待开发', duration: 3 }) }, @@ -871,28 +1000,29 @@ loading.value = true ApiAudit(postData) .then((res) => { - // loading.value = false createMessage.success(res.message) - // 最后一个审批完,弹出选择是否现舱 - // if (res.data.isCompleted && res.data.flowStatus == 3) { - // // 通过此单现舱控制选择舱位 - // if (bookingDetails.value.shippingSpaceType == 'xc') { - // // 选择现舱 - // sspace.value.init() - // } else { - // AutomaticBooking(id.value) - // const { fullPath } = route //获取当前路径 - // tabStore.closeTabByKey(fullPath, router) - // } - // } else { - // // 关闭当前页面 const { fullPath } = route //获取当前路径 tabStore.closeTabByKey(fullPath, router) - // } }) - .catch(() => { - // loading.value = false + .catch(() => {}) + } + // 干系人 审核 + const ApproveClientStakeholder = (remark) => { + const postData: any = { + result: remark ? 2 : 1, + ids: [route.query.taskId], + // businessType: '1', + // taskTypeName: route.query.status, + } + if (remark) postData['remark'] = remark + loading.value = true + ApiClientStakeholderAudit(postData) + .then((res) => { + createMessage.success(res.message) + const { fullPath } = route //获取当前路径 + tabStore.closeTabByKey(fullPath, router) }) + .catch(() => {}) }