Commit 56db58d3 by wangshuangqing

1.默认展示选择项

2.调用调用医嘱接口
3.获取选择的数据
parent aa1953ff
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wsq * @Author: wsq
* @Date: 2022-04-22 15:20:58 * @Date: 2022-04-22 15:20:58
* @LastEditors: wsq * @LastEditors: wsq
* @LastEditTime: 2023-01-11 15:25:24 * @LastEditTime: 2023-01-11 23:19:56
* @Description: * @Description:
--> -->
<template> <template>
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
> >
<span <span
:class=" :class="
timeindex == index timeindex == activity.inhosdays
? 'outClinicalpathway_table_left_timespan' ? 'outClinicalpathway_table_left_timespan'
: 'outClinicalpathway_table_left_timespan2' : 'outClinicalpathway_table_left_timespan2'
" "
...@@ -195,6 +195,7 @@ export default { ...@@ -195,6 +195,7 @@ export default {
}, },
//路径天数下拉数据 //路径天数下拉数据
options: [], options: [],
chickid: [], //选中的id
}); });
//获取患者信息 //获取患者信息
const gettopdata = () => { const gettopdata = () => {
...@@ -227,6 +228,8 @@ export default { ...@@ -227,6 +228,8 @@ export default {
return row.id === el.id; return row.id === el.id;
}) })
) { ) {
// console.log("选中-row", row);
row.ischeck = 1;
if (row.children) { if (row.children) {
row.children.map((j) => { row.children.map((j) => {
toggleSelection(j, true); toggleSelection(j, true);
...@@ -234,8 +237,13 @@ export default { ...@@ -234,8 +237,13 @@ export default {
} }
//取消 //取消
} else { } else {
// console.log("取消-row", row);
//取消的行数据
row.ischeck = 2;
if (row.children) { if (row.children) {
row.children.map((j) => { row.children.map((j) => {
j.ischeck = 2;
toggleSelection(j, false); toggleSelection(j, false);
}); });
} }
...@@ -244,10 +252,17 @@ export default { ...@@ -244,10 +252,17 @@ export default {
// 控制选框是否被选中 // 控制选框是否被选中
const toggleSelection = (row, select) => { const toggleSelection = (row, select) => {
if (row) { if (row) {
// console.log("row-亮", row);
nextTick(() => { nextTick(() => {
multipleTable.value && multipleTable.value &&
multipleTable.value.toggleRowSelection(row, select); multipleTable.value.toggleRowSelection(row, select);
}); });
if (select == true) {
row.ischeck = 1;
} else {
row.ischeck = 2;
}
} }
}; };
...@@ -286,13 +301,10 @@ export default { ...@@ -286,13 +301,10 @@ export default {
//当选择项发生变化时会触发该事件 //当选择项发生变化时会触发该事件
const SelectionChange = (val) => { const SelectionChange = (val) => {
state.multipleSelection = val; state.multipleSelection = val;
console.log('val',val); // console.log("val", val);
}; };
// console.log("state.multipleSelection", state.multipleSelection);
//获取左侧时间线数据 //获取左侧时间线数据
const getlefttime = () => { const getlefttime = () => {
...@@ -303,13 +315,14 @@ export default { ...@@ -303,13 +315,14 @@ export default {
) )
.then((data) => { .then((data) => {
state.activities = data; state.activities = data;
// console.log("state.activities", state.activities);
state.options = data; state.options = data;
}) })
.catch((error) => {}); .catch((error) => {});
}; };
//点击左侧时间线 获取右侧表格数据 //点击左侧时间线 获取右侧表格数据
const timeclick = (val, index) => { const timeclick = (val, index) => {
state.timeindex = index; state.timeindex = val.inhosdays;
state.case_routeid = val.case_routeid; state.case_routeid = val.case_routeid;
state.inhosdays = val.inhosdays; state.inhosdays = val.inhosdays;
http http
...@@ -319,27 +332,33 @@ export default { ...@@ -319,27 +332,33 @@ export default {
) )
.then((data) => { .then((data) => {
state.tableData = data; state.tableData = data;
// console.log(" state.tableData", state.tableData);
state.tableData.map((el) => {
// console.log(" el",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);
}
}
}
});
}) })
.catch((error) => {}); .catch((error) => {});
}; };
//加入医嘱 //加入医嘱
const joinorder = () => { const joinorder = () => {
// console.log("加入按钮-tabledata", state.tableData);
http http
.post( .post(
`/ClinicalRoute/ClinicalRoute/SetPatientRoutes?pid=${route.value.query.pid}`, `/ClinicalRoute/ClinicalRoute/SetPatientRoutes?pid=${route.value.query.pid}`,
state.selectArr state.tableData
) )
.then((data) => { .then((data) => {
// 重新加载表格数据接口 //重新获取左侧时间线数据
http getlefttime();
.post(
`/ClinicalRoute/ClinicalRoute/GetGetRouteAdvicesRight?pid=${route.value.query.pid}&case_routeid=${state.case_routeid}&searchQuery=${state.inhosdays}`,
{}
)
.then((data) => {
state.tableData = data;
})
.catch((error) => {});
Message({ Message({
message: data.message, message: data.message,
type: "success", type: "success",
......
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