main
hcj 3 months ago
parent ed5c395643
commit 4b1c07088e
  1. BIN
      admin_prod.zip
  2. BIN
      admin_test.zip
  3. 3
      package.json
  4. 341
      src/api/trainService/index.js
  5. 81
      src/components/buttonUpload/index.vue
  6. 0
      src/components/formatForm/drective.js
  7. 38
      src/components/formatForm/formOptions.vue
  8. 15
      src/components/formatForm/formResult.vue
  9. 119
      src/components/formatForm/formSource.vue
  10. 78
      src/components/formatForm/index.vue
  11. 27
      src/components/formatForm/indexX.vue
  12. 0
      src/components/formatForm/parseFrom.js
  13. 6
      src/components/formatForm/style.scss
  14. 80
      src/components/formatForm/template.js
  15. 42
      src/components/formatForm/testData.js
  16. 24
      src/components/importCourse/index.vue
  17. 2
      src/layout/components/Sidebar/Logo.vue
  18. 361
      src/router/index.js
  19. 2
      src/settings.js
  20. 1
      src/store/getters.js
  21. 7
      src/store/modules/user.js
  22. 157
      src/utils/request.js
  23. 18
      src/views/components/ToolEdit.vue
  24. 2
      src/views/login.vue
  25. 135
      src/views/manage/order/list.vue
  26. 1
      src/views/manage/tool/list.vue
  27. 2
      src/views/phonelogin.vue
  28. 303
      src/views/system/user/index.vue
  29. 28
      src/views/testModule/index.vue
  30. 197
      src/views/trainService/courseManage.vue
  31. 222
      src/views/trainService/importCourse.vue
  32. 68
      src/views/trainService/learnStudent.vue
  33. 4
      src/views/trainService/signInInfoList.vue
  34. 179
      src/views/trainService/signlist.vue
  35. 501
      src/views/trainService/signlist_def.vue
  36. 414
      src/views/trainService/signupStudent.vue

Binary file not shown.

Binary file not shown.

@ -1,7 +1,7 @@
{
"name": "keysaas",
"version": "3.4.0",
"description": "关键测试云平台",
"description": "小关软测宝后台管理",
"author": "mihong",
"license": "MIT",
"scripts": {
@ -76,6 +76,7 @@
"vue-router": "3.4.9",
"vuedraggable": "2.24.3",
"vuex": "3.6.0",
"xlsx": "^0.18.5",
"xss": "^1.0.15"
},
"devDependencies": {

@ -1,328 +1,381 @@
import request from '@/utils/request'
import request from "@/utils/request";
export function getSchoolList(query) {
return request({
url: '/train/schoolList',
method: 'get',
url: "/train/schoolList",
method: "get",
params: query,
// headers: {
// isToken: false
// },
})
});
}
export function addSchool(data) {
return request({
url: '/train/school/add',
method: 'post',
url: "/train/school/add",
method: "post",
data,
})
});
}
export function updateSchool(data) {
return request({
url: '/train/school/update',
method: 'post',
url: "/train/school/update",
method: "post",
data,
})
});
}
export function delSchool(id) {
return request({
url: `/train/school/del/?schoolId=${id}`,
method: 'delete',
})
method: "delete",
});
}
export function getSignUpList(query) {
return request({
url: `/train/trainClassList`,
method: 'get',
method: "get",
params: query,
})
});
}
export function addSignUp(data) {
return request({
url: '/train/trainClass/add',
method: 'post',
url: "/train/trainClass/add",
method: "post",
data,
})
});
}
export function updateSignUp(data) {
return request({
url: '/train/trainClass/update',
method: 'post',
url: "/train/trainClass/update",
method: "post",
data,
})
});
}
export function delSignUp(id) {
return request({
url: `/train/trainClass/del?trainClassId=${id}`,
method: 'delete',
})
method: "delete",
});
}
// 查询已报名列表
export function searchNum(params) {
return request({
url: `/train/trainStudentList`,
method: 'get',
method: "get",
params,
})
});
}
// 人才库+教师
// 新增人才
export function listTalent(params) {
return request({
url: '/talent/admin/list',
method: 'get',
params
})
url: "/talent/admin/list",
method: "get",
params,
});
}
export function addTalent(data) {
return request({
url: '/talent/admin/add',
method: 'post',
url: "/talent/admin/add",
method: "post",
data,
})
});
}
// 修改人才
export function updateTalent(data) {
return request({
url: '/talent/admin/update',
method: 'post',
url: "/talent/admin/update",
method: "post",
data,
})
});
}
// 删除人才-删除教师
export function deleteTalent(id) {
return request({
url: '/talent/admin/' + id,
method: 'delete',
})
url: "/talent/admin/" + id,
method: "delete",
});
}
// 查看人才-教师详情
export function detailTalent(id) {
return request({
url: '/talent/admin/' + id,
method: 'get',
})
url: "/talent/admin/" + id,
method: "get",
});
}
export function listTeacher() {
return request({
url: '/talent/admin/teacherList',
method: 'get',
})
url: "/talent/admin/teacherList",
method: "get",
});
}
// 新增教师
export function addTeacher(data) {
return request({
url: '/talent/admin/teacher/add',
method: 'post',
url: "/talent/admin/teacher/add",
method: "post",
data,
})
});
}
// 修改教师
export function updateTeacher(data) {
return request({
url: '/talent/admin/teacher/update',
method: 'post',
url: "/talent/admin/teacher/update",
method: "post",
data,
})
});
}
// 下载模板
export function importTemplate() {
return request({
url: '/talent/admin/download',
method: 'get',
responseType: 'blob',
})
url: "/talent/admin/download",
method: "get",
responseType: "blob",
});
}
// 查询所有教师
export function listTeacherAll() {
return request({
url: '/talent/findAllTeacher',
method: 'get',
})
url: "/talent/findAllTeacher",
method: "get",
});
}
// 添加备注
export function addRemarkI(data) {
return request({
url: '/train/addRemark',
method: 'post',
url: "/train/addRemark",
method: "post",
data,
})
});
}
// 删除报名人
export function delSign(id) {
return request({
url: '/train/trainStuden/del?studentId=' + id,
method: 'delete',
})
url: "/train/trainStuden/del?studentId=" + id,
method: "delete",
});
}
// 师资班配置json
export function setJson(data) {
return request({
url: '/train/trainClass/editData',
method: 'post',
url: "/train/trainClass/editData",
method: "post",
data,
})
});
}
// 导出excel
export function exportExcelF(id) {
export function exportExcelF(id, params) {
return request({
url: '/train/importStudent/' + id,
method: 'get',
responseType: 'blob',
})
url: "/train/importStudent/" + id,
method: "get",
params,
responseType: "blob",
});
}
// 获取所有轮播图
export function getSwiperInfo() {
return request({
url: '/train/admin/banner/list',
method: 'get',
})
url: "/train/admin/banner/list",
method: "get",
});
}
// 提交轮播图
export function addSwiperInfo(data) {
return request({
url: 'train/admin/banner/add',
method: 'post',
data
})
url: "train/admin/banner/add",
method: "post",
data,
});
}
// 获取轮播图班级类型
export function getSwiperClass() {
return request({
url: '/train/admin/bannerTrainClasses',
method: 'get',
})
url: "/train/admin/bannerTrainClasses",
method: "get",
});
}
// 删除轮播图
export function delteSwiper(id) {
console.log(id);
return request({
url: '/train/admin/banner/' + id,
method: 'delete',
})
url: "/train/admin/banner/" + id,
method: "delete",
});
}
// 获取所有班级
export function getClassList() {
export function getClassList(params) {
return request({
url: '/train/admin/trainClasses',
method: 'get',
})
url: "/train/admin/trainClasses",
method: "get",
params,
});
}
// 获取所有课程
export function getCourseList(params) {
return request({
url: '/course/admin/findAll',
method: 'get',
params
})
url: "/course/admin/findAll",
method: "get",
params,
});
}
// 增加课程
export function addCourseItem(data) {
return request({
url: '/course/admin/add',
method: 'post',
data:JSON.stringify(data)
})
url: "/course/admin/add",
method: "post",
data: JSON.stringify(data),
});
}
// 修改课程
export function putCourseItem(data) {
return request({
url: '/course/admin/update',
method: 'post',
data
})
url: "/course/admin/update",
method: "post",
data,
});
}
// 删除课程
export function delCourse(id) {
return request({
url: '/course/admin/' + id,
method: 'delete',
})
url: "/course/admin/" + id,
method: "delete",
});
}
// 根据课程ID获取改课程下所有签到用户信息
export function getSigninInfo(id,params) {
export function getSigninInfo(id, params) {
return request({
url: '/course/admin/singin/' + id,
method: 'get',
params
})
url: "/course/admin/singin/" + id,
method: "get",
params,
});
}
// 删除签到信息
export function delSigninItem(id) {
return request({
url: '/course/admin/singin/' + id,
method: 'delete',
})
url: "/course/admin/singin/" + id,
method: "delete",
});
}
// 考勤删除
export function delAttendance(id) {
return request({
url: '/course/admin/singin/class/' + id,
method: 'delete',
})
url: "/course/admin/singin/class/" + id,
method: "delete",
});
}
// 获取考勤信息表
export function getAttendanceList(id) {
return request({
url: '/course/admin/singin/class/' + id,
method: 'get',
})
url: "/course/admin/singin/class/" + id,
method: "get",
});
}
// 导出考勤表
export function exportAttendance(id) {
return request({
url: '/course/admin/importSignIn/class/' + id,
method: 'get',
responseType: 'blob'
})
url: "/course/admin/importSignIn/class/" + id,
method: "get",
responseType: "blob",
});
}
// 导出所有签到信息
export function exportSignIn(id,params) {
console.log(params);
export function exportSignIn(id, params) {
return request({
url: "/course/admin/importSignIn/course/" + id,
method: "get",
params,
responseType: "blob",
});
}
// 获取收入管理信息
export function getInComeInfo(data) {
return request({
url: "/mpay/admin/record/course/payList",
method: "post",
data,
});
}
// 获取学习人次
export function getStudyRows(id, params) {
console.log(id);
return request({
url: "train/online/course/studyList/" + id,
method: "get",
params,
});
}
// 添加学生评价
export function addStuentEva(data) {
return request({
url: "train/admin/assessmen/add",
method: "post",
data,
});
}
// 删除学生评价
export function delStudentEva(id) {
return request({
url: '/course/admin/importSignIn/course/' + id,
method: 'get',
url: "train/admin/assessmen/" + id,
method: "delete",
});
}
// 获取学生评价列表
export function getStudentEva(id, params) {
console.log(id);
return request({
url: "train/admin/assessmen/list/" + id,
method: "get",
params,
responseType: 'blob'
})
}
});
}
// 导出评价信息
export function exportEva(data) {
return request({
url: "/train/admin/import/assement",
method: "post",
data,
responseType: "blob",
});
}
// 复制班级
export function copyClassInfo(id, nid) {
return request({
url: "/course/admin/class/copy/" + id + "/" + nid,
method: "get",
});
}
// 导出学习人次
export function expLearnNum(courseId) {
return request({
url: "/train/admin/import/studyList/" + courseId,
method: "get",
responseType: "blob",
});
}

@ -0,0 +1,81 @@
<template>
<el-upload class="upload-demo myupload" :action="action" :headers="headers" :on-preview="handlePreview"
:on-remove="handleRemove" :before-remove="beforeRemove" :on-success="successUpload" :limit="3"
:on-exceed="handleExceed" :before-upload="beforeAvatarUpload">
<slot></slot>
</el-upload>
</template>
<script>
import { mapGetters } from "vuex";
export default {
data() {
return {
action: '/',
name: ''
};
},
computed: {
...mapGetters(['token']),
headers() {
return { Authorization: "Bearer " + this.token };
},
},
methods: {
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
},
beforeRemove(file, fileList) {
// return this.$confirm(` ${file.name}`);
},
successUpload(response) {
console.log(response);
this.$emit('upload', response, this.name)
},
beforeAvatarUpload(file, fileList) {
this.name = file.name
const filetype = file.name.slice(file.name.lastIndexOf('.', file.name.length))
console.log(filetype);
const isType = ['.excel', '.xlsx'].some(item => { return item == filetype })
if (!isType) {
this.$message.error('只能上传excel文件!');
return false
}
this.parseExcel(file)
},
parseExcel(file) {
let reader = new FileReader()
let _this = this
reader.readAsArrayBuffer(file)
reader.onload = function () {
let buffer = reader.result
let bytes = new Uint8Array(buffer)
let length = bytes.byteLength
let binary = ''
for (let i = 0; i < length; i++) {
binary += String.fromCharCode(bytes[i])
}
let XLSX = require('xlsx')
let wb = XLSX.read(binary, {
type: 'binary'
})
let outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
console.log(outdata)
}
}
}
}
</script>
<style lang="scss">
.myupload .el-upload-list {
display: none;
}
</style>

@ -0,0 +1,38 @@
<template>
<div class="formOptionsWrap">
<div v-for="(form, fIndex) in optionsData" :key="fIndex">
<optionsItem :form="form"></optionsItem>
</div>
</div>
</template>
<script>
import Vue from 'vue';
Vue.component(
'optionsItem',
{
render: (createElement) => {
return createElement(
'div',
{},
'option123'
)
}
}
)
const optionsData = [
{},
{}
]
export default {
data() {
return {
optionsData
}
}
}
</script>
<style></style>

@ -0,0 +1,15 @@
<template>
<div class="formResultWrap"></div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
.formResultWrap{
border-left: 1px solid gray;
}
</style>

@ -0,0 +1,119 @@
<template>
<div class="sourceWrap">
<h3 class="sourceTitle">选择组件</h3>
<div v-for="(form, fIndex) in fomrmSourceList" :key="fIndex">
<div class="diyInpWrap">
<label>{{ form.label }}</label>
<diyInput :form="form"></diyInput>
</div>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import { fomrmSourceList } from './template'
Vue.component("diyInput", {
props: {
form: Object
},
render: function (createElement) {
if (this.form.tag == 'select') {
return createElement(
this.form.tag,
{
domProps: {
type: this.form.type
}
},
this.form.data.defalut.map(form => {
return createElement(
'option',
{},
form
)
})
)
}
else if ((this.form.type == 'radio') || (this.form.type == 'checkBox')) {
console.log(this.form);
return createElement(
'span', {}, this.form.data.defalut.map(form => {
console.log(form);
return createElement(
this.form.tag,
{
domProps: {
type: this.form.type,
}
},
form
)
})
)
} else if (this.form.tag == 'textarea') {
return createElement(
this.form.tag,
{
domProps: {
name: this.form.type,
cols: "20",
rows: "2",
placeholder: this.form.data.defalut
}
},
)
}
return createElement(
this.form.tag,
{
domProps: {
name: this.form.type,
cols: "50",
rows: "10",
placeholder: this.form.data.defalut
}
},
'test'
)
}
})
export default {
// components: { 'diy-input': diyInput },
data() {
return {
fomrmSourceList
}
},
renderInput() {
}
}
</script>
<style lang="scss" scoped>
.sourceWrap {
height: calc(100vh - 40px);
border-right: 1px solid gray;
text-align: center;
select,input,textarea{
width: 170px;
height: 25px;
}
.sourceTitle {
line-height: 40px;
margin: 0;
}
.diyInpWrap {
text-align: left;
margin: 0px 10px 20px 10px;
background-color: antiquewhite;
padding: 15px 10px;
cursor: move;
border-radius: 5px;
display: flex;
align-items: center;
}
}
</style>

@ -0,0 +1,78 @@
<script>
import { itemTemp, formItemTemp, formTemplate, propertyMap, formatForm } from './template.js'
import { testData } from './testData'
export default {
name: 'formatForm',
render: (h, params) => {
const formArray = testData
// form-Item form item,data
const Factory = (property) => {
//
const item = JSON.parse(JSON.stringify(itemTemp))
// console.log(item);
// formItem
const resultFormItem = JSON.parse(JSON.stringify(formItemTemp))
// data
const dataItem = {}
// 1
Object.keys(property).forEach(proKey => {
//
const targetKey = propertyMap[proKey]
const targetValue = property[proKey]
if (targetKey) {
if (proKey == 'type') {
item[proKey] = targetValue
item[targetKey] = 'input'
}
resultFormItem.children = [item]
}
// datadata{key:value}
else {
dataItem[proKey] = targetValue
formatForm.push(dataItem)
}
});
return { 'formItem': resultFormItem, itemForm: 'formatForm' }
}
// form
//
const itemResult = formArray.map((li) => {
const { formItem, itemForm } = Factory(li)
// data
formatForm.push(itemForm)
// form - Item
return formItem
})
formTemplate.children = itemResult
const resu = renderFactory(formTemplate)
// dom
function renderFactory(current) {
const tag = current.tag
const property = current.property
let childrend = current.children
if (current.children.length != 0) {
childrend = current.children.map(it => {
return renderFactory(it)
})
} else {
childrend = ''
}
return h(tag, property, childrend)
}
return resu
}
}
</script>
<style lang="scss" scoped>
@import url(./style.scss);
</style>

@ -0,0 +1,27 @@
<template>
<div class="diyWrap">
<formSource></formSource>
<formOptions></formOptions>
<formResult></formResult>
</div>
</template>
<script>
import formSource from '@/components/formatForm/formSource.vue'
import formResult from '@/components/formatForm/formResult.vue'
import formOptions from '@/components/formatForm/formOptions.vue'
export default {
components: {
formSource,
formResult,
formOptions
}
}
</script>
<style lang="scss" scoped>
.diyWrap{
display: grid;
grid-template-columns: 300px calc(100vw - 600px) 300px;
}
</style>

@ -0,0 +1,6 @@
.form-wrap{
background-color: antiquewhite;
.form-item{
background-color: aqua;
}
}

@ -0,0 +1,80 @@
export const lableWidth = "80px";
const propertyMap = {
// title: "label",
type: "tag",
key: "formKey",
value: "defaultValue",
};
const fomrmSourceList = [
{
type:'input',
tag:'input',
label:'输入框',
data:{defalut:'请输入文本'}
},
{
type:'radio',
label:'单选框',
tag:'input',
data:{defalut:['test1','test2']}
},
{
type:'checkBox',
tag:'input',
label:'多选框',
data:{defalut:['boxTest1','boxTest2','boxTest3']}
},
{
type:'select',
tag:'select',
label:'下拉框',
data:{defalut:['seTest1','seTest2','seTest3']}
},
{
tag:'textarea',
type:'textarea',
label:'文本框',
data:{defalut:'请输入文本'}
},
];
const optionsTemplate = fomrmSourceList
const formatForm = [];
const itemTemp = {
tag: "",
property: {},
text: "",
children: [],
};
const formItemTemp = {
tag: "div",
property: {
class: "el-form-item",
},
text: "",
children: [],
};
const formTemplate = {
tag: "div",
property: {
ref: "forMatform",
class: "form-wrap",
":model": `${formatForm}`,
"label-width": `${lableWidth}`,
},
text: "",
children: [],
};
export {
itemTemp,
formItemTemp,
formTemplate,
propertyMap,
formatForm,
fomrmSourceList,
optionsTemplate
};

@ -0,0 +1,42 @@
export const testData = [
{ name: "姓名", type: "input", key: "name", value: "" },
{ title: "在校职务", type: "input", key: "title", value: "" },
{ mobile: "手机号", type: "input", key: "mobile", value: "" },
{ college: "院校全称", type: "input", key: "college", value: "" },
{ address: "院校所在地址", type: "input", key: "address", value: "" },
{
payType: "培训付款方式",
type: "radio",
key: "payType",
value: [
"公对公转账,请于报到前提供截图",
"现场支付(公务卡、微信、支付宝、现金)",
],
},
{ sex: "性别", type: "radio", key: "sex", value: ["男", "女"] },
{
hotel: "是否需要统一安排住宿",
type: "radio",
key: "hotel",
value: [
"大床房(付房费全额)",
"标间(独立居住、付全额房费)",
"标间(拼房、付房费一半),无指定合住人员",
"标间(拼房、付房费一半),指定合住人员",
"其他,请说明,包括非指定日期的订房",
"无须订房,自行安排",
],
},
{
addWeixin: "是否添加业务负责人微信",
type: "radio",
key: "addWeixin",
value: ["是", "否"],
},
{
suggestion: "针对此次培训,您还有什么建议",
type: "textarea",
key: "suggestion",
value: "",
},
];

@ -0,0 +1,24 @@
<template>
<div>
<div class="importArea">
<el-select v-model="model" placeholder="请选择班级">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-upload action="">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</div>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

@ -35,7 +35,7 @@ export default {
},
data() {
return {
title: '关键测试云平台',
title: '小关软测宝后台管理',
logo: null
}
}

@ -1,11 +1,11 @@
import Vue from 'vue'
import Router from 'vue-router'
import Vue from "vue";
import Router from "vue-router";
Vue.use(Router)
Vue.use(Router);
/* Layout */
import Layout from '@/layout'
import ParentView from '@/components/ParentView';
import Layout from "@/layout";
import ParentView from "@/components/ParentView";
/**
* Note: 路由配置项
@ -28,264 +28,317 @@ import ParentView from '@/components/ParentView';
// 公共路由
export const constantRoutes = [
{
path: '/redirect',
path: "/redirect",
component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path(.*)',
component: (resolve) => require(['@/views/redirect'], resolve)
}
]
path: "/redirect/:path(.*)",
component: (resolve) => require(["@/views/redirect"], resolve),
},
],
},
{
path: '/login',
component: (resolve) => require(['@/views/tester_login'], resolve),
hidden: true
path: "/login",
component: (resolve) => require(["@/views/tester_login"], resolve),
hidden: true,
},
{
path: '/register',
component: (resolve) => require(['@/views/register'], resolve),
hidden: true
path: "/register",
component: (resolve) => require(["@/views/register"], resolve),
hidden: true,
},
{
path: '/retrieve',
component: (resolve) => require(['@/views/retrieve'], resolve),
hidden: true
path: "/retrieve",
component: (resolve) => require(["@/views/retrieve"], resolve),
hidden: true,
},
{
path: '/tl',
component: (resolve) => require(['@/views/tester_login'], resolve),
hidden: true
path: "/tl",
component: (resolve) => require(["@/views/tester_login"], resolve),
hidden: true,
},
{
path: '/404',
component: (resolve) => require(['@/views/error/404'], resolve),
hidden: true
path: "/404",
component: (resolve) => require(["@/views/error/404"], resolve),
hidden: true,
},
{
path: '/401',
component: (resolve) => require(['@/views/error/401'], resolve),
hidden: true
path: "/401",
component: (resolve) => require(["@/views/error/401"], resolve),
hidden: true,
},
{
path: '',
path: "",
component: Layout,
redirect: 'index',
redirect: "index",
children: [
{
path: 'index',
component: (resolve) => require(['@/views/index'], resolve),
name: '首页',
meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
}
]
path: "index",
component: (resolve) => require(["@/views/index"], resolve),
name: "首页",
meta: { title: "首页", icon: "dashboard", noCache: true, affix: true },
},
],
},
{
path: '/user',
path: "/user",
component: Layout,
hidden: true,
redirect: 'noredirect',
redirect: "noredirect",
children: [
{
path: 'profile',
component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
name: 'Profile',
meta: { title: '个人中心', icon: 'user' }
path: "profile",
component: (resolve) =>
require(["@/views/system/user/profile/index"], resolve),
name: "Profile",
meta: { title: "个人中心", icon: "user" },
},
{
path: "profile/:activeTab",
component: (resolve) =>
require(["@/views/system/user/profile/index"], resolve),
name: "Profile",
meta: { title: "个人中心", icon: "user" },
},
{
path: 'profile/:activeTab',
component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
name: 'Profile',
meta: { title: '个人中心', icon: 'user' }
path: "company",
component: (resolve) =>
require(["@/views/system/user/company/index"], resolve),
name: "company",
meta: { title: "企业认证", icon: "user" },
},
{
path: 'company',
component: (resolve) => require(['@/views/system/user/company/index'], resolve),
name: 'company',
meta: { title: '企业认证', icon: 'user' }
path: "p2pt",
component: (resolve) =>
require(["@/views/system/user/tester/p2pt"], resolve),
name: "tester",
meta: { title: "测试资质认证", icon: "user" },
},
{
path: 'p2pt',
component: (resolve) => require(['@/views/system/user/tester/p2pt'], resolve),
name: 'tester',
meta: { title: '测试资质认证', icon: 'user' }
path: "p2ct",
component: (resolve) =>
require(["@/views/system/user/tester/p2ct"], resolve),
name: "tester",
meta: { title: "测试资质认证", icon: "user" },
},
{
path: 'p2ct',
component: (resolve) => require(['@/views/system/user/tester/p2ct'], resolve),
name: 'tester',
meta: { title: '测试资质认证', icon: 'user' }
path: "c2ct",
component: (resolve) =>
require(["@/views/system/user/tester/c2ct"], resolve),
name: "tester",
meta: { title: "测试资质认证", icon: "user" },
},
{
path: 'c2ct',
component: (resolve) => require(['@/views/system/user/tester/c2ct'], resolve),
name: 'tester',
meta: { title: '测试资质认证', icon: 'user' }
path: "message",
component: (resolve) => require(["@/views/my/message"], resolve),
name: "MyMessage",
meta: { title: "我的消息", icon: "user" },
},
],
},
{
path: "/dict",
component: Layout,
hidden: true,
children: [
{
path: "type/data/:dictId(\\d+)",
component: (resolve) => require(["@/views/system/dict/data"], resolve),
name: "Data",
meta: { title: "字典数据", icon: "" },
},
],
},
{
path: "/course",
component: Layout,
hidden: true,
children: [
{
path: 'message',
component: (resolve) => require(['@/views/my/message'], resolve),
name: 'MyMessage',
meta: { title: '我的消息', icon: 'user' }
}
]
path: "learnNum",
component: (resolve) =>
require(["@/views/trainService/learnStudent"], resolve),
name: "signupStudent",
meta: { title: "学习人次", icon: "" },
},
],
},
{
path: '/dict',
path: "/course",
component: Layout,
hidden: true,
children: [
{
path: 'type/data/:dictId(\\d+)',
component: (resolve) => require(['@/views/system/dict/data'], resolve),
name: 'Data',
meta: { title: '字典数据', icon: '' }
}
]
path: "courseImport",
component: (resolve) =>
require(["@/views/trainService/importCourse"], resolve),
name: "importCourse",
meta: { title: "课程导入", icon: "" },
},
],
},
{
path: '/my',
path: "/my",
component: Layout,
hidden: true,
children: [
{
path: 'tool/detail/:id(\\d+)',
component: (resolve) => require(['@/views/mytools/detail'], resolve),
name: 'myToolDetail',
meta: { title: '我的工具详情', icon: '' }
}
]
path: "tool/detail/:id(\\d+)",
component: (resolve) => require(["@/views/mytools/detail"], resolve),
name: "myToolDetail",
meta: { title: "我的工具详情", icon: "" },
},
],
},
{
path: '/test',
path: "/test",
component: Layout,
hidden: true,
children: [
{
path: 'tool/detail/:id(\\d+)',
component: (resolve) => require(['@/views/market/detail'], resolve),
name: 'MarketDetail',
meta: { title: '测试工具详情', icon: '' }
}
]
path: "tool/detail/:id(\\d+)",
component: (resolve) => require(["@/views/market/detail"], resolve),
name: "MarketDetail",
meta: { title: "测试工具详情", icon: "" },
},
],
},
{
path: '/crowdsource',
path: "/crowdsource",
component: Layout,
hidden: true,
children: [
{
path: 'my/publishApply/:id(\\d+)',
component: (resolve) => require(['@/views/crowdsource/my/publishApply/detail'], resolve),
name: 'crowdsourceAuditDetail',
meta: { title: '我发布的众包审核历史', icon: '' }
path: "my/publishApply/:id(\\d+)",
component: (resolve) =>
require(["@/views/crowdsource/my/publishApply/detail"], resolve),
name: "crowdsourceAuditDetail",
meta: { title: "我发布的众包审核历史", icon: "" },
},
{
path: 'my/publish/:id(\\d+)',
component: (resolve) => require(['@/views/crowdsource/my/publish/detail'], resolve),
name: 'crowdsourcePublishDetail',
meta: { title: '我发布的众包任务详情', icon: '' }
path: "my/publish/:id(\\d+)",
component: (resolve) =>
require(["@/views/crowdsource/my/publish/detail"], resolve),
name: "crowdsourcePublishDetail",
meta: { title: "我发布的众包任务详情", icon: "" },
},
{
path: 'my/claim/:id(\\d+)',
component: (resolve) => require(['@/views/crowdsource/my/claim/detail'], resolve),
name: 'crowdsourceClaimDetail',
meta: { title: '我应征的众包任务详情', icon: '' }
path: "my/claim/:id(\\d+)",
component: (resolve) =>
require(["@/views/crowdsource/my/claim/detail"], resolve),
name: "crowdsourceClaimDetail",
meta: { title: "我应征的众包任务详情", icon: "" },
},
{
path: 'detail/:id(\\d+)',
component: (resolve) => require(['@/views/crowdsource/detail'], resolve),
name: 'myCrowdsourceDetail',
meta: { title: '众包任务详情', icon: '' }
path: "detail/:id(\\d+)",
component: (resolve) =>
require(["@/views/crowdsource/detail"], resolve),
name: "myCrowdsourceDetail",
meta: { title: "众包任务详情", icon: "" },
},
{
path: 'manage/detail/:id(\\d+)',
component: (resolve) => require(['@/views/manage/crowdsource/detail'], resolve),
name: 'manageDetail',
meta: { title: '众包任务详情', icon: '' }
}
]
path: "manage/detail/:id(\\d+)",
component: (resolve) =>
require(["@/views/manage/crowdsource/detail"], resolve),
name: "manageDetail",
meta: { title: "众包任务详情", icon: "" },
},
],
},
{
path: '/buy',
path: "/buy",
component: Layout,
hidden: true,
children: [
{
path: 'alipay',
component: (resolve) => require(['@/views/market/buy/alipay'], resolve),
name: 'alipay',
meta: { title: '支付宝支付', icon: '' }
}
]
path: "alipay",
component: (resolve) => require(["@/views/market/buy/alipay"], resolve),
name: "alipay",
meta: { title: "支付宝支付", icon: "" },
},
],
},
{
path: '/callback',
path: "/callback",
component: Layout,
hidden: true,
children: [
{
path: '',
component: (resolve) => require(['@/views/market/buy/return'], resolve),
name: 'return',
meta: { title: '支付结果', icon: '' }
}
]
path: "",
component: (resolve) => require(["@/views/market/buy/return"], resolve),
name: "return",
meta: { title: "支付结果", icon: "" },
},
],
},
{
path: '/buy',
path: "/buy",
component: Layout,
hidden: true,
children: [
{
path: 'tool/:id(\\d+)',
component: (resolve) => require(['@/views/market/buy/alipay'], resolve),
name: 'buyTool',
meta: { title: '购买工具', icon: '' }
}
]
path: "tool/:id(\\d+)",
component: (resolve) => require(["@/views/market/buy/alipay"], resolve),
name: "buyTool",
meta: { title: "购买工具", icon: "" },
},
],
},
// {
// path: '/signInInfoList',
// component: (resolve) => require(['@/views/trainService/courseManageCom/signInInfoList.vue'], resolve),
// name: 'signInList',
// meta: { title: '签到详情', icon: '' }
// },
{
path: '/job',
path: "/job",
component: Layout,
hidden: true,
children: [
{
path: 'log',
component: (resolve) => require(['@/views/monitor/job/log'], resolve),
name: 'JobLog',
meta: { title: '调度日志' }
}
]
path: "log",
component: (resolve) => require(["@/views/monitor/job/log"], resolve),
name: "JobLog",
meta: { title: "调度日志" },
},
],
},
{
path: "/testModule",
component: Layout,
hidden: true,
component: (resolve) => require(["@/views/testModule"], resolve),
meta: { title: "测试模块" },
// children: [
// {
// path: 'testModule',
// name: 'testModule',
// }
// ]
},
{
path: '/gen',
path: "/gen",
component: Layout,
hidden: true,
children: [
{
path: 'edit/:tableId(\\d+)',
component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
name: 'GenEdit',
meta: { title: '修改生成配置' }
}
]
}
]
path: "edit/:tableId(\\d+)",
component: (resolve) =>
require(["@/views/tool/gen/editTable"], resolve),
name: "GenEdit",
meta: { title: "修改生成配置" },
},
],
},
];
export default new Router({
// mode: 'hash', // 去掉url中的#
mode: 'history', // 去掉url中的#
mode: "history", // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
routes: constantRoutes,
});

@ -1,5 +1,5 @@
module.exports = {
title: '关键测试云平台',
title: '小关软测宝后台管理',
/**
* 侧边栏主题 深色主题theme-dark浅色主题theme-light

@ -7,6 +7,7 @@ const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
nickName: state => state.user.nickName,
userId: state=> state.user.userId,
introduction: state => state.user.introduction,
roles: state => state.user.roles,

@ -15,6 +15,7 @@ const user = {
messageCount:0,
cartCount:0,
userId:0,
nickName:'',
activeName:'',
activeNameManager: '',
websiteDomain:''
@ -27,6 +28,9 @@ const user = {
SET_NAME: (state, name) => {
state.name = name
},
SET_NICKNAME: (state, nickName) => {
state.nickName = nickName
},
SET_USERID:(state, userId) => {
state.userId = userId
},
@ -138,7 +142,10 @@ const user = {
} else {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}
console.log(user);
commit('SET_NAME', user.userName)
commit('SET_NICKNAME', user.nickName)
commit('SET_USERID', user.userId)
commit('SET_AVATAR', avatar)
commit('SET_COMPANY', user.companyStatus)

@ -1,113 +1,122 @@
import axios from 'axios'
import { Notification, MessageBox, Message } from 'element-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import Cookies from 'js-cookie'
import axios from "axios";
import { Notification, MessageBox, Message } from "element-ui";
import store from "@/store";
import { getToken } from "@/utils/auth";
import errorCode from "@/utils/errorCode";
import Cookies from "js-cookie";
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API,
// 超时
timeout: 20000
})
timeout: 20000,
});
// request拦截器
service.interceptors.request.use(config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
service.interceptors.request.use(
(config) => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false;
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
if (getToken() && !isToken) {
config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
}
// get请求映射params参数
if (config.method === 'get' && config.params) {
let url = config.url + '?';
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
var part = encodeURIComponent(propName) + "=";
if (value !== null && typeof(value) !== "undefined") {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
let params = propName + '[' + key + ']';
var subPart = encodeURIComponent(params) + "=";
url += subPart + encodeURIComponent(value[key]) + "&";
// get请求映射params参数
if (config.method === "get" && config.params) {
let url = config.url + "?";
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
var part = encodeURIComponent(propName) + "=";
if (value !== null && typeof value !== "undefined") {
if (typeof value === "object") {
for (const key of Object.keys(value)) {
let params = propName + "[" + key + "]";
var subPart = encodeURIComponent(params) + "=";
url += subPart + encodeURIComponent(value[key]) + "&";
}
} else {
url += part + encodeURIComponent(value) + "&";
}
} else {
url += part + encodeURIComponent(value) + "&";
}
}
url = url.slice(0, -1);
config.params = {};
config.url = url;
}
url = url.slice(0, -1);
config.params = {};
config.url = url;
return config;
},
(error) => {
console.log(error);
Promise.reject(error);
}
return config
}, error => {
console.log(error)
Promise.reject(error)
})
);
// 响应拦截器
service.interceptors.response.use(res => {
// console.log('响应拦截器',res)
service.interceptors.response.use(
(res) => {
console.log(res);
// console.log('响应拦截器',res)
// 未设置状态码则默认成功状态
// const code = res.status || 200;
const code = res.data.code || 200 ;
const code = res.data.code || 200;
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
const msg = errorCode[code] || res.data.msg || errorCode["default"];
// console.log('code---',code)
if (code === 401) {
// Cookies.set('Admin-Token', '');
MessageBox.confirm('登录状态已过期,请重新登录', '系统提示', {
confirmButtonText: '重新登录',
showCancelButton:false,
showClose:false,
type: 'warning'
}
).then(() => {
store.dispatch('LogOut').then(() => {
location.href = '/index';
})
})
MessageBox.confirm("登录状态已过期,请重新登录", "系统提示", {
confirmButtonText: "重新登录",
showCancelButton: false,
showClose: false,
type: "warning",
}).then(() => {
store.dispatch("LogOut").then(() => {
location.href = "/index";
});
});
} else if (code === 500) {
Message({
message: msg,
type: 'error'
})
return Promise.reject(new Error(msg))
}
else if (code === 501) {
type: "error",
});
return Promise.reject(new Error(msg));
} else if (code === 501) {
Message({
message: msg,
type: 'error'
})
return Promise.reject(new Error(msg))
}
else if (code == '200') {
type: "error",
});
return Promise.reject(new Error(msg));
} else if (code === 409) {
Message({
message: msg,
type: "error",
});
return Promise.reject(new Error(msg));
} else if (code == "200") {
// console.log('200',res.data)
return res.data
return res.data;
} else if (code !== 200) {
// Notification.error({
// title: msg
// })
return Promise.reject('error')
} else {
return res.data
return Promise.reject("error");
} else {
return res.data;
}
},
error => {
(error) => {
// console.log('err' + error)
let { message } = error;
console.log(error);
if (message == "Network Error") {
message = "后端接口连接异常";
}
else if (message.includes("timeout")) {
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
}
else if (message.includes("Request failed with status code")) {
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
// Message({
@ -115,8 +124,8 @@ service.interceptors.response.use(res => {
// type: 'error',
// duration: 5 * 1000
// })
return Promise.reject(error)
return Promise.reject(error);
}
)
);
export default service
export default service;

@ -1,6 +1,7 @@
<template>
<div class="container">
<el-dialog
v-if="open"
:title="title"
:visible.sync="open"
:close-on-click-modal="false"
@ -30,18 +31,19 @@
<el-radio-group v-model="form.deliverType">
<el-radio label="License">License</el-radio>
<el-radio label="SaaS">SaaS</el-radio>
<!-- <el-radio label="线下服务">线下服务</el-radio> -->
</el-radio-group>
</el-form-item>
<el-form-item label="软件包" prop="packagePath" v-if="form.deliverType == 'License'">
<el-input v-model="form.packagePath" placeholder="请输入软件包地址"></el-input>
<!-- <el-input v-model="form.packagePath" v-show="false" :limit="1"></el-input>
<!-- <el-input v-model="form.packagePath" placeholder="请输入软件包地址"></el-input> -->
<el-input v-model="form.packagePath" v-show="false" :limit="1"></el-input>
<nonimage-upload
ref="packageUpload"
:limitRemark="',文件请选用压缩包格式'"
:limit="1"
@setImgPath="setPackagePath"
imageType="zip|rar"
/> -->
/>
</el-form-item>
<el-form-item label="安装手册" prop="installDocPath" v-if="form.deliverType == 'License'">
<el-input v-model="form.installDocPath" v-show="false" :limit="1"></el-input>
@ -304,6 +306,7 @@ export default {
},
methods: {
submit() {
console.log(this.form.installDocPath);
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.toolId) {
@ -396,6 +399,8 @@ export default {
this.form.packagePath = value
},
setInstallDocPath(value) {
console.log(value);
console.log('--------------------------------');
this.form.installDocPath = value
},
// +mp4
@ -407,6 +412,7 @@ export default {
},
openDialog(tool) {
console.log(tool.installDocPath);
this.form.toolId = tool.toolId
this.form.name = tool.name
this.form.price = tool.price
@ -453,6 +459,9 @@ export default {
this.form.detailFile = fileList.filter(function (item) {
return item.fileType == 'detail'
})
// this.form.packageFile = fileList.filter(function (item) {
// return item.fileType == 'package'
// })
this.form.packageFile = fileList.filter(function (item) {
return item.fileType == 'package'
})
@ -504,6 +513,8 @@ export default {
filePath: this.form.packageFile[0].filePath,
},
]
console.log(this.form.packageFile);
// this.form.packagePath = this.form.packageFile[0].filePath
this.$refs.packageUpload?.setToolFileList(packageFile)
}
if (this.form.installDocFile.length > 0) {
@ -514,6 +525,7 @@ export default {
filePath: this.form.installDocFile[0].filePath,
},
]
console.log(installDocFile);
this.$refs.installDocUpload?.setInstallDocFileList(installDocFile)
}
// 使

@ -1,7 +1,7 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">关键测试云平台</h3>
<h3 class="title">小关软测宝后台管理</h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />

@ -1,11 +1,11 @@
<template>
<div class="container" style="padding: 30px!important; ">
<div class="container" style="padding: 30px!important; ">
<el-form :model="queryParam" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="工具类型" prop="toolType">
<el-select v-model="queryParam.toolType">
<el-option label="" value="">请选择</el-option>
<el-option v-for="item in this.toolTypes" :key="item.dictValue" :label="item.dictLabel"
:value="item.dictValue * 1"/>
:value="item.dictValue * 1" />
</el-select>
</el-form-item>
<el-form-item label="交付方式" prop="deliverType">
@ -13,19 +13,12 @@
<el-option label="" value="">请选择</el-option>
<el-option label="License" value="License">License</el-option>
<el-option label="SaaS" value="SaaS">SaaS</el-option>
<el-option label="offLine" value="offLine">线下服务</el-option>
</el-select>
</el-form-item>
<el-form-item label="订单时间">
<el-date-picker
v-model="dateRange"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -33,40 +26,46 @@
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="orders" ref="multipleTable">
<el-table-column label="订单编号" align="center" key="orderNumber" width="200" prop="orderNumber" :show-overflow-tooltip="true"/>
<el-table-column label="用户姓名" align="center" key="userName" prop="userName" :show-overflow-tooltip="true">
<el-table-column label="订单编号" align="center" key="orderNumber" width="200" prop="orderNumber"
:show-overflow-tooltip="true" />
<el-table-column label="用户姓名" align="center" key="userName" prop="userName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{scope.row.userName}}
{{ scope.row.userName }}
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" key="name" prop="name" :show-overflow-tooltip="true">
<el-table-column label="商品名称" align="center" key="name" prop="name" :show-overflow-tooltip="true">
<template slot-scope="scope">
<router-link :to="'/test/tool/detail/'+ scope.row.toolId" class="link-type"> {{scope.row.name}}</router-link>
<router-link :to="'/test/tool/detail/' + scope.row.toolId" class="link-type"> {{ scope.row.name
}}</router-link>
</template>
</el-table-column>
<el-table-column label="商品类型" align="center" key="type" prop="type" width="150" :show-overflow-tooltip="true">
<el-table-column label="商品类型" align="center" key="type" prop="type" width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
<tool-type :type="scope.row.type"></tool-type>
</template>
</el-table-column>
<el-table-column label="交付方式" align="center" key="deliverType" prop="deliverType" width="100"
:show-overflow-tooltip="true">
:show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.priceType == 'offLine' ? '线下服务' : scope.row.deliverType }}</span>
</template>
</el-table-column>
<el-table-column label="商品数量" align="center" key="amount" prop="amount" width="100"
:show-overflow-tooltip="true"/>
:show-overflow-tooltip="true" />
<el-table-column label="订单金额" align="center" key="fee" prop="fee" width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{scope.row.fee}}</span>
<span>{{ scope.row.priceType == 'offLine' ? '金额面议' : scope.row.fee +'元' }}</span>
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" key="payType" prop="payType" width="100" :show-overflow-tooltip="true">
<el-table-column label="付款方式" align="center" key="payType" prop="payType" width="100"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{scope.row.payType=='wx'?'微信支付':'支付宝支付' }}</span>
<span>{{ scope.row.priceType == 'offLine' ? '线下支付' : scope.row.payType == 'wx' ? '微信支付' : '支付宝支付' }}</span>
</template>
</el-table-column>
<el-table-column label="订单状态" align="center" key="status" prop="status" width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{scope.row.status==0?'未支付':scope.row.status==1?'支付成功':'支付失败' }}</span>
<span>{{ scope.row.priceType == 'offLine' ? '已完成' : scope.row.status == 0 ? '未支付' : scope.row.status == 1 ? '支付成功' : '支付失败' }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="创建时间" align="center" key="createTime" prop="createTime" width="200">-->
@ -80,62 +79,56 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParam.pageNum"
:limit.sync="queryParam.pageSize"
@pagination="handleQuery"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParam.pageNum" :limit.sync="queryParam.pageSize"
@pagination="handleQuery" />
</div>
</template>
<script>
import {listOrder} from "@/api/order/order";
import ToolType from "@/views/components/enum/ToolType";
import { listOrder } from "@/api/order/order";
import ToolType from "@/views/components/enum/ToolType";
export default {
name: "OrderList",
components: {ToolType},
data() {
return {
loading: false,
orders: [],
//
total: 0,
//
dateRange: [],
toolTypes: [],
//
queryParam: {
pageNum: 1,
pageSize: 10,
deliverType: undefined,
toolType: undefined
}
export default {
name: "OrderList",
components: { ToolType },
data() {
return {
loading: false,
orders: [],
//
total: 0,
//
dateRange: [],
toolTypes: [],
//
queryParam: {
pageNum: 1,
pageSize: 10,
deliverType: undefined,
toolType: undefined
}
},
created() {
this.handleQuery();
this.getDicts("sys_tool_type").then(response => {
this.toolTypes = response.data;
}
},
created() {
this.handleQuery();
this.getDicts("sys_tool_type").then(response => {
this.toolTypes = response.data;
})
},
methods: {
handleQuery() {
listOrder(this.addDateRange(this.queryParam, this.dateRange)).then(response => {
this.orders = response.rows;
this.total = response.total;
})
},
methods: {
handleQuery() {
listOrder(this.addDateRange(this.queryParam, this.dateRange)).then(response => {
this.orders = response.rows;
this.total = response.total;
})
},
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
}
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
}
}
}
</script>
<style scoped>
</style>
<style scoped></style>

@ -144,6 +144,7 @@ export default {
})
},
modify(row) {
console.log(row);
this.$refs.toolEditDialog.openDialog(row)
},
updateStatus(toolId, status) {

@ -1,7 +1,7 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">关键测试云平台</h3>
<h3 class="title">小关软测宝后台管理</h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="用户电话">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />

@ -5,52 +5,22 @@
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable size="small" style="width: 240px"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="手机号码" prop="phonenumber">
<el-input
v-model="queryParams.phonenumber"
placeholder="请输入手机号码"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable size="small"
style="width: 240px" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="用户状态"
clearable
size="small"
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
<el-select v-model="queryParams.status" placeholder="用户状态" clearable size="small" style="width: 240px">
<el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel"
:value="dict.dictValue" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="dateRange"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -60,74 +30,42 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:user:add']"
>新增</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:user:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:user:edit']"
>修改</el-button>
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['system:user:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:user:remove']"
>删除</el-button>
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['system:user:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['system:user:import']"
>导入</el-button>
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
v-hasPermi="['system:user:import']">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:user:export']"
>导出</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['system:user:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" width="100" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible"
width="100" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible"
:show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible"
:show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible"
width="120" />
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="0"
inactive-value="1"
@change="handleStatusChange(scope.row)"
></el-switch>
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
@change="handleStatusChange(scope.row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
@ -135,46 +73,20 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="250"
class-name="small-padding fixed-width"
>
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']"
>修改</el-button>
<el-button
v-if="scope.row.userId !== 1"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-key"
@click="handleResetPwd(scope.row)"
v-hasPermi="['system:user:resetPwd']"
>重置</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']">修改</el-button>
<el-button v-if="scope.row.userId !== 1" size="mini" type="text" icon="el-icon-delete"
@click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)"
v-hasPermi="['system:user:resetPwd']">重置</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</el-col>
</el-row>
@ -190,13 +102,8 @@
<el-col :span="12">
<el-form-item label="角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择">
<el-option
v-for="item in roleOptions"
:key="item.roleId"
:label="item.roleName"
:value="item.roleId"
:disabled="item.status == 1"
></el-option>
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId"
:disabled="item.status == 1"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -229,27 +136,37 @@
<el-col :span="12">
<el-form-item label="用户性别">
<el-select v-model="form.sex" placeholder="请选择">
<el-option
v-for="dict in sexOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
<el-option v-for="dict in sexOptions" :key="dict.dictValue" :label="dict.dictLabel"
:value="dict.dictValue"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
<el-radio v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel
}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="用户类型">
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> -->
<!-- <el-select v-model="form.type" placeholder="请选择">
<el-option label="普通用户" value="0"></el-option>
<el-option label="管理用户" value="1"></el-option>
</el-select> -->
<el-radio-group v-model="form.type">
<el-radio label="0">普通用户</el-radio>
<el-radio label="1">管理用户</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注">
@ -266,18 +183,9 @@
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
@ -344,7 +252,9 @@ export default {
//
roleOptions: [],
//
form: {},
form: {
// type:'1'
},
defaultProps: {
children: "children",
label: "label"
@ -386,7 +296,8 @@ export default {
//
rules: {
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" }
{ required: true, message: "用户名称不能为空", trigger: "blur" },
{ pattern: /^[^\u4e00-\u9fa5]+$/, message: "用户名称不能包含中文", trigger: "blur" }
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
@ -435,10 +346,10 @@ export default {
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
@ -461,16 +372,16 @@ export default {
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return changeUserStatus(row.userId, row.status);
}).then(() => {
this.msgSuccess(text + "成功");
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return changeUserStatus(row.userId, row.status);
}).then(() => {
this.msgSuccess(text + "成功");
}).catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
//
cancel() {
@ -479,6 +390,7 @@ export default {
},
//
reset() {
console.log(this.sexOptions[0]);
this.form = {
userId: undefined,
deptId: undefined,
@ -487,8 +399,9 @@ export default {
password: undefined,
phonenumber: undefined,
email: undefined,
sex: undefined,
sex: this.sexOptions[0].dictValue,
status: "0",
type: '1',
remark: undefined,
postIds: [],
roleIds: []
@ -546,13 +459,13 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then(({ value }) => {
resetUserPwd(row.userId, value).then(response => {
this.msgSuccess("修改成功,新密码是:" + value);
});
}).catch(() => {});
resetUserPwd(row.userId, value).then(response => {
this.msgSuccess("修改成功,新密码是:" + value);
});
}).catch(() => { });
},
/** 提交按钮 */
submitForm: function() {
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.userId != undefined) {
@ -575,28 +488,28 @@ export default {
handleDelete(row) {
const userIds = row.userId || this.ids;
this.$confirm('是否确认删除用户编号为"' + userIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delUser(userIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delUser(userIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有用户数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportUser(queryParams);
}).then(response => {
this.download(response.msg);
})
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportUser(queryParams);
}).then(response => {
this.download(response.msg);
})
},
/** 导入按钮操作 */
handleImport() {

@ -0,0 +1,28 @@
<template>
<div class="testModule">
<h2 class="testModuleTitle">表单模块测试</h2>
<diyForm></diyForm>
</div>
</template>
<script>
import diyForm from '@/components/formatForm/indexX.vue'
// import formSource from '@/components/formatForm/formSource.vue'
export default {
components: {
diyForm
}
}
</script>
<style lang="scss" scoped>
.testModule {
.testModuleTitle{
text-align: center;
height: 40px;
border-bottom: 1px solid gray;
margin: 0;
}
}
</style>

@ -4,12 +4,19 @@
style="display: flex; margin-left: 5px">
<div style="margin-top: 5px; margin-bottom: 20px; margin-right: 5px">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="option({}, 'add')">新增课程</el-button>
<!-- <el-button type="primary" icon="el-icon-plus" size="mini" @click="importCourse">导入课程</el-button> -->
<!-- <buttonUpload v-if="courseForm.classId !== ''" style="margin-left: 10px;"><el-button type="primary" icon="el-icon-plus" size="mini" @click="uploadExcel">导入课程</el-button></buttonUpload> -->
<!-- <buttonUpload style="margin-left: 10px;"><el-button type="primary" icon="el-icon-plus" size="mini" @click="uploadExcel">导入课程</el-button></buttonUpload> -->
</div>
<el-form-item label="课程" prop="courseId">
<el-input v-model="queryParams.courseName"></el-input>
<el-input v-model="queryParams.courseName" clearable></el-input>
</el-form-item>
<el-form-item label="班级名称" prop="courseId">
<el-input v-model="queryParams.className"></el-input>
<el-input v-model="queryParams.className" clearable></el-input>
<!-- <el-select v-model="queryParams.className" placeholder="选择班级" clearable>
<el-option v-for="item in classList" :key="item.trainClassId" :label="item.trainClassName" :value="item.trainClassName">
</el-option>
</el-select> -->
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
@ -17,13 +24,23 @@
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="courseList">
<el-tabs v-model="queryParams.classType" @tab-click="handleClick">
<el-tab-pane v-for="(myClass, classIndex) in classMap" :key="classIndex" :label="myClass.type"
:name="myClass.value">
</el-tab-pane>
</el-tabs>
<el-table v-loading="loading" :data="courseList" ref="table">
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="所属班级" align="center" prop="className" />
<el-table-column label="课程名称" align="center" prop="courseName" />
<el-table-column label="任课老师" align="center" prop="instructor" />
<el-table-column label="上课时间" align="center" prop="courseTime" />
<el-table-column label="课程资料" align="center">
<el-table-column v-if="queryParams.classType == 4" label="下课时间" align="center" prop="dateTime">
<template slot-scope="scope">
<div>{{ scope.row.classType == 4 ? scope.row.dateTime : '' }}</div>
</template>
</el-table-column>
<el-table-column v-if="queryParams.classType != 4" label="课程资料" align="center">
<template slot-scope="scope">
<div v-for="name in scope.row.attachments" :key="name.fileId" @click="downLoadSource(name)"
class="sourceItem">
@ -31,18 +48,23 @@
</div>
</template>
</el-table-column>
<el-table-column label="签到情况" align="center">
<el-table-column v-if="queryParams.classType != 4" label="签到情况" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="option(scope.row, 'siginList')">{{
scope.row.signIn
}}</el-button>
scope.row.classType == 4 ? '' : scope.row.signIn
}}</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="option(scope.row, 'motify')">修改</el-button>
<el-button size="mini" type="text" @click="option(scope.row, 'delete')">删除</el-button>
<el-button size="mini" type="text" @click="option(scope.row, 'signIn')">签到</el-button>
<el-button size="mini" type="text" v-show="scope.row.classType != 4"
@click="option(scope.row, 'signIn')">签到</el-button>
<el-button v-show="scope.row.classType == 4" size="mini" type="text"
@click="option(scope.row, 'inCome')">收入管理</el-button>
<el-button v-show="scope.row.classType == 4" size="mini" type="text"
@click="option(scope.row, 'studentRows')">学习人数</el-button>
</template>
</el-table-column>
</el-table>
@ -55,13 +77,25 @@
<vueQr :signInInfo="JSON.stringify(signInInfo)"></vueQr>
</div>
<div v-else-if="optionType == 'inCome'">
<el-table v-loading="loading" :data="inComeForm">
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="付费时间" align="center" width="250px" prop="recordTime" />
<el-table-column label="付费金额" align="center" width="110px" prop="recordAmount" />
<el-table-column label="流水号" align="center" width="250px" prop="reqsn" />
</el-table>
<pagination v-show="total > 0" :total="inComeTotal" :page.sync="inComeParams.pageNum"
:limit.sync="inComeParams.pageSize" @pagination="inComeManage('')" />
</div>
<el-form v-else :model="courseForm" :rules="rules" ref="courseForm" label-width="150px" text-align:center>
<el-form-item label="所属班级" prop="classId">
<el-select v-model="courseForm.classId" filterable placeholder="请选择" @change="classChange">
<el-option v-for="item in classList" :key="item.trainClassId" :label="item.trainClassName"
:value="item.trainClassId">
</el-option>
</el-select>
<div style="display: flex;">
<el-select v-model="courseForm.classId" filterable placeholder="请选择" @change="classChange">
<el-option v-for="item in classList" :key="item.trainClassId" :label="item.trainClassName"
:value="item.trainClassId">
</el-option>
</el-select>
</div>
</el-form-item>
<el-form-item label="课程名称" prop="courseName">
@ -89,7 +123,13 @@
<el-form-item label="上课时间" prop="courseTime">
<el-date-picker v-model="courseForm.courseTime" type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间">
@change="timeChange('courseTime')" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="下课时间" prop="dateTime" v-if="classType == 4">
<el-date-picker v-model="courseForm.dateTime" type="datetime" format="yyyy-MM-dd HH:mm:ss"
@change="timeChange('dateTime')" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
@ -110,21 +150,11 @@
<el-option label="免费" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="支付方式" prop="payMethods" v-if="classType == 4 && courseForm.isPay == 1">
<!-- <el-cascader v-model="courseForm.isPay" :options="payOptions"
@change="payHandleChange"></el-cascader> -->
<el-select v-model="courseForm.payMethods" placeholder="请选择是否付费">
<el-option label="费用" value="1"></el-option>
<el-option label="口令" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="费用" prop="amount"
v-if="classType == 4 && courseForm.isPay == 1 && courseForm.payMethods == '1'">
<el-form-item label="费用" prop="amount" v-if="classType == 4 && courseForm.isPay == 1">
<el-input v-model="courseForm.amount" type="number" placeholder="请输入费用"></el-input>
</el-form-item>
<el-form-item label="口令" prop="password"
v-if="classType == 4 && courseForm.isPay == 1 && courseForm.payMethods == '2'">
<el-input v-model="courseForm.password" placeholder="请输入口令"></el-input>
<el-form-item label="口令" prop="password" v-if="classType == 4 && courseForm.isPay == 1">
<el-input v-model="courseForm.password" type="number" placeholder="请输入口令"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark" v-if="classType == 4">
<el-input v-model="courseForm.remark" placeholder="请输入备注"></el-input>
@ -156,11 +186,14 @@ import {
delCourse,
listTeacherAll,
getClassList,
getInComeInfo
} from '@/api/trainService/index'
import fileUpload from '@/components/FileUpload/index.vue'
import { encodeChinese } from '@/utils/encodeChinese'
import buttonUpload from '@/components/buttonUpload/index.vue'
import vueQr from '@/components/vueQr/index.vue'
import { deepClone } from '@/utils'
import router from '../../router'
const titleMap = {
motify: '修改',
delete: '删除',
@ -168,24 +201,37 @@ const titleMap = {
add: '新增',
siginList: '签到情况',
attendance: '考勤',
inCome: '收入管理'
}
const classMap = [
{ type: '校企合作班', value: '0' },
{ type: '线下培训进阶班', value: '1' },
{ type: '可靠性人才培训班', value: '2' },
{ type: '师资培训班', value: '3' },
{ type: '线上培训班', value: '4' }
]
const courseRule = {
courseName: [{ required: true, message: '请输入课程名称', trigger: 'blur' }],
classId: [{ required: true, message: '请选择班级', trigger: 'change' }],
instructor: [{ required: true, message: '请选择任课老师', trigger: 'change' }],
courseTime: [{ required: true, trigger: 'change', message: '请输入上课时间' }],
dateTime: [{ required: true, trigger: 'change', message: '请输入下课时间' }],
courseContent: [{ required: true, message: '请输入课程内容', trigger: 'blur' }],
password: [{ required: true, message: '请输入口令', trigger: 'blur' }],
amount: [{ required: true, message: '请输入付款金额', trigger: 'blue' }],
password: [{ required: true, message: '请输入口令', trigger: 'blur' },
{ min: 4, max: 4, message: '请输入四位数字', trigger: 'blur' }
],
amount: [{ required: true, message: '请输入付款金额', trigger: 'blur' },
{ pattern: /^([1-9]\d*(\.\d*[1-9][0-9])?)|(0\.\d*[1-9][0-9])|(0\.\d*[1-9])$/, message: "请输入正确的金额", trigger: 'blur' }],
isPay: [{ required: true, message: '请输入选择授课方法', trigger: 'change' }],
url: [{ required: true, message: '请输入课程链接', trigger: 'blur' }],
title: [{ required: true, message: '请输入职称', trigger: 'blur' }],
title: [{ required: false, message: '请输入职称', trigger: 'blur' }],
payMethods: [{ required: true, message: '请输入支付方式', trigger: 'change' }]
}
export default {
components: { fileUpload, vueQr },
components: { fileUpload, vueQr, buttonUpload },
data() {
return {
classMap: classMap,
imgAction: process.env.VUE_APP_BASE_API + '/upload',
loading: false,
id: '',
@ -209,9 +255,10 @@ export default {
//
queryParams: {
pageNum: 1,
pageSize: 10,
pageSize: 20,
courseName: '',
className: '',
classType: '0'
},
courseForm: {
classId: '',
@ -228,6 +275,8 @@ export default {
visibleopen: false,
rules: courseRule,
classType: 0,
inComeForm: [],
// payOptions: [
// {
// value: '1',
@ -247,10 +296,31 @@ export default {
// label: '',
// }],
payMethods: '0'
payMethods: '0',
inComeParams: {
pageNum: 1,
pageSize: 10,
},
inComeTotal: 1,
}
},
methods: {
// arraySpanMethod({ row, column, rowIndex, columnIndex }) {
// if (columnIndex === 1) {
// if (rowIndex % 2 === 0) {
// return {
// rowspan: 2,
// colspan: 1
// };
// } else {
// return {
// rowspan: 0,
// colspan: 0
// };
// }
// }
// },
querySearch(queryString, cb) {
var restaurants = this.teacherList;
console.log(restaurants);
@ -294,7 +364,7 @@ export default {
return item.trainClassId == e
})
if (result) {
this.classType = result.classType
this.classType = result.classType * 1
}
console.log(this.courseForm);
},
@ -305,6 +375,19 @@ export default {
}
downloadHttp(url)
},
// excel
uploadExcel() {
},
handleClick() {
this.getList()
this.$nextTick(() => {
this.$refs.table.doLayout()
})
},
// importCourse(){
// this.$router.push('/course/courseImport')
// },
async option(row, type) {
this.optionType = type
this.currentCourse = row
@ -331,14 +414,27 @@ export default {
case 'signIn':
this.generateSignIn(row)
break
case 'inCome':
this.inComeManage(row)
return
case 'studentRows':
// this.studentRows(row)
this.$router.push({
path: '/course/learnNum',
query: {
courseId: row.courseId,
rourseName: row.courseName
},
})
return
case 'siginList':
// this.id = row.courseId
console.log(row);
this.$router.push({
path: '/signInInfoList',
query: {
name: row.courseName,
id: row.courseId,
classType: row.classType,
},
})
return
@ -365,10 +461,7 @@ export default {
}
if (this.classType == 4) {
data.classType = '4'
delete data.payMethods
}
if (this.courseForm.courseId) {
const res = await putCourseItem(data)
res.code == 200 && this.$message.success('修改成功')
@ -379,10 +472,27 @@ export default {
this.closeDia()
this.getList()
},
timeChange(val) {
if(this.queryParams.classType != 4){
return
}
if (this.courseForm.courseTime && this.courseForm.dateTime) {
const sta = new Date(this.courseForm.courseTime).getTime()
const end = new Date(this.courseForm.dateTime).getTime()
if (end - sta <= 0) {
this.$message.error('上课时间不能晚于下课时间');
('dateTime' == val) && (this.courseForm.dateTime = '');
('courseTime' == val) && (this.courseForm.courseTime = '')
}
}
},
// dialog init
async initDialog(val) {
console.log(val);
const classRes = await getClassList()
const obj = {
classType: this.queryParams.classType
}
const classRes = await getClassList(obj)
this.classList = classRes.data
if (val) {
this.classChange(val)
@ -391,6 +501,15 @@ export default {
this.teacherList = teacherRes
},
//
inComeManage(row) {
row.courseId ? '' : (row = this.currentCourse)
getInComeInfo({ recordName: row.courseName, ...this.inComeParams }).then(res => {
this.inComeTotal = res.total
this.inComeForm = res.rows
this.visibleopen = true
})
},
openDia() {
if (this.optionType === 'motify') {
this.$refs.fileUpload?.fileInit(this.courseForm.attachments)

@ -0,0 +1,222 @@
<template>
<div class="importCourseWrap">
<div class="importArea" v-if="tableList.length == 0">
<el-form ref="form" :model="excelForm" :rules="excleRules" label-width="150px">
<el-form-item label="请选择班级" prop="className">
<el-select v-model="excelForm.className" filterable placeholder="请选择">
<el-option v-for="item in classList" :key="item.trainClassId" :label="item.trainClassName"
:value="item.trainClassId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="请上传excel" prop="excelFile">
<el-upload class="upload-demo" drag action="#" :file-list="fileList" :before-upload="beforeUpload"
:show-file-list="false" :on-remove="handleRemove">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传excelxlsx文件且不超过500kb</div>
</el-upload>
<div>{{ excelForm.excelFile }}</div>
</el-form-item>
</el-form>
<div style="text-align: center;">
<el-button @click="parseExcel(file)" type="primary"
:disabled="(excelForm.className == '' || excelForm.excelFile == '')">确认上传{{ excelForm.className &&
excelForm.excelFile }}</el-button>
</div>
</div>
<div v-else>
<el-table height="800px" :data="tableList" style="width: 100%">
<el-table-column prop="courseName" label="课堂名称" width="width"></el-table-column>
<el-table-column prop="courseTime" label="上课时间" width="width"></el-table-column>
<el-table-column prop="dateTime" label="下课时间" width="width"></el-table-column>
<el-table-column prop="instructor" label="老师" width="width"></el-table-column>
<el-table-column prop="isPay" label="是否付款" width="width"></el-table-column>
<el-table-column prop="remark" label="备注" width="width"></el-table-column>
<el-table-column prop="title" label="职称" width="width"></el-table-column>
<el-table-column prop="url" label="链接" width="width"></el-table-column>
<el-table-column>
<template slot-scope="scope">
<el-button type="text" @click="dialogVisible = true" size="mini">编辑</el-button>
<el-button type="text" size="mini" @click="delRow(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin: 10px 0;">
<el-button type="primary" @click="tableList = []">重新上传</el-button>
<el-button type="primary" @click="submit">确定提交</el-button>
</div>
</div>
<el-dialog title="编辑" :visible.sync="dialogVisible" width="width">
<div>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="1">
<el-input placeholder=""></el-input>
</el-form-item>
<el-form-item label="2">
<el-input placeholder=""></el-input>
</el-form-item>
<el-form-item label="3">
<el-input placeholder=""></el-input>
</el-form-item>
<el-form-item label="4">
<el-input placeholder=""></el-input>
</el-form-item>
<el-form-item label="5">
<el-input placeholder=""></el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getClassList,
} from '@/api/trainService/index'
const keyMap = {
'上课时间': 'courseTime',
'下课时间': 'dateTime',
'备注': 'remark',
'授课内容': 'contend',
'授课老师': 'instructor',
'是否付费': 'isPay',
'职称': 'title',
'课堂名称': 'courseName',
'课程链接': 'url',
}
export default {
created() {
this.init()
},
data() {
return {
excelForm: {
className: '',
excelFile: ''
},
classList: [],
excleRules: {
className: [{ required: true, message: '请选择班级', trigger: 'blur' }],
excelFile: [{ required: true, message: '请上传excel文件', trigger: 'change' }],
},
fileList: [],
tableList: [],
file: '',
newFile: new FormData(),
dialogVisible: false
}
},
methods: {
async init() {
const res = await getClassList()
this.classList = res.data
},
beforeUpload(file, fileList) {
this.name = file.name
const filetype = file.name.slice(file.name.lastIndexOf('.', file.name.length))
console.log(filetype);
const isType = ['.excel', '.xlsx'].some(item => { return item == filetype })
if (!isType) {
this.$message.error('只能上传excel文件!');
return false
}
this.newFile.append('file', file); // 2. fileFormData
this.file = file
this.excelForm.excelFile = file.name
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
product(outdata, loading) {
const result = outdata.reduce((pre, cur, index) => {
const obj = {}
Object.keys(cur).forEach(key => {
console.log(key);
if (keyMap[key]) {
obj[keyMap[key]] = cur[key]
} else {
}
})
pre.push(obj)
return pre
}, [])
this.tableList = result
console.log(result);
console.log(outdata);
loading.close()
},
parseExcel(file) {
const loading = this.$loading({
lock: true,
text: '解析中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let reader = new FileReader()
let _this = this
reader.readAsArrayBuffer(file)
reader.onload = function () {
let buffer = reader.result
let bytes = new Uint8Array(buffer)
let length = bytes.byteLength
let binary = ''
for (let i = 0; i < length; i++) {
binary += String.fromCharCode(bytes[i])
}
let XLSX = require('xlsx')
let wb = XLSX.read(binary, {
type: 'binary'
})
let outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
_this.product(outdata, loading)
}
},
delRow(row) {
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功'
});
})
},
submit() {
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message.success('修改成功')
this.$router.push('/courseManage')
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
}
}
</script>
<style lang="scss" scoped>
.importCourseWrap {
.importArea {
width: 500px;
margin: 200px auto;
}
}
</style>

@ -0,0 +1,68 @@
<template>
<div style="padding: 20px;">
<el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px"
@click="excelExport">导出为excel</el-button>
<el-table v-loading="false" :data="listenCourseNum">
<el-table-column label="序号" type="index" align="center" />
<el-table-column label="姓名" align="center" prop="studentName" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="开始听课时间" align="center" prop="startTime"></el-table-column>
</el-table>
<pagination :total="studentTotal" :page.sync="studentParams.pageNum" :limit.sync="studentParams.pageSize"
@pagination="init('')" />
</div>
</template>
<script>
import {
getStudyRows,
expLearnNum
} from '@/api/trainService/index'
import { saveAs } from 'file-saver';
export default {
data() {
return {
listenCourseNum: [],
studentTotal: 1,
studentParams: {
pageNum: 1,
pageSize: 10,
},
courseId:'',
rourseName:''
}
},
created() {
this.courseId = this.$route.query.courseId
this.rourseName = this.$route.query.rourseName
this.init()
},
methods: {
init() {
getStudyRows(this.courseId, this.studentParams).then(res => {
this.studentTotal = res.total
this.listenCourseNum = res.rows.map(item => {
if (!item.data) {
item.startTime = '未开始'
return item
}
const tempData = JSON.parse(item.data)
const courseKey = 'courseId_' + this.courseId
item.startTime = tempData.find(ph => {
return ph[courseKey]
})[courseKey]
return item
})
})
},
async excelExport() {
const res = await expLearnNum(this.courseId)
const blob = new Blob([res])
saveAs(blob, this.rourseName + '学习人数表.xlsx')
}
}
}
</script>
<style></style>

@ -17,7 +17,7 @@
<el-table-column label="序号" type="index" />
<el-table-column label="学生姓名" prop="studenName" align="center" />
<el-table-column label="学号" prop="studenCode" align="center" />
<el-table-column label="专业" prop="major" align="center" />
<el-table-column v-if="classType == 0" label="专业" prop="major" align="center" />
<el-table-column label="手机号" prop="mobile" align="center"> </el-table-column>
<el-table-column label="时间" prop="createTime" align="center"></el-table-column>
<el-table-column label="操作" align="center">
@ -45,6 +45,7 @@ export default {
const query = this.$route.query
this.name = query.name
this.id = query.id
this.classType = query.classType
this.signIninit()
},
props: {},
@ -54,6 +55,7 @@ export default {
id: '',
loading: false,
total: 0,
classType:1,
signinList: [],
queryParams: {
pageNum: 1,

@ -13,8 +13,7 @@
<el-form-item label="班级名称" prop="trainClassName">
<el-input v-model="queryParams.trainClassName" placeholder="请输入班级名称" clearable size="small" />
</el-form-item>
<el-form-item label="班级类型" prop="classType">
<!-- <el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable size="small" /> -->
<!-- <el-form-item label="班级类型" prop="classType">
<el-select v-model="queryParams.classType">
<el-option label="校企合作班" :value="0"></el-option>
@ -23,7 +22,7 @@
<el-option label="师资培训班" :value="3"></el-option>
<el-option label="线上培训班" :value="4"></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -33,27 +32,37 @@
<div style="margin-top: 5px; margin-bottom: 20px">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="addsign">新增</el-button>
</div>
<el-table v-loading="loading" :data="classList">
<el-tabs v-model="queryParams.classType" @tab-click="handleClick">
<el-tab-pane v-for="(myClass, classIndex) in classMap" :key="classIndex" :label="myClass.type"
:name="myClass.value">
</el-tab-pane>
</el-tabs>
<el-table v-loading="loading" :data="classList" ref="table" style="overflow: auto;">
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="学校" align="center" prop="schoolName" />
<el-table-column v-if="queryParams.classType == '0'" label="学校" align="center" prop="schoolName" />
<el-table-column label="班级名称" align="center" prop="trainClassName" />
<el-table-column label="班级代号" align="center" prop="trainClassCode" />
<el-table-column v-if="queryParams.classType == '0'" label="班级代号" align="center" prop="trainClassCode" />
<!-- <el-table-column label="班级人数" align="center" prop="classSize" /> -->
<el-table-column label="班级类型" align="center" prop="registrationStartTime">
<!-- <el-table-column label="班级类型" align="center" prop="registrationStartTime">
<template slot-scope="scope">
<span style="color:#F56C6C;" v-if="scope.row.classType == 0">校企合作班</span>
<span style="color: #E6A23C;" v-if="scope.row.classType == 1">线下培训进阶班</span>
<span style="color:brown;" v-if="scope.row.classType == 2">可靠性人才培训班</span>
<span style="color:black;" v-if="scope.row.classType == 3">师资培训班</span>
<span style="color:cornflowerblue;" v-if="scope.row.classType == 4">线上培训班</span>
</template>
</el-table-column> -->
<el-table-column v-if="queryParams.classType != '4'" label="培训教师" align="center" prop="teacherName" />
<el-table-column v-if="queryParams.classType != '4'" label="报名开始时间" align="center"
prop="registrationStartTime">
<template slot-scope="scope">
<span v-if="scope.row.classType == 0">校企合作班</span>
<span v-if="scope.row.classType == 1">线下培训进阶班</span>
<span v-if="scope.row.classType == 2">可靠性人才培训班</span>
<span v-if="scope.row.classType == 3">师资培训班</span>
{{ (scope.row.registrationStartTime && scope.row.registrationStartTime.slice(0, 10)) ||
'未录入' }}
</template>
</el-table-column>
<el-table-column label="培训教师" align="center" prop="teacherName" />
<el-table-column label="报名开始时间" align="center" prop="registrationStartTime">
<template slot-scope="scope">
{{ (scope.row.registrationStartTime && scope.row.registrationStartTime.slice(0, 10)) || '未录入' }}
</template>
</el-table-column>
<el-table-column label="报名结束时间" align="center" prop="registrationEndTime">
<el-table-column v-if="queryParams.classType != '4'" label="报名结束时间" align="center"
prop="registrationEndTime">
<template slot-scope="scope">
{{ (scope.row.registrationEndTime && scope.row.registrationEndTime.slice(0, 10)) || '未录入' }}
</template>
@ -69,26 +78,31 @@
{{ (scope.row.trainEndTime && scope.row.trainEndTime.slice(0, 10)) || '未录入' }}
</template>
</el-table-column>
<el-table-column label="是否限制人数" align="center" prop="limitApply">
<el-table-column v-if="queryParams.classType != '4'" label="是否限制人数" align="center" prop="limitApply">
<template slot-scope="scope">
{{ scope.row.limitApply == 1 ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="已报名/总人数" align="center" prop="classSize">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="searchUp(scope.row)">{{
scope.row.ratio || '暂无信息'
}}</el-button>
<el-button size="mini" type="text"
:style="(scope.row.classType == 4) ? 'color:#000;cursor: default;' : ''"
@click="searchUp(scope.row)">{{ scope.row.ratio || '暂无信息' }}</el-button>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<!-- 1 报名未开始2 报名中 3 报名结束未开课4 开课中5 已结束 status字段 -->
<span v-if="scope.row.status == 1">报名未开始</span>
<span v-if="scope.row.status == 2">报名中</span>
<!-- <span v-if="scope.row.status == 1">报名未开始</span>
<span style="color:#E6A23C;" v-if="scope.row.status == 2">报名中</span>
<span v-if="scope.row.status == 3">报名结束未开课</span>
<span v-if="scope.row.status == 4">开课中</span>
<span v-if="scope.row.status == 5">已结束</span>
<span style="color:#67C23A" v-if="scope.row.status == 4">开课中</span>
<span style="color:#F56C6C;" v-if="scope.row.status == 5">已结束</span> -->
<el-tag v-if="scope.row.status == 4">开课中</el-tag>
<el-tag v-if="scope.row.status == 2" type="success">报名中</el-tag>
<el-tag v-if="scope.row.status == 1" type="info">报名未开始</el-tag>
<el-tag v-if="scope.row.status == 3" type="warning">报名结束未开课</el-tag>
<el-tag v-if="scope.row.status == 5" type="danger">已结束</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
@ -97,7 +111,10 @@
@click="setSignTab(scope.row)">配置报名表</el-button>
<el-button size="mini" type="text" @click="modify(scope.row)">修改</el-button>
<el-button size="mini" type="text" @click="delrow(scope.row)">删除</el-button>
<el-button size="mini" type="text" @click="option(scope.row)">考勤</el-button>
<el-button v-show="scope.row.classType != 4" size="mini" type="text"
@click="option(scope.row)">考勤</el-button>
<el-button v-if="scope.row.classType != 4" size="mini" type="text"
@click="copyClass(scope.row)">拷贝</el-button>
</template>
</el-table-column>
</el-table>
@ -105,7 +122,25 @@
:limit.sync="queryParams.pageSize" @pagination="getList" />
<el-dialog class="diaform" :title="title" :visible.sync="visibleopen" :close-on-click-modal="false"
width="800px" append-to-body @close="colsedia">
<el-form :model="form" :rules="rules" ref="form" label-width="120px" inline>
<el-form v-if="title == '拷贝课程'" :model="copyClassForm" :rules="copyClassRules" ref="copyClassForm">
<div style="width: 400px;margin: 0 auto;">
<el-form-item label="选择目标班级" prop="targetClass">
<el-select v-model="copyClassForm.targetClass" placeholder="选择目标班级">
<el-option v-for="item in classOptions" :key="item.trainClassId"
:label="item.trainClassName" :value="item.trainClassId">
</el-option>
</el-select>
</el-form-item>
</div>
<el-form-item style="width: 400px;margin: 0 auto;text-align: center;margin-top: 30px;">
<el-button type="primary" style="width: 135px; font-size: 16px; height: 39px; line-height: 11px"
@click="copyClassSub('confirm')">确认</el-button>
<el-button style="width: 135px; font-size: 16px; height: 39px; line-height: 11px; margin-left: 30px"
@click="colsedia">取消</el-button>
</el-form-item>
</el-form>
<el-form v-else :model="form" :rules="rules" ref="form" label-width="120px" inline>
<!-- 类型 -->
<el-form-item label="培训班类型" prop="classType">
<el-select v-model="form.classType" @change="classTypeChange">
@ -216,9 +251,17 @@
<el-button type="primary" @click="jsonsubmit"> </el-button>
</span>
</el-dialog>
<!-- <format-form></format-form> -->
</div>
</template>
<script>
const classMap = [
{ type: '校企合作班', value: '0' },
{ type: '线下培训进阶班', value: '1' },
{ type: '可靠性人才培训班', value: '2' },
{ type: '师资培训班', value: '3' },
{ type: '线上培训班', value: '4' }
]
import {
getSchoolList,
getSignUpList,
@ -228,16 +271,21 @@ import {
searchNum,
listTeacherAll,
setJson,
getClassList,
copyClassInfo
} from '@/api/trainService/index.js'
// import formatForm from '@/components/formatForm/index'
import ImageUpload from '@/components/ImgUpload/index.vue'
import NonimageUpload from '@/views/components/NonimageUpload'
// 1 2 3 4 5 status
import JsonTool from '@/components/jsonTool'
export default {
name: 'peixunbaoming',
components: { ImageUpload, NonimageUpload, JsonTool },
// formatForm
components: { ImageUpload, NonimageUpload, JsonTool , },
data() {
return {
classMap: classMap,
teacherList: [],
imgAction: process.env.VUE_APP_BASE_API + '/upload',
loading: false,
@ -249,18 +297,27 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 20,
classType: null,
classType: '0',
},
queryParamss: {
pageNum: 1,
pageSize: 10,
},
classOptions: [],
totals: 0,
activeName: '0',
title: '新增班级',
visibleopen: false,
form: {
classType: 0,
limitApply: '1',
limitApply: '0',
},
// FORM
copyClassForm: {
targetClass: ''
},
copyClassRules: {
targetClass: [{ required: true, message: '请选择目标班级', trigger: 'change' }],
},
rules: {
classType: [{ required: true, message: '请输入培训班类型', trigger: 'change' }],
@ -348,6 +405,11 @@ export default {
async getList() {
const res = await getSignUpList(this.queryParams)
this.total = res.total
// res.rows.form(item=>{
// if(!item.teacherName && item.instructor){
// item.teacherName = item.instructor
// }
// })
this.classList = res.rows
},
//
@ -355,11 +417,18 @@ export default {
this.title = '新增班级'
this.visibleopen = true
},
handleClick() {
this.form.classType = this.queryParams.classType * 1
this.classList = []
this.$nextTick(() => {
this.$refs.table.doLayout()
})
this.getList()
},
//
async modify(row) {
this.title = '修改班级'
this.visibleopen = true
this.form = row
this.form = JSON.parse(JSON.stringify(row))
// 线
if (row.classType == 4) {
this.rules.trainStartTime = []
@ -381,6 +450,7 @@ export default {
this.$refs.packageUpload.setToolFileList(packageFile)
})
}
this.visibleopen = true
},
option(row) {
console.log(row);
@ -392,6 +462,34 @@ export default {
},
})
},
async copyClass(row) {
this.title = '拷贝课程'
this.form = JSON.parse(JSON.stringify(row))
const obj = {
classType: this.queryParams.classType
}
const res = await getClassList(obj)
console.log(res);
this.classOptions = res.data
this.visibleopen = true
},
copyClassSub() {
const classId = this.form.trainClassId
const target = this.copyClassForm.targetClass
this.$refs['copyClassForm'].validate((valid) => {
if (valid) {
copyClassInfo(classId, target).then(res => {
if (res) {
if (res.code == 200) {
this.$message.success("拷贝成功")
}
this.colsedia()
}
})
}
})
},
async delrow(row) {
this.$confirm('是否确认删除培训班?', '提示', {
confirmButtonText: '确定',
@ -423,6 +521,7 @@ export default {
})
} else {
addSignUp(this.form).then((res) => {
console.log(res);
this.$message.success('新增成功')
this.colsedia()
this.getList()
@ -433,12 +532,18 @@ export default {
},
//
colsedia() {
this.$refs['form'].resetFields()
this.visibleopen = false
this.$refs['form']?.resetFields()
this.$refs['copyClassForm']?.resetFields()
this.copyClassForm = {
targetClass: ''
}
this.form = {
classType: 0,
limitApply: '1',
limitApply: '0',
}
this.$nextTick(() => {
this.visibleopen = false
})
},
handleQuery() {
this.getList()
@ -451,6 +556,7 @@ export default {
searchUp(rwo) {
// this.activeR = rwo
// this.getStudentList()
if (rwo.classType == 4) { return }
this.$router.push(`/signupStudent?id=${rwo.trainClassId}&type=${rwo.classType}&name=${rwo.trainClassName}`)
rwo.data && localStorage.setItem('jsondata', rwo.data)
@ -483,5 +589,6 @@ export default {
<style lang="scss" scoped>
::v-deep .el-radio-group {
width: 220px;
}
</style>

@ -0,0 +1,501 @@
<template>
<div class="container" style="padding: 30px">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"
style="display: flex; justify-content: space-between">
<div style="display: flex">
<el-form-item label="学校名称" prop="schoolName">
<!-- <el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable size="small" /> -->
<el-select v-model="queryParams.schoolName">
<el-option v-for="it in schoolList" :key="it.schoolId" :label="it.schoolName"
:value="it.schoolName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="班级名称" prop="trainClassName">
<el-input v-model="queryParams.trainClassName" placeholder="请输入班级名称" clearable size="small" />
</el-form-item>
<el-form-item label="班级类型" prop="classType">
<!-- <el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable size="small" /> -->
<el-select v-model="queryParams.classType">
<el-option label="校企合作班" :value="0"></el-option>
<el-option label="线下培训进阶班" :value="1"></el-option>
<el-option label="可靠性人才培训班" :value="2"></el-option>
<el-option label="师资培训班" :value="3"></el-option>
<el-option label="线上培训班" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</div>
</el-form>
<div style="margin-top: 5px; margin-bottom: 20px">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="addsign">新增</el-button>
</div>
<el-table v-loading="loading" :data="classList">
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="学校" align="center" prop="schoolName" />
<el-table-column label="班级名称" align="center" prop="trainClassName" />
<el-table-column label="班级代号" align="center" prop="trainClassCode" />
<!-- <el-table-column label="班级人数" align="center" prop="classSize" /> -->
<el-table-column label="班级类型" align="center" prop="registrationStartTime">
<template slot-scope="scope">
<span style="color:#F56C6C;" v-if="scope.row.classType == 0">校企合作班</span>
<span style="color: #E6A23C;" v-if="scope.row.classType == 1">线下培训进阶班</span>
<span style="color:brown;" v-if="scope.row.classType == 2">可靠性人才培训班</span>
<span style="color:black;" v-if="scope.row.classType == 3">师资培训班</span>
<span style="color:cornflowerblue;" v-if="scope.row.classType == 4">线上培训班</span>
</template>
</el-table-column>
<el-table-column label="培训教师" align="center" prop="teacherName" />
<el-table-column label="报名开始时间" align="center" prop="registrationStartTime">
<template slot-scope="scope">
{{ (scope.row.registrationStartTime && scope.row.registrationStartTime.slice(0, 10)) || '未录入' }}
</template>
</el-table-column>
<el-table-column label="报名结束时间" align="center" prop="registrationEndTime">
<template slot-scope="scope">
{{ (scope.row.registrationEndTime && scope.row.registrationEndTime.slice(0, 10)) || '未录入' }}
</template>
</el-table-column>
<el-table-column label="培训开始时间" align="center" prop="trainStartTime">
<template slot-scope="scope">
{{ (scope.row.trainStartTime && scope.row.trainStartTime.slice(0, 10)) || '未录入' }}
</template>
</el-table-column>
<el-table-column label="培训结束时间" align="center" prop="trainEndTime">
<template slot-scope="scope">
{{ (scope.row.trainEndTime && scope.row.trainEndTime.slice(0, 10)) || '未录入' }}
</template>
</el-table-column>
<el-table-column label="是否限制人数" align="center" prop="limitApply">
<template slot-scope="scope">
{{ scope.row.limitApply == 1 ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="已报名/总人数" align="center" prop="classSize">
<template slot-scope="scope">
<el-button size="mini" type="text"
:style="(scope.row.classType == 4) ? 'color:#000;cursor: default;' : ''"
@click="searchUp(scope.row)">{{
scope.row.ratio || '暂无信息'
}}</el-button>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<!-- 1 报名未开始2 报名中 3 报名结束未开课4 开课中5 已结束 status字段 -->
<span v-if="scope.row.status == 1">报名未开始</span>
<span style="color:#E6A23C;" v-if="scope.row.status == 2">报名中</span>
<span v-if="scope.row.status == 3">报名结束未开课</span>
<span style="color:#67C23A" v-if="scope.row.status == 4">开课中</span>
<span style="color:#F56C6C;" v-if="scope.row.status == 5">已结束</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button size="mini" type="text" v-if="scope.row.classType == 3"
@click="setSignTab(scope.row)">配置报名表</el-button>
<el-button size="mini" type="text" @click="modify(scope.row)">修改</el-button>
<el-button size="mini" type="text" @click="delrow(scope.row)">删除</el-button>
<el-button v-show="scope.row.classType != 4" size="mini" type="text"
@click="option(scope.row)">考勤</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<el-dialog class="diaform" :title="title" :visible.sync="visibleopen" :close-on-click-modal="false"
width="800px" append-to-body @close="colsedia">
<el-form :model="form" :rules="rules" ref="form" label-width="120px" inline>
<!-- 类型 -->
<el-form-item label="培训班类型" prop="classType">
<el-select v-model="form.classType" @change="classTypeChange">
<el-option label="校企合作班" :value="0"></el-option>
<el-option label="线下培训进阶班" :value="1"></el-option>
<el-option label="可靠性人才培训班" :value="2"></el-option>
<el-option label="师资培训班" :value="3"></el-option>
<el-option label="线上培训班" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="培训教师" prop="teacherName" v-if="form.classType != 4">
<el-select allow-create filterable v-model="form.teacherName">
<el-option v-for="it in teacherList" :key="it.talent_id" :label="it.name"
:value="it.name"></el-option>
</el-select>
</el-form-item>
<el-form-item label="学校名称" prop="schoolId" v-if="form.classType == 0">
<el-select v-model="form.schoolId">
<el-option v-for="it in schoolList" :key="it.schoolId" :label="it.schoolName"
:value="it.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="班级代号" prop="trainClassCode" v-if="form.classType == 0">
<el-input v-model="form.trainClassCode" placeholder="请输入班级代号" clearable size="small" />
</el-form-item>
<el-form-item label="班级名称" prop="trainClassName">
<el-input v-model="form.trainClassName" placeholder="请输入班级名称" clearable size="small" />
</el-form-item>
<el-form-item label="班级等级" prop="classLevel" v-if="(form.classType != 0) && (form.classType != 4)">
<el-select v-model="form.classLevel">
<el-option label="初级" :value="0"></el-option>
<el-option label="中级" :value="1"></el-option>
<el-option label="高级" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="班级人数" prop="classSize" v-if="form.classType != 4">
<el-input v-model="form.classSize" placeholder="请输入班级人数" clearable size="small" />
</el-form-item>
<!-- 是否限制人数 -->
<el-form-item label="是否限制人数" prop="limitApply" class="limitApply" v-if="form.classType != 4">
<el-radio-group v-model="form.limitApply">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="报名开始时间" prop="registrationStartTime" v-if="form.classType != 4">
<el-date-picker clearable size="small" v-model="form.registrationStartTime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="报名开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="报名结束时间" prop="registrationEndTime" v-if="form.classType != 4">
<el-date-picker clearable size="small" v-model="form.registrationEndTime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="报名结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="培训开始时间" prop="trainStartTime">
<el-date-picker clearable size="small" v-model="form.trainStartTime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="培训开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="培训结束时间" prop="trainEndTime">
<el-date-picker clearable size="small" v-model="form.trainEndTime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="培训结束时间">
</el-date-picker>
</el-form-item>
<br />
<el-form-item label="资料" prop="attachment" v-if="form.classType == 0">
<el-input v-model="form.attachment" v-show="false" :limit="1"></el-input>
<nonimage-upload ref="packageUpload" :limitRemark="',文件请选用压缩包格式'" :limit="1"
@setImgPath="setPackagePath" imageType="zip|rar" />
</el-form-item>
<!-- 编辑json -->
<el-form-item style="padding-left: 170px">
<el-button type="primary" style="width: 135px; font-size: 16px; height: 39px; line-height: 11px"
@click="submitto('confirm')">确认</el-button>
<el-button style="width: 135px; font-size: 16px; height: 39px; line-height: 11px; margin-left: 30px"
@click="colsedia">取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
<!-- 详细学生信息弹层 -->
<el-dialog class="diaform" title="报名学生信息" :visible.sync="studentOpen" :close-on-click-modal="false"
width="1200px" append-to-body>
<el-table :data="studentList">
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="学号" align="center" prop="studentCode" v-if="activeR.classType == 0" />
<el-table-column label="姓名" align="center" prop="studentName" />
<el-table-column label="所属学院" align="center" prop="homeCollege" v-if="activeR.classType == 0" />
<el-table-column label="专业名称" align="center" prop="majorName" v-if="activeR.classType == 0" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="报名时间" align="center" prop="registrationTime" />
</el-table>
<pagination v-show="totals > 0" :total="totals" :page.sync="queryParamss.pageNum"
:limit.sync="queryParamss.pageSize" @pagination="getStudentList" />
</el-dialog>
<!-- json弹层 -->
<el-dialog title="报名表配置" :visible.sync="signTable" :close-on-click-modal="false" width="800px" append-to-body>
<JsonTool ref="jsontool" />
<div>
name为标题type为类型(input输入框;radio单选框;textarea文本域)key为标题标识须一致value为单选框选项
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="jsoncancle"> </el-button>
<el-button type="primary" @click="jsonsubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getSchoolList,
getSignUpList,
addSignUp,
updateSignUp,
delSignUp,
searchNum,
listTeacherAll,
setJson,
} from '@/api/trainService/index.js'
import ImageUpload from '@/components/ImgUpload/index.vue'
import NonimageUpload from '@/views/components/NonimageUpload'
// 1 2 3 4 5 status
import JsonTool from '@/components/jsonTool'
export default {
name: 'peixunbaoming',
components: { ImageUpload, NonimageUpload, JsonTool },
data() {
return {
teacherList: [],
imgAction: process.env.VUE_APP_BASE_API + '/upload',
loading: false,
classList: [],
schoolList: [],
//
total: 0,
//
queryParams: {
pageNum: 1,
pageSize: 20,
classType: null,
},
queryParamss: {
pageNum: 1,
pageSize: 10,
},
totals: 0,
title: '新增班级',
visibleopen: false,
form: {
classType: 0,
limitApply: '0',
},
rules: {
classType: [{ required: true, message: '请输入培训班类型', trigger: 'change' }],
schoolId: [{ required: true, message: '请选择学校', trigger: 'change' }],
teacherName: [{ required: true, message: '请选择教师', trigger: 'change' }],
trainClassCode: [{ required: true, message: '请输入班级代号', trigger: 'blur' }],
trainClassName: [{ required: true, message: '请输入班级名称', trigger: 'blur' }],
limitApply: [{ required: true, message: '请选择是否限制人数', trigger: 'change' }],
classSize: [
{
required: true,
message: '请输入班级人数',
trigger: blur,
},
],
classLevel: [{ required: true, message: '请输入班级等级', trigger: 'change' }],
registrationStartTime: [{ required: true, message: '报名开始时间', trigger: 'blur' }],
registrationEndTime: [{ required: true, message: '报名结束时间', trigger: 'blur' }],
trainStartTime: [{ required: true, message: '培训开始时间', trigger: 'blur' }],
trainEndTime: [{ required: true, message: '培训结束时间', trigger: 'blur' }],
},
studentList: [],
studentOpen: false,
activeR: {},
// Json
signTable: false,
activeRowId: '',
}
},
mounted() { },
methods: {
// json
setSignTab(row) {
this.signTable = true
this.activeRowId = row.trainClassId
this.$nextTick(() => {
if (row.data) {
this.$refs.jsontool.jsonData = row.data
this.$refs.jsontool.formatCode()
} else {
this.$refs.jsontool.jsonData =
'[{"name":"姓名","type":"input","key":"name","value":""},{"title":"在校职务","type":"input","key":"title","value":""},{"mobile":"手机号","type":"input","key":"mobile","value":""},{"college":"院校全称","type":"input","key":"college","value":""},{"address":"院校所在地址","type":"input","key":"address","value":""},{"payType":"培训付款方式","type":"radio","key":"payType","value":["公对公转账,请于报到前提供截图","现场支付(公务卡、微信、支付宝、现金)"]},{"sex":"性别","type":"radio","key":"sex","value":["男","女"]},{"hotel":"是否需要统一安排住宿","type":"radio","key":"hotel","value":["大床房(付房费全额)","标间(独立居住、付全额房费)","标间(拼房、付房费一半),无指定合住人员","标间(拼房、付房费一半),指定合住人员","其他,请说明,包括非指定日期的订房","无须订房,自行安排"]},{"addWeixin":"是否添加业务负责人微信","type":"radio","key":"addWeixin","value":["是","否"]},{"suggestion":"针对此次培训,您还有什么建议","type":"textarea","key":"suggestion","value":""}]'
this.$refs.jsontool.formatCode()
}
this.$refs.jsontool.formatCode()
})
},
jsoncancle() {
this.signTable = false
},
jsonsubmit() {
const flag = this.$refs.jsontool.onSubumit()
if (flag) {
const jsonstr = this.$refs.jsontool.jsonData
setJson({ data: jsonstr, trainClassId: this.activeRowId })
.then((res) => {
this.$message.success('配置成功')
this.getList()
this.signTable = false
})
.catch((error) => { })
} else {
this.$message.warning('请检查JSON数据格式')
}
},
// json
//
async getTeacherList() {
const res = await listTeacherAll()
this.teacherList = res
},
//
setPackagePath(value) {
this.form.attachment = value
},
//
async getSchoolListFn() {
const res = await getSchoolList({
pageNum: 1,
pageSize: 999,
})
this.schoolList = res.rows
},
async getList() {
const res = await getSignUpList(this.queryParams)
this.total = res.total
// res.rows.form(item=>{
// if(!item.teacherName && item.instructor){
// item.teacherName = item.instructor
// }
// })
this.classList = res.rows
},
//
addsign() {
this.title = '新增班级'
this.visibleopen = true
},
//
async modify(row) {
this.title = '修改班级'
this.form =JSON.parse(JSON.stringify(row))
// 线
if (row.classType == 4) {
this.rules.trainStartTime = []
this.rules.trainEndTime = []
} else {
this.rules.trainStartTime = [{ required: true, message: '培训开始时间', trigger: 'blur' }]
this.rules.trainEndTime = [{ required: true, message: '培训结束时间', trigger: 'blur' }]
}
//
if (row.attachment) {
let packageFile = [
{
name: '资料',
url: row.attachment,
filePath: row.attachment,
},
]
this.$nextTick(() => {
this.$refs.packageUpload.setToolFileList(packageFile)
})
}
this.visibleopen = true
},
option(row) {
console.log(row);
this.$router.push({
path: '/attendanceList',
query: {
name: row.trainClassName,
id: row.trainClassId,
},
})
},
async delrow(row) {
this.$confirm('是否确认删除培训班?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delSignUp(row.trainClassId).then((res) => {
this.getList()
this.$message.success('删除成功')
})
})
.catch(() => { })
},
//
async submitto() {
if (this.form.schoolId) {
const schoolinfo = this.schoolList.find((it) => it.schoolId == this.form.schoolId)
this.form.schoolName = schoolinfo.schoolName
}
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.trainClassId) {
//
updateSignUp(this.form).then((res) => {
this.$message.success('修改成功')
this.colsedia()
this.getList()
})
} else {
addSignUp(this.form).then((res) => {
this.$message.success('新增成功')
this.colsedia()
this.getList()
})
}
}
})
},
//
colsedia() {
this.$refs['form'].resetFields()
console.log(this.form);
this.form = {
classType: 0,
limitApply: '0',
}
this.$nextTick(() => {
this.visibleopen = false
})
},
handleQuery() {
this.getList()
},
resetQuery() {
this.resetForm('queryForm')
this.getList()
},
//
searchUp(rwo) {
// this.activeR = rwo
// this.getStudentList()
if (rwo.classType == 4) { return }
this.$router.push(`/signupStudent?id=${rwo.trainClassId}&type=${rwo.classType}&name=${rwo.trainClassName}`)
rwo.data && localStorage.setItem('jsondata', rwo.data)
},
async getStudentList() {
const res = await searchNum(this.activeR.trainClassId)
this.studentOpen = true
this.studentList = res.rows
this.totals = res.total
},
classTypeChange(e) {
console.log(e);
if (e == 4) {
this.rules.trainStartTime = []
this.rules.trainEndTime = []
} else {
this.rules.trainStartTime = [{ required: true, message: '培训开始时间', trigger: 'blur' }]
this.rules.trainEndTime = [{ required: true, message: '培训结束时间', trigger: 'blur' }]
}
}
},
created() {
this.getList()
this.getSchoolListFn()
this.getTeacherList()
},
}
</script>
<style lang="scss" scoped>
::v-deep .el-radio-group {
width: 220px;
}
</style>

@ -16,8 +16,8 @@
<el-form-item label="专业" prop="majorName" v-if="$route.query.type == 0">
<el-input v-model="queryParamss.majorName" placeholder="请输入专业" clearable size="small" />
</el-form-item>
<el-form-item label="结课报告" prop="majorName" v-if="$route.query.type == 0">
<el-select v-model="queryParamss.major" placeholder="" style="width: 100px;">
<el-form-item label="结课报告" prop="reportName" v-if="$route.query.type == 0">
<el-select v-model="queryParamss.reportName" placeholder="是否上传" style="width: 100px;">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
@ -29,11 +29,13 @@
</el-form>
<el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px"
@click="exporExcel">导出为excel</el-button>
<el-button icon="el-icon-download" type="success" size="small" style="margin-bottom: 20px"
@click="exportEvaReport('multify')">导出评价</el-button>
<el-button icon="el-icon-download" type="primary" size="small" style="margin-bottom: 20px"
@click="downloadReport('multify')">下载</el-button>
<!-- 详细学生信息弹层 -->
<el-table v-if="$route.query.type != 3" :data="studentList" v-loading="loading"
@selection-change="handleSelectionChange">
:default-sort="{ prop: 'asseGradeVag', order: 'descending' }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="学号" align="center" prop="studentCode" v-if="$route.query.type == 0" />
@ -58,24 +60,39 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="评分(次数)" sortable align="center" prop="asseGradeVag">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="evaluateContend(scope.row)">{{ scope.row.asseGradeVag ? (
scope.row.asseGradeVag + '(' + scope.row.asseCount + ')') : '' }}</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" v-if="scope.row.remark"
@click="editRemark(scope.row)">修改备注</el-button>
<el-button size="mini" type="text" v-else @click="addRemark(scope.row)">添加备注</el-button>
<el-button size="mini" type="text" @click="delRow(scope.row)">删除</el-button>
<el-button size="mini" type="text" @click="evaluate(scope.row)">去评价</el-button>
</template>
</el-table-column>
</el-table>
<el-table v-else :data="teacherList" v-loading="loading">
<el-table v-else :data="teacherList" v-loading="loading"
:default-sort="{ prop: 'asseGradeVag', order: 'descending' }">
<el-table-column label="序号" align="center" type="index" />
<el-table-column v-for="it in headerList" :key="it" :label="headerData[it]" align="center" :prop="it" />
<el-table-column label="评分(次数)" sortable align="center" prop="asseGradeVag">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="evaluateContend(scope.row)">{{ scope.row.asseGradeVag ? (
scope.row.asseGradeVag + '(' + scope.row.asseCount + ')') : '' }}</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" v-if="scope.row.remark"
@click="editRemark(scope.row)">修改备注</el-button>
<el-button size="mini" type="text" v-else @click="addRemark(scope.row)">添加备注</el-button>
<el-button size="mini" type="text" @click="delRow(scope.row)">删除</el-button>
<el-button size="mini" type="text" @click="evaluate(scope.row)">去评价</el-button>
</template>
</el-table-column>
</el-table>
@ -83,13 +100,67 @@
:limit.sync="queryParamss.pageSize" @pagination="getStudentList" />
<!-- 弹层 -->
<el-dialog class="diaform" :title="title" :visible.sync="visibleopen" :close-on-click-modal="false"
width="500px" append-to-body @close="colsedia">
<el-form :model="form" :rules="rules" ref="form">
width="650px" append-to-body @close="colsedia">
<el-form v-show="currentType === 'remark'" :model="form" :rules="rules" ref="Form" label-width="80px">
<!-- 类型 -->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" clearable size="small" type="textarea" />
<el-input v-model="form.remark" placeholder="请输入备注" clearable type="textarea" />
</el-form-item>
</el-form>
<el-form v-show="currentType === 'evaluate'" :model="evaForm" :rules="evaFormrules" ref="evaForm"
label-width="150px">
<!-- 类型 -->
<el-form-item label="日期" prop="assessmentDate">
<el-date-picker v-model="evaForm.assessmentDate" :default-value="new Date()" style="width: 340px"
value-format="yyyy-MM-dd" placeholder="请选择评价日期"></el-date-picker>
</el-form-item>
<el-form-item label="评分" prop="grade">
<el-input v-model="evaForm.grade" type="number" style="width: 340px" placeholder="请输入评分" />
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model="evaForm.content" style="width: 340px" placeholder="请输入评价内容" clearable
type="textarea" />
</el-form-item>
</el-form>
<div v-show="currentType === 'evaContent'">
<h3 style="text-align: center;font-weight: bold;margin: 0;">平均分<span class="scoreNum">{{ asseGradeVag
}}</span></h3>
<div style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 3px;">
<div style="text-align: center;margin-left: -10px;">总数:{{ asseCount }}</div>
<div class="loadMore" v-if="evaTotal > evaQuery.pageSize" @click="loadMoreEva">加载更多...</div>
<!-- <div class="" v-else>已显示</div> -->
</div>
<div class="evaWrap">
<div v-for="(item, index) in evaList" :key="index" class="evaItem">
<div class="evaItemWrap">
<div class="evaTitle">
<div class="evaHead">
<div class="timeStemp">{{ item.assessmentDate.substr(0, 10) }}</div>
<div><span class="scoreNum">{{ item.grade }}</span></div>
</div>
<div style="padding-right: 10px;">评价老师{{ item.assessmentBy }}</div>
</div>
<div class="evaContend">
<div class="evaHead">
<div class="timeLine"></div>
<el-tooltip v-if="item.content.length > 15" placement="top" effect="light"
class="evaText">
<div slot="content">{{ item.content }}</div>
<div class="">{{ item.content }}</div>
</el-tooltip>
<div v-else class="">{{ item.content }}</div>
</div>
<el-button size="mini" @click="delEva(item)" type="text"
v-show="nickName(item.assessmentBy)"
style="color: red;padding-right: 5px;">删除</el-button>
</div>
</div>
</div>
<div v-show="evaTotal <= evaQuery.pageSize" class="startSteamp">开始</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="colsedia"> </el-button>
<el-button type="primary" @click="submitRemark"> </el-button>
@ -98,8 +169,13 @@
</div>
</template>
<script>
import { searchNum, addRemarkI, delSign, exportExcelF } from '@/api/trainService/index.js'
// const currentTypeMap = {}
import {
searchNum, addRemarkI, delSign, exportExcelF, addStuentEva
, delStudentEva, getStudentEva, exportEva
} from '@/api/trainService/index.js'
import { saveAs } from 'file-saver'
import store from '@/store'
// 1 2 3 4 5 status
export default {
name: 'peixunbaoming',
@ -113,14 +189,16 @@ export default {
pageSize: 10,
studentName: null,
mobile: null,
reportName: '',
majorName: null,
counsellor: null,
counsellorTel: null,
},
totals: 0,
evaList: [],
options: [
{ value: 0, label: '' },
{ value: 1, label: '' }
{ value: '1', label: '已上传' },
{ value: '0', label: '未上传' }
],
studentList: [],
//
@ -134,15 +212,64 @@ export default {
teacherList: [], //
//
headerList: [],
base: process.env.VUE_APP_BASE,
//
evaTotal: 0,
asseGradeVag: 0,
asseCount: 0,
evaQuery: {
pageSize: 5,
pageNum: 1,
},
base: process.env.VUE_APP_BASE_API,
headerData: {},
//
courrentStudnent: {},
currentType: '',
evaForm: {
assessmentDate: '',
grade: NaN,
content: ''
},
evaFormrules: {
assessmentDate: [
{ required: true, message: '请选择评价日期', trigger: 'change' }
],
grade: [
{ required: true, message: '请填写评分', trigger: 'blur' },
{ pattern: /^(([1-9]?\d)|100)$/, message: '请输入0-100的整数', trigger: 'blur' }
],
content: [
{ required: true, message: '请添加评价', trigger: 'blur' },
{ min: 1, max: 500, message: '只能输入1-500个字符', trigger: 'blur' }
],
}
}
},
mounted() {
this.getStudentList()
},
computed: {
nickName() {
return function (myNickName) {
if (store.getters.name == 'admin' || store.getters.name == 'manager') {
return true
} else if (myNickName == store.getters.nickName) {
return true
} else {
return false
}
}
},
average() {
let re = 0
this.evaList.forEach(item => { re += item.grade })
return re / (this.evaList.length)
},
},
methods: {
async getStudentList() {
this.loading = true
if (localStorage.getItem('jsondata')) {
@ -191,6 +318,8 @@ export default {
obj[ite.key] = ite.value
obj.trainingStudentId = item.trainingStudentId
obj.remark = item.remark
obj.asseGradeVag = item.asseGradeVag
obj.asseCount = item.asseCount
})
newData.push(obj)
}
@ -206,12 +335,17 @@ export default {
handleQuery() {
this.getStudentList()
},
loadMoreEva() {
this.evaQuery.pageSize = this.evaQuery.pageSize + 5
this.initEvalist()
},
resetQuery() {
this.resetForm('queryForm')
this.getStudentList()
},
//
delRow(row) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -225,8 +359,36 @@ export default {
})
.catch(() => { })
},
//
evaluate(row) {
this.courrentStudnent = row
this.title = '添加评价'
this.currentType = 'evaluate'
this.visibleopen = true
},
async evaluateContend(row) {
this.courrentStudnent = row
this.title = '查看评分'
this.currentType = 'evaContent'
await this.initEvalist()
this.asseGradeVag = row.asseGradeVag
this.asseCount = row.asseCount
this.visibleopen = true
},
initEvalist() {
getStudentEva(this.courrentStudnent.trainingStudentId, this.evaQuery).then(res => {
this.evaList = res.rows
this.evaTotal = res.total
if (this.evaList.length == 0) {
this.visibleopen = false
this.getStudentList()
}
})
},
//
addRemark(row) {
this.currentType = 'remark'
this.title = '添加备注'
this.visibleopen = true
// trainClassId trainingStudentId userId
@ -234,6 +396,7 @@ export default {
},
//
editRemark(row) {
this.currentType = 'remark'
this.rowId = row.trainingStudentId
this.visibleopen = true
this.title = '修改备注'
@ -241,24 +404,66 @@ export default {
},
//
submitRemark() {
this.$refs['form'].validate((valid) => {
if (valid) {
addRemarkI({ trainingStudentId: this.rowId, remark: this.form.remark }).then(() => {
this.$message.success('备注成功!')
this.getStudentList()
this.colsedia()
})
}
if (this.currentType == 'remark') {
this.$refs['form'].validate((valid) => {
if (valid) {
addRemarkI({ trainingStudentId: this.rowId, remark: this.form.remark }).then(() => {
this.$message.success('备注成功!')
this.getStudentList()
this.colsedia()
})
}
})
} else if (this.currentType == 'evaluate') {
this.$refs['evaForm'].validate((valid) => {
if (valid) {
const data = JSON.parse(JSON.stringify(this.evaForm))
// data.grade = data.grade*1
data['studentId'] = this.courrentStudnent.trainingStudentId
data.assessmentDate = data.assessmentDate
addStuentEva(data).then(() => {
this.$message.success('评价成功')
this.getStudentList()
this.colsedia()
})
}
})
}
},
//
delEva(row) {
this.$confirm('此操作将永久删除该评价, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delStudentEva(row.assessmentId).then(res => {
// getStudentEva(this.courrentStudnent.trainingStudentId)
this.initEvalist()
this.$message({
type: 'success',
message: '删除成功!'
});
})
})
},
//
colsedia() {
this.$refs['evaForm']?.resetFields()
this.evaList = []
this.evaQuery = {
pageSize: 5,
pageNum: 1
}
this.evaTotal = 0
this.form = {}
this.visibleopen = false
},
// excel
exporExcel() {
exportExcelF(this.$route.query.id).then((res) => {
exportExcelF(this.$route.query.id, this.queryParamss).then((res) => {
const blob = new Blob([res])
saveAs(blob, this.$route.query.name + '报名表.xlsx')
})
@ -266,22 +471,181 @@ export default {
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
async exportEvaReport() {
if (this.multipleSelection.length == 0) {
return
}
const ids = this.multipleSelection.map(item => {
return item.trainingStudentId
})
const res = await exportEva({ 'ids': ids })
const blob = new Blob([res])
saveAs(blob, this.$route.query.name + '评价表.xlsx')
},
downloadReport(val) {
function downPdf(val) {
fetch(val).then(respose => {
return respose.blob()
}).then(blob => {
const url = URL.createObjectURL(blob)
const a = document.createElement("a")
const name = val.substr(val.lastIndexOf('/') + 1, val.length)
a.href = url
a.download = name
a.click()
})
}
// return
if (val === 'multify') {
const self = this
this.multipleSelection.forEach(item => {
if (item.reportAttachment) {
console.log(item.reportAttachment);
window.open(this.base + item.reportAttachment)
downPdf(this.base + item.reportAttachment)
// const iframe = document.createElement("iframe");
// iframe.style.display = "none"; //
// iframe.style.height = "0"; // 0
// iframe.src = this.base + item.reportAttachment; //
// document.body.appendChild(iframe); // iframedom
// // this.$nextTick(()=>{
// // document.body.removeChild(iframe)
// // })
// setTimeout(() => {
// document.body.removeChild(iframe);
// }, 1000)
// }
}
})
} else if (val) {
window.open(this.base + val)
downPdf(this.base + val)
}
}
},
created() { },
created() {
console.log();
},
}
</script>
<style lang="scss" scoped></style>
<style lang="scss">
.scoreNum {
color: #fbaa10;
}
.el-tooltip__popper.is-light {
width: 300px !important;
overflow: hidden;
}
.loadMore {
text-align: center;
color: rgb(24, 144, 255);
cursor: pointer;
}
.evaWrap {
padding: 0 10px;
max-height: 500px;
overflow: auto;
.evaHead {
display: flex;
align-items: center;
.evaText {
width: 500px;
line-height: 40px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
}
}
.startSteamp {
width: 100px;
font-weight: bold;
padding-left: 20px;
color: #676768;
position: relative;
&::before {
content: ' ';
position: absolute;
margin-top: 5px;
left: -2px;
width: 10px;
border-radius: 50%;
height: 10px;
background-color: #aeb0b6;
}
}
.evaItemWrap {
border-radius: 4px;
border: 1px solid #ebeef5;
margin-left: 10px;
padding: 5px;
border-radius: 5px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1)
}
.evaItem {
margin-top: 5px;
.evaTitle {
display: flex;
align-items: center;
justify-content: space-between;
// background-color: #6767682a;
border-radius: 5px;
.timeStemp {
font-weight: bold;
color: #676768;
width: 100px;
padding-left: 10px;
}
}
.evaContend {
padding-right: 5px;
display: flex;
align-items: center;
height: 40px;
justify-content: space-between;
// background-color: #6767685b;
margin-left: 10px;
.timeLine {
width: 0px;
height: 50px;
position: relative;
&::before {
content: ' ';
position: absolute;
margin-top: -5px;
left: -24px;
width: 2px;
height: 75px;
background-color: #aeb0b6;
border-radius: 2px;
}
&::after {
content: ' ';
position: absolute;
margin-top: -10px;
left: -28px;
width: 10px;
border-radius: 50%;
height: 10px;
background-color: #aeb0b6;
}
}
}
}
}
</style>

Loading…
Cancel
Save