提交 0b2d20b9 编写于 作者: haochangdi's avatar haochangdi

优化代码逻辑

上级 84a15cb6
......@@ -475,12 +475,12 @@ export default {
});
if (res.code == "000000") {
//notify
if (type == 2) {
if (type == 3) {
let query = {};
if (this.$route.query.pageNum) {
query = { pageNum: this.$route.query.pageNum };
}
this.$router.push({ path: "item-manager", query: query });
this.$router.push({ path: "template-manager", query: query });
// this.$router.push("item-manager?pageNum="+this.$route.query.pageNum);
}
}
......
......@@ -12,7 +12,7 @@
</el-col>
<el-col :span="7" :offset="5">
<el-button v-if="!fished" size="small" type="primary" @click="nextStep">下一步</el-button>
<el-button v-if="fished" size="small" type="primary" @click="complete">完成</el-button>
<el-button v-if="fished" size="small" type="primary" @click="complete">发布</el-button>
</el-col>
</el-row>
</div>
......
......@@ -23,7 +23,7 @@
</li>
<li class="clase-item" v-if="item.afterExamCount">
<span class="icon"></span>
<i class="icon-message">{{tem.afterExamCount}}次结业考试<i v-if="item.existCertificate "> (通过获结业证书)</i></i>
<i class="icon-message">{{item.afterExamCount}}次结业考试<i v-if="item.existCertificate "> (通过获结业证书)</i></i>
</li>
<li class="clase-item">
<span class="icon"></span>
......
......@@ -236,6 +236,7 @@ export default {
projectBegintime: "", //模板开始时间
projectEndtime: "", //模板结束时间
projectIntro: "", //开放模板简介
projectType: 3, //类型
type: 1, //封面类型 1图片2视频
projectStatus: 3, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
expireDay: 1, //模板有效期(天)
......@@ -643,9 +644,11 @@ export default {
});
return flag;
},
// 取消
confirm() {
vm.dialogObj.visible = false;
},
// 确定
hide() {
vm.dialogObj.visible = false;
this.$emit('backSelectVue')
......
......@@ -52,6 +52,7 @@
</div>
<dialog-componet :dialogObj="dialogObj" @hide="hide"></dialog-componet>
<dialog-componet :dialogObj="sendObj" @hide="hidefn" @confirm="confirmFn"></dialog-componet>
</div>
</template>
......@@ -116,6 +117,13 @@ export default {
message: '本年度免费创建数已达',
hideMsg: '确定'
}
},
sendObj: { // 发布
visible: false,
title: '确定发布吗?',
message: '发布后,项目将进入审核中,待审核完成后学员可在云鹊医App上参加培训学习',
confirmMsg: '取消',
hideMsg: '确定发布'
}
}
},
......@@ -130,48 +138,63 @@ export default {
},
created() {
vm = this;
vm.isEditorFn();
},
mounted() {
commonUtil.resizeHeight();
},
methods: {
isEditorFn(){
if(vm.$route.query.id) {
vm.projectId = vm.$route.query.id;
vm.editor = true;
vm.active = 1;
vm.canNext = true;
}
},
// 下一步
nextStep() {
if (this.active == 0) {
// let flag = this.checkSelectTemplate();
if (vm.active == 0) {
// let flag = vm.checkSelectTemplate();
let flag = true;
if (flag) {
this.active = 1;
vm.active = 1;
}
return;
}
if (this.active == 1) {
this.$refs.templateMessage.nextStep();
if (vm.active == 1) {
vm.$refs.templateMessage.nextStep();
return;
}
},
// 填写项目信息组件的下一步回调
next(id) {
this.projectId = id;
this.active = 2;
vm.projectId = id;
vm.active = 2;
},
// 暂存
save() {
if (this.active == 1) {
this.$refs.templateMessage.save();
} else if (this.active == 2) {
this.regionComplete();
if (vm.active == 1) {
vm.$refs.templateMessage.save();
} else if (vm.active == 2) {
vm.regionComplete();
}
},
confirmFn() {
vm.sendObj.visible = false;
},
// 完成
complete() {
this.regionComplete(this.changeStatus());
vm.sendObj.visible = true;
},
hidefn() {
vm.regionComplete(vm.changeStatus());
},
// 选择学元范围暂存
regionComplete(fishFn) {
let req = {
projectId: this.projectId,
scopeOfAdministrative: this.$refs.selectRegion.setScope(),
projectId: vm.projectId,
scopeOfAdministrative: vm.$refs.selectRegion.setScope(),
scopeOfDepartment: 99999999,
flag: fishFn ? 3 : 1, //0:下一步 1:暂存
};
......@@ -192,15 +215,17 @@ export default {
// 完成后更改状态
changeStatus() {
let req = {
projectId: this.projectId,
projectId: vm.projectId,
changeStatus: 3 //待审核
};
vm.POST("portal/portalInfo/changeStatus", req)
.then(res => {
vm.$message({
type: "info",
message: res.message
});
vm.sendObj.visible = false;
let query = {};
if (vm.$route.query.pageNum) {
query = { pageNum: vm.$route.query.pageNum };
}
vm.$router.push({ path: "item-manager", query: query });
})
.catch(() => {
vm.$message({
......@@ -212,13 +237,13 @@ export default {
//切换tabs
handleClickTabs(tab, event) {
if (tab.name == 'second') {
this.setRegion();
vm.setRegion();
}
},
// 模板列表选中
checkFn(id) {
this.canNext = true;
this.openTemplateId = id;
vm.canNext = true;
vm.openTemplateId = id;
},
//选中模板后点击下一步时检测(机构和进行中的项目)
checkSelectTemplate() {
......@@ -230,8 +255,8 @@ export default {
if (res.data.status == 0) {
return true;
} else {
this.dialogObj = Object.assign(this.dialogObj, this.statusObj[`status_${res.data.status}`]);
this.dialogObj.visible = true;
vm.dialogObj = Object.assign(vm.dialogObj, vm.statusObj[`status_${res.data.status}`]);
vm.dialogObj.visible = true;
return false;
}
} else {
......@@ -245,19 +270,19 @@ export default {
},
// 隐藏弹框
hide() {
this.dialogObj.visible = false;
vm.dialogObj.visible = false;
},
// 获取行政范围
setRegion() {
this.getOrganizationList(this.$refs.selectRegion.getScope());
vm.getOrganizationList(vm.$refs.selectRegion.getScope());
},
// 查询行政范围的设定机构列表
getOrganizationList(r) {
this.$refs.setOrganization.getOrganization(r);
vm.$refs.setOrganization.getOrganization(r);
},
// 返回选择模板页
backSelectVue() {
this.active = 0;
vm.active = 0;
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册