diff --git a/.env.development b/.env.development index a08fd7f..292bbd2 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ ENV = 'development' VUE_APP_BASE_API = '/prod-api' # VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/test-api' -VUE_APP_BASE_TARGET = 'http://192.168.0.230:9999' +VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999' # VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/prod-api' # VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999' diff --git a/README.md b/README.md index a857617..844f650 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ npm install # 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 npm install --registry=https://registry.npm.taobao.org +npm install --registry=https://registry.npmjs.org/ # 启动服务 npm run dev diff --git a/admin_test.zip b/admin_test.zip deleted file mode 100644 index d6b8251..0000000 Binary files a/admin_test.zip and /dev/null differ diff --git a/src/api/trainService/index.js b/src/api/trainService/index.js index 64dcf91..f832866 100644 --- a/src/api/trainService/index.js +++ b/src/api/trainService/index.js @@ -317,10 +317,12 @@ export function exportAttendance(id) { }) } // 导出所有签到信息 -export function exportSignIn(id) { +export function exportSignIn(id,params) { + console.log(params); return request({ url: '/course/admin/importSignIn/course/' + id, method: 'get', + params, responseType: 'blob' }) } \ No newline at end of file diff --git a/src/views/components/ToolEdit.vue b/src/views/components/ToolEdit.vue index e2204d2..64ee3d3 100644 --- a/src/views/components/ToolEdit.vue +++ b/src/views/components/ToolEdit.vue @@ -33,14 +33,15 @@ - + + diff --git a/src/views/trainService/attendanceList.vue b/src/views/trainService/attendanceList.vue index 30526c4..bdadebd 100644 --- a/src/views/trainService/attendanceList.vue +++ b/src/views/trainService/attendanceList.vue @@ -7,8 +7,9 @@ + - + diff --git a/src/views/trainService/courseManage.vue b/src/views/trainService/courseManage.vue index 7e0a9a3..2dde15c 100644 --- a/src/views/trainService/courseManage.vue +++ b/src/views/trainService/courseManage.vue @@ -1,16 +1,9 @@ - + - +
- + - - + + + - + - + - + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- +
- 确认 - 取消 + 确认 + 取消
@@ -173,6 +174,13 @@ const courseRule = { classId: [{ required: true, message: '请选择班级', trigger: 'change' }], instructor: [{ required: true, message: '请选择任课老师', trigger: 'change' }], courseTime: [{ required: true, trigger: 'change', message: '请输入上课时间' }], + courseContent: [{ required: true, message: '请输入课程内容', trigger: 'blur' }], + password: [{ required: true, message: '请输入口令', trigger: 'blur' }], + amount: [{ required: true, message: '请输入付款金额', trigger: 'blue' }], + isPay: [{ required: true, message: '请输入选择授课方法', trigger: 'change' }], + url: [{ required: true, message: '请输入课程链接', trigger: 'blur' }], + title: [{ required: true, message: '请输入职称', trigger: 'blur' }], + payMethods: [{ required: true, message: '请输入支付方式', trigger: 'change' }] } export default { components: { fileUpload, vueQr }, @@ -219,9 +227,46 @@ export default { title: '', visibleopen: false, rules: courseRule, + classType: 0, + // payOptions: [ + // { + // value: '1', + // label: '付费', + // children: [{ + // key: '0', + // value: '1-1', + // label: '金额' + // }, { + // key: '0', + // value: '1-2', + // label: '口令' + // }] + // }, + // { + // value: '0', + // label: '免费', + + // }], + payMethods: '0' } }, methods: { + 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 @@ -236,6 +281,23 @@ 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 + } + console.log(this.courseForm); + }, downLoadSource(params) { const url = params.filePath if (!url) { @@ -250,7 +312,15 @@ export default { switch (type) { case 'motify': this.courseForm = deepClone(row) - this.initDialog() + 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 break case 'delete': this.deleteRow(row) @@ -263,10 +333,11 @@ export default { break case 'siginList': // this.id = row.courseId + console.log(row); this.$router.push({ path: '/signInInfoList', query: { - name: row.className, + name: row.courseName, id: row.courseId, }, }) @@ -278,7 +349,7 @@ export default { }, // 提交 submitto() { - this.$refs['form'].validate((valid) => { + this.$refs['courseForm'].validate((valid) => { if (valid) { this.submit() } else { @@ -289,6 +360,15 @@ export default { }, async submit() { const data = deepClone(this.courseForm) + if (data.amount) { + data.amount = data.amount * 1 + } + if (this.classType == 4) { + data.classType = '4' + delete data.payMethods + } + + if (this.courseForm.courseId) { const res = await putCourseItem(data) res.code == 200 && this.$message.success('修改成功') @@ -300,11 +380,16 @@ export default { this.getList() }, // dialog init - async initDialog() { + async initDialog(val) { + console.log(val); const classRes = await getClassList() + this.classList = classRes.data + if (val) { + this.classChange(val) + } const teacherRes = await listTeacherAll() this.teacherList = teacherRes - this.classList = classRes.data + }, openDia() { if (this.optionType === 'motify') { @@ -313,14 +398,19 @@ export default { }, // 关闭 closeDia() { - this.$refs['form']?.resetFields() + this.$refs['courseForm']?.resetFields() Object.keys(this.courseForm).forEach((item) => { if (Array.isArray(this.courseForm[item])) { - this.courseForm[item] = [] + if (item == 'remark') { + this.courseForm[item] = '' + } else { + this.courseForm[item] = [] + } } else { this.courseForm[item] = '' } }) + this.classType = 0 this.$refs.fileUpload?.reset() this.visibleopen = false }, @@ -361,11 +451,13 @@ export default { .courseName { width: 220px; } + .sourceItem { color: #1890ff; cursor: pointer; text-decoration: underline; } + .sourceItem:hover { color: #0e4272; cursor: pointer; diff --git a/src/views/trainService/signInInfoList.vue b/src/views/trainService/signInInfoList.vue index de1b410..83703bc 100644 --- a/src/views/trainService/signInInfoList.vue +++ b/src/views/trainService/signInInfoList.vue @@ -12,13 +12,12 @@ 重置
- 导出为excel + 导出为excel + @@ -62,6 +61,10 @@ export default { studenName: '', studenCode: '', }, + exportParams: { + studenName: '', + studenCode: '', + }, } }, methods: { @@ -72,9 +75,9 @@ export default { this.signinList = res.rows }, async excelExport() { - const res = await exportSignIn(this.id) + const res = await exportSignIn(this.id,this.exportParams) const blob = new Blob([res]) - saveAs(blob, this.name + '签到记录.xlsx') + saveAs(blob, this.name + '-签到记录.xlsx') //this.$route.query.name // this.download(res) }, @@ -95,6 +98,8 @@ export default { handleQuery() { this.queryParams.pageNum = 1 this.signIninit() + this.exportParams.studenName = this.queryParams.studenName + this.exportParams.studenCode = this.queryParams.studenCode }, resetQuery() { this.resetForm('queryForm') diff --git a/src/views/trainService/signlist.vue b/src/views/trainService/signlist.vue index f04d795..d89d0c2 100644 --- a/src/views/trainService/signlist.vue +++ b/src/views/trainService/signlist.vue @@ -1,31 +1,17 @@ +