Compare commits

..

No commits in common. 'fc5f33924f577053f0de24b74695fc543644e6f7' and 'd7a2821d197dffab0556326146cf9f6326d1d077' have entirely different histories.

  1. 1
      .env.development
  2. 3
      README.md
  3. 3
      package.json
  4. 30
      src/api/toolInfo/market.js
  5. 355
      src/api/trainService/index.js
  6. 2
      src/components/ImageUpload/index.vue
  7. 81
      src/components/buttonUpload/index.vue
  8. 47
      src/components/formatForm/drective.js
  9. 38
      src/components/formatForm/formOptions.vue
  10. 15
      src/components/formatForm/formResult.vue
  11. 119
      src/components/formatForm/formSource.vue
  12. 78
      src/components/formatForm/index.vue
  13. 27
      src/components/formatForm/indexX.vue
  14. 0
      src/components/formatForm/parseFrom.js
  15. 6
      src/components/formatForm/style.scss
  16. 80
      src/components/formatForm/template.js
  17. 42
      src/components/formatForm/testData.js
  18. 24
      src/components/importCourse/index.vue
  19. 2
      src/layout/components/Sidebar/Logo.vue
  20. 361
      src/router/index.js
  21. 2
      src/settings.js
  22. 1
      src/store/getters.js
  23. 7
      src/store/modules/user.js
  24. 12
      src/utils/index.js
  25. 157
      src/utils/request.js
  26. 29
      src/views/components/CrowdsourceAudit.vue
  27. 55
      src/views/components/TaskInfo.vue
  28. 13
      src/views/components/ToolEdit.vue
  29. 2
      src/views/login.vue
  30. 135
      src/views/manage/order/list.vue
  31. 1
      src/views/manage/tool/list.vue
  32. 2
      src/views/phonelogin.vue
  33. 304
      src/views/system/user/index.vue
  34. 28
      src/views/testModule/index.vue
  35. 324
      src/views/trainService/assignWork.vue
  36. 3
      src/views/trainService/attendanceList.vue
  37. 463
      src/views/trainService/courseManage.vue
  38. 222
      src/views/trainService/importCourse.vue
  39. 68
      src/views/trainService/learnStudent.vue
  40. 43
      src/views/trainService/signInInfoList.vue
  41. 461
      src/views/trainService/signlist.vue
  42. 501
      src/views/trainService/signlist_def.vue
  43. 499
      src/views/trainService/signupStudent.vue

@ -6,7 +6,6 @@ VUE_APP_BASE_API = '/prod-api'
# VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/test-api'
VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999'
# VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999'
# VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/prod-api'
# VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999'

@ -7,14 +7,11 @@ git clone https://gitee.com/y_project/RuoYi-Vue
# 进入项目目录
cd ruoyi-ui
### node版本需求 16.15.0
# 安装依赖
npm install
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npm.taobao.org
npm install --registry=https://registry.npmjs.org/
# 启动服务
npm run dev

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

@ -33,22 +33,22 @@ export function getFunction(toolId) {
// 购买工具支付成功
// export function buyTool(tool) {
// return request({
// url: '/pay/one',
// method: 'post',
// data: tool
// })
// }
export function buyTool(tool) {
return request({
url: '/pay/one',
method: 'post',
data: tool
})
}
// // 购买多个工具支付成功
// export function buyTools(tools) {
// return request({
// url: '/pay/more',
// method: 'post',
// data: tools
// })
// }
// 购买多个工具支付成功
export function buyTools(tools) {
return request({
url: '/pay/more',
method: 'post',
data: tools
})
}
//0元订单支付
export function noPayBuy(tool) {
return request({

@ -1,396 +1,325 @@
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, params) {
export function exportExcelF(id) {
return request({
url: "/train/importStudent/" + id,
method: "get",
params,
responseType: "blob",
});
url: '/train/importStudent/' + id,
method: 'get',
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(params) {
export function getClassList() {
return request({
url: "/train/admin/trainClasses",
method: "get",
params,
});
url: '/train/admin/trainClasses',
method: 'get',
})
}
// 获取所有课程
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) {
return request({
url: "/course/admin/singin/" + id,
method: "get",
params,
});
url: '/course/admin/singin/' + id,
method: 'get',
})
}
// 删除签到信息
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) {
return request({
url: "/course/admin/importSignIn/course/" + id,
method: "get",
params,
responseType: "blob",
});
}
// 获取收入管理信息
export function getInComeInfo(data) {
export function exportSignIn(id) {
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: "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,
});
}
// 导出评价信息
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",
});
}
export function assignHomeWork(data) {
return request({
url: "course/admin/setting/homework",
method: "post",
data,
});
}
// export function updateHomeWork(data) {
// return request({
// url: "/course/admin/course/updateHomework",
// method: "post",
// data
// });
// }
url: '/course/admin/importSignIn/course/' + id,
method: 'get',
responseType: 'blob'
})
}

@ -65,8 +65,6 @@ export default {
this.$emit('input', '')
},
handleUploadSuccess(res) {
console.log(res);
this.$emit('input', res.fileName)
this.loading.close()
},

@ -1,81 +0,0 @@
<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>

@ -1,47 +0,0 @@
/**
* 自定义拖拽指令
* 生命周期指令包括
* bind 第一次绑定在元素上时调用只调用一次
* inserted 元素被插入父节点时调用
* update
* componentUpdate 指令所在组件的 VNode 及其子 VNode 全部更新后调用
* unbind 解绑时调用
*
* mouseEvent类型的事件有
* client 提供事件发生时的应用客户端区域的水平坐标也就是无论是否滚动都会最上方都是0
* ctrlKey ctrl 键被按下返回 true否则返回 false
* layer 往上找有定位属性的父元素的左上角自身有定位属性的话就是相对于自身都没有的话就是相对于body的左上角
* metaKey mac为Matawindows为windows键
* movement 相当于上一次mouseMove的偏移量
* offset 事件对象与目标节点的内填充边padding edge的偏移量
* page 相对于文档的坐标如果向上滚动了200px点击最上方的值为200
* screen 提供鼠标在全局屏幕中的坐标偏移量
*/
export default {
install(Vue) {
Vue.directive("dragme", {
// 指令全局命名为v-dragme
inserted(el) {
el.onmousedowm = function (ev) {
// 获取鼠标按下去时候变量
const disX = ev.clientX - el.offsetLeft;
const disY = ev.clientY - el.offsetTop;
el.onmousemove = function (ev) {
const l = ev.clientX - disX;
const t = ev.clientY - disY;
// 实时设置元素位置
el.style.left = l + "px";
el.style.top = t + "px";
// 获取鼠标移动时的变量
};
el.onmouseup = function () {
// 获取鼠标松开时,销毁所有变量
document.onmousemove = null;
document.onmouseup = null;
};
};
},
});
},
};

@ -1,38 +0,0 @@
<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>

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

@ -1,119 +0,0 @@
<template>
<div class="sourceWrap">
<h3 class="sourceTitle">选择组件</h3>
<div v-for="(form, fIndex) in fomrmSourceList" :key="fIndex">
<div class="diyInpWrap" v-drageme>
<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>

@ -1,78 +0,0 @@
<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>

@ -1,27 +0,0 @@
<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>

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

@ -1,80 +0,0 @@
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
};

@ -1,42 +0,0 @@
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: "",
},
];

@ -1,24 +0,0 @@
<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,317 +28,264 @@ 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/:activeTab",
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: "company",
component: (resolve) =>
require(["@/views/system/user/company/index"], resolve),
name: "company",
meta: { title: "企业认证", icon: "user" },
path: 'profile/:activeTab',
component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
name: 'Profile',
meta: { title: '个人中心', icon: 'user' }
},
{
path: "p2pt",
component: (resolve) =>
require(["@/views/system/user/tester/p2pt"], resolve),
name: "tester",
meta: { title: "测试资质认证", icon: "user" },
path: 'company',
component: (resolve) => require(['@/views/system/user/company/index'], resolve),
name: 'company',
meta: { title: '企业认证', icon: 'user' }
},
{
path: "p2ct",
component: (resolve) =>
require(["@/views/system/user/tester/p2ct"], 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: "c2ct",
component: (resolve) =>
require(["@/views/system/user/tester/c2ct"], 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: "message",
component: (resolve) => require(["@/views/my/message"], resolve),
name: "MyMessage",
meta: { title: "我的消息", icon: "user" },
path: 'c2ct',
component: (resolve) => require(['@/views/system/user/tester/c2ct'], resolve),
name: 'tester',
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: "learnNum",
component: (resolve) =>
require(["@/views/trainService/learnStudent"], resolve),
name: "signupStudent",
meta: { title: "学习人次", icon: "" },
},
],
path: 'message',
component: (resolve) => require(['@/views/my/message'], resolve),
name: 'MyMessage',
meta: { title: '我的消息', icon: 'user' }
}
]
},
{
path: "/course",
path: '/dict',
component: Layout,
hidden: true,
children: [
{
path: "courseImport",
component: (resolve) =>
require(["@/views/trainService/importCourse"], resolve),
name: "importCourse",
meta: { title: "课程导入", icon: "" },
},
],
path: 'type/data/:dictId(\\d+)',
component: (resolve) => require(['@/views/system/dict/data'], resolve),
name: 'Data',
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: "/testModule",
component: Layout,
hidden: true,
component: (resolve) => require(["@/views/testModule"], resolve),
meta: { title: "测试模块" },
// children: [
// {
// path: 'testModule',
// name: 'testModule',
// }
// ]
path: 'log',
component: (resolve) => require(['@/views/monitor/job/log'], resolve),
name: 'JobLog',
meta: { title: '调度日志' }
}
]
},
{
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,7 +7,6 @@ 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,7 +15,6 @@ const user = {
messageCount:0,
cartCount:0,
userId:0,
nickName:'',
activeName:'',
activeNameManager: '',
websiteDomain:''
@ -28,9 +27,6 @@ const user = {
SET_NAME: (state, name) => {
state.name = name
},
SET_NICKNAME: (state, nickName) => {
state.nickName = nickName
},
SET_USERID:(state, userId) => {
state.userId = userId
},
@ -142,10 +138,7 @@ 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)

@ -390,15 +390,3 @@ export function isNumberStr(str) {
export 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()
})
}

@ -1,122 +1,113 @@
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]) + "&";
}
} else {
url += part + encodeURIComponent(value) + "&";
// 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) + "&";
}
}
url = url.slice(0, -1);
config.params = {};
config.url = url;
}
return config;
},
(error) => {
console.log(error);
Promise.reject(error);
url = url.slice(0, -1);
config.params = {};
config.url = url;
}
);
return config
}, error => {
console.log(error)
Promise.reject(error)
})
// 响应拦截器
service.interceptors.response.use(
(res) => {
console.log(res);
// console.log('响应拦截器',res)
service.interceptors.response.use(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 === 409) {
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 == '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({
@ -124,8 +115,8 @@ service.interceptors.response.use(
// type: 'error',
// duration: 5 * 1000
// })
return Promise.reject(error);
return Promise.reject(error)
}
);
)
export default service;
export default service

@ -7,7 +7,7 @@
<el-descriptions-item label="需要人数">{{ task.needPerson }}</el-descriptions-item>
<el-descriptions-item label="测试类型">
<!-- <test-type :type="task.testType"></test-type> -->
<span>{{ findLabelValueByProp(list, task.testType, 'dictValue', 'dictLabel') }}</span>
<span>{{ findLabelValueByProp(list, task.testType, 'dictValue', 'dictLabel')}}</span>
</el-descriptions-item>
<el-descriptions-item label="测试技能要求">{{ task.techNeed }}</el-descriptions-item>
<el-descriptions-item label="任务金额">
@ -22,7 +22,6 @@
<onsite-type :type="task.onsiteType"></onsite-type>
</el-descriptions-item>
<el-descriptions-item label="地域要求">{{ task.area }}</el-descriptions-item>
<el-descriptions-item label="等级要求">{{ levelMap[task.level] }}</el-descriptions-item>
<el-descriptions-item label="联系人">{{ task.contactName }}</el-descriptions-item>
<el-descriptions-item label="联系电话">{{ task.contactTel }}</el-descriptions-item>
<el-descriptions-item label="项目描述">
@ -30,7 +29,7 @@
</el-descriptions-item>
<el-descriptions-item label="项目附件">
<template v-if="task.attachment">
<div v-for="(it, index) in task.attachmentArr" :key="it" class="uploaddiv">
<div v-for="(it,index) in task.attachmentArr" :key="it" class="uploaddiv">
<img title="点击下载查看" @click="uploaddivClick(it)" src="@/assets/images/crowd/upload.png" alt="">
<span title="点击下载查看" @click="uploaddivClick(it)">项目附件{{ index + 1 }}</span>
</div>
@ -123,8 +122,7 @@
</el-col>
</el-row>
<div style="display: flex; justify-content: center">
<el-button type="primary" @click="audit(1)"
style="padding: 10px !important; margin-right: 30px !important">审核通过</el-button>
<el-button type="primary" @click="audit(1)" style="padding: 10px !important; margin-right: 30px !important">审核通过</el-button>
<el-button type="danger" @click="audit(2)" style="padding: 10px !important">审核不通过</el-button>
</div>
</el-form>
@ -138,13 +136,6 @@ import TestType from './enum/TestType'
import OnsiteType from './enum/OnsiteType'
import TesterType from './enum/TesterType'
const levelMap = {
'0': '无门槛',
'1': '一级',
'2': '二级',
'3': '三级',
}
export default {
name: 'CrowdsourceAudit',
components: { TesterType, OnsiteType, TestType },
@ -166,9 +157,6 @@ export default {
form: {},
task: {},
rules: {},
base: process.env.VUE_APP_BASE_API,
levelMap: levelMap
}
},
methods: {
@ -201,25 +189,23 @@ export default {
},
uploaddivClick(it) {
if (it) {
window.location.href = this.base + it
window.location.href=it
}
}
},
created() { },
created() {},
computed: {},
}
</script>
<style scoped>
.pagedesc>>>.el-descriptions-item__label {
.pagedesc >>> .el-descriptions-item__label {
width: 120px !important;
}
.dialogax>>>.el-dialog__body {
.dialogax >>> .el-dialog__body {
height: 600px;
overflow-y: auto;
}
.uploaddiv {
display: flex;
align-items: center;
@ -227,7 +213,6 @@ export default {
cursor: pointer;
margin-right: 10px;
}
.uploaddiv img {
width: 15px;
margin-right: 5px;

@ -116,8 +116,7 @@
<div class="toptitle">{{ task.projectName }}</div>
<div class="topstatus">
<audit-status :status="task.status"></audit-status>
<el-tag style="margin-left: 10px" size="small" effect="plain"><test-type
:type="task.testType"></test-type></el-tag>
<el-tag style="margin-left: 10px" size="small" effect="plain"><test-type :type="task.testType"></test-type></el-tag>
</div>
</div>
<div class="topright">
@ -130,10 +129,8 @@
<div class="topstatus">
<process-status :processStatus="task.processStatus" />
<!-- <el-tag style="margin-left: 10px" size="small" effect="plain"><test-type :type="task.testType"></test-type></el-tag> -->
<el-tag style="margin-left: 10px" size="small" effect="plain"
v-for="it in findLabelValueByProp(tasktypelist, task.testType, 'dictValue', 'dictLabel').split(',')"
:key="it">
{{ it }}
<el-tag style="margin-left: 10px" size="small" effect="plain" v-for="it in findLabelValueByProp(tasktypelist, task.testType, 'dictValue', 'dictLabel').split(',')" :key="it">
{{it}}
</el-tag>
</div>
</div>
@ -145,10 +142,10 @@
<div class="contentinfo" v-if="!history">
<div class="lefttext">应征者总数</div>
<div class="rightinfo">{{
task.companyAppCount + task.personalAppCount == 20
? "已满"
: task.companyAppCount + task.personalAppCount + "人"
}}</div>
task.companyAppCount + task.personalAppCount == 20
? "已满"
: task.companyAppCount + task.personalAppCount + "人"
}}</div>
</div>
<div class="contentinfo">
<div class="lefttext">发布日期</div>
@ -186,10 +183,6 @@
<div class="lefttext">地域要求</div>
<div class="rightinfo">{{ task.area }}</div>
</div>
<div class="contentinfo">
<div class="lefttext">等级要求</div>
<div class="rightinfo">{{ levelMap[task.level] }}</div>
</div>
<!-- <div class="contentinfo">
<div class="lefttext">备注信息</div>
<div class="rightinfo">{{ task.remark }}</div>
@ -201,13 +194,13 @@
</div>
<div class="contentinfo">
<div class="lefttext">项目附件</div>
<template v-if="task.attachment">
<div v-for="(it, index) in task.attachmentArr" :key="it" class="uploaddiv">
<img title="点击下载查看" @click="uploaddivClick(it)" src="@/assets/images/crowd/upload.png" alt="">
<span title="点击下载查看" @click="uploaddivClick(it)">项目附件{{ index + 1 }}</span>
</div>
</template>
<div v-else></div>
<template v-if="task.attachment">
<div v-for="(it,index) in task.attachmentArr" :key="it" class="uploaddiv">
<img title="点击下载查看" @click="uploaddivClick(it)" src="@/assets/images/crowd/upload.png" alt="">
<span title="点击下载查看" @click="uploaddivClick(it)">项目附件{{ index + 1 }}</span>
</div>
</template>
<div v-else></div>
</div>
</div>
</template>
@ -220,12 +213,6 @@ import TestType from "@/views/components/enum/TestType";
import OnsiteType from "@/views/components/enum/OnsiteType";
import AuditStatus from "@/views/components/enum/AuditStatus";
import mixin from '@/mixin/index.js'
const levelMap = {
'0': '无门槛',
'1': '一级',
'2': '二级',
'3': '三级',
}
export default {
name: "TaskInfo",
mixins: [mixin],
@ -243,8 +230,6 @@ export default {
data() {
return {
task: {},
base: process.env.VUE_APP_BASE_API,
levelMap: levelMap
};
},
methods: {
@ -256,7 +241,7 @@ export default {
},
uploaddivClick(it) {
if (it) {
window.location.href = this.base + it
window.location.href=it
}
}
},
@ -271,15 +256,12 @@ export default {
cursor: pointer;
margin-right: 10px;
}
.uploaddiv img {
width: 15px;
margin-right: 5px;
}
.taskinfo {
width: 100%;
// padding: 20px;
// box-shadow: 0px 2px 8px 0px rgba(54, 61, 67, 0.3);
.modeltitel {
@ -289,7 +271,6 @@ export default {
font-size: 20px;
font-weight: 700;
color: #333333;
.line {
width: 5px;
height: 25px;
@ -297,16 +278,13 @@ export default {
margin-right: 10px;
}
}
.taskinfotop {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.topleft {
padding: 20px 0;
.toptitle {
font-size: 18px;
font-weight: 700;
@ -314,20 +292,17 @@ export default {
margin-bottom: 10px;
}
}
.topright {
font-size: 18px;
font-weight: 700;
color: rgb(253, 70, 26);
}
}
.contentinfo {
font-size: 16px;
color: rgb(128, 128, 128);
display: flex;
margin-bottom: 10px;
.lefttext {
min-width: 100px;
}

@ -1,7 +1,6 @@
<template>
<div class="container">
<el-dialog
v-if="open"
:title="title"
:visible.sync="open"
:close-on-click-modal="false"
@ -31,11 +30,9 @@
<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>
<nonimage-upload
ref="packageUpload"
@ -306,7 +303,6 @@ export default {
},
methods: {
submit() {
console.log(this.form.installDocPath);
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.toolId) {
@ -399,8 +395,6 @@ export default {
this.form.packagePath = value
},
setInstallDocPath(value) {
console.log(value);
console.log('--------------------------------');
this.form.installDocPath = value
},
// +mp4
@ -412,7 +406,6 @@ export default {
},
openDialog(tool) {
console.log(tool.installDocPath);
this.form.toolId = tool.toolId
this.form.name = tool.name
this.form.price = tool.price
@ -459,9 +452,6 @@ 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'
})
@ -513,8 +503,6 @@ 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) {
@ -525,7 +513,6 @@ 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,12 +13,19 @@
<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>
@ -26,46 +33,40 @@
</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">
<template slot-scope="scope">
<span>{{ scope.row.priceType == 'offLine' ? '线下服务' : scope.row.deliverType }}</span>
</template>
:show-overflow-tooltip="true">
</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.priceType == 'offLine' ? '金额面议' : scope.row.fee +'元' }}</span>
<span>{{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.priceType == 'offLine' ? '线下支付' : scope.row.payType == 'wx' ? '微信支付' : '支付宝支付' }}</span>
<span>{{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.priceType == 'offLine' ? '已完成' : scope.row.status == 0 ? '未支付' : scope.row.status == 1 ? '支付成功' : '支付失败' }}</span>
<span>{{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">-->
@ -79,56 +80,62 @@
</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;
})
},
methods: {
handleQuery() {
listOrder(this.addDateRange(this.queryParam, this.dateRange)).then(response => {
this.orders = response.rows;
this.total = response.total;
},
created() {
this.handleQuery();
this.getDicts("sys_tool_type").then(response => {
this.toolTypes = response.data;
})
},
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
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();
}
}
}
}
</script>
<style scoped></style>
<style scoped>
</style>

@ -144,7 +144,6 @@ 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,22 +5,52 @@
<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>
@ -30,42 +60,74 @@
<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">
@ -73,20 +135,46 @@
<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>
@ -102,8 +190,13 @@
<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>
@ -136,37 +229,27 @@
<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="备注">
@ -183,9 +266,18 @@
<!-- 用户导入对话框 -->
<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">
将文件拖到此处
@ -252,9 +344,7 @@ export default {
//
roleOptions: [],
//
form: {
// type:'1'
},
form: {},
defaultProps: {
children: "children",
label: "label"
@ -296,8 +386,7 @@ export default {
//
rules: {
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" },
{ pattern: /^[^\u4e00-\u9fa5]+$/, message: "用户名称不能包含中文", trigger: "blur" }
{ required: true, message: "用户名称不能为空", trigger: "blur" }
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
@ -313,7 +402,6 @@ export default {
}
],
phonenumber: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
@ -347,10 +435,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;
}
);
},
/** 查询部门下拉树结构 */
@ -373,16 +461,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() {
@ -391,7 +479,6 @@ export default {
},
//
reset() {
console.log(this.sexOptions[0]);
this.form = {
userId: undefined,
deptId: undefined,
@ -400,9 +487,8 @@ export default {
password: undefined,
phonenumber: undefined,
email: undefined,
sex: this.sexOptions[0].dictValue,
sex: undefined,
status: "0",
type: '1',
remark: undefined,
postIds: [],
roleIds: []
@ -460,13 +546,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) {
@ -489,28 +575,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() {

@ -1,28 +0,0 @@
<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>

@ -1,324 +0,0 @@
<template>
<el-dialog title="布置作业" :visible.sync="dialogVisible" width="width" @close="beforeClose"
:close-on-click-modal="false">
<div class="homeWork">
<ImageUpload v-show="false" id="imgUploadQuill" :igonreMin="true" v-model="quillImg" @input="getImg">
</ImageUpload>
<quill-editor v-model="editContent" ref="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)"
@focus="onEditorFocus($event)" @change="onEditorChange($event)">
</quill-editor>
</div>
<div slot="footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</template>
<script>
import ImageUpload from '@/components/ImageUpload/index.vue'
import { Quill, quillEditor } from "vue-quill-editor"; //
// import Quill from "quill";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
// import { ImageExtend, QuillWatch } from 'quill-image-extend-module'
import ImageResize from 'quill-image-resize-module';
//
const fontSizeStyle = Quill.import("attributors/style/size"); // style
fontSizeStyle.whitelist = ["12px", "14px", "16px", "18px", "20px", "24px", "28px", "32px", "36px",];
Quill.register(fontSizeStyle, true);
// //
const Font = Quill.import("attributors/style/font"); // style
const fonts = ["SimSun", "SimHei", "Microsoft-YaHei", "KaiTi", "FangSong"];
Font.whitelist = fonts; //
Quill.register(Font, true);
Quill.register('modules/imageResize', ImageResize);
import { ImageDrop } from 'quill-image-drop-module'
Quill.register('modules/imageDrop', ImageDrop)
const AlignStyle = Quill.import("attributors/style/align");
AlignStyle.whitelist = ["right", "center", "justify"];
Quill.register(AlignStyle, true);
const toolbarOptions = [
["bold", "italic", "underline", "strike"], // 线 线 -----['bold', 'italic', 'underline', 'strike']
[{ color: [] }, { background: [] }], // -----[{ color: [] }, { background: [] }]
[{ align: [] }], // -----[{ align: [] }]
// [{ size: ["12px","14px","16px","18px","20px","24px","28px","32px","36px",true] }], // -----[{ size: ['small', false, 'large', 'huge'] }]
// [{ font: ["SimSun", "SimHei", "Microsoft-YaHei", "KaiTi", "FangSong",true] }], // -----[{ font: [] }]
[{ size: fontSizeStyle.whitelist }], // -----[{ size: ['small', false, 'large', 'huge'] }]
[{ font: fonts }], // -----[{ font: [] }]
[{ header: [1, 2, 3, 4, 5, 6, true] }], //
[{ direction: "ltl" }], // -----[{'direction': 'rtl'}]
[{ direction: "rtl" }], // -----[{'direction': 'rtl'}]
[{ indent: "-1" }, { indent: "+1" }], // -----[{ indent: '-1' }, { indent: '+1' }]
[{ list: "ordered" }, { list: "bullet" }], // -----[{ list: 'ordered' }, { list: 'bullet' }]
[{ script: "sub" }, { script: "super" }], // /-----[{ script: 'sub' }, { script: 'super' }]
["blockquote", "code-block"], // -----['blockquote', 'code-block']
["clean"], // -----['clean']
["link", "image"], // -----['link', 'image', 'video']
];
export default {
components: { quillEditor, ImageUpload },
data() {
return {
dialogVisible: false,
editContent: '',
quillImg: '',
editorOption: {
placeholder: "请输入作业内容",
modules: {
toolbar: {
container: toolbarOptions,
// handlers: {
// image: this.handleImgUpload,
// },
handlers: { //使
'image': function (value) {
console.log(value)
if (value) { //
document.querySelector('#imgUploadQuill .el-upload').click()
}
}
}
},
//
// imageDrop: true,
imageResize: {
displayStyles: {
backgroundColor: 'black',
border: 'none',
color: 'white'
},
modules: ['Resize', 'DisplaySize', 'Toolbar']
},
},
},
}
},
mounted() {
},
methods: {
submit() {
this.$emit('subWork', this.editContent)
console.log(this.editContent);
},
beforeClose() {
this.editContent = ''
},
onEditorReady(editor) {
//
},
getImg(url) {
console.log(process.env.VUE_APP_BASE_API + url);
if (url) {
const quill = this.$refs.myQuillEditor.quill
//
const pos = quill.getSelection().index
//
quill.insertEmbed(pos, 'image', process.env.VUE_APP_BASE_API + url)
} else {
this.$essage.error('图片插入失败')
}
},
onEditorBlur() { }, //
onEditorFocus() { }, //
//
onEditorChange({ quill, html, text }) {
if (text.length - 1 > 2000) {
let event = this.$refs.myQuillEditor
event.quill.deleteText(2000, 1);
this.$message({
type: 'warning',
message: '长度超出,无法输入!'
});
// this.content = html
return
}
// this.newsobj.content = this.escapeStringHTML(this.editContent);
// console.log('', this.editContent)
},
//
escapeStringHTML(content) {
content = content.replace(/&lt;/g, "<");
content = content.replace(/&gt;/g, ">");
return content;
},
}
}
</script>
<style>
.ql-editor {
min-height: 250px;
max-height: 400px;
}
.homeWork .ql-editor{
margin-left: 0;
}
.ql-snow .ql-tooltip[data-mode="link"]::before {
content: "请输入链接地址:";
}
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
border-right: 0px;
content: "保存";
padding-right: 0px;
}
.ql-snow .ql-tooltip[data-mode="video"]::before {
content: "请输入视频地址:";
}
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
content: "14px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
content: "10px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
content: "18px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
content: "32px";
}
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
content: "文本";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
content: "标题1";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
content: "标题2";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
content: "标题3";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
content: "标题4";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
content: "标题5";
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
content: "标题6";
}
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
content: "默认";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="SimSun"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="SimSun"]::before {
content: "宋体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Microsoft-YaHei"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Microsoft-YaHei"]::before {
content: "微软雅黑";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="KaiTi"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="KaiTi"]::before {
content: "楷体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="FangSong"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="FangSong"]::before {
content: "仿宋";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="SimHei"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="SimHei"]::before {
content: "黑体";
}
.ql-toolbar.ql-snow+.ql-container.ql-snow {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
.ql-toolbar.ql-snow {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.ql-snow .ql-stroke,
.ql-snow .ql-picker {
/* color: #999;
stroke: #999; */
}
.ql-snow .ql-fill,
.ql-snow .ql-stroke.ql-fill {
/* fill: #999; */
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="12px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12px"]::before {
content: "12px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before {
content: "14px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="16px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16px"]::before {
content: "16px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="20px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20px"]::before {
content: "20px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before {
content: "24px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="28px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="28px"]::before {
content: "28px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="32px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32px"]::before {
content: "32px";
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="36px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="36px"]::before {
content: "36px";
}
.ql-container {
font-size: 14px;
}
</style>

@ -7,9 +7,8 @@
<el-table-column label="序号" type="index" />
<el-table-column label="学生姓名" prop="studentName" align="center" />
<el-table-column label="学号" prop="studentCode" align="center" />
<el-table-column label="专业" prop="major" align="center" />
<el-table-column label="手机号" prop="mobile" align="center"> </el-table-column>
<el-table-column label="签到次数" prop="totalSign" align="center"></el-table-column>
<!-- <el-table-column label="签到次数" prop="createTime" align="center"></el-table-column> -->
<el-table-column label="实际签到次数" prop="signCount" align="center"></el-table-column>
</el-table>

@ -1,22 +1,22 @@
<template>
<div class="container" style="padding: 30px">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"
style="display: flex; margin-left: 5px">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
label-width="68px"
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> -->
<el-button type="primary" icon="el-icon-plus" size="mini" @click="option({}, 'add')"
>新增课程</el-button
>
</div>
<el-form-item label="课程" prop="courseId">
<el-input v-model="queryParams.courseName" clearable></el-input>
<el-input v-model="queryParams.courseName"></el-input>
</el-form-item>
<el-form-item label="班级名称" prop="courseId">
<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-input v-model="queryParams.className"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
@ -24,168 +24,127 @@
</el-form-item>
</el-form>
<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 v-loading="loading" :data="courseList">
<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 v-if="queryParams.classType == 4" label="下课时间" align="center" prop="dateTime">
<el-table-column label="课程资料" align="center">
<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">
<div
v-for="name in scope.row.attachments"
:key="name.fileId"
@click="downLoadSource(name)"
class="sourceItem"
>
{{ name.fileName }}
</div>
</template>
</el-table-column>
<el-table-column v-if="queryParams.classType != 4" label="签到情况" align="center">
<el-table-column label="签到情况" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="option(scope.row, 'siginList')">{{
scope.row.classType == 4 ? '' : scope.row.signIn
}}</el-button>
</template>
</el-table-column>
<el-table-column v-if="queryParams.classType != 3" label="布置作业" align="center">
<template slot-scope="scope">
<el-button v-if="!scope.row.homework" size="mini" type="text"
@click="toAssignHomework(scope.row)">新增</el-button>
<el-button v-else size="mini" type="text" @click="toAssignHomework(scope.row)">修改</el-button>
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" v-show="scope.row.classType != 3"
@click="toAssignHomework(scope.row)">布置作业</el-button> -->
<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" 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>
<el-button size="mini" type="text" @click="option(scope.row, 'signIn')">签到</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-dialog class="diaform" :title="title" :visible.sync="visibleopen" :close-on-click-modal="false"
append-to-body width="700px" @open="openDia" @close="closeDia">
<el-dialog
class="diaform"
:title="title"
:visible.sync="visibleopen"
:close-on-click-modal="false"
append-to-body
width="700px"
@open="openDia"
@close="closeDia"
>
<div v-if="optionType == 'signIn'">
<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 v-else :model="courseForm" :rules="rules" ref="form" label-width="150px" text-align:center>
<el-form-item label="所属班级" prop="classId">
<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-select v-model="courseForm.classId" placeholder="请选择班级" clearable>
<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="课程名称" prop="courseName">
<el-input class="courseName" placeholder="请输入课堂名称" v-model="courseForm.courseName"></el-input>
<el-input class="courseName" v-model="courseForm.courseName"></el-input>
</el-form-item>
<el-form-item label="课堂老师" prop="instructor" v-if="classType != 4">
<el-form-item label="课堂老师" prop="instructor">
<el-select v-model="courseForm.instructor" placeholder="请选择老师" clearable>
<el-option v-for="item in teacherList" :key="item.talent_id" :label="item.name"
:value="item.name"></el-option>
<el-option
v-for="item in teacherList"
:key="item.talent_id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="职称" prop="title" v-if="classType == 4">
<el-input class="courseName" v-model="courseForm.title" placeholder="请输入职称"></el-input>
</el-form-item>
<el-form-item label="授课老师" prop="instructor" v-if="classType == 4">
<el-autocomplete class="inline-input" v-model="courseForm.instructor"
:fetch-suggestions="querySearch" placeholder="请输入授课老师" @select="handleSelect">
<template slot-scope="{ item }">
<span class="addr">{{ item.name }}</span>
</template></el-autocomplete>
</el-form-item>
<el-form-item label="上课时间" prop="courseTime">
<el-date-picker v-model="courseForm.courseTime" type="datetime" format="yyyy-MM-dd HH:mm:ss"
@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
v-model="courseForm.courseTime"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="授课内容" prop="courseContent" v-if="classType == 4">
<el-input v-model="courseForm.courseContent" placeholder="请输入授课内容" type="textarea"
:rows="2"></el-input>
</el-form-item>
<el-form-item label="授课链接" prop="url" v-if="classType == 4">
<el-input class="courseName" v-model="courseForm.url" placeholder="请输入授课链接"></el-input>
</el-form-item>
<el-form-item label="是否付费" prop="isPay" v-if="classType == 4">
<!-- <el-cascader v-model="courseForm.isPay" :options="payOptions"
@change="payHandleChange"></el-cascader> -->
<el-select v-model="courseForm.isPay" placeholder="请选择是否付费">
<el-option label="付费" value="1"></el-option>
<el-option label="免费" value="0"></el-option>
</el-select>
</el-form-item>
<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">
<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>
</el-form-item>
<el-form-item label="课程资料" prop="attachments" v-if="classType != 4">
<el-form-item label="课程资料" prop="attachments">
<div>
<fileUpload ref="fileUpload" v-model="courseForm.attachments" listtype="picture-card"
:fileType="['rar']" class="widthFix" fileName="publicize" :limit="3" />
<fileUpload
ref="fileUpload"
v-model="courseForm.attachments"
listtype="picture-card"
:fileType="['rar']"
class="widthFix"
fileName="publicize"
:limit="3"
/>
</div>
</el-form-item>
<el-form-item style="margin-top: 80px; text-align: center; margin-left: -150px">
<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="closeDia">取消</el-button>
<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="closeDia"
>取消</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<assignWork ref="assignWork" @subWork="subWork"></assignWork>
</div>
</template>
<script>
@ -196,17 +155,11 @@ import {
delCourse,
listTeacherAll,
getClassList,
getInComeInfo,
assignHomeWork,
updateHomeWork
} 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 assignWork from './assignWork.vue'
import store from '../../store'
const titleMap = {
motify: '修改',
delete: '删除',
@ -214,37 +167,17 @@ 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' },
{ 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: false, message: '请输入职称', trigger: 'blur' }],
payMethods: [{ required: true, message: '请输入支付方式', trigger: 'change' }]
}
export default {
components: { fileUpload, vueQr, buttonUpload, assignWork },
components: { fileUpload, vueQr },
data() {
return {
classMap: classMap,
imgAction: process.env.VUE_APP_BASE_API + '/upload',
loading: false,
id: '',
@ -268,10 +201,9 @@ export default {
//
queryParams: {
pageNum: 1,
pageSize: 20,
pageSize: 10,
courseName: '',
className: '',
classType: '0'
},
courseForm: {
classId: '',
@ -287,69 +219,9 @@ export default {
title: '',
visibleopen: false,
rules: courseRule,
classType: 0,
inComeForm: [],
// payOptions: [
// {
// value: '1',
// label: '',
// children: [{
// key: '0',
// value: '1-1',
// label: ''
// }, {
// key: '0',
// value: '1-2',
// label: ''
// }]
// },
// {
// value: '0',
// label: '',
// }],
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);
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
// callback
cb(results);
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
handleSelect(item) {
this.courseForm.instructor = item.name
console.log(item);
},
async getList() {
const res = await getCourseList(this.queryParams)
this.total = res.total
@ -364,23 +236,6 @@ export default {
}
this.getList()
},
// payHandleChange(e) {
// this.courseForm.isPay = e[0]
// if (e[1]) {
// this.payMethods = e[1]
// }
// console.log(e);
// },
classChange(e) {
const result = this.classList.find(item => {
console.log(item);
return item.trainClassId == e
})
if (result) {
this.classType = result.classType * 1
}
console.log(this.courseForm);
},
downLoadSource(params) {
const url = params.filePath
if (!url) {
@ -388,66 +243,6 @@ export default {
}
downloadHttp(url)
},
// excel
uploadExcel() {
},
handleClick() {
this.getList()
this.$nextTick(() => {
this.$refs.table.doLayout()
})
},
// importCourse(){
// this.$router.push('/course/courseImport')
// },
toAssignHomework(row) {
console.log(row);
this.currentCourse = row
this.$refs.assignWork.dialogVisible = true
if (row.homework) {
this.$refs.assignWork.editContent = row.homework
} else {
}
},
async subWork(content) {
const data = {
courseId: this.currentCourse.courseId,
// teacherId: store.getters.userId,
homework: content
}
const res = await assignHomeWork(data)
if (res.code == 200) {
this.$refs.assignWork.dialogVisible = false
this.getList()
this.$message.success('操作成功')
}
console.log(res);
return
/* 未布置过作业 */
if (!this.currentCourse.content) {
const res = await assignHomeWork(data)
if (res.code == 200) {
this.$refs.assignWork.dialogVisible = false
this.getList()
this.$message.success('作业布置成功')
}
}
/* 修改作业 */
else {
const res = await updateHomeWork(data)
if (res.code == 200) {
this.$refs.assignWork.dialogVisible = false
this.getList()
this.$message.success('作业修改成功')
}
}
},
async option(row, type) {
this.optionType = type
this.currentCourse = row
@ -455,15 +250,7 @@ export default {
switch (type) {
case 'motify':
this.courseForm = deepClone(row)
this.initDialog(this.courseForm.classId)
// 线
// console.log(this.classList);
// const result = this.classList.find(item => {
// console.log(item);
// return item.trainClassId == this.courseForm.classId
// })
// console.log(result);
// this.classType = result.classType
this.initDialog()
break
case 'delete':
this.deleteRow(row)
@ -474,27 +261,13 @@ 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
this.$router.push({
path: '/signInInfoList',
query: {
name: row.courseName,
name: row.className,
id: row.courseId,
classType: row.classType,
},
})
return
@ -505,7 +278,7 @@ export default {
},
//
submitto() {
this.$refs['courseForm'].validate((valid) => {
this.$refs['form'].validate((valid) => {
if (valid) {
this.submit()
} else {
@ -516,12 +289,6 @@ export default {
},
async submit() {
const data = deepClone(this.courseForm)
if (data.amount) {
data.amount = data.amount * 1
}
if (this.classType == 4) {
data.classType = '4'
}
if (this.courseForm.courseId) {
const res = await putCourseItem(data)
res.code == 200 && this.$message.success('修改成功')
@ -532,43 +299,12 @@ 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 obj = {
classType: this.queryParams.classType
}
const classRes = await getClassList(obj)
this.classList = classRes.data
if (val) {
this.classChange(val)
}
async initDialog() {
const classRes = await getClassList()
const teacherRes = await listTeacherAll()
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
})
this.classList = classRes.data
},
openDia() {
if (this.optionType === 'motify') {
@ -577,19 +313,14 @@ export default {
},
//
closeDia() {
this.$refs['courseForm']?.resetFields()
this.$refs['form']?.resetFields()
Object.keys(this.courseForm).forEach((item) => {
if (Array.isArray(this.courseForm[item])) {
if (item == 'remark') {
this.courseForm[item] = ''
} else {
this.courseForm[item] = []
}
this.courseForm[item] = []
} else {
this.courseForm[item] = ''
}
})
this.classType = 0
this.$refs.fileUpload?.reset()
this.visibleopen = false
},
@ -630,13 +361,11 @@ export default {
.courseName {
width: 220px;
}
.sourceItem {
color: #1890ff;
cursor: pointer;
text-decoration: underline;
}
.sourceItem:hover {
color: #0e4272;
cursor: pointer;

@ -1,222 +0,0 @@
<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>

@ -1,68 +0,0 @@
<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>

@ -1,23 +1,14 @@
<template>
<div class="singInWrapper">
<el-form :model="queryParams" ref="queryForm" inline label-width="68px">
<el-form-item label="姓名" prop="studenName">
<el-input v-model="queryParams.studenName" placeholder="请输入姓名" clearable size="small" />
</el-form-item>
<el-form-item label="学号" prop="studenCode">
<el-input v-model="queryParams.studenCode" placeholder="请输入学号" clearable size="small" />
</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>
</el-form>
<el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px" @click="excelExport">导出为excel</el-button>
<div class="expBtn">
<el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom:20px" @click="excelExport"
>导出为excel</el-button
>
</div>
<el-table v-loading="loading" :data="signinList">
<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 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,7 +36,6 @@ export default {
const query = this.$route.query
this.name = query.name
this.id = query.id
this.classType = query.classType
this.signIninit()
},
props: {},
@ -55,31 +45,24 @@ export default {
id: '',
loading: false,
total: 0,
classType:1,
signinList: [],
queryParams: {
pageNum: 1,
pageSize: 10,
studenName: '',
studenCode: '',
},
exportParams: {
studenName: '',
studenCode: '',
},
}
},
methods: {
async signIninit() {
console.log(this.id)
const res = await getSigninInfo(this.id,this.queryParams)
const res = await getSigninInfo(this.id)
this.total = res.total
this.signinList = res.rows
},
async excelExport() {
const res = await exportSignIn(this.id,this.exportParams)
const res = await exportSignIn(this.id)
const blob = new Blob([res])
saveAs(blob, this.name + '-签到记录.xlsx')
saveAs(blob, this.name + '签到记录.xlsx')
//this.$route.query.name
// this.download(res)
},
@ -97,16 +80,6 @@ export default {
this.$message.success('删除成功')
})
},
handleQuery() {
this.queryParams.pageNum = 1
this.signIninit()
this.exportParams.studenName = this.queryParams.studenName
this.exportParams.studenCode = this.queryParams.studenCode
},
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
},
}
</script>

@ -1,28 +1,42 @@
<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">
<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-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-input
v-model="queryParams.trainClassName"
placeholder="请输入班级名称"
clearable
size="small"
/>
</el-form-item>
<!-- <el-form-item label="班级类型" prop="classType">
<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-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>
@ -32,42 +46,31 @@
<div style="margin-top: 5px; margin-bottom: 20px">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="addsign">新增</el-button>
</div>
<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 v-loading="loading" :data="classList">
<el-table-column label="序号" align="center" type="index" />
<el-table-column v-if="queryParams.classType == '0'" label="学校" align="center" prop="schoolName" />
<el-table-column label="学校" align="center" prop="schoolName" />
<el-table-column label="班级名称" align="center" prop="trainClassName" />
<el-table-column v-if="queryParams.classType == '0'" label="班级代号" align="center" prop="trainClassCode" />
<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 v-if="queryParams.classType != '4'" label="培训教师" align="center" prop="teacherName" />
<el-table-column v-if="queryParams.classType != '4'" label="报名开始时间" align="center"
prop="registrationStartTime">
<el-table-column 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>
</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)) ||
'未录入' }}
{{ (scope.row.registrationStartTime && scope.row.registrationStartTime.slice(0, 10)) || '未录入' }}
</template>
</el-table-column>
<el-table-column v-if="queryParams.classType != '4'" label="报名结束时间" align="center"
prop="registrationEndTime">
<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)) || '未录入' }}
@ -78,101 +81,93 @@
{{ (scope.row.trainEndTime && scope.row.trainEndTime.slice(0, 10)) || '未录入' }}
</template>
</el-table-column>
<el-table-column v-if="queryParams.classType != '4'" label="是否限制人数" align="center" prop="limitApply">
<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>
<el-button size="mini" type="text" @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 == 1">报名未开始</span>
<span 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> -->
<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>
<span v-if="scope.row.status == 4">开课中</span>
<span 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" 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>
<el-button v-if="scope.row.classType != 4" size="mini" type="text"
@click="copyClass(scope.row)">拷贝</el-button>
<el-button 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 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>
<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" :disabled="classTypeDisabled"
key="class-type">
<el-select v-model="form.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 label="培训教师" prop="teacherName" v-if="form.classType != 4">
<el-form-item label="培训教师" prop="teacherName">
<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-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-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="请输入班级代号" key="class-code" clearable
size="small" />
<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-form-item label="班级等级" prop="classLevel" v-if="form.classType != 0">
<el-select v-model="form.classLevel">
<el-option label="初级" :value="0"></el-option>
<el-option label="中级" :value="1"></el-option>
@ -180,56 +175,98 @@
</el-select>
</el-form-item>
<el-form-item label="班级人数" prop="classSize" v-if="form.classType != 4">
<el-form-item label="班级人数" prop="classSize">
<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-form-item label="是否限制人数" prop="limitApply" class="limitApply">
<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-form-item label="报名开始时间" prop="registrationStartTime">
<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-form-item label="报名结束时间" prop="registrationEndTime">
<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
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
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" />
<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-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-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" />
@ -239,11 +276,22 @@
<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" />
<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>
<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为单选框选项
@ -253,17 +301,9 @@
<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,
@ -273,21 +313,16 @@ 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',
// formatForm
components: { ImageUpload, NonimageUpload, JsonTool, },
components: { ImageUpload, NonimageUpload, JsonTool },
data() {
return {
classMap: classMap,
teacherList: [],
imgAction: process.env.VUE_APP_BASE_API + '/upload',
loading: false,
@ -299,27 +334,18 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 20,
classType: '0',
classType: null,
},
queryParamss: {
pageNum: 1,
pageSize: 10,
},
classOptions: [],
totals: 0,
activeName: '0',
title: '新增班级',
visibleopen: false,
form: {
classType: 0,
limitApply: '0',
},
// FORM
copyClassForm: {
targetClass: ''
},
copyClassRules: {
targetClass: [{ required: true, message: '请选择目标班级', trigger: 'change' }],
limitApply: '1',
},
rules: {
classType: [{ required: true, message: '请输入培训班类型', trigger: 'change' }],
@ -347,11 +373,10 @@ export default {
// Json
signTable: false,
activeRowId: '',
classTypeDisabled: true
}
},
mounted() { },
mounted() {},
methods: {
// json
setSignTab(row) {
@ -362,82 +387,8 @@ export default {
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.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()
@ -456,7 +407,7 @@ export default {
this.getList()
this.signTable = false
})
.catch((error) => { })
.catch((error) => {})
} else {
this.$message.warning('请检查JSON数据格式')
}
@ -482,11 +433,6 @@ 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
},
//
@ -494,27 +440,11 @@ 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.form = JSON.parse(JSON.stringify(row))
// this.classTypeDisabled = true
// 线
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' }]
}
this.visibleopen = true
this.form = row
//
if (row.attachment) {
let packageFile = [
@ -528,7 +458,6 @@ export default {
this.$refs.packageUpload.setToolFileList(packageFile)
})
}
this.visibleopen = true
},
option(row) {
console.log(row);
@ -540,34 +469,6 @@ 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: '确定',
@ -580,7 +481,7 @@ export default {
this.$message.success('删除成功')
})
})
.catch(() => { })
.catch(() => {})
},
//
async submitto() {
@ -599,7 +500,6 @@ export default {
})
} else {
addSignUp(this.form).then((res) => {
console.log(res);
this.$message.success('新增成功')
this.colsedia()
this.getList()
@ -610,19 +510,12 @@ export default {
},
//
colsedia() {
// this.classTypeDisabled = false
this.$refs['form']?.resetFields()
this.$refs['copyClassForm']?.resetFields()
this.copyClassForm = {
targetClass: ''
}
this.$refs['form'].resetFields()
this.visibleopen = false
this.form = {
classType: 0,
limitApply: '0',
limitApply: '1',
}
this.$nextTick(() => {
this.visibleopen = false
})
},
handleQuery() {
this.getList()
@ -635,7 +528,6 @@ 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)
@ -646,16 +538,6 @@ export default {
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()
@ -668,6 +550,5 @@ export default {
<style lang="scss" scoped>
::v-deep .el-radio-group {
width: 220px;
}
</style>

@ -1,501 +0,0 @@
<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,161 +16,72 @@
<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="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>
</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>
</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-button icon="el-icon-download" size="small" style="margin-bottom: 20px"
@click="downloadAttachment('multify')">下载附件简历</el-button>
<el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px" @click="exporExcel"
>导出为excel</el-button
>
<!-- 详细学生信息弹层 -->
<el-table v-if="$route.query.type != 3" :data="studentList" v-loading="loading"
:default-sort="{ prop: 'asseGradeVag', order: 'descending' }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table v-if="$route.query.type != 3" :data="studentList" v-loading="loading">
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="学号" align="center" prop="studentCode" v-if="$route.query.type == 0" />
<el-table-column label="姓名" align="center" prop="studentName" />
<el-table-column label="性别" align="center" prop="sex">
<template slot-scope="scope">
<div v-show="scope.row.sex === '0'"></div>
<div v-show="scope.row.sex === '1'"></div>
</template>
</el-table-column>
<!-- <el-table-column label="所属学院" align="center" prop="homeCollege" v-if="$route.query.type == 0" /> -->
<el-table-column label="专业名称" align="center" prop="majorName" v-if="$route.query.type == 0" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="辅导员" align="center" prop="counsellor" v-if="$route.query.type == 0" />
<el-table-column label="辅导员联系方式" align="center" prop="counsellorTel" v-if="$route.query.type == 0" />
<el-table-column label="报名时间" align="center" prop="registrationTime" />
<el-table-column label="结课报告" align="center" prop="registrationTime">
<template slot-scope="scope">
<div style="color: #1890ff;cursor: pointer;" @click="downloadReport(scope.row.reportAttachment)">{{
scope.row.reportName ? scope.row.reportName : '' }}
</div>
</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" prop="registrationTime">
<template slot-scope="scope">
<div style="color: #1890ff;cursor: pointer;" @click="downloadReport(scope.row.attResume)">{{
scope.row.attResume ? '下载' : '' }}
</div>
</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-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"
:default-sort="{ prop: 'asseGradeVag', order: 'descending' }">
<el-table v-else :data="teacherList" v-loading="loading">
<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-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>
<pagination v-show="totals > 0" :total="totals" :page.sync="queryParamss.pageNum"
:limit.sync="queryParamss.pageSize" @pagination="getStudentList" />
<pagination
v-show="totals > 0"
:total="totals"
:page.sync="queryParamss.pageNum"
:limit.sync="queryParamss.pageSize"
@pagination="getStudentList"
/>
<!-- 弹层 -->
<el-dialog class="diaform" :title="title" :visible.sync="visibleopen" :close-on-click-modal="false"
width="650px" append-to-body @close="colsedia">
<el-form v-show="currentType === 'remark'" :model="form" :rules="rules" ref="Form" label-width="80px">
<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">
<!-- 类型 -->
<el-form-item label="备注" prop="remark">
<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-input v-model="form.remark" placeholder="请输入备注" clearable size="small" 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>
@ -179,14 +90,8 @@
</div>
</template>
<script>
// const currentTypeMap = {}
import {
searchNum, addRemarkI, delSign, exportExcelF, addStuentEva
, delStudentEva, getStudentEva, exportEva
} from '@/api/trainService/index.js'
import { searchNum, addRemarkI, delSign, exportExcelF } from '@/api/trainService/index.js'
import { saveAs } from 'file-saver'
import store from '@/store'
import { downPdf } from '../../utils';
// 1 2 3 4 5 status
export default {
name: 'peixunbaoming',
@ -194,93 +99,37 @@ export default {
return {
loading: false,
//
multipleSelection: [],
queryParamss: {
pageNum: 1,
pageSize: 10,
studentName: null,
mobile: null,
reportName: '',
majorName: null,
counsellor: null,
counsellorTel: null,
},
totals: 0,
evaList: [],
options: [
{ value: '1', label: '已上传' },
{ value: '0', label: '未上传' }
],
studentList: [],
//
title: '添加备注',
visibleopen: false,
form: {},
rules: {
// remark: [{ required: true, message: '', trigger: 'blur' }],
remark: [{ required: true, message: '请输入备注', trigger: 'blur' }],
},
rowId: null,
teacherList: [], //
//
headerList: [],
//
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')) {
@ -329,8 +178,6 @@ 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)
}
@ -346,17 +193,12 @@ 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: '取消',
@ -368,38 +210,10 @@ export default {
this.$message.success('删除成功')
})
})
.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()
}
})
.catch(() => {})
},
//
addRemark(row) {
this.currentType = 'remark'
this.title = '添加备注'
this.visibleopen = true
// trainClassId trainingStudentId userId
@ -407,7 +221,6 @@ export default {
},
//
editRemark(row) {
this.currentType = 'remark'
this.rowId = row.trainingStudentId
this.visibleopen = true
this.title = '修改备注'
@ -415,256 +228,32 @@ export default {
},
//
submitRemark() {
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: '删除成功!'
});
})
this.$refs['form'].validate((valid) => {
if (valid) {
addRemarkI({ trainingStudentId: this.rowId, remark: this.form.remark }).then(() => {
this.$message.success('备注成功!')
this.getStudentList()
this.colsedia()
})
}
})
},
//
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, this.queryParamss).then((res) => {
exportExcelF(this.$route.query.id).then((res) => {
const blob = new Blob([res])
saveAs(blob, this.$route.query.name + '报名表.xlsx')
})
},
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')
},
downloadAttachment() {
this.multipleSelection.forEach(item => {
if (item.attResume) {
downPdf(this.base + item.attResume)
// 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)
// }
}
})
},
downloadReport(val) {
// return
if (val === 'multify') {
const self = this
this.multipleSelection.forEach(item => {
if (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) {
downPdf(this.base + val)
}
}
},
created() {
console.log();
},
created() {},
}
</script>
<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 lang="scss" scoped>
</style>

Loading…
Cancel
Save