|
|
@@ -69,19 +69,15 @@
|
|
|
<div class="mainItem mainItemData">
|
|
|
<p class="label labelPeople">培训资料</p>
|
|
|
<div>
|
|
|
-
|
|
|
- <div v-for="item in studyList" :key="item.name">
|
|
|
-
|
|
|
- <van-tag type="primary" @click="tagHandler(item)" class="tagCls" plain >{{
|
|
|
- item.name
|
|
|
- }}</van-tag><span class="deleteCls" @click="close(item)">删除</span>
|
|
|
- </div>
|
|
|
-
|
|
|
+ <div v-for="item in studyList" :key="item.name">
|
|
|
+ <van-tag type="primary" @click="tagHandler(item)" class="tagCls" plain>{{ item.name }}</van-tag
|
|
|
+ ><span class="deleteCls" @click="close(item)">删除</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<van-field label="">
|
|
|
<template #input>
|
|
|
- <van-button type="info" size="small" @click="selectData">从学习资料选取</van-button>
|
|
|
+ <van-button type="info" size="small" @click="selectData">选取知识库文件</van-button>
|
|
|
</template>
|
|
|
</van-field>
|
|
|
<!-- 培训内容 -->
|
|
|
@@ -139,7 +135,12 @@
|
|
|
<van-button type="info" @click="submitHandler(2)">提交</van-button>
|
|
|
</div>
|
|
|
<!-- 选择资料 -->
|
|
|
- <SelectData ref="SelectData" :organizationId="trainingData.orgId" :listLength="studyList.length" @dataList="dataList"></SelectData>
|
|
|
+ <SelectData
|
|
|
+ ref="SelectData"
|
|
|
+ :organizationId="trainingData.orgId"
|
|
|
+ :listLength="studyList.length"
|
|
|
+ @dataList="dataList"
|
|
|
+ ></SelectData>
|
|
|
</van-form>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -261,8 +262,7 @@ export default {
|
|
|
//从资料里选取
|
|
|
selectData() {
|
|
|
this.$refs.SelectData.show = true
|
|
|
- this.studyList=this.studyList.filter(item=>item.type!=undefined)
|
|
|
-
|
|
|
+ this.studyList = this.studyList.filter(item => item.type != undefined)
|
|
|
},
|
|
|
clikHadner() {
|
|
|
this.$refs.PDFAndImgLook.show = true
|
|
|
@@ -414,17 +414,28 @@ export default {
|
|
|
// 表单提交
|
|
|
submitHandlerConfirm(type) {
|
|
|
let obj = JSON.parse(JSON.stringify(this.form))
|
|
|
- obj.trainingEndDateTime=obj.trainingEndDateTime?obj.trainingEndDateTime+':00':''
|
|
|
- obj.trainingStartDateTime=obj.trainingStartDateTime?obj.trainingStartDateTime+':00':''
|
|
|
+ //动态拼接秒钟
|
|
|
+ let trainingStartDateTime = obj.trainingStartDateTime
|
|
|
+ let trainingEndDateTime = obj.trainingEndDateTime
|
|
|
+ if (trainingStartDateTime && trainingStartDateTime.length == 19) {
|
|
|
+ obj.trainingStartDateTime = obj.trainingStartDateTime ? obj.trainingStartDateTime : ''
|
|
|
+ } else {
|
|
|
+ obj.trainingStartDateTime = obj.trainingStartDateTime ? obj.trainingStartDateTime + ':00' : ''
|
|
|
+ }
|
|
|
+ if (trainingEndDateTime && trainingEndDateTime.length == 19) {
|
|
|
+ obj.trainingEndDateTime = obj.trainingEndDateTime ? obj.trainingEndDateTime : ''
|
|
|
+ } else {
|
|
|
+ obj.trainingEndDateTime = obj.trainingEndDateTime ? obj.trainingEndDateTime + ':00' : ''
|
|
|
+ }
|
|
|
obj.imageList = obj.imageList.map(item => item.path).join(',')
|
|
|
- console.log(obj.imageList)
|
|
|
+
|
|
|
obj.taskUserList = []
|
|
|
- let list=this.studyList
|
|
|
- obj.fileList=[]
|
|
|
- list.forEach(item=>{
|
|
|
+ let list = this.studyList
|
|
|
+ obj.fileList = []
|
|
|
+ list.forEach(item => {
|
|
|
obj.fileList.push(JSON.stringify(item))
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
obj.taskUserList.push(...this.userPeopleList, ...this.lackPeopleList)
|
|
|
|
|
|
edittrainingInfo({
|
|
|
@@ -436,7 +447,7 @@ export default {
|
|
|
}).then(res => {
|
|
|
let { code, msg } = res
|
|
|
if (code == 200) {
|
|
|
- Toast(`${type==1? '保存':'提交'}成功`)
|
|
|
+ Toast(`${type == 1 ? '保存' : '提交'}成功`)
|
|
|
this.$router.push('/training')
|
|
|
} else {
|
|
|
Toast(msg)
|
|
|
@@ -445,8 +456,7 @@ export default {
|
|
|
},
|
|
|
dataList(list) {
|
|
|
this.studyList.push(...list)
|
|
|
- this.studyList=uniqBy(this.studyList, 'name')
|
|
|
-
|
|
|
+ this.studyList = uniqBy(this.studyList, 'name')
|
|
|
},
|
|
|
tagHandler(i) {
|
|
|
let str = i.name.split('.')[1]
|
|
|
@@ -466,10 +476,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//清除
|
|
|
- close(item){
|
|
|
- this.studyList=this.studyList.filter(i=> item.name!=i.name)
|
|
|
+ close(item) {
|
|
|
+ this.studyList = this.studyList.filter(i => item.name != i.name)
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -525,7 +534,7 @@ export default {
|
|
|
margin-bottom: 20px;
|
|
|
margin-left: 10px;
|
|
|
}
|
|
|
-.deleteCls{
|
|
|
+.deleteCls {
|
|
|
color: #3095fb;
|
|
|
text-decoration: dashed;
|
|
|
margin-left: 30px;
|