提交 1ad9f891 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-saas-phrase2.1-0522' into 'release'

自定义项目 code reviewer:张平

自定义项目 code reviewer:张平

See merge request !156
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
"vue-infinite-scroll": "^2.0.2", "vue-infinite-scroll": "^2.0.2",
"vue-router": "^2.1.1", "vue-router": "^2.1.1",
"vue-ueditor-wrap": "^2.4.1", "vue-ueditor-wrap": "^2.4.1",
"vuedraggable": "^2.23.2",
"vuex": "^2.0.0" "vuex": "^2.0.0"
}, },
"devDependencies": { "devDependencies": {
......
<template>
<div class="course-list-wrapper">
<ul class="course-header">
<li class="title">
<span class="main">全部课程</span>
<span v-show="courseLimitCount != -1" class="sub">单个项目最多只能选择{{courseLimitCount}}个课程</span>
</li>
<li class="order">
<div class="num" @click="toggleOrder">
<span>学习人数</span>
<img v-show="!isRise" src="../../../assets/custom/icon/icon-rise.png" alt />
<img v-show="isRise" src="../../../assets/custom/icon/icon-drop.png" alt />
</div>
<div class="cart-wrapper">
<div class="cart" @click="toggleCart">
<span>已选课程</span>
<img src="../../../assets/custom/icon/icon-cart.png" alt />
<div class="count">
<span>{{cartList.length}}</span>
</div>
</div>
<div v-show="isShowCart" class="curt-position">
<ShoppingCart @close="toggleCart"></ShoppingCart>
</div>
</div>
</li>
</ul>
<div v-if="courseList && courseList.list && courseList.list.length" class="list-wrapper">
<ul class="list">
<li
class="course"
v-for="(item, index) in courseList.list"
:key="index"
@click="toggleChecked(item)"
>
<div class="img">
<img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<div class="chapter">
<span>{{item.docName | shortName(5)}}</span>
<span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span>
<span v-if="item.testCount" class="exam-num">{{item.testCount}}场考试</span>
</div>
<div class="cost">
<span class="no">免费</span>
<span class="num">{{item.joinNum}}人已学</span>
</div>
</div>
<img
v-show="item.checked"
class="course-selected"
src="../../../assets/custom/icon/icon-selected.png"
/>
</li>
</ul>
</div>
<div v-else class="no-list">
<img src="../../../assets/custom/icon/img-no-content.png" alt />
<span class="tips">没有找到相关结果,请重新查询</span>
</div>
<div class="page-wrapper">
<div class="page">
<el-pagination
background
:current-page="searchParam.pageNo"
:page-sizes="[10, 30, 50, 100]"
:page-size="searchParam.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="courseList.totalRows"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></el-pagination>
</div>
</div>
<!-- 弹框提示 -->
<dialog-componet :dialogObj="dialogObj"></dialog-componet>
</div>
</template>
<script>
import ShoppingCart from "@/components/education/custom/shopping-cart";
import dialog from "@/components/education/custom/dialog";
import { mapGetters, mapActions } from "vuex";
export default {
data() {
return {
isRise: true,
isShowCart: false,
dialogObj: {
title: "课程数量已达上限",
visible: false,
message: '单个项目最多只能选择3个课程',
tip: "",
hideMsg: "我知道了"
}
};
},
computed: {
...mapGetters(["cartList", "courseList", "searchParam", "courseLimitCount"])
},
components: {
ShoppingCart,
dialogComponet: dialog
},
methods: {
...mapActions(["setCartList", "setSearchParam"]),
toggleOrder() {
this.isRise = !this.isRise;
let dir = this.isRise ? 1 : 2;
this.searchParam.dir = dir;
this.setSearchParam(this.searchParam);
},
toggleCart() {
this.isShowCart = !this.isShowCart;
},
// 选择当前分页个数
handleSizeChange(val) {
this.searchParam.pageSize = val;
this.setSearchParam(this.searchParam);
},
// 选择当前分页
handleCurrentChange(val) {
this.searchParam.pageNo = val;
this.setSearchParam(this.searchParam);
},
// 选择课程(并要处理过滤,删除等)
toggleChecked(item) {
item.checked = !item.checked;
if (item.checked) {
if (this.courseLimitCount != -1 && this.cartList.length >= this.courseLimitCount) {
item.checked = !item.checked;
this.dialogObj.message = '单个项目最多只能选择' + this.courseLimitCount + '个课程';
this.dialogObj.visible = true;
return;
}
this.cartList.unshift(item); // 倒序
} else {
let delItemIndex = this.cartList.findIndex(course => {
return course.courseId == item.courseId;
});
this.cartList.splice(delItemIndex, 1);
}
this.setCartList(this.cartList);
this.$forceUpdate();
}
}
};
</script>
<style lang="less" scoped>
.course-list-wrapper {
padding: 0 30px;
min-width: 1180px;
// max-width: 1600px;
.course-header {
// position: relative;
// top: 0;
// left: 0;
display: flex;
flex-direction: row;
height: 78px;
// line-height: 78px;
align-items: center;
// margin-right: 100px;
justify-content: space-between;
.title {
.main {
margin-right: 6px;
font-size: 18px;
font-weight: 600;
color: #000;
}
.sub {
font-size: 14px;
font-weight: 400;
color: #676869;
}
}
.order {
margin-right: 40px;
display: flex;
flex-direction: row;
align-items: center;
font-size: 14px;
color: #333333;
img {
position: relative;
top: 2px;
width: 14px;
height: 14px;
}
.num {
margin-right: 30px;
}
.cart-wrapper {
position: relative;
.cart {
position: relative;
.count {
position: absolute;
height: 20px;
top: -8px;
right: -12px;
display: inline-block;
span {
display: inline-block;
min-width: 18px;
text-align: center;
font-size: 12px;
padding: 2px;
background: red;
border-radius: 10px;
color: #fff;
}
}
}
.curt-position {
background: #fff;
position: absolute;
top: 30px;
right: 0px;
z-index: 100;
}
}
}
}
.list-wrapper {
// height: 500px;
overflow: auto;
.list {
display: flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: wrap;
overflow-y: auto;
.course {
user-select: none;
cursor: pointer;
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: row;
height: 120px;
width: 527px;
padding: 15px;
margin-bottom: 10px;
margin-right: 10px;
border-radius: 4px;
border: 1px solid rgba(228, 231, 237, 1);
.img {
position: relative;
top: 0;
left: 0;
width: 160px;
height: 90px;
margin-right: 15px;
img {
width: 160px;
height: 90px;
border-radius: 4px;
}
.level {
position: absolute;
top: 0;
left: 0;
width: 44px;
height: 22px;
line-height: 22px;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px 0px 4px 0px;
}
}
.detail {
position: relative;
display: flex;
flex-direction: column;
flex: 1;
.title {
position: relative;
top: -3px;
left: 0;
font-size: 16px;
font-weight: 600;
color: #373839;
}
.chapter {
font-size: 14px;
font-weight: 400;
color: #999999;
.section-num::before,
.exam-num::before {
content: "";
position: relative;
top: 2.5px;
left: 0;
display: inline-block;
height: 14px;
line-height: 14px;
margin: 0 10px;
width: 1px;
background: #999999;
}
}
.cost {
position: absolute;
left: 0;
bottom: -5px;
.no {
font-size: 18px;
font-weight: 600;
margin-right: 4px;
color: #d82b2b;
}
.num {
font-size: 14px;
font-weight: 400;
color: #999999;
}
}
}
.course-selected {
position: absolute;
right: 0;
bottom: 0;
width: 44px;
height: 44px;
}
}
}
}
.page-wrapper {
width: 1074px;
.page {
float: right;
margin: 20px 0;
}
}
.no-list {
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
// padding: 30px 200px;
width: 1000px;
text-align: center;
margin-bottom: 100px;
align-items: center;
img {
width: 300px;
height: 300px;
}
.tips {
position: relative;
top: -30px;
left: 10px;
z-index: 2;
color: #999999;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="custom-over">
<!-- <div class="custom-select-wrapper" style="overflow:auto;">
<div class="department-label" style="width: 1200px;"> -->
<div class="custom-select-wrapper">
<div class="department-label" style="min-width:1420px;">
<span
v-for="(item, index) in allLabelList"
:key="index"
class="item"
:class="{checked: item.checked}"
@click="selectLabel(index)"
>
<span class="split" :class="{acitve: item.checked}"></span>
{{item.name}}
</span>
</div>
</div>
<div class="custom-select-wrapper">
<!-- 课程分类 -->
<div class="course-class">
<div class="title">课程分类</div>
<div v-if="subLabelList.length" class="item" @click="selectSubLabel(subLabelList[0], 1)">
<span class="name" :class="{'active': subLabelList[0].checked}">全部</span>
</div>
<ul class="check-list">
<li
class="sub-item"
:class="{'active': item.checked}"
v-for="(item, index) in subLabelList.slice(1)"
:key="index"
@click="selectSubLabel(item, 2)"
>
<img v-show="item.checked" src="../../../assets/custom/icon/label-sel.png" alt />
<img v-show="!item.checked" src="../../../assets/custom/icon/label-sel-no.png" alt />
{{item.name}}
</li>
</ul>
<div class="right"></div>
</div>
<!-- 课程等级 -->
<div class="course-level">
<span class="title">课程等级</span>
<span
class="item"
v-for="(item, index) in courseLevel"
:key="index"
@click="selectLevel(index)"
>
<span class="name" :class="{active: item.checked}">{{item.name}}</span>
</span>
</div>
<div class="button-wrapper">
<el-button class="add-button" plain size="small" @click="resetCond">重 置</el-button>
<el-button class="add-button" size="small" type="primary" @click="search">查 询</el-button>
</div>
</div>
</div>
</template>
<script>
import { mapGetters, mapActions } from 'vuex'
export default {
data() {
return {
courseLevel: [
{ name: "全部", value: 0, checked: true },
{ name: "初级", value: 1, checked: false },
{ name: "中级", value: 2, checked: false },
{ name: "高级", value: 3, checked: false }
],
checkList: [431, 441]
};
},
props: {
dataList: {
type: Array,
default: () => {
return [
{
name: "全部",
checked: true
},
{
name: "内科",
checked: false
},
{
name: "神经科",
checked: false
},
{
name: "肿瘤科",
checked: false
},
{
name: "妇产科",
checked: false
},
{
name: "内科",
checked: false
},
{
name: "神经科",
checked: false
},
{
name: "肿瘤科",
checked: false
},
{
name: "妇产科",
checked: false
},
{
name: "内科",
checked: false
},
{
name: "神经科",
checked: false
},
{
name: "肿瘤科",
checked: false
},
{
name: "妇产科",
checked: false
}
];
}
}
},
computed: {
...mapGetters(['searchParam', 'allLabelList', 'subLabelList'])
},
components: {},
methods: {
...mapActions(['setSubLabelList', 'setSearchParam']),
// 选择一级
selectLabel(index) {
this.allLabelList.forEach(element => {
element.checked = false;
});
this.allLabelList[index].checked = true;
let subLabelList = this.allLabelList[index].subList;
this.setSubLabelList(subLabelList);
},
// 选择二级
selectSubLabel(item, type) {
item.checked = !item.checked;
console.log('selectSubLabel', item);
// 如果被选中
if(item.checked) {
// 是全部按钮 第一个全部:parentid-0
if(type == 1) {
let labelArr = item.id.split('-'), labelType = labelArr[0], labelIndex = labelArr[1] - 0;
labelArr = item.id.split('-');
if(labelType == 'parentid') {
// 将所有子项目选中
this.allLabelList[0].subList.forEach( (item, index) => {
if(index != 0) { // 第一个不用
item.checked = true;
}
})
// 将其它所有全部置为选中
this.allLabelList.forEach( (item, index) => {
index != 0 && (item.subList[0].checked = true);
})
} else {
this.allLabelList[labelIndex + 1].subList.forEach( (item, index) => {
if(index != 0) { // 第一个不用
item.checked = true;
}
})
}
}
// 末被选中
} else {
// 是全部按钮 第一个全部:parentid-0
if(type == 1) {
let labelArr = item.id.split('-'), labelType = labelArr[0], labelIndex = labelArr[1] - 0;
labelArr = item.id.split('-');
if(labelType == 'parentid') {
// 将所有子项目选中
this.allLabelList[0].subList.forEach( (item, index) => {
if(index != 0) { // 第一个不用
item.checked = false;
}
})
// 将其它所有全部置为选中
this.allLabelList.forEach( (item, index) => {
index != 0 && (item.subList[0].checked = false);
})
} else {
this.allLabelList[labelIndex + 1].subList.forEach( (item, index) => {
if(index != 0) { // 第一个不用
item.checked = false;
}
})
}
}
}
// 无论哪种操作,都要重置各个“全部”按钮
this.allLabelList.forEach( (parent, index) => {
let needhecked = true, subList = parent.subList;
for(let i = 1; i < subList.length; i ++) {
if(!subList[i].checked) {
needhecked = false;
break;
}
}
this.allLabelList[index].subList[0].checked = needhecked;
})
this.$forceUpdate();
},
// 选中等级
selectLevel(index) {
this.courseLevel.forEach(element => {
element.checked = false;
});
this.courseLevel[index].checked = true;
},
// 重置按钮
resetCond() {
this.allLabelList.forEach((item, index) => {
item.checked = false;
item.subList.forEach((sub, subIndex) => {
sub.checked = true;
});
});
this.setSubLabelList(this.allLabelList[0].subList);
this.allLabelList[0].checked = true;
this.selectLevel(0);
},
search() {
let allSelectedLabel = [];
this.allLabelList[0].subList.forEach( (item, index) => {
index && item.checked && allSelectedLabel.push(item.id);
})
this.searchParam.labelIdList = allSelectedLabel;
this.courseLevel.forEach( item => {
if(item.checked) {
this.searchParam.grade = item.value;
}
})
this.searchParam.pageNo = 1;
this.setSearchParam(this.searchParam);
console.log(allSelectedLabel);
}
}
};
</script>
<style lang="less" scoped>
.custom-select-wrapper {
// width: 1090px;
user-select: none;
.department-label {
display: flex;
flex-direction: row;
height: 48px;
line-height: 48px;
border-bottom: 2px solid #449284;
border-radius: 6px 6px 0px 0px;
.item {
cursor: pointer;
position: relative;
z-index: 1;
display: inline-block;
padding: 0 22px;
font-size: 16px;
color: #666666;
&.checked {
color: #fff;
z-index: 3;
background: #449284;
}
&:first-child {
border-radius: 6px 0px 0px 0px;
}
}
.split {
position: absolute;
top: 14px;
left: 0px;
z-index: 2;
display: inline-block;
height: 20px;
width: 1px;
background: #c7c8c9;
}
.item:nth-child(1) > .split,
.item.checked + .item > .split,
.split.acitve {
display: none;
}
}
}
.course-level {
display: flex;
flex-direction: row;
box-sizing: content-box;
height: 56px;
line-height: 56px;
padding-left: 20px;
// margin: 16px 0 16px 20px;
border-bottom: 1px dotted #e4e7ed;
.title {
display: inline-block;
padding: 0 10px;
color: #999999;
}
.item {
cursor: pointer;
display: inline-block;
margin: 0 5px;
color: #333333;
.name {
height: 26px;
line-height: 26px;
display: inline-block;
padding: 0px 10px;
border-radius: 2px;
&.active {
color: #fff;
background: #449284;
}
}
}
}
.course-class {
display: flex;
flex-direction: row;
box-sizing: content-box;
padding: 10px 20px;
// padding-left: 20px;
// margin: 16px 0 16px 20px;
border-bottom: 1px dashed #e4e7ed;
.title {
height: 56px;
line-height: 56px;
display: inline-block;
padding: 0 10px;
color: #999999;
}
.item {
cursor: pointer;
height: 56px;
line-height: 56px;
display: inline-block;
margin: 0 5px;
color: #333333;
.name {
height: 26px;
line-height: 26px;
display: inline-block;
padding: 0px 10px;
border-radius: 2px;
margin-right: 16px;
&.active {
color: #fff;
background: #449284;
}
}
}
.check-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-top: 14px;
margin-right: 40px;
flex: 1;
.sub-item {
cursor: pointer;
display: flex;
flex-direction: row;
align-items: center;
height: 30px;
line-height: 30px;
font-size: 14px;
color: #333333;
margin-right: 30px;
img {
width: 16px;
height: 16px;
margin-right: 5px;
}
&.active {
color: #449284;
}
}
}
.el-checkbox {
height: 30px;
line-height: 30px;
}
}
.button-wrapper {
display: flex;
flex-direction: row;
justify-content: flex-end;
margin-top: 20px;
margin-right: 60px;
}
</style>
\ No newline at end of file
<!--基础信息-->
<template>
<div class="base-message-wrap">
<el-form ref="formData" :model="formData" :rules="rules" label-width="150px" class="basic-form">
<el-form-item label="项目名称:" prop="projectName">
<el-col :span="13">
<el-input
size="small"
v-model="formData.projectName"
placeholder="请输入项目名称"
style="width:70%;"
ref="projectName"
maxlength="24"
:disabled="isPreview==1"
></el-input>
<span class="word-num">{{(formData.projectName).replace(/\s+/g,"").length}}/24</span>
</el-col>
<el-col :span="10" class="curt-position-wrapper">
<div class="curt-position">
<SortedCart :isPreview="isPreview" :projectStatus="projectStatus" :projectId="projectId"></SortedCart>
</div>
</el-col>
</el-form-item>
<el-form-item label="发起机构名称:">
<el-col :span="13" v-for="(item, index) in formData.organizationNameList" :key="index">
<el-input
size="small"
v-model="formData.organizationNameList[index]"
placeholder="请输入发起机构名称"
style="width:70%;"
maxlength="16"
@input="changeOrganizationName"
@blur="blurName"
@focus="focusName(index)"
:disabled="isPreview==1"
></el-input>
<span
class="word-num"
>{{(formData.organizationNameList[index]).replace(/\s+/g,"").length}}/16</span>
<img
@click="plusOrg(index)"
class="edit-img"
src="../../../assets/image/plus.png"
v-if="isPreview!=1"
/>
<img
@click="deleteOrg(index)"
v-if="index >= 1 && isPreview!=1"
class="edit-img"
src="../../../assets/image/trash.png"
/>
</el-col>
<el-popover
v-if="formData.creatorOrganizationName"
class="popover-content"
:style="{'top': orgListIndex * 41 + 'px'}"
placement="bottom"
:content="organizationContent"
v-model="visibleName"
@click="checkDefault"
>
<p @click="checkDefault">我的机构: {{ formData.creatorOrganizationName }}</p>
</el-popover>
</el-form-item>
<div>
<el-form-item label="项目时间:" required>
<el-col :span="5">
<el-form-item prop="projectBegintime">
<el-date-picker
v-model="formData.projectBegintime"
size="small"
type="datetime"
placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0"
style="width: 100%;"
:disabled="formData.status4Flag == 1 || isPreview==1"
></el-date-picker>
</el-form-item>
</el-col>
<el-col class="line" :span="1">~</el-col>
<el-col :span="5">
<el-form-item label prop="projectEndtime">
<el-date-picker
v-model="formData.projectEndtime"
size="small"
type="datetime"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions1"
default-time="00:00:00"
style="width: 100%;"
:disabled="isPreview==1"
></el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
<p class="time-message">
<i class="el-icon-warning-outline"></i>
项目有效期为{{attachInfo.limitValue}}天,选择项目起止时间须在有效期内
</p>
</div>
<el-form-item label="列表图片:" style="margin-bottom: 10px">
<el-col :span="13" style="height:95px">
<div class="url1-selected">
<img :src="formData.attachmentUrl1" alt />
</div>
</el-col>
<el-col :span="13" style="height:95px">
<div style="color:#666666;font-size:14px;">从模版中选择其他列表图片</div>
<ul class="url1-list">
<li
class="img-wrapper"
v-for="(item, index) in attachInfo.attachMap[1]"
:key="index"
@click="selectedAttachUrl(item.attachmentUrl, 1)"
>
<img class="selected-icon" :src="item.attachmentUrl" alt />
<img
class="status-icon"
v-show="item.checked"
src="../../../assets/custom/icon/icon-select.png"
alt
/>
<img
class="status-icon"
v-show="!item.checked"
src="../../../assets/custom/icon/icon-select-no.png"
alt
/>
</li>
</ul>
</el-col>
</el-form-item>
<el-form-item label="封面类型:">
<el-radio-group size="small" v-model="formData.type" disabled>
<el-radio :label="1">图片</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="封面文件:" style="margin-bottom: 10px">
<el-col :span="13" style="height: 95px">
<div class="url2-selected">
<img :src="formData.attachmentUrl2" alt />
</div>
</el-col>
<el-col :span="13" style="height:95px">
<div style="color:#666666;font-size:14px;">从模版中选择其他封面图片</div>
<ul class="url2-list">
<li
class="img-wrapper"
v-for="(item, index) in attachInfo.attachMap[2]"
:key="index"
@click="selectedAttachUrl(item.attachmentUrl, 2)"
>
<img class="selected-icon" :src="item.attachmentUrl" alt />
<img
class="status-icon"
v-show="item.checked"
src="../../../assets/custom/icon/icon-select.png"
alt
/>
<img
class="status-icon"
v-show="!item.checked"
src="../../../assets/custom/icon/icon-select-no.png"
alt
/>
</li>
</ul>
</el-col>
</el-form-item>
<el-form-item label="项目简介:" prop="projectIntro">
<el-col :span="13">
<el-input
size="small"
type="textarea"
:autosize="{ minRows: 5}"
placeholder="请输入项目简介"
v-model="formData.projectIntro"
style="width:83%;"
:disabled="isPreview==1"
></el-input>
<span class="word-num">{{(formData.projectIntro).replace(/\s+/g,"").length}}/200</span>
</el-col>
</el-form-item>
</el-form>
<dialog-componet :dialogObj="dialogObj" @confirm="confirm" @hide="hide"></dialog-componet>
</div>
</template>
<script>
import { doUpload, getFilePath } from "../../../utils/qiniu-util";
import { openLoading, closeLoading } from "../../../utils/utils";
import SortedCart from "@/components/education/custom/sorted-cart";
import { convertTime } from "../../../utils";
import dialog from "./dialog";
import { mapGetters, mapActions } from "vuex";
let vm = null;
export default {
props: {
openTemplateId: {
type: String | Number,
default: ""
},
projectId: {
type: String | Number,
default: ""
},
editor: {
type: Boolean,
default: false
}
},
data() {
let checkProjectStr = (rule, value, callback) => {
if (value.indexOf("\\") != -1) {
//存在
callback(new Error("请勿输入字符“ \\ "));
} else if (value.indexOf(".") != -1) {
callback(new Error("请勿输入字符“ . "));
} else {
callback();
}
};
let checkUserTime = (rule, value, callback) => {
if (value > 1000 || value < 1) {
callback(new Error("输入长度为1-1000的有效期"));
} else {
callback();
}
};
return {
visibleName: false, //是否显示机构提示
orgListIndex: 1,
organizationContent: "", //机构名称
formData: {
id: "", //项目 id 26
projectName: "", //开放模板名称
projectBegintime: "", //模板开始时间
projectEndtime: "", //模板结束时间
projectIntro: "", //开放模板简介
projectType: 4, //类型
type: 1, //封面类型 1图片2视频
projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
expireDay: 90, //模板有效期(天)
status4Flag: 0, //0表示没有上过架,1表示上过架
attachmentUrl1: "",
attachmentUrl2: "",
attachmentMore1: {
attachmentExt: "",
attachmentName: "",
attachmentSize: 0
},
attachmentMore2: {
attachmentExt: "",
attachmentName: "",
attachmentSize: 0
},
organizationName: "", // 发起机构名称(多个机构拼接
organizationNameList: [""] //发起机构列表
},
attachmentModel: [
//基础信息的图片视频
{
attachmentExt: "", // 附件格式
attachmentName: "", //附件名称
attachmentSize: "", //附件大小,
attachmentType: 1, //1:图片 2:视频 3:pdf
attachmentUrl: "", //附件链接
id: "", //关联唯一ID
kind: 1, //1:列表图片 2:封面配置 3:附件配置
openTemplateId: "" //开放模板id
},
{
attachmentExt: "", // 附件格式
attachmentName: "", //附件名称
attachmentSize: "", //附件大小,
attachmentType: 1, //1:图片 2:视频 3:pdf
attachmentUrl: "", //附件链接
id: "", //关联唯一ID
kind: 1, //1:列表图片 2:封面配置 3:附件配置
openTemplateId: "" //开放模板id
}
],
pickerOptions0: {
disabledDate: time => {
if (
vm.formData.projectEndtime != "" &&
vm.formData.projectEndtime != null
) {
return (
time.getTime() > new Date(vm.formData.projectEndtime).getTime()
);
}
}
},
pickerOptions1: {
disabledDate: time => {
return (
// time.getTime() < new Date((vm.formData.projectBegintime).replace(/\-/g, '/')).getTime() || time.getTime() > new Date((vm.formData.projectBegintime).replace(/\-/g, '/')).getTime() + 1000 * 60 * 60 * 24 * vm.attachInfo.limitValue
time.getTime() < new Date(vm.formData.projectBegintime).getTime() ||
time.getTime() >
new Date(vm.formData.projectBegintime).getTime() +
1000 * 60 * 60 * 24 * vm.attachInfo.limitValue
); //减去一天的时间代表可以选择同一天;
}
},
imgMouseOver: false,
imgMouseOver2: false,
uploadImgMessage: false,
uploadImgMessage2: false,
rules: {
projectName: [
{ required: true, message: "请输入项目名称" },
{
min: 2,
max: 24,
message: "输入长度为2-24的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
{ validator: checkProjectStr, trigger: "blur" }
],
projectBegintime: [
{
required: true,
message: "请选择时间",
trigger: "change"
}
],
projectEndtime: [
{
required: true,
message: "请选择时间",
trigger: "change"
}
],
projectIntro: [
{ required: true, message: "请填写项目简介", trigger: "blur" },
{ min: 1, max: 200, message: "超出可输入的最大长度", trigger: "blur" }
]
},
disabled: true,
dialogObj: {
visible: false,
title: "该项目模版已下架",
tip: "",
message: "模版已下架,请重新选择其他项目模版",
confirmMsg: "取消",
hideMsg: "重新选择"
},
isPreview: 0,
projectStatus: 0,
attachInfo: {
attachMap: {
1: [],
2: []
},
creatorOrganizationName: "云鹊医",
limitKind: 1,
limitValue: 90
},
attachMap: {
1: [],
2: []
}
};
},
computed: {
...mapGetters(["cartList"])
},
components: {
dialogComponet: dialog,
SortedCart
},
created() {
vm = this;
vm.isPreview = vm.$route.query.isPreview ? vm.$route.query.isPreview : 0;
this.projectStatus = vm.$route.query.projectStatus;
// 编辑时
if (vm.editor) {
vm.disabled = false;
vm.getMessage(vm.editor);
// vm.getEditorMessage();
// 创建时
} else {
vm.disabled = true;
vm.getMessage(false);
}
},
methods: {
...mapActions(["setCartList"]),
// 选择列表或封面图片
selectedAttachUrl(attachmentUrl, index, isClick = true) {
// 查看状态,不可重新选择
if (isClick && vm.isPreview == 1) return;
this.attachInfo.attachMap[index].forEach(attach => {
if (attachmentUrl == attach.attachmentUrl) {
attach.checked = true;
} else {
attach.checked = false;
}
});
vm.formData["attachmentUrl" + index] = attachmentUrl;
vm.$forceUpdate();
},
// 设置已有的基本信息
setBaseMessage(data) {
// data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime);
// data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime);
vm.formData = Object.assign(vm.formData, data.projectData);
vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
vm.selectedAttachUrl(data.attachmentData[0].attachmentUrl, 1, false);
vm.formData.attachmentMore1 = Object.assign( vm.formData.attachmentMore1, data.attachmentData[0]);
// 暂存为1 下一步为3
vm.formData.projectType = vm.formData.projectType == 0 ? 4 : vm.formData.projectType;
// vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : "";
// vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : "";
if (data.attachmentData[1]) {
let attachmentUrl2 = data.attachmentData[1].attachmentUrl;
vm.selectedAttachUrl(attachmentUrl2, 2, false);
vm.formData.attachmentUrl2 = attachmentUrl2;
vm.formData.type = data.attachmentData[1].attachmentType;
vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]);
}
// 将所有课程设置到购物车中
vm.setCartList(data.hotCourseForPortalModelList.slice());
// 不知道是否要使用
// vm.$emit('setStatus4Flag',data.projectData.status4Flag)
},
// 创建时,获取机构信息、列表图片等
getMessage(isEdit = false) {
openLoading(vm);
vm.GET(`portal/portalInfo/sass/attach`, { typeList: [1, 2] })
.then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.attachInfo = res.data;
this.attachInfo.attachMap[1].forEach(item => {
item.checked = false;
});
this.attachInfo.attachMap[2].forEach(item => {
item.checked = false;
});
this.formData.attachmentUrl1 = this.attachInfo.attachMap[1][0].attachmentUrl;
this.formData.attachmentUrl2 = this.attachInfo.attachMap[2][0].attachmentUrl;
this.formData.creatorOrganizationName = this.attachInfo.creatorOrganizationName || "";
this.attachInfo.attachMap[1][0].checked = true;
this.attachInfo.attachMap[2][0].checked = true;
if(isEdit) {
vm.getEditorMessage();
}
} else {
vm.$message.info(res.message);
}
})
.catch(err => {
closeLoading(vm);
vm.$message.warning("请稍后重试");
});
},
// 获取选择模板后的基本信息
// getMessage() {
// openLoading(vm);
// vm.GET(`portal/openTemplateProject/getOpenTemplateInfoForCreate/${vm.openTemplateId}`)
// .then(res => {
// closeLoading(vm);
// if (res.code == "000000") {
// let data = res.data;
// data.projectData.organizationNameList = [data.projectData.creatorOrganizationName]
// this.$emit('hideSave',res.data.projectData.projectStatus)
// vm.setBaseMessage(res.data);
// } else {
// vm.$message.info(res.message);
// }
// })
// .catch((err) => {
// closeLoading(vm);
// vm.$message.warning('请稍后重试');
// });
// },
// 获取编辑时的信息
getEditorMessage() {
openLoading(vm);
vm.GET(`portal/portalCustom/getInfo/${vm.projectId}`)
.then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.$emit('hideSave',res.data.projectData.projectStatus)
vm.setBaseMessage(res.data);
} else {
vm.$message.info(res.message);
}
})
.catch(err => {
closeLoading(vm);
vm.$message.warning("请稍后重试");
});
},
// 增加发起机构
plusOrg(index) {
vm.formData.organizationNameList.splice(index + 1, 0, "");
},
// 删除发起机构
deleteOrg(index) {
vm.formData.organizationNameList.splice(index, 1);
},
// 机构名称输入
changeOrganizationName() {
let textLength = vm.formData.organizationName.length;
// 机构输入提示显示与否
vm.visibleName = textLength == 0;
},
// 离开机构名称焦点
blurName() {
vm.visibleName = false;
setTimeout(() => {
vm.submitForm("formData");
}, 200);
},
// 机构名称聚焦
focusName(index) {
let textLength = vm.formData.organizationNameList[index].length;
if (textLength == 0) {
vm.orgListIndex = index + 1;
vm.visibleName = true;
} else {
vm.visibleName = false;
}
},
// 机构选择默认值
checkDefault() {
vm.organizationContent = vm.formData.creatorOrganizationName;
vm.formData.organizationNameList.splice(
vm.orgListIndex - 1,
1,
vm.organizationContent
);
vm.visibleName = false;
},
// 点击下一步
nextStep() {
let flag = true;
if (!vm.formData.attachmentUrl1) {
vm.uploadImgMessage = true;
flag = false;
} else {
vm.uploadImgMessage = false;
}
if (!vm.formData.attachmentUrl2) {
vm.uploadImgMessage2 = true;
flag = false;
} else {
vm.uploadImgMessage2 = false;
}
if (vm.submitForm("formData") && flag) {
vm.insertOrupdate();
}
},
// 暂存
save(needCheckTime = true) {
if (!vm.formData.projectName) {
vm.$refs["formData"].validateField("projectName");
} else {
vm.insertOrupdate(1, needCheckTime);
}
},
// 新增或者更新基本信息
insertOrupdate(status, needCheckTime) {
console.log('insertOrupdate', vm.formData.projectEndtime);
if(needCheckTime) {
if (
new Date(vm.formData.projectEndtime).getTime() >
new Date(vm.formData.projectBegintime).getTime() +
1000 * 60 * 60 * 24 * vm.attachInfo.limitValue
) {
vm.$message.warning("项目结束时间应在有效期内");
return;
}
if (
new Date(vm.formData.projectEndtime).getTime() <=
new Date(vm.formData.projectBegintime).getTime()
) {
vm.$message.warning("项目结束时间应大于开始时间");
return;
}
}
// vm.formData.projectBegintime = convertTime(
// vm.formData.projectBegintime,
// false
// );
// vm.formData.projectEndtime = convertTime(
// vm.formData.projectEndtime,
// false
// );
if (status) {
vm.formData.projectStatus = status;
}
// 图片或者视频地址
vm.formData.attachmentMore1.attachmentUrl = vm.formData.attachmentUrl1;
vm.formData.attachmentMore2.attachmentUrl = vm.formData.attachmentUrl2;
// 封面类型
vm.formData.attachmentMore2.attachmentType = vm.formData.type;
vm.formData.attachmentMore2.kind = 2;
//整合图片视频
vm.attachmentModel[0] = Object.assign(
vm.attachmentModel[0],
vm.formData.attachmentMore1
);
vm.attachmentModel[1] = Object.assign(
vm.attachmentModel[1],
vm.formData.attachmentMore2
);
let baseobj = {};
baseobj.projectModel = JSON.stringify(vm.formData);
baseobj.attachmentModel = JSON.stringify(vm.attachmentModel);
baseobj.attachmentPDFModel = null;
baseobj.notifyData = null;
baseobj.hotCourseForPortalModelList = vm.cartList;
console.log(baseobj);
openLoading(vm);
vm.POST("portal/portalCustom/insertOrUpdate", baseobj)
.then(res => {
closeLoading(vm);
if (res.code == "000000") {
// 暂存不会跳到下一页
vm.formData.id = res.data.id;
if (status == 1) {
vm.$message.info("成功");
return;
}
// 下一步,并将项目id传递给父组件
vm.$emit("next", res.data.id);
} else if (res.code == "213061") {
vm.dialogObj.visible = true;
} else {
vm.$message.warning(res.message);
}
})
.catch(err => {
vm.$message({
type: "warning",
message: res.message
});
});
},
//表单校验
submitForm(formName) {
let flag = null;
vm.$refs[formName].validate(valid => {
if (valid) {
flag = true;
} else {
flag = false;
}
});
return flag;
},
// 取消
confirm() {
vm.dialogObj.visible = false;
},
// 确定
hide() {
vm.dialogObj.visible = false;
vm.$emit("backSelectVue");
}
}
};
</script>
<style scoped>
.subject-slelct .el-input__inner {
height: 32px;
line-height: 32px;
}
</style>
<style lang="scss">
.base-message-wrap {
width: 1200px;
padding-top: 40px;
.p_label {
margin-left: 56px;
font-size: 12px;
color: #606266;
}
.edit-img {
width: 20px;
height: 20px;
vertical-align: middle;
margin-left: 10px;
}
.day-btn {
display: inline-block;
width: 50px;
height: 32px;
line-height: 32px;
background: #838683;
text-align: center;
margin-left: -3px;
border-radius: 0 4px 4px 0;
z-index: 100;
}
.basic-item-icon {
position: relative;
.require {
position: absolute;
left: 67px;
top: 11px;
color: #f56c6c;
}
.upload-message {
position: absolute;
left: 160px;
top: 105px;
font-size: 12px;
color: #f56c6c;
}
.img-delete {
position: absolute;
left: 0px;
top: 0px;
width: 84px;
height: 100px;
background: #000;
opacity: 0.7;
z-index: 999;
i {
color: #fff;
margin-top: 39px;
margin-left: 0px;
}
}
}
.word-num {
font-size: 12px;
color: #999;
padding-top: 5px;
}
.line {
margin-left: 10px;
width: 20px;
}
.bg-uploader {
img {
float: left;
}
.bg-img {
width: 84px;
height: 100px;
}
.bg-video {
float: left;
width: 84px;
height: 100px;
}
.limit-text {
float: left;
margin-left: 10px;
margin-top: -10px;
p {
font-size: 12px;
color: #999;
}
}
}
.el-upload__tip {
position: absolute;
top: -6px;
left: 130px;
}
.choose-button {
background: #fff;
color: #409eff;
border: 1px solid #409eff;
}
.el-popover--plain {
padding: 18px 20px;
top: 40px;
}
.ueitem {
position: relative;
}
.ue-warp {
position: absolute;
width: 80%;
height: 100%;
background: #f5f7fa;
opacity: 0.5;
top: 0;
z-index: 1000;
}
}
.el-form-item__content {
width: 100%;
height: 100%;
// background: red;
}
.popover-content {
position: relative;
top: 0;
left: 0;
}
.time-message {
margin: -6px 0 20px 150px;
font-size: 14px;
}
.url1-selected {
img {
widows: 120px;
height: 90px;
}
}
.url1-list {
display: flex;
flex-direction: row;
.img-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 1;
.selected-icon {
width: 60px;
height: 45px;
margin-right: 10px;
}
.status-icon {
position: absolute;
top: 5px;
right: 15px;
z-index: 2;
widows: 14px;
height: 14px;
}
}
}
.url2-selected {
img {
width: 160px;
height: 90px;
}
}
.url2-list {
display: flex;
flex-direction: row;
.img-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 1;
.selected-icon {
width: 80px;
height: 45px;
margin-right: 10px;
}
.status-icon {
position: absolute;
top: 5px;
right: 15px;
z-index: 2;
widows: 14px;
height: 14px;
}
}
}
.curt-position-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 100;
.curt-position {
position: absolute;
top: 0;
left: 0;
z-index: 101;
}
}
</style>
\ No newline at end of file
<template>
<div class="dialog">
<el-dialog
:title="dialogObj.title"
:show-close=false
:visible.sync="dialogObj.visible"
:close-on-click-modal="false"
width="600px"
center>
<p style="text-align: center;">{{dialogObj.message}}</p>
<p class="tip" v-if="dialogObj.tip">{{dialogObj.tip}}</p>
<span slot="footer" class="dialog-footer">
<el-button @click="confirm" v-if="dialogObj.confirmMsg">{{dialogObj.confirmMsg}}</el-button>
<el-button type="primary" @click="hide" v-if="dialogObj.hideMsg">{{dialogObj.hideMsg}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
dialogObj: {
type: Object,
default: () => {
return null;
}
}
},
data() {
return {
}
},
created() {},
methods: {
confirm() {
this.$emit('confirm');
},
hide() {
// this.$emit('hide');
this.dialogObj.visible = false;
}
}
}
</script>
<style lang="scss" scoped>
.tip {
margin-top: 20px;
text-align: center;
color: #C0C0C0;
}
</style>
<template>
<div class="select-course-wrapper">
<div class="top-line"></div>
<CourseSelect></CourseSelect>
<div class="top-line" style="margin-top: 20px;"></div>
<CourseList></CourseList>
</div>
</template>
<script>
import CourseSelect from '@/components/education/custom/course-select'
import CourseList from '@/components/education/custom/course-list'
export default {
data() {
return {
}
},
components: {
CourseSelect,
CourseList,
}
}
</script>
<style lang="less" scoped>
.select-course-wrapper {
min-width: 1200px;
.top-line {
// width: 120%;
height: 10px;
background: rgb(240, 242, 245);
}
}
</style>
\ No newline at end of file
<template>
<div class="cart-list-wrapper">
<div class="cart-header">
<span class="title">已选项目课程(共{{this.cartList.length}}节)</span>
<img @click="close" src="../../../assets/custom/icon/close.png" alt />
</div>
<ul v-if="cartList.length" class="cart-list">
<li class="cart-course" v-for="item in cartList" :key="item.courseId">
<div class="img">
<img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<span class="cost">免费</span>
</div>
<div class="delete" @click="deleteCart(item)">
<img src="../../../assets/custom/icon/icon-delete.png" alt />
</div>
</li>
</ul>
<div v-else class="no-list">
<img src="../../../assets/custom/icon/img-no-content.png" alt />
<span class="tips">您还未选择课程,快去选择课程组建项目吧!</span>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
data() {
return {};
},
computed: {
...mapGetters(["cartList", "courseList"])
},
methods: {
close() {
this.$emit("close");
},
deleteCart(item) {
// 先删除够物车中的课程
let delItemIndex = this.cartList.findIndex(course => {
return course.courseId == item.courseId;
});
this.cartList.splice(delItemIndex, 1);
// 再查找当前课程列表中是否有,如果有,则将其置为不选中状态
let courseIndex = this.courseList.list.findIndex(course => {
return course.courseId == item.courseId;
});
if (courseIndex >= 0) {
this.courseList.list[courseIndex].checked = false;
}
}
}
};
</script>
<style lang="less" scoped>
.cart-list-wrapper {
font-family: PingFang SC !important;
width: 440px;
height: 550px;
background: #fff;
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15);
border-radius: 4px;
.cart-header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 50px;
line-height: 50px;
padding: 0 15px;
font-size: 18px;
font-weight: 700;
color: #000000;
background: #f9f9f9;
img {
width: 15px;
height: 15px;
}
}
.cart-list {
display: flex;
flex-direction: column;
justify-content: flex-start;
height: 490px;
overflow: auto;
.cart-course {
user-select: none;
position: relative;
display: flex;
flex-direction: row;
width: 410px;
margin: 15px;
align-items: center;
border-radius: 4px;
&::after {
position: absolute;
left: 0;
bottom: -15px;
z-index: 1;
content: "";
width: 410px;
height: 1px;
background: #e4e7ed;
}
.img {
position: relative;
top: 0;
left: 0;
width: 120px;
height: 68px;
margin-right: 15px;
img {
width: 120px;
height: 68px;
border-radius: 4px;
}
.level {
position: absolute;
top: 0;
left: 0;
width: 44px;
height: 22px;
line-height: 22px;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px 0px 4px 0px;
}
}
.detail {
position: relative;
display: flex;
flex-direction: column;
flex: 1;
height: 60px;
.title {
position: relative;
top: -7px;
left: 0;
font-size: 16px;
font-weight: 600;
color: #373839;
}
.cost {
position: absolute;
bottom: -7px;
left: 0;
font-size: 18px;
font-weight: 600;
margin-right: 4px;
color: #d82b2b;
}
}
.delete {
width: 35px;
img {
cursor: pointer;
width: 20px;
height: 20px;
float: right;
}
}
}
}
.no-list {
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
margin-top: 30px;
text-align: center;
margin-bottom: 100px;
align-items: center;
img {
width: 200px;
height: 200px;
}
.tips {
position: relative;
top: -10px;
left: 10px;
z-index: 2;
color: #999999;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="sorted-cart-wrapper">
<div class="cart-header">
<span class="title">已选项目课程(共{{this.cartList.length}}节)</span>
<span class="sub">可上下拖拽课程行,调整课程在列表页的展示顺序</span>
</div>
<div v-if="projectId && (isPreview == 1 || projectStatus != 1)" class="cart-list">
<div class="cart-course is-preview" v-for="(item, index) in cartList" :key="index">
<div class="img">
<img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<div class="chapter">
<span>{{item.docName | shortName(5)}}</span>
<span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span><span v-if="true" class="exam-num">{{item.testCount}}场考试</span>
</div>
</div>
<div class="handler">
<img src="../../../assets/custom/icon/icon-handle.png" alt />
</div>
</div>
</div>
<draggable v-else class="cart-list" v-model="cartList">
<div class="cart-course" v-for="(item, index) in cartList" :key="index">
<div class="img">
<img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<div class="chapter">
<span>{{item.docName}}</span>
<span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span><span v-if="item.testCount" class="exam-num">{{item.testCount}}场考试</span>
</div>
</div>
<div class="handler">
<img src="../../../assets/custom/icon/icon-handle.png" alt />
</div>
</div>
</draggable>
</div>
</template>
<script>
import draggable from "vuedraggable";
export default {
data() {
return {};
},
props: {
isPreview: String | Number,
projectStatus: String | Number,
projectId: String | Number,
},
computed: {
cartList: {
get() {
return this.$store.state.customStore.cartList;
},
set(value) {
this.$store.dispatch("setCartList", value);
}
}
},
components: {
draggable
},
methods: {}
};
</script>
<style lang="less" scoped>
.sorted-cart-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 1;
font-family: PingFang SC !important;
width: 480px;
height: 790px;
background: #fff;
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15);
border-radius: 4px;
.mask {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 440px;
height: 790px;
// background: ;
}
.cart-header {
display: flex;
flex-direction: column;
height: 70px;
padding: 0 15px;
background: #f9f9f9;
.title {
padding: 15px 0 28px 0;
height: 18px;
line-height: 18px;
font-size: 18px;
font-weight: 700;
color: #000000;
}
.sub {
height: 14px;
line-height: 14px;
font-size: 14px;
font-weight: 400;
color: #999999;
}
}
.cart-list {
display: flex;
flex-direction: column;
justify-content: flex-start;
height: 710px;
overflow: auto;
.cart-course {
cursor: pointer;
user-select: none;
position: relative;
display: flex;
flex-direction: row;
// width: 410px;
margin: 15px;
align-items: center;
border-radius: 4px;
&.is-preview {
cursor: default;
}
&::after {
position: absolute;
left: 0;
bottom: -15px;
z-index: 1;
content: "";
width: 100%;
height: 1px;
background: #e4e7ed;
}
.img {
position: relative;
top: 0;
left: 0;
width: 120px;
height: 68px;
margin-right: 15px;
img {
width: 120px;
height: 68px;
border-radius: 4px;
}
.level {
position: absolute;
top: 0;
left: 0;
width: 44px;
height: 22px;
line-height: 22px;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px 0px 4px 0px;
}
}
.detail {
position: relative;
display: flex;
flex-direction: column;
flex: 1;
height: 60px;
.title {
position: relative;
top: -5px;
left: 0;
font-size: 16px;
line-height: 20px;
font-weight: 600;
color: #373839;
}
.chapter {
position: absolute;
bottom: -15px;
left: 0;
font-size: 14px;
font-weight: 400;
color: #999999;
.section-num::before,
.exam-num::before {
content: "";
position: relative;
top: 2.5px;
left: 0;
display: inline-block;
height: 14px;
line-height: 14px;
margin: 0 10px;
width: 1px;
background: #999999;
}
}
}
.handler {
width: 35px;
img {
// cursor: pointer;
width: 20px;
height: 20px;
float: right;
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -44,6 +44,7 @@ const templateManager = r => require.ensure([], () => r(require('../views/educat ...@@ -44,6 +44,7 @@ const templateManager = r => require.ensure([], () => r(require('../views/educat
const templateEditor = r => require.ensure([], () => r(require('../views/education/template-editor.vue')), 'template-editor') const templateEditor = r => require.ensure([], () => r(require('../views/education/template-editor.vue')), 'template-editor')
const templateOpen = r => require.ensure([], () => r(require('../views/education/template-open.vue')), 'templateOpen') const templateOpen = r => require.ensure([], () => r(require('../views/education/template-open.vue')), 'templateOpen')
const eduRole = r => require.ensure([], () => r(require('../views/education/edu-role.vue')), 'edu-role') const eduRole = r => require.ensure([], () => r(require('../views/education/edu-role.vue')), 'edu-role')
const editCustom = r => require.ensure([], () => r(require('../views/education/edit-custom.vue')), 'templateOpen')
const noticeEditor = r => require.ensure([], () => r(require('../views/education/notice-editor.vue')), 'notice-editor') const noticeEditor = r => require.ensure([], () => r(require('../views/education/notice-editor.vue')), 'notice-editor')
...@@ -179,6 +180,10 @@ export default [{ ...@@ -179,6 +180,10 @@ export default [{
path: '/template-open', path: '/template-open',
component: templateOpen component: templateOpen
}, },
{
path: '/edit-custom',
component: editCustom
},
{ {
path: '/edu-role', path: '/edu-role',
component: eduRole component: eduRole
......
const customStore = {
// namespaced: true,
state: {
searchParam: {
orderBy: 2,
dir: 1,
grade: 0,
pageNo: 1,
pageSize: 10,
labelIdList: []
},
cartList: [],
courseList: [],
allLabelList: [],
subLabelList: [],
courseLimitCount: -1 // -1: 不限制; 其它值: 限制的个数
},
mutations: {
SET_SEARCH_PARAM: (state, searchParam) => {
state.searchParam = searchParam;
},
SET_CART_LIST: (state, cartList) => {
state.cartList = cartList;
},
SET_COURSE_LIST: (state, courseList) => {
state.courseList = courseList;
},
SET_ALL_LABEL_LIST: (state, allLabelList) => {
state.allLabelList = allLabelList;
},
SET_SUB_LABEL_LIST: (state, subLabelList) => {
state.subLabelList = subLabelList;
},
SET_COURSE_LIMIT_COUNT: (state, courseLimitCount) => {
state.courseLimitCount = courseLimitCount;
},
},
actions: {
setSearchParam({ commit }, searchParam) {
commit('SET_SEARCH_PARAM', searchParam);
},
setCartList({ commit }, cartList) {
commit('SET_CART_LIST', cartList);
},
setCourseList({ commit }, courseList) {
commit('SET_COURSE_LIST', courseList);
},
setAllLabelList({ commit }, allLabelList) {
commit('SET_ALL_LABEL_LIST', allLabelList);
},
setSubLabelList({ commit }, subLabelList) {
commit('SET_SUB_LABEL_LIST', subLabelList);
},
setCourseLimitCount({ commit }, courseLimitCount) {
commit('SET_COURSE_LIMIT_COUNT', courseLimitCount);
},
}
}
export default customStore;
\ No newline at end of file
const getters = {
searchParam: state => state.customStore.searchParam,
cartList: state => state.customStore.cartList,
courseList: state => state.customStore.courseList,
allLabelList: state => state.customStore.allLabelList,
subLabelList: state => state.customStore.subLabelList,
courseLimitCount: state => state.customStore.courseLimitCount,
}
export default getters
import education from './education/getters' import education from './education/getters'
import custom from './custom/getters'
import { containObject } from '../utils/utils' // import { containObject } from '../utils/utils'
// let getters = containObject(education)
const getters = containObject(education)
const getters = Object.assign(education, custom)
export default getters export default getters
\ No newline at end of file
...@@ -9,7 +9,8 @@ import patientsDiagnose from './patientsManage/patientsDiagnose'; ...@@ -9,7 +9,8 @@ import patientsDiagnose from './patientsManage/patientsDiagnose';
// cme // cme
import cmeStore from './cme/cmeStore'; import cmeStore from './cme/cmeStore';
// custom
import customStore from './custom/customStore';
Vue.use(Vuex) Vue.use(Vuex)
...@@ -19,6 +20,7 @@ export default new Vuex.Store({ ...@@ -19,6 +20,7 @@ export default new Vuex.Store({
...followModules, ...followModules,
patientsDiagnose, patientsDiagnose,
cmeStore, cmeStore,
customStore
}, },
getters getters
}) })
......
...@@ -120,3 +120,45 @@ ...@@ -120,3 +120,45 @@
border-color: #ecedf1; border-color: #ecedf1;
border-radius: 2px; border-radius: 2px;
} }
.custom-select-wrapper {
.el-checkbox__label {
padding-left: 5px !important;
font-size: 14px !important;
color: #333;
}
.el-checkbox__input.is-checked+.el-checkbox__label {
color: #449284;
}
.el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
color: #449284;
}
.el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner {
background-color: #449284;
border-color: #449284;
}
}
.custom-select-wrapper {
// .el-button:focus, .el-button:hover {
// color: #449284;
// border-color: #449284;
// // background-color: #449284;
// }
.el-button.is-plain, .el-button.is-plain {
background: #fff !important;
border-color: #449284 !important;
color: #449284 !important;
}
.el-button.is-plain:focus, .el-button.is-plain:hover {
background: #fff !important;
border-color: #449284 !important;
color: #449284 !important;
}
.el-button--mini, .el-button--small {
font-size: 14px;
border-radius: 3px;
}
}
...@@ -54,8 +54,7 @@ service.interceptors.request.use(config => { ...@@ -54,8 +54,7 @@ service.interceptors.request.use(config => {
} }
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境 if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
// console.log('环境变量>>>> ', process.env.BUILD_ENV); // console.log('环境变量>>>> ', process.env.BUILD_ENV);
// config.headers['token'] = '29D71EAAB92E4580AFB16A8011BE7206'; config.headers['token'] = '69A24843079C458DBAC7E7C954923718';
config.headers['token'] = '4606AE29F7E547388A9339ACC2EC2B0D';
// config.headers['token'] = localStorage.getItem('storageToken') // config.headers['token'] = localStorage.getItem('storageToken')
}else{ }else{
config.headers['token'] = localStorage.getItem('storageToken') config.headers['token'] = localStorage.getItem('storageToken')
......
...@@ -413,9 +413,9 @@ const vueFilter = { ...@@ -413,9 +413,9 @@ const vueFilter = {
} else if (value == 2) { } else if (value == 2) {
return '未上架'; return '未上架';
} else if (value == 300) { } else if (value == 300) {
return '审核中'; return '审核中';
} else if (value == 3) { } else if (value == 3) {
return '待审核'; return '待审核';
} else if (value == 4) { } else if (value == 4) {
return '已上架'; return '已上架';
} else if (value == 5) { } else if (value == 5) {
...@@ -437,6 +437,14 @@ const vueFilter = { ...@@ -437,6 +437,14 @@ const vueFilter = {
} else { } else {
return value return value
} }
} },
// 将字符串截短至指定长度,并用在最后追加特定字符串(例如:...)
shortName: (value, length = 24, append = '...') => {
if (value && value.length > length) {
return value.substring(0, length) + append
} else {
return value
}
},
} }
export default vueFilter export default vueFilter
\ No newline at end of file
...@@ -236,13 +236,15 @@ export function convertTime(time, isToSlash = true) { ...@@ -236,13 +236,15 @@ export function convertTime(time, isToSlash = true) {
} else { } else {
if(isToSlash) { if(isToSlash) {
if(typeof(time) == 'object') { if(typeof(time) == 'object') {
return time.format("yyyy/MM/dd hh:mm:ss"); // return time.format("yyyy/MM/dd hh:mm:ss");
return new Date(time.getTime()).format("yyyy/MM/dd hh:mm:ss");
} else { } else {
return time.replace(/-/g, '/') return time.replace(/-/g, '/')
} }
} else { } else {
if(typeof(time) == 'object') { if(typeof(time) == 'object') {
return time.format("yyyy-MM-dd hh:mm:ss"); // return time.format("yyyy-MM-dd hh:mm:ss");
return new Date(time.getTime()).format("yyyy-MM-dd hh:mm:ss");
} else { } else {
return time.replace(/\//g, '-') return time.replace(/\//g, '-')
} }
......
import axios from 'axios'; import axios from 'axios';
// 对象的合并 // 对象的合并
export const containObject = function(...obj1) { // export const containObject = function(...obj1) {
let obj = Object.assign(...obj1) // let obj = Object.assign(...obj1)
return obj // return obj
} // }
// 获取页面自适应高度 // 获取页面自适应高度
export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'slidebar-container', export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'slidebar-container',
containerHeightId = 'screenSet'){ containerHeightId = 'screenSet'){
......
因为 它太大了无法显示 源差异 。您可以改为 查看blob
<template>
<div class="edit-custom-wrap">
<bread-crumb
:curmbFirst="curmbFirst"
:curmbSecond="curmbSecond"
:curmbThird="curmbThird"
:jumPathThird="jumPathThird"
></bread-crumb>
<div class="add-content-new screenSet" id="screenSet">
<el-row class="step-content-new">
<el-col style="width: 700px;">
<el-steps :active="active" simple class>
<span class="step-num" v-bind:class="{ 'on-step': active==0 }">1</span>
<el-step title="选择项目课程">1</el-step>
<span class="step-num" v-bind:class="{ 'on-step': active==1 }">2</span>
<el-step title="填写项目信息">2</el-step>
<span class="step-num" v-bind:class="{ 'on-step': active==2 }">3</span>
<el-step title="选择学员范围">3</el-step>
</el-steps>
</el-col>
<div style="flex: 1;"></div>
<el-col style="margin-left: 236px; width: 160px;margin-top: 2px;">
<!-- <el-col :span="5" :offset="5"> -->
<div v-if="!canNext" class="dis-btn">下一步</div>
<el-button class="dis-btn-b" v-if="active != 0 && projectStatus == 1 && isPreview != 1" size="small" @click="save">暂存</el-button>
<el-button class="dis-btn-b" v-if="active !== 2 && canNext" size="small" type="primary" @click="nextStep">下一步</el-button>
<el-button class="dis-btn-b" v-if="active == 2" size="small" type="primary" @click="complete">完成</el-button>
</el-col>
</el-row>
<!-- 模板列表
<div v-if="active == 0" class="tpl-main">
<template-list @checkFn="checkFn"></template-list>
</div>-->
<!-- 选择课程 -->
<div v-if="active == 0" class="tpl-main">
<SelectCourseComp></SelectCourseComp>
</div>
<!-- 填写项目信息-->
<!-- <template-message -->
<custom-baseinfo
ref="CustomBaseinfo"
v-if="active == 1"
:openTemplateId="openTemplateId"
:projectId="projectId"
:editor="editor"
@next="next"
@backSelectVue="backSelectVue"
@hideSave="hideSave"
@setStatus4Flag="setStatus4Flag"
/>
<!-- 设定行政范围与设定机构 -->
<div class="three-step" v-if="active === 2">
<el-tabs v-model="activeName" @tab-click="handleClickTabs">
<el-tab-pane label="设定行政范围" name="first">
<select-region ref="selectRegion" :projectId="projectId" :status4Flag="status4Flag"></select-region>
</el-tab-pane>
<el-tab-pane label="设定机构" name="second">
<set-organization
ref="setOrganization"
:projectId="projectId"
:status4Flag="status4Flag"
></set-organization>
</el-tab-pane>
</el-tabs>
</div>
</div>
<dialog-componet :dialogObj="dialogObj" @hide="hide"></dialog-componet>
<dialog-componet :dialogObj="sendObj" @hide="hidefn" @confirm="confirmFn"></dialog-componet>
</div>
</template>
<script>
import BreadCrumb from "@/components/breadcrumb.vue";
// import CustomBaseinfo from "@/components/education/template/CustomBaseinfo";
import CustomBaseinfo from "@/components/education/custom/custom-baseinfo";
import selectTemplate from "@/components/education/template/selectTemplate";
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 { openLoading, closeLoading, resizeHeight } from "@/utils/utils";
import { mapGetters, mapActions } from "vuex";
let vm = null;
export default {
data() {
return {
curmbFirst: "教培项目",
curmbSecond: "项目管理",
jumPathThird: "item-manager",
curmbThird: "发起项目",
active: 0,
formTemplate: {
component: [],
configure: 2,
certificate: ""
},
activeName: "first",
canNext: false,
openTemplateId: 0, // 开放模板ID
projectId: "", // 项目id
status: 10, // 0正常10没有加入机构11审核中12审核失败20存在进行中项目21数量已达上限
editor: false, // 是否为编辑状态
dialogObj: {
visible: false,
title: "",
message: "",
tip: "",
hideMsg: ""
},
statusObj: {
status_10: {
title: "您暂未加入机构",
message: "请前往云鹊医APP-个人中心-我的资料-填写工作所属机构。加入机构后,可创建项目",
tip: "",
hideMsg: "我知道了"
},
status_11: {
title: "您创建的机构正在审核中",
message: "请前往云鹊医APP-个人中心-我的资料-填写工作所属机构。加入机构后,可创建项目",
tip: "",
hideMsg: "我知道了"
},
status_12: {
title: "您创建的机构审核不通过",
message: "请前往云鹊医APP-个人中心-我的资料-填写工作所属机构。加入机构后,可创建项目",
tip: "",
hideMsg: "我知道了"
},
status_20: {
title: "该项目正在进行中",
message: "不能重复创建,请选择其他模版或者下架正在进行中的项目",
hideMsg: "确定"
},
status_21: {
title: "自定义项目创建数量已达上限",
message: "本年度免费创建自定义项目数已达20次,不能继续创建",
hideMsg: "确定"
}
},
sendObj: {
// 发布
visible: false,
title: "确定发布吗?",
message:
"发布后,项目将进入审核中,待审核完成后学员可在云鹊医App上参加培训学习",
tip: "",
confirmMsg: "取消",
hideMsg: "确定发布"
},
projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
status4Flag: 0, //0表示没有上过架,1表示上过架
isPreview: 0, // 1表示是查看信息
maxLimitCreatedCustomProjectCountInYear: 20, // 同一个用户每年能够创建的项目数
allSubList: [],
};
},
computed: {
...mapGetters(["searchParam", "cartList"])
},
watch: {
searchParam: {
handler(val) {
this.getCourseList(val);
},
deep: true
},
cartList(val) {
this.canNext = val.length > 0;
}
},
components: {
BreadCrumb,
CustomBaseinfo,
selectTemplate,
selectRegion,
setOrganization,
dialogComponet: dialog,
SelectCourseComp
},
created() {
vm = this;
vm.isEditorFn();
vm.isPreviewFn();
},
mounted() {
resizeHeight();
this.getLabelList();
this.initPageParams();
// this.initPageParams();
},
methods: {
...mapActions([
"setSearchParam",
"setCartList",
"setCourseList",
"setAllLabelList",
"setSubLabelList",
"setCourseLimitCount",
]),
initPageParams(labelIdList) {
let searchParam = {
orderBy: 2,
dir: 1,
grade: 0,
pageNo: 1,
pageSize: 10,
labelIdList: labelIdList || []
};
this.setCartList([]);
this.setCourseList([]);
this.setAllLabelList([]);
this.setSubLabelList([]);
this.courseLimitCount();
// this.getLabelList();
// this.getCourseList(searchParam);
},
// 自定义项目--选择课程个数限制(-1表示不限制)
courseLimitCount() {
vm.GET("portal/portalCustom/courseLimitCount", {}).then(res => {
if (res.code == "000000") {
this.setCourseLimitCount(res.data);
}
});
},
// 获取所有标签(一级及二级),交做相应处理
getLabelList() {
vm.GET("contents/diseases/labelList", {}).then(res => {
if (res.code == "000000") {
// 先将所有的标签添加checked字段
let labelList = res.data;
let allSubList = [];
let labelIdList = [];
labelList.forEach((item, index) => {
item.checked = false;
item.subList.forEach((sub, subIndex) => {
sub.parentIndex = index;
sub.checked = true;
if (subIndex == 0) {
sub.id = `subid-${index}`; // 将二级中的“全部”id改为可以识别的
} else {
allSubList.push(sub);
labelIdList.push(sub.id);
}
});
});
// 构建其子标签
allSubList.unshift({
name: "全部",
checked: true,
id: 'parentid-0'
});
// 添加一级的“全部”标签,并构建其子标签
labelList.unshift({
name: "全部",
checked: true,
subList: allSubList
});
// this.initPageParams(labelIdList);
this.setAllLabelList(labelList);
this.setSubLabelList(allSubList);
let searchParam = {
orderBy: 2,
dir: 1,
grade: 0,
pageNo: 1,
pageSize: 10,
labelIdList: labelIdList || []
};
this.setSearchParam(searchParam);
}
});
},
// (根据条件)查询课程
getCourseList(searchParam) {
vm.GET("contents/diseases/courseListForPortal", searchParam).then(res => {
if (res.code == "000000") {
let courseList = res.data, cartIndex = -1;
courseList.list.forEach(item => {
cartIndex = vm.cartList.findIndex( current => {
return current.courseId == item.courseId;
})
if(cartIndex >= 0) {
item.checked = true;
} else {
item.checked = false;
}
});
this.setCourseList(courseList);
}
});
},
// 判断是否为编辑状态
isEditorFn() {
if (vm.$route.query.projectId) {
vm.projectId = vm.$route.query.projectId;
vm.editor = true;
vm.active = 1;
vm.canNext = true;
}
},
// 判断是否为预览状态
isPreviewFn() {
if (vm.$route.query.isPreview == 1 && vm.$route.query.projectId) {
vm.projectId = vm.$route.query.projectId;
vm.isPreview = vm.$route.query.isPreview;
vm.active = 1;
vm.canNext = true;
}
},
// 按钮点击下一步
nextStep() {
if (vm.active == 0) {
vm.checkSelectCustomCourse();
// vm.checkSelectTemplate()
return;
}
if (vm.active == 1) {
// 查看时,点击下一步直接跳
if (vm.isPreview == 1) {
vm.active = 2;
return;
}
// 调用项目信息中的下一步操作
vm.$refs.CustomBaseinfo.nextStep();
return;
}
},
// 填写项目信息组件的下一步回调(获取项目id)
next(id) {
vm.projectId = id;
vm.active = 2;
},
// 暂存
save() {
if (vm.active == 1) {
vm.$refs.CustomBaseinfo.save(false);
} else if (vm.active == 2) {
vm.regionComplete();
}
},
confirmFn() {
vm.sendObj.visible = false;
},
// 完成
complete() {
// 4不弹框
if (vm.projectStatus != 4 && vm.isPreview != 1) {
vm.sendObj.visible = true;
} else {
// 查看时,点击完成直接跳到列表页
if (vm.isPreview == 1) {
let query = {};
if (vm.$route.query.pageNum) {
query = { pageNum: vm.$route.query.pageNum };
}
vm.$router.push({ path: "item-manager", query: query });
return;
}
vm.hidefn();
}
},
// 完成触发的接口
hidefn() {
vm.regionComplete(vm.changeStatus);
},
// 选择学元范围暂存
regionComplete(fishFn) {
let req = {
projectId: vm.projectId,
scopeOfAdministrative: vm.$refs.selectRegion.setScope(),
scopeOfDepartment: 99999999,
flag: fishFn ? 3 : 1 //0:下一步 1:暂存
};
openLoading(vm);
vm.POST("portal/new/scope", req)
.then(res => {
closeLoading(vm);
if (res.code == "000000" && fishFn) {
fishFn();
}
if (!fishFn) {
vm.$message({
type: "info",
message: res.message
});
}
})
.catch(() => {
vm.$message({
type: "warning",
message: res.message
});
});
},
// 完成后更改状态
changeStatus() {
let req = {
projectId: vm.projectId,
changeStatus: 3 //待审核
};
vm.POST("portal/portalInfo/changeStatus", req)
.then(res => {
vm.sendObj.visible = false;
if (res.code == "000000") {
let query = {};
if (vm.$route.query.pageNum) {
query = { pageNum: vm.$route.query.pageNum };
}
console.log("vm.$router.push");
vm.$router.push({ path: "item-manager", query: query });
} else {
vm.$message({
type: "warning",
message: res.message
});
}
})
.catch(() => {
vm.$message({
type: "warning",
message: res.message
});
});
},
//切换tabs
handleClickTabs(tab, event) {
if (tab.name == "second") {
vm.setRegion();
}
},
// 模板列表选中
checkFn(id) {
vm.canNext = true;
vm.openTemplateId = id;
},
//选中自定义课程后点击下一步时检测(机构和进行中的项目)
checkSelectCustomCourse() {
openLoading(vm);
vm.GET(`portal/portalCustom/checkBeforeCreateCustomProject`)
.then(res => {
closeLoading(vm);
if (res.code == "000000") {
if (res.data.status == 0) {
vm.maxLimitCreatedCustomProjectCountInYear =
res.data.maxLimitCreatedCustomProjectCountInYear;
vm.active = 1;
return;
} else {
if(res.data.status == 21) {
vm.statusObj.status_21.message = `本年度免费创建自定义项目数已达${res.data.maxLimitCreatedCustomProjectCountInYear}次,不能继续创建`;
}
vm.dialogObj = Object.assign(vm.dialogObj, vm.statusObj[`status_${res.data.status}`]);
vm.dialogObj.visible = true;
return;
}
} else {
vm.$message.info(res.message);
}
})
.catch(err => {
closeLoading(vm);
vm.$message.warning("请稍后重试");
});
},
//选中模板后点击下一步时检测(机构和进行中的项目)
checkSelectTemplate() {
openLoading(vm);
vm.GET(
`portal/openTemplateProject/checkAfterSelectOneOpenTemplate/${vm.openTemplateId}`
)
.then(res => {
closeLoading(vm);
if (res.code == "000000") {
if (res.data.status == 0) {
vm.active = 1;
return;
} else {
vm.dialogObj = Object.assign(
vm.dialogObj,
vm.statusObj[`status_${res.data.status}`]
);
vm.dialogObj.visible = true;
return;
}
} else {
vm.$message.info(res.message);
}
})
.catch(err => {
closeLoading(vm);
vm.$message.warning("请稍后重试");
});
},
// 隐藏弹框
hide() {
vm.dialogObj.visible = false;
},
// 获取行政范围
setRegion() {
vm.getOrganizationList(vm.$refs.selectRegion.getScope());
},
// 查询行政范围的设定机构列表
getOrganizationList(r) {
vm.$refs.setOrganization.init();
vm.$refs.setOrganization.getOrganization(r);
},
// 返回选择模板页
backSelectVue() {
vm.active = 0;
},
// 是否隐藏暂存按钮
hideSave(num) {
this.projectStatus = num;
},
// 从子组件(项目信息)获取项目状态是否为上架
setStatus4Flag(s) {
vm.status4Flag = s;
}
}
};
</script>
<style lang="scss">
.edit-custom-wrap {
::-webkit-scrollbar {
width: 10px;
height: 10px;
background-color: #fff;
}
/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track {
// box-shadow: inset 0 0 3px rgba(0,0,0,0.3);
// -webkit-box-shadow: inset 0 0 3px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #fff;
}
/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb {
border-radius: 6px;
// box-shadow: inset 0 0 3px rgba(0,0,0,.3);
// -webkit-box-shadow: inset 0 0 3px rgba(0,0,0,.3);
background-color: #C7C8C9;
}
.el-step.is-simple:not(:last-of-type) .el-step__title {
max-width: 100%;
}
.top-lin {
position: fixed;
height: 30px;
background: #f0f2f5;
right: 30px;
left: 285px;
z-index: 1001;
top: 125px;
}
.step-content-new {
min-width: 1200px;
display: flex;
justify-content: space-between;
// min-width: 1300px;
background: #fff;
background: #fff;
overflow: hidden;
height: 54px;
line-height: 54px;
padding: 15px 0 50px 0;
border-bottom: 1px solid #efefef;
background: #fff;
.is-text {
display: none;
}
.el-steps--simple {
background: #fff;
}
.button-green {
color: #ffffff;
background: #449284;
border-color: #bfdad5;
border-radius: 2px;
}
.button-white {
color: #606266;
background: #ffffff;
border-color: #ecedf1;
border-radius: 2px;
}
.step-num {
display: block;
font-size: 12px;
border: 1px solid #999 !important;
border-radius: 50%;
width: 25px;
height: 18px;
line-height: 16px;
text-align: center;
color: #999;
}
.el-step__title.is-wait {
color: #999;
}
.el-step__title.is-process {
color: #449284;
}
.is-finish {
color: #999 !important;
}
.on-step {
color: #449284;
border: 1px solid #449284 !important;
}
.dis-btn {
width: 78px;
height: 34px;
background: rgba(240, 242, 245, 1);
border-radius: 3px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(144, 147, 153, 1);
line-height: 34px;
text-align: center;
cursor: pointer;
}
.dis-btn-b {
position: relative;
left: 5px;
bottom: 10px;
}
}
.add-content-new {
background: #fff;
}
.three-step {
padding-top: 64px;
margin: 10px 0 0 20px;
.area-p {
margin-bottom: 15px;
font-size: 14px;
}
.span_ecology {
line-height: 45px;
margin-left: 8px;
}
.dialog-p {
text-align: center;
span {
color: #449284;
}
}
//隐藏树展开
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
.el-tree-node__expand-icon {
display: none;
}
.department {
margin-top: 20px;
border: 1px solid #dddddd;
}
.el-tabs__nav-wrap::after {
display: none;
}
.el-tabs__active-bar {
display: none;
}
#tab-first,
#tab-second,
#tab-third {
padding-right: 0px;
}
#tab-first::after {
color: #c7cbd2;
margin-left: 20px;
content: "•";
}
.el-tabs__item.is-active {
color: #fff;
}
.el-tag {
margin: 0 10px 10px 0;
border: 1.3px solid #48a8fe;
color: #1e92fe;
background-color: #e7f6fe;
.el-icon-close {
width: 13px;
height: 13px;
line-height: 13px;
font-size: 12px;
background-color: #0486fe;
border-radius: 50%;
color: #d4edfe;
}
}
.down-button {
margin-left: 10px;
}
.down-button-close {
margin-left: 100px;
float: left;
}
.dialog-success {
p {
text-align: center;
.upload-text {
color: #449284;
}
}
}
.dialog-fail {
.fail-type {
p {
margin-top: 10px;
}
.fail-num {
color: #db3f52;
}
.fail-notice {
color: #e3e3e3;
font-size: 13px;
}
.fail-link {
text-align: center;
color: #449284;
cursor: pointer;
}
}
}
}
.tpl-main {
// padding-top: 64px;
}
}
</style>
因为 它太大了无法显示 源差异 。您可以改为 查看blob
<template>
<div class="notice-item-shield">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="header-title" style="position:relative;">
公告
<el-button
type="primary"
style="position: absolute;right: 30px;bottom: 8px;"
size="small"
@click="beforeConfirm()"
>发布</el-button>
<el-button
type="primary"
style="position: absolute;right: 100px;bottom: 8px;"
size="small"
@click="cancleEdit()"
>取消</el-button>
</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form :model="formData" ref="formData" :rules="rules" label-width="120px" class="form-inline">
<el-form-item label="是否开启公告:" prop="projectIntro" style="min-width: 1000px;margin-bottom: 10px">
<el-col :span="20">
<el-radio-group size="small" v-model="formData.openFlag">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</el-col>
</el-form-item>
<!-- <el-col :span="22" style="min-width: 600px;">
<el-form-item label="是否开启公告:">
<el-radio-group size="small" v-model="formData.openFlag" @change="changeOpenFlag">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-col> -->
<el-form-item v-show="formData.openFlag != 2" label="标题:" prop="noticeTitle">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeTitle" placeholder="请输入公告标题" maxlength=20></el-input>
<span class="word-num">{{(formData.noticeTitle).replace(/\s+/g,"").length}}/20</span>
</el-col>
</el-form-item>
<!-- <el-col v-show="formData.openFlag != 2" :span="20">
<el-form-item label="标题:" prop="noticeTitle">
<el-input size="small" v-model="formData.noticeTitle" placeholder="请输入公告标题" maxlength=20></el-input>
<span class="word-num">{{(formData.noticeTitle).replace(/\s+/g,"").length}}/20</span>
</el-form-item>
</el-col> -->
<el-form-item v-show="formData.openFlag != 2" label="内容:" prop="noticeContent">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeContent" placeholder="请输入公告内容" type="textarea"
:autosize="{ minRows: 5}" maxlength=150></el-input>
<span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/150</span>
</el-col>
</el-form-item>
<!-- <el-col v-show="formData.openFlag != 2" :span="20">
<el-form-item label="内容:" prop="noticeContent">
<el-input size="small" v-model="formData.noticeContent" placeholder="请输入公告内容" maxlength=150></el-input>
<span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/150</span>
</el-form-item>
</el-col> -->
</el-form>
</el-row>
</div>
<el-dialog
class="prot-dialog"
title=""
:visible.sync="isShowDialog"
width="30%"
center
:close-on-click-modal=false
:close-on-press-escape=false
:show-close=false>
<p v-show="isCancleBtn" class="prot-dialog-tips-1">确定取消吗?取消后将不保存本次操作内容</p>
<p v-show="!isCancleBtn" class="prot-dialog-tips-1">点击发布后将立即生效,是否继续发布?</p>
<!-- <p class="prot-dialog-tips-2">若您选择暂不发送,您只能录入量表的非敏感信息</p> -->
<!-- <p class="prot-dialog-tips-3">为避免打扰居民,7天内只能发送1次,您已发送过短信,请尽快联系居民同意授权</p> -->
<span v-show="isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="cancleConfirm"> 确定取消 </el-button>
<el-button size="small" type="primary" @click="isShowDialog = false"> 继续操作 </el-button>
</span>
<span v-show="!isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="openFlagCancle"> 取消 </el-button>
<el-button size="small" type="primary" @click="openFlagConfirm"> 确定 </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
// let checkNoticeTitleStr = (rule, value, callback) => {
// if(value.indexOf("\\") != -1) {//存在
// callback(new Error('请勿输入字符“ \\ ”'));
// } else if (value.indexOf(".") != -1) {
// callback(new Error('请勿输入字符“ . ”'));
// } else {
// callback();
// }
// };
return {
curmbFirst: "教培项目",
curmbSecond: "公告管理",
projectId: "",
formData: {
noticeContent: "",
noticeId: 0,
noticeTitle: "",
openFlag: 0,
projectId: 0
},
isShowDialog: false,
isCancleBtn: true,
rules: {
noticeTitle: [
{ required: true, message: "请输入公告标题", trigger: "blur" },
{
min: 2,
max: 20,
message: "输入长度为2-20的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
// { validator: checkNoticeTitleStr, trigger: 'blur' }
],
noticeContent: [
{ required: true, message: "请输入公告内容", trigger: "blur" },
{
min: 2,
max: 150,
message: "输入长度为2-150的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
],
}
};
},
created() {
vm = this;
vm.projectId = vm.getUrlSearch(window.location.href, "projectId");
vm.formData.projectId = vm.projectId
vm.getNoticeInfo();
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
//获取公告信息
getNoticeInfo() {
let req = {
projectId: vm.projectId
};
openLoading(vm);
vm.GET("portal/noticeInfo/getNoticeInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.formData = res.data;
}
});
},
beforeConfirm() {
let flag = false;
vm.$refs['formData'].validate(valid => {
if (valid) {
flag = true;
} else {
flag = false;
}
});
if(!flag) return;
vm.isCancleBtn = false;
// if(vm.formData.noticeId) {
vm.isShowDialog = true;
// }
},
//提交公告信息
confirmEdit(needJump) {
openLoading(vm);
vm.formData.projectId = vm.projectId
vm.POST("portal/noticeInfo/insertOrUpdate", vm.formData).then(res => {
closeLoading(vm);
if (res.code == "000000") {
// if(needJump) {
vm.$router.push('/item-manager');
vm.$message.success('发布成功');
// }
}
});
},
// 点击取消按钮
cancleEdit() {
vm.isCancleBtn = true;
vm.isShowDialog = true;
},
// 切换开启状态
changeOpenFlag(value) {
if(vm.formData.noticeId && value == 1) {
vm.isCancleBtn = false;
vm.isShowDialog = true;
}
},
// 确认取消
cancleConfirm() {
vm.isShowDialog = false;
vm.$router.push('/item-manager');
},
// 确认开启的取消
openFlagCancle() {
vm.isShowDialog = false;
// vm.formData.openFlag = 2;
// vm.$forceUpdate();
},
// 确认开启
openFlagConfirm() {
vm.isShowDialog = false;
vm.confirmEdit();
}
}
};
</script>
<style lang="scss">
.notice-item-shield {
.component-content {
background: #fff;
padding: 20px 30px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.complete {
float: right;
}
.text-black {
color: #d51f35;
}
}
.word-num {
font-size: 12px;
color: #999;
padding-top: 5px;
}
.el-input {
width: 80%;
}
.el-textarea {
width: 80%;
}
.el-form-item__error {
left: 13px;
}
}
</style>
\ No newline at end of file
<template>
<div class="item-component-wrap">
<bread-crumb
:curmbFirst="curmbFirst"
:curmbSecond="curmbSecond">
</bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="search-title">查询条件</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form ref="serchForm" :model="searchParam" label-width="75px" style="width:100%;">
<el-col :span="6">
<el-form-item label="组件名称:">
<el-input v-model="searchParam.name" size="small" placeholder="请输入组件名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="发布状态:">
<el-select v-model="searchParam.status" size="small" style="width: 100%;" placeholder="请选择发布状态">
<el-option
v-for="(item,index) in statuSelect"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="search(1)">查询</el-button>
<el-button type="default" size="small" @click="reseat" style="margin-left:0;">重置</el-button>
</el-col>
</el-form>
</el-row>
<el-row :gutter="10" class="row create-button" style="margin-right:0;">
<el-button type="primary" size="small" :disabled="idType == 2 && masterAdministratorFlag == 'false'" @click="createComponent">新建项目组件</el-button>
</el-row>
<el-table
:data="tableData"
style="width: 100%">
<el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="name" label="组件名称" min-width="200" align="center"></el-table-column>
<el-table-column prop="createdName" label="发起人" min-width="100" align="center"></el-table-column>
<el-table-column prop="status" label="状态" min-width="80" align="center">
<template slot-scope="scope">
<span>{{ scope.row.status | statusFileter }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="200">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editComponentList(scope.row)">编辑</el-button>
<el-button type="primary" v-if="scope.row.status == 2 || scope.row.status == 4" size="small" @click="enableAndDisable(scope.row,1)">启用</el-button>
<el-button type="primary" v-if="scope.row.status == 3" size="small" @click="enableAndDisable(scope.row,2)">禁用</el-button>
<el-button type="primary" v-if="scope.row.status == 1 || scope.row.status == 2" size="small" @click="deleteComponent(scope.row)">删除</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png" />
<p>没有查询到相关结果</p>
</div>
</div>
</el-table>
<!-- 分页 -->
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchParam.pageNo"
:page-sizes="[15, 30, 50, 100, 200, 500, 700, 1000, 1500, 2000]"
:page-size="searchParam.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows">
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import BreadCrumb from '../../components/breadcrumb.vue'
import { doUpload, getFilePath } from "../../utils/qiniu-util"
import { validateWord } from "../../utils/validate.js"
import { mapGetters,mapActions } from 'vuex'
import { openLoading, closeLoading } from '../../utils/utils'
import * as commonUtil from '../../utils/utils'
let vm = null
export default {
components: {
BreadCrumb
},
data() {
return {
curmbFirst: '教培项目',
curmbSecond: '项目组件',
idType:'',
masterAdministratorFlag: false,
searchParam: {
idType: '',
name: '',
status: '',
pageNo: 1,
pageSize: 15
},
statuSelect: [
{
label: '草稿',
value: '1'
},{
label: '未启用',
value: '2'
},{
label: '已启用',
value: '3'
},{
label: '已禁用',
value: '4'
}
],
tableData: [],
totalRows: 0,
basicRule: {
"name": [
{ required: true, message: '输入长度为2-20个中文', trigger: 'blur' },
{ validator: function(rule, value, callback) {
validateWord(rule, value, callback, '输入长度为2-20个中文')
},
trigger: 'blur' }
],
"introduce": [
{ required: true, message: '请输入组件简介', trigger: 'blur' },
],
}
}
},
computed: {
...mapGetters([
'_token',
// 'idType',
// 'masterAdministratorFlag'
])
},
created() {
vm = this
vm.idType = localStorage.getItem('storageIdType')
vm.masterAdministratorFlag = localStorage.getItem('storageMaster')
if(this.$route.query.pageNum){
console.log(this.$store.state.common.itemComponents)
vm.searchParam.status = this.$store.state.common.itemComponents.status
vm.searchParam.name = this.$store.state.common.itemComponents.name
vm.searchParam.pageNo = parseInt(this.$route.query.pageNum)
}
vm.search()
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight()
},
methods: {
...mapActions([
'updateItemComponents'
]),
// 列表查询
search(flag) {
if(flag) vm.searchParam.pageNo = 1
vm.searchParam.idType = vm.idType
openLoading(vm)
vm.GET('portal/portalComponent/queryPortalComponent',vm.searchParam).then((res) => {
closeLoading(vm)
if( res.code == '000000' ) {
vm.tableData = res.data.queryList
vm.totalRows = res.data.total
}else {
vm.$message.info(res.message)
}
})
},
// 重置
reseat() {
vm.searchParam = Object.assign({},{
idType: '',
name: '',
status: '',
pageNo: 1,
pageSize: 15
})
vm.search()
},
// 新建组件
createComponent() {
vm.$router.push({path: 'create-component'})
},
// 编辑(验证可编辑范围)
editComponentList(row) {
let req = {
token: vm._token,
componentId: row.id
}
vm.GET('portal/portalComponent/componentEditRange',req).then((res) => {
if(res.code == "000000") {
vm.updateItemComponents({name:vm.searchParam.name,status:vm.searchParam.status})
vm.$router.push({path: 'create-component',query: {id:row.id,status: row.status,resultFlag: res.data.resultFlag,pageNum:vm.searchParam.pageNo}})
}else {
vm.$message.info(res.message)
}
})
},
// 启用(禁用)
enableAndDisable(row,flag) {
let req = null
let text = ''
if(flag == 1) { // 启用
req = {
id: row.id,
status: 3
}
text = '组件一经启用,将无法进行修改,确定启用吗?'
}else if(flag == 2) { // 禁用
req = {
id: row.id,
status: 4
}
text = '确定禁用吗?'
}
vm.$confirm(text, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vm.GET('portal/portalComponent/disableOrStart',req).then((res) => {
if(res.code == "000000") {
vm.$message({
type: 'success',
message: '操作成功!'
});
vm.search()
if(res.message != 'success') {
vm.$message({
message: res.message,
type: 'warning'
})
}
}else {
vm.$message.info(res.message)
}
}).catch(function (error) {
vm.$message.error(error);
});
}).catch(() => {
vm.$message({
type: 'info',
message: '已取消'
});
});
},
// 删除
deleteComponent(row) {
vm.$confirm('确定要删除该组件吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vm.GET('portal/portalComponent/deleteComponentById',{id: row.id}).then((res) => {
if(res.code == "000000") {
vm.$message({
type: 'success',
message: '删除成功!'
});
vm.search()
} else {
vm.$message.info(res.message)
}
}).catch(function (error) {
vm.$message.error(error);
});
}).catch(() => {
vm.$message({
type: 'info',
message: '已取消'
})
})
},
handleSizeChange(value) {
vm.searchParam.pageSize = value
vm.search()
},
handleCurrentChange(value) {
vm.searchParam.pageNo = value
vm.search()
}
}
}
</script>
<style lang="scss">
.item-component-wrap {
.component-content {
padding: 10px;
background: #fff;
// margin: 84px 20px 20px;
.search-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.create-button {
padding: 0 0 15px;
margin-top: 0 !important;
text-align: right;
}
.table-empty {
img{
width: 100px;
}
p {
margin-top: -50px;
}
}
}
}
</style>
<template>
<div class="item-manager-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="header-title">项目管理</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;">
<el-col :span="5">
<el-form-item label="项目名称:">
<el-input v-model="formInline.projectName" size="small" placeholder="请输入项目名称"></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="项目时间:">
<el-date-picker
v-model="formInline.duringTime"
size="small"
type="daterange"
start-placeholder="请选择开始时间"
end-placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</el-form-item>
</el-col>-->
<el-col :span="6">
<el-form-item label="项目时间:">
<el-date-picker
v-model="formInline.projectBegintime"
size="small"
type="datetime"
placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="~">
<el-date-picker
v-model="formInline.projectEndtime"
size="small"
type="datetime"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions1"
default-time="23:59:59"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="searchList">查询</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button>
</el-col>
</el-form>
</el-row>
<el-row>
<el-col :span="5">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;">
<el-form-item label="发布状态:">
<el-select size="small" v-model="formInline.projectStatus" placeholder="请选择发布状态">
<el-option
v-for="item in optionStatus"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-form :model="formInline" class="demo-form-inline">
<el-form-item>
<el-button class="add-button" :disabled="idType == 2 && masterAdministratorFlag == 'false'" size="small" type="primary" @click="openProject()">新建项目</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdName" label="创建人" align="center"></el-table-column>
<el-table-column prop="projectLeader" label="项目负责人" align="center"></el-table-column>
<el-table-column prop="projectTypeValue" label="项目类型" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" width="100" align="center"></el-table-column>
<!-- <el-table-column
prop="projectIntro"
label="项目简介"
align="center"
min-width="100"
show-overflow-tooltip
></el-table-column> -->
<el-table-column prop="projectBegintime" label="项目开始时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectEndtime" label="项目结束时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectStatus" label="状态" align="center">
<template slot-scope="scope">
<span>{{ [scope.row.projectStatus , idType] | statusProject }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" min-width="360" align="center">
<template slot-scope="scope">
<el-button
@click="changeStatus(scope.row,0)"
v-show="showButton(scope.row,0)"
type="primary"
size="small"
>编辑</el-button>
<el-button
@click="changeStatus(scope.row,1)"
v-show="showButton(scope.row,1)"
type="primary"
size="small"
>暂存</el-button>
<el-button
@click="changeStatus(scope.row,2)"
v-show="showButton(scope.row,2)"
type="primary"
size="small"
>完成</el-button>
<el-button
@click="changeStatus(scope.row,3)"
v-show="showButton(scope.row,3)"
type="primary"
size="small"
>发布</el-button>
<el-button
@click="changeStatus(scope.row,4)"
v-show="showButton(scope.row,4)"
type="primary"
size="small"
>通过</el-button>
<el-button
@click="changeStatus(scope.row,5)"
v-show="showButton(scope.row,5)"
type="primary"
size="small"
>下架</el-button>
<el-button
@click="changeStatus(scope.row,7)"
v-show="showButton(scope.row,7)"
type="primary"
size="small"
:disabled="scope.row.checkStatus==1"
>提醒审核</el-button>
<el-button
@click="changeStatus(scope.row,8)"
v-show="showButton(scope.row,8)"
type="primary"
size="small"
>取消审核</el-button>
<el-button
@click="changeStatus(scope.row,6)"
v-show="showButton(scope.row,6)"
type="primary"
size="small"
>拒绝</el-button>
<el-button
@click="delItem(scope.row,9)"
v-show="showButton(scope.row,9)"
type="primary"
size="small"
>删除</el-button>
<el-button
@click="hanldeCmeClick(scope.row)"
v-show="showCMEButton(scope.row)"
type="primary"
size="small"
>{{ handleCmeOperate(scope.row.projectStatus) }}</el-button>
<el-button
@click="toShield(scope.row)"
v-show="scope.row.blackModifiable == true"
type="primary"
size="small"
>屏蔽</el-button>
<el-button
@click="addOrModifyNotice(scope.row, 0)"
v-if="masterAdministratorFlag == 'true'"
type="primary"
size="small"
>公告</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有查询到相关结果</p>
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formInline.pageNo"
:page-sizes="[10, 30, 50, 100]"
:page-size="formInline.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
<!-- 初审 弹窗 -->
<el-dialog
title="项目初审"
:visible.sync="firstCheckVisible"
width="600px"
:close-on-click-modal="false"
center>
<span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》初审结果为?` }}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCheckLeft">通 过</el-button>
<el-button @click="handleCheckRight">不通过</el-button>
</span>
</el-dialog>
<!-- 新建项目弹窗 -->
<el-dialog
title="请选择项目类型"
:visible.sync="centerDialogVisible"
width="600px"
:close-on-click-modal="false"
@close="handleTypeClose"
center>
<span style="margin: 0 20px;">项目类型:</span>
<el-radio-group v-model="newProjectType">
<el-radio :label="1">普通项目</el-radio>
<el-radio :label="2">CME项目</el-radio>
<el-radio :label="3">开放模板</el-radio>
</el-radio-group>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="handleCreateProject">确 定</el-button>
</span>
</el-dialog>
<!-- 复审 弹窗 -->
<el-dialog
title="项目复审"
:visible.sync="secondCheckVisible"
width="600px"
:close-on-click-modal="false"
center>
<span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》复审结果为?` }}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCheckLeft">通 过</el-button>
<el-button @click="handleCheckRight">不通过</el-button>
</span>
</el-dialog>
<!-- 删除 弹窗 -->
<el-dialog
title="确认删除"
:show-close=false
:visible.sync="deleteVisible"
:close-on-click-modal="false"
width="600px"
center>
<p style="text-align: center;">删除后将不可撤销,确认删除吗?</p>
<span slot="footer" class="dialog-footer">
<el-button @click="confirmDelete">删 除</el-button>
<el-button type="primary" @click="hideDeleteFrom">取 消</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { mapGetters,mapActions } from 'vuex'
import { returnData } from "../../utils/mock";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import { setTimeout } from 'timers';
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
return {
idValue: '',
curmbFirst: "教培项目",
curmbSecond: "项目管理",
centerDialogVisible: false, // 新建项目弹窗
firstCheckVisible: false, // 各种操作的确认弹窗
secondCheckVisible: false,
newProjectType: 1, // 1 普通项目 2 CME项目
searchParam: {
name: "",
status: "",
pageNo: 1,
pageSize: 10
},
cmeBtnText: '',
currentRow: {},
optionStatus: [
{
value: 1,
label: "草稿"
},
{
value: 2,
label: "未上架"
},
{
value: 3,
label: "审核中/待审核"
},
{
value: 4,
label: "已上架"
},
{
value: 5,
label: "已下架"
},
{
value: 6,
label: "已拒绝/未上架"
},
{
value: 7,
label: "待初审"
},
{
value: 8,
label: "初审未通过"
},
{
value: 9,
label: "待复审"
},
{
value: 10,
label: "复审未通过"
},
{
value: 11,
label: "复审通过"
},
// 加上去 。。。。。。。CME
],
tableData: [],
totalRows: 0,
loading: true,
timingTime: "",
currentPage: 1,
formInline: {
projectName: "",
projectBegintime: "",
projectEndtime: "",
projectStatus: "",
pageNo: 1,
pageSize: 10
},
pickerOptions0: {
disabledDate: time => {
if (this.formInline.projectEndtime != "" && this.formInline.projectEndtime !=null) {
return (
time.getTime() >
new Date(this.formInline.projectEndtime).getTime()
);
}
}
},
pickerOptions1: {
disabledDate: time => {
return (
time.getTime() <
new Date(this.formInline.projectBegintime).getTime()
); //减去一天的时间代表可以选择同一天;
}
},
idType: '',
masterAdministratorFlag: false,
deleteVisible: false,
};
},
computed: {
...mapGetters([
"_token",
// "idType",
// "masterAdministratorFlag"
])
},
created() {
vm = this;
vm.idType = localStorage.getItem('storageIdType');
vm.masterAdministratorFlag = localStorage.getItem('storageMaster');
console.log('idType:',vm.idType);
if(this.$route.query.pageNum){
this.formInline = {...this.$store.state.common.itemManager}
this.formInline.pageNo = parseInt(this.$route.query.pageNum)
}
this.$nextTick(function() {;
this.getProjectList();
});
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
...mapActions([
'updateItemManager'
]),
hideDeleteFrom() {
this.deleteVisible = false;
},
openProject() {
if(vm.masterAdministratorFlag == 'true') {
this.centerDialogVisible = true;
} else {
this.toPage();
}
},
toPage() {
this.$router.push("edit-manager?projectType=1");
},
toCmePage() {
this.$router.push("edit-cme?projectType=2");
},
toTemplatePage() {
this.$router.push("template-open?projectType=3");
},
toShield(row) {
this.$router.push("item-shield?projectId="+row.id);
},
handleTypeClose() {
this.centerDialogVisible = false;
this.newProjectType = 1;
},
handleCreateProject() {
if (this.newProjectType == 1) { // 1 普通项目 2 CME项目
this.toPage();
} else if (this.newProjectType == 2) {
this.toCmePage();
} else if(this.newProjectType == 3) {
this.toTemplatePage();
}
},
hanldeCmeClick(row) {
this.currentRow = row;
let status = row.projectStatus;
// 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过
if (status == 7 || status == 8) { // 按钮显示 初审
this.firstCheckVisible = true;
} else if (status == 9 || status == 10) { // 按钮显示 复审
this.secondCheckVisible = true;
} else if (status == 11) { // 按钮显示 发布
this.changeStatus(row,3)
}
},
handleCheckLeft() { // 左边通过
this.goToCheckAuth(1);
},
handleCheckRight() {
this.goToCheckAuth(2);
},
goToCheckAuth(refuse) {
let row = this.currentRow;
let req = {};
openLoading(vm);
// refuse = 1 : 同意 refuse = 2:拒绝
vm.GET(`portal/cme/verifyProject?projectId=${row.id}&refuse=${refuse}`, req).then(res => {
closeLoading(vm);
// debugger;
vm.firstCheckVisible = false;
vm.secondCheckVisible = false;
if (res.code == "000000") {
vm.getProjectList();
this.$message({
message: '审核成功',
type: 'success'
});
} else {
this.$message.error(res.message);
}
});
},
searchList() {
this.formInline.pageNo = 1;
this.getProjectList();
},
//查询项目列表
getProjectList() {
let req = {};
req = this.formInline;
openLoading(vm);
vm.GET("portal/portalInfo/getProjectList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.data;
//console.log(vm.tableData);
vm.totalRows = res.data.totalRows;
}
});
},
showCMEButton(row, type) {
// if(row.projectType == 2) {
// return true;
// } else {
// return false;
// }
// CME 专属状态码 为7~11,是这些代码的直接走新逻辑,别的走老逻辑
let cmeStatus = [7, 8, 9, 10, 11];
let currentStatus = parseInt(row.projectStatus);
if ( cmeStatus.indexOf(currentStatus) > -1 ) {
return true;
} else {
return false;
}
},
//按钮展示情况
showButton(row, type) {
// debugger;
// 按钮type类型: 0-编辑
// 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝
// 7- 提醒审核 8(2)-取消审核 9-删除
let projectStatus = row.projectStatus;
let idType = row.idType;
let level = row.level;
let flag = false;
let typeStr = parseInt(type);
//console.log("状态:"+projectStatus+ "等级:" + level + " 按钮类型:" + type);
//console.log('idType',idType);
let buttonStatus = "";
if (idType == 1) {
//内部项目
buttonStatus = returnData().buttonStatusIn;
} else {
//外部项目
buttonStatus = returnData().buttonStatusOut;
}
if(projectStatus == null) {
return false;
}
if (level != null) {
let tempStatus = JSON.parse(JSON.stringify(projectStatus));
if (tempStatus > 6) {
tempStatus = 1;
}
let statusSet = buttonStatus[tempStatus - 1][level];
let flagValue = statusSet.indexOf(typeStr);
if (flagValue >= 0) {
flag = true;
} else {
flag = false;
}
}
//flag = true;
return flag;
},
handleCmeOperate(status) {
let text = '';
// 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过
if (status == 7 || status == 8) { // 按钮显示 初审
text = '初审';
} else if (status == 9 || status == 10) { // 按钮显示 复审
text = '复审';
} else if (status == 11) { // 按钮显示 发布
text = '发布';
}
this.cmeBtnText = text;
return text;
// return true / false;
},
//改变状态
changeStatus(row, type) {
let projectId = row.id;
let level = row.level;
if (type === 0) {
this.updateItemManager(this.formInline)
//编辑
if(row.projectType === 1) {
this.$router.push("edit-manager?projectType=1&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo);
} else if(row.projectType === 2) {
this.$router.push("edit-cme?projectType=2&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo);
}
} else if (type === 7) {
//提醒审核
let req = {
portalProjectId: projectId,
warnType: 1
};
vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
vm.$message.info(res.message);
vm.getProjectList();
if (res.code == "000000") {
console.log(res);
//vm.getProjectList();
}
});
} else {
// if (type === 8) {
// //取消审批值对应2
// type = 2;
// let req = {
// portalProjectId: projectId,
// warnType: 5
// };
// vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
// vm.$message.info(res.message);
// if (res.code == "000000") {
// console.log(res);
// vm.getProjectList();
// }
// });
// }
// if (type == 4 || type == 6) {
// //发送消息
// let warnType = "";
// if (type == 4) {
// warnType = 3;
// } else if (type == 6) {
// warnType = 4;
// }
// let req = {
// portalProjectId: projectId,
// warnType: warnType
// };
// vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
// vm.$message.info(res.message);
// if (res.code == "000000") {
// console.log(res);
// vm.getProjectList();
// }
// });
// }
let req = {
projectId: projectId,
changeStatus: vm.getType(type)
};
vm.POST("portal/portalInfo/changeStatus", req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
console.log(res);
vm.getProjectList();
//changeStatus之后remindPortalCheck
if (type == 4 || type == 6 || type == 8) {
//发送消息
let warnType = "";
if (type == 4) {
warnType = 3;
} else if (type == 6) {
warnType = 4;
} else if (type == 8) {
warnType = 5;
}
let req = {
portalProjectId: projectId,
warnType: warnType
};
vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
vm.getProjectList();
}
});
}
}
});
}
},
getType(value) {
let data = value;
if(data == 8) {
data = 2;
}
return data;
},
delItem(row) {
this.deleteVisible = true
this.currentRow = row;
},
hideDeleteFrom() {
this.deleteVisible = false;
},
// 删除项目
confirmDelete() {
let req = {};
vm.DELETE("portal/portalInfo/delete/" + this.currentRow.id, req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
this.deleteVisible = false;
vm.getProjectList();
}
});
},
// 重置表单
resetForm() {
vm.formInline = Object.assign(
{},
{
projectName: "",
projectBegintime: "",
projectEndtime: "",
projectStatus: "",
pageNo: 1,
pageSize: 10,
duringTime: ""
}
);
vm.getProjectList();
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.formInline.pageSize = val;
this.handleCurrentChange(this.searchParam.pageNo);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.formInline.pageNo = val;
this.getProjectList();
//需要判断是否检索
// if (!this.flag) {
// this.currentChangePage(this.tableDataEnd);
// } else {
// this.currentChangePage(this.filterTableDataEnd);
// }
}, //组件自带监控当前页码
currentChangePage(list) {
let from = (this.currentPage - 1) * this.pageSize;
let to = this.currentPage * this.pageSize;
this.tableDataEnd = [];
for (; from < to; from++) {
if (list[from]) {
this.tableDataEnd.push(list[from]);
}
}
},
addOrModifyNotice(row) {
this.$router.push("edit-notice?projectId=" + row.id);
}
}
};
</script>
<style lang="scss">
.item-manager-wrap {
.component-content {
background: #fff;
//margin-top: 88px;
padding: 10px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
// .table-option span {
// color: #409eff;
// }
.add-button {
float: right;
}
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
}
}
.el-tooltip__popper {
max-width:50%
}
</style>
<template>
<div class="item-manager-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="header-title">项目管理</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;">
<el-col :span="5">
<el-form-item label="项目名称:">
<el-input v-model="formInline.projectName" size="small" placeholder="请输入项目名称"></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="项目时间:">
<el-date-picker
v-model="formInline.duringTime"
size="small"
type="daterange"
start-placeholder="请选择开始时间"
end-placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</el-form-item>
</el-col>-->
<el-col :span="6">
<el-form-item label="项目时间:">
<el-date-picker
v-model="formInline.projectBegintime"
size="small"
type="datetime"
placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="~">
<el-date-picker
v-model="formInline.projectEndtime"
size="small"
type="datetime"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions1"
default-time="23:59:59"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="searchList">查询</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button>
</el-col>
</el-form>
</el-row>
<el-row>
<el-col :span="5">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;">
<el-form-item label="发布状态:">
<el-select size="small" v-model="formInline.projectStatus" placeholder="请选择发布状态">
<el-option
v-for="item in optionStatus"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-form :model="formInline" class="demo-form-inline">
<el-form-item>
<el-button class="add-button" :disabled="idType == 2 && masterAdministratorFlag == 'false'" size="small" type="primary" @click="openProject()">新建项目</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdName" label="创建人" align="center"></el-table-column>
<el-table-column prop="projectLeader" label="项目负责人" align="center"></el-table-column>
<el-table-column prop="projectTypeValue" label="项目类型" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" width="100" align="center"></el-table-column>
<!-- <el-table-column
prop="projectIntro"
label="项目简介"
align="center"
min-width="100"
show-overflow-tooltip
></el-table-column> -->
<el-table-column prop="projectBegintime" label="项目开始时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectEndtime" label="项目结束时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectStatus" label="状态" align="center">
<template slot-scope="scope">
<span>{{ [scope.row.projectStatus , idType] | statusProject }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" min-width="360" align="center">
<template slot-scope="scope">
<el-button
@click="changeStatus(scope.row,0)"
v-show="showButton(scope.row,0)"
type="primary"
size="small"
>编辑</el-button>
<el-button
@click="changeStatus(scope.row,1)"
v-show="showButton(scope.row,1)"
type="primary"
size="small"
>暂存</el-button>
<el-button
@click="changeStatus(scope.row,2)"
v-show="showButton(scope.row,2)"
type="primary"
size="small"
>完成</el-button>
<el-button
@click="changeStatus(scope.row,3)"
v-show="showButton(scope.row,3)"
type="primary"
size="small"
>发布</el-button>
<el-button
@click="changeStatus(scope.row,4)"
v-show="showButton(scope.row,4)"
type="primary"
size="small"
>通过</el-button>
<el-button
@click="changeStatus(scope.row,5)"
v-show="showButton(scope.row,5)"
type="primary"
size="small"
>下架</el-button>
<el-button
@click="changeStatus(scope.row,7)"
v-show="showButton(scope.row,7)"
type="primary"
size="small"
:disabled="scope.row.checkStatus==1"
>提醒审核</el-button>
<el-button
@click="changeStatus(scope.row,8)"
v-show="showButton(scope.row,8)"
type="primary"
size="small"
>取消审核</el-button>
<el-button
@click="changeStatus(scope.row,6)"
v-show="showButton(scope.row,6)"
type="primary"
size="small"
>拒绝</el-button>
<el-button
@click="delItem(scope.row,9)"
v-show="showButton(scope.row,9)"
type="primary"
size="small"
>删除</el-button>
<el-button
@click="hanldeCmeClick(scope.row)"
v-show="showCMEButton(scope.row)"
type="primary"
size="small"
>{{ handleCmeOperate(scope.row.projectStatus) }}</el-button>
<el-button
@click="toShield(scope.row)"
v-show="scope.row.blackModifiable == true"
type="primary"
size="small"
>屏蔽</el-button>
<el-button
@click="addOrModifyNotice(scope.row, 0)"
v-if="masterAdministratorFlag == 'true'"
type="primary"
size="small"
>公告</el-button>
</template>
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有查询到相关结果</p>
</div>
</div>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="formInline.pageNo"
:page-sizes="[10, 30, 50, 100]"
:page-size="formInline.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
<!-- 初审 弹窗 -->
<el-dialog
title="项目初审"
:visible.sync="firstCheckVisible"
width="600px"
:close-on-click-modal="false"
center>
<span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》初审结果为?` }}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCheckLeft">通 过</el-button>
<el-button @click="handleCheckRight">不通过</el-button>
</span>
</el-dialog>
<!-- 新建项目弹窗 -->
<el-dialog
title="请选择项目类型"
:visible.sync="centerDialogVisible"
width="600px"
:close-on-click-modal="false"
@close="handleTypeClose"
center>
<span style="margin: 0 20px;">项目类型:</span>
<el-radio-group v-model="newProjectType">
<el-radio :label="1">普通项目</el-radio>
<el-radio :label="2">CME项目</el-radio>
</el-radio-group>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="handleCreateProject">确 定</el-button>
</span>
</el-dialog>
<!-- 复审 弹窗 -->
<el-dialog
title="项目复审"
:visible.sync="secondCheckVisible"
width="600px"
:close-on-click-modal="false"
center>
<span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》复审结果为?` }}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCheckLeft">通 过</el-button>
<el-button @click="handleCheckRight">不通过</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { mapGetters,mapActions } from 'vuex'
import { returnData } from "../../utils/mock";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import { setTimeout } from 'timers';
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
return {
idValue: '',
curmbFirst: "教培项目",
curmbSecond: "项目管理",
centerDialogVisible: false, // 新建项目弹窗
firstCheckVisible: false, // 各种操作的确认弹窗
secondCheckVisible: false,
newProjectType: 1, // 1 普通项目 2 CME项目
searchParam: {
name: "",
status: "",
pageNo: 1,
pageSize: 10
},
cmeBtnText: '',
currentRow: {},
optionStatus: [
{
value: 1,
label: "草稿"
},
{
value: 2,
label: "未上架"
},
{
value: 3,
label: "审核中/待审核"
},
{
value: 4,
label: "已上架"
},
{
value: 5,
label: "已下架"
},
{
value: 6,
label: "已拒绝/未上架"
},
{
value: 7,
label: "待初审"
},
{
value: 8,
label: "初审未通过"
},
{
value: 9,
label: "待复审"
},
{
value: 10,
label: "复审未通过"
},
{
value: 11,
label: "复审通过"
},
// 加上去 。。。。。。。CME
],
tableData: [],
totalRows: 0,
loading: true,
timingTime: "",
currentPage: 1,
formInline: {
projectName: "",
projectBegintime: "",
projectEndtime: "",
projectStatus: "",
pageNo: 1,
pageSize: 10
},
pickerOptions0: {
disabledDate: time => {
if (this.formInline.projectEndtime != "" && this.formInline.projectEndtime !=null) {
return (
time.getTime() >
new Date(this.formInline.projectEndtime).getTime()
);
}
}
},
pickerOptions1: {
disabledDate: time => {
return (
time.getTime() <
new Date(this.formInline.projectBegintime).getTime()
); //减去一天的时间代表可以选择同一天;
}
},
idType: '',
masterAdministratorFlag: false
};
},
computed: {
...mapGetters([
"_token",
// "idType",
// "masterAdministratorFlag"
])
},
created() {
vm = this;
vm.idType = localStorage.getItem('storageIdType');
vm.masterAdministratorFlag = localStorage.getItem('storageMaster');
console.log('idType:',vm.idType);
if(this.$route.query.pageNum){
this.formInline = {...this.$store.state.common.itemManager}
this.formInline.pageNo = parseInt(this.$route.query.pageNum)
}
this.$nextTick(function() {;
this.getProjectList();
});
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
...mapActions([
'updateItemManager'
]),
openProject() {
if(vm.masterAdministratorFlag == 'true') {
this.centerDialogVisible = true;
} else {
this.toPage();
}
},
toPage() {
this.$router.push("edit-manager?projectType=1");
},
toCmePage() {
console.log('跳转至 cme 新建项目');
this.$router.push("edit-cme?projectType=2");
},
toShield(row) {
this.$router.push("item-shield?projectId="+row.id);
},
handleTypeClose() {
this.centerDialogVisible = false;
this.newProjectType = 1;
},
handleCreateProject() {
if (this.newProjectType == 1) { // 1 普通项目 2 CME项目
this.toPage();
} else if (this.newProjectType == 2) {
this.toCmePage();
}
},
hanldeCmeClick(row) {
this.currentRow = row;
let status = row.projectStatus;
// 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过
if (status == 7 || status == 8) { // 按钮显示 初审
this.firstCheckVisible = true;
} else if (status == 9 || status == 10) { // 按钮显示 复审
this.secondCheckVisible = true;
} else if (status == 11) { // 按钮显示 发布
this.changeStatus(row,3)
}
},
handleCheckLeft() { // 左边通过
this.goToCheckAuth(1);
},
handleCheckRight() {
this.goToCheckAuth(2);
},
goToCheckAuth(refuse) {
let row = this.currentRow;
let req = {};
openLoading(vm);
// refuse = 1 : 同意 refuse = 2:拒绝
vm.GET(`portal/cme/verifyProject?projectId=${row.id}&refuse=${refuse}`, req).then(res => {
closeLoading(vm);
// debugger;
vm.firstCheckVisible = false;
vm.secondCheckVisible = false;
if (res.code == "000000") {
vm.getProjectList();
this.$message({
message: '审核成功',
type: 'success'
});
} else {
this.$message.error(res.message);
}
});
},
searchList() {
this.formInline.pageNo = 1;
this.getProjectList();
},
//查询项目列表
getProjectList() {
let req = {};
req = this.formInline;
openLoading(vm);
vm.GET("portal/portalInfo/getProjectList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.data;
//console.log(vm.tableData);
vm.totalRows = res.data.totalRows;
}
});
},
showCMEButton(row, type) {
// if(row.projectType == 2) {
// return true;
// } else {
// return false;
// }
// CME 专属状态码 为7~11,是这些代码的直接走新逻辑,别的走老逻辑
let cmeStatus = [7, 8, 9, 10, 11];
let currentStatus = parseInt(row.projectStatus);
if ( cmeStatus.indexOf(currentStatus) > -1 ) {
return true;
} else {
return false;
}
},
//按钮展示情况
showButton(row, type) {
// debugger;
// 按钮type类型: 0-编辑
// 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝
// 7- 提醒审核 8(2)-取消审核 9-删除
let projectStatus = row.projectStatus;
let idType = row.idType;
let level = row.level;
let flag = false;
let typeStr = parseInt(type);
//console.log("状态:"+projectStatus+ "等级:" + level + " 按钮类型:" + type);
//console.log('idType',idType);
let buttonStatus = "";
if (idType == 1) {
//内部项目
buttonStatus = returnData().buttonStatusIn;
} else {
//外部项目
buttonStatus = returnData().buttonStatusOut;
}
if(projectStatus == null) {
return false;
}
if (level != null) {
let tempStatus = JSON.parse(JSON.stringify(projectStatus));
if (tempStatus > 6) {
tempStatus = 1;
}
let statusSet = buttonStatus[tempStatus - 1][level];
let flagValue = statusSet.indexOf(typeStr);
if (flagValue >= 0) {
flag = true;
} else {
flag = false;
}
}
//flag = true;
return flag;
},
handleCmeOperate(status) {
let text = '';
// 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过
if (status == 7 || status == 8) { // 按钮显示 初审
text = '初审';
} else if (status == 9 || status == 10) { // 按钮显示 复审
text = '复审';
} else if (status == 11) { // 按钮显示 发布
text = '发布';
}
this.cmeBtnText = text;
return text;
// return true / false;
},
//改变状态
changeStatus(row, type) {
let projectId = row.id;
let level = row.level;
if (type === 0) {
this.updateItemManager(this.formInline)
//编辑
if(row.projectType === 1) {
this.$router.push("edit-manager?projectType=1&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo);
} else if(row.projectType === 2) {
this.$router.push("edit-cme?projectType=2&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo);
}
} else if (type === 7) {
//提醒审核
let req = {
portalProjectId: projectId,
warnType: 1
};
vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
vm.$message.info(res.message);
vm.getProjectList();
if (res.code == "000000") {
console.log(res);
//vm.getProjectList();
}
});
} else {
// if (type === 8) {
// //取消审批值对应2
// type = 2;
// let req = {
// portalProjectId: projectId,
// warnType: 5
// };
// vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
// vm.$message.info(res.message);
// if (res.code == "000000") {
// console.log(res);
// vm.getProjectList();
// }
// });
// }
// if (type == 4 || type == 6) {
// //发送消息
// let warnType = "";
// if (type == 4) {
// warnType = 3;
// } else if (type == 6) {
// warnType = 4;
// }
// let req = {
// portalProjectId: projectId,
// warnType: warnType
// };
// vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
// vm.$message.info(res.message);
// if (res.code == "000000") {
// console.log(res);
// vm.getProjectList();
// }
// });
// }
let req = {
projectId: projectId,
changeStatus: vm.getType(type)
};
vm.POST("portal/portalInfo/changeStatus", req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
console.log(res);
vm.getProjectList();
//changeStatus之后remindPortalCheck
if (type == 4 || type == 6 || type == 8) {
//发送消息
let warnType = "";
if (type == 4) {
warnType = 3;
} else if (type == 6) {
warnType = 4;
} else if (type == 8) {
warnType = 5;
}
let req = {
portalProjectId: projectId,
warnType: warnType
};
vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
vm.getProjectList();
}
});
}
}
});
}
},
getType(value) {
let data = value;
if(data == 8) {
data = 2;
}
return data;
},
//删除项目
delItem(row) {
let req = {};
console.log(row);
vm.DELETE("portal/portalInfo/delete/" + row.id, req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
console.log(res);
vm.getProjectList();
}
});
},
//重置表单
resetForm() {
vm.formInline = Object.assign(
{},
{
projectName: "",
projectBegintime: "",
projectEndtime: "",
projectStatus: "",
pageNo: 1,
pageSize: 10,
duringTime: ""
}
);
vm.getProjectList();
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.formInline.pageSize = val;
this.handleCurrentChange(this.searchParam.pageNo);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.formInline.pageNo = val;
this.getProjectList();
//需要判断是否检索
// if (!this.flag) {
// this.currentChangePage(this.tableDataEnd);
// } else {
// this.currentChangePage(this.filterTableDataEnd);
// }
}, //组件自带监控当前页码
currentChangePage(list) {
let from = (this.currentPage - 1) * this.pageSize;
let to = this.currentPage * this.pageSize;
this.tableDataEnd = [];
for (; from < to; from++) {
if (list[from]) {
this.tableDataEnd.push(list[from]);
}
}
},
addOrModifyNotice(row) {
this.$router.push("edit-notice?projectId=" + row.id);
}
}
};
</script>
<style lang="scss">
.item-manager-wrap {
.component-content {
background: #fff;
//margin-top: 88px;
padding: 10px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
// .table-option span {
// color: #409eff;
// }
.add-button {
float: right;
}
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
}
}
.el-tooltip__popper {
max-width:50%
}
</style>
...@@ -4,25 +4,13 @@ ...@@ -4,25 +4,13 @@
<div class="component-content screenSet" id="screenSet"> <div class="component-content screenSet" id="screenSet">
<div class="header-title">项目管理</div> <div class="header-title">项目管理</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;"> <el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;"> <el-form ref="formInline" :model="formInline" label-width="75px" style="min-width:1200px;">
<el-col :span="5"> <el-col style="width: 300px">
<el-form-item label="项目名称:"> <el-form-item label="项目名称:">
<el-input v-model="formInline.projectName" size="small" placeholder="请输入项目名称"></el-input> <el-input style="width: 192px;" v-model="formInline.projectName" size="small" placeholder="请输入项目名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="8"> <el-col style="width: 600px">
<el-form-item label="项目时间:">
<el-date-picker
v-model="formInline.duringTime"
size="small"
type="daterange"
start-placeholder="请选择开始时间"
end-placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</el-form-item>
</el-col>-->
<el-col :span="12">
<el-form-item label="项目时间:"> <el-form-item label="项目时间:">
<el-date-picker <el-date-picker
v-model="formInline.projectBegintime" v-model="formInline.projectBegintime"
...@@ -31,8 +19,7 @@ ...@@ -31,8 +19,7 @@
placeholder="请选择开始时间" placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0" :picker-options="pickerOptions0"
></el-date-picker> ></el-date-picker> ~
~
<el-date-picker <el-date-picker
v-model="formInline.projectEndtime" v-model="formInline.projectEndtime"
size="small" size="small"
...@@ -44,19 +31,6 @@ ...@@ -44,19 +31,6 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="4">
<el-form-item label="~">
<el-date-picker
v-model="formInline.projectEndtime"
size="small"
type="datetime"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions1"
default-time="23:59:59"
></el-date-picker>
</el-form-item>
</el-col> -->
<el-col :span="4" style="padding:0;text-align:right;padding-right:15px;"> <el-col :span="4" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="searchList">查询</el-button> <el-button type="primary" size="small" @click="searchList">查询</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button> <el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button>
...@@ -64,7 +38,7 @@ ...@@ -64,7 +38,7 @@
</el-form> </el-form>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="5"> <el-col style="width: 300px">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;"> <el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;">
<el-form-item label="发布状态:"> <el-form-item label="发布状态:">
<el-select size="small" v-model="formInline.projectStatus" placeholder="请选择发布状态"> <el-select size="small" v-model="formInline.projectStatus" placeholder="请选择发布状态">
...@@ -79,18 +53,28 @@ ...@@ -79,18 +53,28 @@
</el-form> </el-form>
</el-col> </el-col>
</el-row> </el-row>
<el-form v-if="isRoleOfOuter" :model="formInline" class="demo-form-inline">
<el-form-item> <el-form :model="formInline" class="demo-form-inline">
<el-button class="add-button" size="small" type="primary" @click="openProject()">新建项目</el-button> <el-form-item >
<el-button v-show="isRoleOfOuter && idType == 2"
class="add-button"
size="small"
type="primary"
@click="toEditCustomPage()"
>创建自定义项目</el-button>
<el-button v-show="isRoleOfOuter" class="add-button" size="small" type="primary" @click="openProject()">新建项目</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table class="item-table" :data="tableData" style="width: 100%"> <el-table class="item-table" :data="tableData" style="width: 100%">
<el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column> <el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="100" align="center"> <el-table-column prop="projectName" label="项目名称" min-width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span @click="previewTemplate(scope.row, 1)" style="color:rgb(2, 130, 132);cursor:pointer;" <span
v-if="scope.row.projectType == 3 @click="previewTemplate(scope.row, 1)"
&& (scope.row.level == 'L1' || scope.row.level == 'L2') ">{{scope.row.projectName}}</span> style="color:rgb(2, 130, 132);cursor:pointer;"
v-if="(scope.row.projectType == 3 || scope.row.projectType == 4)
&& (scope.row.level == 'L1' || scope.row.level == 'L2') "
>{{scope.row.projectName}}</span>
<span v-else>{{scope.row.projectName}}</span> <span v-else>{{scope.row.projectName}}</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -98,13 +82,6 @@ ...@@ -98,13 +82,6 @@
<el-table-column prop="projectLeader" label="项目负责人" align="center"></el-table-column> <el-table-column prop="projectLeader" label="项目负责人" align="center"></el-table-column>
<el-table-column prop="projectTypeValue" label="项目类型" align="center"></el-table-column> <el-table-column prop="projectTypeValue" label="项目类型" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" width="100" align="center"></el-table-column> <el-table-column prop="createdTime" label="创建时间" width="100" align="center"></el-table-column>
<!-- <el-table-column
prop="projectIntro"
label="项目简介"
align="center"
min-width="100"
show-overflow-tooltip
></el-table-column> -->
<el-table-column prop="projectBegintime" label="项目开始时间" min-width="90" align="center"></el-table-column> <el-table-column prop="projectBegintime" label="项目开始时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectEndtime" label="项目结束时间" min-width="90" align="center"></el-table-column> <el-table-column prop="projectEndtime" label="项目结束时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectStatus" label="状态" align="center"> <el-table-column prop="projectStatus" label="状态" align="center">
...@@ -188,23 +165,19 @@ ...@@ -188,23 +165,19 @@
type="primary" type="primary"
size="small" size="small"
>屏蔽</el-button> >屏蔽</el-button>
<!-- v-if="scope.row.level != 'L1'" --> <!-- v-if="scope.row.level != 'L1'" -->
<el-button <el-button
v-if="idType == 1" v-if="idType == 1"
@click="addOrModifyNotice(scope.row, 0)" @click="addOrModifyNotice(scope.row, 0)"
type="primary" type="primary"
size="small" size="small"
>发送通知</el-button> >发送通知</el-button>
<el-button <el-button @click="reviewReport(scope.row)" type="primary" size="small">查看学情报告</el-button>
@click="reviewReport(scope.row)"
type="primary"
size="small"
>查看学情报告</el-button>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty"> <div slot="empty">
<div class="table-empty"> <div class="table-empty">
<img src="../../assets/image/no-content1.png"> <img src="../../assets/image/no-content1.png" />
<p>没有查询到相关结果</p> <p>没有查询到相关结果</p>
</div> </div>
</div> </div>
...@@ -227,7 +200,8 @@ ...@@ -227,7 +200,8 @@
:visible.sync="firstCheckVisible" :visible.sync="firstCheckVisible"
width="600px" width="600px"
:close-on-click-modal="false" :close-on-click-modal="false"
center> center
>
<span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》初审结果为?` }}</span> <span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》初审结果为?` }}</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCheckLeft">通 过</el-button> <el-button type="primary" @click="handleCheckLeft">通 过</el-button>
...@@ -242,7 +216,8 @@ ...@@ -242,7 +216,8 @@
width="600px" width="600px"
:close-on-click-modal="false" :close-on-click-modal="false"
@close="handleTypeClose" @close="handleTypeClose"
center> center
>
<span style="margin: 0 20px;">项目类型:</span> <span style="margin: 0 20px;">项目类型:</span>
<el-radio-group v-model="newProjectType"> <el-radio-group v-model="newProjectType">
<el-radio :label="1">普通项目</el-radio> <el-radio :label="1">普通项目</el-radio>
...@@ -261,7 +236,8 @@ ...@@ -261,7 +236,8 @@
:visible.sync="secondCheckVisible" :visible.sync="secondCheckVisible"
width="600px" width="600px"
:close-on-click-modal="false" :close-on-click-modal="false"
center> center
>
<span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》复审结果为?` }}</span> <span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》复审结果为?` }}</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCheckLeft">通 过</el-button> <el-button type="primary" @click="handleCheckLeft">通 过</el-button>
...@@ -271,11 +247,12 @@ ...@@ -271,11 +247,12 @@
<!-- 删除 弹窗 --> <!-- 删除 弹窗 -->
<el-dialog <el-dialog
title="确认删除" title="确认删除"
:show-close=false :show-close="false"
:visible.sync="deleteVisible" :visible.sync="deleteVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
width="600px" width="600px"
center> center
>
<p style="text-align: center;">删除后将不可撤销,确认删除吗?</p> <p style="text-align: center;">删除后将不可撤销,确认删除吗?</p>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="confirmDelete">删 除</el-button> <el-button @click="confirmDelete">删 除</el-button>
...@@ -286,29 +263,29 @@ ...@@ -286,29 +263,29 @@
<!-- 修改状态 --> <!-- 修改状态 -->
<el-dialog <el-dialog
:title="changeStatusConfig.title" :title="changeStatusConfig.title"
:show-close=false :show-close="false"
:visible.sync="changeStatusVisible" :visible.sync="changeStatusVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
width="600px" width="600px"
center> center
>
<p style="text-align: center;">{{changeStatusConfig.message}}</p> <p style="text-align: center;">{{changeStatusConfig.message}}</p>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="changeStatusVisible=false">取 消</el-button> <el-button @click="changeStatusVisible=false">取 消</el-button>
<el-button type="primary" @click="changeStatusPre">确 认</el-button> <el-button type="primary" @click="changeStatusPre">确 认</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import BreadCrumb from "../../components/breadcrumb.vue"; import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain"; import { create } from "domain";
import { mapGetters,mapActions } from 'vuex' import { mapGetters, mapActions } from "vuex";
import { returnData } from "../../utils/mock"; import { returnData } from "../../utils/mock";
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils"; import * as commonUtil from "../../utils/utils";
import { setTimeout } from 'timers'; import { setTimeout } from "timers";
let vm = null; let vm = null;
export default { export default {
components: { components: {
...@@ -320,30 +297,30 @@ export default { ...@@ -320,30 +297,30 @@ export default {
currentRow: null, currentRow: null,
currentType: 4, currentType: 4,
changeStatusConfig: { changeStatusConfig: {
title: '确认通过该项目模版审核吗?', title: "确认通过该项目模版审核吗?",
message: '下架后,用户新建项目则无法看到该模版', message: "下架后,用户新建项目则无法看到该模版"
}, },
idValue: '', idValue: "",
curmbFirst: "教培项目", curmbFirst: "教培项目",
curmbSecond: "项目管理", curmbSecond: "项目管理",
centerDialogVisible: false, // 新建项目弹窗 centerDialogVisible: false, // 新建项目弹窗
firstCheckVisible: false, // 各种操作的确认弹窗 firstCheckVisible: false, // 各种操作的确认弹窗
secondCheckVisible: false, secondCheckVisible: false,
newProjectType: 1, // 1 普通项目 2 CME项目 newProjectType: 1, // 1 普通项目 2 CME项目
searchParam: { searchParam: {
name: "", name: "",
status: "", status: "",
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
}, },
cmeBtnText: '', cmeBtnText: "",
currentRow: {}, currentRow: {},
optionStatus: [ optionStatus: [
{ {
value: "", value: "",
label: "全部" label: "全部"
}, },
{ {
value: 1, value: 1,
label: "草稿" label: "草稿"
...@@ -387,9 +364,8 @@ export default { ...@@ -387,9 +364,8 @@ export default {
{ {
value: 11, value: 11,
label: "复审通过" label: "复审通过"
}, }
// 加上去 。。。。。。。CME // 加上去 。。。。。。。CME
], ],
tableData: [], tableData: [],
totalRows: 0, totalRows: 0,
...@@ -406,7 +382,10 @@ export default { ...@@ -406,7 +382,10 @@ export default {
}, },
pickerOptions0: { pickerOptions0: {
disabledDate: time => { disabledDate: time => {
if (this.formInline.projectEndtime != "" && this.formInline.projectEndtime !=null) { if (
this.formInline.projectEndtime != "" &&
this.formInline.projectEndtime != null
) {
return ( return (
time.getTime() > time.getTime() >
new Date(this.formInline.projectEndtime).getTime() new Date(this.formInline.projectEndtime).getTime()
...@@ -422,30 +401,30 @@ export default { ...@@ -422,30 +401,30 @@ export default {
); //减去一天的时间代表可以选择同一天; ); //减去一天的时间代表可以选择同一天;
} }
}, },
idType: '', idType: "",
deleteVisible: false, deleteVisible: false,
isRoleOfOuter: 0, isRoleOfOuter: 0
}; };
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
"_token", "_token"
// "idType", // "idType",
]) ])
}, },
created() { created() {
vm = this; vm = this;
vm.idType = localStorage.getItem('storageIdType'); vm.idType = localStorage.getItem("storageIdType");
vm.isRoleOfOuter = localStorage.getItem('isRoleOfOuter') - 0; vm.isRoleOfOuter = localStorage.getItem("isRoleOfOuter") - 0;
let pageSize = vm.formInline.pageSize; let pageSize = vm.formInline.pageSize;
console.log('idType:',vm.idType); console.log("idType:", vm.idType);
if(this.$route.query.pageNum){ if (this.$route.query.pageNum) {
this.formInline = {...this.$store.state.common.itemManager} this.formInline = { ...this.$store.state.common.itemManager };
this.formInline.pageNo = parseInt(this.$route.query.pageNum) this.formInline.pageNo = parseInt(this.$route.query.pageNum);
this.formInline.pageSize = pageSize; this.formInline.pageSize = pageSize;
} }
this.$nextTick(function() {; this.$nextTick(function() {
this.getProjectList(); this.getProjectList();
}); });
}, },
...@@ -454,26 +433,24 @@ export default { ...@@ -454,26 +433,24 @@ export default {
commonUtil.resizeHeight(); commonUtil.resizeHeight();
}, },
methods: { methods: {
...mapActions([ ...mapActions(["updateItemManager"]),
'updateItemManager'
]),
//跳转到报告详情页 //跳转到报告详情页
reviewReport(row) { reviewReport(row) {
let routerData = { let routerData = {
id: row.id, id: row.id,
projectName: row.projectName, projectName: row.projectName
}; };
vm.$router.push({ path: "/item-list" , query: routerData }); vm.$router.push({ path: "/item-list", query: routerData });
}, },
hideDeleteFrom() { hideDeleteFrom() {
this.deleteVisible = false; this.deleteVisible = false;
}, },
// 打开新建页面 // 打开新建页面
openProject() { openProject() {
if(vm.idType == 2) { if (vm.idType == 2) {
vm.toTemplatePage(); vm.toTemplatePage();
} else { } else {
this.centerDialogVisible = true; this.centerDialogVisible = true;
...@@ -484,29 +461,41 @@ export default { ...@@ -484,29 +461,41 @@ export default {
}, },
toCmePage(isPreview = 0) { toCmePage(isPreview = 0) {
this.$router.push("edit-cme?projectType=2&isPreview=" + isPreview); this.$router.push("edit-cme?projectType=2&isPreview=" + isPreview);
}, },
toTemplatePage(isPreview = 0) { toTemplatePage(isPreview = 0) {
this.$router.push("template-open?projectType=3&isPreview=" + isPreview); this.$router.push("template-open?projectType=3&isPreview=" + isPreview);
}, },
toEditCustomPage(isPreview = 0) {
this.$router.push("edit-custom?projectType=4&isPreview=" + isPreview);
},
toShield(row) { toShield(row) {
this.$router.push("item-shield?projectId="+row.id); this.$router.push("item-shield?projectId=" + row.id);
}, },
handleTypeClose() { handleTypeClose() {
this.centerDialogVisible = false; this.centerDialogVisible = false;
this.newProjectType = 1; this.newProjectType = 1;
}, },
handleCreateProject() { handleCreateProject() {
if (this.newProjectType == 1) { // 1 普通项目 2 CME项目 if (this.newProjectType == 1) {
// 1 普通项目 2 CME项目
this.toPage(); this.toPage();
} else if (this.newProjectType == 2) { } else if (this.newProjectType == 2) {
this.toCmePage(); this.toCmePage();
} else if(this.newProjectType == 3) { } else if (this.newProjectType == 3) {
this.toTemplatePage(); this.toTemplatePage();
} }
}, },
previewTemplate(row, isPreview) { previewTemplate(row, isPreview) {
this.$router.push(`template-open?projectId=${row.id}&projectType=3&isPreview=${isPreview}`); if (row.projectType == 3) {
this.$router.push(
`template-open?projectId=${row.id}&projectType=3&isPreview=${isPreview}`
);
} else if (row.projectType == 4) {
this.$router.push(
`edit-custom?projectId=${row.id}&projectType=3&isPreview=${isPreview}`
);
}
}, },
// handleCreateProject(isPreview) { // handleCreateProject(isPreview) {
...@@ -517,24 +506,28 @@ export default { ...@@ -517,24 +506,28 @@ export default {
// } else if(this.newProjectType == 3) { // } else if(this.newProjectType == 3) {
// this.toTemplatePage(isPreview); // this.toTemplatePage(isPreview);
// } // }
// }, // },
hanldeCmeClick(row) { hanldeCmeClick(row) {
this.currentRow = row; this.currentRow = row;
let status = row.projectStatus; let status = row.projectStatus;
// 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过 // 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过
if (status == 7 || status == 8) { // 按钮显示 初审 if (status == 7 || status == 8) {
// 按钮显示 初审
this.firstCheckVisible = true; this.firstCheckVisible = true;
} else if (status == 9 || status == 10) { // 按钮显示 复审 } else if (status == 9 || status == 10) {
// 按钮显示 复审
this.secondCheckVisible = true; this.secondCheckVisible = true;
} else if (status == 11) { // 按钮显示 发布 } else if (status == 11) {
this.changeStatus(row,3) // 按钮显示 发布
this.changeStatus(row, 3);
} }
}, },
handleCheckLeft() { // 左边通过 handleCheckLeft() {
// 左边通过
this.goToCheckAuth(1); this.goToCheckAuth(1);
}, },
handleCheckRight() { handleCheckRight() {
this.goToCheckAuth(2); this.goToCheckAuth(2);
}, },
goToCheckAuth(refuse) { goToCheckAuth(refuse) {
...@@ -542,7 +535,10 @@ export default { ...@@ -542,7 +535,10 @@ export default {
let req = {}; let req = {};
openLoading(vm); openLoading(vm);
// refuse = 1 : 同意 refuse = 2:拒绝 // refuse = 1 : 同意 refuse = 2:拒绝
vm.GET(`portal/cme/verifyProject?projectId=${row.id}&refuse=${refuse}`, req).then(res => { vm.GET(
`portal/cme/verifyProject?projectId=${row.id}&refuse=${refuse}`,
req
).then(res => {
closeLoading(vm); closeLoading(vm);
// debugger; // debugger;
vm.firstCheckVisible = false; vm.firstCheckVisible = false;
...@@ -550,12 +546,12 @@ export default { ...@@ -550,12 +546,12 @@ export default {
if (res.code == "000000") { if (res.code == "000000") {
vm.getProjectList(); vm.getProjectList();
this.$message({ this.$message({
message: '审核成功', message: "审核成功",
type: 'success' type: "success"
}); });
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
} }
}); });
}, },
searchList() { searchList() {
...@@ -566,8 +562,12 @@ export default { ...@@ -566,8 +562,12 @@ export default {
getProjectList() { getProjectList() {
let req = {}; let req = {};
req = this.formInline; req = this.formInline;
this.formInline.projectBegintime = !this.formInline.projectBegintime ? "" : this.formInline.projectBegintime; this.formInline.projectBegintime = !this.formInline.projectBegintime
this.formInline.projectEndtime = !this.formInline.projectEndtime ? "" : this.formInline.projectEndtime; ? ""
: this.formInline.projectBegintime;
this.formInline.projectEndtime = !this.formInline.projectEndtime
? ""
: this.formInline.projectEndtime;
openLoading(vm); openLoading(vm);
vm.GET("portal/portalInfo/getProjectList", req).then(res => { vm.GET("portal/portalInfo/getProjectList", req).then(res => {
closeLoading(vm); closeLoading(vm);
...@@ -587,15 +587,15 @@ export default { ...@@ -587,15 +587,15 @@ export default {
// CME 专属状态码 为7~11,是这些代码的直接走新逻辑,别的走老逻辑 // CME 专属状态码 为7~11,是这些代码的直接走新逻辑,别的走老逻辑
let cmeStatus = [7, 8, 9, 10, 11]; let cmeStatus = [7, 8, 9, 10, 11];
let currentStatus = parseInt(row.projectStatus); let currentStatus = parseInt(row.projectStatus);
if ( cmeStatus.indexOf(currentStatus) > -1 ) { if (cmeStatus.indexOf(currentStatus) > -1) {
return true; return true;
} else { } else {
return false; return false;
} }
}, },
//按钮展示情况 //按钮展示情况
showButton(row, type) { showButton(row, type) {
if(!row.isRoleOfOuter) return false; if (!row.isRoleOfOuter) return false;
// 按钮type类型: 0-编辑 // 按钮type类型: 0-编辑
// 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝 // 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝
// 7- 提醒审核 8(2)-取消审核 9-删除 // 7- 提醒审核 8(2)-取消审核 9-删除
...@@ -612,7 +612,7 @@ export default { ...@@ -612,7 +612,7 @@ export default {
//外部项目 //外部项目
buttonStatus = returnData().buttonStatusOut; buttonStatus = returnData().buttonStatusOut;
} }
if(projectStatus == null) { if (projectStatus == null) {
return false; return false;
} }
if (level != null) { if (level != null) {
...@@ -629,24 +629,30 @@ export default { ...@@ -629,24 +629,30 @@ export default {
} }
} }
// 添加新的判断逻辑 // 添加新的判断逻辑
if(flag && type == 0) { if (flag && type == 0) {
return (row.level == 'L1' && row.idType == 1) || (row.level == 'L2' && row.idType == 2) return (
(row.level == "L1" && row.idType == 1) ||
(row.level == "L2" && row.idType == 2)
);
} }
return flag; return flag;
}, },
handleCmeOperate(status) { handleCmeOperate(status) {
let text = ''; let text = "";
// 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过 // 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过
if (status == 7 || status == 8) { // 按钮显示 初审 if (status == 7 || status == 8) {
text = '初审'; // 按钮显示 初审
} else if (status == 9 || status == 10) { // 按钮显示 复审 text = "初审";
text = '复审'; } else if (status == 9 || status == 10) {
} else if (status == 11) { // 按钮显示 发布 // 按钮显示 复审
text = '发布'; text = "复审";
} else if (status == 11) {
// 按钮显示 发布
text = "发布";
} }
this.cmeBtnText = text; this.cmeBtnText = text;
return text; return text;
// return true / false; // return true / false;
}, },
changeStatusPre() { changeStatusPre() {
...@@ -654,16 +660,17 @@ export default { ...@@ -654,16 +660,17 @@ export default {
this.changeStatusVisible = false; this.changeStatusVisible = false;
}, },
// //
changeStatusForSP(row, type) { changeStatusForSP(row, type) {
this.currentRow = row; this.currentRow = row;
this.currentType = type; this.currentType = type;
if(type == 4) { if (type == 4) {
this.changeStatusConfig.title = '确认通过该项目审核吗?'; this.changeStatusConfig.title = "确认通过该项目审核吗?";
this.changeStatusConfig.message = '审核通过后,该项目范围内的学员可在云鹊医App进行培训学习'; this.changeStatusConfig.message =
} else if(type == 6) { "审核通过后,该项目范围内的学员可在云鹊医App进行培训学习";
this.changeStatusConfig.title = '确认要拒绝该项目吗?'; } else if (type == 6) {
this.changeStatusConfig.message = '拒绝后该项目将从列表中消失'; this.changeStatusConfig.title = "确认要拒绝该项目吗?";
this.changeStatusConfig.message = "";
} }
this.changeStatusVisible = true; this.changeStatusVisible = true;
}, },
...@@ -673,14 +680,41 @@ export default { ...@@ -673,14 +680,41 @@ export default {
let projectId = row.id; let projectId = row.id;
let level = row.level; let level = row.level;
if (type === 0) { if (type === 0) {
this.updateItemManager(this.formInline) this.updateItemManager(this.formInline);
//编辑 //编辑
if(row.projectType === 1) { if (row.projectType === 1) {
this.$router.push("edit-manager?projectType=1&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo); this.$router.push(
} else if(row.projectType === 2) { "edit-manager?projectType=1&projectId=" +
this.$router.push("edit-cme?projectType=2&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo); projectId +
} else if(row.projectType === 3) { "&level=" +
this.$router.push("template-open?projectType=3&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo); level +
"&pageNum=" +
this.formInline.pageNo
);
} else if (row.projectType === 2) {
this.$router.push(
"edit-cme?projectType=2&projectId=" +
projectId +
"&level=" +
level +
"&pageNum=" +
this.formInline.pageNo
);
} else if (row.projectType === 3) {
this.$router.push(
"template-open?projectType=3&projectId=" +
projectId +
"&level=" +
level +
"&pageNum=" +
this.formInline.pageNo
);
} else if (row.projectType === 4) {
this.$router.push(
"edit-custom?projectType=4&projectId=" +
projectId + "&level=" + level + "&pageNum=" + this.formInline.pageNo +
"&projectStatus=" + row.projectStatus
);
} }
} else if (type === 7) { } else if (type === 7) {
//提醒审核 //提醒审核
...@@ -737,13 +771,13 @@ export default { ...@@ -737,13 +771,13 @@ export default {
}, },
getType(value) { getType(value) {
let data = value; let data = value;
if(data == 8) { if (data == 8) {
data = 2; data = 2;
} }
return data; return data;
}, },
delItem(row) { delItem(row) {
this.deleteVisible = true this.deleteVisible = true;
this.currentRow = row; this.currentRow = row;
}, },
hideDeleteFrom() { hideDeleteFrom() {
...@@ -752,13 +786,15 @@ export default { ...@@ -752,13 +786,15 @@ export default {
// 删除项目 // 删除项目
confirmDelete() { confirmDelete() {
let req = {}; let req = {};
vm.DELETE("portal/portalInfo/delete/" + this.currentRow.id, req).then(res => { vm.DELETE("portal/portalInfo/delete/" + this.currentRow.id, req).then(
vm.$message.info(res.message); res => {
if (res.code == "000000") { vm.$message.info(res.message);
this.deleteVisible = false; if (res.code == "000000") {
vm.getProjectList(); this.deleteVisible = false;
vm.getProjectList();
}
} }
}); );
}, },
// 重置表单 // 重置表单
resetForm() { resetForm() {
...@@ -815,7 +851,6 @@ export default { ...@@ -815,7 +851,6 @@ export default {
.item-manager-wrap { .item-manager-wrap {
.component-content { .component-content {
background: #fff; background: #fff;
//margin-top: 88px;
padding: 10px; padding: 10px;
.header-title { .header-title {
padding: 10px 12px; padding: 10px 12px;
...@@ -823,11 +858,12 @@ export default { ...@@ -823,11 +858,12 @@ export default {
color: #449284; color: #449284;
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
} }
// .table-option span { .demo-form-inline {
// color: #409eff; margin-right: 20px;
// } .add-button {
.add-button { float: right;
float: right; margin-right: 10px;
}
} }
.table-empty { .table-empty {
img { img {
...@@ -840,6 +876,6 @@ export default { ...@@ -840,6 +876,6 @@ export default {
} }
} }
.el-tooltip__popper { .el-tooltip__popper {
max-width:50% max-width: 50%;
} }
</style> </style>
<template>
<div class="home-wrap">
<bread-crumb :curmbFirst="curmbFirst"></bread-crumb>
<div class="message-content">
<el-row>
<el-col class="visitor screenSet" :span="24">
<div class="visitor-title">
<div class="title">
今日履约:
<span style="color:#449284;margin-right: 10px">{{todayPlansList.length}}</span>
<span
class="type-button"
:style="{background:(planBtn?'rgba(68,146,132,0.06)':'#ffffff')}"
@click="changeTodayPlansList(0)"
>未完成</span>
<span
class="type-button"
:style="{background:(!planBtn?'rgba(68,146,132,0.06)':'#ffffff')}"
@click="changeTodayPlansList(1)"
>已过期</span>
</div>
<span class="visitor-more" @click="lookMore(1)">查看更多</span>
</div>
<div class="visitor-info">
<el-table :data="todayPlansList" style="width: 100%">
<el-table-column prop="patientName" label="姓名" align="center"></el-table-column>
<el-table-column prop="appointTime" label="预约时间" align="center"></el-table-column>
<el-table-column prop="fuTypeStr" label="履约方式" align="center"></el-table-column>
<el-table-column prop="content" label="操作" align="center">
<template slot-scope="scope">
<span class="text-btn" @click="goToScale(scope.row)">履约录入</span> |
<span class="text-btn" @click="changeFollowStatus(scope.row)">变更履约状态</span>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
<el-col class="visitor screenSet" :span="24" style="margin-top: 0;margin-bottom: 0;">
<div class="visitor-title">
<div class="title">
今日预约
<span
class="type-button"
:style="{background:(appointBtn?'rgba(68,146,132,0.06)':'#ffffff')}"
@click="changeTodayAppointsList(0)"
style="margin-left: 10px;"
>未完成</span>
<span
class="type-button"
:style="{background:(!appointBtn?'rgba(68,146,132,0.06)':'#ffffff')}"
@click="changeTodayAppointsList(1)"
>已过期</span>
</div>
<span class="visitor-more" @click="lookMore(2)">查看更多</span>
</div>
<div class="visitor-info">
<el-table :data="todayAppointsList" style="width: 100%">
<el-table-column prop="planName" label="履约计划名称" align="center"></el-table-column>
<el-table-column prop="appointTime" label="履约计划时间" align="center"></el-table-column>
<el-table-column prop="appointedCount" label="已经预约" align="center"></el-table-column>
<el-table-column prop="notAppointedCount" label="未预约" align="center"></el-table-column>
<el-table-column prop="content" label="操作" align="center">
<template slot-scope="scope">
<span
class="text-btn"
@click="goToReservation(scope.row.planName, scope.row.appointTime)"
>去预约</span>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
<el-col class="message screenSet" :span="24" id="screenSet">
<div class="message-title">
系统消息
<span>今日消息:{{count}}条</span>
</div>
<div class="message-info" v-if="messageList.length > 0">
<div class="message-item" v-for="(item,index) in messageList" :key="index">
<div class="text-top">
<img :src="item.url" />
<span>{{item.menuName}}</span>
<span>{{item.portalTime}}</span>
</div>
<div class="text-bottom" v-html="item.content"></div>
</div>
</div>
<div class="no-message" v-else>
<div>
<img src="../assets/image/noData.png" />
</div>
</div>
</el-col>
</el-row>
</div>
<change-followup-status
:isShowChangeDialog="isShowChangeDialog"
:statusForm="statusForm"
@closeChangeStatus="closeChangeStatus()"
></change-followup-status>
<el-dialog
title="选择量表"
:visible.sync="selectFormShow"
center
:close-on-click-modal="false"
:close-on-press-escape="false"
width="400px"
:before-close="closeForm"
>
<div class="list-content">
<p
v-for="(item, index) in formList.scalesList"
:key="index"
@click="goFormView(item)"
>{{item.sendContent}}</p>
</div>
</el-dialog>
<!-- 敏感词及协议校验 -->
<el-dialog class="prot-dialog" title="" :visible.sync="isShowProtocolDialog" width="30%" center :show-close=false>
<p class="prot-dialog-tips-1">由于该居民尚未同意《云鹊平台隐私协议》,将导致履约量表部分信息无法录入,为了方便您的工作开展,请您发送短信提醒居民完成授权</p>
<p v-show="!isSentedProt" class="prot-dialog-tips-2">若您选择暂不发送,您只能录入量表的非敏感信息</p>
<p v-show="isSentedProt" class="prot-dialog-tips-3">为避免打扰居民,7天内只能发送1次,您已发送过短信,请尽快联系居民同意授权</p>
<span v-show="!isSentedProt" slot="footer" class="dialog-footer">
<el-button size="small" @click="closeProtocolDialog"> 暂不发送 </el-button>
<el-button size="small" type="primary" @click="sendMsg"> 发送短信 </el-button>
</span>
<span v-show="isSentedProt" slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="closeProtocolDialog"> 我知道了 </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import BreadCrumb from "../components/breadcrumb.vue";
import { setTimeout, setInterval } from "timers";
import ChangeFollowupStatus from "./followup/record-manage/dialog/change-followup-status";
import { mapGetters, mapState, mapActions } from "vuex";
import * as commonUtil from "../utils/utils";
import { uniteValidate, authMessage } from '@/utils/followup/followapis'
let vm = null;
export default {
components: {
BreadCrumb,
ChangeFollowupStatus
},
data() {
return {
curmbFirst: "数据总览",
spanFirstNum: 12,
spanSecondNum: 12,
tableData: [],
count: 0,
messageList: [],
planBtn: true,
appointBtn: true,
isShowChangeDialog: false,
statusForm: {},
selectFormShow: false,
ScaleData: {},
isShowProtocolDialog: true,
scaleQuery: {},
isSentedProt: false,
scaleNo: '',
patientIds: [],
sendMsgPatientIds: [],
};
},
created() {
vm = this;
vm.getSystemData();
vm.getTodayPlansList({
status: 0
});
vm.getTodayAppointsList({
status: 0
});
/*vm.getTodayOverview({
status:0
});*/
},
computed: {
...mapGetters(["_token"]),
...mapState("workbench", {
todayPlansList: state => state.todayPlansList,
todayAppointsList: state => state.todayAppointsList
//todayOverview: state => state.todayOverview,
}),
...mapState("recordManage", {
formList: state => state.formList
})
},
// 挂载到Dom完成时
mounted: function() {
// commonUtil.resizeHeight()
},
methods: {
...mapActions("workbench", [
"getTodayPlansList",
"getTodayAppointsList",
"getTodayOverview"
]),
...mapActions("recordManage", ["getFormList"]),
// 查看更多
lookMore(type) {
if (type == 1) {
this.$router.push("/followup/record-manage/record-list");
} else if (type == 2) {
this.$router.push("/followup/reservation-manage/reservation-list");
}
},
// 获取系统消息数据
getSystemData() {
vm.GET("portal/portalMessage/queryPortalMessageInfo", {
token: vm._token,
pageNo: 1,
pageSize: 15
}).then(res => {
if (res.code == "000000") {
vm.messageList = res.data.portalMessageModels;
vm.count = res.data.count;
} else {
vm.$message.info(res.message);
}
});
},
changeTodayPlansList(status) {
if (status == 0) {
vm.planBtn = true;
} else {
vm.planBtn = false;
}
vm.getTodayPlansList({
status: status
});
},
changeTodayAppointsList(status) {
if (status == 0) {
vm.appointBtn = true;
} else {
vm.appointBtn = false;
}
vm.getTodayAppointsList({
status: status
});
},
goToReservation(planName, appointTime) {
this.$router.push({
path: "/followup/reservation-manage/reservation-list",
query: { planName: planName, appointTime: appointTime, status: 1 }
});
},
closeChangeStatus(val) {
this.isShowChangeDialog = val;
let status = null;
if (this.planBtn == true) {
status = 0;
} else {
status = 1;
}
this.getTodayPlansList({
status: status
});
},
goFormView(item) {
this.selectFormShow = false;
this.$router.push({
path: "/followup/record-manage/form-template",
query: {
doctorId: this.ScaleData.doctorId,
scaleNo: item.resourceId,
planPatientsTimesId: this.ScaleData.planPatientsTimesId,
planTimesId: item.planTimesId,
showBtn: 1
}
});
// this.scaleQuery = {
// doctorId: this.ScaleData.doctorId,
// scaleNo: item.resourceId,
// planPatientsTimesId: this.ScaleData.planPatientsTimesId,
// planTimesId: item.planTimesId,
// showBtn: 1
// }
// this.needSign()
// this.scaleNo = this.formList.scalesList[0].resourceId;
// this.patientIds = [row.patientId];
// this.uniteValidateAction()
},
closeForm() {
this.selectFormShow = false;
},
async goToScale(row) {
await this.getFormList(row.planTimesId); //获取量表列表
//获取量表列表情况
if (this.formList.scalesList.length > 1) {
this.selectFormShow = true;
this.ScaleData = {
doctorId: this.formList.doctorId,
planPatientsTimesId: row.planPatientTimesId
};
} else if (this.formList.scalesList.length === 1) {
this.$router.push({
path: "/followup/record-manage/form-template",
query: {
doctorId: this.formList.doctorId,
scaleNo: this.formList.scalesList[0].resourceId,
planPatientsTimesId: row.planPatientTimesId,
planTimesId: row.planTimesId,
showBtn: 1
}
});
// this.scaleQuery = {
// doctorId: this.formList.doctorId,
// scaleNo: this.formList.scalesList[0].resourceId,
// planPatientsTimesId: row.planPatientTimesId,
// planTimesId: row.planTimesId,
// showBtn: 1
// }
// this.needSign()
// this.scaleNo = this.formList.scalesList[0].resourceId;
// this.patientIds = [row.patientId];
// this.uniteValidateAction()
} else {
this.$message.warning("暂无量表!");
}
},
changeFollowStatus(row) {
this.statusForm = {
fuPlanPatientTimesId: row.planPatientTimesId,
patientId: row.patientId,
nickname: row.patientName,
status: 1
};
this.isShowChangeDialog = true;
},
// Add by Anndy Yang
// 统一验证:量表内是否存在敏感字段、居民是否签署隐私协议、7天内是否发送过授权短信
async uniteValidateAction() {
let validParams = {
scaleNo: this.scaleNo,
patientIds: this.patientIds, // pc端只传这个字段
// planPatientsTimesId: planPatientsTimesId, // app端只传这个字段
protocolType: 5,
userType: 1,
validateType: 1
};
let r = await uniteValidate(validParams).then(res => {
let result = res;
// 请求成功
if (result.code === '000000') {
let levelType = result.data.levelType;
// 没有敏感字段或者居民已经签订过协议,则直接返回
if (levelType === 1 || levelType === 2) {
jumpToScale()
} else if (levelType === 3) {
this.isShowProtocolDialog = true;
this.isSentedProt = false;
} else if (levelType === 4) {
this.isShowProtocolDialog = true;
this.isSentedProt = true;
this.sendMsgPatientIds = result.data.ids;
}
}
});
},
// 发送协议授权短信给居民
sendMsgToPatients() {
authMessage({ patientIds: this.sendMsgPatientIds }).then(res => {
if (res.code === '000000') {
this.$message({
message: '已发送,请尽快联系居民同意授权',
type: 'success'
});
}
});
this.isShowDialog = false;
},
// 敏感词校验与签署协议逻辑
// 1. 判断量表内是否存在敏感词
// 2. 判断居民是否存签署协议
// 3. 七天内是否发送过
needSign(scaleId, query) {
// let statusConfig =await getStatusByScaleId(scaleId)
let statusConfig = {
isSensitive: 1, // 量表内是否存在敏感词 0: 否;1: 是
hasProtocol: 0, // 居民是否存签署协议 0: 否;1: 是
hasSented: 0 // 七天内是否发送过 0: 否;1: 是
};
if (statusConfig.isSensitive == 1 && statusConfig.hasProtocol == 0) {
this.isShowProtocolDialog = true
this.isSentedProt = statusConfig.hasSented == 1
} else {
this.jumpToScale()
}
},
// 统一跳转到量表页面
jumpToScale() {
// this.$router.push({
// path: "/followup/record-manage/form-template",
// query: this.scaleQuery
// });
},
// 关闭协议确认窗口
closeProtocolDialog() {
this.isShowProtocolDialog = false
this.jumpToScale()
},
// 发送短信通知
sendMsg() {
this.sendMsgToPatients();
this.closeProtocolDialog()
},
}
};
</script>
<style lang="scss">
.home-wrap {
.list-content {
p {
cursor: pointer;
line-height: 30px;
text-decoration: underline;
color: #449284;
}
}
.message-content {
.visitor {
padding: 0 25px 30px;
margin-bottom: 20px;
background: #fff;
margin-top: 88px;
// min-height: 348px;
@media screen and (min-width: 1240px) and (max-width: 1900px) {
width: 95%;
height: 300px !important;
}
@media screen and (min-width: 1900px) {
width: 96.7%;
height: 380px !important;
}
.visitor-title {
height: 80px;
line-height: 80px;
margin-right: 20px;
text-align: right;
.title {
float: left;
font-size: 20px;
}
.visitor-more {
font-size: 12px;
color: #449284;
border: 1px solid rgba(68, 146, 132, 0.3);
padding: 5px 14px;
border-radius: 3px;
background: rgba(68, 146, 132, 0.06);
cursor: pointer;
}
.type-button {
font-size: 12px;
color: #449284;
border: 1px solid rgba(68, 146, 132, 0.3);
padding: 5px 14px;
border-radius: 3px;
/*background: rgba(68,146,132,0.06);*/
background: #ffffff;
cursor: pointer;
}
}
.visitor-info {
margin-right: 20px;
.text-btn:hover {
cursor: pointer;
color: #449284;
}
}
}
.message {
padding: 0 25px 30px;
// margin-top: 20px;
margin-top: 20px;
background: #fff;
@media screen and (min-width: 1240px) and (max-width: 1900px) {
width: 95%;
// height: 320px !important;
}
@media screen and (min-width: 1900px) {
width: 96.7%;
// height: 400px !important;
}
.message-title {
font-size: 20px;
height: 80px;
line-height: 80px;
span {
font-size: 14px;
color: #717377;
margin-left: 8px;
}
}
.message-info {
padding: 7px;
.message-item {
padding: 10px 10px 15px;
border-bottom: 1px solid #ebeef5;
.text-top {
img {
float: left;
width: 16px;
margin-top: 3px;
}
span:nth-child(2) {
padding: 10px;
}
span:nth-child(3) {
font-size: 12px;
color: #999;
}
}
.text-bottom {
font-size: 14px;
color: #666;
margin-top: 15px;
}
}
}
}
.no-message {
text-align: center;
img {
width: 100px;
// margin-top: 17%;
margin: 6% 0 6%;
}
}
}
}
</style>
<template>
<div class="home-wrap">
<bread-crumb :curmbFirst="curmbFirst"></bread-crumb>
<div class="message-content">
<el-row>
<el-col class="visitor screenSet" :span="24">
<div class="visitor-title">
<div class="title">今日履约:
<span style="color:#449284;margin-right: 10px">{{todayPlansList.length}}</span>
<span class="type-button" :style="{background:(planBtn?'rgba(68,146,132,0.06)':'#ffffff')}" @click="changeTodayPlansList(0)">未完成</span>
<span class="type-button" :style="{background:(!planBtn?'rgba(68,146,132,0.06)':'#ffffff')}" @click="changeTodayPlansList(1)">已过期</span>
</div>
<span class="visitor-more" @click="lookMore(1)">查看更多</span>
</div>
<div class="visitor-info">
<el-table
:data="todayPlansList"
style="width: 100%">
<el-table-column prop="patientName" label="姓名" align="center"></el-table-column>
<el-table-column prop="appointTime" label="预约时间" align="center"></el-table-column>
<el-table-column prop="fuTypeStr" label="履约方式" align="center"></el-table-column>
<el-table-column prop="content" label="操作" align="center">
<template slot-scope="scope">
<span class="text-btn" @click="goToScale(scope.row)">履约录入</span> | <span class="text-btn" @click="changeFollowStatus(scope.row)">变更履约状态</span>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
<el-col class="visitor screenSet" :span="24" style="margin-top: 0;margin-bottom: 0;">
<div class="visitor-title">
<div class="title">今日预约
<span class="type-button" :style="{background:(appointBtn?'rgba(68,146,132,0.06)':'#ffffff')}" @click="changeTodayAppointsList(0)" style="margin-left: 10px;">未完成</span>
<span class="type-button" :style="{background:(!appointBtn?'rgba(68,146,132,0.06)':'#ffffff')}" @click="changeTodayAppointsList(1)" >已过期</span>
</div>
<span class="visitor-more" @click="lookMore(2)">查看更多</span>
</div>
<div class="visitor-info">
<el-table
:data="todayAppointsList"
style="width: 100%">
<el-table-column prop="planName" label="履约计划名称" align="center"></el-table-column>
<el-table-column prop="appointTime" label="履约计划时间" align="center"></el-table-column>
<el-table-column prop="appointedCount" label="已经预约" align="center"></el-table-column>
<el-table-column prop="notAppointedCount" label="未预约" align="center"></el-table-column>
<el-table-column prop="content" label="操作" align="center">
<template slot-scope="scope">
<span class="text-btn" @click="goToReservation(scope.row.planName, scope.row.appointTime)">去预约</span>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
<el-col class="message screenSet" :span="24" id="screenSet">
<div class="message-title">系统消息 <span>今日消息:{{count}}条</span></div>
<div class="message-info" v-if="messageList.length > 0">
<div class="message-item" v-for="(item,index) in messageList" :key="index">
<div class="text-top">
<img :src="item.url"/>
<span>{{item.menuName}}</span>
<span>{{item.portalTime}}</span>
</div>
<div class="text-bottom" v-html="item.content"></div>
</div>
</div>
<div class="no-message" v-else>
<div>
<img src="../assets/image/noData.png"/>
</div>
</div>
</el-col>
</el-row>
</div>
<change-followup-status :isShowChangeDialog="isShowChangeDialog" :statusForm="statusForm" @closeChangeStatus="closeChangeStatus()"></change-followup-status>
<el-dialog title="选择量表"
:visible.sync="selectFormShow"
center
:close-on-click-modal="false"
:close-on-press-escape="false"
width="400px"
:before-close="closeForm">
<div class="list-content">
<p v-for="(item, index) in formList.scalesList" :key="index" @click="goFormView(item)">{{item.sendContent}}</p>
</div>
</el-dialog>
</div>
</template>
<script>
import BreadCrumb from '../components/breadcrumb.vue'
import { setTimeout, setInterval } from 'timers'
import ChangeFollowupStatus from "./followup/record-manage/dialog/change-followup-status";
import { mapGetters, mapState, mapActions } from 'vuex'
import * as commonUtil from '../utils/utils'
let vm = null
export default {
components: {
BreadCrumb,
ChangeFollowupStatus
},
data() {
return {
curmbFirst: '数据总览',
spanFirstNum: 12,
spanSecondNum: 12,
tableData: [],
count: 0,
messageList:[],
planBtn: true,
appointBtn: true,
isShowChangeDialog: false,
statusForm: {},
selectFormShow: false,
ScaleData: {}
}
},
created() {
vm = this
vm.getSystemData()
vm.getTodayPlansList({
status:0
});
vm.getTodayAppointsList({
status:0
});
/*vm.getTodayOverview({
status:0
});*/
},
computed: {
...mapGetters([
'_token'
]),
...mapState('workbench', {
todayPlansList: state => state.todayPlansList,
todayAppointsList: state => state.todayAppointsList,
//todayOverview: state => state.todayOverview,
}),
...mapState('recordManage',{
formList: state => state.formList,
}),
},
// 挂载到Dom完成时
mounted: function() {
// commonUtil.resizeHeight()
},
methods: {
...mapActions('workbench', ['getTodayPlansList', 'getTodayAppointsList', 'getTodayOverview']),
...mapActions('recordManage', ['getFormList']),
// 查看更多
lookMore(type) {
if(type==1) {
this.$router.push('/followup/record-manage/record-list');
} else if(type == 2) {
this.$router.push('/followup/reservation-manage/reservation-list');
}
},
// 获取系统消息数据
getSystemData() {
vm.GET('portal/portalMessage/queryPortalMessageInfo',{token: vm._token, pageNo: 1, pageSize: 15}).then((res) => {
if( res.code == '000000') {
vm.messageList = res.data.portalMessageModels
vm.count = res.data.count
} else {
vm.$message.info(res.message)
}
})
},
changeTodayPlansList(status) {
if(status == 0) {
vm.planBtn = true
} else {
vm.planBtn = false
}
vm.getTodayPlansList({
status: status
});
},
changeTodayAppointsList(status) {
if(status == 0) {
vm.appointBtn = true
} else {
vm.appointBtn = false
}
vm.getTodayAppointsList({
status: status
});
},
goToReservation(planName, appointTime) {
this.$router.push({path: '/followup/reservation-manage/reservation-list', query: {planName: planName, appointTime:appointTime, status: 1}});
},
closeChangeStatus(val){
this.isShowChangeDialog = val;
let status = null
if(this.planBtn == true) {
status = 0
} else {
status = 1
}
this.getTodayPlansList({
status: status
})
},
goFormView(item) {
this.selectFormShow = false
this.$router.push({path: '/followup/record-manage/form-template',
query: {doctorId: this.ScaleData.doctorId, scaleNo: item.resourceId, planPatientsTimesId: this.ScaleData.planPatientsTimesId,planTimesId : item.planTimesId, showBtn: 1}});
},
closeForm() {
this.selectFormShow = false;
},
async goToScale(row) {
await this.getFormList(row.planTimesId); //获取量表列表
//获取量表列表情况
if(this.formList.scalesList.length > 1){
this.selectFormShow = true
this.ScaleData = {
doctorId: this.formList.doctorId,
planPatientsTimesId: row.planPatientTimesId
}
}else if(this.formList.scalesList.length === 1){
this.$router.push({path: '/followup/record-manage/form-template',
query: {doctorId: this.formList.doctorId, scaleNo: this.formList.scalesList[0].resourceId, planPatientsTimesId: row.planPatientTimesId,planTimesId : row.planTimesId, showBtn: 1}})
}else {
this.$message.warning('暂无量表!')
}
},
changeFollowStatus(row) {
this.statusForm = {
fuPlanPatientTimesId: row.planPatientTimesId,
patientId: row.patientId,
nickname: row.patientName,
status: 1,
}
this.isShowChangeDialog = true
}
}
}
</script>
<style lang="scss">
.home-wrap {
.list-content{
p{
cursor: pointer;
line-height: 30px;
text-decoration: underline;
color: #449284;
}
}
.message-content {
.visitor {
padding: 0 25px 30px;
margin-bottom: 20px;
background: #fff;
margin-top: 88px;
// min-height: 348px;
@media screen and (min-width:1240px) and (max-width:1900px) {
width: 95%;
height: 300px !important;
}
@media screen and (min-width:1900px) {
width: 96.7%;
height: 380px !important;
}
.visitor-title {
height: 80px;
line-height: 80px;
margin-right: 20px;
text-align: right;
.title {
float: left;
font-size: 20px;
}
.visitor-more {
font-size: 12px;
color: #449284;
border: 1px solid rgba(68,146,132,0.3);
padding: 5px 14px;
border-radius: 3px;
background: rgba(68,146,132,0.06);
cursor: pointer;
}
.type-button {
font-size: 12px;
color: #449284;
border: 1px solid rgba(68,146,132,0.3);
padding: 5px 14px;
border-radius: 3px;
/*background: rgba(68,146,132,0.06);*/
background: #ffffff;
cursor: pointer;
}
}
.visitor-info {
margin-right: 20px;
.text-btn:hover {
cursor: pointer;
color: #449284;
}
}
}
.message {
padding: 0 25px 30px;
/*margin-top: 20px;*/
margin-top: 90px;
background: #fff;
@media screen and (min-width:1240px) and (max-width:1900px) {
width: 95%;
// height: 320px !important;
}
@media screen and (min-width:1900px) {
width: 96.7%;
// height: 400px !important;
}
.message-title {
font-size: 20px;
height: 80px;
line-height: 80px;
span {
font-size: 14px;
color: #717377;
margin-left: 8px;
}
}
.message-info {
padding: 7px;
.message-item {
padding: 10px 10px 15px;
border-bottom: 1px solid #EBEEF5;
.text-top {
img {
float: left;
width: 16px;
margin-top: 3px;
}
span:nth-child(2) {
padding: 10px;
}
span:nth-child(3) {
font-size: 12px;
color: #999;
}
}
.text-bottom {
font-size: 14px;
color: #666;
margin-top: 15px;
}
}
}
}
.no-message {
text-align: center;
img {
width: 100px;
// margin-top: 17%;
margin: 6% 0 6%;
}
}
}
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册