Commit 5355f1c2 by guomingpang

feat:微信审核

parent 7f03904c
......@@ -76,5 +76,13 @@ export function getStoreDetail(params: object) {
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 @@
*/
import { getEmployeeList, getUserList, getStoreDecorationList, getStoreRole, addEmployee, editEmployee, deleteEmployee, getCourseCatalogList,
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 {
// 获取员工列表
......@@ -89,4 +89,14 @@ export default class StoreService {
static getStoreDetail(params: any) {
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 {
showSelectFileModal: false,
cutImageBlob: null,
imageFile: null, // 需要被截取的图片
auditSwitch:true,
auditSwitch:"OPEN",
};
}
componentWillMount() {
......@@ -34,18 +34,20 @@ class CollegeInfoPage extends React.Component {
};
StoreService.getStoreDetail(params).then((res) => {
const { result = {} } = res;
const { storeName, logo } = result;
const { storeName, logo,auditSwitch } = result;
this.formRef.current.setFieldsValue({
storeName: storeName,
});
this.setState({
storeName,
auditSwitch,
logo,
});
});
};
onChangeFiledValue = (filed, value) => {
console.log(filed, value)
this.setState({
[filed]: value,
});
......@@ -83,7 +85,8 @@ class CollegeInfoPage extends React.Component {
};
updateInfo = () => {
const { storeName, logo } = this.state;
const { storeName, logo, auditSwitch
} = this.state;
if (!storeName) {
message.warning('请输入学院名称');
return;
......@@ -92,6 +95,8 @@ class CollegeInfoPage extends React.Component {
storeName,
logo,
storeId: User.getStoreId(),
auditSwitch
};
StoreService.updateStoreMessage(params).then((res) => {
User.setStoreName(storeName);
......@@ -147,7 +152,7 @@ class CollegeInfoPage extends React.Component {
<div className='title mt40'>高级设置</div>
<Form.Item label='学员审核' name='storeName' rules={[{ required: true }]}>
<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>
<When condition={auditSwitch}>
<div className='switch-desc'>已开启,成为学院学员需要审核</div>
......
......@@ -35,6 +35,7 @@ function UserManagePage(props:any) {
const { match } = props;
const [userList, setUserList] = useState([]);
const [model, setModel] = useState<React.ReactNode>(null);
const [auditSwitch,setAuditSwitch] = useState('No')
const [query, setQuery] = useState({
current: 0,
size: 10,
......@@ -64,9 +65,24 @@ function UserManagePage(props:any) {
StoreService.getUserList(_query).then((res: any) => {
setRealTotal(res.result.total);
});
const params= {
storeId:User.getStoreId()
}
StoreService.getStoreDetail(params).then((res) => {
const { result = { } } = res;
const {
auditSwitch
} = result;
setAuditSwitch(auditSwitch)
})
}, [])
useEffect(()=>{
},[])
useEffect(() => {
getUserList();
}, [query]);
......@@ -141,12 +157,19 @@ function UserManagePage(props:any) {
<div className=" page user-manage-page">
<div className="content-header">
<div>学员管理</div>
<div className='wechat-audit' onClick={()=>{
window.RCHistory.push({
pathname: `${match.url}/wechat-user-audit`,
});
}} ><span className='icon iconfont icon-font-weixin'>&#xe8e0;</span><span className='content-header-right'>学员审核列表</span></div>
<If condition={auditSwitch === 'OPEN'}>
<div className='wechat-audit' onClick={()=>{
window.RCHistory.push({
pathname: `${match.url}/wechat-user-audit`,
});
}} >
<span className='icon iconfont icon-font-weixin'>&#xe8e0;</span>
<span className='content-header-right'>学员审核列表</span>
</div>
</If>
</div>
<div className="box">
<div className="box-header">
<div className="header-item">
......
......@@ -3,7 +3,7 @@ import Breadcrumbs from '@/components/Breadcrumbs';
import WechatUserAuditFilter from './WechatUserAuditFilter';
import WechatUserAuditOpt from './WechatUserAuditOpt'
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 './WechatUserAudit.less';
......@@ -13,7 +13,7 @@ const WechatUserAudit = function () {
const [query, setQuery] = useState({
current: 1,
size: 10,
type: 'b'
applyStatus: 'WAIT' //PASSED, WAIT, REJECTED
});
useEffect(() => {
......@@ -23,10 +23,10 @@ const WechatUserAudit = function () {
const params = {
...query,
..._query,
storeUserId: User.getStoreUserId(),
storeId: User.getStoreId(),
};
PlanService.getTrainingPlanPage(params).then((res) => {
StoreService.getCustomerAuditList(params).then((res) => {
const {
result: { records = [], total },
} = res;
......@@ -51,7 +51,7 @@ const WechatUserAudit = function () {
<Breadcrumbs navList='学员审核列表' />
<div className='box'>
<WechatUserAuditFilter onChange={queryChange} />
<WechatUserAuditOpt onChange = {queryChange} defaultType={query.type}/>
<WechatUserAuditOpt onChange = {queryChange} defaultType={query.applyStatus}/>
<WechatUserAuditList listData={listData} query={query} totalCount={totalCount} onChange={queryChange} />
</div>
</div>
......
import React from 'react';
import { message, Badge } from 'antd';
import { PageControl, XMTable } from '@/components';
// 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) {
const {listData , totalCount, query,onChange=()=>{}} =props
const { listData, totalCount, query, onChange = () => {} } = props;
function parseColumns() {
const columns = [
{
title: '微信名称',
key: 'planName',
dataIndex: 'planName',
width: '14%',
key: 'nickName',
dataIndex: 'nickName',
width: '12%',
fixed: 'left',
render: (val, record) => {
return (
<div className='wechat-user-audit-name'>{val}</div>
)
return <div className='wechat-user-audit-name'>{val}</div>;
},
},
{
title: '真实姓名',
key: 'createName',
dataIndex: 'createName',
width: '10%',
key: 'realName',
dataIndex: 'realName',
width: '12%',
render: (val) => {
return <div className='create-name'>{val}</div>;
},
......@@ -37,8 +35,8 @@ function WechatUserAuditList(props) {
{
title: '申请时间',
width: '12.5%',
key: 'created',
dataIndex: 'created',
key: 'applyDate',
dataIndex: 'applyDate',
render: (val) => {
return <span style={{ whiteSpace: 'nowrap' }}>{window.formatDate('YYYY-MM-DD H:i', val)}</span>;
},
......@@ -46,19 +44,33 @@ function WechatUserAuditList(props) {
{
title: '审批状态',
width: '10%',
key: 'updated',
dataIndex: 'updated',
key: 'applyStatus',
dataIndex: 'applyStatus',
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: '审核人',
width: '10%',
key: 'cultureCustomerNum',
dataIndex: 'cultureCustomerNum',
key: 'reviewer',
dataIndex: 'reviewer',
render: (val) => {
return <div className='join-number'>{val}</div>;
return <div>{val}</div>;
},
},
{
......@@ -69,27 +81,47 @@ function WechatUserAuditList(props) {
width: '14.5%',
render: (val, record) => {
return (
<div className='operate'>
<div className='operate__item' onClick={() => toLearningDataPage(record)}>
通过
</div>
<span className='operate__item split'> | </span>
<div className='operate__item' onClick={() => toLearningDataPage(record)}>
拒绝
</div>
</div>
<Choose>
<When condition={record.applyStatus === 'WAIT'}>
<div className='operate'>
<div className='operate__item' onClick={() => audit(record, true)}>
通过
</div>
<span className='operate__item split'> | </span>
<div className='operate__item' onClick={() => audit(record, false)}>
拒绝
</div>
</div>
</When>
<Otherwise>
<div className='operate'>
<div></div>
</div>
</Otherwise>
</Choose>
);
},
},
];
return columns;
}
function toLearningDataPage(record){
console.log(record)
function audit(record, isTrue) {
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) {
if (current === size) {
return;
......@@ -107,7 +139,6 @@ function WechatUserAuditList(props) {
dataSource={listData}
columns={parseColumns()}
pagination={false}
bordered
size='middle'
scroll={{ x: 1400 }}
......@@ -132,4 +163,4 @@ function WechatUserAuditList(props) {
);
}
export default WechatUserAuditList
export default WechatUserAuditList;
......@@ -63,5 +63,12 @@
.more-operate {
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 { Row, Radio } from 'antd';
const WechatUserAuditOpt = function (props) {
const { onChange = () => {}, defaultType = 'a' } = props;
const { onChange = () => {}, defaultType = '' } = props;
return (
<div className='wechat-user-audit-filter'>
<Row type='flex' justify='end' align='top'>
<Radio.Group onChange={(e)=>onChange({type:e.target.value})} defaultValue={defaultType}>
<Radio.Button value='a'>全部</Radio.Button>
<Radio.Button value='b'>待审核</Radio.Button>
<Radio.Button value='c'>已通过</Radio.Button>
<Radio.Button value='d'>已拒绝</Radio.Button>
<Radio.Group onChange={(e)=>onChange({applyStatus:e.target.value})} defaultValue={defaultType}>
<Radio.Button value=''>全部</Radio.Button>
<Radio.Button value='WAIT'>待审核</Radio.Button>
<Radio.Button value='PASSED'>已通过</Radio.Button>
<Radio.Button value='REJECTED'>已拒绝</Radio.Button>
</Radio.Group>
</Row>
</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