|
@@ -62,7 +62,7 @@
|
|
|
<div v-if="isOpenCloseItems">
|
|
|
<ul class="sub" v-for="(item,index) in planDefaultList" :key="item.id">
|
|
|
<li class="planItem">
|
|
|
- <div class="sort">
|
|
|
+ <div class="sort" v-if="item.ismove">
|
|
|
<div class="top">
|
|
|
<img
|
|
|
:src="isTopLight !== index ? require('../../../images/icon_default_top.png') : require('../../../images/icon_hover_top.png')"
|
|
@@ -84,8 +84,10 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="sort" v-else></div>
|
|
|
<div class="openOrClose">
|
|
|
<span class="planInfo">{{item.name}}</span>
|
|
|
+ <!-- <span class="planInfo">{{i.name}}</span> -->
|
|
|
<div class="switch">
|
|
|
<el-switch
|
|
|
v-model="item.status"
|
|
@@ -114,6 +116,43 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</li>
|
|
|
+ <li
|
|
|
+ class="planItem"
|
|
|
+ v-if="item.arr.length>0"
|
|
|
+ v-for="i in item.arr"
|
|
|
+ :key="i.id"
|
|
|
+ >
|
|
|
+ <div class="sort"></div>
|
|
|
+ <div class="openOrClose">
|
|
|
+ <span class="planInfo">{{i.name}}</span>
|
|
|
+ <div class="switch">
|
|
|
+ <el-switch
|
|
|
+ v-model="i.status"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ active-color="#4BC4D7"
|
|
|
+ inactive-color="#BBBBBB"
|
|
|
+ ></el-switch>
|
|
|
+ </div>
|
|
|
+ <span class="planStatus">{{i.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"
|
|
|
+ :disabled="item.status !== 1 ? true: false"
|
|
|
+ >
|
|
|
+ <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>
|
|
@@ -227,7 +266,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
- console.log(this.editCount,'this.editCount');
|
|
|
+ console.log(this.editCount, 'this.editCount');
|
|
|
if (
|
|
|
(this.editCount > 3 && !this.isSaveSuccess && this.isEdit) ||
|
|
|
(this.editCount > 1 && !this.isSaveSuccess && !this.isEdit)
|
|
@@ -275,7 +314,7 @@ export default {
|
|
|
if (isEdit) {
|
|
|
// 编辑页面
|
|
|
this.isEdit = true;
|
|
|
- this.form.hospitalId = data.hospitalId
|
|
|
+ this.form.hospitalId = data.hospitalId;
|
|
|
let params = {
|
|
|
hospitalId: data.hospitalId,
|
|
|
id: data.id
|
|
@@ -298,56 +337,72 @@ export default {
|
|
|
},
|
|
|
// 方案配置排序
|
|
|
sortPlan(item, index, type) {
|
|
|
- // console.log('排序', item, index, type);
|
|
|
+ console.log('排序', item, index, type);
|
|
|
let tempList = [...this.planDefaultList];
|
|
|
if (type === 'down') {
|
|
|
+ tempList.splice(index + 2, 0, item);
|
|
|
+ tempList.splice(index, 1);
|
|
|
+ [tempList[index + 1].orderNo, tempList[index].orderNo] = [
|
|
|
+ tempList[index].orderNo,
|
|
|
+ tempList[index + 1].orderNo
|
|
|
+ ];
|
|
|
+ this.planDefaultList = tempList;
|
|
|
// 降序
|
|
|
- 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];
|
|
|
+ // let plan = tempList.find(item => {
|
|
|
+ // console.log(item)
|
|
|
+ // return item.orderNo === index + 1;
|
|
|
+ // });
|
|
|
+ // console.log(item);
|
|
|
+ // 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 {
|
|
|
+ tempList.splice(index - 1, 0, item);
|
|
|
+ tempList.splice(index+1, 1);
|
|
|
+ [tempList[index - 1].orderNo, tempList[index+1].orderNo] = [
|
|
|
+ tempList[index+1].orderNo,
|
|
|
+ tempList[index - 1].orderNo
|
|
|
+ ];
|
|
|
+ this.planDefaultList = tempList;
|
|
|
// 升序
|
|
|
- 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];
|
|
|
+ // 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];
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -376,15 +431,52 @@ export default {
|
|
|
this.isTopLight = -1;
|
|
|
},
|
|
|
|
|
|
- // 获取默认方案配置
|
|
|
+ // 添加 获取默认方案配置
|
|
|
_getDefaultPlans() {
|
|
|
api.getDefaultPlans().then(res => {
|
|
|
- console.log(res, '获取默认的方案配置');
|
|
|
+ // console.log(res, '获取默认的方案配置');
|
|
|
if (res.data.code === '0') {
|
|
|
this.planDefaultList =
|
|
|
res.data.data &&
|
|
|
res.data.data.planDetailDefault.length !== 0 &&
|
|
|
res.data.data.planDetailDefault[0].planDetails;
|
|
|
+ let planDefaultList = this.planDefaultList.map((item, index) => {
|
|
|
+ if (
|
|
|
+ item.name == '高危' ||
|
|
|
+ item.name == '危急值提醒' ||
|
|
|
+ item.name == '其他提醒'
|
|
|
+ ) {
|
|
|
+ return {
|
|
|
+ ismove: false,
|
|
|
+ ...item
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ arr: [],
|
|
|
+ ismove: true,
|
|
|
+ ...item
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // this.planDefaultList = JSON.parse(JSON.stringify(planDefaultList)) ;
|
|
|
+ planDefaultList
|
|
|
+ .slice()
|
|
|
+ .reverse()
|
|
|
+ .forEach((item, i, arr) => {
|
|
|
+ if (
|
|
|
+ item.name == '高危' ||
|
|
|
+ item.name == '危急值提醒' ||
|
|
|
+ item.name == '其他提醒'
|
|
|
+ ) {
|
|
|
+ planDefaultList.splice(arr.length - 1 - i, 1);
|
|
|
+ planDefaultList
|
|
|
+ .find(items => {
|
|
|
+ return items.name == '开单合理性';
|
|
|
+ })
|
|
|
+ .arr.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.planDefaultList = planDefaultList;
|
|
|
this.switchSubStatus =
|
|
|
res.data.data &&
|
|
|
res.data.data.planDetailDefault.length !== 0 &&
|
|
@@ -414,7 +506,6 @@ export default {
|
|
|
res.data.data.planDetailDefault[0].planDetails;
|
|
|
}
|
|
|
let res1 = await api.getPlanInfoIds(params);
|
|
|
- console.log(res1, '==================');
|
|
|
if (res1.data.code === '0') {
|
|
|
newPlan = res1.data.data[0].sysSetInfo[0].planDetails;
|
|
|
this.form.planName = res1.data.data[0].planName;
|
|
@@ -449,16 +540,63 @@ export default {
|
|
|
}
|
|
|
// console.log(endArr,'-=-=-=-=-=');
|
|
|
this.planDefaultList = endArr;
|
|
|
+ let planDefaultList = this.planDefaultList.map((item, index) => {
|
|
|
+ if (
|
|
|
+ item.name == '高危' ||
|
|
|
+ item.name == '危急值提醒' ||
|
|
|
+ item.name == '其他提醒'
|
|
|
+ ) {
|
|
|
+ return {
|
|
|
+ ismove: false,
|
|
|
+ ...item
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ arr: [],
|
|
|
+ ismove: true,
|
|
|
+ ...item
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ planDefaultList
|
|
|
+ .slice()
|
|
|
+ .reverse()
|
|
|
+ .forEach((item, i, arr) => {
|
|
|
+ if (
|
|
|
+ item.name == '高危' ||
|
|
|
+ item.name == '危急值提醒' ||
|
|
|
+ item.name == '其他提醒'
|
|
|
+ ) {
|
|
|
+ planDefaultList.splice(arr.length - 1 - i, 1);
|
|
|
+ planDefaultList
|
|
|
+ .find(items => {
|
|
|
+ return items.name == '开单合理性';
|
|
|
+ })
|
|
|
+ .arr.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.planDefaultList = planDefaultList;
|
|
|
},
|
|
|
|
|
|
// format处理细项数据
|
|
|
handleSendData() {
|
|
|
+ this.planDefaultList.forEach((item, i) => {
|
|
|
+ if(item.name == '开单合理性'){
|
|
|
+ item.arr.slice().reverse().forEach(items => {
|
|
|
+ if (items.name == '高危' ||items.name == '危急值提醒' ||items.name == '其他提醒') {
|
|
|
+ console.log(i)
|
|
|
+ this.planDefaultList.splice(i+1, 0, items);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ item.arr = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(this.planDefaultList)
|
|
|
let TempPlanDetail = [];
|
|
|
TempPlanDetail = this.planDefaultList.map((item, index) => {
|
|
|
return {
|
|
|
code: item.code,
|
|
|
- hospitalId: this.form.hospitalId,
|
|
|
- // hospitalId: this.hospitalId,
|
|
|
+ hospitalId: this.hospitalId,
|
|
|
name: item.name,
|
|
|
number: item.number,
|
|
|
orderNo: item.orderNo,
|
|
@@ -469,18 +607,18 @@ export default {
|
|
|
};
|
|
|
});
|
|
|
return TempPlanDetail;
|
|
|
- // console.log(TempPlanDetail, 'TempPlanDetail');
|
|
|
+ console.log(TempPlanDetail, 'TempPlanDetail');
|
|
|
},
|
|
|
|
|
|
// 处理保存活动信息参数
|
|
|
_getParams() {
|
|
|
let params = {
|
|
|
- hospitalId: this.form.hospitalId,
|
|
|
+ hospitalId: this.hospitalId,
|
|
|
planCode: this.form.planCode,
|
|
|
planDetailParent: [
|
|
|
{
|
|
|
code: 'auxiliary',
|
|
|
- hospitalId: this.form.hospitalId,
|
|
|
+ hospitalId: this.hospitalId,
|
|
|
name: '辅助信息',
|
|
|
number: 0,
|
|
|
orderNo: 1,
|
|
@@ -489,7 +627,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
code: 'medical',
|
|
|
- hospitalId: this.form.hospitalId,
|
|
|
+ hospitalId: this.hospitalId,
|
|
|
name: '医学知识',
|
|
|
orderNo: 3,
|
|
|
planDetailSub: [{}],
|
|
@@ -497,7 +635,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
code: 'followup',
|
|
|
- hospitalId: this.form.hospitalId,
|
|
|
+ hospitalId: this.hospitalId,
|
|
|
name: '随访计划',
|
|
|
orderNo: 4,
|
|
|
planDetailSub: [{}],
|