提交 02d87d43 编写于 作者: tao.wu's avatar tao.wu

Merge branch 'dev-followUp-20190312' of...

Merge branch 'dev-followUp-20190312' of 192.168.110.53:com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-followUp-20190312
......@@ -7,4 +7,3 @@ dist/
node_modules/
.DS_Store
.vscode
src/utils/envConfig.js
\ No newline at end of file
......@@ -47,6 +47,7 @@ var webpackConfig = merge(baseWebpackConfig, {
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
favicon: 'favicon.ico',
inject: true,
// minify: {
// removeComments: true,
......
......@@ -2,6 +2,8 @@
<html>
<head>
<meta charset="utf-8">
<meta content="云鹊医,云鹊健康,工作站,项目管理,教培项目,学情报告,随访管理,预约随访" name="keywords">
<meta content="云鹊医工作站用于管理人员的日常操作,支持提交内容审核、管理项目、管理随访计划等功能。" name="description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
<meta name="screen-orientation" content="portrait"/>
<meta name="apple-mobile-web-app-capable" content="yes">
......
......@@ -67,12 +67,14 @@ export default {
localStorage.setItem('storageToken', vm.token)
vm.$router.push({ path: 'home' })
} else {
window.location.href = getLoginUrl() // 没有token返回登录页面
if(!localStorage.getItem('storageToken')) {
window.location.href = getLoginUrl('?from=work&type=logout') // 没有token返回登录页面
return
}
}
}else {
if(!localStorage.getItem('storageToken')) {
window.location.href = getLoginUrl() // 没有token返回登录页面
window.location.href = getLoginUrl('?from=work&type=logout') // 没有token返回登录页面
return
}
}
......@@ -82,7 +84,8 @@ export default {
// 修改token
...mapActions([
'changeToken',
'changeIdType'
'changeIdType',
'changeMaster'
]),
// 获取用户权限
getUserAuth(token) {
......@@ -90,13 +93,18 @@ export default {
req = {
token: token
}
vm.GET('common/v1/role',req).then((res) => {
vm.GET('portal/common/v1/role',req).then((res) => {
if(res.code == '000000') {
vm.changeIdType(res.data.idType)
vm.changeMaster(res.data.masterAdministratorFlag)
localStorage.setItem('storageIdType', res.data.idType)
localStorage.setItem('storageMaster', res.data.masterAdministratorFlag)
vm.idType = res.data.idType
vm.userName = res.data.name
vm.portrait = res.data.imageUrl
vm.authList = res.data.auth
} else {
vm.$message.info(res.message)
}
})
}
......
// import "@babel/polyfill";
import "@babel/polyfill";
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './router/router'
......
const common = {
state: {
_token: '',
idType: ''
idType: '',
masterAdministratorFlag: false
},
mutations: {
CHANGE_TOKEN: (state, data) => {
......@@ -9,6 +10,9 @@ const common = {
},
CHANGE_IDTYPE: (state, data) => {
state.idType = data
},
CHANGE_MASTER: (state, data) => {
state.masterAdministratorFlag = data
}
},
actions: {
......@@ -17,6 +21,9 @@ const common = {
},
changeIdType({ commit }, idTypeData) {
commit('CHANGE_IDTYPE', idTypeData)
},
changeMaster({ commit }, masterData) {
commit('CHANGE_MASTER', masterData)
}
}
}
......
const getters = {
_token: state => state.common._token,
idType: state => state.common.idType
idType: state => state.common.idType,
masterAdministratorFlag: state => state.common.masterAdministratorFlag
}
export default getters
......@@ -89,9 +89,7 @@ export default {
});
},
getNodeTimeContent(context, payload) {
getNodeTimeContent({}, {
urlSuffix:payload
}).then(({data}) => {
getNodeTimeContent(payload).then(({data}) => {
context.commit('GET_NODE_CONTENT', data);
});
},
......@@ -110,7 +108,7 @@ export default {
});
},
async getPlanList(context, payload) {
await followApi.getPlanList({
await getPlanList({
...payload
}).then(({data}) => {
context.commit('GET_PLAN_LIST', data);
......
import {getEnteringList, changeEnteringStatus, getEnteringInfo} from '../../utils/followup/followapis'
import {getEnteringList, getEnteringInfo} from '../../utils/followup/followapis'
export default {
namespaced: true,
......@@ -27,9 +27,7 @@ export default {
});
},
async getEnteringInfo(context, payload) {
await getEnteringInfo({}, {
...payload
}).then(({data}) => {
await getEnteringInfo(payload.patientId, payload.fuPlanPatientTimesId).then(({data}) => {
context.commit('GET_ENTERING_INFO', data);
});
},
......
......@@ -7,17 +7,17 @@ export default {
namespaced: true,
state: {
reservationList: { //居民列表
pageNum: 1, //当前页码
pageNo: 1, //当前页码
pageSize: 10, //每页数据大小
total: null, //总数
count: null, //总数
},
checkRevervationData: {},//发送预约校验
constantsData: {},//获取常量
getRevervationNum: null,
getRevervationNum: null, //查看已预约人数
},
mutations: {
GET_RESERVATION_LIST(state, payload) {
state.reservationList = payload
state.reservationList = payload.data.enteringDtos
},
GET_CHECK_RESERVATION(state, payload) {
state.checkRevervationData = payload
......@@ -31,10 +31,10 @@ export default {
},
actions: {
getReservationList(context, payload) {
const { pageSize, pageNum } = context.state.reservationList;
const { pageNo, pageSize } = context.state.reservationList;
getReservationList({
pageNo,
pageSize,
pageNum,
...payload
}).then(({data}) => {
context.commit('GET_RESERVATION_LIST', data);
......@@ -59,7 +59,6 @@ export default {
...payload
}).then(({data}) => {
context.commit('GET_REVERVATION_NUM', data.number)
// this.reservationForm.hasReservedNumber = data.number;
})
},
// getConstantsData({commit}) {
......
......@@ -125,7 +125,7 @@ html,body{
.screenSet{
// width: 163vh !important;
// height: 66vh !important;
height: 430px !important;
// height: 430px !important;
margin: 88px 30px 0px;
overflow: auto;
}
......@@ -134,7 +134,7 @@ html,body{
.screenSet{
// width: 166vh !important;
// height: 78vh !important;
height: 800px !important;
// height: 800px !important;
overflow: auto;
margin: 88px 30px 0px;
}
......
......@@ -46,9 +46,9 @@
border-color: #449284!important;
}
.el-form-item .el-form-item__label{
font-size: 14px;
}
/*.el-form-item .el-form-item__label{*/
/*font-size: 14px;*/
/*}*/
.el-message-box__content{
padding: 20px 15px;
......
......@@ -9,8 +9,8 @@ export const envConfig = {
// baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl: 'http://dev-sc.yunqueyi.com/portal/',
qiniuFileUrl: "http://localhost:10201/contents/admin/qiniu/token1",
baseUrl: 'https://dev-sc.yunqueyi.com/',
qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
......@@ -20,7 +20,7 @@ export const envConfig = {
followUpSC: 'https://dev-sc.yunqueyi.com'
},
dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/portal/',
baseUrl: 'https://dev-sc.yunqueyi.com/',
qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
......@@ -30,33 +30,33 @@ export const envConfig = {
followUpSC: 'https://dev-sc.yunqueyi.com'
},
test: {
baseUrl: 'https://test1-sc.yunqueyi.com/portal/',
baseUrl: 'https://test1-sc.yunqueyi.com/',
qiniuFileUrl: "https://test1-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://test1-saas.yunqueyi.com/pica-login/work_station.html',
loginUrl: 'https://test1.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://test-saas.yunqueyi.com/pica_index.html',
followUpSC: 'https://test1-sc.yunqueyi.com'
followUpSC: 'https://test1-sc.yunqueyi.com',
yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html'
},
uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/portal/',
baseUrl: 'https://uat-sc.yunqueyi.com/',
qiniuFileUrl: "https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://videos.yunqueyi.com", // 视频
qiniuImgUrl: "https://file.yunqueyi.com",
loginUrl: 'https://uat-saas.yunqueyi.com/pica-login/work_station.html',
qiniuResourceUrl: "https://video.yunqueyi.com", // 视频
qiniuImgUrl: "https://files.yunqueyi.com",
loginUrl: 'https://uat.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://uat-saas.yunqueyi.com/pica_index.html',
followUpSC: 'https://uat-sc.yunqueyi.com'
followUpSC: 'https://uat-sc.yunqueyi.com',
yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html'
},
pro: {
baseUrl: 'https://sc.yunqueyi.com/portal/',
baseUrl: 'https://sc.yunqueyi.com/',
qiniuFileUrl: "https://sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://videos.yunqueyi.com",
qiniuImgUrl: "https://file.yunqueyi.com",
loginUrl: 'https://saas.yunqueyi.com/pica-login/work_station.html',
qiniuResourceUrl: "https://video.yunqueyi.com",
qiniuImgUrl: "https://files.yunqueyi.com",
loginUrl: 'https://yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://saas.yunqueyi.com/pica_index.html',
followUpSC: 'https://sc.yunqueyi.com'
followUpSC: 'https://sc.yunqueyi.com',
yuequeyiIndexUrl: 'https://www.yunqueyi.com/pica_index.html'
}
}
......@@ -59,16 +59,14 @@ export default async(url = '', data = {}, type = 'POST', method = 'fetch',server
} else {
requestObj = new ActiveXObject;
}
let sendData = '';
if (type == 'POST' || type == 'DELETE' || type == 'PUT') {
sendData = JSON.stringify(data);
}
requestObj.open(type, url, true);
requestObj.setRequestHeader("Content-Type", "application/json");
requestObj.setRequestHeader("sysCode", "3");
requestObj.send(sendData);
requestObj.onreadystatechange = () => {
if (requestObj.readyState == 4) {
if (requestObj.status == 200) {
......
......@@ -11,12 +11,12 @@ const service = axios.create({
// request拦截器
service.interceptors.request.use(config => {
/*if( config.headers['sysCode']==undefined) {
if( config.headers['sysCode']==undefined) {
config.headers['sysCode'] = 12
}*/
// config.headers['token'] = '1B27380B2BFE4B8DA432EB149D237AA1'
// config.headers['token'] = localStorage.getItem('storageToken')
// config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
}
config.headers['token'] = 'B19ABBCB6B7A4B6F887A1ED6BCB69FD6'
//config.headers['token'] = localStorage.getItem('storageToken')
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
// if (config.data && config.data.setEntry) {
// config.headers['sysCode'] = config.data.sysCode || 10
// if(config.data.token){
......@@ -39,11 +39,11 @@ service.interceptors.response.use(
baseUrl时,返回000000为成功
apiUrl时,返回200为成功
*/
if (res.code !== '000000' && response.respCode === 200) {
return Promise.reject('error')
} else {
// if (res.code !== '000000') {
// return Promise.reject('error')
// } else {
return response.data
}
// }
},
error => {
// logger.error('err' + error)
......
......@@ -127,17 +127,22 @@ const vueFilter = {
},
//项目管理
statusProject: (value) => {
if(value == 1) {
//console.log(value)
if(value[0] == 1) {
return '草稿'
}else if(value == 2) {
}else if(value[0] == 2) {
return '未上架'
}else if(value == 3) {
return '审批中'
}else if(value == 4) {
}else if(value[0] == 3) {
if(value[1] == 1) {
return '待审核'
} else {
return '审核中'
}
}else if(value[0] == 4) {
return '已上架'
}else if(value == 5) {
}else if(value[0] == 5) {
return '已下架'
}else {
}else if(value[0] == 6) {
return '已拒绝'
}
},
......@@ -148,7 +153,7 @@ const vueFilter = {
return '项目负责人'
}else if(value == "L3") {
return '次级负责人'
} else if(value == "L4") {
} else if(value == "L0") {
return '普通用户'
}
},
......
......@@ -60,7 +60,7 @@ export const getPlanDetail = (planId) => {
export const getNodeTimeList = (planId) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/times/line/${planId}`),
url: getFollowUpSC(`/followup/plans/${planId}/time`),
method: 'get',
description: '获取随访时间节点列表',
})
......@@ -111,12 +111,12 @@ export const changePlan = (params) => {
};
/*预约管理*/
export const getReservationList = (params) => {
export const getReservationList = (data) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/appointmentPatient/`),
method: 'get',
params: params,
url: getFollowUpSC(`/followup/appoint/appointed/list`),
method: 'post',
data: data,
description: '获取预约列表',
})
};
......@@ -138,15 +138,24 @@ export const getReservationPatients = (params) => {
description: '查看预约人数',
})
};
export const changeReservationStatus = (params) => {
export const changeReservationStatus = (data) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/appoint/status/`),
url: getFollowUpSC(`/appoint/status/`),
method: 'post',
params: 'data',
data: data,
description: '手动变更预约状态',
})
};
export const sendReservation = (data) => {
return fetch({
headers,
url: getFollowUpSC(`/appoint/`),
method: 'post',
data: data,
description: '发送预约',
})
};
/*录入管理*/
export const getEnteringList = (data) => {
return fetch({
......@@ -162,23 +171,23 @@ export const changeEnteringStatus = (data) => {
headers,
url: getFollowUpSC(`/followup/entering/status/change`),
method: 'post',
data: 'data',
data: data,
description: '变更随访状态',
},)
}
export const getEnteringInfo = (patientId, fuPlanPatientTimesId) => {
return fetch({
headers,
url: getFollowUpSC(`followup/entering/${patientId}/fuInfo/${fuPlanPatientTimesId}`),
url: getFollowUpSC(`/followup/entering/${patientId}/fuInfo/${fuPlanPatientTimesId}`),
method: 'get',
params: 'params',
// params: params,
description: '随访单条信息查看',
},)
}
/*常量*/
export const getBasicData = (data) => {
export const getBasicData = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/basic-data/constants/`),
......
/**
* Created by Anndy Yang on 18/09/18.
*/
import { envConfig } from '@/utils/envConfig'
import { envConfig } from '@/utils/env-config'
export function setEventByModuleCode(itemData){
let modeCode = itemData.appModuleInfo.code || '';
......@@ -152,8 +152,8 @@ export function getQiniuToken1() {
}
// 登录URL
export function getLoginUrl() {
return getConfigByEnvType('loginUrl')
export function getLoginUrl(param) {
return getConfigByEnvType('loginUrl') + param
}
export function getInnerLoginUrl() {
return getConfigByEnvType('innerLoginUrl')
......@@ -174,7 +174,7 @@ export function uploadImg() {
// 获取随访微服务服务器域名地址
export function getFollowUpSC(url) {
return getConfigByEnvType('followUpSCSoSo') + url
return getConfigByEnvType('followUpSC') + url
}
// 获取常量接口域名地址
......
......@@ -12,7 +12,7 @@ module.exports = {
// this.token = this.getUrlSearch(location.href, 'token') || (query && query.token) || null
// this.token = this.getUrlKey('token') || (query && query.token) || null
},
mounted() {
mounted: function() {
},
methods: {
......
......@@ -111,19 +111,34 @@ let treeData = [
];
// 按钮type类型: 0-编辑
// 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝
// 7- 提醒审核 8(5)-取消审核 9-删除
let buttonStatus = [
// 7- 提醒审核 8(2)-取消审核 9-删除
let buttonStatusIn = [
//L1 内部管理员 L2项目负责人 L3次级负责人
//草稿
{ L1: "09", L2: "09", L3: "" },
{ L1: "09", L2: "", L3: "" },
//未上架
{ L1: "039", L2: "039", L3: "0" },
//待审核、审批中
{ L1: "46", L2: "78", L3: "" },
//已上架
{ L1: "05", L2: "05", L3: "0" },
//已下架
{ L1: "039", L2: "039", L3: "0" },
//已拒绝/未上架
{ L1: "039", L2: "039", L3: "0" },
];
let buttonStatusOut = [
//L1 内部管理员 L2项目负责人 L3次级负责人
//草稿
{ L1: "", L2: "09", L3: "" },
//未上架
{ L1: "09", L2: "039", L3: "0" },
//待审、审批中
//待审、审批中
{ L1: "46", L2: "78", L3: "" },
//已上架
{ L1: "05", L2: "05", L3: "5" },
{ L1: "05", L2: "05", L3: "0" },
//已下架
{ L1: "03", L2: "03", L3: "0" },
{ L1: "039", L2: "039", L3: "0" },
//已拒绝/未上架
{ L1: "09", L2: "039", L3: "0" },
];
......@@ -132,6 +147,7 @@ export function returnData() {
data.tableOrganization = tableOrganization;
data.tablePerson = tablePerson;
data.treeData = treeData;
data.buttonStatus = buttonStatus;
data.buttonStatusIn = buttonStatusIn;
data.buttonStatusOut = buttonStatusOut;
return data;
}
\ No newline at end of file
//求并集
export function getUnion(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1, ...set2]));
}
return null;
}
//求差集
export function getDifference(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1].filter(x => !set2.has(x))));
}
return null;
}
//求交集
export function getIntersect(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1].filter(x => set2.has(x))));
}
return null;
}
//获取id的list
export function getIdList(data) {
let list = [];
if(typeof data === 'undefined') {
return list;
}
if (data.constructor === Array) {
for (let i = 0; i < data.length; i++) {
list.push(data[i].id);
}
}
return list;
}
//区域
export function getDivision(data) {
if (data === null || data == 'NaN') {
let empty = [];
return empty;
}
let list = data.split('|');
let num = [];
for (let i = 0; i < list.length; i++) {
num[i] = parseInt(list[i]);
}
//console.log(list);
return num;
}
export function getLevelList(data) {
let level = [];
level[0] = {
id: '-1',
label: '全部医院等级',
}
for (let i = 0; i < data.length; i++) {
let obj = {
id: data[i].no,
label: data[i].value,
}
level.push(obj);
}
//console.log(level);
return level;
}
function inTags(id, tags) {
let flag = false;
for (let i = 0; i < tags.length; i++) {
if (tags[i].key == id) {
flag = true;
}
}
return flag;
}
export function inOrganization(list, id) {
let flag = false;
if (list.length == 0) {
flag = true;
}
for (let i = 0; i < list.length; i++) {
if (list[i].id != id) {
flag = true;
}
}
return flag;
}
export function initTags(value) {
let tags = [];
for (let j = 0; j < value.length; j++) {
let tagsComponent = {};
tagsComponent.value = value.value;
tagsComponent[j].name = this.optionsComponent[j].label;
}
return tags;
}
//机构列表
export function getOrganizationList(data) {
let list = [];
list[0] = {
value: '0',
label: '全部机构',
};
for (let i = 0; i < data.length; i++) {
let obj = {
value: data[i].key,
label: data[i].name,
}
list.push(obj);
}
return list;
}
//机构列表
export function getHospitalList(data) {
let list = [];
list[0] = {
value: 0,
label: '全部医院',
};
for (let i = 0; i < data.length; i++) {
let obj = {
value: data[i].id,
label: data[i].name,
}
list.push(obj);
}
//console.log(list);
return list;
}
//拼树
export function changeTags(option) {
let list = [];
// for(let i=0;i<option.length;i++) {
// console.log(option[i].label);
// let obj = {
// name: option[i].name,
// key: option[i].key,
// }
// list.push(obj);
// }
console.log(option);
return option;
}
// 递归删除多余的节点
function handlerAction(treeData, selData) {
treeData.forEach((elem, index) => {
if (!isValuable(elem.value, selData)) {
treeData.splice(index, 1)
handlerAction(treeData, selData)
} else {
if (elem.children) {
handlerAction(elem.children, selData)
}
}
})
return treeData;
}
function isValuable(val, selData) {
for (let i = 0; i < selData.length; i++) {
if (selData[i]['value'].indexOf(val) >= 0) {
return true
}
}
return false
}
function changeTreeKey(oData, orgKey, targetKey) {
oData = [...oData]
oData.forEach(elem => {
elem[targetKey] = elem[orgKey]
delete elem[orgKey]
if (elem.children) {
changeTreeKey(elem.children, orgKey, targetKey)
}
})
return oData
}
function deleteTreeKey(oData, delKeys) {
oData = [...oData]
oData.forEach(elem => {
delKeys.forEach(key => {
delete elem[key]
})
if (elem.children) {
deleteTreeKey(elem.children, delKeys)
}
})
return oData
}
function deleteEmptyChild(oData) {
oData = [...oData]
oData.forEach(elem => {
if (elem.children && elem.children.length == 0) {
delete elem.children
} else if (elem.children) {
deleteEmptyChild(elem.children)
}
})
return oData
}
function addEmpty(data) {
let after = [];
after[0] = {
label: "全部地区",
value: "0",
}
for(let i=0;i<data.length;i++) {
after.push(data[i]);
}
return after;
}
export function treeHandler(treeData, selData) {
//console.log('treeData',treeData,'selData',selData);
treeData = deleteTreeKey(treeData, ['status', 'disabled'])
treeData = changeTreeKey(treeData, 'id', 'value')
selData = changeTreeKey(selData, 'name', 'label')
selData = changeTreeKey(selData, 'key', 'value')
let endData = deleteEmptyChild(handlerAction(treeData, selData));
// console.log(treeData, selData)
//return handlerAction(treeData, selData);
let returnData = addEmpty(endData);
return returnData;
}
\ No newline at end of file
import {isEmptyUtils, isNotEmptyUtils, subString} from "./utils";
import fetchQiniu from './fetchQiniu.js';
import fetchQiniu from './fetch-qiniu.js';
import { getQiniuToken1, uploadVideo, uploadImg } from './index'
let fileApiUrl = getQiniuToken1()
......
......@@ -4,6 +4,20 @@ export const containObject = function(...obj1) {
let obj = Object.assign(...obj1)
return obj
}
// 获取页面自适应高度
export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'slidebar-container',
containerHeightId = 'screenSet'){
let containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 15
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
window.onresize = function() {
containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 15
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
}
}
function p_getElm(elmId){
return document.getElementById(elmId)
}
//共通函数
Array.prototype.contains = function (obj) {
if (this.length > 0) {
......
<template>
<div class="blank-wrap screenSet">
<div id="screenSet" class="blank-wrap screenSet">
<div class="blank-content">
<img src="../assets/image/no-content.png"/>
<p>很抱歉,您暂时还没开通工作站功能</p>
......@@ -7,8 +7,17 @@
</div>
</template>
<script>
import * as commonUtil from '../utils/utils'
export default {
data() {
return {
}
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight(100)
}
}
</script>
<style lang="scss">
......
<template>
<div class="add-manager-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="add-content screenSet">
<div class="add-content screenSet" id="screenSet">
<el-row class="step-content">
<el-col :span="14">
<el-steps :active="active" simple class>
......@@ -14,40 +14,59 @@
</el-steps>
</el-col>
<el-col :span="5" :offset="5">
<el-button size="small" @click="storage">暂存</el-button>
<el-button v-if="active<2" size="small" class="button-green" @click="nextStep">下一步</el-button>
<el-button v-if="active>=2" size="small" class="button-white" @click="complete">完成</el-button>
<el-button v-if="showStorage" size="small" @click="storage">暂存</el-button>
<el-button v-if="active<2" size="small" type="primary" @click="nextStep">下一步</el-button>
<el-button v-if="active>=2" size="small" type="primary" @click="complete">完成</el-button>
</el-col>
</el-row>
<div class="first-step" v-if="active === 0">
<el-form ref="formData" :model="formData" :rules="rules" label-width="150px">
<el-form
ref="formData"
:model="formData"
:rules="rules"
label-width="150px"
class="basic-form"
>
<el-form-item label="项目名称:" prop="projectName">
<el-col :span="13">
<el-input size="mini" v-model="formData.projectName" placeholder="请输入项目名称"></el-input>
<el-input
size="small"
v-model="formData.projectName"
placeholder="请输入项目名称"
style="width:83%;"
:disabled="peopleLevel == 'L3'"
></el-input>
<span class="word-num">{{(formData.projectName).replace(/\s+/g,"").length}}/20</span>
</el-col>
</el-form-item>
<el-form-item label="项目时间:" required>
<el-col :span="3">
<el-form-item label>
<el-col :span="5">
<el-form-item prop="projectBegintime">
<el-date-picker
v-model="formData.projectBegintime"
size="mini"
type="date"
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="~">
<el-form-item label prop="projectEndtime">
<el-date-picker
v-model="formData.projectEndtime"
size="mini"
type="date"
size="small"
type="datetime"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd 23:59:59"
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>
......@@ -55,53 +74,70 @@
<el-form-item label="项目简介:" prop="projectIntro">
<el-col :span="13">
<el-input
size="mini"
size="small"
type="textarea"
:autosize="{ minRows: 5}"
placeholder="请输入项目简介"
v-model="formData.projectIntro"
style="width:83%;"
:disabled="peopleLevel == 'L3'"
></el-input>
<span class="word-num">{{(formData.projectIntro).replace(/\s+/g,"").length}}/150</span>
</el-col>
</el-form-item>
<el-form-item label="列表图片:" prop="attachmentUrl1">
<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" :src="formData.attachmentUrl1" class="bg-img">
<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"
>
<!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
<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>尺寸:48*48</p>
<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="mini" v-model="formData.type" @change="changeCover">
<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>
<el-form-item label="封面图片(视频):" prop="attachmentUrl2">
<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
......@@ -109,6 +145,7 @@
width="100"
controls
class="bg-video"
@mouseover.stop="imgMouseOver2=true && peopleLevel != 'L3'"
>
<source :src="formData.attachmentUrl2" type="video/mp4">浏览器不支持mp4
</video>
......@@ -117,7 +154,7 @@
class="bg-img"
src="../../assets/image/small.png"
>
<!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
<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>
......@@ -130,7 +167,9 @@
</div>
</el-upload>
</el-form-item>
<el-form-item label="可下载附件:">
<p class="upload-message" v-if="uploadImgMessage2">请选择封面</p>
</div>
<el-form-item label="添加下载文件:">
<el-col :span="10">
<el-upload
v-model="formData.attachmentUrl3"
......@@ -144,6 +183,7 @@
multiple
:on-exceed="handleExceed"
:file-list="fileList"
:disabled="peopleLevel == 'L3'"
>
<el-button class="choose-button" plain icon="el-icon-document">选择文件</el-button>
<div slot="tip" class="el-upload__tip">支持文件类型:pdf</div>
......@@ -154,7 +194,7 @@
</div>
<div class="second-step" v-else-if="active === 1">
<el-tabs v-model="activeName" @tab-click="handleClickTabs">
<el-tab-pane v-if="idTypeValue == 1" label="设定行政范围" name="first">
<el-tab-pane v-if="idType != 2" label="设定行政范围" name="first">
<el-row :gutter="20">
<el-col class="rim" :span="12">
<!--
......@@ -178,7 +218,7 @@
<el-button
type="text"
icon="el-icon-caret-bottom"
size="mini"
size="small"
@click="() => append(data,node)"
></el-button>
</span>
......@@ -199,20 +239,29 @@
<el-tab-pane label="设定机构" name="second">
<el-form :inline="true" :model="formOrganization" class="demo-form-inline">
<el-form-item label>
<el-input size="mini" v-model="formOrganization.name" placeholder="请输入机构名称"></el-input>
</el-form-item>
<el-form-item label>
<el-select size="mini" v-model="formOrganization.region" placeholder="全部地区">
<!-- <el-select
size="small"
v-model="formOrganization.administrativeId"
placeholder="全部地区"
v-if="idType != 2"
>
<el-option
v-for="(item, index) in organizationRegion"
:key="index"
v-for="item in organizationRegion"
:key="item.id"
:label="item.label"
:value="item.id"
:value="item.value"
></el-option>
</el-select>
</el-select> -->
<el-cascader
v-if="idType != 2"
size="small"
expand-trigger="hover"
:options="organizationRegion"
v-model="formOrganization.administrativeIdList"
></el-cascader>
</el-form-item>
<el-form-item>
<el-select size="mini" v-model="formOrganization.grade" placeholder="全部医院级别">
<el-select size="small" v-model="formOrganization.level" placeholder="全部医院级别">
<el-option
v-for="(item, index) in organizationRank"
:key="index"
......@@ -221,8 +270,11 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label>
<el-input size="small" v-model="formOrganization.name" placeholder="请输入机构名称"></el-input>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="getOrganization()">搜索</el-button>
<el-button size="small" type="primary" @click="searchOrganization()">搜索</el-button>
</el-form-item>
<el-form-item style="float:right;">
<el-button-group>
......@@ -246,14 +298,26 @@
tooltip-effect="dark"
style="width: 100%"
@selection-change="selectionChangeOrganization"
:row-key="getRowKeys"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
type="selection"
width="55"
:selectable="selectableTableList"
:reserve-selection="true"
></el-table-column>
<el-table-column prop="name" label="医院名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="hospitalLevel" label="医院级别" align="center"></el-table-column>
<el-table-column prop="hospitalLevelName" label="医院级别" align="center"></el-table-column>
<el-table-column prop="provinceName" label="所属省份" align="center"></el-table-column>
<el-table-column prop="cityName" label="所属城市" align="center"></el-table-column>
<el-table-column prop="countyName" label="所属区县" align="center"></el-table-column>
<el-table-column prop="townName" label="所属街道" align="center"></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
......@@ -278,35 +342,48 @@
style="width: 100%"
@selection-change="selectionChangeDepartment"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
type="selection"
width="55"
:selectable="selectableTableList"
></el-table-column>
<el-table-column prop="name" label="科室名称" align="center"></el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有科室信息</p>
</div>
</div>
</el-table>
</el-col>
</el-tab-pane>
<el-tab-pane label="设定人员" name="fourth">
<el-form :inline="true" :model="formPerson" class="demo-form-inline">
<el-form-item label>
<el-select size="mini" v-model="formPerson.hospital" placeholder="全部医院">
<el-select size="small" v-model="formPerson.hospitalId" placeholder="全部医院">
<el-option
v-for="(item, index) in organizationRank"
v-for="(item, index) in hospitalList"
:key="index"
:label="item.label"
:value="item.id"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select size="mini" v-model="formPerson.department" placeholder="全部部门">
<el-select size="small" v-model="formPerson.departmentId" placeholder="全部科室">
<el-option
v-for="(item, index) in organizationRank"
:key="index"
v-for="item in departmentList"
:key="item.value"
:label="item.label"
:value="item.id"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label>
<el-input size="small" v-model="formPerson.name" placeholder="请输入人员名称"></el-input>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="getPeople">搜索</el-button>
<el-button size="small" type="primary" @click="searchPeople">搜索</el-button>
</el-form-item>
<el-form-item style="float:right;">
<el-button-group>
......@@ -330,14 +407,26 @@
tooltip-effect="dark"
style="width: 100%"
@selection-change="selectionChangePerson"
:row-key="getRowKeysPerson"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
type="selection"
width="55"
:reserve-selection="true"
:selectable="selectableTableList"
></el-table-column>
<el-table-column prop="name" label="人员名称" align="center"></el-table-column>
<el-table-column prop="hospitalName" label="所属医院" align="center"></el-table-column>
<el-table-column prop="departmentName" label="所属部门" align="center"></el-table-column>
<el-table-column prop="departmentName" label="所属科室" align="center"></el-table-column>
<el-table-column prop="provinceName" label="所属省份" align="center"></el-table-column>
<el-table-column prop="cityName" label="所属城市" align="center"></el-table-column>
<el-table-column prop="countyName" label="所属区县" align="center"></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
......@@ -353,6 +442,14 @@
</div>
</el-tab-pane>
</el-tabs>
<el-dialog title :visible.sync="dialogShow" width="40%" center>
<p class="dialog-p">设定范围数据已经被其他管理员修改,是否强制提交进行覆盖</p>
<span slot="footer" class="dialog-footer">
<el-button type="default" size="small" @click="dialogShow = false">取消</el-button>
<el-button type="primary" size="small" @click="coverData()">确定</el-button>
</span>
</el-dialog>
</div>
<div class="third-step" v-else-if="active === 2">
<el-form
......@@ -370,6 +467,7 @@
style="width: 350px"
placeholder="请选择组件"
@change="changeValue"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
>
<el-option
v-for="item in optionsComponent"
......@@ -393,7 +491,7 @@
</el-col>
</el-form-item>
<el-form-item label="配置证书:">
<el-radio-group v-model="formComponent.configure">
<el-radio-group v-model="formComponent.configure" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
......@@ -404,6 +502,7 @@
v-model="formComponent.certificate"
placeholder="请选择证书"
style="width: 350px"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
>
<el-option
v-for="item in optionsCertificate"
......@@ -421,37 +520,40 @@
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { doUpload, getFilePath } from "../../utils/qiniuUtil";
import { returnData } from "../mock";
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";
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
const itemOrganization = {
name: "上海市第一人民医院",
grade: "二甲医院",
province: "上海市",
city: "上海市",
district: "浦东新区",
street: "张江街道"
};
const itemPerson = {
name: "云小鹊",
hospital: "上海市第一人民医院",
department: "全科",
province: "上海市",
city: "上海市",
district: "长宁区"
};
// const itemOrganization = {
// name: "上海市第一人民医院",
// grade: "二甲医院",
// province: "上海市",
// city: "上海市",
// district: "浦东新区",
// street: "张江街道"
// };
// const itemPerson = {
// name: "云小鹊",
// hospital: "上海市第一人民医院",
// department: "全科",
// province: "上海市",
// city: "上海市",
// district: "长宁区"
// };
return {
idTypeValue: "",
itemOrganization: itemOrganization,
itemPerson: itemPerson,
idTypeValue: 1,
idTypeProject: '',
// itemOrganization: itemOrganization,
// itemPerson: itemPerson,
projectId: null,
peopleLevel: null,
//面包屑
curmbFirst: "教培项目",
curmbSecond: "新建项目",
......@@ -460,6 +562,10 @@ export default {
active: 0,
activeName: "first",
//基层信息 数据
uploadImgMessage: false,
uploadImgMessage2: false,
imgMouseOver: false,
imgMouseOver2: false,
imageUrl: "",
formData: {
projectName: "",
......@@ -469,11 +575,16 @@ export default {
type: 1,
attachmentUrl1: "",
attachmentUrl2: "",
attachmentUrl3: ""
attachmentUrl3: "",
attachmentMore1: {},
attachmentMore2: {}
},
pickerOptions0: {
disabledDate: time => {
if (this.formData.projectEndtime != "") {
if (
this.formData.projectEndtime != "" &&
this.formData.projectEndtime != null
) {
return (
time.getTime() > new Date(this.formData.projectEndtime).getTime()
);
......@@ -489,6 +600,7 @@ export default {
},
fileList: [],
//设定行政范围 数据
scopeReq: {},
allSelectedKeys: [],
updatedTree: false,
defaultProps: {
......@@ -499,47 +611,35 @@ export default {
treeData: [],
tagsRegion: [],
//设定机构 数据
getRowKeys(row) {
return row.id;
},
checkTableState: {
multipleOrganization: true,
multipleDepartment: true,
multiplePerson: true
multipleOrganization: "",
multipleDepartment: "",
multiplePerson: ""
},
updatedOrganization: false,
formOrganization: {
name: "",
region: "",
grade: "",
administrativeId: "0",
administrativeIdList: ['0'],
level: "-1",
chechAll: true,
pageNum: 1,
pageSize: 10
},
organizationRegion: [
{
id: "100",
label: "上海"
},
{
id: "101",
label: "北京"
}
],
organizationRank: [
{
id: "1",
label: "一甲"
},
{
id: "2",
label: "二甲"
}
],
organizationRegion: [],
organizationRank: [],
hasOrganizationInit: false,
tableOrganization: new Array(),
multipleSelectionOrganization: [],
currentOrganization: 1,
totalOrganization: 10,
pageSizeOrganization: 2,
changedOrganization: {},
lookedOrganization: [],
changedOrganization: [],
changedOrganization2: [],
//设定科室 数据
firstDepartment: true,
formDepartment: {
......@@ -550,19 +650,38 @@ export default {
updatedDepartment: false,
changedDepartment: {},
//设定人员 数据
getRowKeysPerson(row) {
return row.id;
},
formPerson: {
hospital: "",
department: "",
hospitalId: 0,
departmentId: -1,
name: "",
pageNum: 1,
pageSize: 10
},
hospitalList: [],
departmentList: [],
tablePerson: new Array(),
multipleSelectionPerson: [],
currentPerson: 1,
pageSizePerson: 2,
totalPerson: 10,
updatedPerson: false,
changedPerson: {},
lookedPerson: [],
changedPerson: [],
changedPerson2: [],
//dialog
dialogShow: false,
flagCover: 0,
//记录上次
scopeOfOrganizationLast: [],
scopeOfPeopleLast: [],
setKindOfOrganizationLast: '',
setKindOfPeopleLast: '',
//搜索类型
searchOrganizationType: '',
searchPeopleType: '',
//选择项目组件 数据
optionsComponent: [],
optionsCertificate: [],
......@@ -573,6 +692,7 @@ export default {
},
tagsComponent: [],
projectStatus: "",
showStorage: false,
//校验工具 数据
rulesComponent: {
component: [
......@@ -584,7 +704,7 @@ export default {
},
rules: {
projectName: [
{ required: true, message: "请输入活动名称", trigger: "blur" },
{ required: true, message: "请输入项目名称", trigger: "blur" },
{
min: 2,
max: 20,
......@@ -601,7 +721,6 @@ export default {
],
projectBegintime: [
{
type: "date",
required: true,
message: "请选择时间",
trigger: "change"
......@@ -609,7 +728,6 @@ export default {
],
projectEndtime: [
{
type: "date",
required: true,
message: "请选择时间",
trigger: "change"
......@@ -627,7 +745,8 @@ export default {
{ required: true, message: "请选择活动资源", trigger: "change" }
],
projectIntro: [
{ required: true, message: "请填写活动形式", trigger: "blur" }
{ required: true, message: "请填写项目简介", trigger: "blur" },
{ min: 1, max: 150, message: "超出可输入的最大长度", trigger: "blur" }
],
attachmentUrl1: [
{ required: true, message: "请选择列表图片", trigger: "blur" }
......@@ -639,26 +758,31 @@ export default {
};
},
computed: {
...mapGetters(["_token", "idType"])
...mapGetters(["_token"])
},
created() {
vm = this;
(this.projectId = vm.getUrlSearch(window.location.href, "projectId")),
this.editManager();
(this.peopleLevel = vm.getUrlSearch(window.location.href, "level"));
this.changeOnStep(this.active);
this.getComponentInfo();
this.$nextTick(function() {
//this.getDepartment();
this.idTypeValue = vm.idType;
//this.idTypeValue = 2;
if (this.idTypeValue == 2) {
console.log("idType:", vm.idType, " idTypeValue:", this.idTypeValue);
//this.editManager();
vm.idType = localStorage.getItem('storageIdType');
console.log('this.idType:'+ vm.idType);
if (vm.idType == 2) {
this.activeName = "second";
}
this.$nextTick(function() {
//this.getDepartment();
});
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
//表单校验
submitForm(formName) {
let flag = null;
......@@ -677,6 +801,16 @@ export default {
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 = "";
......@@ -695,13 +829,25 @@ export default {
type: editData.attachmentData[1].attachmentType,
attachmentUrl1: editData.attachmentData[0].attachmentUrl,
attachmentUrl2: editData.attachmentData[1].attachmentUrl,
attachmentUrl3: ""
attachmentUrl3: "",
attachmentMore1: {
attachmentName: editData.attachmentData[0].attachmentName,
attachmentExt: editData.attachmentData[0].attachmentExt,
attachmentSize: editData.attachmentData[0].attachmentSize
},
attachmentMore2: {
attachmentName: editData.attachmentData[1].attachmentName,
attachmentExt: editData.attachmentData[1].attachmentExt,
attachmentSize: editData.attachmentData[1].attachmentSize
}
};
if (editData.attachmentData.length > 2) {
for (let i = 2; i < editData.attachmentData.length; i++) {
let pdfItem = {
name: editData.attachmentData[i].attachmentName,
url: editData.attachmentData[i].attachmentUrl
url: editData.attachmentData[i].attachmentUrl,
attachmentExt: editData.attachmentData[i].attachmentExt,
attachmentSize: editData.attachmentData[i].attachmentSize
};
vm.fileList.push(pdfItem);
}
......@@ -713,10 +859,11 @@ export default {
componentEdit.push(editData.componentData[i].relevanceId);
}
this.formComponent.component = componentEdit;
this.changeValue(componentEdit);
this.initTags(componentEdit);
if (editData.certificateData.length > 0) {
this.formComponent.configure = 1;
this.formComponent.certificate = editData.componentData[0].relevanceId;
this.formComponent.certificate =
editData.certificateData[0].relevanceId;
}
},
//编辑管理
......@@ -724,17 +871,29 @@ export default {
let req = {};
let projectId = vm.getUrlSearch(window.location.href, "projectId");
if (projectId != null && projectId != "") {
vm.GET("portalInfo/getProjectInfo/" + projectId, req).then(res => {
openLoading(vm);
vm.GET("portal/portalInfo/getProjectInfo/" + projectId, req).then(
res => {
closeLoading(vm);
if (res.code == "000000" && res.data.projectData != null) {
let editData = res.data;
this.setEditData(editData);
this.idTypeProject = res.data.projectData.idType;
this.projectStatus = res.data.projectData.projectStatus;
if (this.projectStatus == 1) {
this.showStorage = true;
}
//console.log('projectStatus:',this.projectStatus);
} else {
console.log(res);
}
});
}
);
} else {
this.showStorage = true;
}
},
//编辑/更新 基础信息
insertOrUpdate(option) {
//console.log(this.formData);
......@@ -748,12 +907,18 @@ export default {
{
attachmentType: 1,
attachmentUrl: this.formData.attachmentUrl1,
attachmentName: this.formData.attachmentMore1.attachmentName,
attachmentExt: this.formData.attachmentMore1.attachmentExt,
attachmentSize: this.formData.attachmentMore1.attachmentSize,
kind: 1,
seqNo: 1
},
{
attachmentType: this.formData.type,
attachmentUrl: this.formData.attachmentUrl2,
attachmentName: this.formData.attachmentMore2.attachmentName,
attachmentExt: this.formData.attachmentMore2.attachmentExt,
attachmentSize: this.formData.attachmentMore2.attachmentSize,
kind: 2,
seqNo: 1
}
......@@ -765,20 +930,24 @@ export default {
attachmentType: 3,
attachmentName: vm.fileList[i].name,
attachmentUrl: vm.fileList[i].url,
attachmentExt: vm.fileList[i].attachmentExt,
attachmentSize: vm.fileList[i].attachmentSize,
kind: 3
};
attachmentPDFModel.push(PDFModel);
}
//}
if (option == "edit") {
if (option == "edit" || option == "storageEdit") {
//编辑
projectModel.id = this.formData.id;
projectModel.projectStatus = this.projectStatus;
for (let i = 0; i < attachmentModel.length; i++) {
attachmentModel[i].portalProjectId = this.formData.id;
}
for (let i = 0; i < attachmentPDFModel.length; i++) {
attachmentPDFModel[i].portalProjectId = this.formData.id;
}
//idTypeProject
}
let postData = {
projectModel: JSON.stringify(projectModel),
......@@ -786,22 +955,51 @@ export default {
attachmentPDFModel: JSON.stringify(attachmentPDFModel)
};
//console.log(postData);
vm.POST("portalInfo/insertOrUpdate", postData).then(res => {
openLoading(vm);
vm.POST("portal/portalInfo/insertOrUpdate", postData).then(res => {
closeLoading(vm);
if(option == "storage" || option == "storageEdit") {
vm.$message.info(res.message);
}
if (res.code == "000000") {
console.log(res);
this.active++;
this.stepData = [false, true, false];
//console.log(res);
this.projectId = res.data.id;
this.projectStatus = res.data.projectStatus;
this.idTypeProject = res.data.idType;
this.operationLast();
if (option != "storage" && option != "storageEdit") {
this.active++;
this.stepData = [false, true, false];
// this.projectId = res.data.id;
this.initRange();
this.getDepartment();
}
}
});
},
//查询上次设定范围
operationLast() {
let req = {};
vm.GET("portal/scope/v1/" + this.projectId + "/operation/last", req).then(
res => {
if (res.code == "000000") {
this.scopeReq = res.data.scopeReq;
//console.log(this.scopeReq);
//operationData.getDivision(res.data.scopeReq.scopeOfAdministrative);
this.setKindOfOrganizationLast = this.scopeReq.setKindOfOrganization;
this.setKindOfPeopleLast = this.scopeReq.setKindOfPeople;
this.scopeOfOrganizationLast = operationData.getDivision(this.scopeReq.scopeOfOrganization);
this.scopeOfPeopleLast = operationData.getDivision(this.scopeReq.scopeOfPeople);
//this.changedOrganization = list;
}
}
);
},
//查询组件证书信息
getComponentInfo() {
let param = {};
vm.GET("portalInfo/getComponentInfo", param).then(res => {
vm.GET("portal/portalInfo/getComponentInfo", param).then(res => {
if (res.code == "000000") {
//console.log(res);
let componentList = res.data.componentList;
......@@ -823,6 +1021,7 @@ export default {
this.optionsComponent = optionsComponent;
this.optionsCertificate = optionsCertificate;
}
this.editManager();
});
},
//项目组件信息 暂存/完成
......@@ -834,19 +1033,17 @@ export default {
type: type,
status: this.projectStatus
};
vm.POST("portalInfo/componentDraft", param).then(res => {
vm.POST("portal/portalInfo/componentDraft", param).then(res => {
console.log(res);
if (res.code == "000000") {
this.$notify({
title: "成功",
message: "项目创建成功"
vm.$message({
message: res.message,
type: "info"
});
if (res.code == "000000") {
//notify
if (type == 2) {
this.$router.push("item-manager");
} else {
this.$notify({
title: "",
message: res.message
});
}
}
});
},
......@@ -856,37 +1053,63 @@ export default {
this.stepData = [true, false, false];
} else if (active == 1) {
this.stepData = [false, true, false];
this.operationLast();
this.initRange();
this.getDepartment();
} else if (active == 2) {
this.stepData = [false, false, true];
}
},
//选择范围选中所有table被选中
checkAllTable() {
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleAllSelection();
this.$refs.multipleDepartment.toggleAllSelection();
this.$refs.multiplePerson.toggleAllSelection();
});
},
//点击暂存
storage() {
console.log("暂存步骤" + (this.active + 1));
if (this.active == 0) {
//暂存步骤1
let formName = "formData";
let state = this.submitForm(formName);
if (state === true) {
this.insertOrUpdate();
if (this.formData.projectName != "") {
if (
this.formData.projectName.length < 2 ||
this.formData.projectName.length > 20
) {
this.$message.error("输入长度为2-20的内容");
return;
}
let urlProjectId = vm.getUrlSearch(window.location.href, "projectId");
if (urlProjectId == null) {
let param = {
projectName: this.formData.projectName
};
vm.GET("portal/portalInfo/checkProjectName", param).then(res => {
//console.log(res);
if (res.code == "000000") {
//移动到第二页 选择范围
this.insertOrUpdate("storage");
} else {
this.$message.info(res.message);
}
});
} else {
//console.log('urlProjectId'+urlProjectId);
this.insertOrUpdate("storageEdit");
}
} else {
this.$message.error("请输入项目名称");
}
} else if (this.active == 1) {
//暂存步骤2
if(this.tagsRegion.length == 0) {
vm.$message({
type: "info",
message: '成功',
});
return;
}
let req = {
projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"),
setKindOfAdministrative: this.getKind("administrativeScope"),
setKindOfOrganization: this.getKind("organization"),
setKindOfDepartment: this.getKind("department"),
setKindOfPeople: this.getKind("person")
setKindOfPeople: this.getKind("person"),
flag: this.flagCover,
};
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrativeUpdate");
......@@ -902,39 +1125,63 @@ export default {
if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) {
req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople);
}
vm.POST("scope", req).then(res => {
//移动到选择项目组件
openLoading(vm);
vm.POST("portal/scope", req).then(res => {
//暂存范围
closeLoading(vm);
console.log(res);
this.$notify({
title: "",
vm.$message({
type: "info",
message: res.message
});
});
} else if (this.active == 2) {
//暂存步骤3
let formName = "formComponent";
let completeState = this.submitForm(formName);
if (completeState === true) {
this.componentDraft(1);
}
// let formName = "formComponent";
// let completeState = this.submitForm(formName);
// if (completeState === true) {
// this.componentDraft(1);
// }
}
},
//点击完成
complete() {
//type 1:暂存 2:完成
if (this.projectStatus == 4) {
vm.$message.info("完成");
vm.$router.push({ path: "item-manager" });
return;
}
let formName = "formComponent";
let completeState = this.submitForm(formName);
if (completeState === true) {
this.componentDraft(2);
}
},
//覆盖数据
coverData() {
this.dialogShow = false;
this.flagCover = 1;
this.nextStep();
},
//点击下一步
nextStep() {
if (this.active == 0) {
let formName = "formData";
let removeState = this.submitForm(formName);
console.log("判断移动" + removeState);
if (removeState === true) {
if (!vm.formData.attachmentUrl1) {
vm.uploadImgMessage = true;
} else {
vm.uploadImgMessage = false;
}
if (!vm.formData.attachmentUrl2) {
vm.uploadImgMessage2 = true;
} else {
vm.uploadImgMessage2 = false;
}
//console.log("判断移动" + removeState);
if (removeState === true && vm.formData.attachmentUrl1!='' && vm.formData.attachmentUrl2!='') {
//校验名字
let projectId = vm.getUrlSearch(window.location.href, "projectId");
if (projectId == null) {
......@@ -942,41 +1189,41 @@ export default {
let param = {
projectName: this.formData.projectName
};
vm.GET("portalInfo/checkProjectName", param).then(res => {
vm.GET("portal/portalInfo/checkProjectName", param).then(res => {
if (res.code == "000000") {
//移动到第二页 选择范围
// this.operationLast();
this.insertOrUpdate("add");
// this.active++;
// this.stepData = [false, true, false];
//this.initRange();
//this.checkAllTable();
} else {
this.$message.error("项目名称" + res.message);
this.$message.info(res.message);
}
});
} else {
//编辑
// this.operationLast();
this.insertOrUpdate("edit");
// this.active++;
// this.stepData = [false, true, false];
//this.initRange();
}
}
} else if (this.active == 1) {
if (this.idTypeValue == 1) {
//进入第三步
if (this.idType == 1) {
//内部管理员
if (this.tagsRegion.length > 0) {
if (this.tagsRegion.length > 0 || this.idTypeProject == 2) {
//选择了范围
let req = {
projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"),
setKindOfAdministrative: this.getKind("administrativeScope"),
//scopeOfAdministrative: "000:2|000_110:1",
setKindOfOrganization: this.getKind("organization"),
//scopeOfOrganization: "2|3|4|5|6|7",
setKindOfDepartment: this.getKind("department"),
//scopeOfDepartment: "54",
setKindOfPeople: this.getKind("person")
setKindOfPeople: this.getKind("person"),
//scopeOfPeople: ""
flag: this.flagCover,
};
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrativeUpdate");
......@@ -995,15 +1242,23 @@ export default {
if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) {
req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople);
}
vm.POST("scope", req).then(res => {
openLoading(vm);
vm.POST("portal/scope", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
//移动到选择项目组件
console.log(res);
//console.log(res);
let statusMove = this.scopeStatus(res.data.status);
if(statusMove === 0) {
this.active++;
this.stepData = [false, false, true];
} else {
this.$notify({
title: "",
console.log('不能改变范围status:'+res.data.status)
}
} else {
vm.$message({
type: "info",
message: res.message
});
}
......@@ -1012,10 +1267,51 @@ export default {
//没有选择范围
vm.$message({
showClose: true,
message: "选择项目范围后才能进行下一步操作",
message: "项目范围不能为空",
type: "error"
});
}
} else {
//外部人员
let req = {
projectId: this.projectId,
setKindOfAdministrative: 0,
setKindOfOrganization: this.getKind("organization"),
setKindOfDepartment: this.getKind("department"),
setKindOfPeople: this.getKind("person"),
flag: this.flagCover,
};
if (
req.setKindOfOrganization == 2 ||
req.setKindOfOrganization == 3
) {
req.scopeOfOrganization = this.getScopeOrganization(
req.setKindOfOrganization
);
}
if (req.setKindOfDepartment == 3) {
req.scopeOfDepartment = this.getScopeDepartment();
}
if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) {
req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople);
}
vm.POST("portal/scope", req).then(res => {
if (res.code == "000000") {
//移动到选择项目组件
let statusMove = this.scopeStatus(res.data.status);
if(statusMove === 0) {
this.active++;
this.stepData = [false, false, true];
} else {
console.log('不能改变范围status:'+res.data.status)
}
} else {
vm.$message({
type: "info",
message: res.message
});
}
});
}
}
},
......@@ -1026,11 +1322,13 @@ export default {
//上传列表图片
beforeUploadListPic(file) {
let fileLimit = {
width: 48,
height: 48,
width: 230,
height: 172,
size: 0.5,
sizeText: "500Kb",
key: "attachmentUrl1"
sizeText: "500K",
key: "attachmentUrl1",
more: "attachmentMore1",
show: "uploadImgMessage"
};
this.beforeAvatarUpload(file, fileLimit);
},
......@@ -1040,8 +1338,10 @@ export default {
width: 750,
height: 420,
size: 2,
sizeText: "2.0Mb",
key: "attachmentUrl2"
sizeText: "2.0M",
key: "attachmentUrl2",
more: "attachmentMore2",
show: "uploadImgMessage2"
};
if (this.formData.type == 1) {
this.beforeAvatarUpload(file, fileLimit);
......@@ -1070,7 +1370,9 @@ export default {
console.log(path);
let fileItem = {
name: path.name,
url: path.fullPath
url: path.fullPath,
attachmentExt: path.ext,
attachmentSize: path.size
};
vm.fileList.push(fileItem);
vm.$message.success("上传成功");
......@@ -1086,10 +1388,11 @@ export default {
const isMP4 = file.type === "video/mp4";
const isLt = file.size / 1024 / 1024 < 500;
if (!isLt) {
this.$message.error("上传视频大小不能超过500M !");
this.$message.error("视频不符合规范,请根据规范上传视频");
return;
}
if (!isMP4) {
this.$message.error("请上传MP4格式文件!");
this.$message.error("视频不符合规范,请根据规范上传视频");
} else {
openLoading(vm);
doUpload(
......@@ -1098,10 +1401,11 @@ export default {
getFilePath(file, null),
"preview4",
"progress1",
1
''
).then(function(path) {
closeLoading(vm);
console.log(path);
vm.uploadImgMessage2 = false;
vm.formData.attachmentUrl2 = path.fullPath;
vm.$message.success("上传成功");
});
......@@ -1113,12 +1417,12 @@ export default {
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) {
this.$message.error("上传头像图片只能是 JPG 格式!");
this.$message.error("图片不符合规范,请根据规范上传图片");
return;
}
if (!isLt2M) {
this.$message.error(
"上传头像图片大小不能超过 " + fileLimit.sizeText + "!"
);
this.$message.error("图片不符合规范,请根据规范上传图片 ");
return;
}
let _img = new FileReader();
_img.readAsDataURL(file);
......@@ -1131,7 +1435,7 @@ export default {
_this.width != fileLimit.width ||
_this.height != fileLimit.height
) {
vm.$message.info("上传图片长宽不合适,请重新上传");
vm.$message.error("图片不符合规范,请根据规范上传图片");
} else {
openLoading(vm);
doUpload(
......@@ -1144,7 +1448,17 @@ export default {
).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
};
vm.$message.success("上传成功");
});
}
......@@ -1164,11 +1478,11 @@ export default {
//console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${
files.length
} 个文件,共选择了 ${files.length + fileList.length} 个文件`
);
// this.$message.warning(
// `当前限制选择 3 个文件,本次选择了 ${
// files.length
// } 个文件,共选择了 ${files.length + fileList.length} 个文件`
// );
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`);
......@@ -1180,8 +1494,13 @@ export default {
//新建
} else {
//编辑
if(this.idTypeValue == 1) {
this.listLevels();
if (this.idType != 2) {
this.getAdministrative();
} else {
this.activeName = "second";
this.getOrganization();
this.getCheckedTree();
}
}
},
......@@ -1190,7 +1509,13 @@ export default {
let tabName = tab.name;
if (tabName == "second") {
//设定机构
this.formOrganization.pageNum = 1;
this.formOrganization.name ="";
this.formOrganization.administrativeIdList = ['0'];
this.formOrganization.level ="-1";
this.getCheckedTree();
this.getOrganization();
// this.listLevels();
} else if (tabName == "third") {
//设定科室
// if (this.checkTableState.multipleDepartment && this.firstDepartment) {
......@@ -1199,9 +1524,31 @@ export default {
// }
} else if (tabName == "fourth") {
//设定人员
this.formPerson.pageNum = 1;
this.formPerson.name ="";
this.formPerson.departmentId = -1;
this.formPerson.hospitalId = 0;
this.getHospital();
this.departmentList = this.getDepartmentList();
//console.log('departmentList',this.departmentList);
this.getPeople();
}
},
//获取勾选树
getCheckedTree() {
if(this.idType != 2) {
let allTree = JSON.parse(JSON.stringify(this.treeData[0].children));
let changedTags = JSON.parse(JSON.stringify(this.tagsRegion));
let organizationArea = operationData.treeHandler(allTree,changedTags);
console.log('多级树:',organizationArea);
this.organizationRegion = organizationArea;
//改
// this.organizationRegion = operationData.getOrganizationList(
// this.tagsRegion
// );
//console.log(this.organizationRegion);
}
},
//初始化范围树
setTreeData(administrative) {
let treeIdList = [];
......@@ -1222,7 +1569,7 @@ export default {
projectId: this.projectId
};
openLoading(vm);
vm.GET("scope/v1/administrative", req).then(res => {
vm.GET("portal/scope/v1/administrative", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
//console.log(res.data);
......@@ -1231,11 +1578,11 @@ export default {
this.treeData = [];
this.treeData[0] = administrativeAll;
this.setTreeData(administrative);
this.getCheckedTree();
//console.log("treeData", this.treeData);
}
});
},
//列举选中地区
initCheckList(allSelectedKeys) {
this.tagsRegion = [];
......@@ -1256,63 +1603,45 @@ export default {
}
}
},
//子节点选中
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);
});
},
//添加子节点
append(data, node) {
console.log("data:", data);
console.log("node:", node);
if (data.children.length == 0) {
let id = data.id + "add";
const newChild = [
{ id: id, label: "testtest", children: [] },
{ id: id, label: "22", children: [] }
];
//data.children.push(newChild);
let req = {
id: data.id
};
vm.GET("scope/v1/administrative/children", req).then(res => {
if (res.code == "000000") {
let administrative = res.data.administrative;
console.log(administrative);
data.children = administrative;
//data.children.push(newChild);
}
});
}
},
//树结构
loadNode(node, resolve) {
if (node.level === 0) {
return resolve([{ label: "全国", id: "000", status: 0 }]);
}
if (node.level === 1) {
let req = {
//projectId: vm.getUrlSearch(window.location.href, "projectId"),
projectId: 54
};
vm.GET("scope/v1/administrative", req).then(res => {
if (res.code == "000000") {
let administrativeAll = res.data.administrativeAll;
let administrative = res.data.administrative;
let children = administrativeAll.children;
//console.log(administrativeAll);
return resolve(children);
}
});
//let id = data.id + "add";
let statusValue = 0;
if (node.checked == true) {
statusValue = 1;
}
if (node.level === 2 || node.level === 3 || node.level === 4) {
let req = {
id: node.data.id
id: data.id,
status: statusValue,
disabled: data.disabled
};
vm.GET("scope/v1/administrative/children", req).then(res => {
vm.GET("portal/scope/v1/administrative/children", req).then(res => {
if (res.code == "000000") {
let administrative = res.data.administrative;
return resolve(administrative);
//console.log(administrative);
data.children = administrative;
this.appendCheck(administrative, node.checked);
}
});
}
if (node.level === 5) return resolve([]);
},
getCheckedKeys() {
console.log(this.$refs.tree.getCheckedKeys());
......@@ -1339,6 +1668,22 @@ export default {
this.updateOrganizationAndPerson(allSelectedKeys);
this.updatedTree = true;
},
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);
return allSelectedKeys;
},
// 递归删除列表中所有子节点
delSubKeysByNode(node, checkedKeys) {
let idIndex;
......@@ -1387,8 +1732,10 @@ export default {
//删除label节点 同步树结构
handleCloseTree(tag) {
if (this.projectStatus != 4) {
this.tagsRegion.splice(this.tagsRegion.indexOf(tag), 1);
this.setCheckedKeys(this.tagsRegion);
}
},
//获取反选数据
getDifference(a, b) {
......@@ -1399,42 +1746,54 @@ export default {
}
return null;
},
getReverseData(data, check) {
let reverse = [];
//console.log('data',data,'check',check);
for (let i = 0; i < data.length; i++) {
for (let j = 0; j < check.length; j++) {
if (data[i].id !== check[j].id) {
reverse.push(data[i]);
}
}
//获取医院等级
listLevels() {
let req = {};
vm.GET("contents/courseDoctor/listLevels?sysCode=10", req).then(res => {
if (res.code == "000000") {
// console.log(res);
this.organizationRank = operationData.getLevelList(res.data.list);
} else {
this.organizationRank = [{
id: '0',
label: '全部医院等级',
}];
}
return reverse;
});
},
selectableTableList(row, index) {
if (this.projectStatus == 4) {
if (row.status == 1) {
//console.log("scopeReq",this.scopeReq);
return false;
}
return true;
}
return true;
},
//改变 设定机构选项
selectionChangeOrganization(val) {
this.multipleSelectionOrganization = val;
//console.log(val.length , this.formOrganization.pageSize , this.updatedOrganization)
if (
val.length != 0 &&
val.length != this.formOrganization.pageSize &&
this.updatedOrganization == false
) {
this.updatedOrganization = true;
console.log("机构被更新", this.updatedOrganization);
}
if (this.updatedOrganization == true) {
this.changedOrganization[this.formOrganization.pageNum] = [];
this.changedOrganization[
this.formOrganization.pageNum
][0] = this.multipleSelectionOrganization;
let reverse = this.getDifference(
this.tableOrganization,
this.multipleSelectionOrganization
);
this.changedOrganization[this.formOrganization.pageNum][1] = reverse;
console.log("check机构:", this.changedOrganization);
selectionChangeOrganization(rows) {
this.changedOrganization = [];
this.changedOrganization2 = [];
if (rows) {
rows.forEach(row => {
if (row) {
this.changedOrganization.push(row.id);
}
});
}
this.changedOrganization2 = operationData.getDifference(
this.lookedOrganization,
this.changedOrganization
);
console.log(
"选",
this.changedOrganization,
"没",
this.changedOrganization2
);
this.updatePerson();
this.$refs.multiplePerson.clearSelection();
},
//改变机构 table 的check状态
selectionChangeDepartment(val) {
......@@ -1442,94 +1801,175 @@ export default {
//console.log(this.multipleSelectionDepartment);
},
//改变人员 table的check状态
selectionChangePerson(val) {
this.multipleSelectionPerson = val;
//console.log(this.multipleSelectionPerson);
if (
val.length != 0 &&
val.length != this.formPerson.pageSize &&
this.updatedPerson == false
) {
this.updatedPerson = true;
console.log("人员被更新", this.updatedPerson);
}
if (this.updatedPerson == true) {
this.changedPerson[this.formPerson.pageNum] = [];
this.changedPerson[
this.formPerson.pageNum
][0] = this.multipleSelectionPerson;
let reverse = this.getDifference(
this.tablePerson,
this.multipleSelectionPerson
);
this.changedPerson[this.formPerson.pageNum][1] = reverse;
console.log("check人员:", this.changedPerson);
selectionChangePerson(rows) {
this.changedPerson = [];
this.changedPerson2 = [];
if (rows) {
rows.forEach(row => {
if (row) {
this.changedPerson.push(row.id);
}
});
}
this.changedPerson2 = operationData.getDifference(
this.lookedPerson,
this.changedPerson
);
console.log(
"选",
this.changedPerson,
"没",
this.changedPerson2
);
},
//设定机构table全选
checkAll(flag, name) {
//console.log(flag + " " + name);
if (name == "multipleOrganization") {
this.changedOrganization = {};
} else if (name == "multiplePerson") {
this.changedPerson = {};
}
//机构全选
let checkItem = this.checkTableState[name];
if (flag === true) {
if (this.checkTableState[name] === false) {
let idList = operationData.getIdList(this.tableOrganization);
//console.log('idList',idList,'changedOrganization',this.changedOrganization);
let difference = operationData.getDifference(
idList,
this.changedOrganization
);
//console.log('difference',difference);
if (difference.length > 0) {
this.$refs[name].toggleAllSelection();
}
this.checkTableState[name] = true;
this.changedOrganization2 = [];
this.changedOrganization = operationData.getDifference(
this.lookedOrganization,
this.changedOrganization2
);
} else {
this.$refs[name].clearSelection();
this.checkTableState[name] = false;
this.changedOrganization = [];
this.changedOrganization2 = operationData.getDifference(
this.lookedOrganization,
this.changedOrganization
);
}
//置空
} else if (name == "multiplePerson") {
//人员全选
if (flag === true) {
let idList = operationData.getIdList(this.tablePerson);
//console.log('idList',idList,'changedPerson',this.changedPerson);
let difference = operationData.getDifference(
idList,
this.changedPerson
);
//console.log('difference',difference);
if (difference.length > 0) {
this.$refs[name].toggleAllSelection();
}
this.checkTableState[name] = true;
this.changedPerson2 = [];
this.changedPerson = operationData.getDifference(
this.lookedPerson,
this.changedPerson2
);
} else {
this.$refs[name].clearSelection();
this.checkTableState[name] = false;
this.changedPerson = [];
this.changedPerson2 = operationData.getDifference(
this.lookedPerson,
this.changedPerson
);
}
}
},
//获取用户类型
getKind(type) {
let kind = 0;
let kind = 3;
if (type == "administrative") {
//console.log('this.tagsRegion',this.tagsRegion);
kind = 3;
if (this.updatedTree == true) {
kind = 3;
}
//console.log('this.idTypeProject',this.idTypeProject);
if(this.idTypeProject == 2 && this.tagsRegion.length == 0) {
kind = 0;
}
if(this.idType == 2) {
kind = 0;
}
} else if (type == "administrativeScope") {
kind = 3;
if (this.tagsRegion.length > 0) {
kind = 3;
}
if(this.idTypeProject == 2 && this.tagsRegion.length == 0) {
kind = 0;
}
if(this.idType == 2) {
kind = 0;
}
} else if (type == "organization") {
if (this.checkTableState.multipleOrganization == true) {
//设置机构类别0:无 1:全选 2:去掉 3:选中
if (this.checkTableState.multipleOrganization === false) {
//全部不选
kind = 0;
if (this.changedOrganization.length > 0) {
kind = 3;
}
} else if (this.checkTableState.multipleOrganization === true) {
//设置机构类别0:无 1:全选 2:去掉 3:选中
kind = 1;
for (let key in this.changedOrganization) {
if (this.changedOrganization[key][1].length > 0) {
if (this.changedOrganization2.length > 0) {
kind = 2;
}
} else if(this.checkTableState.multipleOrganization === '') {
kind = this.setKindOfOrganizationLast;
if(this.setKindOfOrganizationLast === -1) {
kind = 1;
}
} else {
//全部不选
kind = 0;
for (let key in this.changedOrganization) {
if (this.changedOrganization[key][0].length > 0) {
//初始化0或1
if(kind == 0 && this.changedOrganization.length > 0) {
kind = 3;
}
if(kind == 1 && this.changedOrganization2.length > 0) {
kind = 2;
}
}
} else if (type == "department") {
kind = 3;
if (this.multipleSelectionDepartment.length > 0) {
kind = 3;
}
} else if (type == "person") {
if (this.checkTableState.multiplePerson == true) {
//设置机构类别0:无 1:全选 2:去掉 3:选中
//设置人员类别0:无 1:全选 2:去掉 3:选中
if (this.checkTableState.multiplePerson === false) {
//全部不选
kind = 0;
if (this.changedPerson.length > 0) {
kind = 3;
}
} else if (this.checkTableState.multiplePerson === true) {
kind = 1;
for (let key in this.changedPerson) {
if (this.changedPerson[key][1].length > 0) {
if (this.changedPerson2.length > 0) {
kind = 2;
}
} else if(this.checkTableState.multiplePerson === '') {
kind = this.setKindOfPeopleLast;
if(this.setKindOfPeopleLast === -1) {
kind = 1;
}
} else {
//全部不选
kind = 0;
for (let key in this.changedPerson) {
if (this.changedPerson[key][0].length > 0) {
//初始化0或1
if(kind == 0 && this.changedPerson.length > 0) {
kind = 3;
}
if(kind == 1 && this.changedPerson2.length > 0) {
kind = 2;
}
}
}
......@@ -1546,7 +1986,8 @@ export default {
}
}
} else if (type == "administrativeUpdate") {
//console.log("allSelectedKeys", this.allSelectedKeys);
//console.log(this.allSelectedKeys.length);
if (this.allSelectedKeys.length > 0) {
for (let i = 0; i < this.allSelectedKeys.length; i++) {
scope +=
this.allSelectedKeys[i].key + ":" + this.allSelectedKeys[i].type;
......@@ -1554,16 +1995,88 @@ export default {
scope += "|";
}
}
} else {
let noChangeTree = this.getTreeCheck();
console.log(noChangeTree);
for (let i = 0; i < noChangeTree.length; i++) {
scope += noChangeTree[i].key + ":" + noChangeTree[i].type;
if (i < noChangeTree.length - 1) {
scope += "|";
}
}
}
}
//console.log(scope);
return scope;
},
//查询机构列表
getOrganization() {
initOrganizationStatus() {
let tableStatus = this.tableOrganization;
tableStatus.forEach(row => {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(row);
});
}
});
},
//选择搜索机构方式
searchOrganization() {
this.formOrganization.pageNum = 1;
let searchForm = this.formOrganization;
if (
searchForm.administrativeId == "0" &&
searchForm.administrativeIdList[searchForm.administrativeIdList.length-1] == "0" &&
searchForm.level == "-1" &&
searchForm.name == ""
) {
this.searchOrganizationType = '';
this.getOrganization();
} else {
this.searchOrganizationType = 'choose';
this.getOrganizationChoose();
}
},
//初始化搜索机构状态
initOrganizationChoose() {
let tableStatus = this.tableOrganization;
if(typeof tableStatus === 'undefined') {
return;
}
tableStatus.forEach(row => {
let idList = [];
idList[0] = row.id;
//console.log('this.changedOrganization2',this.changedOrganization2);
let intersect = operationData.getIntersect(idList,this.changedOrganization);
let intersect2 = operationData.getIntersect(idList,this.changedOrganization2);
//debugger;
if(intersect.length > 0) {
//选中
this.$refs.multipleOrganization.toggleRowSelection(row);
} else if (intersect2.length > 0) {
//不选
} else {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(row);
});
}
}
});
},
//机构搜索
getOrganizationChoose() {
// console.log('formOrganization',this.formOrganization);
let lastNum = this.formOrganization.administrativeIdList.length - 1
let administrativeIdItem = this.formOrganization.administrativeIdList[lastNum];
console.log('多级选中administrativeIdItem:',administrativeIdItem)
let req = {
projectId: this.projectId,
setKind: this.getKind("administrative"),
// scope: "000_110",
//administrativeId: this.formOrganization.administrativeId,
administrativeId: administrativeIdItem,
departmentLevel: this.formOrganization.level,
organizationName: this.formOrganization.name,
pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize
};
......@@ -1571,66 +2084,98 @@ export default {
req.scope = this.getScope("administrative");
}
openLoading(vm);
vm.POST("scope/v1/organization", req).then(res => {
vm.POST("portal/scope/v1/organization/choose", req).then(res => {
closeLoading(vm);
console.log(res);
if (res.code == "000000") {
//console.log(res.data);
this.tableOrganization = res.data.organizationList;
this.totalOrganization = res.data.total;
console.log("changedOrganization", this.changedOrganization);
//console.log('机构状态:'+this.checkTableState.multipleOrganization);
if (this.checkTableState.multipleOrganization == true) {
//全选
if (
this.updatedOrganization == true &&
this.changedOrganization[this.formOrganization.pageNum] !=
undefined
) {
//机构table 勾选被更新过
let rowCheck = this.changedOrganization[
this.formOrganization.pageNum
][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tableOrganization.length; i++) {
if (this.tableOrganization[i].id == row.id) {
rowItem = this.tableOrganization[i];
}
}
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(rowItem);
});
});
} else {
let idList = operationData.getIdList(this.tableOrganization);
let intersect = operationData.getIntersect(
idList,
this.changedOrganization
);
this.lookedOrganization = operationData.getUnion(
this.lookedOrganization,
idList
);
//console.log('全部看过的:',this.lookedOrganization);
if (vm.checkTableState.multipleOrganization === "") {
this.initOrganizationChoose();
} else if (vm.checkTableState.multipleOrganization === true) {
let intersect2 = operationData.getIntersect(
idList,
this.changedOrganization
);
// console.log('intersect2',intersect2);
if (intersect2.length == 0) {
this.$refs.multipleOrganization.toggleAllSelection();
}
} else {
//全不选
if (
this.updatedOrganization == true &&
this.changedOrganization[this.formOrganization.pageNum] !=
undefined
) {
let rowCheck = this.changedOrganization[
this.formOrganization.pageNum
][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tableOrganization.length; i++) {
if (this.tableOrganization[i].id == row.id) {
rowItem = this.tableOrganization[i];
}
}
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(rowItem);
});
});
},
//查询机构列表
getOrganization() {
let req = {
projectId: this.projectId,
setKind: this.getKind("administrative"),
// scope: "000_110",
pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize
};
if (req.setKind == 3) {
req.scope = this.getScope("administrative");
}
openLoading(vm);
vm.POST("portal/scope/v1/organization", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
//console.log(res.data);
this.tableOrganization = res.data.organizationList;
this.totalOrganization = res.data.total;
//console.log("changedOrganization", this.changedOrganization);
let idList = operationData.getIdList(this.tableOrganization);
let intersect = operationData.getIntersect(
idList,
this.changedOrganization
);
this.lookedOrganization = operationData.getUnion(
this.lookedOrganization,
idList
);
// this.changedOrganization2 = operationData.getDifference(
// this.lookedOrganization,
// this.changedOrganization
// );
let difference = operationData.getDifference(
idList,
this.changedOrganization2
);
//debugger;
//console.log('全部看过的:',this.lookedOrganization);
if (vm.checkTableState.multipleOrganization === "") {
if (intersect.length == 0 && difference.length > 0) {
this.initOrganizationStatus();
}
} else if (vm.checkTableState.multipleOrganization === true) {
let intersect2 = operationData.getIntersect(
idList,
this.changedOrganization
);
// console.log('intersect2',intersect2);
if (intersect2.length == 0) {
this.$refs.multipleOrganization.toggleAllSelection();
}
}
// this.changedOrganization2 = operationData.getDifference(
// this.lookedOrganization,
// this.changedOrganization
// );
}
});
},
......@@ -1639,7 +2184,7 @@ export default {
let req = {
projectId: this.projectId
};
vm.GET("scope/v1/department", req).then(res => {
vm.GET("portal/scope/v1/department", req).then(res => {
if (res.code == "000000") {
this.tableDepartment = res.data.department;
......@@ -1657,20 +2202,22 @@ export default {
//获取机构id列表
getScopeOrganization(type) {
let scope = "";
//2:去掉 3:选中
if (type == 2) {
for (let key in this.changedOrganization) {
let organizationItem = this.changedOrganization[key][1];
console.log("organizationItem:", organizationItem);
for (let i = 0; i < organizationItem.length; i++) {
scope += organizationItem[i].id + "|";
}
// console.log(this.scopeOfOrganizationLast,this.changedOrganization);
let differenceScope = operationData.getDifference(this.scopeOfOrganizationLast,this.changedOrganization);
//console.log('differenceScope',differenceScope);
let unionScope = operationData.getUnion(this.changedOrganization2,differenceScope);
//console.log('unionScope',unionScope);
for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|";
}
} else if (type == 3) {
for (let key in this.changedOrganization) {
let organizationItem = this.changedOrganization[key][0];
for (let i = 0; i < organizationItem.length; i++) {
scope += organizationItem[i].id + "|";
}
console.log(this.scopeOfOrganizationLast,this.changedOrganization2);
let differenceScope = operationData.getDifference(this.scopeOfOrganizationLast,this.changedOrganization2);
let unionScope = operationData.getUnion(this.changedOrganization,differenceScope);
for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|";
}
}
scope = scope.substring(0, scope.length - 1);
......@@ -1680,22 +2227,24 @@ export default {
//获取人员id列表
getScopePeople(type) {
let scope = "";
//2:去掉 3:选中
if (type == 2) {
for (let key in this.changedPerson) {
let peopleItem = this.changedPerson[key][1];
//console.log("peopleItem:", peopleItem);
for (let i = 0; i < peopleItem.length; i++) {
scope += peopleItem[i].id + "|";
}
let differenceScope = operationData.getDifference(this.scopeOfPeopleLast,this.changedPerson);
//console.log('differenceScope',differenceScope);
let unionScope = operationData.getUnion(this.changedPerson2,differenceScope);
for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|";
}
} else if (type == 3) {
for (let key in this.changedPerson) {
let peopleItem = this.changedPerson[key][0];
for (let i = 0; i < peopleItem.length; i++) {
scope += peopleItem[i].id + "|";
}
//console.log(this.changedPerson2,this.scopeOfPeople);
let differenceScope = operationData.getDifference(this.scopeOfPeopleLast,this.changedPerson2);
let unionScope = operationData.getUnion(this.changedPerson,differenceScope);
// debugger;
for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|";
}
}
scope = scope.substring(0, scope.length - 1);
console.log("scope people", scope);
return scope;
......@@ -1709,8 +2258,78 @@ export default {
scope = scope.substring(0, scope.length - 1);
return scope;
},
//查询人员列表
getPeople() {
//获取医院
getHospital() {
let req = {
projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"),
//scopeOfAdministrative: "000_110",
setKindOfOrganization: this.getKind("organization"),
//scopeOfOrganization: "2|3|4|5|6|7",
pageNum: this.formPerson.pageNum,
pageSize: this.formPerson.pageSize
};
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrative");
}
if (req.setKindOfOrganization == 2 || req.setKindOfOrganization == 3) {
req.scopeOfOrganization = this.getScopeOrganization(
req.setKindOfOrganization
);
}
vm.POST("portal/scope/v1/hospital", req).then(res => {
if (res.code == "000000") {
console.log(res);
this.hospitalList = operationData.getHospitalList(res.data.organizationList);
}
})
},
//选择搜索机构方式
searchPeople() {
this.formPerson.pageNum = 1;
let searchForm = this.formPerson;
if (
searchForm.hospitalId === 0 &&
searchForm.departmentId === -1 &&
searchForm.name == ""
) {
this.searchPeopleType = '';
this.getPeople();
} else {
this.searchPeopleType = 'choose';
this.getPeopleChoose();
}
},
//初始化搜索人员状态
initPeopleChoose() {
let tableStatus = this.tablePerson;
if(typeof tableStatus === 'undefined') {
return;
}
tableStatus.forEach(row => {
let idList = [];
idList[0] = row.id;
let intersect = operationData.getIntersect(idList,this.changedPerson);
let intersect2 = operationData.getIntersect(idList,this.changedPerson2);
// debugger;
if(intersect.length > 0) {
//选中
this.$refs.multiplePerson.toggleRowSelection(row);
} else if (intersect2.length > 0) {
//不选
} else {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multiplePerson.toggleRowSelection(row);
});
}
}
});
},
//人员搜索
getPeopleChoose() {
// console.log('formOrganization',this.formOrganization);
let req = {
projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"),
......@@ -1720,7 +2339,10 @@ export default {
setKindOfDepartment: this.getKind("department"),
//scopeOfDepartment: 54,
pageNum: this.formPerson.pageNum,
pageSize: this.formPerson.pageSize
pageSize: this.formPerson.pageSize,
hospitalId: this.formPerson.hospitalId,
departmentId: this.formPerson.departmentId,
name: this.formPerson.name,
};
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrative");
......@@ -1734,63 +2356,138 @@ export default {
req.scopeOfDepartment = this.getScopeDepartment();
}
openLoading(vm);
vm.POST("scope/v1/people", req).then(res => {
vm.POST("portal/scope/v1/people/choose", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
console.log(res);
if (res.code == "000000") {
this.tablePerson = res.data.people;
this.totalPerson = res.data.total;
if (this.checkTableState.multiplePerson == true) {
//全选
if (
this.updatedPerson == true &&
this.changedPerson[this.formPerson.pageNum] != undefined
) {
//机构table 勾选被更新过
let rowCheck = this.changedPerson[this.formPerson.pageNum][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tablePerson.length; i++) {
if (this.tablePerson[i].id == row.id) {
rowItem = this.tablePerson[i];
let idList = operationData.getIdList(this.tablePerson);
let intersect = operationData.getIntersect(
idList,
this.changedPerson
);
this.lookedPerson = operationData.getUnion(
this.lookedPerson,
idList
);
// this.changedPerson2 = operationData.getDifference(
// this.lookedPerson,
// this.changedPerson
// );
//console.log('全部看过的:',this.lookedPerson);
if (vm.checkTableState.multiplePerson === "") {
this.initPeopleChoose();
} else if (vm.checkTableState.multiplePerson === true) {
let intersect2 = operationData.getIntersect(
idList,
this.changedPerson
);
if (intersect2.length == 0) {
this.$refs.multiplePerson.toggleAllSelection();
}
}
}
});
},
initPeopleStatus() {
let tableStatus = this.tablePerson;
tableStatus.forEach(row => {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multiplePerson.toggleRowSelection(rowItem);
this.$refs.multiplePerson.toggleRowSelection(row);
});
}
});
} else {
this.$refs.multiplePerson.toggleAllSelection();
},
//查询人员列表
getPeople() {
let req = {
projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"),
//scopeOfAdministrative: "000_110",
setKindOfOrganization: this.getKind("organization"),
//scopeOfOrganization: "2|3|4|5|6|7",
setKindOfDepartment: this.getKind("department"),
//scopeOfDepartment: 54,
pageNum: this.formPerson.pageNum,
pageSize: this.formPerson.pageSize
};
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrative");
}
} else {
//person 全不选
if (
this.updatedPerson == true &&
this.changedPerson[this.formPerson.pageNum] != undefined
) {
let rowCheck = this.changedPerson[this.formPerson.pageNum][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tablePerson.length; i++) {
if (this.tablePerson[i].id == row.id) {
rowItem = this.tablePerson[i];
if (req.setKindOfOrganization == 2 || req.setKindOfOrganization == 3) {
req.scopeOfOrganization = this.getScopeOrganization(
req.setKindOfOrganization
);
}
if (req.setKindOfDepartment == 3) {
req.scopeOfDepartment = this.getScopeDepartment();
}
this.$nextTick(function() {
this.$refs.multiplePerson.toggleRowSelection(rowItem);
});
});
openLoading(vm);
vm.POST("portal/scope/v1/people", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
console.log(res);
this.tablePerson = res.data.people;
this.totalPerson = res.data.total;
let idList = operationData.getIdList(this.tablePerson);
let intersect = operationData.getIntersect(
idList,
this.changedPerson
);
this.lookedPerson = operationData.getUnion(
this.lookedPerson,
idList
);
// this.changedPerson2 = operationData.getDifference(
// this.lookedPerson,
// this.changedPerson
// );
let difference = operationData.getDifference(
idList,
this.changedPerson2
);
//console.log('全部看过的:',this.lookedPerson);
if (vm.checkTableState.multiplePerson === "") {
// console.log('intersect',intersect);
if (intersect.length == 0 && difference.length > 0) {
this.initPeopleStatus();
}
} else if (vm.checkTableState.multiplePerson === true) {
let intersect2 = operationData.getIntersect(
idList,
this.changedPerson
);
// console.log('intersect2',intersect2);
if (intersect2.length == 0) {
this.$refs.multiplePerson.toggleAllSelection();
}
}
}
});
},
//设定人员中科室列表
getDepartmentList() {
let list = [];
list[0] = {
value: -1,
label: '全部科室',
};
for (let i = 0; i < this.tableDepartment.length; i++) {
if (this.tableDepartment[i].status == 1) {
let obj = {
value: this.tableDepartment[i].id,
label: this.tableDepartment[i].name
};
list.push(obj);
}
}
return list;
},
//机构table修改
handleSizeOrganization(val) {
console.log(`每页 ${val} 条`);
......@@ -1799,7 +2496,11 @@ export default {
handleCurrentOrganization(val) {
//console.log(`当前页: ${val}`);
this.formOrganization.pageNum = val;
if(this.searchOrganizationType == 'choose') {
this.getOrganizationChoose();
} else {
this.getOrganization();
}
},
//角色table修改
handleSizePerson(val) {
......@@ -1809,19 +2510,49 @@ export default {
handleCurrentPerson(val) {
console.log(`当前页: ${val}`);
this.formPerson.pageNum = val;
if(this.searchPeopleType == 'choose') {
this.getPeopleChoose();
} else {
this.getPeople();
}
},
//行政范围改变更新设定机构和设定人员
updateOrganizationAndPerson(allSelectedKeys) {
this.tableOrganization = [];
this.tablePerson = [];
this.$refs.multipleOrganization.clearSelection();
this.lookedOrganization = [];
this.changedOrganization = [];
this.changedOrganization2 = [];
// this.lookedPerson = [];
// this.changedPerson = [];
// this.changedPerson2 = [];
},
//设定机构改变更新设定人员
updatePerson(organization) {
if (this.hasOrganizationInit === true) {
this.tablePerson = [];
updatePerson() {
this.lookedPerson = [];
this.changedPerson = [];
this.changedPerson2 = [];
},
//scope的不同status操作
scopeStatus(data) {
//console.log('范围提交status:'+data);
let status = data;
//console.log('范围提交status:'+status);
if(status === 0) {
this.flagCover = 0;
} else if(status === 1) {
vm.$message({
type: "info",
message: "您已被上级管理员移除项目,暂无权限操作",
});
this.$router.push("item-manager");
} else if(status === 2) {
console.log('弹框');
this.flagCover = 1;
this.dialogShow = true;
}
this.hasOrganizationInit = true;
return status;
},
//选择项目组件
//改变组件选择情况
......@@ -1841,8 +2572,25 @@ export default {
}
//console.log('this.tagsComponent',this.tagsComponent);
},
initTags(value) {
//console.log('value',value,'optionsComponent',this.optionsComponent);
this.tagsComponent = [];
let len = 0;
for (let i = 0; i < value.length; i++) {
for (let j = 0; j < this.optionsComponent.length; j++) {
if (value[i] == this.optionsComponent[j].value) {
this.tagsComponent[len] = {};
this.tagsComponent[len].value = this.optionsComponent[j].value;
this.tagsComponent[len].name = this.optionsComponent[j].label;
len++;
}
}
}
//console.log('this.tagsComponent',this.tagsComponent);
},
//选择组件数据绑定
handleCloseComponent(tag) {
if (this.projectStatus == 1 || this.projectStatus == 2) {
this.tagsComponent.splice(this.tagsComponent.indexOf(tag), 1);
this.formComponent.component = [];
for (let j = 0; j < this.tagsComponent.length; j++) {
......@@ -1850,6 +2598,7 @@ export default {
}
}
}
}
};
</script>
<style lang="scss">
......@@ -1863,9 +2612,9 @@ export default {
.step-content {
overflow: hidden;
height: 60px;
margin-top: 66px;
padding-top: 15px;
border-bottom: 1px solid #fff;
// margin-top: 66px;
padding: 15px 0 50px 0;
border-bottom: 1px solid #efefef;
.is-text {
display: none;
}
......@@ -1886,25 +2635,72 @@ export default {
}
.step-num {
display: block;
margin-top: 1.5px;
font-size: 12px;
border: 2px solid #b8babe;
border: 1px solid #999 !important;
border-radius: 50%;
width: 25px;
height: 20px;
height: 18px;
line-height: 15px;
text-align: center;
color: #b8babe;
color: #999;
}
.el-step__title.is-wait {
color: #999;
}
.el-step__title.is-process {
color: #449284;
}
.is-finish {
color: #c0c4cc;
color: #999 !important;
}
.on-step {
color: #747476;
border-color: #747476;
color: #449284;
border: 1px solid #449284 !important;
}
}
.first-step {
margin-top: 20px;
.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;
......@@ -1915,7 +2711,7 @@ export default {
}
.bg-video {
float: left;
width: 100px;
width: 84px;
height: 100px;
}
.limit-text {
......@@ -1941,7 +2737,21 @@ export default {
}
.second-step {
margin: 10px 0 0 20px;
.dialog-p {
text-align: center;
span {
color: #449284;
}
}
//隐藏树展开
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
.el-tree-node__expand-icon {
display: none;
}
......@@ -1973,6 +2783,9 @@ export default {
margin-left: 20px;
content: "•";
}
.el-tabs__item.is-active {
color: #fff;
}
.el-tag {
margin: 0 10px 10px 0;
border: 1.3px solid #48a8fe;
......
......@@ -6,7 +6,7 @@
:curmbThird="curmbThird"
:jumPathThird="jumPathThird">
</bread-crumb>
<div class="create-content screenSet">
<div class="create-content screenSet" id="screenSet">
<div class="step-content">
<el-steps :active="stepNum" simple>
<span class="step-one" :class="stepNum == 1 ? 'class-1' : 'class-2'">1</span>
......@@ -22,16 +22,18 @@
</div>
</div>
<div class="first-step" v-if="stepNum == 1">
<el-form ref="basicInfoForm" class="basic-form" :model="portalComponent" :rules="rules" label-width="125px" label-suffix=":" size="mini" style="margin-bottom:30px;">
<el-form ref="basicInfoForm" class="basic-form" :model="portalComponent" :rules="rules" label-width="125px" label-suffix=":" size="small" style="margin-bottom:30px;">
<el-form-item label="组件名称" prop="name">
<el-input type="text" v-model="portalComponent.name" @blur="componentName" size="mini" placeholder="请输入组件名称" style="width:30%;"></el-input>
<span class="word-num">0/20</span>
<el-input type="text" v-model="portalComponent.name" @blur="componentName" size="small" placeholder="请输入组件名称" style="width:30%;"></el-input>
<span class="word-num">{{(portalComponent.name).replace(/\s+/g,"").length}}/20</span>
<p class="component-name" v-if="isStorage">输入组件名称</p>
</el-form-item>
<el-form-item label="组件简介" prop="introduce">
<el-input type="textarea" rows="4" cols="10" v-model="portalComponent.introduce" size="mini" placeholder="请输入组件简介" style="width:37%;"></el-input>
<span class="word-num">0/150</span>
<el-input type="textarea" rows="4" cols="10" v-model="portalComponent.introduce" size="small" placeholder="请输入组件简介" style="width:37%;"></el-input>
<span class="word-num">{{(portalComponent.introduce).replace(/\s+/g,"").length}}/150</span>
</el-form-item>
<div class="basic-item-icon">
<span class="require">*</span>
<el-form-item label="组件图片" prop="imageUrl">
<el-upload
v-model="portalComponent.imageUrl"
......@@ -39,8 +41,9 @@
action="#"
:show-file-list="false"
:before-upload="beforeAvatarUpload">
<img v-if="portalComponent.imageUrl" :src="portalComponent.imageUrl" class="bg-img">
<img v-if="portalComponent.imageUrl" @mouseover.stop="imgMouseOver=true" :src="portalComponent.imageUrl" class="bg-img">
<img v-if="!portalComponent.imageUrl" class="bg-img" src="../../assets/image/small.png">
<div class="img-delete" v-show="imgMouseOver" @click.stop="deleteImg" @mouseout.stop="imgMouseOver=false"><i class="el-icon-delete"></i></div>
<div class="limit-text">
<p>尺寸大小:750*420</p>
<p>限制大小: 2.0 Mb</p>
......@@ -48,18 +51,23 @@
</div>
</el-upload>
</el-form-item>
<p class="upload-message" v-if="uploadImgMessage">请上传组件图片</p>
</div>
<el-row>
<el-col :span="6">
<div class="basic-item-icon">
<span class="require">*</span>
<el-form-item label="配置证书">
<el-radio-group v-model="certificateLable" @change="selectCertificate">
<el-radio-group v-model="certificateLable" @change="selectCertificate" :disabled="componentStatus == 3 || componentStatus == 4">
<el-radio label="是"></el-radio>
<el-radio label="否"></el-radio>
</el-radio-group>
</el-form-item>
</div>
</el-col>
<el-col :span="10" v-if="hasCertificate">
<el-form-item label="选择证书" prop="certificateId">
<el-select v-model="portalComponent.certificateId" @change="selectChange" placeholder="请选择资源包" style="width: 352px;">
<el-select v-model="portalComponent.certificateId" @change="selectChange" :disabled="componentStatus == 3 || componentStatus == 4" placeholder="请选择证书" style="width: 352px;">
<el-option
v-for="(item,index) in certificateIdSelect"
:key="index"
......@@ -70,11 +78,12 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item v-if="hasCertificate" label="获得证书完成率" prop="certificateCondition">
<el-form-item v-if="hasCertificate" label="组件完成(%)" prop="certificateCondition">
<el-input-number
v-model="portalComponent.certificateCondition"
controls-position="right"
@change="handleChange"
:disabled="componentStatus == 3 || componentStatus == 4"
:step="10"
:min="10"
:max="100">
......@@ -95,14 +104,14 @@
<el-row>
<el-col :span="10">
<el-form-item label="模块名称" prop="name">
<el-input v-model="item.name" :disabled="conditionSelect || idType == 2 || item.moduleType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" placeholder="请选择模块名称" style="width:288px;"></el-input>
<el-input v-model="item.name" @blur="moduleNameValidate(index)" :disabled="conditionSelect || idType == 2 || item.moduleType == 2 || (item.id != '' && item.openFlag == 2)" size="small" placeholder="请选择模块名称" style="width:288px;"></el-input>
</el-form-item>
</el-col>
<el-col :span="10" v-if="idType == 1">
<el-form-item label="是否对外开放" prop="openFlag">
<el-radio-group v-model="item.openFlag" @change="selectIsOpen(index)" :disabled="conditionSelect || item.moduleType == 2 || (item.id != '' && item.openFlag == 2)">
<el-radio :label="2" @change="moduleOpenChange"></el-radio>
<el-radio :label="1" @change="moduleOpenChange"></el-radio>
<el-radio :label="2"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
......@@ -141,7 +150,7 @@
<el-col :span="10" class="item-icon">
<span class="require">*</span>
<el-form-item label="考试名称">
<el-input v-model="item3.content1" :disabled="conditionSelect || item.moduleType == 2 || (item.id != '' && item.openFlag == 2) || idType == 2" size="mini" maxlength='30' placeholder="请输入考试名称" style="width:288px;"></el-input>
<el-input v-model="item3.content1" :disabled="conditionSelect || item.moduleType == 2 || (item.id != '' && item.openFlag == 2) || idType == 2" size="small" maxlength='30' placeholder="请输入考试名称" style="width:288px;"></el-input>
<span v-if="conditionAnd && item2.numFlag == 2 && index3 == 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-circle-plus" @click="addMatterCourse(index,index1,index2)" style="color:#449284;"></i></span>
<span v-if="conditionAnd && item2.numFlag == 2 && index3 > 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-delete" @click="deleteMatterCourse(index,index1,index2,index3)" style="color:red;"></i></span>
</el-form-item>
......@@ -149,7 +158,7 @@
<el-col :span="10" class="item-icon">
<span class="require">*</span>
<el-form-item label="关联考试">
<el-select v-model="item3.content2" @focus="examIDfocus(index,index1,index2,index3)" @change="changeExamID" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" placeholder="请选择考试ID" style="width:288px;">
<el-select v-model="item3.content2" @focus="examIDfocus(index,index1,index2,index3)" @change="changeExamID" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="small" placeholder="请选择考试ID" style="width:288px;">
<el-option
v-for="(itemTest,indexTest) in testIdSelect"
:key="indexTest"
......@@ -173,7 +182,7 @@
<el-col :span="10" v-if="item3.certificateFlag == 2" class="item-icon">
<span class="require">*</span>
<el-form-item label="选择证书">
<el-select v-model="item3.content3" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" placeholder="请选择证书" style="width:288px;">
<el-select v-model="item3.content4" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="small" placeholder="请选择证书" style="width:288px;">
<el-option
v-for="(itemCertificate,indexCertificate) in certificateIdSelect"
:key="indexCertificate"
......@@ -193,7 +202,7 @@
<el-col :span="10" class="item-icon">
<span class="require">*</span>
<el-form-item label="课程名称">
<el-input v-model="item3.content1" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" maxlength='30' placeholder="请输入课程名称" style="width:288px;"></el-input>
<el-input v-model="item3.content1" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="small" maxlength='30' placeholder="请输入课程名称" style="width:288px;"></el-input>
<span v-if="conditionAnd && item2.numFlag == 2 && index3 == 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-circle-plus" @click="addMatterCourse(index,index1,index2)" style="color:#449284;"></i></span>
<span v-if="conditionAnd && item2.numFlag == 2 && index3 > 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-delete" @click="deleteMatterCourse(index,index1,index2,index3)" style="color:red;"></i></span>
</el-form-item>
......@@ -201,7 +210,7 @@
<el-col :span="10" class="item-icon">
<span class="require">*</span>
<el-form-item label="关联课程">
<el-select v-model="item3.content2" @focus="courseIDfocus(index,index1,index2,index3)" @change="changeCourseID" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" placeholder="请选择课程ID" style="width:288px;">
<el-select v-model="item3.content2" @focus="courseIDfocus(index,index1,index2,index3)" @change="changeCourseID" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="small" placeholder="请选择课程ID" style="width:288px;">
<el-option
v-for="(itemCourse,indexCourse) in courseIdSelect"
:key="indexCourse"
......@@ -225,7 +234,7 @@
</div>
</div>
<el-dialog :title="dialogTitle" :visible.sync="columnFormVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form ref="resourceForm" class="creat-form" :model="selectResource" label-width="145px" label-suffix=":" size="mini">
<el-form ref="resourceForm" class="creat-form" :model="selectResource" label-width="145px" label-suffix=":" size="small">
<el-form-item label="请选择一个模块" prop="">
<el-select v-model="selectResource.resourceModuleSelect" @change="selectChange" placeholder="请选择资源包" style="width:60%;">
<el-option
......@@ -254,7 +263,7 @@
<el-row>
<el-col :span="10">
<el-form-item label="配置证书">
<span v-if="item1.content2"></span>
<span v-if="item2.certificateFlag == 2"></span>
<span v-else></span>
</el-form-item>
</el-col>
......@@ -284,29 +293,25 @@
</template>
<script>
import BreadCrumb from '../../components/breadcrumb.vue'
import { doUpload, getFilePath } from "../../utils/qiniuUtil"
import { validateWord150 } from "../../utils/validate.js"
import { doUpload, getFilePath } from "../../utils/qiniu-util"
// import { validateWord150 } from "../../utils/validate.js"
import { mapGetters } from 'vuex'
import { openLoading, closeLoading, isNotEmptyUtils, isEmptyList } from '../../utils/utils';
import { openLoading, closeLoading, isNotEmptyUtils, isEmptyList, isNotEmptyList } from '../../utils/utils'
import * as commonUtil from '../../utils/utils'
let vm = null
// 判断组件是否重名
let validateRepeatWord = function(rule, value, callback, message) {
const reg = /^[\u4e00-\u9fa5]{2,20}$/
if(!reg.test(value)) {
callback(new Error(message))
return
}
let req = {
token: vm._token,
name: value,
idType: vm.idType // 1内部 2外部
idType: vm.idType, // 1内部 2外部
id: null || vm.componentId
}
if(vm.itemName != value) {
vm.GET('portalComponent/checkComponentName',req).then((res) => {
vm.GET('portal/portalComponent/checkComponentName',req).then((res) => {
if(res.code == '000000') {
if(res.data.resultFlag == 2) {
callback(new Error('该组件名称已存在,请使用一个新的组件名称'))
return
callback(new Error(message))
}else {
callback()
}
......@@ -318,16 +323,12 @@ let validateRepeatWord = function(rule, value, callback, message) {
}
// 判断模块是否重名(对外开放时候验证)
let validateModuleName = function(rule, value, callback, message) {
const reg = /^[\u4e00-\u9fa5]{2,20}$/
if(!reg.test(value)) {
callback(new Error('输入长度为2-20个字符'))
return
}
for(let i = 0;i<vm.componentList.moduleModelList.length;i++) {
if(vm.componentList.moduleModelList[i].openFlag == 2) {
vm.GET('portalComponent/checkModuleName',{name: value}).then((res) => {
if(vm.firstTab == parseInt(i + 1)) {
vm.GET('portal/portalComponent/checkModuleName',{name: value,openFlag: vm.componentList.moduleModelList[i].openFlag}).then((res) => {
if(res.code == '000000') {
if(res.data.resultFlag > 0) {
if(res.data > 0) {
vm.componentList.moduleModelList[i].name = ''
callback(new Error(message))
return
}else {
......@@ -335,8 +336,7 @@ let validateModuleName = function(rule, value, callback, message) {
}
}
})
}else {
callback()
break
}
}
}
......@@ -347,6 +347,8 @@ export default {
data() {
return {
columnFormVisible: false,
uploadImgMessage: false,
imgMouseOver: false,
itemName: '',
examName: '',
examIndex: '',
......@@ -363,7 +365,7 @@ export default {
componentStatus: '',
resultFlag: '',
conditionSelect: false,
conditionAnd: false,
conditionAnd: true,
isStorage: false,
dialogTitle: '选择模板',
curmbFirst: '教培项目',
......@@ -401,7 +403,7 @@ export default {
moduleModelList: [{
id: '',
name: '',
openFlag: '', // 1不开放 2开放
openFlag: '', // 1 否 不开放 2 是 开放
templetModelList: []
}]
},
......@@ -412,20 +414,15 @@ export default {
rules: {
"name": [
{ required: true, message: '输入组件名称', trigger: 'blur' },
{ min: 2, max: 20, message: '输入长度为2-20个字符', trigger: 'blur' },
{ validator: function(rule, value, callback) {
validateRepeatWord(rule, value, callback, '输入长度为2-20个字符')
validateRepeatWord(rule, value, callback, '该组件名称已存在,请使用一个新的组件名称')
},
trigger: 'blur' }
],
"introduce": [
{ required: true, message: '请输入组件简介', trigger: 'blur' },
{ validator: function(rule, value, callback) {
validateWord150(rule, value, callback, '超出可输入的最大长度')
},
trigger: 'blur' }
],
"imageUrl": [
{ required: true, message: '请上传组件图片', trigger: 'blur' },
{ min: 1, max: 150, message: '超出可输入的最大长度', trigger: 'blur' }
],
"certificateId": [
{ required: true, message: '请选择证书', trigger: 'blur' },
......@@ -437,6 +434,7 @@ export default {
moduleRules: {
"name": [
{ required: true, message: '请输入模块名称', trigger: 'blur' },
{ min: 2, max: 20, message: '输入长度为2-20个字符', trigger: 'blur' },
{ validator: function(rule, value, callback) {
validateModuleName(rule, value, callback, '模块名称已存在,请修改名称后保存')
},
......@@ -462,14 +460,20 @@ export default {
vm.getCertificateList() // 获取证书列表
vm.componentBasicInfo() // 根据ID查询组件基本信息
vm.conditionSelect = vm.resultFlag == 2 || vm.componentStatus == 3 || vm.componentStatus == 4
if(vm.componentStatus && vm.resultFlag) {
vm.conditionAnd = vm.resultFlag == 1 && vm.componentStatus != 3 && vm.componentStatus != 4
}
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight()
},
methods: {
// 根据ID查询组件基本信息
componentBasicInfo() {
if(vm.componentId) {
openLoading(vm)
vm.GET('portalComponent/queryPortalComponentById',{id: vm.componentId}).then((res) => {
vm.GET('portal/portalComponent/queryPortalComponentById',{id: vm.componentId}).then((res) => {
closeLoading(vm)
if( res.code == '000000') {
vm.portalComponent = res.data.portalComponent
......@@ -485,14 +489,18 @@ export default {
})
}
},
// 删除图片
deleteImg() {
vm.portalComponent.imageUrl = ''
vm.imgMouseOver = false
},
// 是否配置证书
selectCertificate(val) {
vm.portalComponent.certificateId = ''
if(val == '否') {
vm.portalComponent.certificateId = 0
vm.hasCertificate = false
vm.portalComponent.certificateCondition = 0
}else{
vm.portalComponent.certificateId = 1
vm.hasCertificate = true
vm.portalComponent.certificateCondition = 60
}
......@@ -503,19 +511,20 @@ export default {
},
// 获取证书下拉列表
getCertificateList() {
vm.GET('portalComponent/CertificateList').then((res) => {
vm.GET('portal/portalComponent/CertificateList').then((res) => {
if( res.code == '000000') {
vm.certificateIdSelect = res.data.certificateList
}else {
vm.$message.info(res.message)
}
})
},
// 暂存(下一步)
storageAndNext(flag) {
vm.itemName = vm.portalComponent.name
if(vm.componentId) { // 编辑
vm.submitBasicData(flag,'portalComponent/updatePortalComponent')
vm.submitBasicData(flag,'portal/portalComponent/updatePortalComponent')
}else{ // 新增
vm.submitBasicData(flag,'portalComponent/insertPortalComponent')
vm.submitBasicData(flag,'portal/portalComponent/insertPortalComponent')
}
},
submitBasicData(flag,url) {
......@@ -533,11 +542,17 @@ export default {
if(!vm.componentId) {
vm.portalComponent.status = 1
}
if(!vm.portalComponent.imageUrl) {
vm.uploadImgMessage = true
return
} else {
vm.uploadImgMessage = false
}
vm.$refs.basicInfoForm.validate((valid) => {
if (valid) {
vm.submitBasic(flag,url)
} else {
return false;
return false
}
})
}
......@@ -546,6 +561,19 @@ export default {
vm.isStorage = false
},
submitBasic(flag,url) {
let req = {
token: vm._token,
name: vm.portalComponent.name,
idType: vm.idType, // 1内部 2外部
id: null || vm.componentId
}
if(vm.portalComponent.name != vm.itemName) {
vm.GET('portal/portalComponent/checkComponentName',req).then((res) => {
if(res.code == '000000') {
if(res.data.resultFlag == 2) {
vm.$message.info("该组件名称已存在,请使用一个新的组件名称")
return
}else {
vm.portalComponent.idType = vm.idType
vm.portalComponent.id = vm.componentId
vm.POST(url,{ model: vm.portalComponent }).then((res) => {
......@@ -564,6 +592,31 @@ export default {
}
}
})
}
} else {
vm.$message.info(res.message)
}
})
}else {
vm.portalComponent.idType = vm.idType
vm.portalComponent.id = vm.componentId
vm.POST(url,{ model: vm.portalComponent }).then((res) => {
if( res.code == '000000') {
if(!vm.componentId) {
vm.componentId = res.data
}
if(flag == 2) {
vm.stepNum = 2
vm.getTemplateData()
vm.getModuleData()
vm.getTestListData()
vm.getCourseData()
} else {
vm.$message.info("暂存成功!")
}
}
})
}
},
// 上传组件图片
beforeAvatarUpload(file) {
......@@ -588,6 +641,7 @@ export default {
doUpload(vm,file, getFilePath(file,null), 'preview4', 'progress1', 1).then(function (path) {
closeLoading(vm)
vm.portalComponent.imageUrl = path.fullPath
vm.uploadImgMessage = false
});
}
}
......@@ -595,9 +649,11 @@ export default {
},
// 获取考试下拉列表
getTestListData() {
vm.GET('portalComponent/OnlineExamList').then((res) => {
vm.GET('portal/portalComponent/OnlineExamList').then((res) => {
if( res.code == '000000') {
vm.testIdSelect = res.data.onlineExamList
}else {
vm.$message.info(res.message)
}
})
},
......@@ -621,9 +677,11 @@ export default {
},
// 获取课程下拉列表
getCourseData() {
vm.GET('portalComponent/CourseList').then((res) => {
vm.GET('portal/portalComponent/CourseList').then((res) => {
if( res.code == '000000') {
vm.courseIdSelect = res.data.courseList
}else {
vm.$message.info(res.message)
}
})
},
......@@ -647,32 +705,37 @@ export default {
},
// 获取默认模板
getTemplateData() {
vm.GET('portalComponent/TempletConfigList').then((res) => {
vm.GET('portal/portalComponent/TempletConfigList').then((res) => {
if( res.code == '000000') {
vm.templateDataList = res.data.templetConfigModelList
}else {
vm.$message.info(res.message)
}
})
},
// 通过编辑获取模块信息
getModuleData() {
vm.GET('portalComponent/ModuleList',{componentId: vm.componentId}).then((res) => {
vm.GET('portal/portalComponent/ModuleList',{componentId: vm.componentId}).then((res) => {
if( res.code == '000000') {
vm.componentList.moduleModelList = res.data.moduleModelList
}else {
vm.$message.info(res.message)
}
})
},
// 模块是否对外开放
selectIsOpen(index) {
vm.moduleIndex = index
vm.componentList.moduleModelList[index].openFlag = vm.componentList.moduleModelList[index].openFlag == 1 ? 2 : 1
},
moduleOpenChange(value) {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(vm.moduleIndex == i) {
if(value == '1') {
vm.componentList.moduleModelList[i].openFlag = 2
}else{
vm.componentList.moduleModelList[i].openFlag = 1
if(index == i) {
if(vm.componentList.moduleModelList[i].name) {
vm.GET('portal/portalComponent/checkModuleName',{name: vm.componentList.moduleModelList[i].name,openFlag: vm.componentList.moduleModelList[i].openFlag}).then((res) => {
if(res.code == '000000') {
if(res.data > 0) {
vm.componentList.moduleModelList[i].name = ''
vm.$message.info("模块名称已存在,请修改名称后保存")
}
}
})
}
break
}
......@@ -682,20 +745,24 @@ export default {
removeTab(targetName) {
for(let i = 0;i<vm.componentList.moduleModelList.length;i++) {
if((targetName - 1) == i) {
if(vm.componentList.moduleModelList[i].id) {
if(vm.componentList.moduleModelList[i].templetModelList) {
if(isNotEmptyUtils(vm.componentList.moduleModelList[i].templetModelList)) { // 模板不为空
vm.$confirm('删除模块会将改模块下已有模板同时删除,确认需要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vm.GET('portalComponent/deletePortalModuleById',{id:vm.componentList.moduleModelList[i].id}).then((res) => {
if(vm.componentList.moduleModelList[i].id != '' && vm.componentList.moduleModelList[i].moduleType == 1) {
vm.GET('portal/portalComponent/deletePortalModuleById',{id:vm.componentList.moduleModelList[i].id}).then((res) => {
if( res.code == '000000') {
vm.$message.info('成功删除模块!')
}
vm.getModuleData()
vm.firstTab = i + ''
})
}else {
vm.componentList.moduleModelList.splice(i,1)
vm.firstTab = i + ''
}
}).catch(() => {
vm.$message({
type: 'info',
......@@ -703,18 +770,19 @@ export default {
})
})
}else {
vm.GET('portalComponent/deletePortalModuleById',{id:vm.componentList.moduleModelList[i].id}).then((res) => {
if(vm.componentList.moduleModelList[i].id) {
vm.GET('portal/portalComponent/deletePortalModuleById',{id:vm.componentList.moduleModelList[i].id}).then((res) => {
if( res.code == '000000') {
vm.$message.info('成功删除模块!')
}
vm.getModuleData()
vm.firstTab = i + ''
})
}
}else {
vm.componentList.moduleModelList.splice(i,1)
vm.firstTab = i + ''
}
}
break
}
}
......@@ -755,7 +823,8 @@ export default {
seqNo: '',
content1: '',
content2: '',
content3: ''
content3: '',
content4: ''
}]
})
}else if(item.partConfigModelList[i].type == 2) { // 课程
......@@ -785,7 +854,7 @@ export default {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index == i) {
if(vm.componentList.moduleModelList[i].templetModelList[index1].id) {
vm.GET('portalComponent/deletePortalTemplateById',{id: vm.componentList.moduleModelList[i].templetModelList[index1].id}).then((res) => {
vm.GET('portal/portalComponent/deletePortalTemplateById',{id: vm.componentList.moduleModelList[i].templetModelList[index1].id}).then((res) => {
if( res.code == '000000') {
vm.$message.info('成功删除模板!')
vm.getModuleData()
......@@ -831,7 +900,7 @@ export default {
for(let q = 0; q < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length;q++){
if(index2 == q) {
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id) {
vm.GET('portalComponent/deletePortalPartById',{id: vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id}).then((res) => {
vm.GET('portal/portalComponent/deletePortalPartById',{id: vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id}).then((res) => {
if( res.code == '000000') {
vm.$message.info('成功删除模板元件内容!')
vm.getModuleData()
......@@ -876,16 +945,35 @@ export default {
}
}
},
// 模块名称失去焦点校验
moduleNameValidate(index) {
let moduleValue = vm.componentList.moduleModelList[index].name
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index != i && vm.componentList.moduleModelList[i].name != '') {
if(moduleValue == vm.componentList.moduleModelList[i].name) {
vm.componentList.moduleModelList[index].name = ''
vm.$message.info('模块名称已存在,请修改名称后保存')
}
}
}
},
// 完成(暂存)
finishConponent(flag) {
let req = null
if(vm.componentList.moduleModelList && vm.componentList.moduleModelList.length > 0) {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(flag == 2) { // 完成
if(flag == 2) {
req = {
id: vm.componentId,
status: 2
}
}else {
req = {
id: vm.componentId,
status: 1
}
}
if(vm.componentList.moduleModelList && vm.componentList.moduleModelList.length > 0) {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(flag == 2) { // 完成
if(!vm.componentList.moduleModelList[i].name) {
vm.$message.info("请输入模块名称")
return
......@@ -894,38 +982,76 @@ export default {
vm.$message.info("模块内容不能为空")
return
}
for(let j = 0; j < vm.componentList.moduleModelList[i].templetModelList.length; j++) {
for(let k = 0; k < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length; k++) {
if(!vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content1) {
vm.$message.info( vm.componentList.moduleModelList[i].templetModelList[j].name + "中名称为空,请添加内容后保存")
// 考试
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].type == 1) {
if(!vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content1 || !vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content2) {
vm.$message.info( vm.componentList.moduleModelList[i].templetModelList[j].name + "中考试为空,请添加考试保存")
return
}
} else {
if(!vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content1 || !vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content2) {
vm.$message.info( vm.componentList.moduleModelList[i].templetModelList[j].name + "中课程为空,请添加课程保存")
return
}
}
}
}else{ // 暂存
req = {
id: vm.componentId,
status: 1
}
}
vm.componentList.moduleModelList[i].componentId = vm.componentId
}
vm.finishModule(req,flag)
}else {
vm.$message.info("请添加有效模块后再保存")
if(flag == 2) {
vm.$message.info("模块内容不能为空")
return
}else {
vm.finishModule(req,flag)
}
}
},
finishModule(req, flag) {
vm.POST('portalComponent/insertOrUpdatePortalModule',{model: vm.componentList.moduleModelList,status: flag}).then((res) => {
if(isNotEmptyList(vm.componentList.moduleModelList)) {
for(let i=0;i<vm.componentList.moduleModelList.length;i++) {
if(isNotEmptyList(vm.componentList.moduleModelList[i].templetModelList)) {
for(let j = 0;j<vm.componentList.moduleModelList[i].templetModelList.length;j++) {
for(let k=0;k<vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length;k++) {
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].type == 1) { // 考试
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content4) {
for(let q = 0; q < vm.certificateIdSelect.length;q++) {
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content4 == vm.certificateIdSelect[q].id) {
vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content3 = vm.certificateIdSelect[q].name
}
}
}
}
}
}
}
}
}
vm.$nextTick(() => {
for(let i=0;i<vm.componentList.moduleModelList.length;i++) {
if(!vm.componentList.moduleModelList[i].name) {
return
}else {
vm.POST('portal/portalComponent/insertOrUpdatePortalModule',{model: vm.componentList.moduleModelList,status: flag}).then((res) => {
if( res.code == '000000') {
vm.enableComponent(req, flag)
}
})
}
}
})
},
// 启用
enableComponent(req, flag) {
vm.GET('portalComponent/disableOrStart',req).then((res) => {
vm.GET('portal/portalComponent/disableOrStart',req).then((res) => {
if(res.code == "000000") {
if(flag == 2) {
vm.$router.push({ path: 'item-component' })
......@@ -943,7 +1069,7 @@ export default {
// 从资源包中添加模块
addFromModule() {
vm.columnFormVisible = true
vm.GET('portalComponent/ModuleList',{openFlag: 2}).then((res) => {
vm.GET('portal/portalComponent/ModuleList',{openFlag: 2}).then((res) => {
if( res.code == '000000') {
vm.resourceArray = res.data.moduleModelList
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
......@@ -1027,6 +1153,37 @@ export default {
top: 100%;
left: 0;
}
.basic-item-icon {
position: relative;
.require {
position: absolute;
left: 51px;
top: 4px;
color: #F56C6C;
}
.upload-message {
position: absolute;
left: 128px;
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;
}
}
}
}
.step-content {
overflow: hidden;
......@@ -1068,12 +1225,11 @@ export default {
font-size: 12px;
border: 1px solid #ccc;
border-radius: 50%;
width: 22px;
height: 16px;
line-height: 13px;
padding-left: 3px;
width: 34px;
height: 18px;
margin-top: 3px;
margin-right: 10px;
text-align: center;
}
}
.btn-container {
......
......@@ -4,18 +4,18 @@
:curmbFirst="curmbFirst"
:curmbSecond="curmbSecond">
</bread-crumb>
<div class="component-content screenSet">
<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="mini" placeholder="请输入组件名称"></el-input>
<el-input v-model="searchParam.name" size="small" placeholder="请输入组件名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-col :span="6">
<el-form-item label="发布状态:">
<el-select v-model="searchParam.status" size="mini" placeholder="请选择发布状态">
<el-select v-model="searchParam.status" size="small" style="width: 100%;" placeholder="请选择发布状态">
<el-option
v-for="(item,index) in statuSelect"
:key="index"
......@@ -25,16 +25,18 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="13" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="search">查询</el-button>
<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" @click="createComponent">新建项目组件</el-button>
<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
: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>
......@@ -46,11 +48,17 @@
<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 == 1 || 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 == 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">
......@@ -70,10 +78,11 @@
</template>
<script>
import BreadCrumb from '../../components/breadcrumb.vue'
import { doUpload, getFilePath } from "../../utils/qiniuUtil"
import { doUpload, getFilePath } from "../../utils/qiniu-util"
import { validateWord } from "../../utils/validate.js"
import { mapGetters } from 'vuex'
import { openLoading, closeLoading } from '../../utils/utils';
import { openLoading, closeLoading } from '../../utils/utils'
import * as commonUtil from '../../utils/utils'
let vm = null
export default {
components: {
......@@ -83,7 +92,10 @@ export default {
return {
curmbFirst: '教培项目',
curmbSecond: '项目组件',
idType:'',
masterAdministratorFlag: false,
searchParam: {
idType: '',
name: '',
status: '',
pageNo: 1,
......@@ -124,28 +136,41 @@ export default {
},
computed: {
...mapGetters([
'_token'
'_token',
// 'idType',
// 'masterAdministratorFlag'
])
},
created() {
vm = this
vm.search()
vm.idType = localStorage.getItem('storageIdType')
vm.masterAdministratorFlag = localStorage.getItem('storageMaster')
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight()
},
methods: {
// 列表查询
search() {
search(flag) {
if(flag) vm.searchParam.pageNo = 1
vm.searchParam.idType = vm.idType
openLoading(vm)
vm.GET('portalComponent/queryPortalComponent',vm.searchParam).then((res) => {
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,
......@@ -163,9 +188,11 @@ export default {
token: vm._token,
componentId: row.id
}
vm.GET('portalComponent/componentEditRange',req).then((res) => {
vm.GET('portal/portalComponent/componentEditRange',req).then((res) => {
if(res.code == "000000") {
vm.$router.push({path: 'create-component',query: {id:row.id,status: row.status,resultFlag: res.data.resultFlag}})
}else {
vm.$message.info(res.message)
}
})
},
......@@ -191,18 +218,21 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vm.GET('portalComponent/disableOrStart',req).then((res) => {
vm.GET('portal/portalComponent/disableOrStart',req).then((res) => {
if(res.code == "000000") {
vm.$message({
type: 'success',
message: '操作成功!'
});
vm.search()
} else {
if(res.message != 'success') {
vm.$message({
message: res.message,
type: 'warning'
});
})
}
}else {
vm.$message.info(res.message)
}
}).catch(function (error) {
vm.$message.error(error);
......@@ -221,13 +251,15 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vm.GET('portalComponent/deleteComponentById',{id: row.id}).then((res) => {
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);
......@@ -267,6 +299,14 @@ export default {
margin-top: 0 !important;
text-align: right;
}
.table-empty {
img{
width: 100px;
}
p {
margin-top: -50px;
}
}
}
}
</style>
......
<template>
<div class="item-manager-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet">
<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="mini" placeholder="请输入项目名称"></el-input>
<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="mini"
size="small"
type="daterange"
start-placeholder="请选择开始时间"
end-placeholder="请选择结束时间"
......@@ -26,8 +26,8 @@
<el-form-item label="项目时间:">
<el-date-picker
v-model="formInline.projectBegintime"
size="mini"
type="date"
size="small"
type="datetime"
placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0"
......@@ -38,16 +38,17 @@
<el-form-item label="~">
<el-date-picker
v-model="formInline.projectEndtime"
size="mini"
type="date"
size="small"
type="datetime"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd 23:59:59"
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="9" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="getProjectList">查询</el-button>
<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>
......@@ -56,7 +57,7 @@
<el-col :span="5">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;">
<el-form-item label="发布状态:">
<el-select size="mini" v-model="formInline.projectStatus" placeholder="请选择发布状态">
<el-select size="small" v-model="formInline.projectStatus" placeholder="请选择发布状态">
<el-option
v-for="item in optionStatus"
:key="item.value"
......@@ -70,19 +71,25 @@
</el-row>
<el-form :model="formInline" class="demo-form-inline">
<el-form-item>
<el-button class="add-button" size="small" type="primary" @click="toPage()">新建项目</el-button>
<el-button class="add-button" :disabled="idType == 2 && masterAdministratorFlag == 'false'" size="small" type="primary" @click="toPage()">新建项目</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="projectIntro" label="项目简介" align="center"></el-table-column>
<el-table-column prop="projectBegintime" label="项目开始时间" align="center"></el-table-column>
<el-table-column prop="projectEndtime" label="项目结束时间" 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 | statusProject }}</span>
<span>{{ [scope.row.projectStatus , idType] | statusProject }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" min-width="200" align="center">
......@@ -128,6 +135,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)"
......@@ -149,6 +157,12 @@
>删除</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
......@@ -168,8 +182,11 @@
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { returnData } from "../mock";
import { mapGetters } 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: {
......@@ -177,6 +194,7 @@ export default {
},
data() {
return {
idValue: '',
curmbFirst: "教培项目",
curmbSecond: "项目管理",
searchParam: {
......@@ -226,7 +244,7 @@ export default {
},
pickerOptions0: {
disabledDate: time => {
if (this.formInline.projectEndtime != "") {
if (this.formInline.projectEndtime != "" && this.formInline.projectEndtime !=null) {
return (
time.getTime() >
new Date(this.formInline.projectEndtime).getTime()
......@@ -241,26 +259,49 @@ export default {
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);
this.$nextTick(function() {;
this.getProjectList();
});
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
toPage() {
this.$router.push("add-manager");
},
searchList() {
this.formInline.pageNo = 1;
this.getProjectList();
},
//查询项目列表
getProjectList() {
let req = {};
req = this.formInline;
openLoading(vm);
vm.GET("portalInfo/getProjectList", req).then(res => {
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;
}
});
......@@ -269,13 +310,22 @@ export default {
showButton(row, type) {
// 按钮type类型: 0-编辑
// 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝
// 7- 提醒审核 8(5)-取消审核 9-删除
// 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);
let buttonStatus = returnData().buttonStatus;
//console.log('idType',idType);
let buttonStatus = "";
if (idType == 1) {
//内部项目
buttonStatus = returnData().buttonStatusIn;
} else {
//外部项目
buttonStatus = returnData().buttonStatusOut;
}
if (level != null) {
let statusSet = buttonStatus[projectStatus - 1][level];
let flagValue = statusSet.indexOf(typeStr);
......@@ -291,24 +341,69 @@ export default {
//改变状态
changeStatus(row, type) {
let projectId = row.id;
let level = row.level;
if (type === 0) {
//编辑
this.$router.push("add-manager?projectId=" + projectId);
this.$router.push("add-manager?projectId=" + projectId +"&level="+level);
} 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) {
//取消审批值对应5
type = 5;
//取消审批值对应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: type
};
let that = this;
vm.POST("portalInfo/changeStatus", req).then(res => {
vm.POST("portal/portalInfo/changeStatus", req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
console.log(res);
vm.getProjectList();
}
});
}
......@@ -316,16 +411,11 @@ export default {
//删除项目
delItem(row) {
let req = {};
let that = this;
console.log(row);
vm.DELETE("portalInfo/delete/" + row.id, req).then(res => {
vm.DELETE("portal/portalInfo/delete/" + row.id, req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
console.log(res);
this.$notify({
title: "删除项目",
message: "ID为:" + row.id + "的项目删除成功"
});
this.loading = true;
vm.getProjectList();
}
});
......@@ -393,6 +483,14 @@ export default {
.add-button {
float: right;
}
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
}
}
</style>
\ No newline at end of file
let data = {
"projectModel":
{
"projectBegintime": 1551948983468,
"projectEndtime": 1551948983468,
"projectIntro": "测试用例",
"projectName": "testProjectName"
},
"attachmentModel": [
{
"attachmentType": 1,
"attachmentUrl": "www.baidu.com",
"kind": 1, "seqNo": 1
},
{
"attachmentType": 2,
"attachmentUrl": "www.qq.com",
"kind": 2, "seqNo": 1
}
],
"attachmentPDFModel": [
{
"attachmentType": 3,
"attachmentUrl": "www.pdf.com",
"kind": 3
}
]
};
let req = {
projectModel:
'{"id":6,"projectBegintime":1551853576789,"projectEndtime":1551853576789,"projectIntro":"测试用例","projectName":"testProjectName"}',
attachmentModel:
'[{"attachmentType":1,"attachmentUrl":"www.baidu.com","kind":1,"portalProjectId":6,"seqNo":1},{"attachmentType":2,"attachmentUrl":"www.qq.com","kind":2,"portalProjectId":6,"seqNo":1}]',
attachmentPDFModel:
'[{"attachmentType":3,"attachmentUrl":"www.pdf.com","kind":3,"portalProjectId":6},{"attachmentType":3,"attachmentUrl":"www.pdf.com","kind":3,"portalProjectId":6}]'
};
/**
projectModel
ProjectBegintime ProjectEndtime 开始结束时间
projectIntro 项目简介 test
ProjectName 项目名称
attachmentModel 附件信息
attachmentType 1:项目列表 2:封面信息(图片和视频) 3:PDF
attachmenturl 链接
kind 1:图片 2:视频 3:PDF
attachmentName 附件名称
attachment_ext 附件格式
attachment_size 附件大小
*/
\ No newline at end of file
<template>
<div>
<el-tree
:data="data2"
show-checkbox
default-expand-all
node-key="id"
ref="tree"
highlight-current
:props="defaultProps"
@check="onChecked"
></el-tree>
<!-- <base1
:data="data2"
show-checkbox
default-expand-all
node-key="id"
ref="tree"
highlight-current
:props="defaultProps"
></base1>-->
<span></span>
<div class="buttons">
<el-button @click="getCheckedNodes">通过 node 获取</el-button>
<el-button @click="getCheckedKeys">通过 key 获取</el-button>
<el-button @click="setCheckedNodes">通过 node 设置</el-button>
<el-button @click="setCheckedKeys">通过 key 设置</el-button>
<el-button @click="resetChecked">清空</el-button>
</div>
</div>
</template>
<script>
import { ELTree1 } from "element-ui/lib/checkbox";
// import Vue from 'vue'
// require("element-ui/lib/checkbox"
export default {
// components: {
// base1
// },
mounted() {
// const base1 = Vue.extend(ELTree)
// Vue.component('base1', base1)
},
data() {
return {
data2: [
{
id: 11,
label: "一级 1",
children: [
{
id: 1,
label: "一级 1",
children: [
{
id: 4,
label: "二级 1-1",
children: [
{
id: 9,
label: "三级 1-1-1"
},
{
id: 10,
label: "三级 1-1-2"
}
]
}
]
},
{
id: 2,
label: "一级 2",
children: [
{
id: 5,
label: "二级 2-1"
},
{
id: 6,
label: "二级 2-2"
}
]
},
{
id: 3,
label: "一级 3",
children: [
{
id: 7,
label: "二级 3-1"
},
{
id: 8,
label: "二级 3-2"
}
]
}
]
}
],
defaultProps: {
children: "children",
label: "label"
}
};
},
methods: {
getCheckedNodes() {
console.log(this.$refs.tree.getCheckedNodes());
},
getCheckedKeys() {
console.log(this.$refs.tree.getCheckedKeys());
},
setCheckedNodes() {
this.$refs.tree.setCheckedNodes([
{
id: 5,
label: "二级 2-1"
},
{
id: 9,
label: "三级 1-1-1"
}
]);
},
setCheckedKeys() {
this.$refs.tree.setCheckedKeys([3]);
},
resetChecked() {
this.$refs.tree.setCheckedKeys([]);
},
onChecked() {
let cData = [],
oldData = (this.data2.length && this.data2.slice()) || [],
checkedKeys = this.$refs.tree.getCheckedKeys(),
halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys(),
savedCheckedKeys = this.handlerCheckedData(oldData, checkedKeys).map(
key => {
return { type: 2, key: key };
}
),
savedHalfCheckedKeys = halfCheckedKeys.map(key => {
return { type: 1, key: key };
}),
allSelectedKeys = savedCheckedKeys.concat(savedHalfCheckedKeys);
console.log("treeData", this.data2);
console.log(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;
}
}
};
</script>
\ No newline at end of file
......@@ -9,7 +9,7 @@
center>
<el-form :model="planChangeData" label-width="110px">
<el-form-item label="分组:">
<el-select v-model="planChangeData.group" >
<el-select v-model="planChangeData.group" size="small">
<el-option
v-for="item in groupList"
:key="item.labelId"
......@@ -19,7 +19,7 @@
</el-select>
</el-form-item>
<el-form-item label="随访计划:">
<el-select v-model="planChangeData.planId" >
<el-select v-model="planChangeData.planId" size="small">
<el-option
v-for="item in planOption"
:key="item.id"
......@@ -29,7 +29,7 @@
</el-select>
</el-form-item>
<el-form-item label="随访开始时间:">
<el-select v-model="planChangeData.startTime">
<el-select v-model="planChangeData.startTime" size="small">
<el-option
v-for="item in nodeTimeList"
:key="item.id"
......@@ -40,8 +40,8 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button class="button-green" @click="clickClose" type="primary">取 消</el-button>
<el-button class="button-white" @click="changePlan" plain>确 定</el-button>
<el-button class="button-green" @click="clickClose" size="small" type="primary">取 消</el-button>
<el-button class="button-white" @click="changePlan" size="small" plain>确 定</el-button>
</span>
</el-dialog>
</div>
......
......@@ -11,7 +11,7 @@
<el-form
:model="finishData"
:rules="rules"
label-width="85px">
label-width="100px">
<el-form-item label="居民:">
{{finishData.patientName}}
</el-form-item>
......@@ -27,8 +27,8 @@
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="button-green" @click="clickClose" type="primary">取 消</el-button>
<el-button class="button-white" @click="clickClose" plain>确 定</el-button>
<el-button class="button-green" @click="clickClose" size="small" type="primary">取 消</el-button>
<el-button class="button-white" @click="clickClose" size="small" plain>确 定</el-button>
</span>
</el-dialog>
</div>
......
......@@ -10,7 +10,7 @@
center :lock-scroll="false">
<div class="selected-dialog-content">
<div class="title-div">
<el-button type="primary" @click="continueAdd">继续添加</el-button>
<el-button type="primary" size="small" @click="continueAdd">继续添加</el-button>
</div>
<el-table
:data="hasSelectedList"
......
......@@ -7,7 +7,7 @@
center>
<div class="select-content">
<div class="first-section">
<el-select placeholder="请选择疾病" v-model="diseaseId">
<el-select placeholder="请选择疾病" v-model="diseaseId" size="small">
<el-option
v-for="item in diseaseOptions"
:key="item.value"
......@@ -15,11 +15,11 @@
:value="item.value">
</el-option>
</el-select>
<el-select placeholder="请选择类目" v-model="typeId" style="margin-left:20px;">
<el-select placeholder="请选择类目" size="small" v-model="typeId" style="margin-left:20px;">
</el-select>
</div>
<div class="scroll-section">
<el-radio-group v-model="sendObj.hasSelected">
<el-radio-group v-model="sendObj.hasSelected" size="small">
<el-radio
v-for="(item, index) in cartoonList"
:key="index"
......@@ -28,8 +28,8 @@
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button class="button-green" @click="clickClose" plain>取 消</el-button>
<el-button class="button-white" @click="sureSelect" type="primary">确 定</el-button>
<el-button class="button-green" size="small" @click="clickClose" plain>取 消</el-button>
<el-button class="button-white" size="small" @click="sureSelect" type="primary">确 定</el-button>
</span>
</el-dialog>
</template>
......
......@@ -9,7 +9,7 @@
:close-on-press-escape="false"
center>
<div class="finish-content">
<el-form ref="searchData" :model="searchData" :inline="true" class="select-width">
<el-form ref="searchData" :model="searchData" :inline="true" class="select-width" size="small">
<el-form-item>
<el-select v-model="searchData.sex">
<el-option
......@@ -113,8 +113,8 @@
</el-row>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="clickClose" plain>取 消</el-button>
<el-button type="primary" @click="sureClick">确 定</el-button>
<el-button @click="clickClose" size="small" plain>取 消</el-button>
<el-button type="primary" size="small" @click="sureClick">确 定</el-button>
</div>
</el-dialog>
</div>
......
<template>
<div>
<p><el-button plain icon="el-icon-plus" round @click="addNewNode(timeForm.formRef)">新增时间节点</el-button><br></p>
<p><el-button plain icon="el-icon-plus" size="small" round @click="addNewNode(timeForm.formRef)">新增时间节点</el-button><br></p>
<div class="add-time-content">
<div class="time-line-scroll">
<!--<el-button type="primary" size="mini" round>设置随访时间 <i class="el-icon-circle-close-outline"></i></el-button>-->
<!--<el-button type="primary" @click="changeTab(item)" size="mini" round v-for="(item, index) in setTimeNodeList" :key="index">开始后{{item.followupTime}}{{item.followupMark}} <i class="el-icon-circle-close-outline"></i></el-button>-->
<el-radio-group v-model="activeTab" @change="changeTab">
<el-radio-button v-if="setTimeNodeList.length > 0" :key="item.formRef" v-for="(item, index) in setTimeNodeList" :label="index">开始后{{item.followupTime + item.followupMark}} <i class="el-icon-circle-close-outline" @click="deleteTimeNode(item, index)"></i></el-radio-button>
<div class="time-line-scroll">
<el-radio-group v-model="activeTab" @change="changeTab" size="small">
<el-radio-button v-if="setTimeNodeList.length > 0" :key="item.formRef" v-for="(item, index) in setTimeNodeList1" :label="index">开始后{{item.followupTime + item.followupMark}} <i class="el-icon-circle-close-outline" @click="deleteTimeNode(item, index)"></i></el-radio-button>
<el-radio-button label="setNewRef" v-if="showSetBtn">设置随访时间 <i class="el-icon-circle-close-outline" @click="deleteAddNode" v-if="setTimeNodeList.length>0"></i></el-radio-button>
</el-radio-group>
<!--<el-button type="primary" :class="(activeTab || activeTab==0) ? 'blur-btn' : ''" @click="setTimeForm()">设置随访时间</el-button>-->
</div>
<div class="form-div">
<el-form :ref="timeForm.formRef" :model="timeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true">
<div class="form-div" v-if="activeTab != 'setNewRef'">
<div :key="timeFormHas.formRef" v-for="(timeFormHas, index) in setTimeNodeList1" :label="index">
<el-form v-if="index == activeTab" :ref="timeFormHas.formRef" :model="timeFormHas" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small">
<el-form-item label="本次随访时间" required>
<div style="display: flex;">
<el-form-item prop="followupTime">
<el-select v-model="timeFormHas.followupTime" placeholder="请选择">
<el-option
v-for="item in indexOptions"
:key="item.value"
:label="item.label"
:value="item.label">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="followupMark" class="ml20">
<el-select v-model="timeFormHas.followupMark" placeholder="请选择" :disabled="timeFormHas.isDisabled">
<el-option
v-for="item in markOptions"
:key="item.value"
:label="item.label"
:value="item.label">
</el-option>
</el-select>
</el-form-item>
</div>
</el-form-item>
<el-form-item label="随访方式" prop="followupWay">
<el-radio-group v-model="timeFormHas.followupWay" size="small">
<el-radio :label="1">门诊随访</el-radio>
<el-radio :label="2">上门随访</el-radio>
<el-radio :label="3">电话随访</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="提醒医生预约居民">
<el-select
v-model="timeFormHas.remindTime"
multiple
:multiple-limit=3
placeholder="请选择">
<el-option
v-for="item in remindOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="推送患教">
<div style="display: flex">
<el-select v-model="timeFormHas.pushTime" placeholder="选择推送时间" clearable>
<el-option
v-for="item in pushTimeOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button plain class="ml20" @click="goSelectCartoon" v-if="!timeFormHas.hasSelected">选择健康漫画</el-button>
<div class="selected-div ml20" v-if="timeFormHas.hasSelected">
<span>《健康漫画名称》</span>
<el-button type="text" @click="goSelectCartoon">重选</el-button>
<el-button type="text" @click="deleteClick">删除</el-button>
</div>
</div>
</el-form-item>
<div class="tips-contnt" v-if="timeFormHas.hasSelected">
<p class="yellow-font">当前计划中共500位居民(微信:300位,短信:200位),本次定时推送任务在发送当日预计需要200条短信额度(微信推送不消耗额度,建议您让居民关注云鹊健康微信公众号),务必提前确保短信额度的充足。</p>
<p>需要更多额度,请前往「云鹊医App-个人中心-啾啾币中心」兑换短信额度后再进行预约,您也可以联系云鹊医客服购买短信额度,客服电话:400-920-8877</p>
</div>
<el-form-item label="随访登记表">
<el-select
v-model="timeFormHas.followupForm"
multiple
:multiple-limit=3
placeholder="请选择">
<el-option
v-for="item in formOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</div>
<div class="form-div" v-if="activeTab == 'setNewRef'">
<el-form :ref="timeForm.formRef" :model="timeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small">
<el-form-item label="本次随访时间" required>
<div style="display: flex;">
<el-form-item prop="followupTime">
......@@ -27,7 +113,7 @@
</el-select>
</el-form-item>
<el-form-item prop="followupMark" class="ml20">
<el-select v-model="timeForm.followupMark" placeholder="请选择">
<el-select v-model="timeForm.followupMark" placeholder="请选择" :disabled="timeForm.isDisabled">
<el-option
v-for="item in markOptions"
:key="item.value"
......@@ -39,7 +125,7 @@
</div>
</el-form-item>
<el-form-item label="随访方式" prop="followupWay">
<el-radio-group v-model="timeForm.followupWay">
<el-radio-group v-model="timeForm.followupWay" size="small">
<el-radio :label="1">门诊随访</el-radio>
<el-radio :label="2">上门随访</el-radio>
<el-radio :label="3">电话随访</el-radio>
......@@ -85,7 +171,7 @@
<el-select
v-model="timeForm.followupForm"
multiple
:multiple-limit=2
:multiple-limit=3
placeholder="请选择">
<el-option
v-for="item in formOptions"
......@@ -98,13 +184,15 @@
</el-form>
</div>
</div>
<select-cartoon :isSelectCartoon="isSelectCartoon" @closeSelectCartoon="closeSelectCartoon"></select-cartoon>
</div>
</template>
<script>
import _ from 'lodash';
import SelectCartoon from '@/views/followup/plan-manage/dialog/select-cartoon';
import { mapState } from 'vuex'
const timeFormInit = {
formRef: '',
followupTime: '',
......@@ -114,16 +202,17 @@
remindTime: [],
followupForm: [],
hasSelected: '',
isDisabled: false,
};
export default {
components: {
SelectCartoon},
SelectCartoon
},
data() {
return {
isSelectCartoon: false,
activeTab: null,
setTimeNodeList: [],
currentFormRef: 1,
showSetBtn: true,
timeForm: _.cloneDeep(timeFormInit),
......@@ -134,6 +223,12 @@
}, {
value: '1',
label: '1'
}, {
value: '2',
label: '2'
}, {
value: '3',
label: '3'
},
],
markOptions: [
......@@ -198,51 +293,67 @@
},
}
},
props: {},
computed: {
...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList,
}),
setTimeNodeList1:function(){
return this.sortKey(this.setTimeNodeList,'followupTime')
},
followupMarkOne() {
if(this.setTimeNodeList.length == 0) {
return;
}else {
return this.setTimeNodeList1[0].followupMark;
}
},
},
created() {
//初始化一个随访时间节点
if(this.setTimeNodeList.length === 0){
this.activeTab = 'setNewRef';
this.timeForm.formRef = this.getNowTime();
if(this.setTimeNodeList.length>0) {
this.timeForm.isDisabled = true;
this.timeForm.followupMark = this.setTimeNodeList[0].followupMark;
}
},
watch: {
activeTab(newVal, oldVal) {
console.log('tab变化',newVal,oldVal)
if(oldVal == 'setNewRef' || newVal== 'setNewRef') {
return
}else {
this.setTimeNodeList[oldVal] = this.timeForm;
timeForm(newVal, oldVal) {
if(this.setTimeNodeList.length>0) {
this.timeForm.isDisabled = true;
this.timeForm.followupMark = this.setTimeNodeList[0].followupMark;
}
},
setTimeNodeList1(newVal, oldVal) {
this.setTimeNodeList1.map(item=>{
item.isDisabled = true;
item.followupMark = this.setTimeNodeList1[0].followupMark
});
this.setTimeNodeList1[0].isDisabled = false;
},
followupMarkOne(newVal, oldVal){
if(newVal != oldVal){
this.setTimeNodeList1.map(item=>{
item.followupMark = this.setTimeNodeList1[0].followupMark
});
}
}
},
methods: {
getNowTime() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
let formName = `form${year}${month}${day}${hour}${minute}${second}`;
return formName;
},
addNewNode(formName) {
if(this.activeTab !== 'setNewRef') {
// 显示设置按钮
this.showSetBtn = true;
this.activeTab = 'setNewRef';
this.showSetBtn = true;
this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm.formRef = this.getNowTime();
}else {
this.$refs[formName].validate((valid) => {
if (valid) {
this.setTimeNodeList.push(this.timeForm);
// this.store.commit('SET_TIME_NODE_LIST',this.setTimeNodeList)
this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm.formRef = this.getNowTime(); //新增一个form
this.timeForm.isDisabled = true; //新增一个form
} else {
return;
}
......@@ -264,23 +375,40 @@
if(val == 'setNewRef') {
this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm.formRef = this.getNowTime();
}else {
this.timeForm = _.cloneDeep(this.setTimeNodeList[val]);
}
},
deleteTimeNode(item, index) {
this.setTimeNodeList.splice(index, 1)
this.activeTab = 0;
if(this.setTimeNodeList.length == 0) {
//新增一个form
this.activeTab = 'setNewRef';
this.showSetBtn = true;
this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm.formRef = this.getNowTime(); //新增一个form
this.timeForm.formRef = this.getNowTime();
}
},
deleteAddNode() {
this.showSetBtn = false;
this.activeTab = '';
this.timeForm = this.setTimeNodeList[0];
this.activeTab = 0;
},
getNowTime() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
let formName = `form${year}${month}${day}${hour}${minute}${second}`;
return formName;
},
sortKey(array,key) {
return array.sort(function(a,b){
var x = a[key];
var y = b[key];
return ((x<y) ? -1 : (x>y) ? 1 : 0)
})
}
},
}
......@@ -290,12 +418,10 @@
padding-top: 20px;
.time-line-scroll{
width: 100%;
height: 64px;
height: 60px;
box-sizing: border-box;
background-color: #F0F2F5;
padding: 8px 10px;
/*display: flex;*/
/*align-items: center;*/
padding: 10px;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
......
......@@ -14,16 +14,17 @@
<span :class="{ 'active-class' : activeTab === 'first' }">随访时间节点</span>
</div>
<div class="plan-btns-group" v-if="activeTab === 'first'">
<el-button class="button-white" plain @click="cancelEdit" >取 消</el-button>
<el-button type="primary"@click="nextClick('baseInfo')">下一步</el-button>
<el-button class="button-white" size="small" plain @click="cancelEdit" >取 消</el-button>
<el-button type="primary" size="small" @click="nextClick('baseInfo')">下一步</el-button>
</div>
<div class="plan-btns-group" v-if="activeTab === 'second'">
<el-button class="button-white" plain @click="preClick">上一步</el-button>
<el-button type="primary" @click="saveEdit">保 存</el-button>
<el-button class="button-white" size="small" plain @click="preClick">上一步</el-button>
<el-button type="primary" size="small" @click="saveEdit">保 存</el-button>
</div>
</div>
<div class="edit-plan-content" v-if="activeTab === 'first'">
<el-form ref="baseInfo" :model="baseInfo" :rules="rules" label-suffix=":" label-width="140px" :inline-message="true">
<el-form ref="baseInfo" :model="baseInfo" :rules="rules" label-suffix=":" label-width="140px" :inline-message="true" size="small">
<el-form-item label="随访计划名称" prop="name">
<el-input v-model="baseInfo.name" maxlength="20" style="width: 30%" clearable></el-input>
</el-form-item>
......@@ -76,9 +77,8 @@
</div>
<div class="edit-plan-content" v-if="activeTab === 'second'">
<set-time-node></set-time-node>
<set-time-node ref="getTimeNodeList"></set-time-node>
</div>
</div>
<select-patient :isShowSelectPatient="isShowSelectPatient" @closeSelectPatient="closeSelectPatient" @sureSelectPatient="sureSelectPatient(arguments)"></select-patient>
......@@ -92,7 +92,7 @@
import HasSelectedPatient from '@/views/followup/plan-manage/dialog/has-selected-patient';
import SetTimeNode from '@/views/followup/plan-manage/dialog/set-time-node';
// import { mapState, mapActions } from 'vuex'
import { mapState, mapActions } from 'vuex'
export default {
name: "addNewPlan",
components: {
......@@ -152,19 +152,15 @@
}
},
created() {
},
mounted() {
// this.getResidentList({
// planId: this.$route.query.planId
// });
// this.getGroupList(); //获取分组列表
//清理store中存的数据setTimeNodeList
},
computed: {
// ...mapState('planManage',{
// residentList: state => state.residentList,
// groupList: state => state.groupList
// })
...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList,
})
},
methods: {
// ...mapActions('planManage', ['getResidentList', 'getGroupList']),
......@@ -204,28 +200,35 @@
},
nextClick(formName) {
//为方便调试,不做校验
this.activeTab = 'second';
//用作校验
// if(!this.baseInfo.hasSelectedNum) {
// this.noChoice = true
// return;
// }else {
// this.noChoice = false
// }
// this.$refs[formName].validate((valid) => {
// if (valid) {
// // this.$refs['statusForm'].resetFields();
// this.activeTab = 'second';
// } else {
// return false;
// }
// });
//用作校验
if(!this.baseInfo.hasSelectedNum) {
this.noChoice = true
return;
}else {
this.noChoice = false
}
this.$refs[formName].validate((valid) => {
if (valid) {
// this.$refs['statusForm'].resetFields();
this.activeTab = 'second';
} else {
return false;
}
});
},
preClick() {
this.activeTab = 'first';
},
saveEdit() {
console.log('保存')
console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
console.log('保存timeForm',this.$refs.getTimeNodeList.timeForm)
// 各种校验通过后,提交编辑内容,toast提示
this.$notify.success({
title: '',
message: '创建成功',
showClose: false
});
},
},
watch: {
......
......@@ -10,7 +10,7 @@
<div class="header">
<div class="title"><p>基本信息</p></div>
<div class="h-btn">
<el-button class="button-white" plain @click="changePlan">修改</el-button>
<el-button class="button-white" plain @click="changePlan" size="small">修改</el-button>
</div>
</div>
<div class="base-info" >
......@@ -47,7 +47,7 @@
</div>
<div class="time-nodes">
<p class="title">随访时间节点</p>
<el-radio-group v-model="timeNodes">
<el-radio-group v-model="timeNodes" size="small">
<el-radio-button :key="item.id" v-for="item in planDetail.fPlanTimeDtoList" :label="item.id">{{item.timeStr}}</el-radio-button>
</el-radio-group>
<div class="followup-contents">
......@@ -110,7 +110,7 @@
},
mounted() {
this.getPlanDetail(this.$route.query.planId); //获取居民详情
this.getPlanDetail(this.$route.query.planId); //获取计划详情
this.getNodeTimeList(this.$route.query.planId); // 获取随访时间列表
},
computed: {
......@@ -127,10 +127,10 @@
this.showFollowTime = true
},
goToResidentList() {
this.$router.push({path: '/followup/plan-manage/resident-list', query: {planId:'1'}})
this.$router.push({path: '/followup/plan-manage/resident-list', query: {planId: this.$route.query.planId}})
},
changePlan() {
this.$router.push({path: '/followup/plan-manage/plan-modify', query: {planId: this.$route.query.planId}})
},
closeFollowTime(isShow) {
this.showFollowTime = isShow
......
......@@ -5,7 +5,7 @@
<div class="page-title">计划管理</div>
<div class="search-div">
<div class="search-input">
<el-form ref="serchForm" :model="searchData" :inline="true" label-suffix=":" label-width="125px">
<el-form ref="serchForm" :model="searchData" :inline="true" label-suffix=":" label-width="125px" size="small">
<el-form-item label="随访计划名称">
<el-input v-model="searchData.name" placeholder="请输入关键词" maxlength="20" style="width: 250px" clearable></el-input>
</el-form-item>
......@@ -23,12 +23,12 @@
</el-form>
</div>
<div class="search-btn">
<el-button class="button-green" type="primary" @click="search(1)">查询</el-button>
<el-button class="button-white" plain @click="reseat">重置</el-button>
<el-button class="button-green" size="small" type="primary" @click="search(1)">查询</el-button>
<el-button class="button-white" size="small" plain @click="reseat">重置</el-button>
</div>
</div>
<div class="table-content">
<div class="content-group-btn"><el-button type="primary" @click="addNewPlan">新建随访计划</el-button></div>
<div class="content-group-btn"><el-button type="primary" size="small" @click="addNewPlan">新建随访计划</el-button></div>
<div>
<el-table :data="planList.fPlanDtoList" style="width: 100%;margin-top: 20px;">
<el-table-column prop="name" label="随访计划名称" min-width="100" align="center" :show-overflow-tooltip="true">
......@@ -128,13 +128,13 @@
this.$router.push({path: '/followup/plan-manage/new-plan'})
},
visitDetail(row){
this.$router.push({path: '/followup/plan-manage/plan-detail', query: {planId:'1'}})
this.$router.push({path: '/followup/plan-manage/plan-detail', query: {planId:row.id}})
},
visitRow(row){
this.$router.push({path: '/followup/plan-manage/resident-list', query: {planId:'1'}})
this.$router.push({path: '/followup/plan-manage/resident-list', query: {planId:row.id}})
},
changeRow(row){
this.$router.push({path: '/followup/plan-manage/plan-modify', query: {planId:'1'}})
this.$router.push({path: '/followup/plan-manage/plan-modify', query: {planId:row.id}})
},
deleteRow(row){},
......
......@@ -12,41 +12,31 @@
<span>修改计划</span>
</div>
<div class="plan-btns-group">
<el-button class="button-white" plain @click="cancelEdit" >取 消</el-button>
<el-button class="button-green" type="primary" @click="cancelEdit" >保 存</el-button>
<el-button class="button-white" plain @click="cancelEdit" size="small">取 消</el-button>
<el-button class="button-green" type="primary" @click="saveModify" size="small">保 存</el-button>
</div>
</div>
<el-form ref="baseInfo" :model="modifyInfo" :rules="rules" label-suffix=":" label-width="140px">
<el-form ref="baseInfo" :model="planDetail" :rules="rules" label-suffix=":" label-width="140px">
<el-form-item label="随访计划名称" prop="name">
<el-input v-model="modifyInfo.name" maxlength="20" style="width: 30%" clearable></el-input>
<el-input v-model="planDetail.name" maxlength="20" style="width: 30%" size="small" clearable></el-input>
</el-form-item>
<el-form-item label="随访居民" required>
<div class="select-patients">
<el-button plain icon="el-icon-plus" @click="selectPatientHandler">{{modifyInfo.hasSelectedNum ? '继续添加' : '选择居民'}}</el-button><br>
<el-button type="text" class="mt10" @click="seeSelectedHandler" v-if="modifyInfo.hasSelectedNum">已选{{modifyInfo.hasSelectedNum}}<i class="el-icon-arrow-right"></i></el-button>
<el-button plain icon="el-icon-plus" size="small" @click="selectPatientHandler">{{planDetail.patientIdList ? '继续添加' : '选择居民'}}</el-button><br>
<el-button type="text" class="mt10" size="small" @click="seeSelectedHandler" v-if="planDetail.patientIdList">已选{{planDetail.patientIdList.length}}<i class="el-icon-arrow-right"></i></el-button>
</div>
</el-form-item>
<el-form-item label="随访模板" prop="followupTemplate">
<el-select
v-model="modifyInfo.followupTemplate"
placeholder="请选择随访模板"
clearable>
<el-option
v-for="item in templateOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<p class="tips">随访计划创建成功后,模板不可更换,请谨慎选择。</p>
<el-form-item label="随访模板" prop="resourceName">
{{planDetail.resourceName}}
</el-form-item>
<el-form-item label="随访开始时间" prop="startTime">
2018-01-01 <el-button class="btn-text" type="text" @click="goToFollowTime">查看全部></el-button>
<el-form-item label="随访开始时间" prop="timeStr">
{{planDetail.timeStr}} <el-button class="btn-text" type="text" @click="goToFollowTime" size="small">查看全部></el-button>
</el-form-item>
<el-form-item label="备注">
<el-select
v-model="modifyInfo.followupKind"
v-model="planDetail.remarksStatus"
placeholder="请选择随访种类"
size="small"
clearable>
<el-option
v-for="item in kindOptions"
......@@ -58,7 +48,7 @@
</el-form-item>
</el-form>
<div class="edit-plan-content">
<set-time-node></set-time-node>
<set-time-node ></set-time-node>
</div>
</div>
<select-patient
......@@ -66,6 +56,8 @@
@closeSelectPatient="closeSelectPatient"
@sureSelectPatient="sureSelectPatient(arguments)">
</select-patient>
<has-selected-patient :isShowSelectedDialog="isShowSelectedDialog" :hasSelectedList="residentList.fPlanPatientInfoDtoList" @closeSelectedDialog="closeSelectedDialog" @continueAdd="continueAdd"></has-selected-patient>
<follow-time :showThisPage="showFollowTime" :nodeTimeList="nodeTimeList" @closeFollowTime="closeFollowTime"></follow-time>
</div>
</template>
......@@ -74,6 +66,10 @@
import SelectPatient from '@/views/followup/plan-manage/dialog/select-patient';
import HasSelectedPatient from '@/views/followup/plan-manage/dialog/has-selected-patient';
import SetTimeNode from '@/views/followup/plan-manage/dialog/set-time-node';
import FollowTime from '@/views/followup/plan-manage/dialog/follow-time';
import { mapState, mapActions } from 'vuex'
export default {
name: "plan-modify",
components: {
......@@ -81,6 +77,7 @@
SelectPatient,
HasSelectedPatient,
SetTimeNode,
FollowTime
},
data() {
return {
......@@ -89,7 +86,6 @@
curmbSecond: '计划管理',
curmbThird: '修改随访计划',
jumPathThird: '/followUp/plan-manage',
modifyInfo: {},
rules: {
name: [{ required: true, message: '请输入随访计划名称', trigger: 'blur' }],
followupTemplate: [{ required: true, message: '请选择随访模板', trigger: 'change' }],
......@@ -109,45 +105,92 @@
],
kindOptions: [
{
value: '0',
value: 0,
label: '上门随访'
}, {
value: '1',
value: 1,
label: '术后随访'
}
],
isShowSelectPatient: false, //显示居民选择框
isShowSelectedDialog: false, //显示已选居民
hasSelectedList: [], //已选居民
showFollowTime: false, //是否展示全部时间
}
},
mounted() {
this.getPlanDetail(this.$route.query.planId); //获取计划详情
this.getNodeTimeList(this.$route.query.planId); // 获取随访时间列表
this.getResidentList({
planId: this.$route.query.planId
}); //已选居民
},
computed: {
...mapState('planManage', {
planDetail: state => state.planDetail,
nodeTimeList: state => state.nodeTimeList,
residentList: state => state.residentList,
})
},
methods: {
...mapActions('planManage', ['getPlanDetail', 'getNodeTimeList', 'getResidentList']),
selectPatientHandler() {
this.isShowSelectPatient = true;
},
closeSelectPatient(val) {
this.isShowSelectPatient = val;
},
seeSelectedHandler() {
this.isShowSelectedDialog = true;
},
closeSelectedDialog(val) {
this.isShowSelectedDialog = val;
},
sureSelectPatient() {
let getArguments = arguments[0];
this.isShowSelectPatient = getArguments[0];
this.hasSelectedList = getArguments[1];
this.modifyInfo.hasSelectedNum = getArguments[1].length;
},
continueAdd(val) {
this.isShowSelectedDialog = val;
this.isShowSelectPatient = true;
},
cancelEdit() {
this.$confirm('是否放弃本次创建,放弃后数据不能被保存', '', {
confirmButtonText: '继续创建',
this.$confirm('是否放弃本次修改?', '', {
confirmButtonText: '继续修改',
cancelButtonText: '确定放弃',
type: 'warning'
}).then(() => {
// 关闭弹层,继续创建
}).catch(() => {
// 确定放弃,跳出当前编辑页面
this.$router.push({path: '/followup/plan-manage/plan-list'})
this.$router.back(-1)
});
},
goToFollowTime() {
saveModify() {
this.$confirm('是否确认保存修改内容?', '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 关闭弹层,继续创建
this.$message({
message: '修改成功!',
type: 'success'
});
this.$router.back(-1)
}).catch(() => {
// 确定放弃,跳出当前编辑页面
}
});
},
goToFollowTime() {
this.showFollowTime = true
},
closeFollowTime(isShow) {
this.showFollowTime = isShow
},
},
}
</script>
......
......@@ -10,8 +10,8 @@
<div class="header">
<div class="title"><p>基本信息</p></div>
<div class="h-btn">
<el-button class="button-white" plain @click="changePlan">计划变更</el-button>
<el-button class="button-white" plain @click="finishFollowup">结束随访</el-button>
<el-button class="button-white" plain size="small" @click="changePlan">计划变更</el-button>
<el-button class="button-white" plain size="small" @click="finishFollowup">结束随访</el-button>
</div>
</div>
<div class="base-info" v-if="residentDetail.fPlanPatientDatilDtoList">
......@@ -64,7 +64,7 @@
</div>
<div class="time-nodes">
<p class="title">随访时间节点</p>
<el-radio-group v-model="timeNodes">
<el-radio-group v-model="timeNodes" size="small">
<el-radio-button :key="item.nodeId" v-for="item in timeNodeList" :label="item.nodeId">{{item.timeNodeContent}}</el-radio-button>
</el-radio-group>
<div class="followup-contents">
......
......@@ -12,13 +12,13 @@
<div class="search-input">
<el-form :model="searchData" ref="searchData" :inline="true" :label-width="labelWidth">
<el-form-item label="姓名:" prop="patientName">
<el-input v-model="searchData.patientName" placeholder="请输入姓名" clearable></el-input>
<el-input v-model="searchData.patientName" size="small" placeholder="请输入姓名" clearable></el-input>
</el-form-item>
<el-form-item label="手机号:" prop="mobile">
<el-input v-model="searchData.mobile" placeholder="请输入手机号" clearable></el-input>
<el-input v-model="searchData.mobile" size="small" placeholder="请输入手机号" clearable></el-input>
</el-form-item>
<el-form-item label="分组:" prop="labelId">
<el-select v-model="searchData.labelId" clearable>
<el-select v-model="searchData.labelId" size="small" clearable>
<el-option
v-for="item in groupList"
:key="item.labelId"
......@@ -27,7 +27,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="随访开始时间:" prop="startDate" clearable>
<el-form-item label="随访开始时间:" prop="startDate" size="small" clearable>
<el-date-picker
v-model="searchData.startDate"
type="datetime"
......@@ -39,25 +39,26 @@
</el-form>
</div>
<div class="search-btn">
<el-button class="button-green" type="primary" @click="searchResidentList">查询</el-button>
<el-button class="button-white" plain @click="resetSearchData('searchData')">重置</el-button>
<el-button class="button-green" type="primary" size="small" @click="searchResidentList">查询</el-button>
<el-button class="button-white" plain size="small" @click="resetSearchData('searchData')">重置</el-button>
</div>
</div>
<div class="resident-table table-content">
<div class="btn-div">
<el-radio-group v-model="status">
<el-radio-group v-model="status" size="small">
<el-radio-button label="0">未完成({{residentList.notCount}})</el-radio-button>
<el-radio-button label="1">进行中({{residentList.handCount}})</el-radio-button>
<el-radio-button label="2">已结束({{residentList.yesCount}})</el-radio-button>
</el-radio-group>
<div class="btn-left">
<el-button class="button-green" type="primary" @click="finishFollowup('all')">结束随访</el-button>
<el-button class="button-white" plain @click="selectPatientHandler">添加居民</el-button>
<el-button class="button-green" type="primary" size="small" @click="finishFollowup('all')">结束随访</el-button>
<el-button class="button-white" plain size="small" @click="selectPatientHandler">添加居民</el-button>
</div>
</div>
<el-table
:data="residentList.fPlanPatientInfoDtoList"
center
@selection-change="handleSelectionChange"
style="width: 100%;margin-top: 20px;">
<el-table-column
type="selection"
......@@ -82,6 +83,7 @@
align="center">
</el-table-column>
<el-table-column
width="160"
prop="time"
label="随访开始时间"
align="center">
......@@ -92,6 +94,7 @@
align="center">
</el-table-column>
<el-table-column
width="190"
fixed="right"
label="操作"
align="center">
......@@ -165,6 +168,7 @@
finishData: {}, //结束数据
isShowSelectPatient: false, //显示居民选择框
hasSelectedList: [], //已选居民
finishPatientList: [], //结束随访居民(多选)
}
},
created() {
......@@ -226,9 +230,23 @@
this.showChangePlan = isShow
},
finishFollowup(row) {
if(row=='all') {
if(this.finishPatientList.length<=0) {
this.$message({
message: '请选择居民!',
type: 'warning'
});
return;
}
this.finishData = {
patientName: row.patientName,
};
} else {
this.finishData = {
patientName: row.patientName,
};
}
this.showFinishFollowup = true;
},
closeFinishFollowup(isShow) {
......@@ -246,6 +264,10 @@
this.hasSelectedList = getArguments[1];
this.modifyInfo.hasSelectedNum = getArguments[1].length;
},
handleSelectionChange(val) {
console.log('已选居民',val)
this.finishPatientList = val;
}
},
watch: {
status(val) {
......
......@@ -9,7 +9,7 @@
:close-on-press-escape="false"
:before-close="closeChange"
width="800px">
<el-form ref="statusForm" :model="statusForm" :rules="rules" label-suffix=":" label-width="120px">
<el-form ref="statusForm" :model="statusForm" :rules="rules" label-suffix=":" label-width="120px" size="small">
<el-form-item label="居民" style="margin-bottom:0;">
<span>{{statusForm.nickname}}</span>
</el-form-item>
......@@ -21,14 +21,14 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button plain @click="closeChange">取 消</el-button>
<el-button type="primary" @click="saveReason('statusForm')">确 定</el-button>
<el-button size="small" plain @click="closeChange">取 消</el-button>
<el-button size="small" type="primary" @click="saveReason('statusForm')">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import followApi from '@/utils/followup/followapis'
import {changeEnteringStatus} from '@/utils/followup/followapis'
export default {
components: {},
data(){
......@@ -66,7 +66,7 @@
this.$refs[formName].validate((valid) => {
if (valid) {
//后面更改为接口调用
followApi.changeEnteringStatus({
changeEnteringStatus({
info: {
fuPlanPatientTimesId: this.statusForm.fuPlanPatientTimesId,
patientId: this.statusForm.patientId,
......
......@@ -5,7 +5,7 @@
<div class="page-title">录入管理</div>
<div class="search-div">
<div class="search-input">
<el-form ref="serchForm" :model="searchData" :inline="true" label-suffix=":" label-width="125px">
<el-form ref="serchForm" :model="searchData" :inline="true" label-suffix=":" label-width="125px" size="small">
<el-form-item label="随访计划名称">
<el-input v-model="searchData.planName" placeholder="请输入关键词" style="width: 250px" clearable></el-input>
</el-form-item>
......@@ -30,12 +30,12 @@
</el-form>
</div>
<div class="search-btn">
<el-button class="button-green" type="primary" @click="search(1)">查询</el-button>
<el-button class="button-white" plain @click="reseat">重置</el-button>
<el-button class="button-green" size="small" type="primary" @click="search(1)">查询</el-button>
<el-button class="button-white" size="small" plain @click="reseat">重置</el-button>
</div>
</div>
<div class="table-content">
<el-radio-group v-model="activeName" @change="handlerClick">
<el-radio-group v-model="activeName" @change="handlerClick" size="small">
<el-radio-button label="0">全部({{recordList.count}}</el-radio-button>
<el-radio-button label="1">已完成({{recordList.acceptCount}}</el-radio-button>
<el-radio-button label="2">未完成({{recordList.refuseCount}}</el-radio-button>
......@@ -180,7 +180,8 @@
this.search(1);
},
async visitDetail(row){
await this.getEnteringInfo({patientId: row.patientId,fuPlanPatientTimesId: row.fuPlanPatientTimesId});
await this.getEnteringInfo({patientId:row.patientId,fuPlanPatientTimesId:row.fuPlanPatientTimesId});
//await this.getEnteringInfo({});
this.dialogDetailShow = true;
// this.enteringRow = row;
......
......@@ -61,7 +61,7 @@
</div>
</template>
<script>
import followApi from '@/utils/followup/followapis'
import { changeReservationStatus } from '@/utils/followup/followapis'
import { mapState, mapActions } from 'vuex'
export default {
components: {},
......@@ -175,7 +175,7 @@
this.$refs[formName].validate((valid) => {
if (valid) {
console.log('保存的内容',this.reservationForm)
followApi.changeReservationStatus({
changeReservationStatus({
...this.reservationForm
}).then(({data}) => {
this.$message.success('变更成功!');
......
......@@ -13,7 +13,8 @@
:rules="rules"
label-suffix=":"
label-width="120px"
:label-position="'left'">
:label-position="'left'"
size="small">
<el-form-item label="已选居民">
<span>{{checkData.total}}</span><span>(微信发送{{checkData.weChatNum}}人;短信发送{{checkData.messageNum}}人)</span>
</el-form-item>
......@@ -66,7 +67,7 @@
</div>
</template>
<script>
import followApi from '@/utils/followup/followapis'
import {sendReservation} from '@/utils/followup/followapis'
import { mapState, mapActions } from 'vuex'
export default {
components: {},
......@@ -174,7 +175,7 @@
closeSendReserve(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
followApi.sendReservation({
sendReservation({
...this.reservationForm,
patientAppointList: this.selectList
}).then(({data}) => {
......
......@@ -9,19 +9,20 @@
<div class="search-div">
<div class="search-input">
<el-form :model="searchData" ref="searchData" :inline="true" :label-width="labelWidth">
<el-form-item label="随访计划名称:" prop="planName">
<el-input v-model="searchData.planName" placeholder="请输入随访计划名称" clearable></el-input>
<el-form-item label="随访计划名称:" prop="name">
<el-input v-model="searchData.name" size="small" placeholder="请输入随访计划名称" clearable></el-input>
</el-form-item>
<el-form-item label="姓名:" prop="nickName">
<el-input v-model="searchData.nickName" placeholder="请输入姓名" clearable></el-input>
<el-input v-model="searchData.nickName" size="small" placeholder="请输入姓名" clearable></el-input>
</el-form-item>
<el-form-item label="手机号:" prop="mobilePhone">
<el-input v-model="searchData.mobilePhone" placeholder="请输入手机号" clearable></el-input>
<el-input v-model="searchData.mobilePhone" size="small" placeholder="请输入手机号" clearable></el-input>
</el-form-item>
<el-form-item label="随访时间范围:" prop="planTimes" clearable>
<el-date-picker
v-model="searchData.planTimes"
v-model="searchData.timeRange"
type="daterange"
size="small"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
......@@ -43,21 +44,21 @@
</el-form>
</div>
<div class="search-btn">
<el-button class="button-green" type="primary" @click="searchReservationList">查询</el-button>
<el-button class="button-white" plain @click="resetSearchData('searchData')">重置</el-button>
<el-button class="button-green" type="primary" size="small" @click="searchReservationList">查询</el-button>
<el-button class="button-white" plain size="small" @click="resetSearchData('searchData')">重置</el-button>
</div>
</div>
<div class="reservation-table table-content">
<el-radio-group v-model="status">
<el-radio-group v-model="status" size="small">
<el-radio-button label="0">全部({{reservationList.total}})</el-radio-button>
<el-radio-button label="1">未发送({{reservationList.notCount}})</el-radio-button>
<el-radio-button label="2">待确认({{reservationList.handCount}})</el-radio-button>
<el-radio-button label="3">已接受({{reservationList.yesCount}})</el-radio-button>
<el-radio-button label="4">已拒绝({{reservationList.refuseCount }})</el-radio-button>
</el-radio-group>
<el-button class="button-green" type="primary" @click="sendReservation">发送预约</el-button>
<el-button class="button-green" type="primary" size="small" @click="sendReservation">发送预约</el-button>
<el-table
:data="reservationList.fPlanAppointmentDtoList"
:data="reservationList.fuPlanInfoList"
center
style="width: 100%;margin-top: 20px;"
@selection-change="handleSelectionChange">
......@@ -79,21 +80,24 @@
align="center">
</el-table-column>
<el-table-column
prop="planName"
prop="name"
label="随访计划名称"
align="center">
</el-table-column>
<el-table-column
prop="planTime"
width="160"
prop="fuPlanTime"
label="随访计划时间"
align="center">
</el-table-column>
<el-table-column
width="160"
prop="appointmentTime"
label="随访预约时间"
align="center">
</el-table-column>
<el-table-column
width="180"
fixed="right"
label="操作"
align="center">
......@@ -106,14 +110,14 @@
<div class="pagination">
<el-pagination
background
v-if="reservationList.fPlanAppointmentDtoList"
v-if="reservationList.fuPlanInfoList"
@size-change="handleSizeChangePre"
@current-change="handleCurrentChangePre"
layout="total, sizes, prev, pager, next, jumper"
:current-page="reservationList.pageNum"
:current-page="reservationList.pageNo"
:page-sizes="[10, 20, 50, 100]"
:page-size="reservationList.pageSize"
:total="reservationList.total">
:total="reservationList.count">
</el-pagination>
</div>
</div>
......@@ -220,7 +224,7 @@
},
handleCurrentChangePre(pageNum) {
this.getReservationList({
pageNum,
pageNo,
status: this.status,
...this.setSearchData()
})
......
......@@ -51,14 +51,12 @@
</el-table>
</div>
</el-col>
<el-col class="message screenSet" :span="24">
<el-col class="message screenSet" :span="24" id="screenSet">
<div class="message-title">系统消息 <span>今日消息:{{count}}条</span></div>
<div class="message-info" v-if="messageList.length > 0">
<div class="message-item" v-for="(item,index) in messageList" :key="index">
<div class="text-top">
<i class="el-icon-error" v-if="item.type == 2" style="color:#FA5555"></i>
<i class="el-icon-success" v-if="item.type == 3" style="color:#67C23A"></i>
<i class="el-icon-warning" v-if="item.type == 1" style="color:#FAAD14"></i>
<img :src="item.url"/>
<span>{{item.menuName}}</span>
<span>{{item.portalTime}}</span>
</div>
......@@ -83,7 +81,7 @@ import { setTimeout, setInterval } from 'timers'
import ChangeFollowupStatus from "./followup/record-manage/dialog/change-followup-status";
import { mapGetters, mapState, mapActions } from 'vuex'
import * as commonUtil from '../utils/utils'
let vm = null
export default {
components: {
......@@ -127,6 +125,10 @@ export default {
todayOverview: state => state.todayOverview,
})
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight()
},
methods: {
...mapActions('workbench', ['getTodayPlansList', 'getTodayAppointsList', 'getTodayOverview']),
// 查看更多
......@@ -139,10 +141,12 @@ export default {
},
// 获取系统消息数据
getSystemData() {
vm.GET('portalMessage/queryPortalMessageInfo',{token: vm._token, pageNo: 1, pageSize: 15}).then((res) => {
vm.GET('portal/portalMessage/queryPortalMessageInfo',{token: vm._token, pageNo: 1, pageSize: 15}).then((res) => {
if( res.code == '000000') {
vm.messageList = res.data.portalMessageModels
vm.count = res.data.count
} else {
vm.$message.info(res.message)
}
})
},
......@@ -265,6 +269,11 @@ export default {
padding: 10px 10px 15px;
border-bottom: 1px solid #EBEEF5;
.text-top {
img {
float: left;
width: 16px;
margin-top: 3px;
}
span:nth-child(2) {
padding: 10px;
}
......
......@@ -55,7 +55,7 @@ export default {
if(vm.idType == 1) { // 内部
window.location.href = getInnerLoginUrl()
} else {
window.location.href = getLoginUrl()
window.location.href = getLoginUrl('?from=work&type=logout')
}
}
if(command === 'forward') {
......
<template>
<div class="slidebar-container">
<div id="slidebar-container" class="slidebar-container">
<el-menu :default-active="onRoutes" class="el-menu-vertical-demo" theme="dark" unique-opened router>
<template v-for="(item,_index) in items">
<template v-if="item.subs">
......@@ -150,9 +150,9 @@ export default {
color: #fff;
background: #06232C;
}
.el-menu-item:focus, .el-menu-item:hover {
background: #06232C !important;
}
// .el-menu-item:focus, .el-menu-item:hover {
// background: #06232C !important;
// }
}
}
</style>
......
<template>
<div class="item-role-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird"></bread-crumb>
<div class="component-content screenSet">
<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 :model="formInline" ref="formInline" label-width="75px" class="form-inline">
<el-col :span="5">
<el-form-item label="姓名:">
<el-input size="mini" v-model="formInline.name" placeholder="请输入名称"></el-input>
<el-input size="small" v-model="formInline.userName" placeholder="请输入名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="角色:">
<el-select size="mini" v-model="formInline.projeceRole" placeholder="请选择角色">
<el-select size="small" v-model="formInline.projeceRole" placeholder="请选择角色">
<el-option
v-for="(item, index) in roleList"
:key="index"
......@@ -24,7 +24,7 @@
</el-col>
<el-col :span="5">
<el-form-item label="所属机构:">
<el-select size="mini" v-model="formInline.organizationName" placeholder="请选择所属机构">
<el-select size="small" v-model="formInline.organizationName" placeholder="请选择所属机构">
<el-option
v-for="(item, index) in organizationList"
:key="index"
......@@ -36,7 +36,7 @@
</el-col>
<el-col :span="5">
<el-form-item label="所属科室:">
<el-select size="mini" v-model="formInline.departmentsName" placeholder="请选择所属科室">
<el-select size="small" v-model="formInline.departmentsName" placeholder="请选择所属科室">
<el-option
v-for="(item, index) in departmentsList"
:key="index"
......@@ -47,7 +47,7 @@
</el-form-item>
</el-col>
<el-col :span="4" style="padding:0;text-align:right;padding-right:10px;">
<el-button type="primary" size="small" @click="queryRoleList()">查询</el-button>
<el-button type="primary" size="small" @click="searchList()">查询</el-button>
<el-button
type="default"
size="small"
......@@ -57,10 +57,7 @@
</el-col>
</el-form>
</el-row>
<el-table
:data="tableData"
style="width: 100%"
>
<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="projeceRole" label="角色" align="center">
......@@ -92,6 +89,12 @@
>降为普通用户</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
......@@ -106,11 +109,12 @@
></el-pagination>
</div>
<el-dialog title :visible.sync="dialog.show" width="30%" center>
<p class="dialog-p">
<p v-if="numL3 > 1" class="dialog-p">
确认将{{ dialog.role }}
<span class="user-name">"{{ dialog.name }}"</span>
{{ dialog.option }}吗?"
</p>
<p v-else >该用户为此机构仅有的次级负责人,确认需要降级吗?</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>
......@@ -133,6 +137,7 @@
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from '../../utils/utils'
let vm = null;
export default {
components: {
......@@ -172,7 +177,7 @@ export default {
value: "L1"
},
{
label: "项目管理员",
label: "项目负责人",
value: "L2"
},
{
......@@ -185,6 +190,7 @@ export default {
}
],
numL2: 0,
numL3: 0,
dialog: {
show: false,
role: "项目负责人",
......@@ -193,14 +199,23 @@ export default {
full: false
},
dialogFull: false,
scopeRow: {}
scopeRow: {},
activeUser: '',
};
},
created() {
vm = this;
this.queryRoleList();
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
searchList() {
this.formInline.pageNo = 1;
this.queryRoleList();
},
//查询用户列表
queryRoleList() {
this.formInline.portalProjectId = vm.getUrlSearch(
......@@ -213,16 +228,18 @@ export default {
let req = {};
req = this.formInline;
openLoading(vm);
vm.GET("portalProjectOrRole/queryRoleList", req).then(res => {
vm.GET("portal/portalProjectOrRole/queryRoleList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.projectRoleInfoModels;
vm.totalRows = res.data.total;
vm.activeUser = res.data.activeUser;
console.log('activeUser',vm.activeUser);
//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;
}
});
},
......@@ -235,12 +252,16 @@ export default {
numL2: this.numL2,
nowL: this.scopeRow.projeceRole
};
vm.GET("portalProjectOrRole/roleLevelUpdate", req).then(res => {
vm.GET("portal/portalProjectOrRole/roleLevelUpdate", req).then(res => {
this.dialog.show = false;
if (res.code == "000000") {
console.log(res);
this.queryRoleList();
}
vm.$message({
type: 'info',
message: res.message,
})
});
},
handleSizeChange(val) {
......@@ -271,7 +292,8 @@ export default {
//按钮展示情况
showButton(row, projeceRole) {
let flag = false;
//console.log("当前等级 " + row.projeceRole + " 改变成等级 " + projeceRole);
if(vm.activeUser == "L1") {
//当前内部管理员
if (row.projeceRole == "L2") {
if (projeceRole == "L0") {
flag = true;
......@@ -285,6 +307,25 @@ export default {
flag = true;
}
}
} else if (vm.activeUser == "L2") {
//当前项目负责人
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 == "L3") {
//当前次级负责人
if (row.projeceRole == "L0") {
if (projeceRole == "L3") {
flag = true;
}
}
}
return flag;
},
//打开弹出框
......@@ -342,6 +383,14 @@ export default {
color: #449284;
}
}
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="role-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet">
<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="6">
<el-form-item label="项目名称:">
<el-input v-model="formInline.projectName" size="mini" placeholder="请输入项目名称"></el-input>
<el-input v-model="formInline.projectName" size="small" placeholder="请输入项目名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="项目时间:">
<el-date-picker
v-model="formInline.projectBegintime"
size="mini"
type="date"
size="small"
type="datetime"
placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0"
......@@ -26,32 +26,31 @@
<el-form-item label="~">
<el-date-picker
v-model="formInline.projectEndtime"
size="mini"
type="date"
size="small"
type="datetime"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd 23:59:59"
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="search">查询</el-button>
<el-button type="primary" size="small" @click="searchList">查询</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button>
</el-col>
</el-form>
</el-row>
<el-table
:data="tableData" style="width: 100%"
>
<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="projectIntro" label="项目简介" 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="项目开始时间" align="center"></el-table-column>
<el-table-column prop="projectEndtime" label="项目结束时间" align="center"></el-table-column>
<el-table-column prop="projectStatus" label="状态" align="center">
<template slot-scope="scope">
<span>{{ scope.row.projectStatus | statusProject }}</span>
<span>{{ [scope.row.projectStatus , idType] | statusProject }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="200" align="center">
......@@ -59,6 +58,12 @@
<el-button type="primary" size="small" @click="toPage(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
......@@ -78,7 +83,9 @@
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain";
import { mapGetters } from 'vuex'
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
let vm = null;
export default {
components: {
......@@ -100,12 +107,15 @@ export default {
projectEndtime: "",
pageNo: 1,
pageSize: 10,
type: 2,
type: 2
},
pickerOptions0: {
disabledDate: time => {
if (this.formInline.projectEndtime != "") {
return time.getTime() > new Date(this.formInline.projectEndtime).getTime();
if (this.formInline.projectEndtime != "" && this.formInline.projectEndtime !=null) {
return (
time.getTime() >
new Date(this.formInline.projectEndtime).getTime()
);
}
}
},
......@@ -119,17 +129,30 @@ export default {
}
};
},
computed: {
...mapGetters(["_token"])
},
created() {
vm = this;
vm.idType = localStorage.getItem('storageIdType');
console.log('idType:',vm.idType);
this.search();
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
searchList() {
this.formInline.pageNo = 1;
this.search();
},
search() {
let req = {};
//console.log(this.formInline);
req = this.formInline;
openLoading(vm);
vm.GET("portalInfo/getProjectList", req).then(res => {
vm.GET("portal/portalInfo/getProjectList", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.data;
......@@ -155,9 +178,13 @@ export default {
this.$router.push("item-role?portalProjectId=" + row.id);
},
handleSizeChange(val) {
this.formInline.pageSize = val;
this.search();
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
this.formInline.pageNo = val;
this.search();
console.log(`当前页: ${val}`);
}
}
......@@ -180,13 +207,14 @@ export default {
.add-button {
float: right;
}
// .el-table .cell {
// color: #929292;
// }
// .el-table th > .cell {
// font-weight: bold;
// color: #000;
// }
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
}
}
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册