Commit 3e30b0a7 by tangjiale

更新代码

parent a4e2e3c4
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</div> </div>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="update">修改密码</el-dropdown-item> <!-- <el-dropdown-item command="update">修改密码</el-dropdown-item> -->
<el-dropdown-item command="layout">退出</el-dropdown-item> <el-dropdown-item command="layout">退出</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
this.$service.base.getUserInfo(this.myUserInfo.token).then(result =>{ this.$service.base.getUserInfo(this.myUserInfo.token).then(result =>{
this.$store.commit('updateUserInfo', result); this.$store.commit('updateUserInfo', result);
setTimeout(() =>{ setTimeout(() =>{
location.href = '/' location.href = '/pxsys/'
},500) },500)
}) })
}) })
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
this.$refs['r-dialog'].change() this.$refs['r-dialog'].change()
break break
case 'layout': case 'layout':
this.$showConfirm("是否确认退出登录?").then(() => { this.$showConfirm("是否确认登录?").then(() => {
this.$store.commit("logout"); this.$store.commit("logout");
}); });
break break
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-02 15:02:39 * @Date: 2022-06-02 15:02:39
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-09 15:13:26 * @LastEditTime: 2022-06-09 17:23:26
--> -->
<template> <template>
<div> <div>
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
<el-form-item label="其它人手机号" prop="otherPhone"> <el-form-item label="其它人手机号" prop="otherPhone">
<el-input v-model="param.otherPhone" placeholder="请输入手机号" style="width:222px"></el-input> <el-input v-model="param.otherPhone" placeholder="请输入手机号" style="width:222px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所在校区" prop="schId"> <el-form-item label="所在校区" prop="schIds">
<t-select v-model="param.schId" :ds="{service:'base', func: 'getUserAllSchList'}"></t-select> <t-select v-model="param.schIds" :ds="{service:'base', func: 'getUserAllSchList'}"></t-select>
</el-form-item> </el-form-item>
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
fatherPhone:'', fatherPhone:'',
motherPhone:'', motherPhone:'',
otherPhone:'', otherPhone:'',
schId:'' schIds:''
}, },
rules:{ rules:{
...@@ -78,8 +78,8 @@ export default { ...@@ -78,8 +78,8 @@ export default {
}, },
queryDetail(id){ queryDetail(id){
this.$service.student.queryStudentDetail(id).then(res =>{ this.$service.student.queryStudentDetail(id).then(res =>{
let {id,name,birthday,gender,fatherPhone,motherPhone,otherPhone,schId} = res let {id,name,birthday,gender,fatherPhone,motherPhone,otherPhone,schIds} = res
this.param = {id,name,birthday,gender,fatherPhone,motherPhone,otherPhone,schId} this.param = {id,name,birthday,gender,fatherPhone,motherPhone,otherPhone,schIds}
}) })
}, },
onSubmit(){ onSubmit(){
......
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
<div class="import-tip" v-if="resultObj.message && resultObj.message.length"> <div class="import-tip" v-if="resultObj.message && resultObj.message.length">
<div class="import-tip-title flex-s"> <div class="import-tip-title flex-s">
<span>错误信息:</span> <span>错误信息:</span>
<div class="download-btn" v-if="resultObj.message && resultObj.message.length" @click="importErrorMsg">导出错误信息</div> <!-- <div class="download-btn" v-if="resultObj.message && resultObj.message.length" @click="importErrorMsg">导出错误信息</div> -->
</div> </div>
<div v-for="(t,idx) in resultObj.message" :key="idx">{{t.row}}{{t.errorInfoList.join(';')}}</div> <div v-for="(t,idx) in resultObj.message" :key="idx">{{t.lineNum}}{{t.errMsg}}</div>
</div> </div>
</div> </div>
<!-- 校验成功 --> <!-- 校验成功 -->
...@@ -139,9 +139,8 @@ export default { ...@@ -139,9 +139,8 @@ export default {
formData.append("file", this.file); formData.append("file", this.file);
this.$service.student.recordCheck(formData).then(res =>{ this.$service.student.recordCheck(formData).then(res =>{
let {success= 0 ,error = 0 ,message = []} = res let {rightNum= 0 ,errorNum = 0 ,checkVoList = []} = res
debugger this.resultObj = {success:rightNum,error:errorNum,message:checkVoList}
this.resultObj = {success,error,message}
this.step =2 this.step =2
}) })
}, },
...@@ -149,15 +148,17 @@ export default { ...@@ -149,15 +148,17 @@ export default {
importData(){ importData(){
let formData = new FormData(); let formData = new FormData();
formData.append("file", this.file); formData.append("file", this.file);
formData.append("taskId", this.activeObj.taskId);
const config = { const config = {
onUploadProgress: progressEvent => { onUploadProgress: progressEvent => {
debugger
// progressEvent.loaded:已上传文件大小 // progressEvent.loaded:已上传文件大小
// progressEvent.total:被上传文件的总大小 // progressEvent.total:被上传文件的总大小
this.progressPercent = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2)) this.progressPercent = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2))
} }
} }
this.$service.physiqueTester.downloadRecordImport(formData,config).then(res =>{
this.$service.student.downloadRecordImport(formData,config).then(res =>{
}) })
}, },
goNext(from){ goNext(from){
......
...@@ -3,74 +3,84 @@ ...@@ -3,74 +3,84 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-02 14:08:46 * @Date: 2022-06-02 14:08:46
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-06 09:31:15 * @LastEditTime: 2022-06-11 13:49:44
--> -->
<template> <template>
<div class="page-bg"> <div class="page-bg">
<!-- autoLoad -->
<t-table autoLoad ref="table" :options="options" :params="params" <t-table autoLoad ref="table" :options="options" :params="params"
@row-btn-click="onRowButtonClick"> @row-btn-click="onRowButtonClick">
<!-- 操作栏 --> <!-- 操作栏 -->
<template slot="form-order-search"> <template slot="form-order-search">
<div class="search-bottom"> <div class="search-bottom">
<el-button type="primary" size="mini" plain @click="exportOrder"><i class="el-icon-plus"></i> 新增课程</el-button> <el-button type="primary" size="mini" plain @click="addCourse"><i class="el-icon-plus"></i> 新增课程</el-button>
</div> </div>
</template> </template>
</t-table> </t-table>
<c-popup ref="c-popup" title="您正在新增课程信息"> <c-popup ref="c-popup" :title="title">
<add-course></add-course> <add-course ref="add-course" @update="updateList(),$refs['c-popup'].change()"></add-course>
</c-popup> </c-popup>
</div> </div>
</template> </template>
<script> <script>
import addCourse from './components/add-course.vue' import addCourse from './components/add-course.vue'
const courseStep = ['','小学组','初中组','高中组']
export default { export default {
services:['order','base'], services:['base','course'],
components:{addCourse}, components:{addCourse},
data(){ data(){
return{ return{
title:'',
params:{ params:{
regionCode:'',schName:''
}, },
options: { options: {
title: "订单管理", title: "课程管理",
search: [ search: [
{ {
label: '所属校区:',field: 'orderStatus', type: 'select',autoSelect:true,required:true, label: '所属校区:',field: 'orderStatus', type: 'select',autoSelect:true,required:true,
ds: [{name:'全部',value:''}, {name:'待发货',value:1}, {name:'已退货',value:2}, {name:'已收货',value:3}, {name:'已取消',value:4}, {name:'待收货',value:5}] ds: {service:'base',func:'getUserAllSchList',params:{all:true}}
},{ },{
label: '课程属性:', field: 'valid', type: 'select',autoSelect:true,required:true, label: '课程属性:', field: 'courseStep', type: 'select',autoSelect:true,required:true,
ds: [{name:'全部',value:''}, {name:'小学组',value:1}, {name:'初中组',value:0},{name:'高中组',value:0}] ds: [{name:'全部',value:''}, {name:'小学组',value:1}, {name:'初中组',value:2},{name:'高中组',value:3}]
},{ },{
label: '课程类型:', field: 'valid', type: 'select',autoSelect:true,required:true, label: '课程类型:', field: 'valid', type: 'select',autoSelect:true,required:true,
ds: [{name:'全部',value:''}, {name:'体验课',value:1}, {name:'正式班课',value:0}] ds: [{name:'全部',value:''}, {name:'体验课',value:1}, {name:'正式班课',value:0}]
},{ },{
label: '课程状态:', field: 'valid', type: 'select',autoSelect:true,required:true, label: '课程状态:', field: 'status', type: 'select',autoSelect:true,required:true,
ds: [{name:'全部',value:''}, {name:'已发布',value:1}, {name:'未发布',value:0}] ds: [{name:'全部',value:''}, {name:'已发布',value:1}, {name:'未发布',value:0}]
},{ },{
placeholder: "请输入课程名称 ",field: "productName",type: "text",label: "课程名称:", placeholder: "请输入课程名称 ",field: "name",type: "text",label: "课程名称:",
}, },
], ],
table: { table: {
service: "order", height:(screen.height - (482 * this.$px2rem)), service: "course", height:(screen.height - (482 * this.$px2rem)),
func: "getOrderPcList", func: "queryCourseList",
selectable: false,customRow:true, selectable: false,customRow:true,
columns: [ columns: [
{title: "课程名单",field: "orderNo"}, {title: "课程名称",field: "name"},
{title: "所属小区",field: "orderNo"}, {title: "所属小区",field: "schNames"},
{title: "课程属性",field: "orderNo"}, {
{ title: "课程属性",type: 'customField',width:'140px',
title: "课时",width:'100px', fieldFunction: row => courseStep[row.courseStep],
},{
title: "课时",width:'140px',
type: 'customField', type: 'customField',
fieldFunction: row => 4 + '课时', fieldFunction: row => row.classHour + '课时',
},{
title: "课程价格", type: 'customField',width:'140px',
fieldFunction: row => (row.cost / 100),
},{
title: "课程类型", type: 'customField',width:'140px',
fieldFunction: row => row.type == 0 ?'体验课' : '正式课',
}, },
{title: "课程价格",field: "orderNo"},
{title: "课程类型",field: "orderNo"},
{ {
title: "操作", title: "操作",
width: "220px",fixed:'right', width: "260px",fixed:'right',
type: "buttons", type: "buttons",
//orderType 1:智慧体育订单 2移动活动订单 3腾讯同步订单 4 h5天天订单 //orderType 1:智慧体育订单 2移动活动订单 3腾讯同步订单 4 h5天天订单
buttons: [ buttons: [
...@@ -78,12 +88,13 @@ export default { ...@@ -78,12 +88,13 @@ export default {
name: "修改", event: "emit" ,type:'primary' name: "修改", event: "emit" ,type:'primary'
},{ },{
name: "发布", type:'success',event: "publish", name: "发布", type:'success',event: "publish",
controlBtn:function(data){ return true} controlBtn:function(data){ return data.status == 0}
},{ },{
name: "取消发布", type:'success',event: "publish", name: "取消发布", type:'success',event: "publish",
controlBtn:function(data){ return data.orderStatus == 3 && (data.orderType == 1 || data.orderType == 4)} controlBtn:function(data){ return data.status == 1}
}, { }, {
name: "删除", event: "delete" ,type:'danger' name: "删除", event: "delete" ,type:'danger',
controlBtn:function(data){ return data.status == 0 && data.canDel == 1}
} }
], ],
}, },
...@@ -93,20 +104,49 @@ export default { ...@@ -93,20 +104,49 @@ export default {
} }
}, },
mounted(){ mounted(){
this.$refs['c-popup'].change() // this.$refs['c-popup'].change()
}, },
methods:{ methods:{
onRowButtonClick(data, i) { onRowButtonClick(data, i) {
let self = this let that = this
let {event,row} = data let {event,row} = data
if(!event) return if(!event) return
switch (event) { switch (event) {
case 'emit': //修改 case 'emit': //修改
break that.title = '您正在编辑课程信息'
that.$refs['c-popup'].change()
setTimeout(() =>{
that.$refs['add-course'].queryDetail(row.id)
},100)
break
case 'publish': //发布 取消发布
that.$service.course.publishCourse({
id:row.id,status:row.status == 0 ? 1 : 0
}).then(res =>{
that.$notifySuccess()
setTimeout(() =>{
that.updateList()
},800)
})
break
case 'delete': //删除
that.$showConfirm().then(res => {
that.$service.course.deleteCourse(row.id).then(()=>{
that.$notifySuccess()
setTimeout(() =>{
that.updateList()
},800)
})
})
break
} }
}, },
exportOrder(){ addCourse(){
this.title = '您正在新增课程信息'
this.$refs['c-popup'].change()
},
updateList(){
this.$refs['table'].reload(true)
} }
} }
} }
......
...@@ -70,8 +70,6 @@ ...@@ -70,8 +70,6 @@
inputCode: this.inputCode, inputCode: this.inputCode,
}).then(res =>{ }).then(res =>{
this.$service.base.getUserInfo(res.token).then(result =>{ this.$service.base.getUserInfo(res.token).then(result =>{
debugger
result.token = res.token result.token = res.token
this.$store.commit('updateUserInfo', result); this.$store.commit('updateUserInfo', result);
this.$router.push('/'); this.$router.push('/');
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-02 14:08:46 * @Date: 2022-06-02 14:08:46
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-09 15:22:07 * @LastEditTime: 2022-06-10 14:04:54
--> -->
<template> <template>
<div class="page-bg"> <div class="page-bg">
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
@row-btn-click="onRowButtonClick"> @row-btn-click="onRowButtonClick">
<!-- 操作栏 --> <!-- 操作栏 -->
<template slot="form-order-search"> <template slot="form-order-search" v-if="!([1,2].includes(myUserInfo.roleId))">
<div class="search-bottom"> <div class="search-bottom">
<el-button type="primary" size="mini" plain @click="handleOption('add')"><i class="el-icon-plus"></i> 新增学生</el-button> <el-button type="primary" size="mini" plain @click="handleOption('add')"><i class="el-icon-plus"></i> 新增学生</el-button>
<el-button type="primary" size="mini" plain @click="handleOption('import')"><i class="el-icon-upload2"></i> 导入学生</el-button> <el-button type="primary" size="mini" plain @click="handleOption('import')"><i class="el-icon-upload2"></i> 导入学生</el-button>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<!-- 导入学生 --> <!-- 导入学生 -->
<c-popup ref="i-popup" title="您正在导入学生数据"> <c-popup ref="i-popup" title="您正在导入学生数据">
<import-student @close="$refs['i-popup'].change()" @updateData="init()"></import-student> <import-student @close="$refs['i-popup'].change()" @updateData="updateList"></import-student>
</c-popup> </c-popup>
</div> </div>
</template> </template>
......
...@@ -141,7 +141,6 @@ export default class Service { ...@@ -141,7 +141,6 @@ export default class Service {
} }
return promise; return promise;
}; };
return _sendTo(options); return _sendTo(options);
} }
......
/*
* @Author: tangjiale
* @eMail: 932055106@qq.com
* @Date: 2022-06-11 14:08:04
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-11 14:13:27
*/
/**
* http基础类
*/
import axios from 'axios'
import hooks from './framework/core/hook'
let config = require(`@/config/${process.env.ENV_CONFIG||'pro'}.config.json`);
export default {
async send(options) {
options = {
toastError: true,
...options
}
options.loadingText && hooks.callHook('showLoading', options.loadingText)
options.headers = {
'content-type': options.contentType,
...options.headers
}
//https域名
options.url = (options.url.indexOf('http://') === 0 || options.url.indexOf('https://') === 0) ? options.url : (config[options.domainKey || 'baseUrl'] + options.url);
if (options.downloadFile || options.playAudio) { // 下载文件
options.responseType = 'blob';
}
if (options.method === 'get') {
options.params = options.data;
} else {
if (options.contentType === 'application/x-www-form-urlencoded') {
let form = new FormData();
let keys = Object.keys(options.data);
keys.forEach(key => {
form.append(key, options.data[key]);
});
options.data = form;
}
}
await hooks.callHook('beforeHttp', options)
return axios(options).then(res => {
options.loadingText && hooks.callHook('hideLoading')
return hooks.callHook('resolveHttpSuccess', res, options)
}).catch(err => {
console.error('request error', err)
options.toastError && hooks.callHook('toastError', err.message || err.toString())
return hooks.callHook('catchHttpError', err, options)
})
},
get(options) {
options.method = 'get';
return this.send(options);
},
postJson(options) {
options.contentType = 'application/json';
return this.post(options);
},
postForm(options) {
options.contentType = 'application/x-www-form-urlencoded';
return this.post(options);
},
post(options) {
options.method = 'post';
return this.send(options);
},
put(options) {
options.method = 'put';
return this.send(options);
},
delete(options) {
options.method = 'delete';
return this.send(options);
}
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-02-11 10:04:50 * @Date: 2022-02-11 10:04:50
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-09 11:18:12 * @LastEditTime: 2022-06-10 17:19:11
*/ */
export default class BaseService extends Service { export default class BaseService extends Service {
...@@ -66,12 +66,15 @@ export default class BaseService extends Service { ...@@ -66,12 +66,15 @@ export default class BaseService extends Service {
} }
//获取用户学校列表 //获取用户学校列表
getUserAllSchList(){ getUserAllSchList(param = {}){
return this.get({ return this.get({
url: '/user/getSchList', url: '/user/getSchList',
data:{} data:{}
}).then(res =>{ }).then(res =>{
let list = [] let list = []
if(param.all){
list.unshift({name:'全部',value:''})
}
if(res && res.length){ if(res && res.length){
res.forEach(v =>{ res.forEach(v =>{
list.push({ list.push({
...@@ -93,6 +96,33 @@ export default class BaseService extends Service { ...@@ -93,6 +96,33 @@ export default class BaseService extends Service {
data: param data: param
}) })
} }
//图片上传
upLoadImage(param){
return this.post({
url:'/common/image',
data: param
})
}
//获取机构职位员工
getSchEmpList(param){
return this.get({
url:'/common/getSchEmpList',
data: param
}).then(res =>{
let list = []
res && res.length && res.forEach(e =>{
list.push({
name:e.empName,
value:e.id,
empCode:e.empCode,
empPosition:e.empPosition
})
})
return list
})
}
} }
...@@ -3,19 +3,55 @@ ...@@ -3,19 +3,55 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-02-11 09:23:35 * @Date: 2022-02-11 09:23:35
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-09 11:30:08 * @LastEditTime: 2022-06-10 17:56:54
*/ */
import service from '../plugins/framework/core/service'
export default class CourseService extends Service { export default class CourseService extends Service {
queryStudentList(param){ queryCourseList(param){
return service.get({ return this.get({
url: '/student', url: '/course',
data: param
})
}
//新增课程
addCourse(param){
return this.post({
url: '/course',
data: param
})
}
//发布课程
publishCourse(param){
return this.get({
url: '/course/publishCourse',
data: param data: param
}) })
} }
//删除课程
deleteCourse(id){
return this.delete({
url: `/course/${id}`,
data: {}
})
}
//编辑课程
emitCourse(param){
return this.put({
url: `/course`,
data: param
})
}
queryCourseDetail(id){
return this.get({
url: `/course/${id}`,
data: {}
})
}
} }
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-02-11 09:23:35 * @Date: 2022-02-11 09:23:35
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-09 15:12:00 * @LastEditTime: 2022-06-11 14:08:51
*/ */
import services from '../plugins/service'
export default class StudentService extends Service { export default class StudentService extends Service {
queryStudentList(param){ queryStudentList(param){
...@@ -65,5 +65,15 @@ export default class StudentService extends Service { ...@@ -65,5 +65,15 @@ export default class StudentService extends Service {
data: param data: param
}) })
} }
//学生导入
downloadRecordImport(param,config = {}){
return services.post({
url: '/student/studentImport',
data: param,
progress:true,
...config
})
}
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-02-11 15:54:33 * @Date: 2022-02-11 15:54:33
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-09 11:03:11 * @LastEditTime: 2022-06-10 11:28:53
*/ */
import Vue from 'vue' import Vue from 'vue'
//配置对象 //配置对象
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
logout(state) { logout(state) {
state.myUserInfo = null; state.myUserInfo = null;
sessionStorage.removeItem('myUserInfo'); sessionStorage.removeItem('myUserInfo');
location.href = '/login'; location.href = '/pxsys/login';
}, },
//更新理由 //更新理由
updateRoute(state,list){ updateRoute(state,list){
......
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