|
@@ -13,6 +13,13 @@
|
|
<ul>
|
|
<ul>
|
|
<li>
|
|
<li>
|
|
<div class="title">
|
|
<div class="title">
|
|
|
|
+ <div class="handleIcon" @click="openPlanItems">
|
|
|
|
+ <img
|
|
|
|
+ src="../../../images/multi.png"
|
|
|
|
+ alt="辅助信息"
|
|
|
|
+ :class="{'open' : isOpenCloseItems}"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
<h4>辅助信息</h4>
|
|
<h4>辅助信息</h4>
|
|
<div class="titlwSwitch">
|
|
<div class="titlwSwitch">
|
|
<el-switch
|
|
<el-switch
|
|
@@ -25,45 +32,66 @@
|
|
<span class="titlwSwitchStatus">{{switchSubStatus === 1 ? '启用中' : '未启用'}}</span>
|
|
<span class="titlwSwitchStatus">{{switchSubStatus === 1 ? '启用中' : '未启用'}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <ul class="sub" v-for="(item,index) in planDefaultList" :key="item.id">
|
|
|
|
- <li class="planItem">
|
|
|
|
- <div class="sort">
|
|
|
|
- <div
|
|
|
|
- class="down"
|
|
|
|
- @click="sortPlan('down')"
|
|
|
|
- v-if="index !== planDefaultList.length - 1"
|
|
|
|
- >下</div>
|
|
|
|
- <div class="top" @click="sortPlan('top')" v-if="index !== 0">上</div>
|
|
|
|
- </div>
|
|
|
|
- <div class="openOrClose">
|
|
|
|
- <span class="planInfo">{{item.name}}</span>
|
|
|
|
- <div class="switch">
|
|
|
|
- <el-switch
|
|
|
|
- v-model="item.status"
|
|
|
|
- :active-value="1"
|
|
|
|
- :inactive-value="0"
|
|
|
|
- active-color="#4BC4D7"
|
|
|
|
- inactive-color="#BBBBBB"
|
|
|
|
- ></el-switch>
|
|
|
|
- </div>
|
|
|
|
- <span class="planStatus">{{item.status === 1 ? '启用中' : '未启用'}}</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="showNum" v-if="item.number">
|
|
|
|
- <span style="marginRight:8px;">默认显示个数</span>
|
|
|
|
- <el-select v-model="item.number" placeholder="请选择" size="small">
|
|
|
|
- <el-option label="1" value="1"></el-option>
|
|
|
|
- <el-option label="2" value="2"></el-option>
|
|
|
|
- <el-option label="3" value="3"></el-option>
|
|
|
|
- <el-option label="4" value="4"></el-option>
|
|
|
|
- <el-option label="5" value="5"></el-option>
|
|
|
|
- <el-option label="6" value="6"></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </div>
|
|
|
|
- </li>
|
|
|
|
- </ul>
|
|
|
|
|
|
+ <transition name="plus-icon">
|
|
|
|
+ <div v-if="isOpenCloseItems">
|
|
|
|
+ <ul class="sub" v-for="(item,index) in planDefaultList" :key="item.id">
|
|
|
|
+ <li class="planItem">
|
|
|
|
+ <div class="sort">
|
|
|
|
+ <div class="top">
|
|
|
|
+ <img
|
|
|
|
+ :src="isTopLight !== index ? require('../../../images/icon_default_top.png') : require('../../../images/icon_hover_top.png')"
|
|
|
|
+ alt="上升"
|
|
|
|
+ v-if="index !== 0"
|
|
|
|
+ @click="sortPlan(item,index,'top')"
|
|
|
|
+ @mouseover="handleMouseEnter1(index)"
|
|
|
|
+ @mouseleave="handleMouseLeave1(index)"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="down">
|
|
|
|
+ <img
|
|
|
|
+ :src="isDownLight !== index ? require('../../../images/icon_default_down.png') : require('../../../images/icon_hover_down.png')"
|
|
|
|
+ alt="下降"
|
|
|
|
+ v-if="index !== planDefaultList.length - 1"
|
|
|
|
+ @click="sortPlan(item,index,'down')"
|
|
|
|
+ @mouseover="handleMouseEnter(index)"
|
|
|
|
+ @mouseleave="handleMouseLeave(index)"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="openOrClose">
|
|
|
|
+ <span class="planInfo">{{item.name}}</span>
|
|
|
|
+ <div class="switch">
|
|
|
|
+ <el-switch
|
|
|
|
+ v-model="item.status"
|
|
|
|
+ :active-value="1"
|
|
|
|
+ :inactive-value="0"
|
|
|
|
+ active-color="#4BC4D7"
|
|
|
|
+ inactive-color="#BBBBBB"
|
|
|
|
+ ></el-switch>
|
|
|
|
+ </div>
|
|
|
|
+ <span class="planStatus">{{item.status === 1 ? '启用中' : '未启用'}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="showNum" v-if="item.number">
|
|
|
|
+ <span style="marginRight:8px;">默认显示个数</span>
|
|
|
|
+ <el-select v-model="item.number" placeholder="请选择" size="small">
|
|
|
|
+ <el-option label="1" value="1"></el-option>
|
|
|
|
+ <el-option label="2" value="2"></el-option>
|
|
|
|
+ <el-option label="3" value="3"></el-option>
|
|
|
|
+ <el-option label="4" value="4"></el-option>
|
|
|
|
+ <el-option label="5" value="5"></el-option>
|
|
|
|
+ <el-option label="6" value="6"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </div>
|
|
|
|
+ </transition>
|
|
</li>
|
|
</li>
|
|
<li>
|
|
<li>
|
|
<div class="title">
|
|
<div class="title">
|
|
|
|
+ <div class="handleIcon">
|
|
|
|
+ <img src="../../../images/multi.png" alt="医学知识" />
|
|
|
|
+ </div>
|
|
<h4>医学知识</h4>
|
|
<h4>医学知识</h4>
|
|
<div class="titlwSwitch">
|
|
<div class="titlwSwitch">
|
|
<el-switch
|
|
<el-switch
|
|
@@ -110,9 +138,21 @@ export default {
|
|
hospitalId: '',
|
|
hospitalId: '',
|
|
isEdit: false, // 是否处于编辑页面 false--新增 true--编辑
|
|
isEdit: false, // 是否处于编辑页面 false--新增 true--编辑
|
|
switchSubStatus: 0, // 辅助信息
|
|
switchSubStatus: 0, // 辅助信息
|
|
- switchMedStatus: 0 // 医学知识
|
|
|
|
|
|
+ switchMedStatus: 0, // 医学知识
|
|
|
|
+ isOpenCloseItems: true, // 是否展开方案配置项
|
|
|
|
+ isDownLight: -1,
|
|
|
|
+ isTopLight: -1,
|
|
|
|
+ flag: 1
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ planDefaultList: {
|
|
|
|
+ handler(newName, oldName) {
|
|
|
|
+ // console.log('obj.a changed');
|
|
|
|
+ },
|
|
|
|
+ immediate: true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
async created() {
|
|
async created() {
|
|
const { isEdit, data } = this.$route.params;
|
|
const { isEdit, data } = this.$route.params;
|
|
// console.log(data, '编辑页传递的data');
|
|
// console.log(data, '编辑页传递的data');
|
|
@@ -133,9 +173,85 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
close() {},
|
|
close() {},
|
|
|
|
+
|
|
// 方案配置排序
|
|
// 方案配置排序
|
|
- sortPlan(type) {
|
|
|
|
- console.log('排序', type);
|
|
|
|
|
|
+ sortPlan(item, index, type) {
|
|
|
|
+ // console.log('排序', item, index, type);
|
|
|
|
+ let tempList = [...this.planDefaultList];
|
|
|
|
+ if (type === 'down') {
|
|
|
|
+ // 降序
|
|
|
|
+ let plan = tempList.find(item => {
|
|
|
|
+ return item.orderNo === index + 1;
|
|
|
|
+ });
|
|
|
|
+ let tempPlan = { ...plan };
|
|
|
|
+ let planNext = tempList.find(item => {
|
|
|
|
+ return item.orderNo === index + 2;
|
|
|
|
+ });
|
|
|
|
+ let tempPlanNext = { ...planNext };
|
|
|
|
+ plan = tempPlanNext;
|
|
|
|
+ plan.orderNo -= 1;
|
|
|
|
+ planNext = tempPlan;
|
|
|
|
+ planNext.orderNo += 1;
|
|
|
|
+ let arr = tempList.map((i, idx) => {
|
|
|
|
+ if (idx === index) {
|
|
|
|
+ return { ...plan };
|
|
|
|
+ } else if (idx === index + 1) {
|
|
|
|
+ return { ...planNext };
|
|
|
|
+ } else {
|
|
|
|
+ return i;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.planDefaultList = [...arr];
|
|
|
|
+ } else {
|
|
|
|
+ // 升序
|
|
|
|
+ let plan = tempList.find(item => {
|
|
|
|
+ return item.orderNo === index + 1;
|
|
|
|
+ });
|
|
|
|
+ let tempPlan = { ...plan };
|
|
|
|
+ let planPre = tempList.find(item => {
|
|
|
|
+ return item.orderNo === index;
|
|
|
|
+ });
|
|
|
|
+ let tempPlanPre = { ...planPre };
|
|
|
|
+ plan = tempPlanPre;
|
|
|
|
+ plan.orderNo += 1;
|
|
|
|
+ planPre = tempPlan;
|
|
|
|
+ planPre.orderNo -= 1;
|
|
|
|
+ let arr = tempList.map((i, idx) => {
|
|
|
|
+ if (idx === index) {
|
|
|
|
+ return { ...plan };
|
|
|
|
+ } else if (idx === index - 1) {
|
|
|
|
+ return { ...planPre };
|
|
|
|
+ } else {
|
|
|
|
+ return i;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.planDefaultList = [...arr];
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 展开列表项
|
|
|
|
+ openPlanItems() {
|
|
|
|
+ this.isOpenCloseItems = !this.isOpenCloseItems;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 鼠标移入
|
|
|
|
+ handleMouseEnter(index) {
|
|
|
|
+ this.isDownLight = index;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 鼠标移除
|
|
|
|
+ handleMouseLeave(index) {
|
|
|
|
+ this.isDownLight = -1;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 鼠标移入
|
|
|
|
+ handleMouseEnter1(index) {
|
|
|
|
+ this.isTopLight = index;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 鼠标移除
|
|
|
|
+ handleMouseLeave1(index) {
|
|
|
|
+ this.isTopLight = -1;
|
|
},
|
|
},
|
|
|
|
|
|
// 获取默认方案配置
|
|
// 获取默认方案配置
|
|
@@ -145,15 +261,15 @@ export default {
|
|
if (res.data.code === '0') {
|
|
if (res.data.code === '0') {
|
|
this.planDefaultList =
|
|
this.planDefaultList =
|
|
res.data.data &&
|
|
res.data.data &&
|
|
- res.data.data.planDetailDefault &&
|
|
|
|
|
|
+ res.data.data.planDetailDefault.length !== 0 &&
|
|
res.data.data.planDetailDefault[0].planDetails;
|
|
res.data.data.planDetailDefault[0].planDetails;
|
|
this.switchSubStatus =
|
|
this.switchSubStatus =
|
|
res.data.data &&
|
|
res.data.data &&
|
|
- res.data.data.planDetailDefault &&
|
|
|
|
|
|
+ res.data.data.planDetailDefault.length !== 0 &&
|
|
res.data.data.planDetailDefault[0].status;
|
|
res.data.data.planDetailDefault[0].status;
|
|
this.switchMedStatus =
|
|
this.switchMedStatus =
|
|
res.data.data &&
|
|
res.data.data &&
|
|
- res.data.data.planDetailDefault &&
|
|
|
|
|
|
+ res.data.data.planDetailDefault.length !== 0 &&
|
|
res.data.data.planDetailDefault[1].status;
|
|
res.data.data.planDetailDefault[1].status;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -205,7 +321,7 @@ export default {
|
|
number: 0,
|
|
number: 0,
|
|
orderNo: 1,
|
|
orderNo: 1,
|
|
planDetailSub: this.handleSendData(),
|
|
planDetailSub: this.handleSendData(),
|
|
- status: this.switchSubStatus,
|
|
|
|
|
|
+ status: this.switchSubStatus
|
|
},
|
|
},
|
|
{
|
|
{
|
|
code: 'medical',
|
|
code: 'medical',
|
|
@@ -213,16 +329,16 @@ export default {
|
|
name: '医学知识',
|
|
name: '医学知识',
|
|
orderNo: 3,
|
|
orderNo: 3,
|
|
planDetailSub: [{}],
|
|
planDetailSub: [{}],
|
|
- status: this.switchMedStatus,
|
|
|
|
|
|
+ status: this.switchMedStatus
|
|
}
|
|
}
|
|
], // 方案配置信息
|
|
], // 方案配置信息
|
|
planName: this.form.planName,
|
|
planName: this.form.planName,
|
|
- planStatus: 1,
|
|
|
|
|
|
+ planStatus: 0
|
|
};
|
|
};
|
|
- if (this.isEdit){
|
|
|
|
- // 编辑状态,需要额外添加ID
|
|
|
|
- const { data } = this.$route.params;
|
|
|
|
- params = {...params,id: data.id}
|
|
|
|
|
|
+ if (this.isEdit) {
|
|
|
|
+ // 编辑状态,需要额外添加ID
|
|
|
|
+ const { data } = this.$route.params;
|
|
|
|
+ params = { ...params, id: data.id };
|
|
}
|
|
}
|
|
return params;
|
|
return params;
|
|
},
|
|
},
|
|
@@ -230,29 +346,30 @@ export default {
|
|
onSubmit() {
|
|
onSubmit() {
|
|
this.$refs.form.validate(valid => {
|
|
this.$refs.form.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- this.saveDisable = true
|
|
|
|
|
|
+ this.saveDisable = true;
|
|
let params = this._getParams();
|
|
let params = this._getParams();
|
|
api.savePlanInfoDatas(params).then(res => {
|
|
api.savePlanInfoDatas(params).then(res => {
|
|
if (res.data.code === '0') {
|
|
if (res.data.code === '0') {
|
|
this.$message({
|
|
this.$message({
|
|
showClose: true,
|
|
showClose: true,
|
|
message: '操作成功',
|
|
message: '操作成功',
|
|
- type: 'success'
|
|
|
|
|
|
+ type: 'success',
|
|
|
|
+ duration: 1000
|
|
});
|
|
});
|
|
} else if (res.data.code === '00020007') {
|
|
} else if (res.data.code === '00020007') {
|
|
// 方案名/方案编码已存在
|
|
// 方案名/方案编码已存在
|
|
this.$message({
|
|
this.$message({
|
|
showClose: true,
|
|
showClose: true,
|
|
message: res.data.msg,
|
|
message: res.data.msg,
|
|
- type: 'error'
|
|
|
|
|
|
+ type: 'error',
|
|
|
|
+ duration: 1000
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- this.saveDisable = false
|
|
|
|
|
|
+ this.saveDisable = false;
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- this.saveDisable = false
|
|
|
|
|
|
+ this.saveDisable = false;
|
|
return false;
|
|
return false;
|
|
-
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -274,13 +391,31 @@ export default {
|
|
.title {
|
|
.title {
|
|
background-color: #f2f2f2;
|
|
background-color: #f2f2f2;
|
|
display: flex;
|
|
display: flex;
|
|
|
|
+ .handleIcon {
|
|
|
|
+ width: 30px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ height: 40px;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ img {
|
|
|
|
+ width: 20px;
|
|
|
|
+ height: 20px;
|
|
|
|
+ }
|
|
|
|
+ .open {
|
|
|
|
+ transform: rotate(180deg);
|
|
|
|
+ }
|
|
|
|
+ .close {
|
|
|
|
+ transform: rotate(0deg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
.titlwSwitch {
|
|
.titlwSwitch {
|
|
width: 120px;
|
|
width: 120px;
|
|
}
|
|
}
|
|
h4 {
|
|
h4 {
|
|
flex: 1;
|
|
flex: 1;
|
|
}
|
|
}
|
|
- .titlwSwitchStatus{
|
|
|
|
|
|
+ .titlwSwitchStatus {
|
|
margin-left: 16px;
|
|
margin-left: 16px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -291,12 +426,26 @@ export default {
|
|
width: 60px;
|
|
width: 60px;
|
|
display: flex;
|
|
display: flex;
|
|
.top {
|
|
.top {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
width: 30px;
|
|
width: 30px;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
|
+ img {
|
|
|
|
+ width: 16px;
|
|
|
|
+ height: 20px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.down {
|
|
.down {
|
|
width: 30px;
|
|
width: 30px;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ img {
|
|
|
|
+ width: 16px;
|
|
|
|
+ height: 20px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.openOrClose {
|
|
.openOrClose {
|
|
@@ -323,5 +472,19 @@ export default {
|
|
.el-button {
|
|
.el-button {
|
|
float: right;
|
|
float: right;
|
|
}
|
|
}
|
|
|
|
+ .plus-icon-enter-active {
|
|
|
|
+ transition: all 0.8s;
|
|
|
|
+ }
|
|
|
|
+ .plus-icon-enter {
|
|
|
|
+ opacity: 0;
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ }
|
|
|
|
+ .plus-icon-leave-active {
|
|
|
|
+ transition: all 0.8s;
|
|
|
|
+ }
|
|
|
|
+ .plus-icon-leave-active {
|
|
|
|
+ opacity: 0;
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|