From c5fa4e64b85f7f4cbf29b005e694781c34ae88c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <14166000+zhangtonghai@user.noreply.gitee.com> Date: Fri, 31 May 2024 11:04:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=BD=E8=B4=A7=E4=BA=BA=E8=81=94=E5=8A=A8?= =?UTF-8?q?=20=E7=BD=91=E7=BB=9C=E9=85=8D=E7=BD=AE=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.ts | 2 +- src/views/operation/seaexport/columns.tsx | 159 +++++++++++------- .../operation/seaexport/detail/index.vue | 85 ++++++++++ src/views/system/user/columns.tsx | 20 ++- 4 files changed, 198 insertions(+), 68 deletions(-) diff --git a/src/utils/request.ts b/src/utils/request.ts index 0d193ebf..9fb45387 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -66,7 +66,7 @@ service.interceptors.request.use( service.interceptors.response.use( (response) => { const res = response.data - if (!res.succeeded) { + if (res.succeeded===false ) { $message.error(res.message || UNKNOWN_ERROR) } return response diff --git a/src/views/operation/seaexport/columns.tsx b/src/views/operation/seaexport/columns.tsx index f6a6074c..14895a50 100644 --- a/src/views/operation/seaexport/columns.tsx +++ b/src/views/operation/seaexport/columns.tsx @@ -148,7 +148,7 @@ const FnsaleId: any = await GetSaleList() if (FnsaleId.succeeded) { ListData.saleId = [] FnsaleId.data.forEach((e) => { - ListData.saleId.push({ ...e, label: `${e.userName}/${e.userCode}`, value: e.id }) + ListData.saleId.push({ ...e, label: e.userName, value: e.id }) }) } @@ -1128,7 +1128,7 @@ export const columns: BasicColumn[] = [ width: 150, }, { - title: '尺寸', + title: '尺码', dataIndex: 'cbm', width: 150, }, @@ -1744,26 +1744,6 @@ export const basicInfoFormSchema: FormSchema[] = [ }, }, }, - { - label: '所属分部', - field: 'saleOrgId', - component: 'Select', - required: false, - dynamicDisabled: false, - // defaultValue: '', - colProps: { span: 4 }, - componentProps: { - allowClear: true, - options: ListData.saleDeptId, - showSearch: true, - filterOption: (input: string, option: any) => { - return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 - }, - onChange: (e, obj) => { - console.log(e, obj) - }, - }, - }, { label: '委托单位Nmae', field: 'customerName', @@ -2142,36 +2122,91 @@ export const basicInfoFormSchema: FormSchema[] = [ } return RData }, - onChange: (e, obj) => { + onChange: async (e, obj) => { if (e && obj) { + console.log(e, obj, '揽货人!!!!!!!!!!') + let saleDeptIdArr: any = [] formModel.sale = obj.label formModel.saleOrgId = obj.defaultOrgId + formModel.saleDeptId = obj.deptId if (formActionType) { ListData.saleDeptId = [] obj.saleOrgList.forEach((item) => { ListData.saleDeptId.push({ label: item.orgName, value: item.orgId }) }) + if (obj.defaultOrgId) { + await GetDeptList({ orgId: obj.defaultOrgId }).then((res) => { + console.log(res, '所属分部 查询 所属部门') + res.data.forEach((item) => { + saleDeptIdArr.push({ label: item.orgName, value: item.id }) + }) + }) + } + const { updateSchema } = formActionType - updateSchema({ - label: '所属分部', - field: 'saleOrgId', - component: 'Select', - required: false, - dynamicDisabled: false, - // defaultValue: '', - colProps: { span: 4 }, - componentProps: { - allowClear: true, - options: ListData.saleDeptId, - showSearch: true, - filterOption: (input: string, option: any) => { - return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + updateSchema([ + { + label: '所属分部', + field: 'saleOrgId', + component: 'Select', + required: false, + dynamicDisabled: false, + // defaultValue: '', + colProps: { span: 4 }, + componentProps: { + allowClear: true, + options: ListData.saleDeptId, + showSearch: true, + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + onChange: (e, obj) => { + formModel.saleDeptId = '' + GetDeptList({ orgId: e }).then((res) => { + console.log(res, '所属分部 查询 所属部门') + let Arr: any = [] + res.data.forEach((item) => { + Arr.push({ label: item.orgName, value: item.id }) + }) + updateSchema({ + label: '所属部门', + field: 'saleDeptId', + component: 'Select', + required: false, + dynamicDisabled: false, + // defaultValue: '', + colProps: { span: 4 }, + componentProps: { + allowClear: true, + options: Arr, + showSearch: true, + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + }, + }) + }) + }, }, - onChange: (e, obj) => { - console.log(e, obj) + }, + { + label: '所属部门', + field: 'saleDeptId', + component: 'Select', + required: false, + dynamicDisabled: false, + // defaultValue: '', + colProps: { span: 4 }, + componentProps: { + allowClear: true, + options: saleDeptIdArr, + showSearch: true, + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, }, }, - }) + ]) } } else { formModel.sale = '' @@ -2180,6 +2215,26 @@ export const basicInfoFormSchema: FormSchema[] = [ } }, }, + { + label: '所属分部', + field: 'saleOrgId', + component: 'Select', + required: false, + colProps: { span: 4 }, + dynamicDisabled: ({ values }) => { + return !values.saleId + }, + }, + { + label: '所属部门', + field: 'saleDeptId', + component: 'Select', + required: false, + colProps: { span: 4 }, + dynamicDisabled: ({ values }) => { + return !values.saleOrgId + }, + }, { label: '客服员', field: 'customerService', @@ -2289,23 +2344,7 @@ export const basicInfoFormSchema: FormSchema[] = [ }, }, }, - { - label: '所属部门', - field: 'saleDeptId', - component: 'Select', - required: false, - dynamicDisabled: false, - // defaultValue: '', - colProps: { span: 4 }, - componentProps: { - allowClear: true, - options: ListData.saleDeptId, - showSearch: true, - filterOption: (input: string, option: any) => { - return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 - }, - }, - }, + // { // field: 'czRemark', // label: '操作备注', @@ -3339,7 +3378,7 @@ export const cargoInfoFormSchema2: FormSchema[] = [ }, }, { - label: '尺寸', + label: '尺码', field: 'cbm', component: 'InputNumber', required: false, @@ -3512,7 +3551,7 @@ export const cargoInfoFormSchema2: FormSchema[] = [ // colProps: { span: 12 }, // }, // { -// label: '尺寸', +// label: '尺码', // field: 'cbm', // component: 'InputNumber', // required: false, @@ -4338,7 +4377,7 @@ export const goodsTablecolumns: BasicColumn[] = [ width: 80, }, { - title: '尺寸', + title: '尺码', dataIndex: 'size', align: 'left', editRow: true, diff --git a/src/views/operation/seaexport/detail/index.vue b/src/views/operation/seaexport/detail/index.vue index d08f8695..90a125aa 100644 --- a/src/views/operation/seaexport/detail/index.vue +++ b/src/views/operation/seaexport/detail/index.vue @@ -222,6 +222,8 @@ CheckCtnCover, GetCtnListRefsh, GetClientSourceDetailSelectList, + GetSaleList, + GetDeptList, } from '../api/BookingLedger' import { getDictDropDown } from '/@/api/common' const appStore = useAppStore() @@ -638,6 +640,89 @@ }, }) } + if (res.data.saleId) { + const FnsaleId: any = await GetSaleList() + FnsaleId.data.forEach(async (item) => { + if (item.id == res.data.saleId) { + let saleDeptIdArr: any = [] + let saleOrgIdArr: any = [] + item.saleOrgList.forEach((item) => { + saleOrgIdArr.push({ label: item.orgName, value: item.orgId }) + }) + if (item.defaultOrgId) { + await GetDeptList({ orgId: item.defaultOrgId }).then((res) => { + console.log(res, '所属分部 查询 所属部门') + res.data.forEach((item) => { + saleDeptIdArr.push({ label: item.orgName, value: item.id }) + }) + }) + } + RefbasicInfo.value.updateSchema([ + { + label: '所属分部', + field: 'saleOrgId', + component: 'Select', + required: false, + dynamicDisabled: false, + // defaultValue: '', + colProps: { span: 4 }, + componentProps: { + allowClear: true, + options: saleOrgIdArr, + showSearch: true, + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + onChange: (e, obj) => { + // formModel.saleDeptId = '' + GetDeptList({ orgId: e }).then((res) => { + console.log(res, '所属分部 查询 所属部门') + let Arr: any = [] + res.data.forEach((item) => { + Arr.push({ label: item.orgName, value: item.id }) + }) + updateSchema({ + label: '所属部门', + field: 'saleDeptId', + component: 'Select', + required: false, + dynamicDisabled: false, + // defaultValue: '', + colProps: { span: 4 }, + componentProps: { + allowClear: true, + options: Arr, + showSearch: true, + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + }, + }) + }) + }, + }, + }, + { + label: '所属部门', + field: 'saleDeptId', + component: 'Select', + required: false, + dynamicDisabled: false, + // defaultValue: '', + colProps: { span: 4 }, + componentProps: { + allowClear: true, + options: saleDeptIdArr, + showSearch: true, + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + }, + }, + ]) + } + }) + } }) .catch(() => { appStore.settopDown(false) diff --git a/src/views/system/user/columns.tsx b/src/views/system/user/columns.tsx index 942b48a7..3a168f98 100644 --- a/src/views/system/user/columns.tsx +++ b/src/views/system/user/columns.tsx @@ -3,6 +3,7 @@ import { BasicColumn, FormSchema } from '/@/components/Table' import { getRoleList, getOrgList, getDeptList } from '/@/api/common' import { Tag } from 'ant-design-vue' import { style } from '@logicflow/extension/es/bpmn-elements/presets/icons' +import { t } from '/@/hooks/web/useI18n' const selectOrgList = ref([]) const selectDeptList = ref([]) let ListData: any = await {} @@ -212,6 +213,7 @@ export const formSchema: FormSchema[] = [ field: 'email', label: '邮箱', component: 'Input', + rules: [{ type: 'email', message: t('请填写正确的邮箱地址') }], colProps: { span: 12 }, }, { @@ -313,10 +315,12 @@ export const formSchema: FormSchema[] = [ } }) }) - formActionType.setFieldsValue({ - defaultOrgId: '', - deptId: '', - }) + if (formActionType) { + formActionType.setFieldsValue({ + defaultOrgId: '', + deptId: '', + }) + } }, } }, @@ -342,9 +346,11 @@ export const formSchema: FormSchema[] = [ selectDeptList.value.push({ label: e.orgName, value: e.id }) }) } - formActionType.setFieldsValue({ - deptId: '', - }) + if (formActionType) { + formActionType.setFieldsValue({ + deptId: '', + }) + } }, } },