Commit 307d754b by wangshuangqing

点击展示修改框

parent 31f28c0e
......@@ -2,7 +2,7 @@
* @Author: wsq
* @Date: 2022-04-22 15:20:58
* @LastEditors: wsq
* @LastEditTime: 2023-01-30 13:51:13
* @LastEditTime: 2023-01-31 17:53:02
* @Description:
-->
<template>
......@@ -142,7 +142,7 @@
default-expand-all
>
<el-table-column type="selection" width="55" />
<el-table-column label="医嘱类型" width="180">
<el-table-column label="医嘱类型" width="180" fixed="left">
<template #default="scope">{{ yztype[scope.row.type] }}</template>
</el-table-column>
<el-table-column
......@@ -150,24 +150,28 @@
property="advice_name"
label="路径名称"
width="150"
fixed="left"
/>
<el-table-column
show-overflow-tooltip
property="project_code"
label="医院项目编码"
width="120"
fixed="left"
/>
<el-table-column
show-overflow-tooltip
property="project_name"
label="医院项目名称"
width="150"
fixed="left"
/>
<el-table-column
show-overflow-tooltip
property="specifications"
label="规格说明"
width="150"
/>
<el-table-column
show-overflow-tooltip
......@@ -181,10 +185,11 @@
width="110"
>
<template #default="scope">
<span v-if="tableIndex != scope.$index">{{
scope.row.isAntibiotic
}}</span>
<el-select v-else size="mini" v-model="scope.row.isAntibiotic">
<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"
......@@ -193,19 +198,18 @@
>
</el-option>
</el-select>
<span v-else>{{ scope.row.isAntibiotic }}</span>
</template>
</el-table-column>
<el-table-column prop="medicUseQuantity" label="用量" width="120">
<template #default="scope">
<span v-if="tableIndex != scope.$index">{{
scope.row.medicUseQuantity
}}</span>
<el-input
v-else
v-if="scope.row.advice_name == null && scope.row.ischeck == 1"
v-model="scope.row.medicUseQuantity"
size="mini"
placeholder="请输入内容"
></el-input>
<span v-else>{{ scope.row.medicUseQuantity }}</span>
</template>
</el-table-column>
<el-table-column
......@@ -226,28 +230,24 @@
<el-table-column prop="dropNumber" label="滴数" width="120">
<template #default="scope">
<span v-if="tableIndex != scope.$index">{{
scope.row.dropNumber
}}</span>
<el-input
v-else
v-if="scope.row.advice_name == null && scope.row.ischeck == 1"
v-model="scope.row.dropNumber"
size="mini"
placeholder="请输入内容"
></el-input>
<span v-else>{{ scope.row.dropNumber }}</span>
</template>
</el-table-column>
<el-table-column prop="medicQuantity" label="用药总量" width="120">
<template #default="scope">
<span v-if="tableIndex != scope.$index">{{
scope.row.medicQuantity
}}</span>
<el-input
v-else
v-if="scope.row.advice_name == null && scope.row.ischeck == 1"
v-model="scope.row.medicQuantity"
size="mini"
placeholder="请输入内容"
></el-input>
<span v-else>{{ scope.row.medicQuantity }}</span>
</template>
</el-table-column>
<el-table-column
......@@ -259,35 +259,18 @@
show-overflow-tooltip
property="remark"
label="嘱托"
/>
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
<div
class="table_handle"
v-show="tableIndex != scope.$index"
v-if="scope.row.advice_name == null"
>
<el-button
size="mini"
type="info"
@click="edit(scope.row, scope.$index)"
>编辑</el-button
>
</div>
<div class="table_handle" v-show="tableIndex == scope.$index">
<el-button
size="mini"
type="primary"
@click="confirm(scope.row, scope.$index)"
>确定</el-button
width="400'"
>
<el-button
<template #default="scope">
<el-input
v-if="scope.row.advice_name == null && scope.row.ischeck == 1"
v-model="scope.row.remark"
size="mini"
type="primary"
@click="cancel(scope.row, scope.$index)"
>取消</el-button
>
</div>
type="textarea"
:autosize="{ minRows: 2 }"
placeholder="请输入内容"
></el-input>
<span v-else>{{ scope.row.remark }}</span>
</template>
</el-table-column>
</el-table>
......@@ -356,8 +339,6 @@ export default {
crid: null,
chickid: [], //选中的id
tableIndex: -1,
tempRow: {}, //储存正在编辑的行
chargeTypeoptions: [
{
label: "是",
......@@ -366,27 +347,10 @@ export default {
label: "否",
},
],
tempRow: {}, //储存正在编辑的行
tempRowChildren: [],
});
//编辑
const edit = (row, index) => {
console.log("row", row);
state.tableIndex = index;
state.tempRow = _.cloneDeep(row);
console.log("state.tempRow ", state.tempRow);
};
//取消
const cancel = (row, index) => {
if (!row.id) {
//如果为空,删除当前行
state.tableData.splice(index, 1); //前端删除
} else {
state.tableData[index] = state.tempRow;
}
state.tableIndex = -1;
};
//获取患者信息
const gettopdata = () => {
http
......@@ -414,30 +378,61 @@ export default {
// 选中父节点时,子节点一起选中取消
const select = (selection, row) => {
console.log("row--父节点", row);
// 选中
if (
selection.some((el) => {
return row.id === el.id;
})
) {
// console.log("选中-row", row);
row.ischeck = 1;
state.tempRow = _.cloneDeep(row);
if (row.children) {
for (let a = 0; a < row.children.length; a++) {
state.tempRowChildren = _.cloneDeep(row.children[a]);
console.log("state.tempRowChildren[a]", state.tempRowChildren);
}
row.children.map((j) => {
toggleSelection(j, true);
});
}
//取消
} else {
// console.log("取消-row", row);
//取消的行数据
row.ischeck = 2;
if (row.children) {
row.children.map((j) => {
j.ischeck = 2;
toggleSelection(j, false);
row.children.map((p) => {
p.ischeck = 2;
// for (var i = 0; i < state.tableData.length; i++) {
// if (state.tableData[i].children.length > 0) {
// for (let j = 0; j < state.tableData[i].children.length; j++) {
// if (state.tableData[i].children[j].id == p.id) {
// state.tableData[i].children[j] =
// state.tempRowChildren[j - 1];
// console.log("p.id", p.id);
// console.log(
// "state.tempRowChildren[j-1]",
// state.tempRowChildren[j - 1]
// );
// }
// }
// }
// }
toggleSelection(p, false);
});
} else {
//取消选中 还原数据
for (var i = 0; i < state.tableData.length; i++) {
if (state.tableData[i].children.length > 0) {
for (let j = 0; j < state.tableData[i].children.length; j++) {
if (state.tableData[i].children[j].id == row.id) {
state.tableData[i].children[j] = state.tempRow;
}
}
}
}
//取消的行数据
row.ischeck = 2;
}
}
};
......@@ -493,7 +488,6 @@ export default {
//当选择项发生变化时会触发该事件
const SelectionChange = (val) => {
state.multipleSelection = val;
// console.log("val", val);
};
//获取左侧时间线数据
......@@ -551,12 +545,12 @@ export default {
state.inhosdays = val.inhosdays;
http
.post(
`/ClinicalRoute/ClinicalRoute/GetGetRouteAdvicesRight?pid=${route.value.query.pid}&case_routeid=${val.case_routeid}&searchQuery=${val.inhosdays}`,
`/ClinicalRoute/ClinicalRoute/GetGetRouteAdvicesRight?pid=${route.value.query.pid}&case_routeid=${state.case_routeid}&searchQuery=${state.inhosdays}`,
{}
)
.then((data) => {
state.tableData = data;
// console.log(" state.tableData", state.tableData);
state.tableData.map((el) => {
// console.log(" el",el);
if (el.children) {
......@@ -573,7 +567,7 @@ export default {
};
//加入医嘱
const joinorder = () => {
// console.log("加入按钮-tabledata", state.tableData);
console.log("加入按钮-tabledata", state.tableData);
http
.post(
`/ClinicalRoute/ClinicalRoute/SetPatientRoutes?pid=${route.value.query.pid}`,
......@@ -683,8 +677,7 @@ export default {
joinorder,
getreasonoptions,
getTitle,
edit,
cancel,
confirm,
};
},
};
......@@ -869,7 +862,7 @@ export default {
width: 100%;
display: flex;
&_left {
width: 15%;
width: 10%;
height: 100%;
margin-right: 5px;
background-color: #ffff;
......@@ -888,7 +881,7 @@ export default {
}
}
&_right {
width: 84%;
width: 89%;
height: 100%;
// overflow: scroll;
}
......
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