提交 30ce6581 编写于 作者: guangjun.yang's avatar guangjun.yang

新建按钮相关

上级 7a1f8841
......@@ -12,9 +12,10 @@
<div slot="title" style="text-align: left;">
<span style="font-weight: 700;">用户协议</span>
</div>
<div v-html="protocolInfo.contents"></div>
<div v-html="protocolContent"></div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="close">确 定</el-button>
<el-button @click="close">不同意</el-button>
<el-button type="primary" @click="signProtocol">同意</el-button>
</div>
</el-dialog>
</div>
......@@ -23,9 +24,7 @@
export default {
data() {
return {
protocolInfo: {
contents: ''
}
};
},
props: {
......@@ -35,35 +34,41 @@ export default {
},
protocolId: {
type: String | Number,
default: 0
}
},
watch: {
protocolId(newVal) {
if(newVal) {
this.getProtocolInfoById(newVal);
}
default: 1
},
protocolContent: {
type: String,
default: ''
}
},
computed: {
},
mounted() {
// this.getProtocolInfoById();
},
methods: {
// 查询列表
getProtocolInfoById(protocolId) {
// 签署协议
signProtocol() {
let req = {
protocolId: protocolId
setEntry: true,
};
this.GET("smartcontract/protocolManage/protocol", req).then(res => {
this.POST("smartcontract/protocol/sign?type=" + this.protocolId, req).then(res => {
if (res.code == "000000") {
this.protocolInfo = res.data;
this.close(true);
} else {
vm.$message.info(res.message);
this.close(false);
}
}).catch(err => {
vm.$message.warning("请稍后重试");
this.close(false);
});
},
close() {
this.$emit('close');
close(status) {
this.$emit('close', status);
},
}
};
......
此差异已折叠。
......@@ -61,7 +61,10 @@
<div v-else class="no-list">
<img src="../../../assets/custom/icon/img-no-content.png" alt />
<span class="tips">没有找到相关结果,请重新查询</span>
<el-button v-show="kind == 1" type="primary" icon="el-icon-plus" @click="showOrgCourse">创建机构课程</el-button>
</div>
<el-button type="primary" icon="el-icon-plus" @click="showOrgCourse">创建机构课程</el-button>
<div class="page-wrapper">
<div class="page">
......@@ -109,6 +112,7 @@ export default {
},
methods: {
...mapActions(["setCartList", "setSearchParam", "setSearchParamOrg"]),
toggleOrder() {
this.isRise = !this.isRise;
let dir = this.isRise ? 1 : 2;
......@@ -150,7 +154,10 @@ export default {
}
this.setCartList(this.cartList);
this.$forceUpdate();
}
},
showOrgCourse() {
this.$emit('showOrgCourse', 'add');
},
}
};
</script>
......
......@@ -10,7 +10,7 @@
</el-tab-pane>
</el-tabs>
<div class="top-line" style="margin-top: 20px;"></div>
<CourseList></CourseList>
<CourseList @showOrgCourse="showOrgCourse"></CourseList>
</div>
</template>
<script>
......@@ -36,7 +36,10 @@ export default {
...mapActions(['setKind']),
handleClick() {
this.setKind(this.activeName);
}
},
showOrgCourse(type) {
this.$emit('showOrgCourse', type);
},
},
}
</script>
......
......@@ -54,21 +54,14 @@ service.interceptors.request.use(config => {
}
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
// console.log('环境变量>>>> ', process.env.BUILD_ENV);
config.headers['token'] = 'F37DD4A8C9094A89A0C7EF84E4303CC9';
config.headers['token'] = 'BCBEB604699441FE86DDB0C5C19A852B';
// config.headers['token'] = localStorage.getItem('storageToken')
}else{
config.headers['token'] = localStorage.getItem('storageToken')
}
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
}
// if (config.data && config.data.setEntry) {
// config.headers['sysCode'] = config.data.sysCode || 10
// if(config.data.token){
// config.headers['token'] = config.data.token || '63C3FA92AF8A45A48B31EB7FD97B95EB'
// }
// config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
// }
return config
}, error => {
// logger.debug('service.interceptors.request: ', error)
......
......@@ -34,7 +34,7 @@
<!-- 选择课程 -->
<div v-if="active == 0" class="tpl-main">
<SelectCourseComp></SelectCourseComp>
<SelectCourseComp @showOrgCourse="showOrgCourse"></SelectCourseComp>
</div>
<!-- 填写项目信息-->
......@@ -70,6 +70,17 @@
<dialog-componet :dialogObj="dialogObj" @hide="hide"></dialog-componet>
<dialog-componet :dialogObj="sendObj" @hide="hidefn" @confirm="confirmFn"></dialog-componet>
<PreviewEditCourse
:dialogVisible="isPreviewEditCourse"
:addOrUpdate="addOrUpdate"
@close="closeEditCourse"
/>
<PreviewProtocol
:dialogVisible="isPreviewProtocol"
:protocolId="protocolId"
:protocolContent="protocolContent"
@close="closeProtocol"
/>
</div>
</template>
......@@ -82,6 +93,8 @@ import selectRegion from "@/components/education/template/selectRegion";
import setOrganization from "@/components/education/template/setOrganization";
import SelectCourseComp from "@/components/education/custom/select-course-comp";
import dialog from "@/components/education/template/dialog";
import PreviewEditCourse from "@/components/education/custom-resource/edit-course-dialog";
import PreviewProtocol from "@/components/education/custom-resource/preview-protocol";
import { openLoading, closeLoading, resizeHeight } from "@/utils/utils";
import { mapGetters, mapActions } from "vuex";
......@@ -157,6 +170,13 @@ export default {
isPreview: 0, // 1表示是查看信息
maxLimitCreatedCustomProjectCountInYear: 20, // 同一个用户每年能够创建的项目数
allSubList: [],
isPreviewEditCourse: false,
addOrUpdate: 'add',
isPreviewProtocol: false,
protocolId: 5,
protocolContent: '',
};
},
computed: {
......@@ -190,7 +210,9 @@ export default {
selectRegion,
setOrganization,
dialogComponet: dialog,
SelectCourseComp
SelectCourseComp,
PreviewEditCourse,
PreviewProtocol
},
created() {
vm = this;
......@@ -399,6 +421,7 @@ export default {
hidefn() {
vm.regionComplete(vm.changeStatus);
},
// 选择学元范围暂存
regionComplete(fishFn) {
let req = {
......@@ -553,9 +576,110 @@ export default {
// 从子组件(项目信息)获取项目状态是否为上架
setStatus4Flag(s) {
vm.status4Flag = s;
}
},
/*
展示添加机构课程弹框
如果已经加入机构,1:没有同意过协议,则打开协议弹框;2:已经加入,时直接打开添加弹框
如果没有加入机构,则直接弹出提示(我知道了)
*/
showOrgCourse(addOrUpdate) {
// this.checkProtocol();
this.checkHospital();
this.addOrUpdate = addOrUpdate
},
// 创建机构课程前校验机构
// TODO 各个状态与数据结构
checkHospital() {
openLoading(vm);
let req = {
setEntry: true
}
vm.GET(`portal/portalCustom/checkHospital`, req)
.then(res => {
closeLoading(vm);
if (res.code == "000000") {
console.log(res);
if (res.data == 0) {
this.checkProtocol();
} else {
vm.dialogObj = Object.assign(
vm.dialogObj,
vm.statusObj[`status_${res.data}`]
);
vm.dialogObj.visible = true;
}
} else {
vm.$message.info(res.message);
}
})
.catch(err => {
closeLoading(vm);
vm.$message.warning("请稍后重试");
});
},
// 判断用户是否签署了最新版协议
// 如果没有签署,则打开协议签署弹框
checkProtocol() {
// openLoading(vm);
let req = {
setEntry: true,
type: this.protocolId
}
vm.GET(`smartcontract/protocol/sign/check`, req)
.then(res => {
// closeLoading(vm);
if (res.code == "000000") {
if(!res.data) { // 没有签署,打开协议签署弹框
this.getProtocolInfoById();
} else {
this.isPreviewEditCourse = true;
}
} else {
vm.$message.info(res.message);
}
})
.catch(err => {
closeLoading(vm);
vm.$message.warning("请稍后重试");
});
},
// 根据协议获取内容
getProtocolInfoById() {
let req = {
type: this.protocolId
};
// this.GET("smartcontract/protocolManage/protocol", req).then(res => {
this.GET("smartcontract/protocol/content", req).then(res => {
if (res.code == "000000") {
// this.protocolContent = res.data.contents;
this.protocolContent = res.data;
this.isPreviewProtocol = true;
} else {
vm.$message.info(res.message);
}
}).catch(err => {
vm.$message.warning("请稍后重试");
});
},
// 关闭编辑课程弹框
closeEditCourse() {
this.isPreviewEditCourse = false;
},
// 关闭预览协议弹框
closeProtocol(needShowAdd) {
if( needShowAdd ) {
this.isPreviewEditCourse = true;
}
this.isPreviewProtocol = false;
},
}
};
}
</script>
<style lang="scss">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册