Commit 3ca3d7e1 by 唐玉峰

总量逻辑计算

parent 52d163fc
......@@ -106,22 +106,11 @@
</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, MessageBox } from "element-ui";
import { useRoute, useRouter } from "../utils/useVueRouter";
import { setItem, getItem } from "../utils/auth";
import { Loading } from "element-ui";
import { Message, MessageBox, Loading } from "element-ui";
export default {
name: "Entrypath",
setup() {
//表格自适应高度
const route = useRoute();
const router = useRouter();
let state = reactive({
data() {
return {
//输入框
pathinput: "",
//选择框
......@@ -144,76 +133,81 @@ export default {
TwotableData: [],
//第三个表格
TreetableData: [],
});
// loading效果
const loadingOption1 = {
// 加载loading
fullscreen: true,
text: "正在加载...",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.5)",
loadingOption1: {
// 加载loading
fullscreen: true,
text: "正在加载...",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.5)",
},
};
},
async mounted() {
this.getIsRoute();
await this.gettopdata();
this.getLeftdata();
},
methods: {
//获取标识
const getIsRoute = () => {
http.post(`/ClinicalRoute/ClinicalRoute/IsRoute?pid=${route.value.query.pid}`, {})
getIsRoute() {
http.post(`/ClinicalRoute/ClinicalRoute/IsRoute?pid=${this.$route.query.pid}`, {})
.then((data) => {
state.IsRoute = data;
this.IsRoute = data;
})
.catch((error) => {});
};
},
//获取患者信息
const gettopdata = () => {
http.post(`/ClinicalRoute/ClinicalRoute/GetPatientInfo?pid=${route.value.query.pid}`, {})
gettopdata() {
http.post(`/ClinicalRoute/ClinicalRoute/GetPatientInfo?pid=${this.$route.query.pid}`, {})
.then((data) => {
state.topdata = data;
this.topdata = data;
//如果标识为false 跳转到临床路径外放页面
if (state.IsRoute == false) {
router.push({
if (this.IsRoute == false) {
this.$router.push({
path: "outClinicalpathway",
query: {
pid: route.value.query.pid,
pid: this.$route.query.pid,
},
});
}
})
.catch((error) => {});
};
},
//显示推荐路径单选框变化
const checkchange = (val) => {
state.checked = val;
};
checkchange(val) {
this.checked = val;
},
//查询
const selectbtn = () => {
getLeftdata();
};
selectbtn() {
this.getLeftdata();
},
//获取左侧表格数据
const getLeftdata = () => {
http.post(`/ClinicalRoute/ClinicalRoute/GetPatientRoutes?pid=${route.value.query.pid}&searchQuery=${state.pathinput}&flag=${state.checked}`, {})
getLeftdata() {
http.post(`/ClinicalRoute/ClinicalRoute/GetPatientRoutes?pid=${this.$route.query.pid}&searchQuery=${this.pathinput}&flag=${this.checked}`, {})
.then((data) => {
state.LefttableData = data;
this.LefttableData = data;
})
.catch((error) => {});
};
},
//点击左侧表格数据
const rowclick = (row) => {
state.iscid = row.id;
var loadingInstance1 = Loading.service(loadingOption1);
rowclick(row) {
this.iscid = row.id;
var loadingInstance1 = Loading.service(this.loadingOption1);
//获取右侧数据
http.post(`/ClinicalRoute/ClinicalRoute/GetCRRuleDescribe?crid=${row.id}`, {})
.then((data) => {
state.OnetableData = data.diagInfo; //诊断信息
state.TwotableData = data.opsInfo;
state.TreetableData = data.staCRStandards;
this.OnetableData = data.diagInfo; //诊断信息
this.TwotableData = data.opsInfo;
this.TreetableData = data.staCRStandards;
loadingInstance1.close();
})
.catch((error) => {
loadingInstance1.close();
});
};
},
//点击进入路径按钮
const okbtn = () => {
okbtn() {
MessageBox.confirm(
"确定进入路径吗?",
......@@ -224,22 +218,22 @@ export default {
}
)
.then(() => {
if (state.iscid == 0) {
if (this.iscid == 0) {
Message({
message: "请先选择路径名称!",
type: "warning",
});
} else if (state.iscid != 0) {
http.post(`/ClinicalRoute/ClinicalRoute/CreatePatientRoute?pid=${route.value.query.pid}&crid=${state.iscid}`, {})
} else if (this.iscid != 0) {
http.post(`/ClinicalRoute/ClinicalRoute/CreatePatientRoute?pid=${this.$route.query.pid}&crid=${this.iscid}`, {})
.then((data) => {
Message({
message: "成功",
type: "success",
});
router.push({
this.$router.push({
path: "outClinicalpathway",
query: {
pid: route.value.query.pid,
pid: this.$route.query.pid,
},
});
})
......@@ -252,25 +246,7 @@ export default {
message: "取消",
});
});
};
onMounted(async () => {
getIsRoute();
await gettopdata();
getLeftdata();
});
return {
...toRefs(state),
gettopdata,
decimal,
getIsRoute,
getLeftdata,
rowclick,
okbtn,
checkchange,
selectbtn,
};
},
},
};
</script>
......
......@@ -193,7 +193,12 @@
</el-table-column>
<el-table-column prop="medicUseQuantity" label="用量" width="85">
<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>
</template>
</el-table-column>
......@@ -215,7 +220,12 @@
</el-table-column>
<el-table-column show-overflow-tooltip property="medicUsePlan" label="频率" width="130">
<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-select>
<span v-else>{{ scope.row.medicUsePlan }}</span>
......@@ -223,7 +233,12 @@
</el-table-column>
<el-table-column prop="dropNumber" label="滴数" width="85">
<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>
</template>
</el-table-column>
......@@ -449,6 +464,50 @@ export default {
},
},
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) {
const { cout } = this;
const newData = {
......@@ -996,7 +1055,7 @@ export default {
//确定
fromOKbtn(fromRef) {
let prome = {
pid: this.$route.value.query.pid,
pid: this.$route.query.pid,
reason: this.form.reason,
inhosdays: this.form.inhosdays,
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