Commit 5355f1c2 by guomingpang

feat:微信审核

parent 7f03904c
...@@ -76,5 +76,13 @@ export function getStoreDetail(params: object) { ...@@ -76,5 +76,13 @@ export function getStoreDetail(params: object) {
return Service.Hades("public/hades/getStoreDetail", params); return Service.Hades("public/hades/getStoreDetail", params);
} }
export function getCustomerAuditList(params: object){
return Service.Hades('public/hades/getCustomerAuditList',params);
}
export function auditOperation(params: object){
return Service.Hades('public/hades/auditOperation',params);
}
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { getEmployeeList, getUserList, getStoreDecorationList, getStoreRole, addEmployee, editEmployee, deleteEmployee, getCourseCatalogList, import { getEmployeeList, getUserList, getStoreDecorationList, getStoreRole, addEmployee, editEmployee, deleteEmployee, getCourseCatalogList,
getAllSonCategory, addCourseCategory, delCourseCategory, editCourseCategory, deleteStoreDecorationList, addStoreBanner, editStoreBanner, getAllSonCategory, addCourseCategory, delCourseCategory, editCourseCategory, deleteStoreDecorationList, addStoreBanner, editStoreBanner,
moveBannerSequence,getStoreUserBasicPage,updateStoreMessage,getStoreDetail} from '@/data-source/store/request-apis'; moveBannerSequence,getStoreUserBasicPage,updateStoreMessage,getStoreDetail,getCustomerAuditList,auditOperation} from '@/data-source/store/request-apis';
export default class StoreService { export default class StoreService {
// 获取员工列表 // 获取员工列表
...@@ -89,4 +89,14 @@ export default class StoreService { ...@@ -89,4 +89,14 @@ export default class StoreService {
static getStoreDetail(params: any) { static getStoreDetail(params: any) {
return getStoreDetail(params); return getStoreDetail(params);
} }
// 获取微信学员审核列表
static getCustomerAuditList(params: any){
return getCustomerAuditList(params)
}
//微信学员审核操作
static auditOperation(params: any){
return auditOperation(params)
}
} }
\ No newline at end of file
...@@ -18,7 +18,7 @@ class CollegeInfoPage extends React.Component { ...@@ -18,7 +18,7 @@ class CollegeInfoPage extends React.Component {
showSelectFileModal: false, showSelectFileModal: false,
cutImageBlob: null, cutImageBlob: null,
imageFile: null, // 需要被截取的图片 imageFile: null, // 需要被截取的图片
auditSwitch:true, auditSwitch:"OPEN",
}; };
} }
componentWillMount() { componentWillMount() {
...@@ -34,18 +34,20 @@ class CollegeInfoPage extends React.Component { ...@@ -34,18 +34,20 @@ class CollegeInfoPage extends React.Component {
}; };
StoreService.getStoreDetail(params).then((res) => { StoreService.getStoreDetail(params).then((res) => {
const { result = {} } = res; const { result = {} } = res;
const { storeName, logo } = result; const { storeName, logo,auditSwitch } = result;
this.formRef.current.setFieldsValue({ this.formRef.current.setFieldsValue({
storeName: storeName, storeName: storeName,
}); });
this.setState({ this.setState({
storeName, storeName,
auditSwitch,
logo, logo,
}); });
}); });
}; };
onChangeFiledValue = (filed, value) => { onChangeFiledValue = (filed, value) => {
console.log(filed, value)
this.setState({ this.setState({
[filed]: value, [filed]: value,
}); });
...@@ -83,7 +85,8 @@ class CollegeInfoPage extends React.Component { ...@@ -83,7 +85,8 @@ class CollegeInfoPage extends React.Component {
}; };
updateInfo = () => { updateInfo = () => {
const { storeName, logo } = this.state; const { storeName, logo, auditSwitch
} = this.state;
if (!storeName) { if (!storeName) {
message.warning('请输入学院名称'); message.warning('请输入学院名称');
return; return;
...@@ -92,6 +95,8 @@ class CollegeInfoPage extends React.Component { ...@@ -92,6 +95,8 @@ class CollegeInfoPage extends React.Component {
storeName, storeName,
logo, logo,
storeId: User.getStoreId(), storeId: User.getStoreId(),
auditSwitch
}; };
StoreService.updateStoreMessage(params).then((res) => { StoreService.updateStoreMessage(params).then((res) => {
User.setStoreName(storeName); User.setStoreName(storeName);
...@@ -147,7 +152,7 @@ class CollegeInfoPage extends React.Component { ...@@ -147,7 +152,7 @@ class CollegeInfoPage extends React.Component {
<div className='title mt40'>高级设置</div> <div className='title mt40'>高级设置</div>
<Form.Item label='学员审核' name='storeName' rules={[{ required: true }]}> <Form.Item label='学员审核' name='storeName' rules={[{ required: true }]}>
<div className='switch-box'> <div className='switch-box'>
<Switch checked={auditSwitch } onChange={(e) => this.onChangeFiledValue('auditSwitch', e)}/> <Switch checked={auditSwitch ==='OPEN' } onChange={(e) => this.onChangeFiledValue('auditSwitch', e ?'OPEN':'CLOSE')}/>
<Choose> <Choose>
<When condition={auditSwitch}> <When condition={auditSwitch}>
<div className='switch-desc'>已开启,成为学院学员需要审核</div> <div className='switch-desc'>已开启,成为学院学员需要审核</div>
......
...@@ -35,6 +35,7 @@ function UserManagePage(props:any) { ...@@ -35,6 +35,7 @@ function UserManagePage(props:any) {
const { match } = props; const { match } = props;
const [userList, setUserList] = useState([]); const [userList, setUserList] = useState([]);
const [model, setModel] = useState<React.ReactNode>(null); const [model, setModel] = useState<React.ReactNode>(null);
const [auditSwitch,setAuditSwitch] = useState('No')
const [query, setQuery] = useState({ const [query, setQuery] = useState({
current: 0, current: 0,
size: 10, size: 10,
...@@ -64,9 +65,24 @@ function UserManagePage(props:any) { ...@@ -64,9 +65,24 @@ function UserManagePage(props:any) {
StoreService.getUserList(_query).then((res: any) => { StoreService.getUserList(_query).then((res: any) => {
setRealTotal(res.result.total); setRealTotal(res.result.total);
}); });
const params= {
storeId:User.getStoreId()
}
StoreService.getStoreDetail(params).then((res) => {
const { result = { } } = res;
const {
auditSwitch
} = result;
setAuditSwitch(auditSwitch)
})
}, []) }, [])
useEffect(()=>{
},[])
useEffect(() => { useEffect(() => {
getUserList(); getUserList();
}, [query]); }, [query]);
...@@ -141,12 +157,19 @@ function UserManagePage(props:any) { ...@@ -141,12 +157,19 @@ function UserManagePage(props:any) {
<div className=" page user-manage-page"> <div className=" page user-manage-page">
<div className="content-header"> <div className="content-header">
<div>学员管理</div> <div>学员管理</div>
<If condition={auditSwitch === 'OPEN'}>
<div className='wechat-audit' onClick={()=>{ <div className='wechat-audit' onClick={()=>{
window.RCHistory.push({ window.RCHistory.push({
pathname: `${match.url}/wechat-user-audit`, pathname: `${match.url}/wechat-user-audit`,
}); });
}} ><span className='icon iconfont icon-font-weixin'>&#xe8e0;</span><span className='content-header-right'>学员审核列表</span></div> }} >
<span className='icon iconfont icon-font-weixin'>&#xe8e0;</span>
<span className='content-header-right'>学员审核列表</span>
</div>
</If>
</div> </div>
<div className="box"> <div className="box">
<div className="box-header"> <div className="box-header">
<div className="header-item"> <div className="header-item">
......
...@@ -3,7 +3,7 @@ import Breadcrumbs from '@/components/Breadcrumbs'; ...@@ -3,7 +3,7 @@ import Breadcrumbs from '@/components/Breadcrumbs';
import WechatUserAuditFilter from './WechatUserAuditFilter'; import WechatUserAuditFilter from './WechatUserAuditFilter';
import WechatUserAuditOpt from './WechatUserAuditOpt' import WechatUserAuditOpt from './WechatUserAuditOpt'
import WechatUserAuditList from './WechatUserAuditList'; import WechatUserAuditList from './WechatUserAuditList';
import PlanService from '@/domains/plan-domain/planService'; import StoreService from "@/domains/store-domain/storeService";
import User from '@/common/js/user'; import User from '@/common/js/user';
import './WechatUserAudit.less'; import './WechatUserAudit.less';
...@@ -13,7 +13,7 @@ const WechatUserAudit = function () { ...@@ -13,7 +13,7 @@ const WechatUserAudit = function () {
const [query, setQuery] = useState({ const [query, setQuery] = useState({
current: 1, current: 1,
size: 10, size: 10,
type: 'b' applyStatus: 'WAIT' //PASSED, WAIT, REJECTED
}); });
useEffect(() => { useEffect(() => {
...@@ -23,10 +23,10 @@ const WechatUserAudit = function () { ...@@ -23,10 +23,10 @@ const WechatUserAudit = function () {
const params = { const params = {
...query, ...query,
..._query, ..._query,
storeUserId: User.getStoreUserId(), storeId: User.getStoreId(),
}; };
PlanService.getTrainingPlanPage(params).then((res) => { StoreService.getCustomerAuditList(params).then((res) => {
const { const {
result: { records = [], total }, result: { records = [], total },
} = res; } = res;
...@@ -51,7 +51,7 @@ const WechatUserAudit = function () { ...@@ -51,7 +51,7 @@ const WechatUserAudit = function () {
<Breadcrumbs navList='学员审核列表' /> <Breadcrumbs navList='学员审核列表' />
<div className='box'> <div className='box'>
<WechatUserAuditFilter onChange={queryChange} /> <WechatUserAuditFilter onChange={queryChange} />
<WechatUserAuditOpt onChange = {queryChange} defaultType={query.type}/> <WechatUserAuditOpt onChange = {queryChange} defaultType={query.applyStatus}/>
<WechatUserAuditList listData={listData} query={query} totalCount={totalCount} onChange={queryChange} /> <WechatUserAuditList listData={listData} query={query} totalCount={totalCount} onChange={queryChange} />
</div> </div>
</div> </div>
......
import React from 'react'; import React from 'react';
import { message, Badge } from 'antd';
import { PageControl, XMTable } from '@/components'; import { PageControl, XMTable } from '@/components';
// import User from '@/common/js/user'; // import User from '@/common/js/user';
import './WechatUserAuditList.less' import './WechatUserAuditList.less';
import StoreService from '@/domains/store-domain/storeService';
import User from '@/common/js/user';
function WechatUserAuditList(props) { function WechatUserAuditList(props) {
const {listData , totalCount, query,onChange=()=>{}} =props const { listData, totalCount, query, onChange = () => {} } = props;
function parseColumns() { function parseColumns() {
const columns = [ const columns = [
{ {
title: '微信名称', title: '微信名称',
key: 'planName', key: 'nickName',
dataIndex: 'planName', dataIndex: 'nickName',
width: '14%', width: '12%',
fixed: 'left', fixed: 'left',
render: (val, record) => { render: (val, record) => {
return ( return <div className='wechat-user-audit-name'>{val}</div>;
<div className='wechat-user-audit-name'>{val}</div>
)
}, },
}, },
{ {
title: '真实姓名', title: '真实姓名',
key: 'createName', key: 'realName',
dataIndex: 'createName', dataIndex: 'realName',
width: '10%', width: '12%',
render: (val) => { render: (val) => {
return <div className='create-name'>{val}</div>; return <div className='create-name'>{val}</div>;
}, },
...@@ -37,8 +35,8 @@ function WechatUserAuditList(props) { ...@@ -37,8 +35,8 @@ function WechatUserAuditList(props) {
{ {
title: '申请时间', title: '申请时间',
width: '12.5%', width: '12.5%',
key: 'created', key: 'applyDate',
dataIndex: 'created', dataIndex: 'applyDate',
render: (val) => { render: (val) => {
return <span style={{ whiteSpace: 'nowrap' }}>{window.formatDate('YYYY-MM-DD H:i', val)}</span>; return <span style={{ whiteSpace: 'nowrap' }}>{window.formatDate('YYYY-MM-DD H:i', val)}</span>;
}, },
...@@ -46,19 +44,33 @@ function WechatUserAuditList(props) { ...@@ -46,19 +44,33 @@ function WechatUserAuditList(props) {
{ {
title: '审批状态', title: '审批状态',
width: '10%', width: '10%',
key: 'updated', key: 'applyStatus',
dataIndex: 'updated', dataIndex: 'applyStatus',
render: (val) => { render: (val) => {
return <span style={{ whiteSpace: 'nowrap' }}>{window.formatDate('YYYY-MM-DD H:i', val)}</span>; return (
<div className='valid-state-icon'>
<Choose>
<When condition={val === 'PASSED'}>
<Badge color='#0ACCA4' text='已通过' />
</When>
<When condition={val === 'REJECTED'}>
<Badge color='#EC4B35' text='已拒绝' />
</When>
<Otherwise>
<Badge color='#FFB714' text='待审核' />
</Otherwise>
</Choose>
</div>
);
}, },
}, },
{ {
title: '审核人', title: '审核人',
width: '10%', width: '10%',
key: 'cultureCustomerNum', key: 'reviewer',
dataIndex: 'cultureCustomerNum', dataIndex: 'reviewer',
render: (val) => { render: (val) => {
return <div className='join-number'>{val}</div>; return <div>{val}</div>;
}, },
}, },
{ {
...@@ -69,15 +81,24 @@ function WechatUserAuditList(props) { ...@@ -69,15 +81,24 @@ function WechatUserAuditList(props) {
width: '14.5%', width: '14.5%',
render: (val, record) => { render: (val, record) => {
return ( return (
<Choose>
<When condition={record.applyStatus === 'WAIT'}>
<div className='operate'> <div className='operate'>
<div className='operate__item' onClick={() => toLearningDataPage(record)}> <div className='operate__item' onClick={() => audit(record, true)}>
通过 通过
</div> </div>
<span className='operate__item split'> | </span> <span className='operate__item split'> | </span>
<div className='operate__item' onClick={() => toLearningDataPage(record)}> <div className='operate__item' onClick={() => audit(record, false)}>
拒绝 拒绝
</div> </div>
</div> </div>
</When>
<Otherwise>
<div className='operate'>
<div></div>
</div>
</Otherwise>
</Choose>
); );
}, },
}, },
...@@ -85,10 +106,21 @@ function WechatUserAuditList(props) { ...@@ -85,10 +106,21 @@ function WechatUserAuditList(props) {
return columns; return columns;
} }
function toLearningDataPage(record){ function audit(record, isTrue) {
console.log(record) const { id } = record;
const params = {
applyCustomerId: id,
audit: isTrue,
operatorId: User.getStoreUserId(),
storeId: User.getStoreId(),
};
StoreService.auditOperation(params).then((res) => {
if (res.success) {
message.success('操作成功');
onChange(query)
}
});
} }
function onShowSizeChange(current, size) { function onShowSizeChange(current, size) {
if (current === size) { if (current === size) {
...@@ -107,7 +139,6 @@ function WechatUserAuditList(props) { ...@@ -107,7 +139,6 @@ function WechatUserAuditList(props) {
dataSource={listData} dataSource={listData}
columns={parseColumns()} columns={parseColumns()}
pagination={false} pagination={false}
bordered bordered
size='middle' size='middle'
scroll={{ x: 1400 }} scroll={{ x: 1400 }}
...@@ -132,4 +163,4 @@ function WechatUserAuditList(props) { ...@@ -132,4 +163,4 @@ function WechatUserAuditList(props) {
); );
} }
export default WechatUserAuditList export default WechatUserAuditList;
...@@ -63,5 +63,12 @@ ...@@ -63,5 +63,12 @@
.more-operate { .more-operate {
line-height: 20px; line-height: 20px;
} }
.valid-state-icon{
display: flex;
align-items: center;
.ant-badge{
transform: translate(0,0) scale(1) !important;
}
}
} }
\ No newline at end of file
import React from 'react'; import React from 'react';
import { Row, Radio } from 'antd'; import { Row, Radio } from 'antd';
const WechatUserAuditOpt = function (props) { const WechatUserAuditOpt = function (props) {
const { onChange = () => {}, defaultType = 'a' } = props; const { onChange = () => {}, defaultType = '' } = props;
return ( return (
<div className='wechat-user-audit-filter'> <div className='wechat-user-audit-filter'>
<Row type='flex' justify='end' align='top'> <Row type='flex' justify='end' align='top'>
<Radio.Group onChange={(e)=>onChange({type:e.target.value})} defaultValue={defaultType}> <Radio.Group onChange={(e)=>onChange({applyStatus:e.target.value})} defaultValue={defaultType}>
<Radio.Button value='a'>全部</Radio.Button> <Radio.Button value=''>全部</Radio.Button>
<Radio.Button value='b'>待审核</Radio.Button> <Radio.Button value='WAIT'>待审核</Radio.Button>
<Radio.Button value='c'>已通过</Radio.Button> <Radio.Button value='PASSED'>已通过</Radio.Button>
<Radio.Button value='d'>已拒绝</Radio.Button> <Radio.Button value='REJECTED'>已拒绝</Radio.Button>
</Radio.Group> </Radio.Group>
</Row> </Row>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment