Merge branch 'dev' of http://59.110.10.99:53000/liuc/fe_supplier_frontend into dev
This commit is contained in:
56
src/components/AccessDepartmentSelect/index.tsx
Normal file
56
src/components/AccessDepartmentSelect/index.tsx
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { Select } from 'antd';
|
||||||
|
import { queryUserOrgAll } from './services'
|
||||||
|
|
||||||
|
export interface AccessDepartmentSelectProps {
|
||||||
|
value?: string | number;
|
||||||
|
onChange?: (value: string | number) => void;
|
||||||
|
options?: { label: string; value: string | number }[];
|
||||||
|
placeholder?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Dict {
|
||||||
|
orgName: string;
|
||||||
|
orgId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const AccessDepartmentSelect: React.FC<AccessDepartmentSelectProps> = ({
|
||||||
|
value,
|
||||||
|
onChange,
|
||||||
|
placeholder = '请选择准入部门',
|
||||||
|
disabled = false,
|
||||||
|
}) => {
|
||||||
|
|
||||||
|
//部门
|
||||||
|
const [userOrgAll, setUserOrgAll] = useState<Dict[]>();
|
||||||
|
useEffect(() => {
|
||||||
|
queryUserOrgAll().then((res) => {
|
||||||
|
const { code, data } = res;
|
||||||
|
if (code == 200) {
|
||||||
|
setUserOrgAll(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Select
|
||||||
|
value={value}
|
||||||
|
onChange={onChange}
|
||||||
|
placeholder={placeholder}
|
||||||
|
disabled={disabled}
|
||||||
|
allowClear
|
||||||
|
style={{ width: '100%' }}
|
||||||
|
showSearch
|
||||||
|
optionFilterProp="label"
|
||||||
|
>
|
||||||
|
{userOrgAll?.map(item => (
|
||||||
|
<Select.Option key={item.orgId} value={item.orgId}>{item.orgName}</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AccessDepartmentSelect;
|
30
src/components/AccessDepartmentSelect/services.ts
Normal file
30
src/components/AccessDepartmentSelect/services.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门
|
||||||
|
*/
|
||||||
|
export const queryUserOrgAll = () => request.get(`/org/queryUserOrgAll`);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -84,7 +84,7 @@ const InvoiceTab: React.FC<InvoiceTabProps> = (props) => {
|
|||||||
|
|
||||||
const columns: ColumnsType<InvoiceInfo> = [
|
const columns: ColumnsType<InvoiceInfo> = [
|
||||||
{ title: 'page.workbench.invoice.index', dataIndex: 'index', width: 80, key: 'index', render: (_: any, __: any, index: number) => index + 1 },
|
{ title: 'page.workbench.invoice.index', dataIndex: 'index', width: 80, key: 'index', render: (_: any, __: any, index: number) => index + 1 },
|
||||||
{ title: 'page.workbench.invoice.taxpayerType', dataIndex: 'taxpayerType', ellipsis: true },
|
{ title: 'page.workbench.invoice.taxpayerType', dataIndex: 'taxpayerTypeCn', ellipsis: true },
|
||||||
{ title: 'page.workbench.invoice.taxpayerCode', dataIndex: 'taxpayerCode', ellipsis: true },
|
{ title: 'page.workbench.invoice.taxpayerCode', dataIndex: 'taxpayerCode', ellipsis: true },
|
||||||
{ title: 'page.workbench.invoice.head', dataIndex: 'head', ellipsis: true },
|
{ title: 'page.workbench.invoice.head', dataIndex: 'head', ellipsis: true },
|
||||||
{ title: 'page.workbench.invoice.address', dataIndex: 'address', ellipsis: true },
|
{ title: 'page.workbench.invoice.address', dataIndex: 'address', ellipsis: true },
|
||||||
|
@ -4,29 +4,41 @@ import LogoImg from '@/assets/img/logo.png';
|
|||||||
//导入菜单组件
|
//导入菜单组件
|
||||||
import Language from './Language';
|
import Language from './Language';
|
||||||
import User from './User';
|
import User from './User';
|
||||||
|
import { history } from 'umi';
|
||||||
import './layout.less';
|
import './layout.less';
|
||||||
|
import { Logout } from '@/servers/api/login';
|
||||||
|
|
||||||
|
|
||||||
const HeaderComponent: React.FC = () => {
|
const HeaderComponent: React.FC = () => {
|
||||||
// 用 state 保存 userId
|
// 用 state 保存 userId
|
||||||
const [userId, setUserId] = useState(() => sessionStorage.getItem('userId'));
|
const [userId, setUserId] = useState(() => sessionStorage.getItem('userId'));
|
||||||
|
|
||||||
useEffect(() => {
|
const handLogout = () => {
|
||||||
// 定义一个方法用于手动刷新 userId
|
Logout()
|
||||||
const refreshUserId = () => setUserId(sessionStorage.getItem('userId'));
|
sessionStorage.clear();
|
||||||
// 登录后你可以手动调用 refreshUserId
|
history.replace('/login');
|
||||||
// 或者监听页面 storage 事件(多窗口/多tab同步)
|
}
|
||||||
window.addEventListener('storage', refreshUserId);
|
|
||||||
// 页面内操作,比如登录成功后,也可以在登录回调里调用 setUserId
|
useEffect(() => {
|
||||||
return () => window.removeEventListener('storage', refreshUserId);
|
// 定义一个方法用于手动刷新 userId
|
||||||
}, []);
|
const refreshUserId = () => setUserId(sessionStorage.getItem('userId'));
|
||||||
|
// 登录后你可以手动调用 refreshUserId
|
||||||
|
// 或者监听页面 storage 事件(多窗口/多tab同步)
|
||||||
|
window.addEventListener('storage', refreshUserId);
|
||||||
|
// 页面内操作,比如登录成功后,也可以在登录回调里调用 setUserId
|
||||||
|
return () => window.removeEventListener('storage', refreshUserId);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="headerComponent">
|
<div className="headerComponent">
|
||||||
<img className="logo" src={LogoImg} alt="logo" />
|
<img className="logo" src={LogoImg} alt="logo" />
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<Language />
|
<Language />
|
||||||
<User />
|
{!userId ? (
|
||||||
|
<User />
|
||||||
|
) : (
|
||||||
|
<div style={{cursor: 'pointer'}} onClick={handLogout}>退出</div>
|
||||||
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|||||||
import { Modal, Form, Select, Button, Tree, message, Input } from 'antd';
|
import { Modal, Form, Select, Button, Tree, message, Input } from 'antd';
|
||||||
//组件
|
//组件
|
||||||
import SupplierSelector from './SupplierSelector';
|
import SupplierSelector from './SupplierSelector';
|
||||||
|
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||||
// 请求
|
// 请求
|
||||||
import { categoryTree, add } from '../services';
|
import { categoryTree, add } from '../services';
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
@ -143,10 +144,7 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
|
|||||||
name="deptId"
|
name="deptId"
|
||||||
rules={[{ required: true, message: '请选择准入部门' }]}
|
rules={[{ required: true, message: '请选择准入部门' }]}
|
||||||
>
|
>
|
||||||
<Select placeholder="请选择部门">
|
<AccessDepartmentSelect />
|
||||||
<Option value="DEPT001">部门A</Option>
|
|
||||||
<Option value="DEPT001">部门B</Option>
|
|
||||||
</Select>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import type { ColumnsType } from 'antd/es/table';
|
|||||||
import { getApprovePage } from './services';
|
import { getApprovePage } from './services';
|
||||||
import { getDictList } from '@/servers/api/dicts'
|
import { getDictList } from '@/servers/api/dicts'
|
||||||
//组件
|
//组件
|
||||||
|
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||||
import ViewModal from './components/ViewModal';
|
import ViewModal from './components/ViewModal';
|
||||||
//统一列表分页
|
//统一列表分页
|
||||||
import tableProps from '@/utils/tableProps'
|
import tableProps from '@/utils/tableProps'
|
||||||
@ -218,7 +219,7 @@ const SupplierEntryReview: React.FC = () => {
|
|||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="deptId" label="准入部门">
|
<Form.Item name="deptId" label="准入部门">
|
||||||
<Select options={deptOptions} allowClear style={{ width: 120 }} placeholder="请选择准入部门" />
|
<AccessDepartmentSelect />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item name="approveStatus" label="审批状态">
|
<Form.Item name="approveStatus" label="审批状态">
|
||||||
|
@ -9,6 +9,8 @@ import DivisionModal from './DivisionModal';
|
|||||||
// 请求
|
// 请求
|
||||||
import { categoryTree, add, uploadFile } from '../services';
|
import { categoryTree, add, uploadFile } from '../services';
|
||||||
|
|
||||||
|
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
//selected 类型
|
//selected 类型
|
||||||
@ -276,10 +278,7 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
|
|||||||
name="deptId"
|
name="deptId"
|
||||||
rules={[{ required: true, message: '请选择准入部门' }]}
|
rules={[{ required: true, message: '请选择准入部门' }]}
|
||||||
>
|
>
|
||||||
<Select placeholder="请选择部门">
|
<AccessDepartmentSelect />
|
||||||
<Option value="DEPT001">部门A</Option>
|
|
||||||
<Option value="DEPT001">部门B</Option>
|
|
||||||
</Select>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
@ -150,8 +150,8 @@ const AccessManagement: React.FC = () => {
|
|||||||
<Form.Item name="categoryId" label="准入品类">
|
<Form.Item name="categoryId" label="准入品类">
|
||||||
<CategorySelector multiple={false} style={{ width: 150 }} />
|
<CategorySelector multiple={false} style={{ width: 150 }} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="approveStatus" label="评审状态">
|
<Form.Item name="approveStatus" label="审批状态">
|
||||||
<Select style={{ width: 150 }} placeholder="请选择评审状态" allowClear>
|
<Select style={{ width: 150 }} placeholder="请选择审批状态" allowClear>
|
||||||
<Option value="0">未开始</Option>
|
<Option value="0">未开始</Option>
|
||||||
<Option value="1">进行中</Option>
|
<Option value="1">进行中</Option>
|
||||||
<Option value="2">结果汇总中</Option>
|
<Option value="2">结果汇总中</Option>
|
||||||
|
@ -3,7 +3,7 @@ import { Modal, Form, Input, DatePicker, Button, Tree, Select, message, Spin, Up
|
|||||||
import { UploadOutlined } from '@ant-design/icons';
|
import { UploadOutlined } from '@ant-design/icons';
|
||||||
import { categoryTree, uploadFile, superiorLockList, getSupplierPage, library, libraryData } from '../services';
|
import { categoryTree, uploadFile, superiorLockList, getSupplierPage, library, libraryData } from '../services';
|
||||||
import type { UploadFile } from 'antd/es/upload/interface';
|
import type { UploadFile } from 'antd/es/upload/interface';
|
||||||
|
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||||
import { getregionInternational } from '@/servers/api/register';
|
import { getregionInternational } from '@/servers/api/register';
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|
||||||
@ -239,14 +239,7 @@ const CategoryAddModal: React.FC<Props> = ({ visible, onCancel, onSuccess }) =>
|
|||||||
name="applyDeptId"
|
name="applyDeptId"
|
||||||
rules={[{ required: true, message: '请选择品类库负责人' }]}
|
rules={[{ required: true, message: '请选择品类库负责人' }]}
|
||||||
>
|
>
|
||||||
<Select
|
<AccessDepartmentSelect />
|
||||||
placeholder="请选择品类库负责人"
|
|
||||||
style={{ width: 260 }}
|
|
||||||
options={deptOptions.map(item => ({
|
|
||||||
label: item.deptId,
|
|
||||||
value: item.deptId,
|
|
||||||
}))}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="选择品类"
|
label="选择品类"
|
||||||
|
@ -203,7 +203,9 @@ const SupplierAddModal: React.FC<{
|
|||||||
showQuickJumper: true,
|
showQuickJumper: true,
|
||||||
onChange: (page, pageSize) => handleTableChange({ current: page, pageSize }),
|
onChange: (page, pageSize) => handleTableChange({ current: page, pageSize }),
|
||||||
}}
|
}}
|
||||||
bordered
|
style={{ flex: 1, minHeight: 0 }}
|
||||||
|
scroll={{ y: 'calc(100vh - 650px)' }}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</Spin>
|
</Spin>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
@ -220,7 +220,8 @@ const SupplierAddModal: React.FC<{
|
|||||||
showQuickJumper: true,
|
showQuickJumper: true,
|
||||||
onChange: (page, pageSize) => handleTableChange({ current: page, pageSize }),
|
onChange: (page, pageSize) => handleTableChange({ current: page, pageSize }),
|
||||||
}}
|
}}
|
||||||
bordered
|
style={{ flex: 1, minHeight: 0 }}
|
||||||
|
scroll={{ y: 'calc(100vh - 650px)' }}
|
||||||
/>
|
/>
|
||||||
</Spin>
|
</Spin>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
@ -140,7 +140,8 @@ const ViewModal: React.FC<{
|
|||||||
dataSource={categoryInfo.coscoCategoryLibrarySupplierVos}
|
dataSource={categoryInfo.coscoCategoryLibrarySupplierVos}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
pagination={false}
|
pagination={false}
|
||||||
bordered
|
style={{ flex: 1, minHeight: 0 }}
|
||||||
|
scroll={{ y: 'calc(100vh - 650px)' }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ export async function getUserinfo() {
|
|||||||
*/
|
*/
|
||||||
export async function Logout() {
|
export async function Logout() {
|
||||||
return request('/v1/login/logout', {
|
return request('/v1/login/logout', {
|
||||||
method: 'GET'
|
method: 'POST'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user