|
@@ -21,6 +21,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
+ <!-- <el-button @click="selectT(2)" type="primary">确定并保存课程</el-button> -->
|
|
|
<el-button @click="selectT" type="primary">确 定</el-button>
|
|
|
<el-button @click="close">关 闭</el-button>
|
|
|
</span>
|
|
@@ -82,7 +83,7 @@ export default {
|
|
|
close() {
|
|
|
this.$emit('update:dialogVisibleTips', false)
|
|
|
},
|
|
|
- selectT() {
|
|
|
+ selectT(type) {
|
|
|
if (!this.title) {
|
|
|
this.$message.error('请输入模板名称');
|
|
|
return
|
|
@@ -98,13 +99,13 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
.then(() => {
|
|
|
- this.updateTipsTemplate();
|
|
|
+ this.updateTipsTemplate(type);
|
|
|
})
|
|
|
.catch(() => {
|
|
|
return;
|
|
|
});
|
|
|
}else{
|
|
|
- this.addTipsTemplate();
|
|
|
+ this.addTipsTemplate(type);
|
|
|
}
|
|
|
// let params = {
|
|
|
// userid: this.userid,
|
|
@@ -138,7 +139,7 @@ export default {
|
|
|
// console.error(err);
|
|
|
// });
|
|
|
},
|
|
|
- addTipsTemplate() {
|
|
|
+ addTipsTemplate(type) {
|
|
|
let params = [{
|
|
|
n: this.title,
|
|
|
d: this.detail,
|
|
@@ -150,7 +151,14 @@ export default {
|
|
|
.post(this.$store.state.api + "addTipsTemplate", params)
|
|
|
.then((res) => {
|
|
|
this.$message.success("保存成功");
|
|
|
- this.$emit('retrunCourse')
|
|
|
+ console.log(res.data);
|
|
|
+ this.$emit('update:templateid', res.data[0][0].id)
|
|
|
+ console.log(this.templateid)
|
|
|
+ if(type == 2){
|
|
|
+ this.$emit('addWork', type)
|
|
|
+ }else{
|
|
|
+ this.$emit('retrunCourse')
|
|
|
+ }
|
|
|
this.close();
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -158,7 +166,7 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
- updateTipsTemplate() {
|
|
|
+ updateTipsTemplate(type) {
|
|
|
let params = [{
|
|
|
n: this.title,
|
|
|
d: this.detail,
|
|
@@ -170,7 +178,11 @@ export default {
|
|
|
.post(this.$store.state.api + "addTipsTemplate", params)
|
|
|
.then((res) => {
|
|
|
this.$message.success("修改成功");
|
|
|
- this.$emit('retrunCourse')
|
|
|
+ if(type == 2){
|
|
|
+ this.$emit('addWork', type)
|
|
|
+ }else{
|
|
|
+ this.$emit('retrunCourse')
|
|
|
+ }
|
|
|
this.close();
|
|
|
})
|
|
|
.catch((err) => {
|