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

新需求迭代

上级 707cfeaf
...@@ -56,7 +56,7 @@ service.interceptors.request.use(config => { ...@@ -56,7 +56,7 @@ service.interceptors.request.use(config => {
// console.log('环境变量>>>> ', process.env.BUILD_ENV); // console.log('环境变量>>>> ', process.env.BUILD_ENV);
// config.headers['token'] = 'BFD804F3A3194FBBBE113962222839F6'; // config.headers['token'] = 'BFD804F3A3194FBBBE113962222839F6';
// config.headers['token'] = 'F8209898391C40A0B8DBC1ED9E157291'; // config.headers['token'] = 'F8209898391C40A0B8DBC1ED9E157291';
config.headers['token'] = '2E46B77D801C479DBA1C550CE70D348F'; config.headers['token'] = '3167CD6495A14C14AEF28AB99F69984D';
}else{ }else{
config.headers['token'] = localStorage.getItem('storageToken') config.headers['token'] = localStorage.getItem('storageToken')
} }
......
...@@ -10,10 +10,10 @@ export const envConfig = { ...@@ -10,10 +10,10 @@ export const envConfig = {
// baseUrl: 'https://uat-sc.yunqueyi.com/', // baseUrl: 'https://uat-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.150:10401/', // baseUrl: 'http://10.177.15.150:10401/',
// baseUrl: 'http://10.177.15.150:11905/', // baseUrl: 'http://10.177.15.150:11905/',
// baseUrl: 'https://dev-sc.yunqueyi.com/', baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'https://test1-sc.yunqueyi.com/', // baseUrl: 'https://test1-sc.yunqueyi.com/',
// baseUrl: 'https://sc.yunqueyi.com/', // baseUrl: 'https://sc.yunqueyi.com/',
baseUrl: 'https://uat-sc.yunqueyi.com/', // baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://uat-api.yunqueyi.com/', apiUrl: 'https://uat-api.yunqueyi.com/',
qiniuFileUrl: "https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1", qiniuFileUrl: "https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com", qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
......
...@@ -55,6 +55,7 @@ service.interceptors.request.use(config => { ...@@ -55,6 +55,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'] = '29D71EAAB92E4580AFB16A8011BE7206';
// config.headers['token'] = '3167CD6495A14C14AEF28AB99F69984D';
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')
......
<template>
<div class="edit-entry-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="header-title">{{ title }}</div>
<div class="button-group">
<el-button v-show="showStorage" size="small" @click="complete(1)">暂存</el-button>
<el-button type="primary" size="small" @click="complete(2)">完成</el-button>
</div>
<el-form
ref="formData"
:model="formData"
:rules="rules"
label-width="150px"
class="basic-form"
>
<el-form-item label="入口名称:" prop="entryName">
<el-col :span="13">
<el-input
size="small"
v-model="formData.entryName"
placeholder="请输入名称"
style="width:83%;"
:disabled="peopleLevel == 'L3'"
></el-input>
<span class="word-num">{{(formData.entryName).replace(/\s+/g,"").length}}/24</span>
</el-col>
</el-form-item>
<el-form-item label="发起机构:" prop="organizationName">
<el-col :span="13">
<el-input
size="small"
v-model="formData.organizationName"
placeholder="请输入发起机构名称"
style="width:83%;"
:disabled="peopleLevel == 'L3'"
@input="changeOrganizationName"
@blur="blurName"
@focus="focusName"
></el-input>
<span class="word-num">{{(formData.organizationName).replace(/\s+/g,"").length}}/12</span>
</el-col>
<el-popover
class="popover-content"
placement="bottom"
:content="organizationContent"
v-model="visibleName"
@click="checkDefault"
>
<p @click="checkDefault">我的机构: {{ organizationContent }}</p>
</el-popover>
</el-form-item>
<el-form-item label="项目时间:" required>
<el-col :span="5">
<el-form-item prop="entryBegintime">
<el-date-picker
v-model="formData.entryBegintime"
size="small"
type="datetime"
placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0"
style="width: 100%;"
:disabled="peopleLevel == 'L3'"
></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="entryEndtime">
<el-date-picker
v-model="formData.entryEndtime"
size="small"
type="datetime"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions1"
default-time="23:59:59"
style="width: 100%;"
:disabled="peopleLevel == 'L3'"
></el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="入口简介:" prop="entryIntro">
<el-col :span="13">
<el-input
size="small"
type="textarea"
:autosize="{ minRows: 5}"
placeholder="请输入入口简介"
v-model="formData.entryIntro"
style="width:83%;"
:disabled="peopleLevel == 'L3'"
></el-input>
<span class="word-num">{{(formData.entryIntro).replace(/\s+/g,"").length}}/200</span>
</el-col>
</el-form-item>
<div class="basic-item-icon">
<span class="require">*</span>
<el-form-item label="列表图片:">
<el-upload
v-model="formData.attachmentUrl1"
class="bg-uploader"
action="#"
:show-file-list="false"
:before-upload="beforeUploadListPic"
:disabled="peopleLevel == 'L3'"
>
<img
v-if="formData.attachmentUrl1"
@mouseover.stop="imgMouseOver=true && peopleLevel != 'L3'"
:src="formData.attachmentUrl1"
class="bg-img"
/>
<img
v-if="!formData.attachmentUrl1"
class="bg-img"
src="../../assets/image/small.png"
/>
<div
class="img-delete"
v-show="imgMouseOver"
@click.stop="deleteImg(1)"
@mouseout.stop="imgMouseOver=false"
>
<i class="el-icon-delete"></i>
</div>
<div class="limit-text">
<p>尺寸:230*172</p>
<p>限制大小: 500Kb</p>
<p>支持.jpg,.png格式</p>
</div>
</el-upload>
</el-form-item>
<p class="upload-message" v-if="uploadImgMessage">请选择列表图片</p>
</div>
<el-form-item label="封面类型:">
<el-radio-group
size="small"
v-model="formData.type"
@change="changeCover"
:disabled="peopleLevel == 'L3'"
>
<el-radio :label="1">图片</el-radio>
<el-radio :label="2">视频</el-radio>
</el-radio-group>
</el-form-item>
<div class="basic-item-icon">
<span class="require">*</span>
<el-form-item label="封面文件:">
<el-upload
v-model="formData.attachmentUrl2"
class="bg-uploader"
action="#"
:show-file-list="false"
:before-upload="beforeUploadCoverPic"
:disabled="peopleLevel == 'L3'"
>
<img
v-if="formData.type == 1 && formData.attachmentUrl2"
:src="formData.attachmentUrl2"
@mouseover.stop="imgMouseOver2=true && peopleLevel != 'L3'"
class="bg-img"
/>
<video
v-if="formData.type == 2 && formData.attachmentUrl2"
width="100"
controls
class="bg-video"
@mouseover.stop="imgMouseOver2=true && peopleLevel != 'L3'"
>
<source :src="formData.attachmentUrl2" type="video/mp4" />浏览器不支持mp4
</video>
<img
v-if="!formData.attachmentUrl2"
class="bg-img"
src="../../assets/image/small.png"
/>
<div
class="img-delete"
v-show="imgMouseOver2"
@click.stop="deleteImg(2)"
@mouseout.stop="imgMouseOver2=false"
>
<i class="el-icon-delete"></i>
</div>
<div v-show="formData.type == 1" class="limit-text">
<p>尺寸:750*420</p>
<p>限制大小: 2.0 Mb</p>
<p>支持.jpg,.png格式</p>
</div>
<div v-show="formData.type == 2" class="limit-text">
<p></p>
<p>限制大小: 500 Mb</p>
<p>支持.mp4</p>
</div>
</el-upload>
</el-form-item>
<p class="upload-message" v-if="uploadImgMessage2">请选择封面</p>
</div>
<el-form-item label="关联项目:">
<el-col :span="10">
<!-- :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" -->
<el-select
v-model="formData.project"
multiple
collapse-tags
style="width: 350px"
placeholder="关联项目"
@change="changeValue"
filterable
>
<el-option
v-for="item in optionsProject"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
></el-option>
</el-select>
</el-col>
</el-form-item>
<el-form-item label="已选择:" class="check-project">
<el-col :span="10" class="tags-list">
<el-tag
class="tags-project"
v-for="tag in tagsProject"
v-bind:class="{'tags-project-online': tag.disabled === true }"
:key="tag.value"
closable
:type="tag.type"
style="margin-left: 10px;"
@close="handleCloseProject(tag)"
>{{tag.name}}</el-tag>
</el-col>
</el-form-item>
</el-form>
<el-dialog title="确认上架" :visible.sync="dialogUp" width="30%" center>
<p class="dialog_p">该项目已关联<span> 0 </span>个子项目</p>
<p class="dialog_p">继续上架,将在APP端无法显示该项目</p>
<span slot="footer" class="dialog-footer">
<el-button @click="insertOrUpdate(2)">确认上架</el-button>
<el-button type="primary" @click="dialogUp = false">取消</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { doUpload, getFilePath } from "../../utils/qiniu-util";
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
import Sortable from "sortablejs";
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
let checkProjectStr = (rule, value, callback) => {
if (value.indexOf("\\") != -1) {
callback(new Error("请勿输入字符“ \\ "));
} else if (value.indexOf(".") != -1) {
callback(new Error("请勿输入字符“ . "));
} else {
callback();
}
};
return {
curmbFirst: "教培项目",
curmbSecond: "项目组件",
curmbThird: "新建入口",
title: "",
showStorage: false,
entryId: null,
peopleLevel: null,
uploadImgMessage: false,
uploadImgMessage2: false,
imgMouseOver: false,
imgMouseOver2: false,
organizationContent: "云鹊医",
statusValue: 0,
dialogUp: false,
formData: {
entryName: "",
entryBegintime: "",
entryEndtime: "",
entryIntro: "",
type: 1,
attachmentUrl1: "",
attachmentUrl2: "",
attachmentMore1: {},
attachmentMore2: {},
organizationName: "",
project: []
},
optionsProject: [],
tagsProject: [],
visibleName: false,
entryOptionData: {},
pickerOptions0: {
disabledDate: time => {
if (
this.formData.entryEndtime != "" &&
this.formData.entryEndtime != null
) {
return (
time.getTime() > new Date(this.formData.entryEndtime).getTime()
);
}
}
},
pickerOptions1: {
disabledDate: time => {
return (
time.getTime() < new Date(this.formData.entryBegintime).getTime()
); //减去一天的时间代表可以选择同一天;
}
},
rules: {
entryName: [
{ required: true, message: "请输入项目名称", trigger: "blur" },
{
min: 2,
max: 24,
message: "输入长度为2-24的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
{ validator: checkProjectStr, trigger: "blur" }
],
organizationName: [
{ required: true, message: "请填写发起机构名称", trigger: "blur" },
{
min: 1,
max: 12,
message: "超过12个最大字数限制,请精简字数或使用简称",
trigger: "blur"
}
],
entryBegintime: [
{
required: true,
message: "请选择时间",
trigger: "change"
}
],
entryEndtime: [
{
required: true,
message: "请选择时间",
trigger: "change"
}
],
type: [
{
type: "array",
required: true,
message: "请至少选择一个活动性质",
trigger: "change"
}
],
entryIntro: [
{ required: true, message: "请填写项目简介", trigger: "blur" },
{ min: 1, max: 200, message: "超出可输入的最大长度", trigger: "blur" }
],
attachmentUrl1: [
{ required: true, message: "请选择列表图片", trigger: "blur" }
],
attachmentUrl2: [
{ required: true, message: "请选择封面", trigger: "blur" }
]
}
};
},
computed: {
...mapGetters(["_token"])
},
created() {
vm = this;
vm.entryId = vm.getUrlSearch(window.location.href, "entryId");
vm.peopleLevel = vm.getUrlSearch(window.location.href, "level");
vm.initTitle();
vm.initOption();
// vm.getEntryData();
},
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
initTitle() {
if (vm.entryId == null) {
vm.title = "新建入口";
vm.curmbThird = "新建入口";
vm.showStorage = true;
} else {
vm.title = "编辑入口";
vm.curmbThird = "编辑入口";
vm.showStorage = false;
}
},
setOption(data) {
let list = [];
for(let i = 0; i<data.length ; i++) {
let obj = {
value: data[i].projectId,
label: data[i].projectName,
}
list.push(obj);
}
return list;
},
initOption() {
vm.optionsProject = [];
let req = {};
openLoading(vm);
vm.GET("portal/entryInfo/getProjectList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.optionsProject = vm.setOption(res.data);
vm.getEntryData();
}
});
},
submitForm(formName) {
let flag = null;
this.$refs[formName].validate(valid => {
if (valid) {
flag = true;
} else {
console.log("error submit!!");
flag = false;
}
});
return flag;
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
// 删除图片
deleteImg(type) {
if (type == 1) {
vm.formData.attachmentUrl1 = "";
vm.imgMouseOver = false;
} else {
vm.formData.attachmentUrl2 = "";
vm.imgMouseOver2 = false;
}
},
changeCover(radio) {
this.formData.attachmentUrl2 = "";
},
beforeUploadListPic(file) {
let fileLimit = {
width: 230,
height: 172,
size: 0.5,
sizeText: "500K",
key: "attachmentUrl1",
more: "attachmentMore1",
show: "uploadImgMessage"
};
this.beforeAvatarUpload(file, fileLimit);
},
beforeUploadCoverPic(file) {
let fileLimit = {
width: 750,
height: 420,
size: 2,
sizeText: "2.0M",
key: "attachmentUrl2",
more: "attachmentMore2",
show: "uploadImgMessage2"
};
if (this.formData.type == 1) {
this.beforeAvatarUpload(file, fileLimit);
} else {
this.beforeUploadMp4(file);
}
},
beforeAvatarUpload(file, fileLimit) {
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) {
this.$message.error("图片不符合规范,请根据规范上传图片");
return;
}
if (!isLt2M) {
this.$message.error("图片不符合规范,请根据规范上传图片 ");
return;
}
let _img = new FileReader();
_img.readAsDataURL(file);
_img.onload = function(theFile) {
let image = new Image();
image.src = theFile.target.result;
image.onload = function() {
let _this = this;
if (
_this.width != fileLimit.width ||
_this.height != fileLimit.height
) {
vm.$message.error("图片不符合规范,请根据规范上传图片");
} else {
openLoading(vm);
doUpload(
vm,
file,
getFilePath(file, null),
"preview4",
"progress1",
1
).then(function(path) {
closeLoading(vm);
console.log(path);
if (fileLimit.show == "uploadImgMessage") {
vm.uploadImgMessage = false;
} else if (fileLimit.show == "uploadImgMessage2") {
vm.uploadImgMessage2 = false;
}
vm.formData[fileLimit.key] = path.fullPath;
vm.formData[fileLimit.more] = {
attachmentName: path.name,
attachmentExt: path.ext,
attachmentSize: path.size
};
console.log("!!!" + vm.formData[fileLimit.key]);
vm.$message.success("上传成功");
});
}
};
};
return isJPG && isLt2M;
},
beforeUploadMp4(file) {
console.log(file);
const isMP4 = file.type === "video/mp4";
const isLt = file.size / 1024 / 1024 < 500;
if (!isLt) {
this.$message.error("视频不符合规范,请根据规范上传视频");
return;
}
if (!isMP4) {
this.$message.error("视频不符合规范,请根据规范上传视频");
} else {
openLoading(vm);
doUpload(
vm,
file,
getFilePath(file, null),
"preview4",
"progress1",
""
).then(function(path) {
closeLoading(vm);
console.log(path);
vm.uploadImgMessage2 = false;
vm.formData.attachmentUrl2 = path.fullPath;
vm.$message.success("上传成功");
});
}
},
checkDefault() {
vm.formData.organizationName = vm.organizationContent;
vm.visibleName = false;
},
blurName() {
vm.visibleName = false;
setTimeout(function() {
// console.log('失去焦点');
vm.submitForm("formData");
}, 200);
},
focusName() {
let textLength = vm.formData.organizationName.length;
if (textLength == 0) {
vm.visibleName = true;
} else {
vm.visibleName = false;
}
},
changeOrganizationName() {
let textLength = vm.formData.organizationName.length;
// console.log("文字长度", textLength);
if (textLength == 0) {
vm.visibleName = true;
} else {
vm.visibleName = false;
}
},
tagDrop() {
this.$nextTick(function() {
if (vm.tagsProject.length > 0) {
const ele = document.querySelector(".check-project .el-col-10");
// console.log('ele',ele);
Sortable.create(ele, {
onEnd({ newIndex, oldIndex }) {
const currRow = vm.tagsProject.splice(oldIndex, 1)[0];
vm.tagsProject.splice(newIndex, 0, currRow);
}
});
}
});
},
changeValue(value) {
this.tagsProject = [];
let len = 0;
for (let i = 0; i < value.length; i++) {
for (let j = 0; j < this.optionsProject.length; j++) {
if (value[i] == this.optionsProject[j].value) {
this.tagsProject[len] = {};
this.tagsProject[len] = this.optionsProject[j];
this.tagsProject[len].value = this.optionsProject[j].value;
this.tagsProject[len].name = this.optionsProject[j].label;
len++;
}
}
}
vm.tagDrop();
},
initTags(value) {
vm.tagsProject = [];
let len = 0;
for (let i = 0; i < value.length; i++) {
for (let j = 0; j < vm.optionsProject.length; j++) {
if (value[i] == vm.optionsProject[j].value) {
vm.tagsProject[len] = {};
vm.tagsProject[len].value = vm.optionsProject[j].value;
vm.tagsProject[len].name = vm.optionsProject[j].label;
len++;
}
}
}
},
handleCloseProject(tag) {
if (tag.disabled == true) {
return;
}
vm.tagsProject.splice(vm.tagsProject.indexOf(tag), 1);
vm.formData.project = [];
for (let j = 0; j < vm.tagsProject.length; j++) {
vm.formData.project[j] = vm.tagsProject[j].value;
}
},
getEntryData() {
if (vm.entryId == null) {
return;
}
let req = {
entryId: vm.entryId
};
openLoading(vm);
vm.GET("portal/entryInfo/getEntry", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.setEditData(res.data);
vm.entryOptionData = res.data;
vm.statusValue = res.data.portalEntry.entryStatus;
// console.log("portalEntryUniInfo", vm.entryOptionData);
} else {
vm.$message(res.message);
}
});
},
setProject(data) {
let list = [];
for(let i = 0; i<data.length; i++) {
list.push(data[i]);
}
return list;
},
setEditData(data) {
if(data.portalEntry.entryStatus === 1) {
vm.showStorage = true;
}
vm.formData = {
entryName: data.portalEntry.entryName,
organizationName: data.portalEntry.organizationName,
entryBegintime: data.portalEntry.entryBegintime,
entryEndtime: data.portalEntry.entryEndtime,
entryIntro: data.portalEntry.entryIntro,
// type: 1,
// attachmentUrl1: "",
// attachmentUrl2: "",
type: data.attachments[1].attachmentType,
attachmentUrl1: data.attachments[0].attachmentUrl,
attachmentUrl2: data.attachments[1].attachmentUrl,
attachmentMore1: {
attachmentName: data.attachments[0].attachmentName,
},
attachmentMore2: {
attachmentName: data.attachments[1].attachmentName,
},
project: data.projectIds,
};
let projectEdit = data.projectIds;
vm.initTags(projectEdit);
},
complete(type) {
//1是暂存,2是完成
if (type == 2) {
if (!vm.formData.attachmentUrl1) {
vm.uploadImgMessage = true;
} else {
vm.uploadImgMessage = false;
}
if (!vm.formData.attachmentUrl2) {
vm.uploadImgMessage2 = true;
} else {
vm.uploadImgMessage2 = false;
}
let completeState = vm.submitForm("formData");
if (
completeState === true &&
vm.formData.attachmentUrl1 != "" &&
vm.formData.attachmentUrl2 != ""
) {
if(vm.statusValue === 3 && vm.formData.project.length == 0) {
vm.dialogUp = true;
} else {
vm.insertOrUpdate(type);
}
}
//完成
} else {
//暂存
if(vm.formData.entryName == '') {
vm.$message('请输入入口名称!');
} else {
vm.insertOrUpdate(type);
}
}
},
insertOrUpdate(isCompleted) {
//option
let portalEntryUniInfo = {};
if (vm.entryId == null) {
portalEntryUniInfo = {
portalEntry: {
entryBegintime: vm.formData.entryBegintime,
entryEndtime: vm.formData.entryEndtime,
entryIntro: vm.formData.entryIntro,
entryName: vm.formData.entryName,
organizationName: vm.formData.organizationName
},
attachments: [
{
attachmentType: 1,
attachmentUrl: vm.formData.attachmentUrl1,
attachmentName: vm.formData.attachmentMore1.attachmentName,
// attachmentExt: vm.formData.attachmentMore1.attachmentExt,
// attachmentSize: vm.formData.attachmentMore1.attachmentSize,
kind: 1,
// seqNo: 1
},
{
attachmentType: vm.formData.type,
attachmentUrl: vm.formData.attachmentUrl2,
attachmentName: vm.formData.attachmentMore2.attachmentName,
// attachmentExt: vm.formData.attachmentMore2.attachmentExt,
// attachmentSize: vm.formData.attachmentMore2.attachmentSize,
kind: 2,
// seqNo: 1
}
],
projectIds: []
};
for(let i = 0;i < vm.tagsProject.length ; i++) {
// portalEntryUniInfo.subprojects[i] = {
// projectId: vm.tagsProject[i].value,
// projectName: vm.tagsProject[i].label,
// }
portalEntryUniInfo.projectIds[i] = vm.tagsProject[i].value;
}
} else {
portalEntryUniInfo = {
portalEntry: {
createdId: vm.entryOptionData.portalEntry.createdId,
createdName: vm.entryOptionData.portalEntry.createdName,
createdTime: vm.entryOptionData.portalEntry.createdTime,
deleteFlag: vm.entryOptionData.portalEntry.deleteFlag,
entryBegintime: vm.formData.entryBegintime,
entryEndtime: vm.formData.entryEndtime,
entryIntro: vm.formData.entryIntro,
entryName: vm.formData.entryName,
entryStatus: vm.entryOptionData.portalEntry.entryStatus,
id: vm.entryOptionData.portalEntry.id,
organizationId: 0,
organizationName: vm.formData.organizationName
},
attachments: [
{
attachmentType: 1,
attachmentUrl: vm.formData.attachmentUrl1,
attachmentName: vm.formData.attachmentMore1.attachmentName,
entryId: vm.entryOptionData.portalEntry.id,
id: vm.entryOptionData.portalEntry.id,
kind: 1,
// seqNo: 1
},
{
attachmentType: vm.formData.type,
attachmentUrl: vm.formData.attachmentUrl2,
attachmentName: vm.formData.attachmentMore2.attachmentName,
entryId: vm.entryOptionData.portalEntry.id,
id: vm.entryOptionData.portalEntry.id,
kind: 2,
// seqNo: 1
}
],
projectIds: []
};
for(let i = 0;i < vm.tagsProject.length ; i++) {
// portalEntryUniInfo.subprojects[i] = {
// projectId: vm.tagsProject[i].value,
// projectName: vm.tagsProject[i].label,
// }
portalEntryUniInfo.projectIds[i] = vm.tagsProject[i].value;
}
// console.log('tagsProject',vm.tagsProject);
}
// console.log("portalEntryUniInfo", portalEntryUniInfo);
openLoading(vm);
vm.POST(
"portal/entryInfo/updateInsertEntry?isCompleted=" + isCompleted,
portalEntryUniInfo
).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(vm.statusValue === 3) {
vm.$message({
message: '发布成功',
type: 'success'
});
}
vm.$router.push("entry-manager");
} else {
if(vm.statusValue === 3) {
vm.$message.error('发布失败');
vm.$message(res.message);
} else {
vm.$message(res.message);
}
}
});
}
}
};
</script>
<style lang="scss">
.edit-entry-wrap {
.component-content {
position: relative;
padding: 10px;
background: #fff;
.dialog_p {
text-align: center;
span{
font-weight: 700;
}
}
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.button-group {
position: absolute;
margin-top: 10px;
right: 5%;
z-index: 999;
}
.basic-form {
::-webkit-scrollbar
{
width: 4px;
height: 20px;
background-color: #D8D8D8;
}
::-webkit-scrollbar-thumb {
background-color: #D8D8D8;
}
position: relative;
margin-top: 10px;
.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-popover--plain {
padding: 18px 20px;
top: 40px;
}
.check-project {
top: 95%;
right: 5%;
position: absolute;
z-index: 999;
.tags-list {
border: 1px #e8e8e8 solid;
height: 350px;
min-width: 280px;
overflow-y: scroll;
.el-tag {
margin-top: 5px;
display: table;
background-color: #e6f1fc;
color: #389efe;
}
.tags-project-online {
color: #9aceff;
background-color: #f3f8fe;
border-color: #d5eafe;
}
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -20,25 +20,27 @@ ...@@ -20,25 +20,27 @@
size="small" size="small"
v-model="formData.entryName" v-model="formData.entryName"
placeholder="请输入名称" placeholder="请输入名称"
style="width:83%;" style="width:70%;"
:disabled="peopleLevel == 'L3'" :disabled="peopleLevel == 'L3'"
></el-input> ></el-input>
<span class="word-num">{{(formData.entryName).replace(/\s+/g,"").length}}/24</span> <span class="word-num">{{(formData.entryName).replace(/\s+/g,"").length}}/24</span>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="发起机构:" prop="organizationName"> <el-form-item label="发起机构:" prop="organizationName">
<el-col :span="13"> <el-col :span="13" v-for="(item, index) in formData.organizationNameNew" :key="index">
<el-input <el-input
size="small" size="small"
v-model="formData.organizationName" v-model="formData.organizationNameNew[index]"
placeholder="请输入发起机构名称" placeholder="请输入发起机构名称"
style="width:83%;" style="width:70%;"
:disabled="peopleLevel == 'L3'" :disabled="peopleLevel == 'L3'"
@input="changeOrganizationName" @input="changeOrganizationName"
@blur="blurName" @blur="blurName"
@focus="focusName" @focus="focusName"
></el-input> ></el-input>
<span class="word-num">{{(formData.organizationName).replace(/\s+/g,"").length}}/12</span> <span class="word-num">{{(formData.organizationName).replace(/\s+/g,"").length}}/16</span>
<img class="edit-img" src="../../assets/image/plus.png" />
<img class="edit-img" src="../../assets/image/delete.png" />
</el-col> </el-col>
<el-popover <el-popover
class="popover-content" class="popover-content"
...@@ -296,6 +298,7 @@ export default { ...@@ -296,6 +298,7 @@ export default {
attachmentMore1: {}, attachmentMore1: {},
attachmentMore2: {}, attachmentMore2: {},
organizationName: "", organizationName: "",
organizationNameNew: ['22', '33', '44'],
project: [] project: []
}, },
optionsProject: [], optionsProject: [],
...@@ -336,7 +339,7 @@ export default { ...@@ -336,7 +339,7 @@ export default {
{ required: true, message: "请填写发起机构名称", trigger: "blur" }, { required: true, message: "请填写发起机构名称", trigger: "blur" },
{ {
min: 1, min: 1,
max: 12, max: 16,
message: "超过12个最大字数限制,请精简字数或使用简称", message: "超过12个最大字数限制,请精简字数或使用简称",
trigger: "blur" trigger: "blur"
} }
......
因为 它太大了无法显示 源差异 。您可以改为 查看blob
...@@ -33,25 +33,27 @@ ...@@ -33,25 +33,27 @@
size="small" size="small"
v-model="formData.projectName" v-model="formData.projectName"
placeholder="请输入项目名称" placeholder="请输入项目名称"
style="width:83%;" style="width:70%;"
:disabled="peopleLevel == 'L3'" :disabled="peopleLevel == 'L3'"
></el-input> ></el-input>
<span class="word-num">{{(formData.projectName).replace(/\s+/g,"").length}}/24</span> <span class="word-num">{{(formData.projectName).replace(/\s+/g,"").length}}/24</span>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="发起机构名称:" prop="organizationName"> <el-form-item label="发起机构名称:" prop="organizationName">
<el-col :span="13"> <el-col :span="13" v-for="(item, index) in formData.organizationNameList" :key="index">
<el-input <el-input
size="small" size="small"
v-model="formData.organizationName" v-model="formData.organizationNameList[index]"
placeholder="请输入发起机构名称" placeholder="请输入发起机构名称"
style="width:83%;" style="width:70%;"
:disabled="peopleLevel == 'L3'" :disabled="peopleLevel == 'L3'"
@input="changeOrganizationName" @input="changeOrganizationName"
@blur = "blurName" @blur = "blurName"
@focus = "focusName" @focus = "focusName(index)"
></el-input> ></el-input>
<span class="word-num">{{(formData.organizationName).replace(/\s+/g,"").length}}/12</span> <span class="word-num">{{(formData.organizationNameList[index]).replace(/\s+/g,"").length}}/16</span>
<img class="edit-img" src="../../assets/image/plus.png" />
<img class="edit-img" src="../../assets/image/delete.png" />
</el-col> </el-col>
<el-popover <el-popover
class="popover-content" class="popover-content"
...@@ -972,8 +974,11 @@ import { openLoading, closeLoading } from "../../utils/utils"; ...@@ -972,8 +974,11 @@ import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils"; import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation"; import * as operationData from "../../utils/operation";
import { getExeclUrl } from "@/utils/index"; import { getExeclUrl } from "@/utils/index";
import { uploadOrgExcel, uploadPersonExcel } from "@/utils/education/educationApi"; import {
import Sortable from 'sortablejs' uploadOrgExcel,
uploadPersonExcel
} from "@/utils/education/educationApi";
import Sortable from "sortablejs";
let vm = null; let vm = null;
export default { export default {
...@@ -982,10 +987,11 @@ export default { ...@@ -982,10 +987,11 @@ export default {
}, },
data() { data() {
let checkProjectStr = (rule, value, callback) => { let checkProjectStr = (rule, value, callback) => {
if(value.indexOf("\\") != -1) {//存在 if (value.indexOf("\\") != -1) {
callback(new Error('请勿输入字符“ \\ ”')); //存在
callback(new Error("请勿输入字符“ \\ "));
} else if (value.indexOf(".") != -1) { } else if (value.indexOf(".") != -1) {
callback(new Error('请勿输入字符“ . ”')); callback(new Error("请勿输入字符“ . "));
} else { } else {
callback(); callback();
} }
...@@ -994,35 +1000,35 @@ export default { ...@@ -994,35 +1000,35 @@ export default {
const val = parseFloat(value); const val = parseFloat(value);
const isInteger = Number.isInteger(val); const isInteger = Number.isInteger(val);
// if((isInteger && val > 0) || checkNeedRule(val)){ // if((isInteger && val > 0) || checkNeedRule(val)){
if( !value || (isInteger && val >= 0 && val <= 100) ){ if (!value || (isInteger && val >= 0 && val <= 100)) {
callback() callback();
}else{ } else {
callback(new Error(`请输入0~100正整数`)) callback(new Error(`请输入0~100正整数`));
}
} }
};
return { return {
idTypeValue: 1, idTypeValue: 1,
idTypeProject: '', idTypeProject: "",
customError:{ customError: {
standard:{ standard: {
className:'', className: "",
error:'' error: ""
}, },
certificate:{ certificate: {
className:'', className: "",
error:'' error: ""
}, },
passTotalLearnTime:{ passTotalLearnTime: {
className:'', className: "",
error:'' error: ""
}, },
passExamCount:{ passExamCount: {
className:'', className: "",
error:'' error: ""
}, },
passAverageScore:{ passAverageScore: {
className:'', className: "",
error:'' error: ""
} }
}, },
projectId: null, projectId: null,
...@@ -1052,13 +1058,14 @@ export default { ...@@ -1052,13 +1058,14 @@ export default {
attachmentMore1: {}, attachmentMore1: {},
attachmentMore2: {}, attachmentMore2: {},
scopeType: 0, scopeType: 0,
organizationName: '', organizationName: "",
organizationNameList: [],
sendOption: 1, sendOption: 1,
receiveOption: 1, receiveOption: 1,
visibleFlag: 1, visibleFlag: 1,
learnableFlag: 2, learnableFlag: 2,
authorityType:1, authorityType: 1,
allowLearn:2 allowLearn: 2
}, },
pickerOptions0: { pickerOptions0: {
disabledDate: time => { disabledDate: time => {
...@@ -1104,7 +1111,7 @@ export default { ...@@ -1104,7 +1111,7 @@ export default {
formOrganization: { formOrganization: {
name: "", name: "",
administrativeId: "0", administrativeId: "0",
administrativeIdList: ['0'], administrativeIdList: ["0"],
level: "-1", level: "-1",
chechAll: true, chechAll: true,
pageNum: 1, pageNum: 1,
...@@ -1159,22 +1166,22 @@ export default { ...@@ -1159,22 +1166,22 @@ export default {
//记录上次 //记录上次
scopeOfOrganizationLast: [], scopeOfOrganizationLast: [],
scopeOfPeopleLast: [], scopeOfPeopleLast: [],
setKindOfOrganizationLast: '', setKindOfOrganizationLast: "",
setKindOfPeopleLast: '', setKindOfPeopleLast: "",
//搜索类型 //搜索类型
searchOrganizationType: '', searchOrganizationType: "",
searchPeopleType: '', searchPeopleType: "",
//小生态 //小生态
checkedEcology: '', checkedEcology: "",
ecologySelect: [], ecologySelect: [],
formEcology: { formEcology: {
ecology: '', ecology: "",
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10
}, },
totalEcology: 0, totalEcology: 0,
tableEcology: [], tableEcology: [],
checkTableEcology: '', checkTableEcology: "",
getRowKeysEcology(row) { getRowKeysEcology(row) {
return row.id; return row.id;
}, },
...@@ -1189,9 +1196,9 @@ export default { ...@@ -1189,9 +1196,9 @@ export default {
configure: 2, configure: 2,
certificate: "", certificate: "",
courseRequire: 0, //0:不控制 1:按课程时长配置要求 courseRequire: 0, //0:不控制 1:按课程时长配置要求
passExamCount:'', passExamCount: "",
passAverageScore:'', passAverageScore: "",
passTotalLearnTime:'' passTotalLearnTime: ""
}, },
tagsComponent: [], tagsComponent: [],
projectStatus: "", projectStatus: "",
...@@ -1200,40 +1207,41 @@ export default { ...@@ -1200,40 +1207,41 @@ export default {
//考试数据 //考试数据
formExam: { formExam: {
certificateType: 1, certificateType: 1,
passType:1, passType: 1,
exam: [{ exam: [
{
examCount: 1, examCount: 1,
rangeMin: '', rangeMin: "",
rangeMax: '', rangeMax: "",
certificateId: '', certificateId: "",
certificateName: '', certificateName: ""
}] }
]
}, },
certificateTypeList: [ certificateTypeList: [
{ {
label: '所有组件通过', label: "所有组件通过",
value: 1, value: 1
}, },
{ {
label: '根据平均分设定', label: "根据平均分设定",
value: 2, value: 2
}, },
{ {
label: '根据项目内学习时长设定', label: "根据项目内学习时长设定",
value: 3, value: 3
}, }
], ],
visibleName: false, visibleName: false,
organizationContent: '', organizationContent: "",
//v2.2.0更新 //v2.2.0更新
dialogWarn: false, dialogWarn: false,
warnType: 0, warnType: 0,
nowCheck: {}, nowCheck: {},
administrativeValue: '', administrativeValue: "",
optionsRegion: [], optionsRegion: [],
dialogUpload: false, dialogUpload: false,
searchName: '', searchName: "",
getRowKeysDepartment(row) { getRowKeysDepartment(row) {
return row.id; return row.id;
}, },
...@@ -1241,9 +1249,9 @@ export default { ...@@ -1241,9 +1249,9 @@ export default {
dialogSuccess: false, dialogSuccess: false,
failType: 2, failType: 2,
failNum: 0, failNum: 0,
failExcelUrl: '', failExcelUrl: "",
dialogFail: false, dialogFail: false,
uploadType: '', uploadType: "",
props: { props: {
lazy: true, lazy: true,
lazyLoad(node, resolve) { lazyLoad(node, resolve) {
...@@ -1285,12 +1293,9 @@ export default { ...@@ -1285,12 +1293,9 @@ export default {
{ required: true, message: "请选择证书", trigger: "change" } { required: true, message: "请选择证书", trigger: "change" }
], ],
visitTime: [ visitTime: [
{required: false, trigger: "change", validator: checkNormalInt,} { required: false, trigger: "change", validator: checkNormalInt }
], ],
showRules1:[ showRules1: [{ required: true, message: "请输入门数", trigger: "blur" }]
{ required: true, message: "请输入门数", trigger: "blur" }
],
}, },
rules: { rules: {
...@@ -1302,11 +1307,16 @@ export default { ...@@ -1302,11 +1307,16 @@ export default {
message: "输入长度为2-24的内容,可包含中英文、数字及特殊符号", message: "输入长度为2-24的内容,可包含中英文、数字及特殊符号",
trigger: "blur" trigger: "blur"
}, },
{ validator: checkProjectStr, trigger: 'blur' } { validator: checkProjectStr, trigger: "blur" }
], ],
organizationName: [ organizationName: [
{ required: true, message: "请填写发起机构名称", trigger: "blur" }, { required: true, message: "请填写发起机构名称", trigger: "blur" },
{ min: 1, max: 12, message: "超过12个最大字数限制,请精简字数或使用简称", trigger: "blur" } {
min: 1,
max: 16,
message: "超过12个最大字数限制,请精简字数或使用简称",
trigger: "blur"
}
], ],
duringTime: [ duringTime: [
{ {
...@@ -1364,8 +1374,8 @@ export default { ...@@ -1364,8 +1374,8 @@ export default {
this.changeOnStep(this.active); this.changeOnStep(this.active);
this.getComponentInfo(); this.getComponentInfo();
//this.editManager(); //this.editManager();
vm.idType = localStorage.getItem('storageIdType'); vm.idType = localStorage.getItem("storageIdType");
console.log('this.idType:'+ vm.idType); console.log("this.idType:" + vm.idType);
if (vm.idType == 2) { if (vm.idType == 2) {
this.activeName = "second"; this.activeName = "second";
} }
...@@ -1375,42 +1385,37 @@ export default { ...@@ -1375,42 +1385,37 @@ export default {
commonUtil.resizeHeight(); commonUtil.resizeHeight();
}, },
methods: { methods: {
focusFun(ev,parm,index){ focusFun(ev, parm, index) {
if (index != undefined) {
if(index != undefined){ if (parseInt(ev) < 0 || !this.checkIntFun(ev)) {
if(parseInt(ev) < 0 || !this.checkIntFun(ev)){ console.log(typeof index);
console.log(typeof index) this.formExam.exam[index][parm] = "";
this.formExam.exam[index][parm] = ''
} }
if(parm == 'rangeMax' && parseInt(ev) > 100){ if (parm == "rangeMax" && parseInt(ev) > 100) {
this.formExam.exam[index][parm] = "100" this.formExam.exam[index][parm] = "100";
} }
if(ev != ''){ if (ev != "") {
if(parm == 'rangeMax'){ if (parm == "rangeMax") {
this.formExam.exam[index].maxClass = '' this.formExam.exam[index].maxClass = "";
this.formExam.exam[index].maxError = '' this.formExam.exam[index].maxError = "";
} }
if(parm == 'rangeMin'){ if (parm == "rangeMin") {
this.formExam.exam[index].minClass = '' this.formExam.exam[index].minClass = "";
this.formExam.exam[index].minError = '' this.formExam.exam[index].minError = "";
} }
} }
} else {
}else{ if (parseInt(ev) < 0 || !this.checkIntFun(ev)) {
if(parseInt(ev) < 0 || !this.checkIntFun(ev)){ this.formComponent[parm] = "";
this.formComponent[parm] = ''
} }
if(parm == 'passAverageScore' && parseInt(ev) > 100){ if (parm == "passAverageScore" && parseInt(ev) > 100) {
this.formComponent[parm] = "100" this.formComponent[parm] = "100";
} }
if(ev != ''){ if (ev != "") {
this.customError[parm] = { this.customError[parm] = {
className:'', className: "",
error:'' error: ""
} };
} }
} }
}, },
...@@ -1433,11 +1438,11 @@ export default { ...@@ -1433,11 +1438,11 @@ export default {
}, },
// 删除图片 // 删除图片
deleteImg(type) { deleteImg(type) {
if(type == 1) { if (type == 1) {
vm.formData.attachmentUrl1 = ''; vm.formData.attachmentUrl1 = "";
vm.imgMouseOver = false; vm.imgMouseOver = false;
} else { } else {
vm.formData.attachmentUrl2 = ''; vm.formData.attachmentUrl2 = "";
vm.imgMouseOver2 = false; vm.imgMouseOver2 = false;
} }
}, },
...@@ -1471,13 +1476,14 @@ export default { ...@@ -1471,13 +1476,14 @@ export default {
}, },
scopeType: editData.projectData.scopeType, scopeType: editData.projectData.scopeType,
organizationName: editData.projectData.organizationName, organizationName: editData.projectData.organizationName,
organizationNameList: editData.projectData.organizationNameList,
notifyId: editData.notifyData.notifyId, notifyId: editData.notifyData.notifyId,
sendOption: editData.notifyData.sendOption, sendOption: editData.notifyData.sendOption,
receiveOption: editData.notifyData.receiveOption, receiveOption: editData.notifyData.receiveOption,
visibleFlag: editData.projectData.visibleFlag, visibleFlag: editData.projectData.visibleFlag,
learnableFlag: editData.projectData.learnableFlag, learnableFlag: editData.projectData.learnableFlag,
authorityType:editData.projectData.authorityType, authorityType: editData.projectData.authorityType,
allowLearn:editData.projectData.allowLearn || 2, allowLearn: editData.projectData.allowLearn || 2
}; };
this.organizationContent = editData.projectData.creatorOrganizationName; this.organizationContent = editData.projectData.creatorOrganizationName;
if (editData.attachmentData.length > 2) { if (editData.attachmentData.length > 2) {
...@@ -1511,34 +1517,43 @@ export default { ...@@ -1511,34 +1517,43 @@ export default {
this.formExam.certificateType = editData.projectData.certificateType; this.formExam.certificateType = editData.projectData.certificateType;
this.formExam.passType = editData.projectData.passType; this.formExam.passType = editData.projectData.passType;
this.formExam.exam = editData.certificateRule; this.formExam.exam = editData.certificateRule;
if(this.formExam.exam.length > 0){ if (this.formExam.exam.length > 0) {
for(let k=0;k<this.formExam.exam.length;k++){ for (let k = 0; k < this.formExam.exam.length; k++) {
this.formExam.exam[k].certClass = '' this.formExam.exam[k].certClass = "";
this.formExam.exam[k].certError = '' this.formExam.exam[k].certError = "";
this.formExam.exam[k].minClass = '' this.formExam.exam[k].minClass = "";
this.formExam.exam[k].minError = '' this.formExam.exam[k].minError = "";
this.formExam.exam[k].maxClass = '' this.formExam.exam[k].maxClass = "";
this.formExam.exam[k].maxError = '' this.formExam.exam[k].maxError = "";
} }
} }
console.log(this.formExam.exam) console.log(this.formExam.exam);
this.formComponent.passAverageScore = editData.projectData.passAverageScore > 0 ? editData.projectData.passAverageScore : '' this.formComponent.passAverageScore =
this.formComponent.passExamCount = editData.projectData.passExamCount > 0 ? editData.projectData.passExamCount : '' editData.projectData.passAverageScore > 0
this.formComponent.passTotalLearnTime = editData.projectData.passTotalLearnTime ? editData.projectData.passAverageScore
if(this.formExam.exam.length == 0) { : "";
this.formExam.exam = [{ this.formComponent.passExamCount =
editData.projectData.passExamCount > 0
? editData.projectData.passExamCount
: "";
this.formComponent.passTotalLearnTime =
editData.projectData.passTotalLearnTime;
if (this.formExam.exam.length == 0) {
this.formExam.exam = [
{
examCount: 1, examCount: 1,
rangeMin: '', rangeMin: "",
rangeMax: '', rangeMax: "",
certificateId: '', certificateId: "",
certificateName: '', certificateName: "",
minClass:'', minClass: "",
minError:'', minError: "",
maxClass:'', maxClass: "",
maxError:'', maxError: "",
certClass:'', certClass: "",
certError:'' certError: ""
}] }
];
} }
}, },
//编辑管理 //编辑管理
...@@ -1547,17 +1562,19 @@ export default { ...@@ -1547,17 +1562,19 @@ export default {
let projectId = vm.getUrlSearch(window.location.href, "projectId"); let projectId = vm.getUrlSearch(window.location.href, "projectId");
if (projectId != null && projectId != "") { if (projectId != null && projectId != "") {
openLoading(vm); openLoading(vm);
vm.GET("portal/portalInfo/getProjectInfo/" + projectId, req).then( vm
res => { .GET("portal/portalInfo/getProjectInfo/" + projectId, req)
.then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000" && res.data.projectData != null) { if (res.code == "000000" && res.data.projectData != null) {
let editData = res.data; let editData = res.data;
console.log(editData) console.log(editData);
this.status4Flag = res.data.projectData.status4Flag; this.status4Flag = res.data.projectData.status4Flag;
this.setEditData(editData); this.setEditData(editData);
this.idTypeProject = res.data.projectData.idType; this.idTypeProject = res.data.projectData.idType;
this.projectStatus = res.data.projectData.projectStatus; this.projectStatus = res.data.projectData.projectStatus;
this.formComponent.courseRequire = res.data.projectData.courseRequire || 0; this.formComponent.courseRequire =
res.data.projectData.courseRequire || 0;
// this.status4Flag = res.data.projectData.status4Flag; // this.status4Flag = res.data.projectData.status4Flag;
if (this.projectStatus == 1) { if (this.projectStatus == 1) {
this.showStorage = true; this.showStorage = true;
...@@ -1566,8 +1583,7 @@ export default { ...@@ -1566,8 +1583,7 @@ export default {
} else { } else {
console.log(res); console.log(res);
} }
} });
);
} else { } else {
this.showStorage = true; this.showStorage = true;
} }
...@@ -1581,11 +1597,12 @@ export default { ...@@ -1581,11 +1597,12 @@ export default {
projectEndtime: this.formData.projectEndtime, projectEndtime: this.formData.projectEndtime,
projectIntro: this.formData.projectIntro, projectIntro: this.formData.projectIntro,
scopeType: this.formData.scopeType, scopeType: this.formData.scopeType,
organizationName: this.formData.organizationName, // organizationName: this.formData.organizationName,
organizationNameList: this.formData.organizationNameList,
visibleFlag: this.formData.visibleFlag, visibleFlag: this.formData.visibleFlag,
learnableFlag: this.formData.learnableFlag, learnableFlag: this.formData.learnableFlag,
authorityType:this.formData.authorityType, authorityType: this.formData.authorityType,
allowLearn:this.formData.allowLearn, allowLearn: this.formData.allowLearn
}; };
let attachmentModel = [ let attachmentModel = [
{ {
...@@ -1638,22 +1655,22 @@ export default { ...@@ -1638,22 +1655,22 @@ export default {
let notifyData = { let notifyData = {
notifyId: 0, notifyId: 0,
receiveOption: this.formData.receiveOption, receiveOption: this.formData.receiveOption,
sendOption: this.formData.sendOption, sendOption: this.formData.sendOption
}; };
if(option == "edit" || option == "storageEdit") { if (option == "edit" || option == "storageEdit") {
notifyData.notifyId = this.formData.notifyId; notifyData.notifyId = this.formData.notifyId;
} }
let postData = { let postData = {
projectModel: JSON.stringify(projectModel), projectModel: JSON.stringify(projectModel),
attachmentModel: JSON.stringify(attachmentModel), attachmentModel: JSON.stringify(attachmentModel),
attachmentPDFModel: JSON.stringify(attachmentPDFModel), attachmentPDFModel: JSON.stringify(attachmentPDFModel),
notifyData: JSON.stringify(notifyData), notifyData: JSON.stringify(notifyData)
}; };
//console.log(postData); //console.log(postData);
openLoading(vm); openLoading(vm);
vm.POST("portal/portalInfo/insertOrUpdate", postData).then(res => { vm.POST("portal/portalInfo/insertOrUpdate", postData).then(res => {
closeLoading(vm); closeLoading(vm);
if(option == "storage" || option == "storageEdit") { if (option == "storage" || option == "storageEdit") {
vm.$message.info(res.message); vm.$message.info(res.message);
} }
if (res.code == "000000") { if (res.code == "000000") {
...@@ -1666,7 +1683,7 @@ export default { ...@@ -1666,7 +1683,7 @@ export default {
if (option != "storage" && option != "storageEdit") { if (option != "storage" && option != "storageEdit") {
this.active++; this.active++;
this.stepData = [false, true, false]; this.stepData = [false, true, false];
if(this.formData.scopeType == 1) { if (this.formData.scopeType == 1) {
this.getEcologySelect(); this.getEcologySelect();
//this.getEcology(); //this.getEcology();
return; return;
...@@ -1683,29 +1700,35 @@ export default { ...@@ -1683,29 +1700,35 @@ export default {
//查询上次设定范围 //查询上次设定范围
operationLast() { operationLast() {
let req = {}; let req = {};
vm.GET("portal/scope/v1/" + this.projectId + "/operation/last", req).then( vm
res => { .GET("portal/scope/v1/" + this.projectId + "/operation/last", req)
.then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.scopeReq = res.data.scopeReq; this.scopeReq = res.data.scopeReq;
//console.log(this.scopeReq); //console.log(this.scopeReq);
//operationData.getDivision(res.data.scopeReq.scopeOfAdministrative); //operationData.getDivision(res.data.scopeReq.scopeOfAdministrative);
this.setKindOfOrganizationLast = this.scopeReq.setKindOfOrganization; this.setKindOfOrganizationLast = this.scopeReq.setKindOfOrganization;
this.setKindOfPeopleLast = this.scopeReq.setKindOfPeople; this.setKindOfPeopleLast = this.scopeReq.setKindOfPeople;
this.scopeOfOrganizationLast = operationData.getDivision(this.scopeReq.scopeOfOrganization); this.scopeOfOrganizationLast = operationData.getDivision(
this.scopeOfPeopleLast = operationData.getDivision(this.scopeReq.scopeOfPeople); this.scopeReq.scopeOfOrganization
);
this.scopeOfPeopleLast = operationData.getDivision(
this.scopeReq.scopeOfPeople
);
//this.changedOrganization = list; //this.changedOrganization = list;
} }
} });
);
}, },
//查询组件证书信息 //查询组件证书信息
getComponentInfo() { getComponentInfo() {
let param = {}; let param = {};
let projectIdValue = vm.projectId; let projectIdValue = vm.projectId;
if(projectIdValue == null) { if (projectIdValue == null) {
projectIdValue = 0; projectIdValue = 0;
} }
vm.GET("portal/portalInfo/getComponentInfo/" + projectIdValue, param).then(res => { vm
.GET("portal/portalInfo/getComponentInfo/" + projectIdValue, param)
.then(res => {
if (res.code == "000000") { if (res.code == "000000") {
//console.log(res); //console.log(res);
let componentList = res.data.componentList; let componentList = res.data.componentList;
...@@ -1744,23 +1767,25 @@ export default { ...@@ -1744,23 +1767,25 @@ export default {
certificateType: this.formExam.passType == 2 ? 2 : 1, certificateType: this.formExam.passType == 2 ? 2 : 1,
getCertificateRule: [], getCertificateRule: [],
courseRequire: this.formComponent.courseRequire, courseRequire: this.formComponent.courseRequire,
passType:this.formExam.passType passType: this.formExam.passType
}; };
if(this.formExam.passType == 2){ if (this.formExam.passType == 2) {
param.passAverageScore = this.formComponent.passAverageScore param.passAverageScore = this.formComponent.passAverageScore;
param.passExamCount = this.formComponent.passExamCount param.passExamCount = this.formComponent.passExamCount;
} }
if(this.formExam.passType == 3){ if (this.formExam.passType == 3) {
param.passTotalLearnTime = this.formComponent.passTotalLearnTime param.passTotalLearnTime = this.formComponent.passTotalLearnTime;
} }
// console.log('排序后',vm.tagsComponent,'param',param); // console.log('排序后',vm.tagsComponent,'param',param);
if(this.formComponent.configure == 1) { if (this.formComponent.configure == 1) {
// 2.多证书有规 // 2.多证书有规
if(this.formExam.passType == 2) { if (this.formExam.passType == 2) {
let ruleData = vm.formExam.exam; let ruleData = vm.formExam.exam;
for(let o=0;o<ruleData.length;o++) { for (let o = 0; o < ruleData.length; o++) {
if(ruleData[o].certificateId != '' && ruleData[o].certificateId != null) { if (
ruleData[o].certificateId != "" &&
ruleData[o].certificateId != null
) {
param.certificateId[o] = ruleData[o].certificateId; param.certificateId[o] = ruleData[o].certificateId;
} }
param.getCertificateRule[o] = { param.getCertificateRule[o] = {
...@@ -1769,13 +1794,15 @@ export default { ...@@ -1769,13 +1794,15 @@ export default {
examCount: ruleData[o].examCount, examCount: ruleData[o].examCount,
portalProjectId: this.projectId, portalProjectId: this.projectId,
rangeMax: ruleData[o].rangeMax, rangeMax: ruleData[o].rangeMax,
rangeMin: ruleData[o].rangeMin, rangeMin: ruleData[o].rangeMin
} };
}
} }
} else {
// 1.单证书无规则 // 1.单证书无规则
else { if (
if(this.formComponent.certificate != '' && this.formComponent.certificate != null) { this.formComponent.certificate != "" &&
this.formComponent.certificate != null
) {
param.certificateId[0] = this.formComponent.certificate; param.certificateId[0] = this.formComponent.certificate;
} }
} }
...@@ -1789,11 +1816,11 @@ export default { ...@@ -1789,11 +1816,11 @@ export default {
if (res.code == "000000") { if (res.code == "000000") {
//notify //notify
if (type == 2) { if (type == 2) {
let query = {} let query = {};
if(this.$route.query.pageNum){ if (this.$route.query.pageNum) {
query = {pageNum:this.$route.query.pageNum} query = { pageNum: this.$route.query.pageNum };
} }
this.$router.push({ path: 'item-manager',query:query }) this.$router.push({ path: "item-manager", query: query });
// this.$router.push("item-manager?pageNum="+this.$route.query.pageNum); // this.$router.push("item-manager?pageNum="+this.$route.query.pageNum);
} }
} }
...@@ -1810,9 +1837,9 @@ export default { ...@@ -1810,9 +1837,9 @@ export default {
this.getDepartment(); this.getDepartment();
} else if (active == 2) { } else if (active == 2) {
this.stepData = [false, false, true]; this.stepData = [false, false, true];
setTimeout(function(){ setTimeout(function() {
vm.tagDrop(); vm.tagDrop();
},800); }, 800);
} }
}, },
//点击暂存 //点击暂存
...@@ -1851,27 +1878,27 @@ export default { ...@@ -1851,27 +1878,27 @@ export default {
} }
} else if (this.active == 1) { } else if (this.active == 1) {
//暂存步骤2 //暂存步骤2
if(this.formData.scopeType == 1) { if (this.formData.scopeType == 1) {
//小生态暂存 //小生态暂存
if(this.formEcology.ecology == '') { if (this.formEcology.ecology == "") {
vm.$message.info('完成'); vm.$message.info("完成");
} else { } else {
let req = {}; let req = {};
req.ecology = []; req.ecology = [];
req.ecology[0] = this.formEcology.ecology; req.ecology[0] = this.formEcology.ecology;
vm.POST("portal/scope/v1/"+this.projectId+"/organization", req).then( vm
res => { .POST("portal/scope/v1/" + this.projectId + "/organization", req)
.then(res => {
//console.log('设定小生态范围',res); //console.log('设定小生态范围',res);
vm.$message.info(res.message); vm.$message.info(res.message);
} });
);
} }
return; return;
} }
if(this.tagsRegion.length == 0) { if (this.tagsRegion.length == 0) {
vm.$message({ vm.$message({
type: "info", type: "info",
message: '成功', message: "成功"
}); });
return; return;
} }
...@@ -1884,7 +1911,7 @@ export default { ...@@ -1884,7 +1911,7 @@ export default {
// flag: this.flagCover, // flag: this.flagCover,
scopeOfAdministrative: this.getScope("administrativeUpdate"), scopeOfAdministrative: this.getScope("administrativeUpdate"),
scopeOfDepartment: this.getScopeDepartment(), scopeOfDepartment: this.getScopeDepartment(),
flag: 1, //0:下一步 1:暂存 flag: 1 //0:下一步 1:暂存
}; };
// if (req.setKindOfAdministrative == 3) { // if (req.setKindOfAdministrative == 3) {
// req.scopeOfAdministrative = this.getScope("administrativeUpdate"); // req.scopeOfAdministrative = this.getScope("administrativeUpdate");
...@@ -1924,8 +1951,8 @@ export default { ...@@ -1924,8 +1951,8 @@ export default {
// vm.$router.push({ path: "item-manager" }); // vm.$router.push({ path: "item-manager" });
// return; // return;
// } // }
console.log('this.peopleLevel',this.peopleLevel); console.log("this.peopleLevel", this.peopleLevel);
if (this.peopleLevel == 'L3') { if (this.peopleLevel == "L3") {
vm.$message.info("完成"); vm.$message.info("完成");
vm.$router.push({ path: "item-manager" }); vm.$router.push({ path: "item-manager" });
return; return;
...@@ -1959,7 +1986,11 @@ export default { ...@@ -1959,7 +1986,11 @@ export default {
vm.uploadImgMessage2 = false; vm.uploadImgMessage2 = false;
} }
//console.log("判断移动" + removeState); //console.log("判断移动" + removeState);
if (removeState === true && vm.formData.attachmentUrl1!='' && vm.formData.attachmentUrl2!='') { if (
removeState === true &&
vm.formData.attachmentUrl1 != "" &&
vm.formData.attachmentUrl2 != ""
) {
//校验名字 //校验名字
let projectId = vm.getUrlSearch(window.location.href, "projectId"); let projectId = vm.getUrlSearch(window.location.href, "projectId");
if (projectId == null) { if (projectId == null) {
...@@ -1987,28 +2018,28 @@ export default { ...@@ -1987,28 +2018,28 @@ export default {
} }
} else if (this.active == 1) { } else if (this.active == 1) {
//进入第三步 //进入第三步
if(this.formData.scopeType == 1) { if (this.formData.scopeType == 1) {
//设定小生态范围 //设定小生态范围
if(this.formEcology.ecology == '') { if (this.formEcology.ecology == "") {
vm.$message({ vm.$message({
type: "info", type: "info",
message: "请选择小生态范围", message: "请选择小生态范围"
}); });
return; return;
} }
let req = {}; let req = {};
req.ecology = []; req.ecology = [];
req.ecology[0] = this.formEcology.ecology; req.ecology[0] = this.formEcology.ecology;
vm.POST("portal/scope/v1/"+this.projectId+"/organization", req).then( vm
res => { .POST("portal/scope/v1/" + this.projectId + "/organization", req)
console.log('设定小生态范围',res); .then(res => {
console.log("设定小生态范围", res);
if (res.code == "000000") { if (res.code == "000000") {
this.active++; this.active++;
this.stepData = [false, false, true]; this.stepData = [false, false, true];
this.tagDrop(); this.tagDrop();
} }
} });
);
return; return;
} }
if (this.idType == 1) { if (this.idType == 1) {
...@@ -2024,7 +2055,7 @@ export default { ...@@ -2024,7 +2055,7 @@ export default {
// flag: this.flagCover, // flag: this.flagCover,
scopeOfAdministrative: this.getScope("administrativeUpdate"), scopeOfAdministrative: this.getScope("administrativeUpdate"),
scopeOfDepartment: this.getScopeDepartment(), scopeOfDepartment: this.getScopeDepartment(),
flag: 0, //0:下一步 1:暂存 flag: 0 //0:下一步 1:暂存
}; };
// if (req.setKindOfAdministrative == 3) { // if (req.setKindOfAdministrative == 3) {
// req.scopeOfAdministrative = this.getScope("administrativeUpdate"); // req.scopeOfAdministrative = this.getScope("administrativeUpdate");
...@@ -2051,12 +2082,12 @@ export default { ...@@ -2051,12 +2082,12 @@ export default {
//移动到选择项目组件 //移动到选择项目组件
//console.log(res); //console.log(res);
let statusMove = this.scopeStatus(res.data.status); let statusMove = this.scopeStatus(res.data.status);
if(statusMove === 0) { if (statusMove === 0) {
this.active++; this.active++;
this.stepData = [false, false, true]; this.stepData = [false, false, true];
this.tagDrop(); this.tagDrop();
} else { } else {
console.log('不能改变范围status:'+res.data.status) console.log("不能改变范围status:" + res.data.status);
} }
} else { } else {
vm.$message({ vm.$message({
...@@ -2085,7 +2116,7 @@ export default { ...@@ -2085,7 +2116,7 @@ export default {
// flag: this.flagCover, // flag: this.flagCover,
scopeOfAdministrative: null, scopeOfAdministrative: null,
scopeOfDepartment: this.getScopeDepartment(), scopeOfDepartment: this.getScopeDepartment(),
flag: 0, //0:下一步 1:暂存 flag: 0 //0:下一步 1:暂存
}; };
// if ( // if (
// req.setKindOfOrganization == 2 || // req.setKindOfOrganization == 2 ||
...@@ -2108,12 +2139,12 @@ export default { ...@@ -2108,12 +2139,12 @@ export default {
if (res.code == "000000") { if (res.code == "000000") {
//移动到选择项目组件 //移动到选择项目组件
let statusMove = this.scopeStatus(res.data.status); let statusMove = this.scopeStatus(res.data.status);
if(statusMove === 0) { if (statusMove === 0) {
this.active++; this.active++;
this.stepData = [false, false, true]; this.stepData = [false, false, true];
this.tagDrop(); this.tagDrop();
} else { } else {
console.log('不能改变范围status:'+res.data.status) console.log("不能改变范围status:" + res.data.status);
} }
} else { } else {
vm.$message({ vm.$message({
...@@ -2132,8 +2163,8 @@ export default { ...@@ -2132,8 +2163,8 @@ export default {
//上传列表图片 //上传列表图片
beforeUploadListPic(file) { beforeUploadListPic(file) {
let fileLimit = { let fileLimit = {
width: 230, // width: 230,
height: 172, // height: 172,
size: 0.5, size: 0.5,
sizeText: "500K", sizeText: "500K",
key: "attachmentUrl1", key: "attachmentUrl1",
...@@ -2145,8 +2176,8 @@ export default { ...@@ -2145,8 +2176,8 @@ export default {
//上传封面图片 //上传封面图片
beforeUploadCoverPic(file) { beforeUploadCoverPic(file) {
let fileLimit = { let fileLimit = {
width: 750, // width: 750,
height: 420, // height: 420,
size: 2, size: 2,
sizeText: "2.0M", sizeText: "2.0M",
key: "attachmentUrl2", key: "attachmentUrl2",
...@@ -2211,7 +2242,7 @@ export default { ...@@ -2211,7 +2242,7 @@ export default {
getFilePath(file, null), getFilePath(file, null),
"preview4", "preview4",
"progress1", "progress1",
'' ""
).then(function(path) { ).then(function(path) {
closeLoading(vm); closeLoading(vm);
console.log(path); console.log(path);
...@@ -2228,11 +2259,11 @@ export default { ...@@ -2228,11 +2259,11 @@ export default {
const isLt2M = file.size / 1024 / 1024 < fileLimit.size; const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) { if (!isJPG && !isPNG) {
this.$message.error("图片不符合规范,请根据规范上传图片"); this.$message.error("图片不符合规范,请根据规范上传图片");
return; // return;
} }
if (!isLt2M) { if (!isLt2M) {
this.$message.error("图片不符合规范,请根据规范上传图片 "); this.$message.error("图片不符合规范,请根据规范上传图片 ");
return; // return;
} }
let _img = new FileReader(); let _img = new FileReader();
_img.readAsDataURL(file); _img.readAsDataURL(file);
...@@ -2241,9 +2272,9 @@ export default { ...@@ -2241,9 +2272,9 @@ export default {
image.src = theFile.target.result; image.src = theFile.target.result;
image.onload = function() { image.onload = function() {
let _this = this; let _this = this;
if ( if ( false
_this.width != fileLimit.width || // _this.width != fileLimit.width ||
_this.height != fileLimit.height // _this.height != fileLimit.height
) { ) {
vm.$message.error("图片不符合规范,请根据规范上传图片"); vm.$message.error("图片不符合规范,请根据规范上传图片");
} else { } else {
...@@ -2284,10 +2315,8 @@ export default { ...@@ -2284,10 +2315,8 @@ export default {
} }
} }
}, },
handlePreview(file) { handlePreview(file) {},
}, handleExceed(files, fileList) {},
handleExceed(files, fileList) {
},
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`); return this.$confirm(`确定移除 ${file.name}?`);
}, },
...@@ -2315,9 +2344,9 @@ export default { ...@@ -2315,9 +2344,9 @@ export default {
if (tabName == "second") { if (tabName == "second") {
//设定机构 //设定机构
this.formOrganization.pageNum = 1; this.formOrganization.pageNum = 1;
this.formOrganization.name =""; this.formOrganization.name = "";
this.formOrganization.administrativeIdList = ['0']; this.formOrganization.administrativeIdList = ["0"];
this.formOrganization.level ="-1"; this.formOrganization.level = "-1";
this.getCheckedTree(); this.getCheckedTree();
this.getOrganization(); this.getOrganization();
// this.listLevels(); // this.listLevels();
...@@ -2341,11 +2370,11 @@ export default { ...@@ -2341,11 +2370,11 @@ export default {
}, },
//获取勾选树 //获取勾选树
getCheckedTree() { getCheckedTree() {
if(this.idType != 2) { if (this.idType != 2) {
let allTree = JSON.parse(JSON.stringify(this.treeData[0].children)); let allTree = JSON.parse(JSON.stringify(this.treeData[0].children));
let changedTags = JSON.parse(JSON.stringify(this.tagsRegion)); let changedTags = JSON.parse(JSON.stringify(this.tagsRegion));
let organizationArea = operationData.treeHandler(allTree,changedTags); let organizationArea = operationData.treeHandler(allTree, changedTags);
console.log('多级树:',organizationArea); console.log("多级树:", organizationArea);
this.organizationRegion = organizationArea; this.organizationRegion = organizationArea;
//改 //改
// this.organizationRegion = operationData.getOrganizationList( // this.organizationRegion = operationData.getOrganizationList(
...@@ -2451,12 +2480,17 @@ export default { ...@@ -2451,12 +2480,17 @@ export default {
getCheckedKeys() { getCheckedKeys() {
console.log(this.$refs.tree.getCheckedKeys()); console.log(this.$refs.tree.getCheckedKeys());
}, },
onChecked(node,data) { onChecked(node, data) {
vm.checkUpdate(node,data); vm.checkUpdate(node, data);
//重构归并树 //重构归并树
let checkedTree = operationData.getSimpleCheckedNodes(this.$refs.tree.store); let checkedTree = operationData.getSimpleCheckedNodes(
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys() this.$refs.tree.store
let allSelectedKeys = operationData.setSelectedKeys(checkedTree,halfCheckedTree); );
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys();
let allSelectedKeys = operationData.setSelectedKeys(
checkedTree,
halfCheckedTree
);
//重构内容 //重构内容
this.allSelectedKeys = allSelectedKeys; this.allSelectedKeys = allSelectedKeys;
...@@ -2468,9 +2502,14 @@ export default { ...@@ -2468,9 +2502,14 @@ export default {
}, },
getTreeCheck() { getTreeCheck() {
//重构归并树 //重构归并树
let checkedTree = operationData.getSimpleCheckedNodes(this.$refs.tree.store); let checkedTree = operationData.getSimpleCheckedNodes(
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys() this.$refs.tree.store
let allSelectedKeys = operationData.setSelectedKeys(checkedTree,halfCheckedTree); );
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys();
let allSelectedKeys = operationData.setSelectedKeys(
checkedTree,
halfCheckedTree
);
vm.allSelectedKeys = allSelectedKeys; vm.allSelectedKeys = allSelectedKeys;
//重构内容 //重构内容
return allSelectedKeys; return allSelectedKeys;
...@@ -2501,10 +2540,12 @@ export default { ...@@ -2501,10 +2540,12 @@ export default {
// console.log(res); // console.log(res);
this.organizationRank = operationData.getLevelList(res.data.list); this.organizationRank = operationData.getLevelList(res.data.list);
} else { } else {
this.organizationRank = [{ this.organizationRank = [
id: '0', {
label: '全部医院等级', id: "0",
}]; label: "全部医院等级"
}
];
} }
}); });
}, },
...@@ -2572,12 +2613,7 @@ export default { ...@@ -2572,12 +2613,7 @@ export default {
this.lookedPerson, this.lookedPerson,
this.changedPerson this.changedPerson
); );
console.log( console.log("选", this.changedPerson, "没", this.changedPerson2);
"选",
this.changedPerson,
"没",
this.changedPerson2
);
}, },
//改变小生态 table check //改变小生态 table check
...@@ -2595,12 +2631,7 @@ export default { ...@@ -2595,12 +2631,7 @@ export default {
this.lookedEcology, this.lookedEcology,
this.changedEcology this.changedEcology
); );
console.log( console.log("选", this.changedEcology, "没", this.changedEcology2);
"选",
this.changedEcology,
"没",
this.changedEcology2
);
}, },
resetPeople() { resetPeople() {
this.checkTableState.multiplePerson = ""; this.checkTableState.multiplePerson = "";
...@@ -2617,10 +2648,10 @@ export default { ...@@ -2617,10 +2648,10 @@ export default {
kind = 3; kind = 3;
} }
//console.log('this.idTypeProject',this.idTypeProject); //console.log('this.idTypeProject',this.idTypeProject);
if(this.idTypeProject == 2 && this.tagsRegion.length == 0) { if (this.idTypeProject == 2 && this.tagsRegion.length == 0) {
kind = 0; kind = 0;
} }
if(this.idType == 2) { if (this.idType == 2) {
kind = 0; kind = 0;
} }
} else if (type == "administrativeScope") { } else if (type == "administrativeScope") {
...@@ -2628,10 +2659,10 @@ export default { ...@@ -2628,10 +2659,10 @@ export default {
if (this.tagsRegion.length > 0) { if (this.tagsRegion.length > 0) {
kind = 3; kind = 3;
} }
if(this.idTypeProject == 2 && this.tagsRegion.length == 0) { if (this.idTypeProject == 2 && this.tagsRegion.length == 0) {
kind = 0; kind = 0;
} }
if(this.idType == 2) { if (this.idType == 2) {
kind = 0; kind = 0;
} }
} else if (type == "organization") { } else if (type == "organization") {
...@@ -2648,16 +2679,16 @@ export default { ...@@ -2648,16 +2679,16 @@ export default {
if (this.changedOrganization2.length > 0) { if (this.changedOrganization2.length > 0) {
kind = 2; kind = 2;
} }
} else if(this.checkTableState.multipleOrganization === '') { } else if (this.checkTableState.multipleOrganization === "") {
kind = this.setKindOfOrganizationLast; kind = this.setKindOfOrganizationLast;
if(this.setKindOfOrganizationLast === -1) { if (this.setKindOfOrganizationLast === -1) {
kind = 1; kind = 1;
} }
//初始化0或1 //初始化0或1
if(kind == 0 && this.changedOrganization.length > 0) { if (kind == 0 && this.changedOrganization.length > 0) {
kind = 3; kind = 3;
} }
if(kind == 1 && this.changedOrganization2.length > 0) { if (kind == 1 && this.changedOrganization2.length > 0) {
kind = 2; kind = 2;
} }
} }
...@@ -2679,16 +2710,16 @@ export default { ...@@ -2679,16 +2710,16 @@ export default {
if (this.changedPerson2.length > 0) { if (this.changedPerson2.length > 0) {
kind = 2; kind = 2;
} }
} else if(this.checkTableState.multiplePerson === '') { } else if (this.checkTableState.multiplePerson === "") {
kind = this.setKindOfPeopleLast; kind = this.setKindOfPeopleLast;
if(this.setKindOfPeopleLast === -1) { if (this.setKindOfPeopleLast === -1) {
kind = 1; kind = 1;
} }
//初始化0或1 //初始化0或1
if(kind == 0 && this.changedPerson.length > 0) { if (kind == 0 && this.changedPerson.length > 0) {
kind = 3; kind = 3;
} }
if(kind == 1 && this.changedPerson2.length > 0) { if (kind == 1 && this.changedPerson2.length > 0) {
kind = 2; kind = 2;
} }
} }
...@@ -2697,7 +2728,7 @@ export default { ...@@ -2697,7 +2728,7 @@ export default {
}, },
//设定的行政范围内容 //设定的行政范围内容
getScope(type) { getScope(type) {
if(vm.idType == 2) { if (vm.idType == 2) {
return null; return null;
} }
let scope = ""; let scope = "";
...@@ -2710,7 +2741,7 @@ export default { ...@@ -2710,7 +2741,7 @@ export default {
} }
} }
} else if (type == "administrativeUpdate") { } else if (type == "administrativeUpdate") {
console.log('this.allSelectedKeys',this.allSelectedKeys); console.log("this.allSelectedKeys", this.allSelectedKeys);
if (this.allSelectedKeys.length > 0) { if (this.allSelectedKeys.length > 0) {
for (let i = 0; i < this.allSelectedKeys.length; i++) { for (let i = 0; i < this.allSelectedKeys.length; i++) {
scope += scope +=
...@@ -2721,8 +2752,8 @@ export default { ...@@ -2721,8 +2752,8 @@ export default {
} }
} else { } else {
// let noChangeTree = this.getTreeCheck(); // let noChangeTree = this.getTreeCheck();
console.log('noChangeTree值',noChangeTree); console.log("noChangeTree值", noChangeTree);
if(noChangeTree.length > 0) { if (noChangeTree.length > 0) {
for (let i = 0; i < noChangeTree.length; i++) { for (let i = 0; i < noChangeTree.length; i++) {
scope += noChangeTree[i].key + ":" + noChangeTree[i].type; scope += noChangeTree[i].key + ":" + noChangeTree[i].type;
if (i < noChangeTree.length - 1) { if (i < noChangeTree.length - 1) {
...@@ -2731,15 +2762,15 @@ export default { ...@@ -2731,15 +2762,15 @@ export default {
} }
} else { } else {
//选全国项目 //选全国项目
if(this.tagsRegion.length > 0 && this.tagsRegion[0].key == '000') { if (this.tagsRegion.length > 0 && this.tagsRegion[0].key == "000") {
scope = '000:1'; scope = "000:1";
console.log(this.tagsRegion,'scope',scope); console.log(this.tagsRegion, "scope", scope);
} }
} }
} }
} }
//console.log(scope); //console.log(scope);
if(scope == "") { if (scope == "") {
return null; return null;
} }
return scope; return scope;
...@@ -2760,31 +2791,39 @@ export default { ...@@ -2760,31 +2791,39 @@ export default {
let searchForm = this.formOrganization; let searchForm = this.formOrganization;
if ( if (
searchForm.administrativeId == "0" && searchForm.administrativeId == "0" &&
searchForm.administrativeIdList[searchForm.administrativeIdList.length-1] == "0" && searchForm.administrativeIdList[
searchForm.administrativeIdList.length - 1
] == "0" &&
searchForm.level == "-1" && searchForm.level == "-1" &&
searchForm.name == "" searchForm.name == ""
) { ) {
this.searchOrganizationType = ''; this.searchOrganizationType = "";
this.getOrganization(); this.getOrganization();
} else { } else {
this.searchOrganizationType = 'choose'; this.searchOrganizationType = "choose";
this.getOrganizationChoose(); this.getOrganizationChoose();
} }
}, },
//初始化搜索机构状态 //初始化搜索机构状态
initOrganizationChoose() { initOrganizationChoose() {
let tableStatus = this.tableOrganization; let tableStatus = this.tableOrganization;
if(typeof tableStatus === 'undefined') { if (typeof tableStatus === "undefined") {
return; return;
} }
tableStatus.forEach(row => { tableStatus.forEach(row => {
let idList = []; let idList = [];
idList[0] = row.id; idList[0] = row.id;
//console.log('this.changedOrganization2',this.changedOrganization2); //console.log('this.changedOrganization2',this.changedOrganization2);
let intersect = operationData.getIntersect(idList,this.changedOrganization); let intersect = operationData.getIntersect(
let intersect2 = operationData.getIntersect(idList,this.changedOrganization2); idList,
this.changedOrganization
);
let intersect2 = operationData.getIntersect(
idList,
this.changedOrganization2
);
//debugger; //debugger;
if(intersect.length > 0) { if (intersect.length > 0) {
//选中 //选中
//this.$refs.multipleOrganization.toggleRowSelection(row); //this.$refs.multipleOrganization.toggleRowSelection(row);
} else if (intersect2.length > 0) { } else if (intersect2.length > 0) {
...@@ -2801,7 +2840,9 @@ export default { ...@@ -2801,7 +2840,9 @@ export default {
//机构搜索 //机构搜索
getOrganizationChoose() { getOrganizationChoose() {
// console.log('formOrganization',this.formOrganization); // console.log('formOrganization',this.formOrganization);
let administrativeIdItem = operationData.setAdministrativeId(this.formOrganization.administrativeIdList); let administrativeIdItem = operationData.setAdministrativeId(
this.formOrganization.administrativeIdList
);
let req = { let req = {
projectId: this.projectId, projectId: this.projectId,
administrativeId: administrativeIdItem, administrativeId: administrativeIdItem,
...@@ -2809,7 +2850,7 @@ export default { ...@@ -2809,7 +2850,7 @@ export default {
hospitalName: this.formOrganization.name, hospitalName: this.formOrganization.name,
pageNum: this.formOrganization.pageNum, pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize, pageSize: this.formOrganization.pageSize,
scope: this.getScope("administrative"), scope: this.getScope("administrative")
}; };
openLoading(vm); openLoading(vm);
// vm.POST("portal/scope/v1/organization/choose", req).then(res => { // vm.POST("portal/scope/v1/organization/choose", req).then(res => {
...@@ -2830,9 +2871,9 @@ export default { ...@@ -2830,9 +2871,9 @@ export default {
getOrganization() { getOrganization() {
let req = { let req = {
projectId: this.projectId, projectId: this.projectId,
administrativeId: '', administrativeId: "",
hospitalLevel: '', hospitalLevel: "",
hospitalLevel: '', hospitalLevel: "",
scope: this.getScope("administrative"), scope: this.getScope("administrative"),
pageNum: this.formOrganization.pageNum, pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize pageSize: this.formOrganization.pageSize
...@@ -2847,7 +2888,7 @@ export default { ...@@ -2847,7 +2888,7 @@ export default {
vm.initOrganizationStatus(); vm.initOrganizationStatus();
} else { } else {
vm.$message(res.message) vm.$message(res.message);
} }
}); });
}, },
...@@ -2859,7 +2900,7 @@ export default { ...@@ -2859,7 +2900,7 @@ export default {
vm.GET("portal/scope/v1/department", req).then(res => { vm.GET("portal/scope/v1/department", req).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.tableDepartment = res.data.department; this.tableDepartment = res.data.department;
if(vm.peopleLevel != 'L3' || vm.idType != 2) { if (vm.peopleLevel != "L3" || vm.idType != 2) {
let rowCheck = this.tableDepartment; let rowCheck = this.tableDepartment;
rowCheck.forEach(row => { rowCheck.forEach(row => {
if (row.status == 1) { if (row.status == 1) {
...@@ -2878,17 +2919,29 @@ export default { ...@@ -2878,17 +2919,29 @@ export default {
//2:去掉 3:选中 //2:去掉 3:选中
if (type == 2) { if (type == 2) {
// console.log(this.scopeOfOrganizationLast,this.changedOrganization); // console.log(this.scopeOfOrganizationLast,this.changedOrganization);
let differenceScope = operationData.getDifference(this.scopeOfOrganizationLast,this.changedOrganization); let differenceScope = operationData.getDifference(
this.scopeOfOrganizationLast,
this.changedOrganization
);
//console.log('differenceScope',differenceScope); //console.log('differenceScope',differenceScope);
let unionScope = operationData.getUnion(this.changedOrganization2,differenceScope); let unionScope = operationData.getUnion(
this.changedOrganization2,
differenceScope
);
//console.log('unionScope',unionScope); //console.log('unionScope',unionScope);
for (let i = 0; i < unionScope.length; i++) { for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|"; scope += unionScope[i] + "|";
} }
} else if (type == 3) { } else if (type == 3) {
console.log(this.scopeOfOrganizationLast,this.changedOrganization2); console.log(this.scopeOfOrganizationLast, this.changedOrganization2);
let differenceScope = operationData.getDifference(this.scopeOfOrganizationLast,this.changedOrganization2); let differenceScope = operationData.getDifference(
let unionScope = operationData.getUnion(this.changedOrganization,differenceScope); this.scopeOfOrganizationLast,
this.changedOrganization2
);
let unionScope = operationData.getUnion(
this.changedOrganization,
differenceScope
);
for (let i = 0; i < unionScope.length; i++) { for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|"; scope += unionScope[i] + "|";
} }
...@@ -2902,16 +2955,28 @@ export default { ...@@ -2902,16 +2955,28 @@ export default {
let scope = ""; let scope = "";
//2:去掉 3:选中 //2:去掉 3:选中
if (type == 2) { if (type == 2) {
let differenceScope = operationData.getDifference(this.scopeOfPeopleLast,this.changedPerson); let differenceScope = operationData.getDifference(
this.scopeOfPeopleLast,
this.changedPerson
);
//console.log('differenceScope',differenceScope); //console.log('differenceScope',differenceScope);
let unionScope = operationData.getUnion(this.changedPerson2,differenceScope); let unionScope = operationData.getUnion(
this.changedPerson2,
differenceScope
);
for (let i = 0; i < unionScope.length; i++) { for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|"; scope += unionScope[i] + "|";
} }
} else if (type == 3) { } else if (type == 3) {
//console.log(this.changedPerson2,this.scopeOfPeople); //console.log(this.changedPerson2,this.scopeOfPeople);
let differenceScope = operationData.getDifference(this.scopeOfPeopleLast,this.changedPerson2); let differenceScope = operationData.getDifference(
let unionScope = operationData.getUnion(this.changedPerson,differenceScope); this.scopeOfPeopleLast,
this.changedPerson2
);
let unionScope = operationData.getUnion(
this.changedPerson,
differenceScope
);
// debugger; // debugger;
for (let i = 0; i < unionScope.length; i++) { for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|"; scope += unionScope[i] + "|";
...@@ -2925,10 +2990,12 @@ export default { ...@@ -2925,10 +2990,12 @@ export default {
//获取科室列表 //获取科室列表
getScopeDepartment() { getScopeDepartment() {
let scope = ""; let scope = "";
if(this.multipleSelectionDepartment.length == this.tableDepartment.length) { if (
this.multipleSelectionDepartment.length == this.tableDepartment.length
) {
return 99999999; return 99999999;
} }
if(this.multipleSelectionDepartment.length == 0) { if (this.multipleSelectionDepartment.length == 0) {
return null; return null;
} }
for (let i = 0; i < this.multipleSelectionDepartment.length; i++) { for (let i = 0; i < this.multipleSelectionDepartment.length; i++) {
...@@ -2959,30 +3026,30 @@ export default { ...@@ -2959,30 +3026,30 @@ export default {
searchPeople() { searchPeople() {
this.formPerson.pageNum = 1; this.formPerson.pageNum = 1;
let searchForm = this.formPerson; let searchForm = this.formPerson;
if ( if (searchForm.hospitalName === "" && searchForm.doctorName === "") {
searchForm.hospitalName === "" && this.searchPeopleType = "";
searchForm.doctorName === ""
) {
this.searchPeopleType = '';
this.getPeople(); this.getPeople();
} else { } else {
this.searchPeopleType = 'choose'; this.searchPeopleType = "choose";
this.getPeopleChoose(); this.getPeopleChoose();
} }
}, },
//初始化搜索人员状态 //初始化搜索人员状态
initPeopleChoose() { initPeopleChoose() {
let tableStatus = this.tablePerson; let tableStatus = this.tablePerson;
if(typeof tableStatus === 'undefined') { if (typeof tableStatus === "undefined") {
return; return;
} }
tableStatus.forEach(row => { tableStatus.forEach(row => {
let idList = []; let idList = [];
idList[0] = row.id; idList[0] = row.id;
let intersect = operationData.getIntersect(idList,this.changedPerson); let intersect = operationData.getIntersect(idList, this.changedPerson);
let intersect2 = operationData.getIntersect(idList,this.changedPerson2); let intersect2 = operationData.getIntersect(
idList,
this.changedPerson2
);
// debugger; // debugger;
if(intersect.length > 0) { if (intersect.length > 0) {
//选中 //选中
//this.$refs.multiplePerson.toggleRowSelection(row); //this.$refs.multiplePerson.toggleRowSelection(row);
} else if (intersect2.length > 0) { } else if (intersect2.length > 0) {
...@@ -3006,7 +3073,7 @@ export default { ...@@ -3006,7 +3073,7 @@ export default {
doctorName: this.formPerson.doctorName, doctorName: this.formPerson.doctorName,
hospitalName: this.formPerson.hospitalName, hospitalName: this.formPerson.hospitalName,
scopeOfAdministrative: this.getScope("administrative"), scopeOfAdministrative: this.getScope("administrative"),
scopeOfDepartment: this.getScopeDepartment(), scopeOfDepartment: this.getScopeDepartment()
}; };
openLoading(vm); openLoading(vm);
// vm.POST("portal/scope/v1/people/choose", req).then(res => { // vm.POST("portal/scope/v1/people/choose", req).then(res => {
...@@ -3017,7 +3084,7 @@ export default { ...@@ -3017,7 +3084,7 @@ export default {
this.totalPerson = res.data.total; this.totalPerson = res.data.total;
vm.initPeopleStatus(); vm.initPeopleStatus();
} else { } else {
vm.$message(res.message) vm.$message(res.message);
} }
}); });
}, },
...@@ -3035,8 +3102,8 @@ export default { ...@@ -3035,8 +3102,8 @@ export default {
getPeople() { getPeople() {
let req = { let req = {
projectId: this.projectId, projectId: this.projectId,
doctorName: '', doctorName: "",
hospitalName: '', hospitalName: "",
scopeOfAdministrative: this.getScope("administrative"), scopeOfAdministrative: this.getScope("administrative"),
scopeOfDepartment: this.getScopeDepartment(), scopeOfDepartment: this.getScopeDepartment(),
pageNum: this.formPerson.pageNum, pageNum: this.formPerson.pageNum,
...@@ -3052,7 +3119,7 @@ export default { ...@@ -3052,7 +3119,7 @@ export default {
this.totalPerson = res.data.total; this.totalPerson = res.data.total;
vm.initPeopleStatus(); vm.initPeopleStatus();
} else { } else {
vm.$message(res.message) vm.$message(res.message);
} }
}); });
}, },
...@@ -3061,7 +3128,7 @@ export default { ...@@ -3061,7 +3128,7 @@ export default {
let list = []; let list = [];
list[0] = { list[0] = {
value: -1, value: -1,
label: '全部科室', label: "全部科室"
}; };
for (let i = 0; i < this.tableDepartment.length; i++) { for (let i = 0; i < this.tableDepartment.length; i++) {
if (this.tableDepartment[i].status == 1) { if (this.tableDepartment[i].status == 1) {
...@@ -3076,8 +3143,8 @@ export default { ...@@ -3076,8 +3143,8 @@ export default {
}, },
//判断项目范围选择 //判断项目范围选择
showScopeType() { showScopeType() {
if(this.projectStatus == '' || this.projectStatus == 1) { if (this.projectStatus == "" || this.projectStatus == 1) {
if(this.peopleLevel != 'L3') { if (this.peopleLevel != "L3") {
return false; return false;
} }
} }
...@@ -3085,8 +3152,12 @@ export default { ...@@ -3085,8 +3152,12 @@ export default {
}, },
//判断通知展示问题 //判断通知展示问题
showNoticeType() { showNoticeType() {
if(this.projectStatus == '' || this.projectStatus == 1 || this.projectStatus == 2) { if (
if(this.peopleLevel != 'L3') { this.projectStatus == "" ||
this.projectStatus == 1 ||
this.projectStatus == 2
) {
if (this.peopleLevel != "L3") {
return false; return false;
} }
} }
...@@ -3094,7 +3165,7 @@ export default { ...@@ -3094,7 +3165,7 @@ export default {
}, },
//判断通知展示问题 //判断通知展示问题
showAllowType() { showAllowType() {
if(this.peopleLevel == 'L3' || this.peopleLevel == 'L0') { if (this.peopleLevel == "L3" || this.peopleLevel == "L0") {
return true; return true;
} }
return false; return false;
...@@ -3103,8 +3174,8 @@ export default { ...@@ -3103,8 +3174,8 @@ export default {
selectChangeEcology(value) { selectChangeEcology(value) {
this.formEcology.pageNum = 1; this.formEcology.pageNum = 1;
//console.log('select',value); //console.log('select',value);
for(let i=0;i<this.ecologySelect.length;i++) { for (let i = 0; i < this.ecologySelect.length; i++) {
if(this.ecologySelect[i].value == value) { if (this.ecologySelect[i].value == value) {
this.checkedEcology = this.ecologySelect[i].label; this.checkedEcology = this.ecologySelect[i].label;
} }
} }
...@@ -3113,29 +3184,32 @@ export default { ...@@ -3113,29 +3184,32 @@ export default {
}, },
getEcologySelect() { getEcologySelect() {
let req = {}; let req = {};
vm.GET("portal/scope/v1/"+this.projectId+"/ecology", req).then( vm
res => { .GET("portal/scope/v1/" + this.projectId + "/ecology", req)
console.log('查询小生态列表',res); .then(res => {
console.log("查询小生态列表", res);
this.ecologySelect = operationData.getEcologySelect(res.data.list); this.ecologySelect = operationData.getEcologySelect(res.data.list);
if(res.data.chooseIdList.length > 0) { if (res.data.chooseIdList.length > 0) {
this.formEcology.ecology = res.data.chooseIdList[0]; this.formEcology.ecology = res.data.chooseIdList[0];
this.getEcology(); this.getEcology();
} }
} });
);
}, },
initEcology() { initEcology() {
let tableStatus = this.tableEcology; let tableStatus = this.tableEcology;
if(typeof tableStatus === 'undefined') { if (typeof tableStatus === "undefined") {
return; return;
} }
tableStatus.forEach(row => { tableStatus.forEach(row => {
let idList = []; let idList = [];
idList[0] = row.id; idList[0] = row.id;
let intersect = operationData.getIntersect(idList,this.changedEcology); let intersect = operationData.getIntersect(idList, this.changedEcology);
let intersect2 = operationData.getIntersect(idList,this.changedEcology2); let intersect2 = operationData.getIntersect(
idList,
this.changedEcology2
);
// debugger; // debugger;
if(intersect.length > 0) { if (intersect.length > 0) {
//选中 //选中
} else if (intersect2.length > 0) { } else if (intersect2.length > 0) {
//不选 //不选
...@@ -3153,10 +3227,11 @@ export default { ...@@ -3153,10 +3227,11 @@ export default {
let req = {}; let req = {};
req = this.formEcology; req = this.formEcology;
openLoading(vm); openLoading(vm);
vm.GET("portal/scope/v1/"+this.projectId+"/organization", req).then( vm
res => { .GET("portal/scope/v1/" + this.projectId + "/organization", req)
.then(res => {
closeLoading(vm); closeLoading(vm);
console.log('根基小生态查询机构列表信息',res); console.log("根基小生态查询机构列表信息", res);
this.tableEcology = res.data.organizationList; this.tableEcology = res.data.organizationList;
this.totalEcology = res.data.total; this.totalEcology = res.data.total;
...@@ -3164,8 +3239,7 @@ export default { ...@@ -3164,8 +3239,7 @@ export default {
tableStatus.forEach(row => { tableStatus.forEach(row => {
this.$refs.multipleEcology.toggleRowSelection(row); this.$refs.multipleEcology.toggleRowSelection(row);
}); });
} });
);
}, },
// //
//机构table修改 //机构table修改
...@@ -3177,7 +3251,7 @@ export default { ...@@ -3177,7 +3251,7 @@ export default {
handleCurrentOrganization(val) { handleCurrentOrganization(val) {
//console.log(`当前页: ${val}`); //console.log(`当前页: ${val}`);
this.formOrganization.pageNum = val; this.formOrganization.pageNum = val;
if(this.searchOrganizationType == 'choose') { if (this.searchOrganizationType == "choose") {
this.getOrganizationChoose(); this.getOrganizationChoose();
} else { } else {
this.getOrganization(); this.getOrganization();
...@@ -3192,7 +3266,7 @@ export default { ...@@ -3192,7 +3266,7 @@ export default {
handleCurrentPerson(val) { handleCurrentPerson(val) {
console.log(`当前页: ${val}`); console.log(`当前页: ${val}`);
this.formPerson.pageNum = val; this.formPerson.pageNum = val;
if(this.searchPeopleType == 'choose') { if (this.searchPeopleType == "choose") {
this.getPeopleChoose(); this.getPeopleChoose();
} else { } else {
this.getPeople(); this.getPeople();
...@@ -3228,22 +3302,23 @@ export default { ...@@ -3228,22 +3302,23 @@ export default {
//console.log('范围提交status:'+data); //console.log('范围提交status:'+data);
let status = data; let status = data;
//console.log('范围提交status:'+status); //console.log('范围提交status:'+status);
if(status === 0) { if (status === 0) {
this.flagCover = 0; this.flagCover = 0;
} else if(status === 1) { } else if (status === 1) {
vm.$message({ vm.$message({
type: "info", type: "info",
message: "您已被上级管理员移除项目,暂无权限操作", message: "您已被上级管理员移除项目,暂无权限操作"
}); });
this.$router.push("item-manager"); this.$router.push("item-manager");
} else if(status === 2) { } else if (status === 2) {
console.log('弹框'); console.log("弹框");
this.flagCover = 1; this.flagCover = 1;
this.dialogShow = true; this.dialogShow = true;
} else if(status === 3) { //3:项目范围没有可参与的人员 } else if (status === 3) {
//3:项目范围没有可参与的人员
vm.$message({ vm.$message({
type: "info", type: "info",
message: "没有选择任何人员", message: "没有选择任何人员"
}); });
} }
return status; return status;
...@@ -3278,7 +3353,7 @@ export default { ...@@ -3278,7 +3353,7 @@ export default {
this.tagsComponent[len] = {}; this.tagsComponent[len] = {};
this.tagsComponent[len].value = this.optionsComponent[j].value; this.tagsComponent[len].value = this.optionsComponent[j].value;
this.tagsComponent[len].name = this.optionsComponent[j].label; this.tagsComponent[len].name = this.optionsComponent[j].label;
if(vm.status4Flag == 1) { if (vm.status4Flag == 1) {
this.optionsComponent[j].disabled = true; this.optionsComponent[j].disabled = true;
this.tagsComponent[len].disabled = true; this.tagsComponent[len].disabled = true;
} }
...@@ -3286,11 +3361,11 @@ export default { ...@@ -3286,11 +3361,11 @@ export default {
} }
} }
} }
console.log('this.optionsComponent值:',this.optionsComponent); console.log("this.optionsComponent值:", this.optionsComponent);
}, },
//选择组件数据绑定 //选择组件数据绑定
handleCloseComponent(tag) { handleCloseComponent(tag) {
if(tag.disabled == true) { if (tag.disabled == true) {
return; return;
} }
// if (this.projectStatus == 1 || this.projectStatus == 2) { // if (this.projectStatus == 1 || this.projectStatus == 2) {
...@@ -3302,44 +3377,46 @@ export default { ...@@ -3302,44 +3377,46 @@ export default {
// } // }
}, },
addCertificate() { addCertificate() {
if(vm.formExam.exam.length == 5){ if (vm.formExam.exam.length == 5) {
return vm.$message('最多配置5个证书'); return vm.$message("最多配置5个证书");
} }
let obj = { let obj = {
examCount: 1, examCount: 1,
rangeMin: '', rangeMin: "",
rangeMax: '', rangeMax: "",
certificateId: '', certificateId: "",
certificateName: '', certificateName: "",
minClass:'', minClass: "",
minError:'', minError: "",
maxClass:'', maxClass: "",
maxError:'', maxError: "",
certClass:'', certClass: "",
certError:'' certError: ""
}; };
vm.formExam.exam.push(obj); vm.formExam.exam.push(obj);
}, },
reduceCertificate(index) { reduceCertificate(index) {
// console.log(index); // console.log(index);
if(vm.formExam.exam.length > 1) { if (vm.formExam.exam.length > 1) {
vm.formExam.exam.splice(index,1); vm.formExam.exam.splice(index, 1);
} else { } else {
vm.$message('至少配置1个证书'); vm.$message("至少配置1个证书");
} }
}, },
//考试门数更新校验 //考试门数更新校验
updateCount(index) { updateCount(index) {
if(vm.formExam.exam[index].examCount) { if (vm.formExam.exam[index].examCount) {
vm.formExam.exam[index].examCount = parseInt(vm.formExam.exam[index].examCount); vm.formExam.exam[index].examCount = parseInt(
if(!Number.isInteger(vm.formExam.exam[index].examCount)){ vm.formExam.exam[index].examCount
vm.formExam.exam[index].examCount = ''; );
if (!Number.isInteger(vm.formExam.exam[index].examCount)) {
vm.formExam.exam[index].examCount = "";
} }
if(vm.formExam.exam[index].examCount <= 0) { if (vm.formExam.exam[index].examCount <= 0) {
vm.formExam.exam[index].examCount = ''; vm.formExam.exam[index].examCount = "";
} }
if(vm.formExam.exam[index].examCount != '') { if (vm.formExam.exam[index].examCount != "") {
for(let i=0;i<vm.formExam.exam.length;i++) { for (let i = 0; i < vm.formExam.exam.length; i++) {
vm.formExam.exam[i].examCount = vm.formExam.exam[index].examCount; vm.formExam.exam[i].examCount = vm.formExam.exam[index].examCount;
} }
} }
...@@ -3347,39 +3424,53 @@ export default { ...@@ -3347,39 +3424,53 @@ export default {
}, },
//区间控制在0~100 //区间控制在0~100
baseCheck(index) { baseCheck(index) {
if(vm.formExam.exam[index].rangeMin != '') { if (vm.formExam.exam[index].rangeMin != "") {
vm.formExam.exam[index].rangeMin = parseInt(vm.formExam.exam[index].rangeMin); vm.formExam.exam[index].rangeMin = parseInt(
if(vm.formExam.exam[index].rangeMin > 100) { vm.formExam.exam[index].rangeMin
);
if (vm.formExam.exam[index].rangeMin > 100) {
vm.formExam.exam[index].rangeMin = 100; vm.formExam.exam[index].rangeMin = 100;
} }
if(vm.formExam.exam[index].rangeMin < 0) { if (vm.formExam.exam[index].rangeMin < 0) {
vm.formExam.exam[index].rangeMin = 0; vm.formExam.exam[index].rangeMin = 0;
} }
} }
if(vm.formExam.exam[index].rangeMax != '') { if (vm.formExam.exam[index].rangeMax != "") {
vm.formExam.exam[index].rangeMax = parseInt(vm.formExam.exam[index].rangeMax); vm.formExam.exam[index].rangeMax = parseInt(
if(vm.formExam.exam[index].rangeMax > 100) { vm.formExam.exam[index].rangeMax
);
if (vm.formExam.exam[index].rangeMax > 100) {
vm.formExam.exam[index].rangeMax = 100; vm.formExam.exam[index].rangeMax = 100;
} }
if(vm.formExam.exam[index].rangeMax < 0) { if (vm.formExam.exam[index].rangeMax < 0) {
vm.formExam.exam[index].rangeMax = 0; vm.formExam.exam[index].rangeMax = 0;
} }
} }
}, },
//区间不能有交集 //区间不能有交集
withoutUnion(index,type) { withoutUnion(index, type) {
let examList = vm.formExam.exam; let examList = vm.formExam.exam;
let nowMin = vm.formExam.exam[index].rangeMin; let nowMin = vm.formExam.exam[index].rangeMin;
let nowMax = vm.formExam.exam[index].rangeMax; let nowMax = vm.formExam.exam[index].rangeMax;
console.log('nowMin',nowMin,'nowMax',nowMax); console.log("nowMin", nowMin, "nowMax", nowMax);
if(nowMin!=='' && nowMax!=='') { if (nowMin !== "" && nowMax !== "") {
for(let i=0;i<examList.length;i++) { for (let i = 0; i < examList.length; i++) {
if(index !== i && examList[i].rangeMin!=='' && examList[i].rangeMax!=='') { if (
let overlapStatus = operationData.isOverlap(examList[i].rangeMin,examList[i].rangeMax,nowMin,nowMax); index !== i &&
if(overlapStatus === true) {//区间有交集 examList[i].rangeMin !== "" &&
vm.$message('设置分数区间不能重合'); examList[i].rangeMax !== ""
vm.formExam.exam[index].rangeMin = ''; ) {
vm.formExam.exam[index].rangeMax = ''; let overlapStatus = operationData.isOverlap(
examList[i].rangeMin,
examList[i].rangeMax,
nowMin,
nowMax
);
if (overlapStatus === true) {
//区间有交集
vm.$message("设置分数区间不能重合");
vm.formExam.exam[index].rangeMin = "";
vm.formExam.exam[index].rangeMax = "";
// console.log('重合制空',vm.formExam.exam[index]) // console.log('重合制空',vm.formExam.exam[index])
} }
} }
...@@ -3388,166 +3479,186 @@ export default { ...@@ -3388,166 +3479,186 @@ export default {
}, },
updateMin(index) { updateMin(index) {
vm.baseCheck(index); vm.baseCheck(index);
if(!Number.isInteger(vm.formExam.exam[index].rangeMin)){ if (!Number.isInteger(vm.formExam.exam[index].rangeMin)) {
vm.formExam.exam[index].rangeMin = ''; vm.formExam.exam[index].rangeMin = "";
return; return;
} }
// console.log('更新 nowMin',vm.formExam.exam[index].rangeMin,'nowMax',vm.formExam.exam[index].rangeMax); // console.log('更新 nowMin',vm.formExam.exam[index].rangeMin,'nowMax',vm.formExam.exam[index].rangeMax);
if(vm.formExam.exam[index].rangeMin == '' || vm.formExam.exam[index].rangeMax == '') { if (
vm.formExam.exam[index].rangeMin == "" ||
vm.formExam.exam[index].rangeMax == ""
) {
return; return;
} }
if(vm.formExam.exam[index].rangeMin > vm.formExam.exam[index].rangeMax) { if (vm.formExam.exam[index].rangeMin > vm.formExam.exam[index].rangeMax) {
vm.formExam.exam[index].rangeMin = vm.formExam.exam[index].rangeMax; vm.formExam.exam[index].rangeMin = vm.formExam.exam[index].rangeMax;
} }
vm.withoutUnion(index,'min') vm.withoutUnion(index, "min");
}, },
updateMax(index) { updateMax(index) {
vm.baseCheck(index); vm.baseCheck(index);
if(!Number.isInteger(vm.formExam.exam[index].rangeMax)){ if (!Number.isInteger(vm.formExam.exam[index].rangeMax)) {
// console.log('只能整数'); // console.log('只能整数');
vm.formExam.exam[index].rangeMax = ''; vm.formExam.exam[index].rangeMax = "";
return; return;
} }
if(vm.formExam.exam[index].rangeMin == '' || vm.formExam.exam[index].rangeMax == '') { if (
vm.formExam.exam[index].rangeMin == "" ||
vm.formExam.exam[index].rangeMax == ""
) {
return; return;
} }
if(vm.formExam.exam[index].rangeMin > vm.formExam.exam[index].rangeMax) { if (vm.formExam.exam[index].rangeMin > vm.formExam.exam[index].rangeMax) {
vm.formExam.exam[index].rangeMax = vm.formExam.exam[index].rangeMin; vm.formExam.exam[index].rangeMax = vm.formExam.exam[index].rangeMin;
} }
vm.withoutUnion(index,'max') vm.withoutUnion(index, "max");
}, },
updateCertificate(index) { updateCertificate(index) {
// console.log('optionsCertificate',vm.optionsCertificate,'index',index,'item',vm.formExam.exam[index]) // console.log('optionsCertificate',vm.optionsCertificate,'index',index,'item',vm.formExam.exam[index])
for(let i=0;i<vm.optionsCertificate.length;i++) { for (let i = 0; i < vm.optionsCertificate.length; i++) {
if(vm.optionsCertificate[i].value == vm.formExam.exam[index].certificateId) { if (
vm.formExam.exam[index].certificateName = vm.optionsCertificate[i].label; vm.optionsCertificate[i].value ==
vm.formExam.exam[index].certificateId
) {
vm.formExam.exam[index].certificateName =
vm.optionsCertificate[i].label;
break; break;
} }
} }
vm.formExam.exam[index].certClass = '' vm.formExam.exam[index].certClass = "";
vm.formExam.exam[index].certError = '' vm.formExam.exam[index].certError = "";
}, },
// add 校验输入是否为整数 // add 校验输入是否为整数
checkIntFun(str){ checkIntFun(str) {
let r = /^\+?[0-9]*$/; let r = /^\+?[0-9]*$/;
return r.test(str); return r.test(str);
}, },
//更新项目成绩评定条件 //更新项目成绩评定条件
updateCertificateType() { updateCertificateType() {
console.log('更新certificateType',vm.formExam.certificateType) console.log("更新certificateType", vm.formExam.certificateType);
if(vm.formExam.passType == 2) { if (vm.formExam.passType == 2) {
vm.formExam.exam = [{ vm.formExam.exam = [
{
examCount: 1, examCount: 1,
rangeMin: '', rangeMin: "",
rangeMax: '', rangeMax: "",
certificateId: '', certificateId: "",
certificateName: '', certificateName: "",
minClass:'', minClass: "",
minError:'', minError: "",
maxClass:'', maxClass: "",
maxError:'', maxError: "",
certClass:'', certClass: "",
certError:'' certError: ""
}]; }
} else if(vm.formExam.passType == 1) { ];
vm.formComponent.certificate = ''; } else if (vm.formExam.passType == 1) {
vm.formComponent.certificate = "";
} }
}, },
//校验分数是否存在交叉 //校验分数是否存在交叉
checkCrossFun(d){ checkCrossFun(d) {
let isRepart = false,index = null,parm = null; let isRepart = false,
index = null,
parm = null;
//alert(d.length) //alert(d.length)
if( d.length > 0 ){ if (d.length > 0) {
for(let i = 1;i < d.length;i++){ for (let i = 1; i < d.length; i++) {
console.log(d[i-1].rangeMin,d[i-1].rangeMax) console.log(d[i - 1].rangeMin, d[i - 1].rangeMax);
if(parseInt(d[i-1].rangeMax) < parseInt(d[i-1].rangeMin)){ if (parseInt(d[i - 1].rangeMax) < parseInt(d[i - 1].rangeMin)) {
isRepart = true; isRepart = true;
index = i-1; index = i - 1;
parm = '1' parm = "1";
break; break;
} }
if(d[i].rangeMin <= d[i-1].rangeMax && d[i].rangeMin >= d[i-1].rangeMin || d[i-1].rangeMax >= d[i].rangeMin && d[i-1].rangeMax <= d[i].rangeMax || d[i].rangeMax >= d[i-1].rangeMin && d[i].rangeMax <= d[i-1].rangeMax){ if (
(d[i].rangeMin <= d[i - 1].rangeMax &&
d[i].rangeMin >= d[i - 1].rangeMin) ||
(d[i - 1].rangeMax >= d[i].rangeMin &&
d[i - 1].rangeMax <= d[i].rangeMax) ||
(d[i].rangeMax >= d[i - 1].rangeMin &&
d[i].rangeMax <= d[i - 1].rangeMax)
) {
isRepart = true; isRepart = true;
index = i; index = i;
parm = "2" parm = "2";
//alert(isRepart) //alert(isRepart)
break; break;
} }
if(parseInt(d[i].rangeMin) > parseInt(d[i].rangeMax)){ if (parseInt(d[i].rangeMin) > parseInt(d[i].rangeMax)) {
isRepart = true; isRepart = true;
index = i; index = i;
parm = '3' parm = "3";
break; break;
} }
} }
} }
console.log(parm) console.log(parm);
return {isRepart:isRepart,index:index,parm:parm} return { isRepart: isRepart, index: index, parm: parm };
}, },
hideErrorInfo(str){ hideErrorInfo(str) {
if(str){ if (str) {
this.customError[str] = { this.customError[str] = {
className:'', className: "",
error:'' error: ""
} };
}else{ } else {
this.customError = {} this.customError = {};
} }
}, },
dioErrorPop(str){ dioErrorPop(str) {
return this.$message({ return this.$message({
message: str, message: str,
type: 'warning' type: "warning"
}); });
}, },
//校验考试通过平均分配置 //校验考试通过平均分配置
checkCertificate () { checkCertificate() {
// if(vm.formComponent.configure == 2) { // if(vm.formComponent.configure == 2) {
// return true; // return true;
// } // }
console.log(vm.formExam.exam) console.log(vm.formExam.exam);
if(vm.formExam.passType == 2) { if (vm.formExam.passType == 2) {
if (vm.formComponent.passExamCount == "") {
if(vm.formComponent.passExamCount == ''){
this.customError.passExamCount = { this.customError.passExamCount = {
className:'is-error', className: "is-error",
error:'请输入门数' error: "请输入门数"
} };
return return;
} }
if(vm.formComponent.passAverageScore == ''){ if (vm.formComponent.passAverageScore == "") {
this.customError.passAverageScore = { this.customError.passAverageScore = {
className:'is-error', className: "is-error",
error:'请输入分数' error: "请输入分数"
} };
return return;
} }
if(!vm.checkIntFun(vm.formComponent.passAverageScore)){ if (!vm.checkIntFun(vm.formComponent.passAverageScore)) {
return vm.dioErrorPop('项目通过分数只能是数字') return vm.dioErrorPop("项目通过分数只能是数字");
} }
}else if(vm.formExam.passType == 3){ } else if (vm.formExam.passType == 3) {
if (
if(vm.formComponent.passTotalLearnTime === '' || vm.formComponent.passTotalLearnTime == null){ vm.formComponent.passTotalLearnTime === "" ||
vm.formComponent.passTotalLearnTime == null
) {
vm.customError.passTotalLearnTime = { vm.customError.passTotalLearnTime = {
className : 'is-error', className: "is-error",
error : '请输入学习时长' error: "请输入学习时长"
} };
return return;
} }
} }
console.log(vm.formExam.exam) console.log(vm.formExam.exam);
//空判断 //空判断
if(vm.formComponent.configure == 1) { if (vm.formComponent.configure == 1) {
if (vm.formExam.passType == 2) {
if(vm.formExam.passType == 2){
let checkIdList = []; let checkIdList = [];
var compare = function (obj1, obj2) { var compare = function(obj1, obj2) {
var val1 = obj1.rangeMin; var val1 = obj1.rangeMin;
var val2 = obj2.rangeMin; var val2 = obj2.rangeMin;
if (val1 < val2) { if (val1 < val2) {
...@@ -3557,83 +3668,86 @@ export default { ...@@ -3557,83 +3668,86 @@ export default {
} else { } else {
return 0; return 0;
} }
} };
vm.formExam.exam.sort(compare) vm.formExam.exam.sort(compare);
let isCross = vm.checkCrossFun(vm.formExam.exam).isRepart; let isCross = vm.checkCrossFun(vm.formExam.exam).isRepart;
if(isCross){ if (isCross) {
let l = vm.checkCrossFun(vm.formExam.exam).index let l = vm.checkCrossFun(vm.formExam.exam).index;
if(parm == '1' || parm == '3'){ if (parm == "1" || parm == "3") {
vm.formExam.exam[l].minClass = 'is-error' vm.formExam.exam[l].minClass = "is-error";
vm.formExam.exam[l].minError = '分数最小值不能大于最大值' vm.formExam.exam[l].minError = "分数最小值不能大于最大值";
//return; //return;
}else if(parm == '2'){ } else if (parm == "2") {
vm.formExam.exam[l].minClass = 'is-error' vm.formExam.exam[l].minClass = "is-error";
vm.formExam.exam[l].minError = '请重新输入,不能出现重合分数' vm.formExam.exam[l].minError = "请重新输入,不能出现重合分数";
} }
this.$set(vm.formExam.exam, l, vm.formExam.exam[l]) this.$set(vm.formExam.exam, l, vm.formExam.exam[l]);
return return;
} }
for(let i=0;i<vm.formExam.exam.length;i++) { for (let i = 0; i < vm.formExam.exam.length; i++) {
if (vm.formExam.exam[i].rangeMin === "") {
vm.formExam.exam[i].minClass = "is-error";
if(vm.formExam.exam[i].rangeMin === '' ){ vm.formExam.exam[i].minError = "请输入平均分";
vm.formExam.exam[i].minClass = 'is-error' this.$set(vm.formExam.exam, i, vm.formExam.exam[i]);
vm.formExam.exam[i].minError = '请输入平均分' return;
this.$set(vm.formExam.exam, i, vm.formExam.exam[i]) }
return vm.formExam.exam[i].minClass = "";
} vm.formExam.exam[i].minError = "";
vm.formExam.exam[i].minClass = ''
vm.formExam.exam[i].minError = ''
if(vm.formExam.exam[i].rangeMax === '' ){ if (vm.formExam.exam[i].rangeMax === "") {
vm.formExam.exam[i].maxClass = 'is-error' vm.formExam.exam[i].maxClass = "is-error";
vm.formExam.exam[i].maxError = '请输入平均分' vm.formExam.exam[i].maxError = "请输入平均分";
this.$set(vm.formExam.exam, i, vm.formExam.exam[i]) this.$set(vm.formExam.exam, i, vm.formExam.exam[i]);
return return;
} }
vm.formExam.exam[i].maxClass = '' vm.formExam.exam[i].maxClass = "";
vm.formExam.exam[i].maxError = '' vm.formExam.exam[i].maxError = "";
if(parseInt(vm.formExam.exam[i].rangeMin) > parseInt(vm.formExam.exam[i].rangeMax)){ if (
vm.formExam.exam[i].minClass = 'is-error' parseInt(vm.formExam.exam[i].rangeMin) >
vm.formExam.exam[i].minError = '分数最小值不能大于最大值' parseInt(vm.formExam.exam[i].rangeMax)
this.$set(vm.formExam.exam, i, vm.formExam.exam[i]) ) {
return vm.formExam.exam[i].minClass = "is-error";
} vm.formExam.exam[i].minError = "分数最小值不能大于最大值";
if(vm.formExam.exam[i].certificateId == ''){ this.$set(vm.formExam.exam, i, vm.formExam.exam[i]);
vm.formExam.exam[i].certClass = 'is-error' return;
vm.formExam.exam[i].certError = '请选择证书' }
this.$set(vm.formExam.exam, i, vm.formExam.exam[i]) if (vm.formExam.exam[i].certificateId == "") {
return vm.formExam.exam[i].certClass = "is-error";
} vm.formExam.exam[i].certError = "请选择证书";
vm.formExam.exam[i].certClass = '' this.$set(vm.formExam.exam, i, vm.formExam.exam[i]);
vm.formExam.exam[i].certError = '' return;
}
vm.formExam.exam[i].certClass = "";
vm.formExam.exam[i].certError = "";
if(parseInt(vm.formComponent.passAverageScore) > parseInt(vm.formExam.exam[i].rangeMin)){ if (
vm.formExam.exam[i].minClass = 'is-error' parseInt(vm.formComponent.passAverageScore) >
vm.formExam.exam[i].minError = '平均分不能低于考试通过分数' parseInt(vm.formExam.exam[i].rangeMin)
) {
vm.formExam.exam[i].minClass = "is-error";
vm.formExam.exam[i].minError = "平均分不能低于考试通过分数";
vm.customError.passAverageScore = { vm.customError.passAverageScore = {
className :'is-error', className: "is-error",
error:'平均分不能低于考试通过分数' error: "平均分不能低于考试通过分数"
} };
return return;
} }
if(checkIdList.indexOf(vm.formExam.exam[i].certificateId) == -1){ if (checkIdList.indexOf(vm.formExam.exam[i].certificateId) == -1) {
checkIdList.push(vm.formExam.exam[i].certificateId) checkIdList.push(vm.formExam.exam[i].certificateId);
}else{ } else {
vm.formExam.exam[i].certClass = 'is-error' vm.formExam.exam[i].certClass = "is-error";
vm.formExam.exam[i].certError = '请重新选择,不能出现重复证书' vm.formExam.exam[i].certError = "请重新选择,不能出现重复证书";
this.$set(vm.formExam.exam, i, vm.formExam.exam[i]) this.$set(vm.formExam.exam, i, vm.formExam.exam[i]);
return; return;
} }
this.customError.passAverageScore = { this.customError.passAverageScore = {
className:'', className: "",
error:'' error: ""
} };
//checkIdList[i] = vm.formExam.exam[i].certificateId; //checkIdList[i] = vm.formExam.exam[i].certificateId;
this.$set(vm.formExam.exam, i, vm.formExam.exam[i]) this.$set(vm.formExam.exam, i, vm.formExam.exam[i]);
} }
// 判断证书不能重复 // 判断证书不能重复
// checkIdList = checkIdList.sort(); // checkIdList = checkIdList.sort();
...@@ -3658,17 +3772,16 @@ export default { ...@@ -3658,17 +3772,16 @@ export default {
// return false; // return false;
// } // }
// } // }
}else{ } else {
if(this.formComponent.certificate == ''){ if (this.formComponent.certificate == "") {
vm.customError.certificate = { vm.customError.certificate = {
className : 'is-error', className: "is-error",
error : '请选择证书' error: "请选择证书"
} };
return; return;
} }
} }
} else if (vm.formExam.certificateType == 1) {
} else if(vm.formExam.certificateType == 1) {
//组件通过即发放 证书必填 //组件通过即发放 证书必填
// if(vm.formComponent.configure == 1 && vm.formExam.certificateType == 1) { // if(vm.formComponent.configure == 1 && vm.formExam.certificateType == 1) {
// if(vm.formComponent.certificate == '') { // if(vm.formComponent.certificate == '') {
...@@ -3681,14 +3794,14 @@ export default { ...@@ -3681,14 +3794,14 @@ export default {
}, },
blurName() { blurName() {
vm.visibleName = false; vm.visibleName = false;
setTimeout(function(){ setTimeout(function() {
// console.log('失去焦点'); // console.log('失去焦点');
vm.submitForm('formData'); vm.submitForm("formData");
},200) }, 200);
}, },
focusName() { focusName(index) {
let textLength = vm.formData.organizationName.length; let textLength = vm.formData.organizationNameList[index].length;
if(textLength == 0) { if (textLength == 0) {
vm.visibleName = true; vm.visibleName = true;
} else { } else {
vm.visibleName = false; vm.visibleName = false;
...@@ -3696,8 +3809,8 @@ export default { ...@@ -3696,8 +3809,8 @@ export default {
}, },
changeOrganizationName() { changeOrganizationName() {
let textLength = vm.formData.organizationName.length; let textLength = vm.formData.organizationName.length;
console.log('文字长度',textLength); console.log("文字长度", textLength);
if(textLength == 0) { if (textLength == 0) {
vm.visibleName = true; vm.visibleName = true;
} else { } else {
vm.visibleName = false; vm.visibleName = false;
...@@ -3710,25 +3823,25 @@ export default { ...@@ -3710,25 +3823,25 @@ export default {
}, },
tagDrop() { tagDrop() {
this.$nextTick(function() { this.$nextTick(function() {
if(vm.tagsComponent.length > 0) { if (vm.tagsComponent.length > 0) {
const ele = document.querySelector('.check-component .el-col-20'); const ele = document.querySelector(".check-component .el-col-20");
// console.log('ele',ele); // console.log('ele',ele);
// Sortable.create(ele,{}); // Sortable.create(ele,{});
Sortable.create(ele, { Sortable.create(ele, {
onEnd({ newIndex, oldIndex }) { onEnd({ newIndex, oldIndex }) {
const currRow = vm.tagsComponent.splice(oldIndex, 1)[0] const currRow = vm.tagsComponent.splice(oldIndex, 1)[0];
vm.tagsComponent.splice(newIndex, 0, currRow) vm.tagsComponent.splice(newIndex, 0, currRow);
} }
}) });
} }
}); });
}, },
//v2.2教培更新 //v2.2教培更新
checkUpdate(node,data) { checkUpdate(node, data) {
let flag = -1; let flag = -1;
flag = data.checkedKeys.indexOf(node.id); flag = data.checkedKeys.indexOf(node.id);
if(vm.status4Flag == 1 && flag >= 0) { if (vm.status4Flag == 1 && flag >= 0) {
console.log(node,data,flag,vm.status4Flag); console.log(node, data, flag, vm.status4Flag);
vm.nowCheck = node; vm.nowCheck = node;
vm.warnType = 0; vm.warnType = 0;
vm.dialogWarn = true; vm.dialogWarn = true;
...@@ -3737,7 +3850,7 @@ export default { ...@@ -3737,7 +3850,7 @@ export default {
}, },
closeCheck() { closeCheck() {
vm.dialogWarn = false; vm.dialogWarn = false;
this.$refs.tree.setChecked(vm.nowCheck,false,true); this.$refs.tree.setChecked(vm.nowCheck, false, true);
vm.initCheckList(vm.getTreeCheck()); vm.initCheckList(vm.getTreeCheck());
// for(let i=0;i<vm.tagsRegion.length;i++) { // for(let i=0;i<vm.tagsRegion.length;i++) {
// if(vm.tagsRegion[i].key == vm.nowCheck.id) { // if(vm.tagsRegion[i].key == vm.nowCheck.id) {
...@@ -3757,9 +3870,9 @@ export default { ...@@ -3757,9 +3870,9 @@ export default {
//导入成功 //导入成功
vm.dialogSuccess = true; vm.dialogSuccess = true;
vm.updateNum = res.data.total; vm.updateNum = res.data.total;
if(vm.uploadType == 'org') { if (vm.uploadType == "org") {
vm.searchOrganization(); vm.searchOrganization();
}else { } else {
vm.searchPeople(); vm.searchPeople();
} }
} else { } else {
...@@ -3786,7 +3899,7 @@ export default { ...@@ -3786,7 +3899,7 @@ export default {
}, },
uploadOrganization(file) { uploadOrganization(file) {
vm.dialogFail = false; vm.dialogFail = false;
vm.uploadType = 'org'; vm.uploadType = "org";
console.log(file); console.log(file);
let arr = file.type.split("/"); let arr = file.type.split("/");
let ext = "." + arr[1]; let ext = "." + arr[1];
...@@ -3806,7 +3919,7 @@ export default { ...@@ -3806,7 +3919,7 @@ export default {
]; ];
let req = { let req = {
fileArray: fileArray, fileArray: fileArray,
scopeOfAdministrative: vm.getScope("administrative"), scopeOfAdministrative: vm.getScope("administrative")
}; };
let projectId = vm.projectId; let projectId = vm.projectId;
console.log("req", req); console.log("req", req);
...@@ -3821,7 +3934,7 @@ export default { ...@@ -3821,7 +3934,7 @@ export default {
}, },
uploadPerson(file) { uploadPerson(file) {
vm.dialogFail = false; vm.dialogFail = false;
vm.uploadType = 'person'; vm.uploadType = "person";
let arr = file.type.split("/"); let arr = file.type.split("/");
let ext = "." + arr[1]; let ext = "." + arr[1];
let name = file.name; let name = file.name;
...@@ -3841,7 +3954,7 @@ export default { ...@@ -3841,7 +3954,7 @@ export default {
let req = { let req = {
fileArray: fileArray, fileArray: fileArray,
scopeOfAdministrative: vm.getScope("administrative"), scopeOfAdministrative: vm.getScope("administrative"),
scopeOfDepartment: vm.getScopeDepartment(), scopeOfDepartment: vm.getScopeDepartment()
}; };
let projectId = vm.projectId; let projectId = vm.projectId;
console.log("req", req); console.log("req", req);
...@@ -3872,12 +3985,12 @@ export default { ...@@ -3872,12 +3985,12 @@ export default {
}, 500); }, 500);
}, },
handleChangeRegion(value) { handleChangeRegion(value) {
let areaId = '000'; let areaId = "000";
for(let i=0;i<value.length;i++) { for (let i = 0; i < value.length; i++) {
areaId += '_'+value[i]; areaId += "_" + value[i];
} }
vm.administrativeValue = areaId; vm.administrativeValue = areaId;
console.log(value,vm.administrativeValue); console.log(value, vm.administrativeValue);
}, },
setMoreOption(data, type) { setMoreOption(data, type) {
let option = []; let option = [];
...@@ -3916,22 +4029,22 @@ export default { ...@@ -3916,22 +4029,22 @@ export default {
selectAllOrganization(selection) { selectAllOrganization(selection) {
let setList = []; let setList = [];
let selectList = []; let selectList = [];
for(let i=0;i<vm.tableOrganization.length;i++) { for (let i = 0; i < vm.tableOrganization.length; i++) {
if(vm.tableOrganization[i].modifyFlag == 0) { if (vm.tableOrganization[i].modifyFlag == 0) {
setList.push(vm.tableOrganization[i].id) setList.push(vm.tableOrganization[i].id);
} }
} }
for(let j=0;j<selection.length;j++) { for (let j = 0; j < selection.length; j++) {
selectList.push(selection[j].id); selectList.push(selection[j].id);
} }
let intersect = operationData.getIntersect(setList,selectList); let intersect = operationData.getIntersect(setList, selectList);
let typeStatus = 0; let typeStatus = 0;
if(intersect.length > 0) { if (intersect.length > 0) {
typeStatus = 1; typeStatus = 1;
} }
// let = this.$refs.multipleTable.selection // let = this.$refs.multipleTable.selection
console.log(selection,setList,selectList); console.log(selection, setList, selectList);
if(setList.length > 0) { if (setList.length > 0) {
let req = { let req = {
ids: setList, ids: setList,
projectId: this.projectId, projectId: this.projectId,
...@@ -3945,17 +4058,15 @@ export default { ...@@ -3945,17 +4058,15 @@ export default {
}, },
//机构table中勾选一个 //机构table中勾选一个
selectOrganization(selection, row) { selectOrganization(selection, row) {
console.log('select',selection,row) console.log("select", selection, row);
let flag = false; let flag = false;
for(let i=0;i<selection.length;i++) { for (let i = 0; i < selection.length; i++) {
if(selection[i].id == row.id) { if (selection[i].id == row.id) {
flag = true; flag = true;
} }
} }
let req = { let req = {
ids: [ ids: [row.id],
row.id
],
projectId: this.projectId, projectId: this.projectId,
type: flag === false ? 0 : 1 type: flag === false ? 0 : 1
}; };
...@@ -3969,21 +4080,21 @@ export default { ...@@ -3969,21 +4080,21 @@ export default {
selectAllPerson(selection) { selectAllPerson(selection) {
let setList = []; let setList = [];
let selectList = []; let selectList = [];
for(let i=0;i<vm.tablePerson.length;i++) { for (let i = 0; i < vm.tablePerson.length; i++) {
if(vm.tablePerson[i].modifyFlag == 0) { if (vm.tablePerson[i].modifyFlag == 0) {
setList.push(vm.tablePerson[i].id) setList.push(vm.tablePerson[i].id);
} }
} }
for(let j=0;j<selection.length;j++) { for (let j = 0; j < selection.length; j++) {
selectList.push(selection[j].id); selectList.push(selection[j].id);
} }
let intersect = operationData.getIntersect(setList,selectList); let intersect = operationData.getIntersect(setList, selectList);
let typeStatus = 0; let typeStatus = 0;
if(intersect.length > 0) { if (intersect.length > 0) {
typeStatus = 1; typeStatus = 1;
} }
console.log(selection,setList,selectList); console.log(selection, setList, selectList);
if(setList.length > 0) { if (setList.length > 0) {
let req = { let req = {
ids: setList, ids: setList,
projectId: this.projectId, projectId: this.projectId,
...@@ -3997,17 +4108,15 @@ export default { ...@@ -3997,17 +4108,15 @@ export default {
}, },
//人员table中勾选一个 //人员table中勾选一个
selectPerson(selection, row) { selectPerson(selection, row) {
console.log('select',selection,row) console.log("select", selection, row);
let flag = false; let flag = false;
for(let i=0;i<selection.length;i++) { for (let i = 0; i < selection.length; i++) {
if(selection[i].id == row.id) { if (selection[i].id == row.id) {
flag = true; flag = true;
} }
} }
let req = { let req = {
ids: [ ids: [row.id],
row.id
],
projectId: this.projectId, projectId: this.projectId,
type: flag === false ? 0 : 1 type: flag === false ? 0 : 1
}; };
...@@ -4018,32 +4127,32 @@ export default { ...@@ -4018,32 +4127,32 @@ export default {
}, },
//重置机构、人员查询 //重置机构、人员查询
resetOrgOrPerson(type) { resetOrgOrPerson(type) {
if(type == 'org') { if (type == "org") {
vm.formOrganization.name = ""; vm.formOrganization.name = "";
vm.formOrganization.administrativeId = "0"; vm.formOrganization.administrativeId = "0";
vm.formOrganization.administrativeIdList = ['0']; vm.formOrganization.administrativeIdList = ["0"];
vm.formOrganization.level = "-1"; vm.formOrganization.level = "-1";
vm.formOrganization.pageNum = 1; vm.formOrganization.pageNum = 1;
vm.searchOrganization(); vm.searchOrganization();
} else if(type == 'person') { } else if (type == "person") {
vm.formPerson.hospitalName = ""; vm.formPerson.hospitalName = "";
vm.formPerson.doctorName = ""; vm.formPerson.doctorName = "";
vm.formPerson.pageNum = 1; vm.formPerson.pageNum = 1;
vm.searchPeople(); vm.searchPeople();
} }
}, }
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.min-label{ .min-label {
.el-form-item__label{ .el-form-item__label {
line-height: 26px; line-height: 26px;
} }
.el-form-item__content{ .el-form-item__content {
line-height: 26px; line-height: 26px;
} }
} }
.add-manager-wrap { .add-manager-wrap {
.add-content { .add-content {
background: #fff; background: #fff;
...@@ -4051,32 +4160,45 @@ export default { ...@@ -4051,32 +4160,45 @@ export default {
.rim { .rim {
border: 1px solid #dddddd; border: 1px solid #dddddd;
} }
.mleft60{ .mleft60 {
margin-left:60px; margin-left: 60px;
} }
.soure-configure{ .soure-configure {
background: #F9F9F9;padding:15px;width:550px;font-size: 12px;color:#606266;position:relative;margin-bottom:20px; background: #f9f9f9;
.configure-option{ padding: 15px;
width: 550px;
font-size: 12px;
color: #606266;
position: relative;
margin-bottom: 20px;
.configure-option {
position: absolute; position: absolute;
right: -95px; right: -95px;
top:50%; top: 50%;
margin-top:-15px; margin-top: -15px;
}
.mb15 {
margin-bottom: 15px;
} }
.mb15{margin-bottom:15px} .configure-item {
.configure-item{ overflow: hidden;
overflow:hidden; .configure-item-l {
.configure-item-l{
display: inline-block; display: inline-block;
width:60px; width: 60px;
text-align: right; text-align: right;
} }
} }
} }
.mini-source{ .mini-source {
background: #F9F9F9;width:650px;padding:15px; background: #f9f9f9;
margin-bottom:20px; width: 650px;
.source-item{ padding: 15px;
padding-top:0px;font-size:12px;line-height: 28px;color: #606266; margin-bottom: 20px;
.source-item {
padding-top: 0px;
font-size: 12px;
line-height: 28px;
color: #606266;
} }
} }
.step-content { .step-content {
...@@ -4292,7 +4414,7 @@ export default { ...@@ -4292,7 +4414,7 @@ export default {
.dialog-success { .dialog-success {
p { p {
text-align: center; text-align: center;
.upload-text{ .upload-text {
color: #449284; color: #449284;
} }
} }
...@@ -4320,20 +4442,19 @@ export default { ...@@ -4320,20 +4442,19 @@ export default {
.third-step { .third-step {
margin: 30px 0 0px 30px; margin: 30px 0 0px 30px;
padding-bottom: 30px; padding-bottom: 30px;
::-webkit-scrollbar ::-webkit-scrollbar {
{
width: 4px; width: 4px;
height: 20px; height: 20px;
background-color: #D8D8D8; background-color: #d8d8d8;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: #D8D8D8; background-color: #d8d8d8;
} }
.el-tag { .el-tag {
margin-top: 5px; margin-top: 5px;
display: table; display: table;
background-color: #E6F1FC; background-color: #e6f1fc;
color: #389EFE; color: #389efe;
} }
.el-select { .el-select {
.el-tag { .el-tag {
...@@ -4343,15 +4464,15 @@ export default { ...@@ -4343,15 +4464,15 @@ export default {
} }
} }
.tags-list { .tags-list {
border: 1px #E8E8E8 solid; border: 1px #e8e8e8 solid;
height: 350px; height: 350px;
min-width: 280px; min-width: 280px;
overflow-y: scroll; overflow-y: scroll;
} }
.tags-component-online { .tags-component-online {
color: #9ACEFF; color: #9aceff;
background-color: #F3F8FE; background-color: #f3f8fe;
border-color: #D5EAFE; border-color: #d5eafe;
} }
.achievement { .achievement {
margin-top: 60px; margin-top: 60px;
...@@ -4365,8 +4486,8 @@ export default { ...@@ -4365,8 +4486,8 @@ export default {
position: absolute; position: absolute;
z-index: 999; z-index: 999;
} }
.el-time-ctr{ .el-time-ctr {
.el-radio{ .el-radio {
display: block; display: block;
padding: 10px 0; padding: 10px 0;
} }
...@@ -4374,14 +4495,17 @@ export default { ...@@ -4374,14 +4495,17 @@ export default {
.el-configure { .el-configure {
width: 200px; width: 200px;
} }
.time-contrl{ .time-contrl {
.el-input__inner{ .el-input__inner {
padding-right: 0; padding-right: 0;
} }
.el-input-group__append{ .el-input-group__append {
padding: 0 8px; padding: 0 8px;
} }
} }
} }
} }
.edit-img {
width: 20px;
}
</style> </style>
<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>
...@@ -74,223 +74,299 @@ ...@@ -74,223 +74,299 @@
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
<!-- 删除 弹窗 -->
<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> </template>
<script> <script>
import BreadCrumb from '../../components/breadcrumb.vue' import BreadCrumb from "../../components/breadcrumb.vue";
import { doUpload, getFilePath } from "../../utils/qiniu-util" import { doUpload, getFilePath } from "../../utils/qiniu-util";
import { validateWord } from "../../utils/validate.js" import { validateWord } from "../../utils/validate.js";
import { mapGetters,mapActions } from 'vuex' import { mapGetters, mapActions } from "vuex";
import { openLoading, closeLoading } from '../../utils/utils' import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from '../../utils/utils' import * as commonUtil from "../../utils/utils";
let vm = null let vm = null;
export default { export default {
components: { components: {
BreadCrumb BreadCrumb
}, },
data() { data() {
return { return {
curmbFirst: '教培项目', curmbFirst: "教培项目",
curmbSecond: '项目组件', curmbSecond: "项目组件",
idType:'', idType: "",
masterAdministratorFlag: false, masterAdministratorFlag: false,
searchParam: { searchParam: {
idType: '', idType: "",
name: '', name: "",
status: '', status: "",
pageNo: 1, pageNo: 1,
pageSize: 15 pageSize: 15
}, },
statuSelect: [ statuSelect: [
{ {
label: '草稿', label: "草稿",
value: '1' value: "1"
},{ },
label: '未启用', {
value: '2' label: "未启用",
},{ value: "2"
label: '已启用', },
value: '3' {
},{ label: "已启用",
label: '已禁用', value: "3"
value: '4' },
{
label: "已禁用",
value: "4"
} }
], ],
tableData: [], tableData: [],
totalRows: 0, totalRows: 0,
basicRule: { basicRule: {
"name": [ name: [
{ required: true, message: '输入长度为2-20个中文', trigger: 'blur' }, { required: true, message: "输入长度为2-20个中文", trigger: "blur" },
{ validator: function(rule, value, callback) { {
validateWord(rule, value, callback, '输入长度为2-20个中文') validator: function(rule, value, callback) {
validateWord(rule, value, callback, "输入长度为2-20个中文");
}, },
trigger: 'blur' } trigger: "blur"
],
"introduce": [
{ required: true, message: '请输入组件简介', trigger: 'blur' },
],
}
} }
],
introduce: [
{ required: true, message: "请输入组件简介", trigger: "blur" }
]
},
currentRow: {},
deleteVisible: false
};
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'_token', "_token"
// 'idType', // 'idType',
// 'masterAdministratorFlag' // 'masterAdministratorFlag'
]) ])
}, },
created() { created() {
vm = this vm = this;
vm.idType = localStorage.getItem('storageIdType') vm.idType = localStorage.getItem("storageIdType");
vm.masterAdministratorFlag = localStorage.getItem('storageMaster') vm.masterAdministratorFlag = localStorage.getItem("storageMaster");
if(this.$route.query.pageNum){ if (this.$route.query.pageNum) {
console.log(this.$store.state.common.itemComponents) console.log(this.$store.state.common.itemComponents);
vm.searchParam.status = this.$store.state.common.itemComponents.status vm.searchParam.status = this.$store.state.common.itemComponents.status;
vm.searchParam.name = this.$store.state.common.itemComponents.name vm.searchParam.name = this.$store.state.common.itemComponents.name;
vm.searchParam.pageNo = parseInt(this.$route.query.pageNum) vm.searchParam.pageNo = parseInt(this.$route.query.pageNum);
} }
vm.search() vm.search();
}, },
// 挂载到Dom完成时 // 挂载到Dom完成时
mounted: function() { mounted: function() {
commonUtil.resizeHeight() commonUtil.resizeHeight();
}, },
methods: { methods: {
...mapActions([ ...mapActions(["updateItemComponents"]),
'updateItemComponents'
]),
// 列表查询 // 列表查询
search(flag) { search(flag) {
if(flag) vm.searchParam.pageNo = 1 if (flag) vm.searchParam.pageNo = 1;
vm.searchParam.idType = vm.idType vm.searchParam.idType = vm.idType;
openLoading(vm) openLoading(vm);
vm.GET('portal/portalComponent/queryPortalComponent',vm.searchParam).then((res) => { vm
closeLoading(vm) .GET("portal/portalComponent/queryPortalComponent", vm.searchParam)
if( res.code == '000000' ) { .then(res => {
vm.tableData = res.data.queryList closeLoading(vm);
vm.totalRows = res.data.total if (res.code == "000000") {
}else { vm.tableData = res.data.queryList;
vm.$message.info(res.message) vm.totalRows = res.data.total;
} else {
vm.$message.info(res.message);
} }
}) });
}, },
// 重置 // 重置
reseat() { reseat() {
vm.searchParam = Object.assign({},{ vm.searchParam = Object.assign(
idType: '', {},
name: '', {
status: '', idType: "",
name: "",
status: "",
pageNo: 1, pageNo: 1,
pageSize: 15 pageSize: 15
}) }
vm.search() );
vm.search();
}, },
// 新建组件 // 新建组件
createComponent() { createComponent() {
vm.$router.push({path: 'create-component'}) vm.$router.push({ path: "create-component" });
}, },
// 编辑(验证可编辑范围) // 编辑(验证可编辑范围)
editComponentList(row) { editComponentList(row) {
let req = { let req = {
token: vm._token, token: vm._token,
componentId: row.id 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
} }
vm.GET('portal/portalComponent/componentEditRange',req).then((res) => { });
if(res.code == "000000") { } else {
vm.updateItemComponents({name:vm.searchParam.name,status:vm.searchParam.status}) vm.$message.info(res.message);
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) { enableAndDisable(row, flag) {
let req = null let req = null;
let text = '' let text = "";
if(flag == 1) { // 启用 if (flag == 1) {
// 启用
req = { req = {
id: row.id, id: row.id,
status: 3 status: 3
} };
text = '组件一经启用,将无法进行修改,确定启用吗?' text = "组件一经启用,将无法进行修改,确定启用吗?";
}else if(flag == 2) { // 禁用 } else if (flag == 2) {
// 禁用
req = { req = {
id: row.id, id: row.id,
status: 4 status: 4
};
text = "确定禁用吗?";
} }
text = '确定禁用吗?' vm
} .$confirm(text, "提示", {
vm.$confirm(text, '提示', { confirmButtonText: "确定",
confirmButtonText: '确定', cancelButtonText: "取消",
cancelButtonText: '取消', type: "warning"
type: 'warning' })
}).then(() => { .then(() => {
vm.GET('portal/portalComponent/disableOrStart',req).then((res) => { vm
if(res.code == "000000") { .GET("portal/portalComponent/disableOrStart", req)
.then(res => {
if (res.code == "000000") {
vm.$message({ vm.$message({
type: 'success', type: "success",
message: '操作成功!' message: "操作成功!"
}); });
vm.search() vm.search();
if(res.message != 'success') { if (res.message != "success") {
vm.$message({ vm.$message({
message: res.message, message: res.message,
type: 'warning' type: "warning"
}) });
} }
}else { } else {
vm.$message.info(res.message) vm.$message.info(res.message);
} }
}).catch(function (error) { })
.catch(function(error) {
vm.$message.error(error); vm.$message.error(error);
}); });
}).catch(() => { })
.catch(() => {
vm.$message({ vm.$message({
type: 'info', type: "info",
message: '已取消' message: "已取消"
}); });
}); });
}, },
// 删除 // 删除
deleteComponent(row) { deleteComponentOld(row) {
vm.$confirm('确定要删除该组件吗?', '提示', { vm
confirmButtonText: '确定', .$confirm("确定要删除该组件吗?", "提示", {
cancelButtonText: '取消', confirmButtonText: "确定",
type: 'warning' cancelButtonText: "取消",
}).then(() => { type: "warning"
vm.GET('portal/portalComponent/deleteComponentById',{id: row.id}).then((res) => { })
if(res.code == "000000") { .then(() => {
vm
.GET("portal/portalComponent/deleteComponentById", { id: row.id })
.then(res => {
if (res.code == "000000") {
vm.$message({ vm.$message({
type: 'success', type: "success",
message: '删除成功!' message: "删除成功!"
}); });
vm.search() vm.search();
} else { } else {
vm.$message.info(res.message) vm.$message.info(res.message);
} }
}).catch(function (error) { })
.catch(function(error) {
vm.$message.error(error); vm.$message.error(error);
}); });
}).catch(() => {
vm.$message({
type: 'info',
message: '已取消'
}) })
.catch(() => {
vm.$message({
type: "info",
message: "已取消"
});
});
},
// 删除组件
confirmDelete() {
let req = {};
vm.GET("portal/portalComponent/deleteComponentById", { id: this.currentRow.id })
.then(res => {
this.deleteVisible = false;
if (res.code == "000000") {
vm.$message({
type: "success",
message: "删除成功!"
});
vm.search();
} else {
vm.$message.info(res.message);
}
}) })
.catch(function(error) {
vm.$message.error(error);
});
},
// 删除
deleteComponent(row) {
this.currentRow = row;
this.deleteVisible = true;
},
hideDeleteFrom() {
this.deleteVisible = false;
}, },
handleSizeChange(value) { handleSizeChange(value) {
vm.searchParam.pageSize = value vm.searchParam.pageSize = value;
vm.search() vm.search();
}, },
handleCurrentChange(value) { handleCurrentChange(value) {
vm.searchParam.pageNo = value vm.searchParam.pageNo = value;
vm.search() vm.search();
} }
} }
} };
</script> </script>
<style lang="scss"> <style lang="scss">
.item-component-wrap { .item-component-wrap {
...@@ -310,7 +386,7 @@ export default { ...@@ -310,7 +386,7 @@ export default {
text-align: right; text-align: right;
} }
.table-empty { .table-empty {
img{ img {
width: 100px; width: 100px;
} }
p { p {
......
<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>
...@@ -244,6 +244,20 @@ ...@@ -244,6 +244,20 @@
<el-button @click="handleCheckRight">不通过</el-button> <el-button @click="handleCheckRight">不通过</el-button>
</span> </span>
</el-dialog> </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>
</div> </div>
</template> </template>
...@@ -357,7 +371,8 @@ export default { ...@@ -357,7 +371,8 @@ export default {
} }
}, },
idType: '', idType: '',
masterAdministratorFlag: false masterAdministratorFlag: false,
deleteVisible: false,
}; };
}, },
computed: { computed: {
...@@ -388,6 +403,10 @@ export default { ...@@ -388,6 +403,10 @@ export default {
...mapActions([ ...mapActions([
'updateItemManager' 'updateItemManager'
]), ]),
hideDeleteFrom() {
this.deleteVisible = false;
},
openProject() { openProject() {
if(vm.masterAdministratorFlag == 'true') { if(vm.masterAdministratorFlag == 'true') {
this.centerDialogVisible = true; this.centerDialogVisible = true;
...@@ -649,19 +668,31 @@ export default { ...@@ -649,19 +668,31 @@ export default {
} }
return data; return data;
}, },
//删除项目
delItem(row) { delItem(row) {
this.deleteVisible = true
this.currentRow = row;
},
hideDeleteFrom() {
this.deleteVisible = false;
},
// 删除项目
confirmDelete() {
let req = {}; let req = {};
console.log(row); vm.GET('portal/portalComponent/deleteComponentById',{id: this.currentRow.id}).then((res) => {
vm.DELETE("portal/portalInfo/delete/" + row.id, req).then(res => { if(res.code == "000000") {
vm.$message.info(res.message); vm.$message({
if (res.code == "000000") { type: 'success',
console.log(res); message: '删除成功!'
vm.getProjectList(); });
vm.search()
} else {
vm.$message.info(res.message)
} }
}).catch(function (error) {
vm.$message.error(error);
}); });
}, },
//重置表单 // 重置表单
resetForm() { resetForm() {
vm.formInline = Object.assign( vm.formInline = Object.assign(
{}, {},
......
<template>
<div class="item-role-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="header-title">
查询条件
<el-upload
v-if="activeUser == 'L1' && authorityType == 1"
class="upload-excel"
action="#"
accept=".xlsx"
multiple
:limit="1"
:before-upload="beforeUpload"
>
<el-button size="small">导入角色权限</el-button>
<el-button class="down-button" slot="tip" size="small" @click="download('model')">下载导入模板</el-button>
</el-upload>
</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form :model="formInline" ref="formInline" label-width="75px" class="form-inline">
<el-col :span="6">
<el-form-item label="所属机构:">
<!-- <el-select size="small" v-model="formInline.organizationName" placeholder="请选择所属机构">
<el-option
v-for="(item, index) in organizationList"
:key="index"
:label="item"
:value="item"
></el-option
</el-select>-->
<el-input size="small" v-model="formInline.organizationName" placeholder="请输入机构名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="姓名:">
<el-input size="small" v-model="formInline.userName" placeholder="请输入人员名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="角色:">
<el-select size="small" v-model="formInline.projeceRole" placeholder="请选择角色">
<el-option
v-for="(item, index) in roleList"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="5">
<el-form-item label="所属科室:">
<el-select size="small" v-model="formInline.departmentsName" placeholder="请选择所属科室">
<el-option
v-for="(item, index) in departmentsList"
:key="index"
:label="item"
:value="item"
></el-option>
</el-select>
</el-form-item>
</el-col>-->
<el-col :span="6" style="padding:0;text-align:right;padding-right:10px;">
<el-button type="primary" size="small" @click="searchList()">查询</el-button>
<el-button
type="default"
size="small"
@click="resetForm('formInline')"
style="margin-left:0;"
>重置</el-button>
</el-col>
</el-form>
</el-row>
<el-table :data="tableData" style="width: 100%">
<!-- <el-table-column prop="userId" label="用户ID" align="center"></el-table-column> -->
<el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="countyName" label="所属区县" align="center"></el-table-column>
<el-table-column prop="organizationName" label="所属机构" align="center"></el-table-column>
<el-table-column prop="departmentsName" label="科室" align="center"></el-table-column>
<el-table-column prop="projeceRole" label="角色" align="center">
<template slot-scope="scope">
<span>{{ scope.row.projeceRole | projeceRoleType }}</span>
</template>
</el-table-column>
<el-table-column prop="area" label="负责区域" align="center">
<template slot-scope="scope">
<span v-if="scope.row.projeceRole == 'L2'">全部地区</span>
<span v-if="scope.row.projeceRole == 'L0'">-</span>
<span v-if="scope.row.projeceRole == 'L3' && scope.row.regions.length == 0">-</span>
<span
v-if="scope.row.projeceRole == 'L3' && scope.row.regions.length == 1"
>{{ scope.row.regions[0] }}</span>
<el-popover
v-if="scope.row.projeceRole == 'L3' && scope.row.regions.length > 1"
placement="bottom"
title
width="200"
trigger="hover"
class="more-text"
>
<p class="more-text">{{ scope.row.regions | areaList }}</p>
<p slot="reference">{{ scope.row | areaText }}</p>
</el-popover>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="350" align="left">
<template slot-scope="scope" >
<!-- v-if="scope.row.projeceRole != 'L2'" -->
<div v-if="authorityType == 2">
<el-button
class="button-text"
type="text"
size="small"
v-if="scope.row.projeceRole != 'L2'"
v-show="showButton2(scope.row)"
@click="proChange(scope.row,'L2')"
>升级项目负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-else
v-show="showButton2(scope.row)"
@click="proChange(scope.row,'')"
>取消项目负责人</el-button>
</div>
<div v-if="authorityType == 1">
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L2')"
@click="openDialog(scope.row,'L2')"
>升级项目负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L3')"
@click="openDialog(scope.row,'L3')"
>升级次级负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L3_2')"
@click="openDialog(scope.row,'L3_2')"
>降为次级负责人</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showButton(scope.row,'L0')"
@click="openDialog(scope.row,'L0')"
>降为普通用户</el-button>
<el-button
class="button-text"
type="text"
size="small"
v-show="showAppend(scope.row.projeceRole)"
@click="addArea(scope.row)"
>追加区域权限</el-button>
</div>
</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, 20, 30, 100]"
:page-size="formInline.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
<el-dialog title :visible.sync="changeDialog.show" width="30%" center>
<p v-html="changeDialog.txt">
</p>
<span slot="footer" class="dialog-footer">
<el-button type="default" size="small" @click="changeDialog.show = false">取消</el-button>
<el-button type="primary" size="small" @click="changeFunRole()">确定</el-button>
</span>
</el-dialog>
<el-dialog title :visible.sync="dialog.show" width="30%" center>
<!-- <p v-if="numL3 > 1" class="dialog-p">
确认将{{ dialog.role }}
<span class="user-name">"{{ dialog.name }}"</span>
{{ dialog.option }}吗?"
</p>
<p v-else >该用户为此机构仅有的次级负责人,确认需要降级吗?</p>-->
<p
v-if="numL3 <= 1 && scopeRow.projeceRole == 'L3'"
class="dialog-p"
>该用户为此机构仅有的次级负责人,确认需要降级吗?</p>
<p v-else>
确认将{{ dialog.role }}
<span class="user-name">"{{ dialog.name }}"</span>
{{ dialog.option }}吗?
</p>
<span slot="footer" class="dialog-footer">
<el-button type="default" size="small" @click="dialog.show = false">取消</el-button>
<el-button type="primary" size="small" @click="changeRole()">确定</el-button>
</span>
</el-dialog>
<el-dialog title :visible.sync="dialogFull" width="30%" center>
<p class="dialog-p">
添加数量已达上限,不可继续添加
<!-- <span class="user-name">5人</span> -->
</p>
<span slot="footer" class="dialog-footer">
<el-button type="default" size="small" @click="dialogFull = false">取消</el-button>
<el-button type="primary" size="small" @click="dialogFull = false">确定</el-button>
</span>
</el-dialog>
<el-dialog
title="导入成功"
:visible.sync="dialogSuccess"
width="30%"
class="dialog-success"
center
>
<p>
本次成功导入
<span class="upload-text">{{ updateNum }}条</span> 数据
</p>
<span slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="dialogSuccess = false">关闭</el-button>
</span>
</el-dialog>
<el-dialog title="导入失败" :visible.sync="dialogFail" width="30%" class="dialog-fail" center>
<div class="fail-type" v-if="failType == 1">
<p>导入数据量已超限额,请修正后再次导入</p>
<p class="fail-notice">仅支持一次导入5000条数据</p>
</div>
<div class="fail-type" v-if="failType == 2">
<p>
<span class="fail-num">{{ failNum }}条</span> 数据不符合格式要求,请修正后再次导入
</p>
<p class="fail-notice">仅支持xlsx格式的文件</p>
<p class="fail-link" @click="download('fail')">下载错误数据></p>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="fail-close" size="small" @click="dialogFail = false">取消</el-button>
<el-upload
class="upload-button"
action="#"
accept=".xlsx"
multiple
:limit="1"
:before-upload="beforeUpload"
>
<el-button
stype="position: absolute;top: -14px;"
type="primary"
size="small"
@click="updateAgain()"
>重新导入</el-button>
</el-upload>
</span>
</el-dialog>
<el-dialog title="追加区域权限" :visible.sync="dialogArea" width="70%" class="dialog-area" center>
<el-col class="area-choose" :span="15">
<el-tree
default-expand-all
:data="treeData"
show-checkbox
node-key="id"
ref="tree"
highlight-current
:props="defaultProps"
@check="onChecked"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span>
<el-button
type="text"
icon="el-icon-caret-bottom"
size="small"
@click="() => append(data,node)"
></el-button>
</span>
</span>
</el-tree>
</el-col>
<el-col class="area-choose" :span="8">
<p class="area-p">
<i class="el-icon-bottom"></i>
追加下列区域的学情报告查看权限 已选择({{ tagsRegion.length }})
</p>
<el-tag
v-for="tag in tagsRegion"
:key="tag.name"
closable
:type="tag.type"
@close="handleCloseTree(tag)"
>{{tag.name}}</el-tag>
</el-col>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogArea = false">取消</el-button>
<el-button type="primary" size="small" @click="updateAttachRegion()">确认</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import { getExeclUrl } from "@/utils/index";
import { uploadExcel } from "@/utils/education/educationApi";
import * as operationData from "../../utils/operation";
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
const item = {
userId: "298490",
userName: "李雪",
projeceRole: "L0",
organizationName: "浙江省人民医院",
departmentsName: "外科"
};
return {
curmbFirst: "系统管理",
curmbSecond: "角色管理",
curmbThird: "项目角色",
tableData: [],
loading: true,
timingTime: "",
totalRows: 0,
currentPage: 1,
formInline: {
portalProjectId: "",
pageNo: 1,
pageSize: 10,
departmentsName: "",
organizationName: "",
projeceRole: "",
userName: ""
},
departmentsList: [],
organizationList: [],
roleList: [
// {
// label: "内部管理员",
// value: "L1"
// },
{
label: "全部",
value: ""
},
{
label: "项目负责人",
value: "L2"
},
{
label: "次级负责人",
value: "L3"
},
{
label: "普通用户",
value: "L0"
}
],
numL2: 0,
numL3: 0,
dialog: {
show: false,
role: "项目负责人",
name: "李雷",
option: "升级为项目负责人",
full: false,
},
changeDialog:{
show: false,
txt:''
},
dialogFull: false,
scopeRow: {},
activeUser: "",
updateNum: 0,
dialogSuccess: false,
failType: 2,
failNum: 0,
failExcelUrl: "",
dialogFail: false,
defaultProps: {
children: "children",
label: "label",
isLeaf: "isLeaf"
},
treeData: [],
dialogArea: false,
tagsRegion: [],
doctorId: "",
allSelectedKeys: [],
attachRegionId: "",
creator: false,
hospitalMasterAdmin: false,
optionType:'',
optionItem:{},
authorityType:0,
};
},
created() {
vm = this;
this.queryRoleList();
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
//add 升、降项目负责人
proChange(item,str){
if (str == "L2" && this.numL2 >= 5) {
this.dialogFull = true;
return;
}
this.optionType = str;
this.optionItem = item;
let s = ''
s = str != '' ? '确认将项目负责人 <span class="user-name">'+item.userName+'</span> 升级为项目负责人吗?' : '确认取消 <span class="user-name">'+ item.userName+'</span> 项目负责人权限吗?'
this.changeDialog = {
show: true,
txt:s
}
},
changeFunRole() {
let req = {
portalProjectId: this.formInline.portalProjectId,
updateL: this.optionType == '' ? 'L3' : 'L2',
userId: this.optionItem.userId,
numL2: this.numL2,
nowL: this.optionItem.projeceRole
};
// vm.GET("portal/portalProjectOrRole/roleLevelUpdate", req).then(res => {
vm.GET("portal/v2/role/roleLevelUpdate", req).then(res => {
vm.dialog.show = false;
if (res.code == "000000") {
console.log(res);
vm.queryRoleList();
vm.$message({
message: "设置成功!",
type: "success"
});
this.changeDialog = {
show: false,
txt:''
}
} else {
this.$message.error(res.code);
}
});
},
updateAgain() {
vm.dialogFail = false;
},
download(type) {
let downloadUrl = "";
if (type == "model") {
downloadUrl = getExeclUrl(
"%E6%95%99%E5%9F%B9%E9%A1%B9%E7%9B%AE%E8%A7%92%E8%89%B2%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx"
);
} else if (type == "fail") {
downloadUrl = vm.failExcelUrl;
}
console.log("下载", type, downloadUrl);
setTimeout(() => {
window.open(downloadUrl);
}, 500);
},
beforeUpload(file) {
vm.dialogFail = false;
console.log(file);
let arr = file.type.split("/");
let ext = "." + arr[1];
let name = file.name;
let reader = new FileReader();
reader.onload = function(e) {
let fileJson = {
fileName: file.name,
file: e.target.result.substr(e.target.result.indexOf("base64,") + 7),
ext: ext
};
let fileArray = [
{
type: "",
base64: fileJson
}
];
let req = {
fileArray: fileArray
};
let projectId = vm.formInline.portalProjectId;
console.log("req", req);
let reqStr = JSON.stringify(req);
console.log("reqStr", reqStr);
openLoading(vm);
uploadExcel(reqStr, projectId).then(res => {
setTimeout(function() {
closeLoading(vm);
if (res.code == "000000") {
if (res.data.success == true) {
//导入成功
vm.dialogSuccess = true;
vm.updateNum = res.data.total;
vm.queryRoleList();
} else {
if (res.data.outCount == true) {
//导入数据超5000
vm.failType = 1;
vm.dialogFail = true;
vm.failNum = res.data.total;
vm.failExcelUrl = res.data.url;
} else {
//导入失败
// setTimeout(function() {
vm.failType = 2;
vm.dialogFail = true;
vm.failNum = res.data.total;
vm.failExcelUrl = res.data.url;
// }, 800);
}
}
} else {
//接口失败
vm.$message.error(res.message);
}
console.log(res);
}, 1000);
});
};
reader.readAsDataURL(file);
},
searchList() {
this.formInline.pageNo = 1;
this.queryRoleList();
},
//查询用户列表
queryRoleList() {
this.formInline.portalProjectId = vm.getUrlSearch(
window.location.href,
"portalProjectId"
);
if (this.formInline.portalProjectId == null) {
this.formInline.portalProjectId = "";
}
let req = {};
req = this.formInline;
openLoading(vm);
vm.GET("portal/v2/role/queryRoleList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.projectRoleInfoModels;
vm.authorityType = res.data.authorityType
vm.totalRows = res.data.total;
vm.activeUser = res.data.activeUser;
vm.creator = res.data.creator;
vm.hospitalMasterAdmin = res.data.hospitalMasterAdmin;
//this.roleList = setRoleList(res.data.roleList);
this.organizationList = res.data.organizationList;
this.departmentsList = res.data.departmentsList;
this.numL2 = res.data.numL2;
this.numL3 = res.data.numL3;
}
});
},
//改变等级
changeRole() {
let req = {
portalProjectId: this.formInline.portalProjectId,
updateL: this.scopeRow.updateL,
userId: this.scopeRow.userId,
numL2: this.numL2,
nowL: this.scopeRow.projeceRole
};
// vm.GET("portal/portalProjectOrRole/roleLevelUpdate", req).then(res => {
vm.GET("portal/v2/role/roleLevelUpdate", req).then(res => {
vm.dialog.show = false;
if (res.code == "000000") {
console.log(res);
vm.queryRoleList();
vm.$message({
message: "设置成功!",
type: "success"
});
} else {
this.$message.error(res.code);
}
});
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.formInline.pageSize = val;
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.formInline.pageNo = val;
this.queryRoleList();
},
//重置表单
resetForm() {
vm.formInline = Object.assign(
{},
{
portalProjectId: "",
pageNo: 1,
pageSize: 10,
departmentsName: "",
organizationName: "",
projeceRole: "",
userName: ""
}
);
vm.queryRoleList();
},
//authorityType == 2 情况下按钮展示判断
showButton2(row) {
let flag = false;
if (vm.activeUser == "L1") {
//当前内部管理员
flag = true;
}
if(vm.activeUser == "L2" && vm.creator == true) {
//当前项目管理员且创建者
flag = true;
}
return flag;
},
//按钮展示情况
showButton(row, projeceRole) {
let flag = false;
if (vm.activeUser == "L1") {
//当前内部管理员
if (row.projeceRole == "L2") {
if (projeceRole == "L0" || projeceRole == "L3_2") {
flag = true;
}
} else if (row.projeceRole == "L3") {
if (projeceRole == "L2" || projeceRole == "L0") {
flag = true;
}
} else if (row.projeceRole == "L0") {
if (projeceRole == "L2" || projeceRole == "L3") {
flag = true;
}
}
} else if (vm.activeUser == "L2") {
//当前项目负责人
//新规则
if (vm.creator == true) {
//项目负责人是:项目创建者
if (row.projeceRole == "L3") {
if (projeceRole == "L2" || projeceRole == "L0") {
flag = true;
}
} else if (row.projeceRole == "L0") {
if (projeceRole == "L2" || projeceRole == "L3") {
flag = true;
}
} else if (row.projeceRole == "L2") {
//创建项目项目管理员可以修改其他项目管理员
if (projeceRole == "L0" || projeceRole == "L3_2") {
flag = true;
}
}
} else {
//不是项目创建者
if (row.projeceRole == "L3") {
if (projeceRole == "L0") {
flag = true;
}
} else if (row.projeceRole == "L0") {
if (projeceRole == "L3") {
flag = true;
}
}
}
} else if (vm.activeUser == "L3") {
//当前次级负责人
//新规则
if (vm.hospitalMasterAdmin == true) {
//次级负责人是:构主管理员
if (row.projeceRole == "L3") {
if (projeceRole == "L0") {
flag = true;
}
} else if (row.projeceRole == "L0") {
if (projeceRole == "L3") {
flag = true;
}
}
}
}
return flag;
},
showAppend(projeceRole) {
let flag = false;
if (vm.activeUser == "L1" || vm.activeUser == "L2") {
if (projeceRole == "L3") {
flag = true;
}
}
return flag;
},
//打开弹出框
openDialog(row, projeceRole) {
console.log(row);
if (projeceRole == "L2" && this.numL2 >= 5) {
this.dialogFull = true;
} else {
this.dialog.show = true;
}
this.dialog.name = row.userName;
this.scopeRow = row;
this.scopeRow.updateL = projeceRole;
if (projeceRole == "L3_2") {
this.scopeRow.updateL = "L3";
}
if (row.projeceRole == "L2") {
this.dialog.role = "项目负责人";
if (projeceRole == "L0") {
this.dialog.option = "降级为普通用户";
} else if (projeceRole == "L3_2") {
this.dialog.option = "降级为次级负责人";
}
} else if (row.projeceRole == "L3") {
this.dialog.role = "次级负责人";
if (projeceRole == "L2") {
this.dialog.option = "升级为项目负责人";
} else if (projeceRole == "L0") {
this.dialog.option = "降级为普通用户";
}
} else if (row.projeceRole == "L0") {
this.dialog.role = "普通用户";
if (projeceRole == "L2") {
this.dialog.option = "升级为项目负责人";
} else if (projeceRole == "L3") {
this.dialog.option = "升级为次级负责人";
}
}
},
addArea(row) {
vm.dialogArea = true;
vm.treeData = [];
vm.tagsRegion = [];
vm.getAdministrative(row);
},
getAdministrative(row) {
vm.doctorId = row.userId;
// let req = {
// projectId: vm.formInline.portalProjectId
// };
let req = {
projectId: vm.formInline.portalProjectId,
doctorId: row.userId
};
openLoading(vm);
// vm.GET("portal/portalProjectOrRole/getAttachRegion", req).then(res => {
vm.GET("portal/v2/role/getAttachRegion", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
let administrativeAll = res.data.administrativeAll;
let administrative = res.data.administrative;
this.treeData = [];
this.treeData[0] = administrativeAll;
this.setTreeData(administrative);
vm.attachRegionId = res.data.attachRegionId;
}
});
},
//初始化范围树
setTreeData(administrative) {
let treeIdList = [];
let checkList = [];
for (let i = 0; i < administrative.length; i++) {
treeIdList.push(administrative[i].id);
checkList[i] = {};
checkList[i].name = administrative[i].label;
checkList[i].key = administrative[i].id;
}
//console.log(treeIdList);
this.$refs.tree.setCheckedKeys(treeIdList);
this.tagsRegion = checkList;
},
initCheckList(allSelectedKeys) {
this.tagsRegion = [];
// console.log(allSelectedKeys);
// console.log(this.$refs.tree.getCheckedNodes());
let nodeData = this.$refs.tree.getCheckedNodes();
for (let i = 0; i < nodeData.length; i++) {
for (let j = 0; j < allSelectedKeys.length; j++) {
if (
allSelectedKeys[j].type == 1 &&
nodeData[i].id == allSelectedKeys[j].key
) {
let tagObj = {};
tagObj.name = nodeData[i].label;
tagObj.key = nodeData[i].id;
this.tagsRegion.push(tagObj);
}
}
}
},
onChecked() {
// let cData = [],
// oldData = (this.treeData.length && this.treeData.slice()) || [],
// checkedKeys = this.$refs.tree.getCheckedKeys(),
// halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys(),
// savedCheckedKeys = this.handlerCheckedData(oldData, checkedKeys).map(
// key => {
// return { type: 1, key: key };
// }
// ),
// savedHalfCheckedKeys = halfCheckedKeys.map(key => {
// return { type: 2, key: key };
// }),
// allSelectedKeys = savedCheckedKeys.concat(savedHalfCheckedKeys);
// vm.allSelectedKeys = allSelectedKeys;
console.log(
"getHalfCheckedKeys():",
this.$refs.tree.getHalfCheckedKeys()
);
console.log(
"getSimpleCheckedNodes():",
operationData.getSimpleCheckedNodes(this.$refs.tree.store)
);
let checkedTree = operationData.getSimpleCheckedNodes(
this.$refs.tree.store
);
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys();
vm.allSelectedKeys = operationData.setSelectedKeys(
checkedTree,
halfCheckedTree
);
console.log("vm.allSelectedKeys", vm.allSelectedKeys);
vm.initCheckList(vm.allSelectedKeys);
},
getTreeCheck() {
// let cData = [],
// oldData = (this.treeData.length && this.treeData.slice()) || [],
// checkedKeys = this.$refs.tree.getCheckedKeys(),
// halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys(),
// savedCheckedKeys = this.handlerCheckedData(oldData, checkedKeys).map(
// key => {
// return { type: 1, key: key };
// }
// ),
// savedHalfCheckedKeys = halfCheckedKeys.map(key => {
// return { type: 2, key: key };
// }),
// allSelectedKeys = savedCheckedKeys.concat(savedHalfCheckedKeys);
let checkedTree = operationData.getSimpleCheckedNodes(
this.$refs.tree.store
);
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys();
let allSelectedKeys = operationData.setSelectedKeys(
checkedTree,
halfCheckedTree
);
vm.allSelectedKeys = allSelectedKeys;
return allSelectedKeys;
},
// // 递归删除列表中所有子节点
// delSubKeysByNode(node, checkedKeys) {
// let idIndex;
// if (node.children && node.children.length) {
// if (node.children && node.children.length) {
// node.children.forEach(elm => {
// idIndex = checkedKeys.findIndex(id => {
// return id === elm.id;
// });
// if (idIndex > -1) {
// checkedKeys.splice(idIndex, 1);
// }
// if (elm.children && elm.children.length) {
// this.delSubKeysByNode(elm, checkedKeys);
// }
// });
// }
// }
// },
// // 去除子节点
// handlerCheckedData(oldData, checkedKeys) {
// oldData.forEach(element => {
// for (let i = 0; i < checkedKeys.length; i++) {
// // 如果此节点被选中,则删除所有子节点
// if (element.id === checkedKeys[i]) {
// this.delSubKeysByNode(element, checkedKeys);
// } else {
// if (element.children && element.children.length) {
// this.handlerCheckedData(element.children, checkedKeys);
// }
// }
// }
// });
// return checkedKeys;
// },
//添加子节点
append(data, node) {
console.log("data:", data);
console.log("node:", node);
if (data.children.length == 0) {
//let id = data.id + "add";
let statusValue = 0;
if (node.checked == true) {
statusValue = 1;
}
let req = {
id: data.id,
status: statusValue,
disabled: data.disabled
};
vm.GET("portal/scope/v1/administrative/children", req).then(res => {
if (res.code == "000000") {
let administrative = res.data.administrative;
//console.log(administrative);
data.children = administrative;
this.appendCheck(administrative, node.checked);
}
});
}
},
//子节点选中
appendCheck(administrative, checked) {
//console.log(checked,administrative)
let checkList = [];
checkList = this.$refs.tree.getCheckedKeys();
if (checked) {
for (let i = 0; i < administrative.length; i++) {
checkList.push(administrative[i].id);
// console.log(checkList);
}
}
this.$nextTick(function() {
this.$refs.tree.setCheckedKeys(checkList);
});
},
//通过key设置tree
setCheckedKeys(tagsRegion) {
console.log(tagsRegion);
let treeKeyList = [];
for (let index = 0; index < tagsRegion.length; index++) {
treeKeyList[index] = tagsRegion[index].key;
}
console.log(treeKeyList);
this.$refs.tree.setCheckedKeys(treeKeyList);
},
//删除label节点 同步树结构
handleCloseTree(tag) {
this.tagsRegion.splice(this.tagsRegion.indexOf(tag), 1);
this.setCheckedKeys(this.tagsRegion);
},
//设定的行政范围内容
getScope(type) {
let scope = "";
let noChangeTree = this.getTreeCheck();
console.log("this.allSelectedKeys", this.allSelectedKeys);
if (this.allSelectedKeys.length > 0) {
for (let i = 0; i < this.allSelectedKeys.length; i++) {
scope +=
this.allSelectedKeys[i].key + ":" + this.allSelectedKeys[i].type;
if (i < this.allSelectedKeys.length - 1) {
scope += "|";
}
}
} else {
// let noChangeTree = this.getTreeCheck();
console.log("noChangeTree值", noChangeTree);
if (noChangeTree.length > 0) {
for (let i = 0; i < noChangeTree.length; i++) {
scope += noChangeTree[i].key + ":" + noChangeTree[i].type;
if (i < noChangeTree.length - 1) {
scope += "|";
}
}
} else {
//选全国项目
if (this.tagsRegion.length > 0 && this.tagsRegion[0].key == "000") {
scope = "000:1";
console.log(this.tagsRegion, "scope", scope);
}
}
}
//console.log(scope);
return scope;
},
updateAttachRegion() {
let req = {
attachRegionId: vm.attachRegionId,
doctorId: vm.doctorId,
projectId: vm.formInline.portalProjectId,
scopeOfAdministrative: vm.getScope()
};
console.log("req", req);
vm.POST("portal/v2/role/insertOrUpdateAttachRegion", req).then(res => {
if (res.code == "000000") {
vm.$message({
message: "设置成功",
type: "success"
});
vm.dialogArea = false;
vm.queryRoleList();
} else {
vm.$message.error(res.message);
}
});
}
}
};
</script>
<style lang="scss">
.item-role-wrap {
.component-content {
padding: 10px;
background: #fff;
.form-inline {
margin-left: 30px;
}
.header-title {
position: relative;
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
.upload-excel {
position: absolute;
top: -2px;
right: 27px;
float: right;
}
.down-button {
margin-left: 10px;
}
}
.button-text {
color: #449284;
}
.user-name {
color: #449284;
}
.more-text {
max-height: 40px;
overflow-y: scroll;
}
.dialog-p {
text-align: center;
span {
color: #449284;
}
}
.dialog-success {
p {
text-align: center;
.upload-text {
color: #449284;
}
}
}
.dialog-fail {
.fail-close {
margin-left: -70px;
}
.upload-button {
position: absolute;
float: right;
width: 80px;
bottom: 20px;
right: 120px;
}
.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;
}
}
}
.dialog-area {
.el-tree-node__expand-icon {
display: none;
}
.el-dialog {
height: 700px;
.el-dialog__body {
overflow: hidden;
.area-choose {
padding: 10px 0 0 10px;
height: 515px;
overflow-y: scroll;
border: 1px solid #dddddd;
.el-icon-caret-bottom {
color: #449284;
}
.area-p {
color: #449284;
margin-bottom: 10px;
}
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
background-color: #449284;
border-color: #449284;
}
.is-checked .el-checkbox__inner {
background-color: #449284;
border-color: #449284;
}
}
}
}
.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;
}
}
}
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
}
}
.el-popover {
::-webkit-scrollbar
{
width: 4px;
height: 10px;
background-color: #D8D8D8;
}
::-webkit-scrollbar-thumb {
background-color: #D8D8D8;
}
.more-text {
padding: 0 5px 0 5px;
max-height: 55px;
overflow-y: scroll;
}
}
</style>
...@@ -432,6 +432,7 @@ export default { ...@@ -432,6 +432,7 @@ export default {
created() { created() {
vm = this; vm = this;
this.queryRoleList(); this.queryRoleList();
this.curmbThird = this.$route.query && this.$route.query.projectName || ''
}, },
// 挂载到Dom完成时 // 挂载到Dom完成时
mounted: function() { mounted: function() {
......
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
vm.search(); vm.search();
}, },
toPage(row) { toPage(row) {
this.$router.push("item-role?portalProjectId=" + row.id); this.$router.push("item-role?portalProjectId=" + row.id + '&projectName=' + row.projectName);
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.formInline.pageSize = val; this.formInline.pageSize = val;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册