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: '', + }) + } }, } },