<template>
|
<div class="contentBox">
|
<div class="generateEorder">
|
<div class="crumbBox">
|
<el-breadcrumb separator-class="el-icon-arrow-right">
|
<span style="float: left">当前位置:</span>
|
<el-breadcrumb-item :to="{ path: '/textbooks' }">数字教材</el-breadcrumb-item>
|
<el-breadcrumb-item>申请试用</el-breadcrumb-item>
|
</el-breadcrumb>
|
</div>
|
</div>
|
<div class="content">
|
<div class="title">协和云课堂数字教材试用申请表</div>
|
<div class="center">
|
<div class="headline">教材申请</div>
|
<div class="book-list">
|
<div class="book-example">
|
<div class="imgBox">
|
<img :src="textBookInfo.icon" alt />
|
</div>
|
<div class="bookname">{{ textBookInfo.name }}</div>
|
</div>
|
</div>
|
<div class="headline">授课情况</div>
|
<el-form
|
label-width="200px"
|
label-position="right"
|
:model="formData"
|
class="teachingSituationForm"
|
:rules="rules"
|
ref="teachingSituationForm"
|
>
|
<el-form-item label="课程名称:" prop="courseName">
|
<el-input v-model="formData.courseName"></el-input>
|
</el-form-item>
|
<el-form-item label="学生层次:" prop="studentLevel">
|
<el-input v-model="formData.studentLevel"></el-input>
|
</el-form-item>
|
<el-form-item label="学生人数/年:" prop="studentsNumber">
|
<el-input v-model="formData.studentsNumber"></el-input>
|
</el-form-item>
|
<el-form-item label="现在使用教材所属出版社:" prop="teachingMaterialPress">
|
<el-input v-model="formData.teachingMaterialPress"></el-input>
|
</el-form-item>
|
<el-form-item label="所用教材:" prop="teachingMaterials">
|
<el-input v-model="formData.teachingMaterials"></el-input>
|
</el-form-item>
|
</el-form>
|
<div class="btn">
|
<el-button :loading="loading" @click="submit(teachingSituationForm)">提交</el-button>
|
<el-button @click="toSelectBook()">返回</el-button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script setup>
|
import { ref, reactive, inject, onMounted } from 'vue'
|
import { useRoute } from 'vue-router'
|
const MG = inject('MG')
|
import { useUserStore } from '@/store'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { useRouter } from 'vue-router'
|
const toolClass = inject('toolClass')
|
const userStore = useUserStore()
|
onMounted(() => {
|
getType()
|
})
|
|
let textBookInfo = ref(JSON.parse(localStorage.getItem('applyBookInfo')))
|
let loading = ref(false)
|
let formData = ref({
|
courseName: '',
|
studentLevel: '',
|
studentsNumber: '',
|
teachingMaterialPress: '',
|
teachingMaterials: '',
|
})
|
|
let workInfo = ref([])
|
const teachingSituationForm = ref()
|
|
const rules = {
|
courseName: [{ required: true, message: '请填写课程名称' }],
|
studentLevel: [{ required: true, message: '请填写学生层次' }],
|
studentsNumber: [{ required: true, message: '请填写学生人数/年' }],
|
teachingMaterialPress: [{ required: true, message: '请填写现在使用教材所属出版社' }],
|
teachingMaterials: [{ required: true, message: '请填写所用教材' }],
|
}
|
|
const getType = () => {
|
const data = {
|
refCodes: ['sampleBook'],
|
}
|
MG.resource.getCmsTypeByRefCode(data).then((res) => {
|
console.log(res, 'sampleBook')
|
workInfo.value = res[0].cmsTypeLinks[0].children
|
})
|
}
|
|
const submit = async (formEl) => {
|
if (!formEl) return
|
formEl.validate((valid) => {
|
if (valid) {
|
loading.value = true
|
const contentData = {
|
id: textBookInfo.value.id,
|
title: textBookInfo.value.name,
|
icon: textBookInfo.value.icon,
|
isbn: textBookInfo.value.tourism_ISBN,
|
author: textBookInfo.value.tourism_author,
|
price: textBookInfo.value.price,
|
}
|
const data = {
|
topicIdOrRefCode: 'applyDigitalBook',
|
name: userStore.userInfo?.name || '-',
|
cmsTypeRefCode: 'sampleBook ',
|
content: JSON.stringify([contentData]),
|
state: 'WaitAudit',
|
type: 'applyDigitalBook',
|
newDataListRequest: toolClass.worksDataBytool(workInfo.value, formData.value),
|
}
|
MG.ugc.newTopicMessage(data).then((res) => {
|
loading.value = false
|
if (res) {
|
ElMessageBox.confirm('您的试用申请已提交,管理员审核中!', 'success', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'success',
|
})
|
.then(() => {
|
this.$router.go(-1)
|
formEl.resetFields()
|
})
|
.catch(() => {
|
this.$router.go(-1)
|
formEl.resetFields()
|
})
|
}
|
})
|
}
|
})
|
}
|
const toSelectBook = () => {}
|
</script>
|
|
<style scoped>
|
.imgBox {
|
display: inline-block;
|
position: relative;
|
width: 100px;
|
height: 140px;
|
background: #fff;
|
}
|
.imgBox img {
|
width: auto;
|
height: auto;
|
max-width: 100%;
|
max-height: 100%;
|
position: absolute;
|
top: 0;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
margin: auto;
|
}
|
.contentBox {
|
display: flex;
|
flex-direction: column;
|
}
|
.generateEorder {
|
width: 1200px;
|
margin: 0 auto;
|
padding: 20px 0;
|
}
|
.xian {
|
width: 100%;
|
height: 5px;
|
}
|
/* content */
|
.content {
|
border: 1px solid #dcdcdc;
|
margin: 11px auto 111px;
|
}
|
.content .title {
|
margin: 0 auto;
|
width: 1160px;
|
border-bottom: 2px dashed #dcdcdc;
|
font-size: 24px;
|
color: #333;
|
text-align: center;
|
line-height: 70px;
|
font-weight: bold;
|
}
|
.content .center {
|
width: 1100px;
|
margin: 0 auto;
|
}
|
.headline {
|
font-size: 16px;
|
color: #333;
|
font-weight: bold;
|
padding-top: 40px;
|
}
|
.list {
|
background-color: #f1f8fe;
|
border-radius: 2px;
|
font-size: 14px;
|
line-height: 28px;
|
margin-top: 20px;
|
color: #333;
|
padding: 10px 0 15px 20px;
|
}
|
.personal {
|
font-weight: bold;
|
}
|
.checkBox {
|
position: absolute;
|
top: 86px;
|
left: 30px;
|
}
|
.book-example {
|
position: relative;
|
display: inline-block;
|
overflow: hidden;
|
padding: 20px 40px;
|
text-align: center;
|
}
|
.book-example img {
|
border: 1px solid #dcdcdc;
|
}
|
.bookname {
|
width: 100%;
|
white-space: nowrap;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
font-size: 15px;
|
color: #333;
|
line-height: 29px;
|
}
|
.book-list {
|
margin-top: 10px;
|
border: 1px solid #dcdcdc;
|
overflow: hidden;
|
margin-bottom: 10px;
|
}
|
.btn {
|
margin: 50px 0;
|
text-align: center;
|
}
|
.teachingSituationForm {
|
margin-top: 20px;
|
}
|
</style>
|
<style>
|
.generateEorder .el-button {
|
width: 120px;
|
height: 40px;
|
background-color: #2b68cd;
|
color: #fff;
|
}
|
.generateEorder .el-button:last-child {
|
border: solid 1px #2b68cd;
|
color: #2b68cd;
|
background-color: #fff;
|
}
|
|
.generateEorder .el-input__inner {
|
border-radius: 0;
|
border: none;
|
border-bottom: 1px solid #eee;
|
width: 315px;
|
height: 30px;
|
}
|
</style>
|