菜单与 审核按钮,登录新用户修改密码
This commit is contained in:
@ -74,7 +74,9 @@ interface coscoSupplierSurveyAttachments {
|
||||
//变更要求
|
||||
interface changeComparisonDataProps {
|
||||
name?: string;
|
||||
nameEn?: string;
|
||||
range?: string;
|
||||
supplierType?: string;
|
||||
}
|
||||
const BaseInfoFormModal: React.FC<Props> = ({
|
||||
visible,
|
||||
@ -114,7 +116,9 @@ const BaseInfoFormModal: React.FC<Props> = ({
|
||||
});
|
||||
setChangeComparisonData({
|
||||
name: initialValues.name,
|
||||
range: initialValues.range
|
||||
range: initialValues.range,
|
||||
supplierType: initialValues.supplierType,
|
||||
nameEn: initialValues.nameEn,
|
||||
})
|
||||
setViewData({
|
||||
...changeData,
|
||||
@ -261,11 +265,15 @@ const BaseInfoFormModal: React.FC<Props> = ({
|
||||
)}
|
||||
<Form.Item shouldUpdate>
|
||||
{() => {
|
||||
console.log(changeComparisonData,';changeComparisonData');
|
||||
|
||||
// 每次Form数据变化都会重新render
|
||||
const currentName = form.getFieldValue(['coscoSupplierBase', 'name']);
|
||||
const currentNameEn = form.getFieldValue(['coscoSupplierBase', 'nameEn']);
|
||||
const currentRange = form.getFieldValue(['coscoSupplierBase', 'range']);
|
||||
const shouldShowPanel =
|
||||
(changeComparisonData?.name !== undefined && currentName !== changeComparisonData.name) ||
|
||||
(changeComparisonData?.name !== undefined && (currentName !== changeComparisonData.name && changeComparisonData.supplierType === 'dvs' )) ||
|
||||
(changeComparisonData?.name !== undefined && (currentNameEn !== changeComparisonData.nameEn && changeComparisonData.supplierType === 'ovs' )) ||
|
||||
(changeComparisonData?.range !== undefined && currentRange !== changeComparisonData.range);
|
||||
|
||||
if (!shouldShowPanel) return null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Descriptions, Button } from 'antd';
|
||||
import { coscoSupplierBase } from '../services';
|
||||
import { Descriptions, Button, message } from 'antd';
|
||||
import { coscoSupplierBase, getSupplierIdCount } from '../services';
|
||||
import { useIntl } from 'umi';
|
||||
import BaseInfoFormModal from './BaseInfoFormModal'
|
||||
|
||||
@ -68,7 +68,16 @@ const BaseInfoTab: React.FC<BaseInfoTabProps> = (props) => {
|
||||
//增改查
|
||||
const [formVisible, setFormVisible] = useState(false);
|
||||
const handleAdd = () => {
|
||||
setFormVisible(true);
|
||||
|
||||
getSupplierIdCount(record).then((res) => {
|
||||
if(res === 0) {
|
||||
setFormVisible(true);
|
||||
} else {
|
||||
message.warning('已存在变更信息审核')
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
};
|
||||
const handleFormSubmit = () => {
|
||||
setFormVisible(false);
|
||||
|
@ -283,6 +283,9 @@ export const categoryTree = () => request.get('/cosco/category/categoryTree');
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 验证是否有变更
|
||||
*/
|
||||
export const getSupplierIdCount = (id: string) => request.get(`/coscoSupplierChangeApply/getSupplierIdCount/${id}`);
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@ import ProLayout, { PageContainer } from '@ant-design/pro-layout';
|
||||
import { Link, useLocation, useIntl } from 'umi';
|
||||
import { connect } from 'dva';
|
||||
import defaultSettings from '../../config/defaultSettings';
|
||||
import routes from '../../config/router.config';
|
||||
import routes from '../../config/router.config';
|
||||
import { ConfigProvider, Breadcrumb } from 'antd';
|
||||
import HeaderComponent from './Header';
|
||||
import IconFont from '@/components/IconFont/IconFont';
|
||||
@ -19,14 +19,14 @@ const MenuRender = (item: any, isSubMenu: boolean) => {
|
||||
<span className="ant-pro-menu-item">
|
||||
<IconFont type={item.icon as string} />
|
||||
<span className="ant-pro-menu-item-title">
|
||||
{intl.formatMessage({ id: `${item.name}` || '' })}
|
||||
{intl.formatMessage({ id: `menu.${item.name}` || '' })}
|
||||
</span>
|
||||
</span>
|
||||
) : (
|
||||
<Link className="ant-pro-menu-item" key={item.path} to={item.path || '/'} innerRef={null}>
|
||||
<IconFont type={item.icon as string} />
|
||||
<span className="ant-pro-menu-item-title">
|
||||
{intl.formatMessage({ id: `${item.name}` || '' })}
|
||||
{intl.formatMessage({ id: `menu.${item.name}` || '' })}
|
||||
</span>
|
||||
</Link>
|
||||
)}
|
||||
@ -77,8 +77,8 @@ function convertMenuData(menus: any[]): any[] {
|
||||
const icon = item.icon || undefined;
|
||||
// 递归 children->routes
|
||||
let routes;
|
||||
if (item.children && item.children.length > 0) {
|
||||
routes = convertMenuData(item.children);
|
||||
if (item.routes && item.routes.length > 0) {
|
||||
routes = convertMenuData(item.routes);
|
||||
}
|
||||
// 国际化优先找 menu.name,否则直接显示 name
|
||||
return {
|
||||
@ -90,6 +90,43 @@ function convertMenuData(menus: any[]): any[] {
|
||||
});
|
||||
}
|
||||
|
||||
// 新增递归过滤函数
|
||||
function filterMenusByLocalConfig(localMenus: any[], remoteMenus: any[]): any[] {
|
||||
if (!Array.isArray(localMenus) || !Array.isArray(remoteMenus)) return [];
|
||||
// remoteMenus 可能有 children 字段,也可能有 routes 字段
|
||||
const remoteMap = new Map();
|
||||
remoteMenus.forEach(r => {
|
||||
if (r.path) remoteMap.set(r.path, r);
|
||||
});
|
||||
|
||||
// filter 和 map 后的结果直接 return
|
||||
localMenus
|
||||
.filter(local => local.path && remoteMap.has(local.path))
|
||||
.map(local => {
|
||||
const remote = remoteMap.get(local.path);
|
||||
// 兼容 children 或 routes 字段
|
||||
const localChildren = local.children || local.routes;
|
||||
const remoteChildren = remote.children || remote.routes;
|
||||
let newChildren: any[] = [];
|
||||
if (
|
||||
localChildren && localChildren.length > 0 &&
|
||||
remoteChildren && remoteChildren.length > 0
|
||||
) {
|
||||
newChildren = filterMenusByLocalConfig(localChildren, remoteChildren);
|
||||
}
|
||||
// 保留原有结构,只替换 children 或 routes
|
||||
let node = { ...local };
|
||||
if (local.children) {
|
||||
node.children = newChildren;
|
||||
} else if (local.routes) {
|
||||
node.routes = newChildren;
|
||||
}
|
||||
return node;
|
||||
});
|
||||
|
||||
return localMenus
|
||||
}
|
||||
|
||||
|
||||
const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
|
||||
const { children, tab, dispatch } = props;
|
||||
@ -118,7 +155,8 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
|
||||
const menuStr = sessionStorage.getItem('menuList');
|
||||
if (menuStr) {
|
||||
const menus = JSON.parse(menuStr);
|
||||
setMenuRoutes(convertMenuData(menus));
|
||||
const filteredMenus = filterMenusByLocalConfig(routes, menus);
|
||||
setMenuRoutes(convertMenuData(filteredMenus));
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Card, Row, Col, Spin, message } from 'antd';
|
||||
import { Column, Pie, Bar } from '@ant-design/charts';
|
||||
import ChangePasswordModal from './components/ChangePasswordModal';
|
||||
|
||||
import {
|
||||
changePasswordOnFirstLogin,
|
||||
getYearcountNum,
|
||||
getAccessTypeCountNum,
|
||||
getSupplierTypeCountNum,
|
||||
@ -22,38 +20,6 @@ const HomeDashboard: React.FC = () => {
|
||||
const [supplierAuditData, setSupplierAuditData] = useState<any[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
// ======= 新增部分:弹窗控制 =======
|
||||
const [showChangePwd, setShowChangePwd] = useState(false);
|
||||
useEffect(() => {
|
||||
// 检查 firstLogin
|
||||
const userStr = sessionStorage.getItem('currentUser');
|
||||
if (userStr) {
|
||||
try {
|
||||
const userObj = JSON.parse(userStr);
|
||||
if (userObj?.supplierUser?.firstLogin === 0) {
|
||||
setShowChangePwd(true);
|
||||
}
|
||||
} catch (e) { }
|
||||
}
|
||||
}, []);
|
||||
// 修改密码确认回调
|
||||
const handleChangePwd = async (values: { userId: string; newPassword: string; confirmPassword: string; }) => {
|
||||
try {
|
||||
await changePasswordOnFirstLogin({ ...values });
|
||||
message.success('密码修改成功,请重新登录');
|
||||
// 更新缓存 firstLogin=1
|
||||
const userStr = sessionStorage.getItem('currentUser');
|
||||
if (userStr) {
|
||||
const userObj = JSON.parse(userStr);
|
||||
if (userObj?.supplierUser) userObj.supplierUser.firstLogin = 1;
|
||||
sessionStorage.setItem('currentUser', JSON.stringify(userObj));
|
||||
}
|
||||
setShowChangePwd(false);
|
||||
|
||||
} catch (e: any) {
|
||||
message.error(e?.message || '修改密码失败');
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
@ -193,19 +159,6 @@ const HomeDashboard: React.FC = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ChangePasswordModal
|
||||
visible={showChangePwd}
|
||||
onOk={handleChangePwd}
|
||||
onCancel={() => {
|
||||
setShowChangePwd(false)
|
||||
const userStr = sessionStorage.getItem('currentUser');
|
||||
if (userStr) {
|
||||
const userObj = JSON.parse(userStr);
|
||||
if (userObj?.supplierUser) userObj.supplierUser.firstLogin = 1;
|
||||
sessionStorage.setItem('currentUser', JSON.stringify(userObj));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Spin spinning={loading}>
|
||||
<Row gutter={[24, 24]}>
|
||||
{/* 第一行:3图 */}
|
||||
|
@ -1,18 +1,5 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
*
|
||||
* @param params
|
||||
* @returns
|
||||
*
|
||||
*/
|
||||
interface PasswordOnFirstLogin {
|
||||
userId:string;
|
||||
newPassword:string;
|
||||
confirmPassword:string;
|
||||
}
|
||||
export const changePasswordOnFirstLogin = (data:PasswordOnFirstLogin) => request.post(`/v1/login/supplier/changePasswordOnFirstLogin`, { data});
|
||||
|
||||
/**
|
||||
*
|
||||
* @param params
|
||||
|
72
src/pages/login/components/ChangePasswordModal.tsx
Normal file
72
src/pages/login/components/ChangePasswordModal.tsx
Normal file
@ -0,0 +1,72 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { Modal, Form, Input, Button } from 'antd';
|
||||
// props: visible, onOk, onCancel
|
||||
const ChangePasswordModal: React.FC<{
|
||||
visible: boolean;
|
||||
onOk: (values: { userId: string; newPassword: string; confirmPassword: string }) => Promise<void>;
|
||||
}> = ({ visible, onOk }) => {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const handleOk = async () => {
|
||||
try {
|
||||
const values = await form.validateFields();
|
||||
await onOk({ ...values });
|
||||
form.resetFields();
|
||||
} catch (err) {}
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="首次登录请修改密码"
|
||||
visible={visible}
|
||||
onOk={handleOk}
|
||||
okText="确认修改"
|
||||
maskClosable={false}
|
||||
closable={false}
|
||||
destroyOnClose
|
||||
footer={null}
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
labelCol={{ flex: '100px' }}
|
||||
initialValues={{ newPassword: '', confirmPassword: '' }}
|
||||
>
|
||||
<Form.Item name="userId" noStyle>
|
||||
<Input type="hidden" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="新密码"
|
||||
name="newPassword"
|
||||
rules={[
|
||||
{ required: true, message: '请输入新密码' },
|
||||
]}
|
||||
>
|
||||
<Input.Password />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="确认新密码"
|
||||
name="confirmPassword"
|
||||
dependencies={['newPassword']}
|
||||
rules={[
|
||||
{ required: true, message: '请确认新密码' },
|
||||
({ getFieldValue }) => ({
|
||||
validator(_, value) {
|
||||
if (!value || getFieldValue('newPassword') === value) return Promise.resolve();
|
||||
return Promise.reject('两次输入密码不一致');
|
||||
},
|
||||
}),
|
||||
]}
|
||||
>
|
||||
<Input.Password />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
<Button type="primary" onClick={handleOk}>
|
||||
确认修改
|
||||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default ChangePasswordModal;
|
@ -3,7 +3,8 @@ import { Form, Input, Button, Checkbox, Tabs, message } from 'antd';
|
||||
import { UserOutlined, LockOutlined, EyeInvisibleOutlined, EyeTwoTone } from '@ant-design/icons';
|
||||
import { history, useIntl } from 'umi';
|
||||
import './login.less';
|
||||
import { getCaptcha, supplierLogin, expertLogin, accountLogin, getUserinfo, refreshDictCache, findMenuList } from '@/servers/api/login';
|
||||
import { getCaptcha, supplierLogin, expertLogin, accountLogin, getUserinfo, refreshDictCache, findMenuList, changePasswordOnFirstLogin } from '@/servers/api/login';
|
||||
import ChangePasswordModal from './components/ChangePasswordModal';
|
||||
|
||||
import { encryptWithRsa } from '@/utils/encryptWithRsa'
|
||||
|
||||
@ -14,6 +15,10 @@ const LoginPage: React.FC = () => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [captchaImg, setCaptchaImg] = useState<string>('');
|
||||
const [userId, setUserId] = useState<string>('');
|
||||
// ======= 修改密码弹窗控制 =======
|
||||
const [showChangePwd, setShowChangePwd] = useState(false);
|
||||
|
||||
// const [captchaKey, setCaptchaKey] = useState<string>('');
|
||||
//切换后 走不同接口
|
||||
const loginApiMap: { [key: string]: (params: any) => Promise<any> } = {
|
||||
@ -51,6 +56,26 @@ const LoginPage: React.FC = () => {
|
||||
// });
|
||||
// }
|
||||
}, [form]);
|
||||
|
||||
// 修改密码确认回调
|
||||
const handleChangePwd = async (values: { userId: string; newPassword: string; confirmPassword: string; }) => {
|
||||
try {
|
||||
await changePasswordOnFirstLogin({
|
||||
userId: userId,
|
||||
newPassword: encryptWithRsa(values.newPassword, false),
|
||||
confirmPassword: encryptWithRsa(values.confirmPassword, false)
|
||||
}).then((res) => {
|
||||
if(res.data) {
|
||||
setShowChangePwd(false);
|
||||
message.success('修改成功,请重新登录');
|
||||
} else {
|
||||
message.success('修改密码失败');
|
||||
}
|
||||
})
|
||||
} catch (e: any) {
|
||||
message.error(e?.message || '修改密码失败');
|
||||
}
|
||||
};
|
||||
const onFinish = async (values: any) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
@ -92,11 +117,19 @@ const LoginPage: React.FC = () => {
|
||||
sessionStorage.setItem('currentUser', JSON.stringify(loginRes.data));
|
||||
await getUserinfo().then(async (res) => {
|
||||
const roleIdList = res.authorityList.map((item: any) => item.roleId);
|
||||
console.log(res);
|
||||
|
||||
setUserId(res.userId)
|
||||
sessionStorage.setItem('Userinfo', JSON.stringify(res));
|
||||
const menuList: any = await findMenuList({ roleIdList });
|
||||
sessionStorage.setItem('menuList', JSON.stringify(menuList.data));
|
||||
message.success('登录成功');
|
||||
history.push('/index');
|
||||
//新用户需要修改一次密码
|
||||
if (loginRes.data?.supplierUser?.firstLogin === 1) {
|
||||
setShowChangePwd(true);
|
||||
} else {
|
||||
message.success('登录成功');
|
||||
history.push('/index');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
message.error(loginRes.message || '登录失败');
|
||||
@ -157,6 +190,12 @@ const LoginPage: React.FC = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ChangePasswordModal
|
||||
visible={showChangePwd}
|
||||
onOk={handleChangePwd}
|
||||
/>
|
||||
|
||||
<div className='login-page'>
|
||||
<div className='login-container'>
|
||||
{/* <div className='back-home'>
|
||||
@ -245,6 +284,7 @@ const LoginPage: React.FC = () => {
|
||||
</Form>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -10,7 +10,7 @@ import CategorySelector from '@/components/CategorySelector';
|
||||
import AdmissionTypeSelect from '@/components/CommonSelect/AdmissionTypeSelect';
|
||||
import AccessDepartmentSelect from "@/components/AccessDepartmentSelect"
|
||||
//接口
|
||||
import { getPage, startApprove } from './services'
|
||||
import { getPage, startApprove, supplierChangeApprove } from './services'
|
||||
import { getDictList } from '@/servers/api/dicts'
|
||||
//统一列表分页
|
||||
import tableProps from '@/utils/tableProps'
|
||||
@ -120,6 +120,15 @@ const SupplierCategoryEntry: React.FC = () => {
|
||||
发起审批
|
||||
</a>
|
||||
)}
|
||||
{record.approveStatus === '0' && (
|
||||
<Button type="link" onClick={() => {
|
||||
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
||||
handleReset()
|
||||
})
|
||||
}}>
|
||||
审批
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
@ -131,7 +140,7 @@ const SupplierCategoryEntry: React.FC = () => {
|
||||
<div className="filter-action-row">
|
||||
<Form layout="inline" form={form} className="filter-form" onFinish={getList}>
|
||||
<Form.Item name="accessType" label="准入方式">
|
||||
<AdmissionTypeSelect/>
|
||||
<AdmissionTypeSelect />
|
||||
</Form.Item>
|
||||
<Form.Item name="orgId" label="准入单位">
|
||||
<AccessDepartmentSelect placeholder={'请选择准入单位'} />
|
||||
|
@ -62,3 +62,6 @@ export const add = (data: addInterface) => request.post('/coscoAccessWorkCategor
|
||||
* 品类选择查询树
|
||||
*/
|
||||
export const categoryTree = () => request.get('/cosco/category/categoryTree');
|
||||
|
||||
|
||||
export const supplierChangeApprove = (data: { id:string; approveStatus:string }) => request.post('/synchronous/receiveCategoryApprove', { data });
|
@ -13,7 +13,7 @@ import AdmissionTypeSelect from '@/components/CommonSelect/AdmissionTypeSelect';
|
||||
import AccessStatusSelect from '@/components/CommonSelect/AccessStatusSelect';
|
||||
import AccessDepartmentSelect from "@/components/AccessDepartmentSelect"
|
||||
//接口
|
||||
import { getPage, startApprove } from './services'
|
||||
import { getPage, startApprove, supplierChangeApprove } from './services'
|
||||
//统一列表分页
|
||||
import tableProps from '@/utils/tableProps'
|
||||
|
||||
@ -112,7 +112,7 @@ const AccessManagement: React.FC = () => {
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
width: 220,
|
||||
fixed: 'right',
|
||||
render: (_: any, record: any) => (
|
||||
<Space>
|
||||
@ -127,6 +127,15 @@ const AccessManagement: React.FC = () => {
|
||||
<a onClick={() => openModal('result', record)}>评审结果</a>
|
||||
</>
|
||||
)}
|
||||
{record.approveStatus === '0' && (
|
||||
<Button type="link" onClick={() => {
|
||||
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
||||
handleReset()
|
||||
})
|
||||
}}>
|
||||
审批
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</Space>
|
||||
),
|
||||
@ -173,7 +182,7 @@ const AccessManagement: React.FC = () => {
|
||||
dataSource={data}
|
||||
columns={columns}
|
||||
loading={loading}
|
||||
pagination={{...tableProps.pagination, total: pagination.total }}
|
||||
pagination={{ ...tableProps.pagination, total: pagination.total }}
|
||||
onChange={(pagination) => {
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, pagination.current!, pagination.pageSize!)
|
||||
|
@ -123,4 +123,4 @@ export const startApprove = (params: startApproveData) => request.get(`/coscoAcc
|
||||
*/
|
||||
export const reviewInfoData = (params: startApproveData) => request.get(`/coscoAccessWork/reviewInfoData`, { params });
|
||||
|
||||
|
||||
export const supplierChangeApprove = (data: { id:string; approveStatus:string }) => request.post('/synchronous/receiveApprove', { data });
|
@ -5,7 +5,7 @@ import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import DetailView from './components/DetailView';
|
||||
import RegionTypeSelect from '@/components/CommonSelect/RegionTypeSelect'
|
||||
//接口
|
||||
import { getPage } from './services';
|
||||
import { getPage, supplierChangeApprove } from './services';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
//字典
|
||||
import { getDictList } from '@/servers/api/dicts'
|
||||
@ -189,9 +189,22 @@ const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
render: (_: any, record: any) => (
|
||||
<Button type="link" onClick={() => handleDetail(record)}>
|
||||
审批记录
|
||||
</Button>
|
||||
<>
|
||||
<Button type="link" onClick={() => handleDetail(record)}>
|
||||
审批记录
|
||||
</Button>
|
||||
{/* 测试使用,需删除 */}
|
||||
{ record.approveStatus === '0' && (
|
||||
<Button type="link" onClick={() => {
|
||||
supplierChangeApprove({ id:record.id, approveStatus: '1' }).then(() => {
|
||||
handleReset()
|
||||
})
|
||||
}}>
|
||||
审批
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
|
||||
),
|
||||
},
|
||||
];
|
||||
|
@ -21,4 +21,4 @@ export const supplierChangeApplyById = (id: string) => request.get(`/coscoSuppli
|
||||
|
||||
|
||||
|
||||
|
||||
export const supplierChangeApprove = (data: { id:string; approveStatus:string }) => request.post('/synchronous/supplierChangeApprove', { data });
|
||||
|
@ -8,7 +8,7 @@ import ViewBlacklistModal from './components/ViewBlacklistModal';
|
||||
import AccessDepartmentSelect from "@/components/AccessDepartmentSelect"
|
||||
//接口
|
||||
import { getDictList } from '@/servers/api/dicts'
|
||||
import { getPage } from './services'
|
||||
import { getPage, supplierChangeApprove } from './services'
|
||||
//统一列表分页
|
||||
import tableProps from '@/utils/tableProps'
|
||||
import moment from 'moment';
|
||||
@ -102,10 +102,11 @@ const supplierExitAudit: React.FC = () => {
|
||||
title: "操作",
|
||||
key: "option",
|
||||
align: "center",
|
||||
width: 100,
|
||||
width: 140,
|
||||
fixed: 'right',
|
||||
render: (record: any) => (
|
||||
<a
|
||||
<>
|
||||
<a
|
||||
onClick={() => {
|
||||
setSelectedRecordId(record.id);
|
||||
setViewVisible(true);
|
||||
@ -113,6 +114,17 @@ const supplierExitAudit: React.FC = () => {
|
||||
>
|
||||
查看
|
||||
</a>
|
||||
{record.approveStatus === '0' && (
|
||||
<Button type="link" onClick={() => {
|
||||
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
||||
handleReset()
|
||||
})
|
||||
}}>
|
||||
审批
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
|
||||
),
|
||||
},
|
||||
];
|
||||
|
@ -84,4 +84,4 @@ export const coscoSupplierexit = (id: string) => request.get(`/coscoSupplierexit
|
||||
|
||||
|
||||
|
||||
|
||||
export const supplierChangeApprove = (data: { id:string; approveStatus:string }) => request.post('/synchronous/supplierCategoryTcApprove', { data });
|
||||
|
@ -104,4 +104,17 @@ export async function reset(data: resetData) {
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param params
|
||||
* @returns
|
||||
*
|
||||
*/
|
||||
interface PasswordOnFirstLogin {
|
||||
userId:string;
|
||||
newPassword:string;
|
||||
confirmPassword:string;
|
||||
}
|
||||
export const changePasswordOnFirstLogin = (data:PasswordOnFirstLogin) => request.post(`/v1/login/supplier/changePasswordOnFirstLogin`, { data});
|
Reference in New Issue
Block a user