Commit 3ca3d7e1 by 唐玉峰

总量逻辑计算

parent 52d163fc
...@@ -106,22 +106,11 @@ ...@@ -106,22 +106,11 @@
</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 { Message, MessageBox, Loading } from "element-ui";
import { decimal } from "../utils/decimal";
import { img } from "../assets/img/zu.png";
import { Message, MessageBox } from "element-ui";
import { useRoute, useRouter } from "../utils/useVueRouter";
import { setItem, getItem } from "../utils/auth";
import { Loading } from "element-ui";
export default { export default {
name: "Entrypath", name: "Entrypath",
setup() { data() {
//表格自适应高度 return {
const route = useRoute();
const router = useRouter();
let state = reactive({
//输入框 //输入框
pathinput: "", pathinput: "",
//选择框 //选择框
...@@ -144,76 +133,81 @@ export default { ...@@ -144,76 +133,81 @@ export default {
TwotableData: [], TwotableData: [],
//第三个表格 //第三个表格
TreetableData: [], TreetableData: [],
}); loadingOption1: {
// loading效果
const loadingOption1 = {
// 加载loading // 加载loading
fullscreen: true, fullscreen: true,
text: "正在加载...", text: "正在加载...",
spinner: "el-icon-loading", spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.5)", background: "rgba(0, 0, 0, 0.5)",
},
}; };
},
async mounted() {
this.getIsRoute();
await this.gettopdata();
this.getLeftdata();
},
methods: {
//获取标识 //获取标识
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) => {
state.IsRoute = data; this.IsRoute = 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;
//如果标识为false 跳转到临床路径外放页面 //如果标识为false 跳转到临床路径外放页面
if (this.IsRoute == false) {
if (state.IsRoute == false) { this.$router.push({
router.push({
path: "outClinicalpathway", path: "outClinicalpathway",
query: { query: {
pid: route.value.query.pid, pid: this.$route.query.pid,
}, },
}); });
} }
}) })
.catch((error) => {}); .catch((error) => {});
}; },
//显示推荐路径单选框变化 //显示推荐路径单选框变化
const checkchange = (val) => { checkchange(val) {
state.checked = val; this.checked = val;
}; },
//查询 //查询
const selectbtn = () => { selectbtn() {
getLeftdata(); this.getLeftdata();
}; },
//获取左侧表格数据 //获取左侧表格数据
const getLeftdata = () => { getLeftdata() {
http.post(`/ClinicalRoute/ClinicalRoute/GetPatientRoutes?pid=${route.value.query.pid}&searchQuery=${state.pathinput}&flag=${state.checked}`, {}) http.post(`/ClinicalRoute/ClinicalRoute/GetPatientRoutes?pid=${this.$route.query.pid}&searchQuery=${this.pathinput}&flag=${this.checked}`, {})
.then((data) => { .then((data) => {
state.LefttableData = data; this.LefttableData = data;
}) })
.catch((error) => {}); .catch((error) => {});
}; },
//点击左侧表格数据 //点击左侧表格数据
const rowclick = (row) => { rowclick(row) {
state.iscid = row.id; this.iscid = row.id;
var loadingInstance1 = Loading.service(loadingOption1); var loadingInstance1 = Loading.service(this.loadingOption1);
//获取右侧数据 //获取右侧数据
http.post(`/ClinicalRoute/ClinicalRoute/GetCRRuleDescribe?crid=${row.id}`, {}) http.post(`/ClinicalRoute/ClinicalRoute/GetCRRuleDescribe?crid=${row.id}`, {})
.then((data) => { .then((data) => {
state.OnetableData = data.diagInfo; //诊断信息 this.OnetableData = data.diagInfo; //诊断信息
state.TwotableData = data.opsInfo; this.TwotableData = data.opsInfo;
state.TreetableData = data.staCRStandards; this.TreetableData = data.staCRStandards;
loadingInstance1.close(); loadingInstance1.close();
}) })
.catch((error) => { .catch((error) => {
loadingInstance1.close(); loadingInstance1.close();
}); });
}; },
//点击进入路径按钮 //点击进入路径按钮
const okbtn = () => { okbtn() {
MessageBox.confirm( MessageBox.confirm(
"确定进入路径吗?", "确定进入路径吗?",
...@@ -224,22 +218,22 @@ export default { ...@@ -224,22 +218,22 @@ export default {
} }
) )
.then(() => { .then(() => {
if (state.iscid == 0) { if (this.iscid == 0) {
Message({ Message({
message: "请先选择路径名称!", message: "请先选择路径名称!",
type: "warning", type: "warning",
}); });
} else if (state.iscid != 0) { } else if (this.iscid != 0) {
http.post(`/ClinicalRoute/ClinicalRoute/CreatePatientRoute?pid=${route.value.query.pid}&crid=${state.iscid}`, {}) http.post(`/ClinicalRoute/ClinicalRoute/CreatePatientRoute?pid=${this.$route.query.pid}&crid=${this.iscid}`, {})
.then((data) => { .then((data) => {
Message({ Message({
message: "成功", message: "成功",
type: "success", type: "success",
}); });
router.push({ this.$router.push({
path: "outClinicalpathway", path: "outClinicalpathway",
query: { query: {
pid: route.value.query.pid, pid: this.$route.query.pid,
}, },
}); });
}) })
...@@ -252,25 +246,7 @@ export default { ...@@ -252,25 +246,7 @@ export default {
message: "取消", message: "取消",
}); });
}); });
}; },
onMounted(async () => {
getIsRoute();
await gettopdata();
getLeftdata();
});
return {
...toRefs(state),
gettopdata,
decimal,
getIsRoute,
getLeftdata,
rowclick,
okbtn,
checkchange,
selectbtn,
};
}, },
}; };
</script> </script>
......
...@@ -193,7 +193,12 @@ ...@@ -193,7 +193,12 @@
</el-table-column> </el-table-column>
<el-table-column prop="medicUseQuantity" label="用量" width="85"> <el-table-column prop="medicUseQuantity" label="用量" width="85">
<template #default="scope"> <template #default="scope">
<el-input v-if="scope.row.ischeck == 1 && scope.row.orderType" v-model="scope.row.medicUseQuantity" size="mini"></el-input> <el-input
v-if="scope.row.ischeck == 1 && scope.row.orderType"
v-model="scope.row.medicUseQuantity"
@input="setIput(scope.row, $event)"
size="mini"
></el-input>
<span v-else>{{ scope.row.medicUseQuantity }}</span> <span v-else>{{ scope.row.medicUseQuantity }}</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -215,7 +220,12 @@ ...@@ -215,7 +220,12 @@
</el-table-column> </el-table-column>
<el-table-column show-overflow-tooltip property="medicUsePlan" label="频率" width="130"> <el-table-column show-overflow-tooltip property="medicUsePlan" label="频率" width="130">
<template #default="scope"> <template #default="scope">
<el-select v-if="scope.row.ischeck == 1 && scope.row.orderType" size="mini" v-model="scope.row.medicUsePlan"> <el-select
v-if="scope.row.ischeck == 1 && scope.row.orderType"
size="mini"
v-model="scope.row.medicUsePlan"
@change="setIput(scope.row, $event)"
>
<el-option v-for="item in medicUsePlanoptions" :key="item.id" :label="item.describe" :value="item.describe"> </el-option> <el-option v-for="item in medicUsePlanoptions" :key="item.id" :label="item.describe" :value="item.describe"> </el-option>
</el-select> </el-select>
<span v-else>{{ scope.row.medicUsePlan }}</span> <span v-else>{{ scope.row.medicUsePlan }}</span>
...@@ -223,7 +233,12 @@ ...@@ -223,7 +233,12 @@
</el-table-column> </el-table-column>
<el-table-column prop="dropNumber" label="滴数" width="85"> <el-table-column prop="dropNumber" label="滴数" width="85">
<template #default="scope"> <template #default="scope">
<el-input v-if="scope.row.ischeck == 1 && scope.row.orderType" v-model="scope.row.dropNumber" size="mini"></el-input> <el-input
v-if="scope.row.ischeck == 1 && scope.row.orderType"
v-model="scope.row.dropNumber"
size="mini"
@input="setIput(scope.row, $event)"
></el-input>
<span v-else>{{ scope.row.dropNumber }}</span> <span v-else>{{ scope.row.dropNumber }}</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -449,6 +464,50 @@ export default { ...@@ -449,6 +464,50 @@ export default {
}, },
}, },
methods: { methods: {
// 总量计算
setIput(row, e) {
if (!isNaN(parseFloat(row.medicUseQuantity)) && isFinite(row.medicUseQuantity) && row.medicUsePlan) {
let num = this.medicUsePlanoptions.find((item) => item.describe == row.medicUsePlan).num;
// 使用量;
if (Number(row.medicUseQuantity) > 0) {
//医嘱取整 //单次取整
if (row.order_round !== "单次取整") {
//住院零售单位 //最小单位
if (row.retail_unit == row.min_unit) {
//使用量 //频率数量 //用药天数 //单位剂量
row.medicQuantity = Math.ceil((Number(row.medicUseQuantity) * num * row.useDay) / row.unit_dose);
console.log(num + "1");
//住院零售单位 //包装单位
} else if (row.retail_unit == row.package_unit) {
//使用量 //频率数量 //用药天数 //单位剂量 //包装数量
row.medicQuantity = Math.ceil((Number(row.medicUseQuantity) * num * row.useDay) / row.unit_dose / row.packagingnum);
console.log(num + "2");
} else {
//使用量 //频率数量 //用药天数 //单位剂量 //包装数量 拆分系数
row.medicQuantity = Math.ceil(
(Number(row.medicUseQuantity) * num * row.useDay) / row.unit_dose / (row.packagingnum / row.split_num)
);
console.log(num + "3");
}
} else {
if (row.order_round === "单次取整") {
row.medicQuantity = Math.round(Math.ceil(Number(row.medicUseQuantity) / row.unit_dose) * num * row.useDay);
console.log(num + "4");
} else if (retail_unit === package_unit) {
row.medicQuantity = Math.round(Math.ceil(Number(row.medicUseQuantity) / row.unit_dose / row.packagingnum) * num * row.useDay);
console.log(num + "5");
} else {
row.medicQuantity = Math.round(
Math.ceil(Number(row.medicUseQuantity) / row.unit_dose / (row.packagingnum / row.split_num)) * num * row.useDay
);
console.log(num + "6");
}
}
}
}
console.log(row);
},
//药疗新增
addRow(r) { addRow(r) {
const { cout } = this; const { cout } = this;
const newData = { const newData = {
...@@ -996,7 +1055,7 @@ export default { ...@@ -996,7 +1055,7 @@ export default {
//确定 //确定
fromOKbtn(fromRef) { fromOKbtn(fromRef) {
let prome = { let prome = {
pid: this.$route.value.query.pid, pid: this.$route.query.pid,
reason: this.form.reason, reason: this.form.reason,
inhosdays: this.form.inhosdays, inhosdays: this.form.inhosdays,
remarks: this.form.remarks, remarks: this.form.remarks,
......
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