Commit 9d0cd01c by tangyufeng

表格

parent ff9757fd
<!--
* @Author: wsq
* @Date: 2022-04-22 15:20:58
* @LastEditors: wsq
* @LastEditTime: 2023-03-02 20:36:22
* @Description:
-->
<template>
<!-- 临床路径外放页面 -->
<div class="outClinicalpathway">
<!-- 患者信息 -->
<div class="outClinicalpathway_top">
<div class="outClinicalpathway_top_bg"></div>
<div class="outClinicalpathway_top_coent">
<!--患者信息 -->
<div class="outClinicalpathway_top_coent_left">
<div class="outClinicalpathway_top_coent_left_one">
<span><img src="../assets/img/peo.png" alt="" /></span>
<div class="outClinicalpathway_top_coent_left_one_t1">
患者姓名:<span>{{ topdata.patientName }}</span>
</div>
<div class="outClinicalpathway_top_coent_left_one_t2">
住院号:<span>{{ topdata.regCode }}</span>
</div>
<div class="outClinicalpathway_top_coent_left_one_t3">
住院次数:<span>{{ topdata.inHosNum }}</span>
</div>
<div class="outClinicalpathway_top_coent_left_one_t4">
符合临床路径:<span>{{ topdata.clinical_route_name }}</span>
</div>
</div>
</div>
<div class="outClinicalpathway_top_coent_right">
<div class="outClinicalpathway_top_coent_right_btn">
<el-button icon="el-icon-user" style="background-color: #0283bb; color: #ffff" @click="joinorder()">保存医嘱</el-button>
<el-button icon="el-icon-s-tools" style="background-color: #0283bb; color: #ffff" @click="variation()">病情变异</el-button>
</div>
</div>
</div>
<div class="outClinicalpathway_top_time">
<el-timeline style="display: flex; padding: 0 10px">
<el-timeline-item
:class="timeindex == activity.inhosdays ? 'outClinicalpathway_top_time_timespan' : 'outClinicalpathway_top_time_timespan2'"
v-for="(activity, index) in activities"
:key="index"
:type="activity.type"
:color="activity.color"
:size="activity.size"
:hollow="activity.hollow"
:timestamp="activity.timestamp"
>
<el-tooltip class="item" effect="dark" :content="activity.inhosdays" placement="top-start" v-if="activity.inhosdays.length > 7">
<span @click="timeclick(activity)">{{ activity.inhosdays }}</span>
</el-tooltip>
<span v-else @click="timeclick(activity)">{{ activity.inhosdays }}</span>
</el-timeline-item>
</el-timeline>
</div>
</div>
<!--病情变异弹框开始 -->
<el-dialog :visible.sync="editdialogFormVisible" width="30%" @close="close">
<el-form ref="fromRef" :model="form" :label-position="labelPosition" label-width="100px">
<el-form-item label="路径天数:">
<!-- <el-input v-model="form.inhosdays" /> -->
<el-select v-model="form.inhosdays" class="m-2" placeholder="请选择" size="mini">
<el-option v-for="item in options" :key="item.inhosdays" :label="item.inhosdays" :value="item.inhosdays" />
</el-select>
</el-form-item>
<el-form-item label="变异原因:">
<el-select v-model="form.reason" class="m-2" placeholder="请选择" size="mini" :title="getTitle(form.reason)">
<el-option v-for="item in reasonoptions" :key="item.id" :label="item.describe" :value="item.describe" :title="item.describe">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注:">
<el-input v-model="form.remarks" :autosize="{ minRows: 4, maxRows: 10 }" type="textarea" />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button size="mini" @click="close()">取消</el-button>
<el-button size="mini" type="primary" @click="fromOKbtn()">确定 </el-button>
</span>
</template>
</el-dialog>
<!--病情变异弹框结束 -->
<!-- 表格 -->
<div class="outClinicalpathway_table">
<!-- 表格 -->
<div class="outClinicalpathway_table_right">
<div class="outClinicalpathway_table_right_radio">
<el-radio-group :value="radio" @input="radiochange">
<el-radio :label="1">长期医嘱</el-radio>
<el-radio :label="2">临时医嘱</el-radio>
</el-radio-group>
</div>
<el-table
ref="multipleTable"
row-key="id"
:data="tableData"
height="100%"
style="width: 100%"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
:select-on-indeterminate="true"
@selection-change="SelectionChange"
@select-all="selectAll"
@select="select"
default-expand-all
size="mini"
:row-class-name="rowClass"
>
<el-table-column type="selection" :selectable="selectEnable" width="50" />
<el-table-column show-overflow-tooltip property="advice_name" label="路径名称" width="130" />
<el-table-column show-overflow-tooltip property="tickTime" label="当前时间" width="145">
<template #default="scope">
<span v-if="scope.row.advice_name == null && scope.row.ischeck == 1">{{ scope.row.tickTime }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip property="orderType" label="类型" width="50" />
<el-table-column show-overflow-tooltip property="project_name" label="医院项目名称" width="200" />
<el-table-column show-overflow-tooltip property="specifications" label="规格说明" width="80" />
<el-table-column show-overflow-tooltip property="dosage" label="药品剂型" width="70" />
<el-table-column show-overflow-tooltip property="isAntibiotic" label="抗生素" width="85">
<template #default="scope">
<el-select v-if="scope.row.advice_name == null && scope.row.ischeck == 1" size="mini" v-model="scope.row.isAntibiotic">
<el-option v-for="item in chargeTypeoptions" :key="item.label" :label="item.label" :value="item.label"> </el-option>
</el-select>
<span v-else>{{ scope.row.isAntibiotic }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip property="medicalPurpose" label="用药目的" width="135">
<template #default="scope">
<el-select v-if="scope.row.advice_name == null && scope.row.ischeck == 1" size="mini" v-model="scope.row.medicalPurpose">
<el-option v-for="item in medicalPurposeoptions" :key="item.id" :label="item.describe" :value="item.describe"> </el-option>
</el-select>
<span v-else>{{ scope.row.medicalPurpose }}</span>
</template>
</el-table-column>
<el-table-column prop="medicUseQuantity" label="用量" width="60">
<template #default="scope">
<el-input
v-if="scope.row.advice_name == null && scope.row.ischeck == 1"
v-model="scope.row.medicUseQuantity"
size="mini"
></el-input>
<span v-else>{{ scope.row.medicUseQuantity }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip property="medicUseUnit" label="单位" width="50" />
<el-table-column show-overflow-tooltip property="medicUseMode" label="途径" width="110">
<template #default="scope">
<el-select
v-if="scope.row.advice_name == null && scope.row.ischeck == 1"
size="mini"
v-model="scope.row.medicUseMode"
filterable
:filter-method="remoteMethod"
>
<el-option v-for="item in medicUseModeoptions" :key="item.id" :label="item.describe" :value="item.describe"> </el-option>
</el-select>
<span v-else>{{ scope.row.medicUseMode }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip property="medicUsePlan" label="频率" width="110">
<template #default="scope">
<el-select v-if="scope.row.advice_name == null && scope.row.ischeck == 1" size="mini" v-model="scope.row.medicUsePlan">
<el-option v-for="item in medicUsePlanoptions" :key="item.id" :label="item.describe" :value="item.describe"> </el-option>
</el-select>
<span v-else>{{ scope.row.medicUsePlan }}</span>
</template>
</el-table-column>
<el-table-column prop="dropNumber" label="滴数" width="60">
<template #default="scope">
<el-input v-if="scope.row.advice_name == null && scope.row.ischeck == 1" v-model="scope.row.dropNumber" size="mini"></el-input>
<span v-else>{{ scope.row.dropNumber }}</span>
</template>
</el-table-column>
<el-table-column prop="medicQuantity" label="用药总量" width="80">
<template #default="scope">
<el-input v-if="scope.row.advice_name == null && scope.row.ischeck == 1" v-model="scope.row.medicQuantity" size="mini"></el-input>
<span v-else>{{ scope.row.medicQuantity }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip property="medicUnit" label="单位" width="60" />
<el-table-column show-overflow-tooltip property="remark" label="嘱托" width="150'">
<template #default="scope">
<el-input
v-if="scope.row.advice_name == null && scope.row.ischeck == 1"
v-model="scope.row.remark"
size="mini"
type="textarea"
:autosize="{ minRows: 2 }"
placeholder="请输入内容"
></el-input>
<span v-else>{{ scope.row.remark }}</span>
</template>
</el-table-column>
<el-table-column prop="description" label="诊断描述" width="150">
<template #default="scope">
<!-- <div style="display: flex; height: 100%; flex-direction: column; justify-content: center; align-items: center">
<div style="display: flex">
<span
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
style="color: red"
>*</span
>
<el-input
size="mini"
validate-event
type="textarea"
:autosize="{ minRows: 2 }"
placeholder="请输入内容"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
v-model="scope.row.description"
></el-input>
</div>
<span
style="font-size: 12px; color: red"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.description == ''"
>请输入内容</span
>
</div> -->
<el-form
:model="scope.row"
label-width="15px"
label-position="left"
ref="numberValidateForm"
class="demo-ruleForm"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
>
<el-form-item prop="description" :rules="[{ required: true, message: '请输入内容' }]">
<template #label> <span></span></template>
<el-input
v-model="scope.row.description"
autocomplete="off"
placeholder="请输入内容"
type="textarea"
:autosize="{ minRows: 2 }"
></el-input>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column prop="symptom" label="症状及体征" width="150">
<template #default="scope">
<!-- <div style="display: flex; height: 100%; flex-direction: column; justify-content: center; align-items: center">
<div style="display: flex">
<span
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
style="color: red"
>*</span
>
<el-input
size="mini"
type="textarea"
:autosize="{ minRows: 2 }"
placeholder="请输入内容"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
v-model="scope.row.symptom"
></el-input>
</div>
<span
style="font-size: 12px; color: red"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.symptom == ''"
>请输入内容</span
>
</div> -->
<el-form
:model="scope.row"
label-width="15px"
label-position="left"
ref="numberValidateForm1"
class="demo-ruleForm"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
>
<el-form-item prop="symptom" :rules="[{ required: true, message: '请输入内容' }]">
<template #label> <span></span></template>
<el-input
v-model="scope.row.symptom"
autocomplete="off"
placeholder="请输入内容"
type="textarea"
:autosize="{ minRows: 2 }"
></el-input>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip property="emergency" label="急诊" width="85">
<template #default="scope">
<el-select
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.isedit"
size="mini"
v-model="scope.row.emergency"
>
<el-option v-for="item in chargeTypeoptions" :key="item.label" :label="item.label" :value="item.value"> </el-option>
</el-select>
<!-- <span v-else>{{ isObj[scope.row.emergency] }}</span> -->
</template>
</el-table-column>
<el-table-column label="操作" width="80">
<template #default="scope">
<el-button
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
size="mini"
type="primary"
@click="goSeeScore(scope.row, scope.$index, scope)"
>更多</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!-- 更多弹框开始 -->
<el-dialog :visible.sync="goSeeScoredialogFormVisible" width="30%" @close="goSeecolse">
<el-form ref="goSeefromRef" :model="goSeeform" :label-position="labelPosition" label-width="100px">
<el-form-item label="主诉:">
<el-input v-model="goSeeform.chiefComplaint" :autosize="{ minRows: 2 }" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="检查目的:">
<el-input v-model="goSeeform.inspectionPurpose" :autosize="{ minRows: 2 }" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="既往史:">
<el-input v-model="goSeeform.pastHistory" :autosize="{ minRows: 2 }" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="其他辅助项目:">
<el-input v-model="goSeeform.auxiliaryItems" :autosize="{ minRows: 2 }" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="备注:">
<el-input v-model="goSeeform.inspectRemarks" :autosize="{ minRows: 2 }" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button size="mini" @click="goSeecolse">取消</el-button>
<el-button size="mini" @click="goSeeok">确定 </el-button>
</span>
</template>
</el-dialog>
<!-- 更多弹框结束 -->
</div>
</template>
<script>
import http from "../utils/http";
import { reactive, toRefs, onMounted, nextTick, computed, ref } from "@vue/composition-api";
import { decimal } from "../utils/decimal";
import { img } from "../assets/img/zu.png";
import { Message } from "element-ui";
import { useRoute, useRouter } from "../utils/useVueRouter";
import { setItem, getItem } from "../utils/auth";
import { Loading } from "element-ui";
import _ from "lodash";
import { transformTimestampnow } from "../utils/formatTime";
import { format } from "echarts";
import M from "minimatch";
export default {
name: "outClinicalpathway",
setup() {
//表格自适应高度
const route = useRoute();
const router = useRouter();
const fromRef = ref();
const goSeefromRef = ref();
function tableLayout() {
nextTick(() => {
fromRef.value.doLayout();
});
}
const numberValidateForm = ref();
const numberValidateForm1 = ref();
const monthlyPlanTable = ref();
const multipleTable = ref();
const transformTime = computed(() => {
return transformTimestampnow;
});
let state = reactive({
//患者信息
topdata: {
patientName: "", //患者姓名
regCode: "", // 住院号
inHosNum: "", // 住院次数
clinical_route_name: "", // 符合临床路径
},
multipleSelection: [], //被选择的数据
multipleSelection1: [], //被选择的数据
selectArr: [],
tableData: [], //表格数据
yztype: {
1: "长期医嘱",
2: "临时医嘱",
},
isObj: {
0: "否",
1: "是",
},
//被点击的index
timeindex: null,
case_routeid: null, //点击左侧时间线的天数id
inhosdays: null, //点击左侧时间线的天数
//时间线
activities: [],
labelPosition: "right",
editdialogFormVisible: false, //弹框是否显示
//表单
form: {
inhosdays: "",
reason: "", //变异原因
remarks: "", //备注
},
//路径天数下拉数据
options: [],
reasonoptions: [], //变异原因
crid: null,
chickid: [], //选中的id
chargeTypeoptions: [
{
label: "是",
value: 1,
},
{
label: "否",
value: 0,
},
],
tempRow: {}, //储存正在编辑的行
tempRowChildren: [],
medicUseModeoptions: [], //途径
medicUseModeoptionsLise: [],
medicUsePlanoptions: [], //频率
medicalPurposeoptions: [], //用药目的
radio: 1,
newtable1: [],
newtable2: [],
objtable: { route1: [], route2: [] },
goSeeScoredialogFormVisible: false, //更多弹框
goSeeform: {},
oldRowObj: {},
goSeeIndex: "",
goSeeIndexPid: "",
distype: 1,
hisUrl: "", //his的接口地址
tempMedicalDrug: {},
tempMedicalcheck: {},
tempMedicalCheckout: {},
longMedical: {},
});
//表格禁用
const selectEnable = (row, rowIndex) => {
if (row.isForbidden == false) {
return false; // 不禁用
} else {
return true; //禁用
}
};
//表格当前行样式
const rowClass = ({ row, rowIndex }) => {
if (row.isClass) {
return "rowStyleclass";
} else {
return "";
}
};
//更多
const goSeeScore = (row) => {
state.distype = row.type;
state.oldRowObj = { ...row };
state.goSeeform = row;
state.goSeeScoredialogFormVisible = true;
// state.tableData.forEach((item, index) => {
// let childIndex = item.children.findIndex((v) => v.id == row.id);
// console.log(childIndex);
// if (childIndex !== -1) {
// state.goSeeIndexPid = index;
// state.goSeeIndex = childIndex;
// }
// });
};
//更多-取消
const goSeecolse = () => {
state.goSeeform = {};
// let childrenList = [...state.tableData[state.goSeeIndexPid].children];
// childrenList.splice(state.goSeeIndex, 1, state.oldRowObj);
// state.tableData[state.goSeeIndexPid].children = childrenList;
state.goSeeScoredialogFormVisible = false;
};
//更多--确定
const goSeeok = () => {
// let childrenList = [...state.tableData[state.goSeeIndexPid].children];
// childrenList.splice(state.goSeeIndex, 1, state.goSeeform);
// state.tableData[state.goSeeIndexPid].children = childrenList;
// console.log(state.tableData, 999);
// state.tableData.forEach((item) => {
// let childIndex = item.children.findIndex((v) => v.id == state.goSeeform.id);
// console.log(childIndex);
// if (childIndex !== -1) {
// item.children[childIndex] = state.goSeeform;
// }
// });
console.log(state.tableData);
if (state.radio == 1) {
state.multipleSelection[0] = state.goSeeform;
} else {
state.multipleSelection1[0] = state.goSeeform;
}
console.log(state.tableData);
console.log(state.multipleSelection);
console.log(state.multipleSelection1);
// toggleSelection(state.multipleSelection[0], true);
state.goSeeScoredialogFormVisible = false;
};
//获取途径,频率的下拉数据
const gemedicUseModeoptions = () => {
http.post(`/ClinicalRoute/ClinicalRoute/GetStaCRParametersByType?type=1`, {})
.then((data) => {
state.medicUseModeoptions = data;
state.medicUseModeoptionsLise = data;
})
.catch((error) => {});
};
const remoteMethod = (query) => {
if (query) {
state.medicUseModeoptions = state.medicUseModeoptions.filter((item) => {
return item.describe.toLowerCase().indexOf(query.toLowerCase()) > -1 || item.pinyin.toLowerCase().indexOf(query.toLowerCase()) > -1;
});
// setTimeout(() => {}, 200);
} else {
state.medicUseModeoptions = state.medicUseModeoptionsLise;
}
console.log(state.medicUseModeoptions);
};
//获取频率,频率的下拉数据
const gemedicUsePlanoptions = () => {
http.post(`/ClinicalRoute/ClinicalRoute/GetStaCRParametersByType?type=2`, {})
.then((data) => {
state.medicUsePlanoptions = data;
})
.catch((error) => {});
};
//获取用要目的下拉数据
const getmedicalPurposeoptions = () => {
http.post(`/ClinicalRoute/ClinicalRoute/GetStaCRParametersByType?type=3`, {})
.then((data) => {
state.medicalPurposeoptions = data;
})
.catch((error) => {});
};
//获取患者信息
const gettopdata = () => {
http.post(`/ClinicalRoute/ClinicalRoute/GetPatientInfo?pid=${route.value.query.pid}`, {})
.then((data) => {
state.topdata = data;
state.crid = data.crid;
getreasonoptions();
})
.catch((error) => {});
};
const setChildren = (children, type) => {
// 编辑多个子层级
children.map((j) => {
toggleSelection(j, type);
if (j.children) {
setChildren(j.children, type);
}
});
};
// 选中父节点时,子节点一起选中取消
const select = (selection, row) => {
row.tickTime = transformTimestampnow();
// 选中
if (
selection.some((el) => {
return row.id === el.id;
})
) {
row.ischeck = 1;
if (row.children) {
row.children
.filter((item) => item.isForbidden)
.map((j) => {
j.tickTime = transformTimestampnow();
j.edit = false;
console.log(j.type);
toggleSelection(j, true);
});
} else {
selection.map((v) => {
toggleSelection(v, true);
});
}
//取消
} else {
console.log(row);
if (row.children) {
row.children.map((p) => {
p.ischeck = 2;
p.isClass = false;
toggleSelection(p, false);
});
} else {
//取消的行数据
row.ischeck = 2;
}
}
};
// 控制选框是否被选中
const toggleSelection = (row, select) => {
if (row) {
console.log(row);
nextTick(() => {
multipleTable.value && multipleTable.value.toggleRowSelection(row, select);
});
if (select == true) {
row.ischeck = 1;
} else {
row.ischeck = 2;
row.isClass = false;
}
}
};
// 选择全部
const selectAll = (selection) => {
// tabledata第一层只要有在selection里面就是全选
const isSelect = selection.some((el) => {
const tableDataIds = state.tableData.map((j) => j.id);
return tableDataIds.includes(el.id);
});
// tableDate第一层只要有不在selection里面就是全不选
const isCancel = !state.tableData.every((el) => {
const selectIds = selection.map((j) => j.id);
return selectIds.includes(el.id);
});
if (isSelect) {
selection.map((el) => {
if (el.children) {
el.children
.filter((item) => item.isForbidden)
.map((j) => {
toggleSelection(j, true);
});
}
});
}
if (isCancel) {
state.tableData.map((el) => {
if (el.children) {
el.children.map((j) => {
toggleSelection(j, false);
});
}
});
}
};
//当选择项发生变化时会触发该事件
const SelectionChange = (val) => {
// state.multipleSelection = val;
console.log(val.length + "选中的数据");
console.log(val.pop());
if (state.radio == 1) {
state.multipleSelection = val.filter((item) => !item.children).sort((a, b) => a.sort - b.sort);
} else {
state.multipleSelection1 = val.filter((item) => !item.children).sort((a, b) => a.sort - b.sort);
}
if (state.multipleSelection.length) {
state.multipleSelection
.filter((item) => item.type != 1)
.map((item, index) => {
index == 0 ? (item.isedit = true) : (item.isedit = false);
});
}
if (state.multipleSelection1.length) {
state.multipleSelection1
.filter((item) => item.type != 1)
.map((item, index) => {
index == 0 ? (item.isedit = true) : (item.isedit = false);
});
}
};
//获取左侧时间线数据
const getlefttime = () => {
http.post(`/ClinicalRoute/ClinicalRoute/GetGetRouteAdvicesLeft?pid=${route.value.query.pid}`, {})
.then((data) => {
state.activities = data;
state.options = data;
if (state.activities.filter((item) => item.flag).length == state.activities.length) {
state.timeindex = state.activities[state.activities.length - 1].inhosdays;
timeclick(state.activities[state.activities.length - 1]);
}
if (state.activities.filter((item) => !item.flag).length == state.activities.length) {
state.timeindex = state.activities[0].inhosdays;
timeclick(state.activities[0]);
} else {
state.timeindex = state.activities.filter((item) => !item.flag)[0].inhosdays;
timeclick(state.activities.filter((item) => !item.flag)[0]);
}
})
.catch((error) => {
console.log(error);
});
};
//获取标识
const getIsRoute = () => {
http.post(`/ClinicalRoute/ClinicalRoute/IsRoute?pid=${route.value.query.pid}`, {})
.then((data) => {
console.log(data);
if (data) {
router.push({
path: "Entrypath",
query: {
pid: route.value.query.pid,
},
});
}
})
.catch((error) => {});
};
const getTableData = () => {
http.post(
`/ClinicalRoute/ClinicalRoute/GetGetRouteAdvicesRight?pid=${route.value.query.pid}&case_routeid=${state.case_routeid}&searchQuery=${state.inhosdays}`,
{}
)
.then((data) => {
data.route1.forEach((element) => {
if (element.children) {
element.children.map((el, i) => {
el.sort = i++;
});
}
});
data.route2.forEach((element) => {
if (element.children) {
element.children.map((el, i) => {
el.sort = i++;
});
}
});
state.newtable1 = data.route1;
state.newtable2 = data.route2;
if (state.radio == 1) {
state.tableData = data.route1;
// state.tableData.map((el) => {
// if (el.children) {
// for (let i = 0; i < el.children.length; i++) {
// if (el.children[i].ischeck == 1) {
// toggleSelection(el.children[i], true);
// toggleSelection(el, true);
// }
// }
// }
// });
// state.newtable1 = state.tableData;
} else if (state.radio == 2) {
state.tableData = data.route2;
// state.tableData.map((el) => {
// if (el.children) {
// for (let i = 0; i < el.children.length; i++) {
// if (el.children[i].ischeck == 1) {
// toggleSelection(el.children[i], true);
// toggleSelection(el, true);
// }
// }
// }
// });
// state.newtable2 = state.tableData;
}
})
.catch((error) => {
console.log(error);
});
};
//单选
const radiochange = (e) => {
if (numberValidateForm.value || numberValidateForm1.value) {
numberValidateForm.value.validate((valid) => {
if (valid) {
numberValidateForm1.value.validate((valid) => {
if (valid) {
state.radio = e;
if (state.radio == 1) {
state.tableData = state.newtable1;
state.multipleSelection.map((j) => {
toggleSelection(j, true);
});
} else {
state.tableData = state.newtable2;
state.multipleSelection1.map((p) => {
toggleSelection(p, true);
});
}
} else {
console.log("error submit!!");
return false;
}
});
} else {
console.log("error submit!!");
return false;
}
});
} else {
state.radio = e;
if (state.radio == 1) {
state.tableData = state.newtable1;
state.multipleSelection.map((j) => {
toggleSelection(j, true);
});
} else {
state.tableData = state.newtable2;
state.multipleSelection1.map((p) => {
toggleSelection(p, true);
});
}
}
};
//点击左侧时间线 获取右侧表格数据
const timeclick = (val) => {
state.timeindex = val.inhosdays;
state.case_routeid = val.case_routeid;
state.inhosdays = val.inhosdays;
getTableData();
};
//保存医嘱
const joinorder = () => {
if (state.multipleSelection.length || state.multipleSelection1.length) {
if (numberValidateForm.value || numberValidateForm1.value) {
numberValidateForm.value.validate((valid) => {
if (valid) {
numberValidateForm1.value.validate((valid) => {
if (valid) {
saveSetPatientRoutes();
} else {
console.log("error submit!!");
return false;
}
});
} else {
console.log("error submit!!");
return false;
}
});
} else {
saveSetPatientRoutes();
}
}
};
const msg = (s, m) => {
Message({
message: m,
type: s,
});
};
const saveSetPatientRoutes = () => {
state.objtable.route1 = state.multipleSelection;
state.objtable.route2 = state.multipleSelection1;
http.post(`/ClinicalRoute/ClinicalRoute/SetPatientRoutes?pid=${route.value.query.pid}`, state.objtable)
.then(async (data) => {
data.map((item) => {
if (item.code == "0") {
setTimeout(() => {
msg("success", item.msg);
}, 300);
} else {
setTimeout(() => {
msg("error", item.msg);
}, 300);
}
});
getlefttime();
})
.catch((error) => {});
};
//获取病情变异--变异原因下拉框
const getreasonoptions = () => {
http.post(`/ClinicalRoute/ClinicalRoute/GetStandardByType?crid=${state.crid}`, {})
.then((data) => {
state.reasonoptions = data;
})
.catch((error) => {});
};
//病情变异
const variation = () => {
state.editdialogFormVisible = true;
};
//确定
const fromOKbtn = (fromRef) => {
let prome = {
pid: route.value.query.pid,
reason: state.form.reason,
inhosdays: state.form.inhosdays,
remarks: state.form.remarks,
};
http.post(`/ClinicalRoute/ClinicalRoute/SetVariation`, prome)
.then((data) => {
Message({
message: data.message,
type: "success",
});
(state.form = {
inhosdays: "",
reason: "",
}),
(state.editdialogFormVisible = false);
router.push({
path: "Entrypath",
query: {
pid: route.value.query.pid,
},
});
})
.catch((error) => {});
};
//取消
const close = () => {
(state.form = {
inhosdays: "",
reason: "",
}),
(state.editdialogFormVisible = false);
};
//下拉框鼠标移上显示提示文字
const getTitle = (val) => {
if (val != "") {
let a = state.reasonoptions.filter((item) => item.describe == val);
return a[0].describe;
}
};
onMounted(() => {
getIsRoute();
gettopdata();
getlefttime();
gemedicUseModeoptions();
gemedicUsePlanoptions();
getmedicalPurposeoptions();
});
return {
...toRefs(state),
decimal,
monthlyPlanTable,
multipleTable,
SelectionChange,
gettopdata,
getlefttime,
timeclick,
setChildren,
select,
toggleSelection,
selectAll,
variation,
fromOKbtn,
fromRef,
numberValidateForm,
numberValidateForm1,
close,
joinorder,
getreasonoptions,
getTitle,
confirm,
tableLayout,
gemedicUseModeoptions,
gemedicUsePlanoptions,
radiochange,
getmedicalPurposeoptions,
transformTime,
goSeeok,
goSeeScore,
goSeefromRef,
goSeecolse,
selectEnable,
rowClass,
remoteMethod,
};
},
};
</script>
<style lang="scss" scoped>
@import "../styles/mixin.scss";
@import "../styles/media/components/outClinicalpathway.scss";
//选中当前行样式
::v-deep .rowStyleclass {
font-weight: 700;
background-color: #f5f7fa;
}
//时间线样式
::v-deep .el-timeline-item__tail {
left: 0 !important;
height: 0 !important;
}
::v-deep .el-timeline-item {
padding-bottom: 5px !important;
display: flex !important;
align-items: end !important;
}
::v-deep .el-timeline-item__wrapper {
padding-left: 29px !important;
margin-right: 30px !important;
top: 3px !important;
display: flex !important;
align-items: end !important;
.el-timeline-item__content {
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
text-overflow: ellipsis;
}
}
::v-deep .el-timeline-item__node--normal {
margin-left: 15px !important;
}
//单选框
::v-deep .el-radio__input.is-checked .el-radio__inner {
background-color: #0085ba !important;
border-color: #1097e0 !important;
}
::v-deep .el-radio__input.is-checked + .el-radio__label {
color: #0085ba !important;
}
//多选框选中状态背景颜色
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
background-color: #0085ba !important;
border-color: #1097e0 !important;
}
::v-deep .el-table--scrollable-x .el-table__body-wrapper {
height: 688px !important ;
overflow-y: auto !important;
}
// 滚动条的宽度
::v-deep .el-table__body-wrapper::-webkit-scrollbar {
/*滚动条整体样式*/
width: 10px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 10px;
background-color: #ffff;
}
// 滚动条的滑块
::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: #27aae2;
border: 3px solid transparent;
border-radius: 9px;
background-clip: content-box;
}
::v-deep .el-table__body-wrapper::-webkit-scrollbar-track {
/*滚动条里面轨道*/
border-radius: 20px;
background: #ffff;
width: 10px;
}
.outClinicalpathway {
// height: calc(100% - 50px);
// background-color: white;
// padding: 20px;
// position: relative;
// overflow: hidden;
height: 900px;
background-color: #f0f0f0;
// padding: 10px;
overflow: hidden;
position: relative;
&_top {
width: 100%;
height: 12%;
margin-bottom: 5px;
background-color: #f0f0f0;
display: flex;
flex-direction: column;
&_bg {
width: 100%;
height: 15%;
background-color: #0283bb;
}
&_coent {
width: 100%;
height: 50%;
background-color: #ffff;
display: flex;
margin-bottom: 5px;
&_left {
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
&_one {
width: 98%;
height: 80%;
background-color: #f2fafd;
margin-bottom: 10px;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 10px;
span {
width: 3%;
height: 100%;
font-size: 14px;
display: flex;
justify-content: center;
align-items: center;
}
&_t1 {
width: 24%;
height: 80%;
margin-right: 5px;
background-color: #ffff;
display: flex;
align-items: center;
color: #acacac;
font-weight: 400;
padding-left: 20px;
margin-left: 10px;
span {
width: 80%;
height: 80%;
color: #181617;
display: flex;
justify-content: flex-start;
align-items: center;
}
}
&_t2 {
width: 24%;
height: 80%;
margin-right: 5px;
background-color: #ffff;
display: flex;
align-items: center;
color: #acacac;
font-weight: 400;
padding-left: 20px;
span {
width: 80%;
height: 80%;
color: #181617;
display: flex;
justify-content: flex-start;
align-items: center;
}
}
&_t3 {
width: 24%;
height: 80%;
margin-right: 5px;
background-color: #ffff;
margin-right: 10px;
display: flex;
align-items: center;
color: #acacac;
font-weight: 400;
padding-left: 20px;
span {
width: 80%;
height: 80%;
color: #181617;
display: flex;
justify-content: flex-start;
align-items: center;
}
}
&_t4 {
width: 24%;
height: 80%;
background-color: #ffff;
margin-right: 5px;
display: flex;
align-items: center;
color: #acacac;
font-weight: 400;
padding-left: 20px;
span {
width: 60%;
height: 80%;
color: #181617;
display: flex;
justify-content: flex-start;
align-items: center;
}
}
}
}
&_right {
height: 100%;
width: 20%;
display: flex;
align-items: center;
justify-content: center;
&_btn {
height: 50%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
}
}
&_time {
width: 100%;
height: 35%;
background: #ffff;
padding-left: 20px;
display: flex;
align-items: center;
&_timespan {
max-width: 200px;
/* height: 20px; */
display: flex;
background-color: #0283bb;
border-radius: 20px;
margin-right: 10px;
span {
color: #ffff;
}
}
&_timespan2 {
max-width: 200px;
/* height: 20px; */
display: flex;
}
}
}
&_table {
height: 84%;
width: 100%;
display: flex;
&_right {
width: 100%;
height: 100%;
&_radio {
width: 100%;
height: 8%;
background: #ffff;
display: flex;
align-items: center;
padding-left: 10px;
}
}
}
/* .el-form-item {
margin: 0;
} */
}
</style>
...@@ -117,7 +117,20 @@ ...@@ -117,7 +117,20 @@
<span v-if="scope.row.advice_name == null && scope.row.ischeck == 1">{{ scope.row.tickTime }}</span> <span v-if="scope.row.advice_name == null && scope.row.ischeck == 1">{{ scope.row.tickTime }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column show-overflow-tooltip property="orderType" label="类型" width="50" /> <el-table-column show-overflow-tooltip property="orderType" label="类型" width="50">
<template #default="scope">
<div v-if="scope.row.orderType == '药疗'">
<i
@click="addRow(scope.row)"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1"
class="el-icon-circle-plus-outline"
style="font-size: 14px; color: #0283bb; margin-right: 5px; cursor: pointer"
></i
>{{ scope.row.orderType }}
</div>
<div v-else>{{ scope.row.orderType }}</div>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip property="project_name" label="医院项目名称" width="200" /> <el-table-column show-overflow-tooltip property="project_name" label="医院项目名称" width="200" />
...@@ -201,30 +214,6 @@ ...@@ -201,30 +214,6 @@
<el-table-column prop="description" label="诊断描述" width="150"> <el-table-column prop="description" label="诊断描述" width="150">
<template #default="scope"> <template #default="scope">
<!-- <div style="display: flex; height: 100%; flex-direction: column; justify-content: center; align-items: center">
<div style="display: flex">
<span
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
style="color: red"
>*</span
>
<el-input
size="mini"
validate-event
type="textarea"
:autosize="{ minRows: 2 }"
placeholder="请输入内容"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
v-model="scope.row.description"
></el-input>
</div>
<span
style="font-size: 12px; color: red"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.description == ''"
>请输入内容</span
>
</div> -->
<el-form <el-form
:model="scope.row" :model="scope.row"
label-width="15px" label-width="15px"
...@@ -248,28 +237,6 @@ ...@@ -248,28 +237,6 @@
</el-table-column> </el-table-column>
<el-table-column prop="symptom" label="症状及体征" width="150"> <el-table-column prop="symptom" label="症状及体征" width="150">
<template #default="scope"> <template #default="scope">
<!-- <div style="display: flex; height: 100%; flex-direction: column; justify-content: center; align-items: center">
<div style="display: flex">
<span
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
style="color: red"
>*</span
>
<el-input
size="mini"
type="textarea"
:autosize="{ minRows: 2 }"
placeholder="请输入内容"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.isedit"
v-model="scope.row.symptom"
></el-input>
</div>
<span
style="font-size: 12px; color: red"
v-if="scope.row.advice_name == null && scope.row.ischeck == 1 && scope.row.type != 1 && scope.row.symptom == ''"
>请输入内容</span
>
</div> -->
<el-form <el-form
:model="scope.row" :model="scope.row"
label-width="15px" label-width="15px"
...@@ -348,40 +315,13 @@ ...@@ -348,40 +315,13 @@
</template> </template>
<script> <script>
import http from "../utils/http"; import http from "../utils/http";
import { reactive, toRefs, onMounted, nextTick, computed, ref } from "@vue/composition-api";
import { decimal } from "../utils/decimal";
import { img } from "../assets/img/zu.png";
import { Message } from "element-ui"; import { Message } from "element-ui";
import { useRoute, useRouter } from "../utils/useVueRouter";
import { setItem, getItem } from "../utils/auth";
import { Loading } from "element-ui";
import _ from "lodash"; import _ from "lodash";
import { transformTimestampnow } from "../utils/formatTime"; import { transformTimestampnow } from "../utils/formatTime";
import { format } from "echarts";
import M from "minimatch";
export default { export default {
name: "outClinicalpathway", name: "outClinicalpathway",
setup() { data() {
//表格自适应高度 return {
const route = useRoute();
const router = useRouter();
const fromRef = ref();
const goSeefromRef = ref();
function tableLayout() {
nextTick(() => {
fromRef.value.doLayout();
});
}
const numberValidateForm = ref();
const numberValidateForm1 = ref();
const monthlyPlanTable = ref();
const multipleTable = ref();
const transformTime = computed(() => {
return transformTimestampnow;
});
let state = reactive({
//患者信息 //患者信息
topdata: { topdata: {
patientName: "", //患者姓名 patientName: "", //患者姓名
...@@ -448,139 +388,189 @@ export default { ...@@ -448,139 +388,189 @@ export default {
goSeeIndex: "", goSeeIndex: "",
goSeeIndexPid: "", goSeeIndexPid: "",
distype: 1, distype: 1,
hisUrl: "", //his的接口地址 cout: 0,
tempMedicalDrug: {}, };
tempMedicalcheck: {}, },
tempMedicalCheckout: {}, mounted() {
longMedical: {}, this.getIsRoute();
}); this.gettopdata();
this.getlefttime();
this.gemedicUseModeoptions();
this.gemedicUsePlanoptions();
this.getmedicalPurposeoptions();
},
methods: {
addRow(r) {
if (r.children == undefined) {
r.children = new Array();
}
const { cout } = this;
const newData = {
emergency: 0,
id: cout + 1000000,
isClass: false,
inhosdays: "",
isForbidden: true,
tickTime: "",
project_code: "15163",
project_name: "新增的",
ischeck: 2,
specifications: null,
stockID: null,
dosage: null,
isAntibiotic: "",
medicUseQuantity: 0.0,
medicUseUnit: null,
medicUseMode: null,
medicUsePlan: null,
medicQuantity: 1,
medicUnit: null,
remark: "",
inventoryNum: null,
orderType: "",
medicalPurpose: null,
price: null,
type: 1,
chiefComplaint: null,
inspectionPurpose: null,
symptom: null,
pastHistory: null,
auxiliaryItems: null,
inspectRemarks: null,
description: null,
};
this.cout = cout + 1;
r.children.push(newData);
console.log(r.children);
console.log(this.tableData);
},
//表格禁用 //表格禁用
const selectEnable = (row, rowIndex) => { selectEnable(row, rowIndex) {
if (row.isForbidden == false) { if (row.isForbidden == false) {
return false; // 不禁用 return false; // 不禁用
} else { } else {
return true; //禁用 return true; //禁用
} }
}; },
//表格当前行样式 //表格当前行样式
const rowClass = ({ row, rowIndex }) => { rowClass({ row, rowIndex }) {
if (row.isClass) { if (row.isClass) {
return "rowStyleclass"; return "rowStyleclass";
} else { } else {
return ""; return "";
} }
}; },
//更多 //更多
const goSeeScore = (row) => { goSeeScore(row) {
state.distype = row.type; this.distype = row.type;
state.oldRowObj = { ...row }; this.oldRowObj = { ...row };
state.goSeeform = row; this.goSeeform = row;
state.goSeeScoredialogFormVisible = true; this.goSeeScoredialogFormVisible = true;
// state.tableData.forEach((item, index) => { // this.tableData.forEach((item, index) => {
// let childIndex = item.children.findIndex((v) => v.id == row.id); // let childIndex = item.children.findIndex((v) => v.id == row.id);
// console.log(childIndex); // console.log(childIndex);
// if (childIndex !== -1) { // if (childIndex !== -1) {
// state.goSeeIndexPid = index; // this.goSeeIndexPid = index;
// state.goSeeIndex = childIndex; // this.goSeeIndex = childIndex;
// } // }
// }); // });
}; },
//更多-取消 //更多-取消
const goSeecolse = () => { goSeecolse() {
state.goSeeform = {}; this.goSeeform = {};
// let childrenList = [...state.tableData[state.goSeeIndexPid].children]; // let childrenList = [...this.tableData[this.goSeeIndexPid].children];
// childrenList.splice(state.goSeeIndex, 1, state.oldRowObj); // childrenList.splice(this.goSeeIndex, 1, this.oldRowObj);
// state.tableData[state.goSeeIndexPid].children = childrenList; // this.tableData[this.goSeeIndexPid].children = childrenList;
state.goSeeScoredialogFormVisible = false; this.goSeeScoredialogFormVisible = false;
}; },
//更多--确定 //更多--确定
const goSeeok = () => { goSeeok() {
// let childrenList = [...state.tableData[state.goSeeIndexPid].children]; // let childrenList = [...this.tableData[this.goSeeIndexPid].children];
// childrenList.splice(state.goSeeIndex, 1, state.goSeeform); // childrenList.splice(this.goSeeIndex, 1, this.goSeeform);
// state.tableData[state.goSeeIndexPid].children = childrenList; // this.tableData[this.goSeeIndexPid].children = childrenList;
// console.log(state.tableData, 999); // console.log(this.tableData, 999);
// state.tableData.forEach((item) => { // this.tableData.forEach((item) => {
// let childIndex = item.children.findIndex((v) => v.id == state.goSeeform.id); // let childIndex = item.children.findIndex((v) => v.id == this.goSeeform.id);
// console.log(childIndex); // console.log(childIndex);
// if (childIndex !== -1) { // if (childIndex !== -1) {
// item.children[childIndex] = state.goSeeform; // item.children[childIndex] = this.goSeeform;
// } // }
// }); // });
console.log(state.tableData); console.log(this.tableData);
if (state.radio == 1) { if (this.radio == 1) {
state.multipleSelection[0] = state.goSeeform; this.multipleSelection[0] = this.goSeeform;
} else { } else {
state.multipleSelection1[0] = state.goSeeform; this.multipleSelection1[0] = this.goSeeform;
} }
console.log(state.tableData); console.log(this.tableData);
console.log(state.multipleSelection); console.log(this.multipleSelection);
console.log(state.multipleSelection1); console.log(this.multipleSelection1);
// toggleSelection(state.multipleSelection[0], true); // toggleSelection(this.multipleSelection[0], true);
state.goSeeScoredialogFormVisible = false; this.goSeeScoredialogFormVisible = false;
}; },
//获取途径,频率的下拉数据 //获取途径,频率的下拉数据
const gemedicUseModeoptions = () => { gemedicUseModeoptions() {
http.post(`/ClinicalRoute/ClinicalRoute/GetStaCRParametersByType?type=1`, {}) http.post(`/ClinicalRoute/ClinicalRoute/GetStaCRParametersByType?type=1`, {})
.then((data) => { .then((data) => {
state.medicUseModeoptions = data; this.medicUseModeoptions = data;
state.medicUseModeoptionsLise = data; this.medicUseModeoptionsLise = data;
}) })
.catch((error) => {}); .catch((error) => {});
}; },
const remoteMethod = (query) => { remoteMethod(query) {
if (query) { if (query) {
state.medicUseModeoptions = state.medicUseModeoptions.filter((item) => { this.medicUseModeoptions = this.medicUseModeoptions.filter((item) => {
return item.describe.toLowerCase().indexOf(query.toLowerCase()) > -1 || item.pinyin.toLowerCase().indexOf(query.toLowerCase()) > -1; return item.describe.toLowerCase().indexOf(query.toLowerCase()) > -1 || item.pinyin.toLowerCase().indexOf(query.toLowerCase()) > -1;
}); });
// setTimeout(() => {}, 200); // setTimeout(() => {}, 200);
} else { } else {
state.medicUseModeoptions = state.medicUseModeoptionsLise; this.medicUseModeoptions = this.medicUseModeoptionsLise;
} }
console.log(state.medicUseModeoptions); console.log(this.medicUseModeoptions);
}; },
//获取频率,频率的下拉数据 //获取频率,频率的下拉数据
const gemedicUsePlanoptions = () => { gemedicUsePlanoptions() {
http.post(`/ClinicalRoute/ClinicalRoute/GetStaCRParametersByType?type=2`, {}) http.post(`/ClinicalRoute/ClinicalRoute/GetStaCRParametersByType?type=2`, {})
.then((data) => { .then((data) => {
state.medicUsePlanoptions = data; this.medicUsePlanoptions = data;
}) })
.catch((error) => {}); .catch((error) => {});
}; },
//获取用要目的下拉数据 //获取用要目的下拉数据
const getmedicalPurposeoptions = () => { getmedicalPurposeoptions() {
http.post(`/ClinicalRoute/ClinicalRoute/GetStaCRParametersByType?type=3`, {}) http.post(`/ClinicalRoute/ClinicalRoute/GetStaCRParametersByType?type=3`, {})
.then((data) => { .then((data) => {
state.medicalPurposeoptions = data; this.medicalPurposeoptions = data;
}) })
.catch((error) => {}); .catch((error) => {});
}; },
//获取患者信息 //获取患者信息
const gettopdata = () => { gettopdata() {
http.post(`/ClinicalRoute/ClinicalRoute/GetPatientInfo?pid=${route.value.query.pid}`, {}) http.post(`/ClinicalRoute/ClinicalRoute/GetPatientInfo?pid=${this.$route.query.pid}`, {})
.then((data) => { .then((data) => {
state.topdata = data; this.topdata = data;
state.crid = data.crid; this.crid = data.crid;
getreasonoptions(); this.getreasonoptions();
}) })
.catch((error) => {}); .catch((error) => {});
}; },
const setChildren = (children, type) => { setChildren(children, type) {
// 编辑多个子层级 // 编辑多个子层级
children.map((j) => { children.map((j) => {
toggleSelection(j, type); this.toggleSelection(j, type);
if (j.children) { if (j.children) {
setChildren(j.children, type); this.setChildren(j.children, type);
} }
}); });
}; },
// 选中父节点时,子节点一起选中取消 // 选中父节点时,子节点一起选中取消
const select = (selection, row) => { select(selection, row) {
row.tickTime = transformTimestampnow(); row.tickTime = transformTimestampnow();
// 选中 // 选中
if ( if (
...@@ -596,11 +586,11 @@ export default { ...@@ -596,11 +586,11 @@ export default {
j.tickTime = transformTimestampnow(); j.tickTime = transformTimestampnow();
j.edit = false; j.edit = false;
console.log(j.type); console.log(j.type);
toggleSelection(j, true); this.toggleSelection(j, true);
}); });
} else { } else {
selection.map((v) => { selection.map((v) => {
toggleSelection(v, true); this.toggleSelection(v, true);
}); });
} }
...@@ -611,20 +601,20 @@ export default { ...@@ -611,20 +601,20 @@ export default {
row.children.map((p) => { row.children.map((p) => {
p.ischeck = 2; p.ischeck = 2;
p.isClass = false; p.isClass = false;
toggleSelection(p, false); this.toggleSelection(p, false);
}); });
} else { } else {
//取消的行数据 //取消的行数据
row.ischeck = 2; row.ischeck = 2;
} }
} }
}; },
// 控制选框是否被选中 // 控制选框是否被选中
const toggleSelection = (row, select) => { toggleSelection(row, select) {
if (row) { if (row) {
console.log(row); console.log(row);
nextTick(() => { this.$nextTick(() => {
multipleTable.value && multipleTable.value.toggleRowSelection(row, select); this.$refs.multipleTable && this.$refs.multipleTable.toggleRowSelection(row, select);
}); });
if (select == true) { if (select == true) {
row.ischeck = 1; row.ischeck = 1;
...@@ -633,17 +623,17 @@ export default { ...@@ -633,17 +623,17 @@ export default {
row.isClass = false; row.isClass = false;
} }
} }
}; },
// 选择全部 // 选择全部
const selectAll = (selection) => { selectAll(selection) {
// tabledata第一层只要有在selection里面就是全选 // tabledata第一层只要有在selection里面就是全选
const isSelect = selection.some((el) => { const isSelect = selection.some((el) => {
const tableDataIds = state.tableData.map((j) => j.id); const tableDataIds = this.tableData.map((j) => j.id);
return tableDataIds.includes(el.id); return tableDataIds.includes(el.id);
}); });
// tableDate第一层只要有不在selection里面就是全不选 // tableDate第一层只要有不在selection里面就是全不选
const isCancel = !state.tableData.every((el) => { const isCancel = !this.tableData.every((el) => {
const selectIds = selection.map((j) => j.id); const selectIds = selection.map((j) => j.id);
return selectIds.includes(el.id); return selectIds.includes(el.id);
}); });
...@@ -653,95 +643,97 @@ export default { ...@@ -653,95 +643,97 @@ export default {
el.children el.children
.filter((item) => item.isForbidden) .filter((item) => item.isForbidden)
.map((j) => { .map((j) => {
toggleSelection(j, true); this.toggleSelection(j, true);
}); });
} }
}); });
} }
if (isCancel) { if (isCancel) {
state.tableData.map((el) => { this.tableData.map((el) => {
if (el.children) { if (el.children) {
el.children.map((j) => { el.children.map((j) => {
toggleSelection(j, false); this.toggleSelection(j, false);
}); });
} }
}); });
} }
}; },
//当选择项发生变化时会触发该事件 //当选择项发生变化时会触发该事件
const SelectionChange = (val) => { SelectionChange(val) {
// state.multipleSelection = val; // this.multipleSelection = val;
console.log(val.length + "选中的数据"); console.log(val.length + "选中的数据");
console.log(val.pop()); if (this.radio == 1) {
if (state.radio == 1) { this.multipleSelection = val.filter((item) => !item.children).sort((a, b) => a.sort - b.sort);
state.multipleSelection = val.filter((item) => !item.children).sort((a, b) => a.sort - b.sort);
} else { } else {
state.multipleSelection1 = val.filter((item) => !item.children).sort((a, b) => a.sort - b.sort); this.multipleSelection1 = val.filter((item) => !item.children).sort((a, b) => a.sort - b.sort);
} }
if (state.multipleSelection.length) { if (this.multipleSelection.length) {
state.multipleSelection this.multipleSelection
.filter((item) => item.type != 1) .filter((item) => item.type != 1)
.map((item, index) => { .map((item, index) => {
index == 0 ? (item.isedit = true) : (item.isedit = false); index == 0 ? (item.isedit = true) : (item.isedit = false);
}); });
} }
if (state.multipleSelection1.length) { if (this.multipleSelection1.length) {
state.multipleSelection1 this.multipleSelection1
.filter((item) => item.type != 1) .filter((item) => item.type != 1)
.map((item, index) => { .map((item, index) => {
index == 0 ? (item.isedit = true) : (item.isedit = false); index == 0 ? (item.isedit = true) : (item.isedit = false);
}); });
} }
}; },
//获取左侧时间线数据 //获取左侧时间线数据
const getlefttime = () => { getlefttime() {
http.post(`/ClinicalRoute/ClinicalRoute/GetGetRouteAdvicesLeft?pid=${route.value.query.pid}`, {}) http.post(`/ClinicalRoute/ClinicalRoute/GetGetRouteAdvicesLeft?pid=${this.$route.query.pid}`, {})
.then((data) => { .then((data) => {
state.activities = data; this.activities = data;
state.options = data; this.options = data;
if (state.activities.filter((item) => item.flag).length == state.activities.length) { if (this.activities.filter((item) => item.flag).length == this.activities.length) {
state.timeindex = state.activities[state.activities.length - 1].inhosdays; this.timeindex = this.activities[this.activities.length - 1].inhosdays;
timeclick(state.activities[state.activities.length - 1]); this.timeclick(this.activities[this.activities.length - 1]);
} }
if (state.activities.filter((item) => !item.flag).length == state.activities.length) { if (this.activities.filter((item) => !item.flag).length == this.activities.length) {
state.timeindex = state.activities[0].inhosdays; this.timeindex = this.activities[0].inhosdays;
timeclick(state.activities[0]); this.timeclick(this.activities[0]);
} else { } else {
state.timeindex = state.activities.filter((item) => !item.flag)[0].inhosdays; this.timeindex = this.activities.filter((item) => !item.flag)[0].inhosdays;
timeclick(state.activities.filter((item) => !item.flag)[0]); this.timeclick(this.activities.filter((item) => !item.flag)[0]);
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
}); });
}; },
//获取标识 //获取标识
const getIsRoute = () => { getIsRoute() {
http.post(`/ClinicalRoute/ClinicalRoute/IsRoute?pid=${route.value.query.pid}`, {}) http.post(`/ClinicalRoute/ClinicalRoute/IsRoute?pid=${this.$route.query.pid}`, {})
.then((data) => { .then((data) => {
console.log(data); console.log(data);
if (data) { if (data) {
router.push({ this.$router.push({
path: "Entrypath", path: "Entrypath",
query: { query: {
pid: route.value.query.pid, pid: this.$route.query.pid,
}, },
}); });
} }
}) })
.catch((error) => {}); .catch((error) => {});
}; },
const getTableData = () => { getTableData() {
http.post( http.post(
`/ClinicalRoute/ClinicalRoute/GetGetRouteAdvicesRight?pid=${route.value.query.pid}&case_routeid=${state.case_routeid}&searchQuery=${state.inhosdays}`, `/ClinicalRoute/ClinicalRoute/GetGetRouteAdvicesRight?pid=${this.$route.query.pid}&case_routeid=${this.case_routeid}&searchQuery=${this.inhosdays}`,
{} {}
) )
.then((data) => { .then((data) => {
data.route1.forEach((element) => { data.route1.forEach((element) => {
if (element.children) { if (element.children) {
element.children.map((el, i) => { element.children.map((el, i) => {
// if (el.orderType == "药疗") {
// el.children = [];
// }
el.sort = i++; el.sort = i++;
}); });
} }
...@@ -749,62 +741,45 @@ export default { ...@@ -749,62 +741,45 @@ export default {
data.route2.forEach((element) => { data.route2.forEach((element) => {
if (element.children) { if (element.children) {
element.children.map((el, i) => { element.children.map((el, i) => {
// if (el.orderType == "药疗") {
// el.children = [];
// }
el.sort = i++; el.sort = i++;
}); });
} }
}); });
state.newtable1 = data.route1; this.newtable1 = data.route1;
state.newtable2 = data.route2; this.newtable2 = data.route2;
if (state.radio == 1) { if (this.radio == 1) {
state.tableData = data.route1; this.tableData = data.route1;
// state.tableData.map((el) => { } else if (this.radio == 2) {
// if (el.children) { this.tableData = data.route2;
// for (let i = 0; i < el.children.length; i++) {
// if (el.children[i].ischeck == 1) {
// toggleSelection(el.children[i], true);
// toggleSelection(el, true);
// }
// }
// }
// });
// state.newtable1 = state.tableData;
} else if (state.radio == 2) {
state.tableData = data.route2;
// state.tableData.map((el) => {
// if (el.children) {
// for (let i = 0; i < el.children.length; i++) {
// if (el.children[i].ischeck == 1) {
// toggleSelection(el.children[i], true);
// toggleSelection(el, true);
// }
// }
// }
// });
// state.newtable2 = state.tableData;
} }
console.log(this.tableData);
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
}); });
}; },
//单选 //单选
const radiochange = (e) => { radiochange(e) {
if (numberValidateForm.value || numberValidateForm1.value) { if (this.$refs.numberValidateForm || this.$refs.numberValidateForm1) {
numberValidateForm.value.validate((valid) => { this.$refs.numberValidateForm.validate((valid) => {
if (valid) { if (valid) {
numberValidateForm1.value.validate((valid) => { this.$refs.numberValidateForm1.validate((valid) => {
if (valid) { if (valid) {
state.radio = e; this.radio = e;
if (state.radio == 1) { if (this.radio == 1) {
state.tableData = state.newtable1; this.tableData = this.newtable1;
state.multipleSelection.map((j) => { this.multipleSelection.map((j) => {
toggleSelection(j, true); this.toggleSelection(j, true);
}); });
} else { } else {
state.tableData = state.newtable2; this.tableData = this.newtable2;
state.multipleSelection1.map((p) => { this.multipleSelection1.map((p) => {
toggleSelection(p, true); this.toggleSelection(p, true);
}); });
} }
} else { } else {
...@@ -818,36 +793,38 @@ export default { ...@@ -818,36 +793,38 @@ export default {
} }
}); });
} else { } else {
state.radio = e; this.radio = e;
if (state.radio == 1) { if (this.radio == 1) {
state.tableData = state.newtable1; this.tableData = this.newtable1;
state.multipleSelection.map((j) => { this.multipleSelection.map((j) => {
toggleSelection(j, true); this.toggleSelection(j, true);
}); });
} else { } else {
state.tableData = state.newtable2; this.tableData = this.newtable2;
state.multipleSelection1.map((p) => { this.multipleSelection1.map((p) => {
toggleSelection(p, true); this.toggleSelection(p, true);
}); });
} }
} }
}; },
//点击左侧时间线 获取右侧表格数据 //点击左侧时间线 获取右侧表格数据
const timeclick = (val) => { timeclick(val) {
state.timeindex = val.inhosdays; this.timeindex = val.inhosdays;
state.case_routeid = val.case_routeid; this.case_routeid = val.case_routeid;
state.inhosdays = val.inhosdays; this.inhosdays = val.inhosdays;
getTableData(); this.getTableData();
}; },
//保存医嘱 //保存医嘱
const joinorder = () => { joinorder() {
if (state.multipleSelection.length || state.multipleSelection1.length) { console.log(this.multipleSelection);
if (numberValidateForm.value || numberValidateForm1.value) { console.log(this.multipleSelection1);
numberValidateForm.value.validate((valid) => { if (this.multipleSelection.length || this.multipleSelection1.length) {
if (this.$refs.numberValidateForm || this.$refs.numberValidateForm1) {
this.$refs.numberValidateForm.validate((valid) => {
if (valid) { if (valid) {
numberValidateForm1.value.validate((valid) => { this.$refs.numberValidateForm1.validate((valid) => {
if (valid) { if (valid) {
saveSetPatientRoutes(); this.saveSetPatientRoutes();
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; return false;
...@@ -859,59 +836,56 @@ export default { ...@@ -859,59 +836,56 @@ export default {
} }
}); });
} else { } else {
saveSetPatientRoutes(); this.saveSetPatientRoutes();
} }
} }
}; },
const msg = (s, m) => { msg(s, m) {
Message({ Message({
message: m, message: m,
type: s, type: s,
}); });
}; },
const saveSetPatientRoutes = () => { saveSetPatientRoutes() {
state.objtable.route1 = state.multipleSelection; this.objtable.route1 = this.multipleSelection;
state.objtable.route2 = state.multipleSelection1; this.objtable.route2 = this.multipleSelection1;
http.post(`/ClinicalRoute/ClinicalRoute/SetPatientRoutes?pid=${route.value.query.pid}`, state.objtable) http.post(`/ClinicalRoute/ClinicalRoute/SetPatientRoutes?pid=${this.$route.query.pid}`, this.objtable)
.then(async (data) => { .then(async (data) => {
data.map((item) => { data.map((item) => {
if (item.code == "0") { if (item.code == "0") {
setTimeout(() => { setTimeout(() => {
msg("success", item.msg); this.msg("success", item.msg);
}, 300); }, 300);
} else { } else {
setTimeout(() => { setTimeout(() => {
msg("error", item.msg); this.msg("error", item.msg);
}, 300); }, 300);
} }
}); });
getlefttime(); this.getlefttime();
}) })
.catch((error) => {}); .catch((error) => {});
}; },
//获取病情变异--变异原因下拉框 //获取病情变异--变异原因下拉框
const getreasonoptions = () => { getreasonoptions() {
http.post(`/ClinicalRoute/ClinicalRoute/GetStandardByType?crid=${state.crid}`, {}) http.post(`/ClinicalRoute/ClinicalRoute/GetStandardByType?crid=${this.crid}`, {})
.then((data) => { .then((data) => {
state.reasonoptions = data; this.reasonoptions = data;
}) })
.catch((error) => {}); .catch((error) => {});
}; },
//病情变异 //病情变异
const variation = () => { variation() {
state.editdialogFormVisible = true; this.editdialogFormVisible = true;
}; },
//确定 //确定
const fromOKbtn = (fromRef) => { fromOKbtn(fromRef) {
let prome = { let prome = {
pid: route.value.query.pid, pid: this.$route.value.query.pid,
reason: state.form.reason, reason: this.form.reason,
inhosdays: state.form.inhosdays, inhosdays: this.form.inhosdays,
remarks: state.form.remarks, remarks: this.form.remarks,
}; };
http.post(`/ClinicalRoute/ClinicalRoute/SetVariation`, prome) http.post(`/ClinicalRoute/ClinicalRoute/SetVariation`, prome)
...@@ -920,83 +894,36 @@ export default { ...@@ -920,83 +894,36 @@ export default {
message: data.message, message: data.message,
type: "success", type: "success",
}); });
(state.form = { (this.form = {
inhosdays: "", inhosdays: "",
reason: "", reason: "",
}), }),
(state.editdialogFormVisible = false); (this.editdialogFormVisible = false);
router.push({ this.$router.push({
path: "Entrypath", path: "Entrypath",
query: { query: {
pid: route.value.query.pid, pid: this.$route.query.pid,
}, },
}); });
}) })
.catch((error) => {}); .catch((error) => {});
}; },
//取消 //取消
const close = () => { close() {
(state.form = { (this.form = {
inhosdays: "", inhosdays: "",
reason: "", reason: "",
}), }),
(state.editdialogFormVisible = false); (this.editdialogFormVisible = false);
}; },
//下拉框鼠标移上显示提示文字 //下拉框鼠标移上显示提示文字
const getTitle = (val) => { getTitle(val) {
if (val != "") { if (val != "") {
let a = state.reasonoptions.filter((item) => item.describe == val); let a = this.reasonoptions.filter((item) => item.describe == val);
return a[0].describe; return a[0].describe;
} }
}; },
onMounted(() => {
getIsRoute();
gettopdata();
getlefttime();
gemedicUseModeoptions();
gemedicUsePlanoptions();
getmedicalPurposeoptions();
});
return {
...toRefs(state),
decimal,
monthlyPlanTable,
multipleTable,
SelectionChange,
gettopdata,
getlefttime,
timeclick,
setChildren,
select,
toggleSelection,
selectAll,
variation,
fromOKbtn,
fromRef,
numberValidateForm,
numberValidateForm1,
close,
joinorder,
getreasonoptions,
getTitle,
confirm,
tableLayout,
gemedicUseModeoptions,
gemedicUsePlanoptions,
radiochange,
getmedicalPurposeoptions,
transformTime,
goSeeok,
goSeeScore,
goSeefromRef,
goSeecolse,
selectEnable,
rowClass,
remoteMethod,
};
}, },
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment