|
@@ -246,36 +246,6 @@
|
|
<TeaTable :schedData="schdData" :teacher="$store.state.userInfo.TEAMModelId" :periodId="curPd" mode="view"></TeaTable>
|
|
<TeaTable :schedData="schdData" :teacher="$store.state.userInfo.TEAMModelId" :periodId="curPd" mode="view"></TeaTable>
|
|
</vuescroll>
|
|
</vuescroll>
|
|
</div>
|
|
</div>
|
|
- <Drawer :title="$t('cusMgt.cusInfo')" class-name="dark-iview-drawer" width="450" :closable="false" v-model="showCusInfo" @on-close="baseEditStatus = true">
|
|
|
|
- <!--基础信息-->
|
|
|
|
- <div class="course-base-info-content dark-iview-form disabled-iview-select dark-wang-editor">
|
|
|
|
- <Form ref="courseBaseInfo" label-position="top">
|
|
|
|
- <FormItem :label="$t('cusMgt.cusName')" prop="name" class="disabled-iview-select">
|
|
|
|
- <Input v-if="listType == 'school' && courseListShow[curCusIndex]" v-model="courseListShow[curCusIndex].name" :disabled="true" style="width:100%" :placeholder="$t('cusMgt.cusName')" :clearable="true"></Input>
|
|
|
|
- <Input v-else-if="listType == 'private' && courseListShow[curCusIndex]" v-model="courseListShow[curCusIndex].name" :disabled="baseEditStatus" style="width:100%" :placeholder="$t('cusMgt.cusName')" :clearable="true"></Input>
|
|
|
|
- </FormItem>
|
|
|
|
- <FormItem :label="$t('cusMgt.cusCode')" prop="no" class="disabled-iview-select">
|
|
|
|
- <Input v-if="listType == 'school' && courseListShow[curCusIndex]" v-model="courseListShow[curCusIndex].no" :disabled="true" style="width:100%" :placeholder="$t('cusMgt.cusCode')" :clearable="true"></Input>
|
|
|
|
- <Input v-else-if="listType == 'private' && courseListShow[curCusIndex]" v-model="courseListShow[curCusIndex].no" :disabled="baseEditStatus" style="width:100%" :placeholder="$t('cusMgt.cusCode')" :clearable="true"></Input>
|
|
|
|
- </FormItem>
|
|
|
|
- <FormItem :label="$t('courseManage.base.courseNotice')">
|
|
|
|
- <!-- 暂时注释课程公告功能 -->
|
|
|
|
- <!-- <span>课程公告暂未处理</span> -->
|
|
|
|
- <!-- <div ref="courseNotice" v-show="!baseEditStatus"></div>
|
|
|
|
- <div v-show="baseEditStatus" style="height:fit-content;color:white;font-size:16px;padding-left:10px;width:100%;">
|
|
|
|
- <vuescroll>
|
|
|
|
- <div v-if="listType == 'school' && courseListS[curCusIndex] && checkNotice(courseListS[curCusIndex].notice)" v-html="courseListS[curCusIndex][0].notice" style=""></div>
|
|
|
|
- <div v-else-if="listType == 'private' && courseListP[curCusIndex] && checkNotice(courseListP[curCusIndex].notice)" v-html="courseListP[curCusIndex].notice" style=""></div>
|
|
|
|
- <div v-else style="">{{$t('cusMgt.noNotice')}}</div>
|
|
|
|
- </vuescroll>
|
|
|
|
- </div> -->
|
|
|
|
- </FormItem>
|
|
|
|
- <FormItem label="">
|
|
|
|
- <Button style="width:100%;margin-top:10px;" @click="edNotice">{{baseEditStatus ? $t('cusMgt.edit') : $t('cusMgt.save')}}</Button>
|
|
|
|
- </FormItem>
|
|
|
|
- </Form>
|
|
|
|
- </div>
|
|
|
|
- </Drawer>
|
|
|
|
<!-- 创建名单 -->
|
|
<!-- 创建名单 -->
|
|
<Modal v-model="newSlStatus" width="600" @on-ok="confirmCreateList" class-name="dark-iview-modal dark-iview-form" :loading="modalLoading">
|
|
<Modal v-model="newSlStatus" width="600" @on-ok="confirmCreateList" class-name="dark-iview-modal dark-iview-form" :loading="modalLoading">
|
|
<div slot="header">
|
|
<div slot="header">
|
|
@@ -302,19 +272,18 @@
|
|
</FormItem>
|
|
</FormItem>
|
|
</Form>
|
|
</Form>
|
|
<span class="create-list-tips">{{$store.state.userInfo.hasSchool ? $t('cusMgt.createTips1') : $t('cusMgt.createTips2')}}</span>
|
|
<span class="create-list-tips">{{$store.state.userInfo.hasSchool ? $t('cusMgt.createTips1') : $t('cusMgt.createTips2')}}</span>
|
|
- <!-- <StudentList v-if="$store.state.userInfo.hasSchool" @getSelectInfo="(selction)=>{createStuList = selction}"></StudentList>
|
|
|
|
- <p v-else class="no-school-tips">
|
|
|
|
- {{$t('cusMgt.noSchoolStu')}}
|
|
|
|
- </p> -->
|
|
|
|
</Modal>
|
|
</Modal>
|
|
- <Modal v-model="addCusStatus" :title="$t('cusMgt.addCus')" @on-ok="confirmAddCus" class-name="dark-iview-modal dark-iview-form">
|
|
|
|
|
|
+ <Modal v-model="addCusStatus" :title="$t('cusMgt.addCus')" @on-ok="confirmAddCus" class-name="dark-iview-modal dark-iview-form" :loading="modalLoading">
|
|
<Form ref="addCusInfo" :model="addCusInfo" :rules="ruleAddCus">
|
|
<Form ref="addCusInfo" :model="addCusInfo" :rules="ruleAddCus">
|
|
<FormItem prop="name" :label="$t('cusMgt.cusName')">
|
|
<FormItem prop="name" :label="$t('cusMgt.cusName')">
|
|
<Input type="text" v-model="addCusInfo.name" :placeholder="$t('cusMgt.nameHolder')"></Input>
|
|
<Input type="text" v-model="addCusInfo.name" :placeholder="$t('cusMgt.nameHolder')"></Input>
|
|
</FormItem>
|
|
</FormItem>
|
|
- <FormItem :label="$t('cusMgt.cusCode')">
|
|
|
|
|
|
+ <FormItem :label="$t('cusMgt.cusCode')" prop="no">
|
|
<Input type="text" v-model="addCusInfo.no" :placeholder="$t('cusMgt.codeHolder')"></Input>
|
|
<Input type="text" v-model="addCusInfo.no" :placeholder="$t('cusMgt.codeHolder')"></Input>
|
|
</FormItem>
|
|
</FormItem>
|
|
|
|
+ <FormItem :label="$t('cusMgt.cusDesc')" prop="desc">
|
|
|
|
+ <Input v-model="addCusInfo.desc" type="textarea" :maxlength="200" show-word-limit :autosize="{ minRows: 4, maxRows: 6 }" :placeholder="$t('cusMgt.descHolder')" />
|
|
|
|
+ </FormItem>
|
|
</Form>
|
|
</Form>
|
|
</Modal>
|
|
</Modal>
|
|
<Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu" class-name="dark-iview-modal">
|
|
<Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu" class-name="dark-iview-modal">
|
|
@@ -347,7 +316,6 @@
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
import QRCode from 'qrcodejs2'
|
|
import QRCode from 'qrcodejs2'
|
|
import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
|
|
import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
|
|
-import E from '@/utils/wangEditor.js'
|
|
|
|
import StudentList from '@/components/coursemgt/StudentList.vue'
|
|
import StudentList from '@/components/coursemgt/StudentList.vue'
|
|
import TeaTable from './TeaTable.vue'
|
|
import TeaTable from './TeaTable.vue'
|
|
export default {
|
|
export default {
|
|
@@ -358,14 +326,11 @@ export default {
|
|
data() {
|
|
data() {
|
|
// 验证只能是字母和数字
|
|
// 验证只能是字母和数字
|
|
const validateCode = (rule, value, callback) => {
|
|
const validateCode = (rule, value, callback) => {
|
|
- if (!value) {
|
|
|
|
- return callback(new Error(this.$t('cusMgt.codeErr1')))
|
|
|
|
- }
|
|
|
|
let zg = /^[0-9a-zA-Z]+$/
|
|
let zg = /^[0-9a-zA-Z]+$/
|
|
- if (zg.test(value)) {
|
|
|
|
- callback()
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (value && !zg.test(value)) {
|
|
callback(new Error(this.$t('cusMgt.codeErr2')))
|
|
callback(new Error(this.$t('cusMgt.codeErr2')))
|
|
|
|
+ } else {
|
|
|
|
+ callback()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
@@ -378,10 +343,6 @@ export default {
|
|
cusType: [],
|
|
cusType: [],
|
|
curPd: '',
|
|
curPd: '',
|
|
isShowSchd: false,
|
|
isShowSchd: false,
|
|
- // schoolBase: {
|
|
|
|
- // period: []
|
|
|
|
- // },
|
|
|
|
- // classList: [],
|
|
|
|
split1: 0.2,
|
|
split1: 0.2,
|
|
split2: 0.2,
|
|
split2: 0.2,
|
|
acTypeList: [
|
|
acTypeList: [
|
|
@@ -497,7 +458,6 @@ export default {
|
|
editClassStatus: false,
|
|
editClassStatus: false,
|
|
baseEditStatus: true,
|
|
baseEditStatus: true,
|
|
showQrStatus: false,
|
|
showQrStatus: false,
|
|
- showCusInfo: false,
|
|
|
|
listLoading: false,
|
|
listLoading: false,
|
|
newSlStatus: false,
|
|
newSlStatus: false,
|
|
stuLoading: false,
|
|
stuLoading: false,
|
|
@@ -513,7 +473,8 @@ export default {
|
|
addCusInfo: {
|
|
addCusInfo: {
|
|
name: '',
|
|
name: '',
|
|
no: '',
|
|
no: '',
|
|
- id: ''
|
|
|
|
|
|
+ id: '',
|
|
|
|
+ desc: ''
|
|
},
|
|
},
|
|
listName: '',
|
|
listName: '',
|
|
ruleAddCus: {
|
|
ruleAddCus: {
|
|
@@ -521,7 +482,7 @@ export default {
|
|
{ required: true, message: this.$t('cusMgt.nameHolder'), trigger: 'change' }
|
|
{ required: true, message: this.$t('cusMgt.nameHolder'), trigger: 'change' }
|
|
],
|
|
],
|
|
no: [
|
|
no: [
|
|
- { required: true, validator: validateCode, trigger: 'change' }
|
|
|
|
|
|
+ { validator: validateCode, trigger: 'change' }
|
|
]
|
|
]
|
|
},
|
|
},
|
|
stuList: []
|
|
stuList: []
|
|
@@ -638,7 +599,7 @@ export default {
|
|
try {
|
|
try {
|
|
let listRes = await this.getListInfo([...ids])
|
|
let listRes = await this.getListInfo([...ids])
|
|
if (listRes) {
|
|
if (listRes) {
|
|
- let already = this.stuList.map(item=>{
|
|
|
|
|
|
+ let already = this.stuList.map(item => {
|
|
return item.id
|
|
return item.id
|
|
})
|
|
})
|
|
listRes.stuList.forEach(item => {
|
|
listRes.stuList.forEach(item => {
|
|
@@ -997,47 +958,8 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
editCus() {
|
|
editCus() {
|
|
- this.toggleCusInfo()
|
|
|
|
- this.edNotice()
|
|
|
|
- },
|
|
|
|
- toggleCusInfo() {
|
|
|
|
- this.showCusInfo = !this.showCusInfo
|
|
|
|
- },
|
|
|
|
- edNotice() {
|
|
|
|
- if (this.baseEditStatus) {
|
|
|
|
- this.baseEditStatus = !this.baseEditStatus
|
|
|
|
- this.initEditor()
|
|
|
|
- } else {
|
|
|
|
- this.updCusInfo()
|
|
|
|
- this.baseEditStatus = !this.baseEditStatus
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- //初始化富文本编辑器
|
|
|
|
- initEditor() {
|
|
|
|
- if (!this.noticeEditor) {
|
|
|
|
- let noticeEditor = new E(this.$refs.courseNotice)
|
|
|
|
- noticeEditor.customConfig.onchange = (html) => {
|
|
|
|
- //TODO 设置课程公告
|
|
|
|
- }
|
|
|
|
- noticeEditor.customConfig.menus = [
|
|
|
|
- 'bold', // 粗体
|
|
|
|
- 'italic', // 斜体
|
|
|
|
- 'underline', // 下划线
|
|
|
|
- 'list', // 列表
|
|
|
|
- 'link', // 插入链接
|
|
|
|
- 'image' // 插入图片
|
|
|
|
- ],
|
|
|
|
- noticeEditor.customConfig.showLinkImg = false
|
|
|
|
- noticeEditor.customConfig.uploadFileName = 'files'
|
|
|
|
- noticeEditor.create()
|
|
|
|
- noticeEditor.txt.html(this.courseListShow[this.curCusIndex].notice)
|
|
|
|
- this.noticeEditor = noticeEditor
|
|
|
|
- } else {
|
|
|
|
- let schoolNotice = this.courseListShow[this.curCusIndex][0].notice ? this.courseListShow[this.curCusIndex][0].notice : ''
|
|
|
|
- this.noticeEditor.txt.html(this.listType == 'school' ? schoolNotice : this.courseListShow[this.curCusIndex].notice)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ this.addCusInfo = this._.cloneDeep(this.courseListShow[this.curCusIndex])
|
|
|
|
+ this.addCusStatus = true
|
|
},
|
|
},
|
|
//创建二维码
|
|
//创建二维码
|
|
createQRCode(url) {
|
|
createQRCode(url) {
|
|
@@ -1310,36 +1232,65 @@ export default {
|
|
this.$refs['addCusInfo'].validate((valid) => {
|
|
this.$refs['addCusInfo'].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
let requestData = {
|
|
let requestData = {
|
|
- option: 'insert',
|
|
|
|
|
|
+ option: this.addCusInfo.id ? 'update' : 'insert',
|
|
scope: 'private',
|
|
scope: 'private',
|
|
course: {
|
|
course: {
|
|
name: this.addCusInfo.name,
|
|
name: this.addCusInfo.name,
|
|
no: this.addCusInfo.no,
|
|
no: this.addCusInfo.no,
|
|
- id: this.$tools.guid(),
|
|
|
|
|
|
+ desc: this.addCusInfo.desc,
|
|
|
|
+ id: this.addCusInfo.id || this.$tools.guid(),
|
|
code: this.$store.state.userInfo.TEAMModelId,
|
|
code: this.$store.state.userInfo.TEAMModelId,
|
|
- schedule: [],
|
|
|
|
|
|
+ schedule: this.addCusInfo.schedule || [],
|
|
scope: 'private',
|
|
scope: 'private',
|
|
- // school: this.$store.state.userInfo.schoolCode,
|
|
|
|
creatorId: this.$store.state.userInfo.schoolCode
|
|
creatorId: this.$store.state.userInfo.schoolCode
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.$api.courseMgmt.saveOrUpdateCourse(requestData).then(
|
|
this.$api.courseMgmt.saveOrUpdateCourse(requestData).then(
|
|
(res) => {
|
|
(res) => {
|
|
- if (res.error == null) {
|
|
|
|
- this.$Message.success(this.$t('cusMgt.addOk'))
|
|
|
|
- // this.courseListP.push(requestData.course)
|
|
|
|
- this.courseList.push(requestData.course)
|
|
|
|
- this.courseListShow.push(requestData.course)
|
|
|
|
|
|
+ if (!res.error) {
|
|
|
|
+ this.$Message.success(this.addCusInfo.id ? this.$t('cusMgt.editOk') : this.$t('cusMgt.addOk'))
|
|
|
|
+ //新增课程
|
|
|
|
+ if (!this.addCusInfo.id) {
|
|
|
|
+ this.courseList.push(requestData.course)
|
|
|
|
+ this.courseListShow.push(requestData.course)
|
|
|
|
+ }
|
|
|
|
+ // 修改课程
|
|
|
|
+ else {
|
|
|
|
+ let index = this.courseListShow.findIndex(item => {
|
|
|
|
+ return item.id == this.addCusInfo.id
|
|
|
|
+ })
|
|
|
|
+ if (index > -1) {
|
|
|
|
+ this.courseListShow.splice(index, 1, requestData.course)
|
|
|
|
+ }
|
|
|
|
+ let oraginIndex = this.courseList.findIndex(item => {
|
|
|
|
+ return item.id == this.addCusInfo.id
|
|
|
|
+ })
|
|
|
|
+ if (index > -1) {
|
|
|
|
+ this.courseList.splice(oraginIndex, 1, requestData.course)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.addCusStatus = false
|
|
} else {
|
|
} else {
|
|
- this.$Message.success(this.$t('cusMgt.addErr'))
|
|
|
|
|
|
+ this.$Message.error(this.addCusInfo.id ? this.$t('cusMgt.editErr') : this.$t('cusMgt.addErr'))
|
|
|
|
+ this.modalLoading = false
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.modalLoading = true
|
|
|
|
+ }, 0)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
(err) => {
|
|
(err) => {
|
|
-
|
|
|
|
|
|
+ this.modalLoading = false
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.modalLoading = true
|
|
|
|
+ }, 0)
|
|
}
|
|
}
|
|
)
|
|
)
|
|
} else {
|
|
} else {
|
|
this.$Message.error(this.$t('cusMgt.formTips'));
|
|
this.$Message.error(this.$t('cusMgt.formTips'));
|
|
|
|
+ this.modalLoading = false
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.modalLoading = true
|
|
|
|
+ }, 0)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -1433,7 +1384,7 @@ export default {
|
|
try {
|
|
try {
|
|
let listRes = await this.getListInfo([...ids])
|
|
let listRes = await this.getListInfo([...ids])
|
|
if (listRes) {
|
|
if (listRes) {
|
|
- let already = this.stuList.map(item=>{
|
|
|
|
|
|
+ let already = this.stuList.map(item => {
|
|
return item.id
|
|
return item.id
|
|
})
|
|
})
|
|
listRes.stuList.forEach(item => {
|
|
listRes.stuList.forEach(item => {
|