Commit 9f132cf5 authored by baixian's avatar baixian

ERP新增需求完成

parent 354b19fb
......@@ -18,5 +18,5 @@
</head>
<body>
<div id="root"></div>
<script type="text/javascript" src="/dist/main.857db3.js"></script></body>
<script type="text/javascript" src="/dist/main.7a5d06.js"></script></body>
</html>
\ No newline at end of file
......@@ -181,6 +181,7 @@ export default {
edit_unlock_subject: `${dakaapi}member/unlock_subject/update`,
unlockSubjectDetail: `${dakaapi}member/unlock_subject/detail`,
unlockAddSubjectCount: `${dakaapi}member/unlock_subject/add_subject_count`,
unlock_student_export: `${dakaapi}member/erp/student/unlock_student_export`,
},
getschooluuid: `${dakaapi}member/school_uuid`,
analyzeCenter: {
......
......@@ -20,6 +20,7 @@ import * as uploader from '../services/uploader';
import { calendar } from '../utils/calendar';
import * as goodsAjax from '../services/integral';
import * as commonAjax from '../services/common';
import exportExcel from '../utils/exportexcel';
export default {
namespace: 'createtheme',
state: {
......@@ -158,7 +159,7 @@ export default {
},
],
sign_up_content: '',
ad_banner: '',
ad_banner: 'https://cdn.img.shangjiadao.cn/qingxiao/daka/images/2c/morethemeindex/adbanner.png',
jump_type: 1,
},
radioname: '',
......@@ -513,14 +514,14 @@ export default {
push_status: emigratedDate.data.push_status,
push_time: emigratedDate.data.push_time,
sign_up_status: emigratedDate.data.sign_up_status,
banner: emigratedDate.data.banner ? emigratedDate.data.banner : '',
banner: emigratedDate.data.banner ? emigratedDate.data.banner : 'https://cdn.img.shangjiadao.cn/qingxiao/daka/images/2c/sharemoretheme/newunlockbg.png',
content: emigratedDate.data.introduce && emigratedDate.data.introduce != null && JSON.parse(emigratedDate.data.introduce) && JSON.parse(emigratedDate.data.introduce)[0] && JSON.parse(emigratedDate.data.introduce)[0].content ? JSON.parse(emigratedDate.data.introduce) : [
{
title: emigratedDate.data.introduce && emigratedDate.data.introduce != null && JSON.parse(emigratedDate.data.introduce).title ? JSON.parse(emigratedDate.data.introduce).title : '',
content: emigratedDate.data.introduce && emigratedDate.data.introduce != null && JSON.parse(emigratedDate.data.introduce).content ? JSON.parse(emigratedDate.data.introduce).content : (JSON.parse(emigratedDate.data.introduce) || []),
},
],
ad_banner: emigratedDate.data.ad_banner,
ad_banner: emigratedDate.data.ad_banner ? emigratedDate.data.ad_banner : 'https://cdn.img.shangjiadao.cn/qingxiao/daka/images/2c/morethemeindex/adbanner.png',
jump_type: emigratedDate.data.jump_type,
},
radioname: emigratedDate.data.sign_up_content ? JSON.parse(emigratedDate.data.sign_up_content).radioname : '',
......@@ -1533,7 +1534,7 @@ export default {
},
],
sign_up_content: '',
ad_banner: '',
ad_banner: 'https://cdn.img.shangjiadao.cn/qingxiao/daka/images/2c/morethemeindex/adbanner.png',
jump_type: 1,
},
radioList: [],
......@@ -2203,6 +2204,31 @@ export default {
});
}
},
// 闯关学员导出 UnlockStudentExport
* exportStudentExcel({ payload }, { call, put, select }) {
const { columns } = payload;
const { emigratedObj } = yield select(state => state.createtheme);
const loading = message.loading('导出数据中...', 1);
const data = yield call(themeAjax.UnlockStudentExport, {
mode_id: emigratedObj.id,
});
setTimeout(loading);
if (data.code == 200) {
const list = (data.data && data.data.list) || [];
if (list.length > 0) {
exportExcel(columns, list, '闯关打卡学员列表.xlsx', 'unlockStudent');
} else {
message.error('暂时没有数据可以导出!', 0.5);
}
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data,
},
});
}
},
* pageInit({ payload }, { call, put, select }) {
yield put({
type: 'updateState',
......@@ -2342,7 +2368,7 @@ export default {
},
],
sign_up_content: '',
ad_banner: '',
ad_banner: 'https://cdn.img.shangjiadao.cn/qingxiao/daka/images/2c/morethemeindex/adbanner.png',
jump_type: 1,
},
radioname: '',
......
......@@ -274,10 +274,13 @@ export default {
themeSortLoading,
courseList,
} = yield select(state => state.officialtheme);
if (courseList.length === 0) {
message.error('请先添加课程之后在进行排序', 0.5);
return;
}
if (themeSortLoading) {
return;
}
console.log(JSON.stringify(courseList), 'JSON.stringify(courseList)');
yield put({
type: 'updateState',
payload: {
......@@ -314,20 +317,18 @@ export default {
const { index, direction } = payload;
const { courseList } = yield select(state => state.officialtheme);
const newContent = [];
console.log(index, 'index');
console.log(direction, 'direction');
const currentImg = courseList[index];
const preImg = courseList[index - 1];
const afterImg = courseList[index + 1];
if (direction == 'up') {
courseList.splice(index - 1, 2, currentImg, preImg);
} else if (direction == 'down') {
courseList.splice(index, 2, afterImg, currentImg);
}
// eslint-disable-next-line array-callback-return
courseList.map(((item, tp) => {
newContent.push(Object.assign(item, { sort: tp + 1 }));
}));
const currentImg = newContent[index];
const preImg = newContent[index - 1];
const afterImg = newContent[index + 1];
if (direction == 'up') {
newContent.splice(index - 1, 2, currentImg, preImg);
} else if (direction == 'down') {
newContent.splice(index, 2, afterImg, currentImg);
}
yield put({
type: 'updateState',
payload: {
......
......@@ -121,7 +121,6 @@ class SuccessStoreForm extends React.Component {
}
delete = (record) => {
const { dispatch } = this.props;
console.log(record, 'record');
if (record.sort === 1) {
message.error('第一关不能删除!', 0.5);
return;
......@@ -150,6 +149,15 @@ class SuccessStoreForm extends React.Component {
},
});
}
exportExcelStudent = (columns) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/exportStudentExcel',
payload: {
columns,
},
});
}
render() {
const {
form: { getFieldDecorator, getFieldValue },
......@@ -160,7 +168,6 @@ class SuccessStoreForm extends React.Component {
previewQrcode,
downloadTitle,
} = this.props;
console.log(emigratedObj, 'emigratedObj');
const columns = [
{
title: '关卡名称',
......@@ -219,6 +226,78 @@ class SuccessStoreForm extends React.Component {
},
},
];
const exportColumns = [
{
title: '微信昵称',
dataIndex: 'wechat_user',
key: 'wechat_user',
render: (text, record) => {
return (
<span>{ record.wechat_user && record.wechat_user.nickname ? record.wechat_user.nickname : '-' }</span>
);
},
},
{
title: '闯关数',
dataIndex: 'unlock_count',
key: 'unlock_count',
},
{
title: '被点评',
dataIndex: 'review_count',
key: 'review_count',
},
{
title: '老师评分总分',
dataIndex: 'review_score',
key: 'review_score',
},
{
title: '被点赞',
dataIndex: 'passive_like_count',
key: 'passive_like_count',
},
{
title: '精选数量',
dataIndex: 'place_top_at_count',
key: 'place_top_at_count',
},
{
title: '带来访客',
dataIndex: 'total_share_uv',
key: 'total_share_uv',
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
render: (text, record) => {
return (
<span>{ record.infoCollection && record.infoCollection.name ? record.infoCollection.name : '-' }</span>
);
},
},
{
title: '手机号',
dataIndex: 'mobile',
key: 'mobile',
render: (text, record) => {
return (
<span>{ record.infoCollection && record.infoCollection.mobile ? record.infoCollection.mobile : '-' }</span>
);
},
},
{
title: '信息收集',
dataIndex: 'value',
key: 'value',
render: (text, record) => {
return (
<span>{ record.infoCollection && record.infoCollection.content ? JSON.parse(record.infoCollection.content).value : '-' }</span>
);
},
},
];
return (
<div className={pageStyle.container}>
......@@ -231,6 +310,8 @@ class SuccessStoreForm extends React.Component {
</div>
</div>
<div>
<span className="hreflink" onClick={() => this.exportExcelStudent(exportColumns)}>导出学员</span>
<Divider type="vertical" />
<span className="hreflink" onClick={() => this.handleRemark(emigratedObj)}>点评作业</span>
<Divider type="vertical" />
<span className="hreflink" onClick={() => this.editStore(emigratedObj.id)}>编辑</span>
......
......@@ -193,7 +193,9 @@ class Officialweb extends React.Component {
<Button type="primary" onClick={this.editor} className={pageStyle.editBtn}>装修主页</Button>
</BtnPermission>
}
<Button type="primary" onClick={this.editThemeClass} className={pageStyle.editBtn} style={{ marginLeft: 30 }}>装修主题课</Button>
<BtnPermission btnId="80001">
<Button type="primary" onClick={this.editThemeClass} className={pageStyle.editBtn} style={{ marginLeft: 30 }}>装修主题课</Button>
</BtnPermission>
<div className={pageStyle.websiteeditdesc}>
左图是您微官网当前的预览效果。
<br />
......
......@@ -184,7 +184,6 @@ class ThemeClassForm extends React.Component {
themeListParams,
themeSortLoading,
} = this.props;
console.log(courseList, 'courseList');
return (
<div className={pageStyle.container}>
<div className={pageStyle.topHead}>
......
......@@ -109,3 +109,11 @@ export function unlockDelete(params) {
data,
});
}
export function UnlockStudentExport(params) {
const data = qs.stringify(params);
return request({
url: `${api.createtheme.unlock_student_export}?${data}`,
method: 'GET',
data,
});
}
......@@ -36,6 +36,23 @@ function exportExcel(headers, data, fileName = 'XXX.xlsx', type) {
};
});
break;
case 'unlockStudent':
// eslint-disable-next-line array-callback-return
thisdata = data.map((item) => {
return {
wechat_user: item.wechat_user && item.wechat_user.nickname ? item.wechat_user.nickname : '',
unlock_count: item.unlock_count ? item.unlock_count : '-',
review_count: item.review_count,
review_score: item.review_score,
passive_like_count: item.passive_like_count,
place_top_at_count: item.place_top_at_count,
total_share_uv: item.total_share_uv,
name: item.infoCollection && item.infoCollection.name ? item.infoCollection.name : '',
mobile: item.infoCollection && item.infoCollection.mobile ? item.infoCollection.mobile : '',
value: item.infoCollection && item.infoCollection.content ? JSON.parse(item.infoCollection.content).value : '',
};
});
break;
default:
thisdata = data;
break;
......
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