|
@@ -245,7 +245,7 @@
|
|
|
|
|
|
|
|
<div
|
|
<div
|
|
|
class="table-choose3"
|
|
class="table-choose3"
|
|
|
- v-if="scope.row.key"
|
|
|
|
|
|
|
+ v-if="index === scope.row.id - 1"
|
|
|
:style="medIndex==0?'':{top:(medIndex*35)+'px'}"
|
|
:style="medIndex==0?'':{top:(medIndex*35)+'px'}"
|
|
|
>
|
|
>
|
|
|
<div class="table-choose-h flex-vertical-between">
|
|
<div class="table-choose-h flex-vertical-between">
|
|
@@ -294,7 +294,7 @@
|
|
|
<template slot-scope="scope" v-if="scope.row.name">
|
|
<template slot-scope="scope" v-if="scope.row.name">
|
|
|
<div
|
|
<div
|
|
|
@click="clickName(scope)"
|
|
@click="clickName(scope)"
|
|
|
- v-if="!scope.row.showSearch"
|
|
|
|
|
|
|
+ v-if="index !== scope.row.id - 1"
|
|
|
:style="{'color':scope.row.color?scope.row.color:''}"
|
|
:style="{'color':scope.row.color?scope.row.color:''}"
|
|
|
>{{scope.row.name}}</div>
|
|
>{{scope.row.name}}</div>
|
|
|
<div v-else class="flex-vertical-between">
|
|
<div v-else class="flex-vertical-between">
|
|
@@ -314,7 +314,6 @@
|
|
|
<!-- v-model="scope.row.key" -->
|
|
<!-- v-model="scope.row.key" -->
|
|
|
<div
|
|
<div
|
|
|
class="table-choose3"
|
|
class="table-choose3"
|
|
|
- v-if="scope.row.key"
|
|
|
|
|
:style="medIndex==0?'':{top:(medIndex*35)+'px'}"
|
|
:style="medIndex==0?'':{top:(medIndex*35)+'px'}"
|
|
|
>
|
|
>
|
|
|
<div class="table-choose-h flex-vertical-between">
|
|
<div class="table-choose-h flex-vertical-between">
|
|
@@ -489,7 +488,7 @@
|
|
|
|
|
|
|
|
<div
|
|
<div
|
|
|
class="table-choose3"
|
|
class="table-choose3"
|
|
|
- v-if="scope.row.key"
|
|
|
|
|
|
|
+ v-if="index === scope.row.id - 1"
|
|
|
:style="medIndex==0?'':{top:(medIndex*35)+'px'}"
|
|
:style="medIndex==0?'':{top:(medIndex*35)+'px'}"
|
|
|
>
|
|
>
|
|
|
<div class="table-choose-h flex-vertical-between">
|
|
<div class="table-choose-h flex-vertical-between">
|
|
@@ -538,7 +537,7 @@
|
|
|
<template slot-scope="scope" v-if="scope.row.name">
|
|
<template slot-scope="scope" v-if="scope.row.name">
|
|
|
<div
|
|
<div
|
|
|
@click="clickName(scope)"
|
|
@click="clickName(scope)"
|
|
|
- v-if="!scope.row.showSearch"
|
|
|
|
|
|
|
+ v-if="index !== scope.row.id - 1"
|
|
|
:style="{'color':scope.row.color?scope.row.color:''}"
|
|
:style="{'color':scope.row.color?scope.row.color:''}"
|
|
|
>{{scope.row.name}}</div>
|
|
>{{scope.row.name}}</div>
|
|
|
<div v-else class="flex-vertical-between">
|
|
<div v-else class="flex-vertical-between">
|
|
@@ -558,7 +557,6 @@
|
|
|
<!-- v-model="scope.row.key" -->
|
|
<!-- v-model="scope.row.key" -->
|
|
|
<div
|
|
<div
|
|
|
class="table-choose3"
|
|
class="table-choose3"
|
|
|
- v-if="scope.row.key"
|
|
|
|
|
:style="medIndex==0?'':{top:(medIndex*35)+'px'}"
|
|
:style="medIndex==0?'':{top:(medIndex*35)+'px'}"
|
|
|
>
|
|
>
|
|
|
<div class="table-choose-h flex-vertical-between">
|
|
<div class="table-choose-h flex-vertical-between">
|
|
@@ -998,6 +996,8 @@ import { debounce } from "@/utils/format.js";
|
|
|
import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
|
|
import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
|
|
|
import popup from "@/components/Propup.vue";
|
|
import popup from "@/components/Propup.vue";
|
|
|
import accompanied from "./ui/accompanied.vue";
|
|
import accompanied from "./ui/accompanied.vue";
|
|
|
|
|
+
|
|
|
|
|
+let medicineBlurTimer;
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
popup,
|
|
popup,
|
|
@@ -1109,7 +1109,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
], // 处方 tabs
|
|
], // 处方 tabs
|
|
|
recipe_tabs_c: 0, // 处方 tabs 下标
|
|
recipe_tabs_c: 0, // 处方 tabs 下标
|
|
|
- index: 0, // 全局index 下拉加载时使用
|
|
|
|
|
|
|
+ index: -1, // 全局index 下拉加载时使用
|
|
|
|
|
|
|
|
provinceList1: [], // 全局省列表 赋值用
|
|
provinceList1: [], // 全局省列表 赋值用
|
|
|
countWay: "1", // 计算方式
|
|
countWay: "1", // 计算方式
|
|
@@ -1533,7 +1533,7 @@ export default {
|
|
|
this.$message.warning("已支付处方不可以清空");
|
|
this.$message.warning("已支付处方不可以清空");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.index = 0;
|
|
|
|
|
|
|
+ this.index = -1;
|
|
|
this.recipe_tabs[this.recipe_tabs_c].disable = false;
|
|
this.recipe_tabs[this.recipe_tabs_c].disable = false;
|
|
|
this.recipe_tabs[this.recipe_tabs_c].isMyMade = true;
|
|
this.recipe_tabs[this.recipe_tabs_c].isMyMade = true;
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.splice(
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.splice(
|
|
@@ -1623,6 +1623,7 @@ export default {
|
|
|
this.countNowRecipeMoney();
|
|
this.countNowRecipeMoney();
|
|
|
},
|
|
},
|
|
|
load() {
|
|
load() {
|
|
|
|
|
+ if (this.index === -1) return;
|
|
|
console.log("进入");
|
|
console.log("进入");
|
|
|
let key = this.recipe_tabs[this.recipe_tabs_c].totalTableD[this.index]
|
|
let key = this.recipe_tabs[this.recipe_tabs_c].totalTableD[this.index]
|
|
|
.key;
|
|
.key;
|
|
@@ -1811,6 +1812,10 @@ export default {
|
|
|
});
|
|
});
|
|
|
if (isHas) {
|
|
if (isHas) {
|
|
|
this.$message.warning("请勿重复添加药品");
|
|
this.$message.warning("请勿重复添加药品");
|
|
|
|
|
+ clearTimeout(medicineBlurTimer);
|
|
|
|
|
+ let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
|
|
|
+ const el = document.querySelectorAll(`#searchD${index+1}`)[0];
|
|
|
|
|
+ if (el) el.focus();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1882,8 +1887,9 @@ export default {
|
|
|
|
|
|
|
|
if (from != "now") return;
|
|
if (from != "now") return;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- let ids = document.querySelectorAll("#dose" + scope.row.id);
|
|
|
|
|
- document.querySelectorAll("#dose" + scope.row.id)[0].focus();
|
|
|
|
|
|
|
+ const el = document.querySelectorAll("#dose" + scope.row.id)[0];
|
|
|
|
|
+ if (el) el.focus();
|
|
|
|
|
+ this.index = -1;
|
|
|
}, 500);
|
|
}, 500);
|
|
|
|
|
|
|
|
this.countNowRecipeMoney();
|
|
this.countNowRecipeMoney();
|
|
@@ -1976,6 +1982,7 @@ export default {
|
|
|
this.countNowRecipeMoney();
|
|
this.countNowRecipeMoney();
|
|
|
},
|
|
},
|
|
|
clickName(scope) {
|
|
clickName(scope) {
|
|
|
|
|
+ if (medicineBlurTimer) clearTimeout(medicineBlurTimer);
|
|
|
// 隐藏滚动条
|
|
// 隐藏滚动条
|
|
|
if (scope.row.id % 2 == 0) {
|
|
if (scope.row.id % 2 == 0) {
|
|
|
document.getElementsByClassName(
|
|
document.getElementsByClassName(
|
|
@@ -1986,21 +1993,16 @@ export default {
|
|
|
"el-table__body-wrapper"
|
|
"el-table__body-wrapper"
|
|
|
)[0].style.overflow = "hidden";
|
|
)[0].style.overflow = "hidden";
|
|
|
}
|
|
}
|
|
|
|
|
+ let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
|
|
|
+ this.index = index;
|
|
|
|
|
|
|
|
this.medIndex = scope.$index;
|
|
this.medIndex = scope.$index;
|
|
|
this.clickPid = scope.row.medid;
|
|
this.clickPid = scope.row.medid;
|
|
|
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
|
|
|
- scope.row.id - 1
|
|
|
|
|
- ].showSearch = !this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
|
|
|
- scope.row.id - 1
|
|
|
|
|
- ].showSearch;
|
|
|
|
|
-
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[scope.row.id - 1].key =
|
|
|
|
|
- scope.row.name;
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
|
|
|
- scope.row.id - 1
|
|
|
|
|
- ].search_i = 0;
|
|
|
|
|
|
|
+ const totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
|
|
|
+ totalData[index].showSearch = !totalData[index].showSearch;
|
|
|
|
|
+ totalData[index].key = scope.row.name;
|
|
|
|
|
+ totalData[index].search_i = 0;
|
|
|
|
|
|
|
|
if (!scope.row.key) scope.row.key = scope.row.name;
|
|
if (!scope.row.key) scope.row.key = scope.row.name;
|
|
|
debounce(this.getTableDrug(scope.row.key, 1, scope.row.id - 1), 10000);
|
|
debounce(this.getTableDrug(scope.row.key, 1, scope.row.id - 1), 10000);
|
|
@@ -2038,7 +2040,7 @@ export default {
|
|
|
totalData[index].key = e;
|
|
totalData[index].key = e;
|
|
|
totalData[index].search_i = 0;
|
|
totalData[index].search_i = 0;
|
|
|
this._splitDataToView(totalData);
|
|
this._splitDataToView(totalData);
|
|
|
- this.index = scope.row.id - 1;
|
|
|
|
|
|
|
+ this.index = index;
|
|
|
|
|
|
|
|
// this.getTableDrug(scope.row.key, 1, scope.row.id - 1)
|
|
// this.getTableDrug(scope.row.key, 1, scope.row.id - 1)
|
|
|
|
|
|
|
@@ -2048,61 +2050,19 @@ export default {
|
|
|
this.medIndex = scope.$index;
|
|
this.medIndex = scope.$index;
|
|
|
},
|
|
},
|
|
|
drugBlur(e, scope) {
|
|
drugBlur(e, scope) {
|
|
|
- // 调用 父级合理用药接口
|
|
|
|
|
-
|
|
|
|
|
- // father.getRationalMedForPlat(scope.row.medid)
|
|
|
|
|
- // 失去焦点 释放滚动条
|
|
|
|
|
- if (scope.row.id % 2 == 0) {
|
|
|
|
|
- document.getElementsByClassName(
|
|
|
|
|
- "el-table__body-wrapper"
|
|
|
|
|
- )[1].style.overflow = "auto";
|
|
|
|
|
- } else {
|
|
|
|
|
- document.getElementsByClassName(
|
|
|
|
|
- "el-table__body-wrapper"
|
|
|
|
|
- )[0].style.overflow = "auto";
|
|
|
|
|
- }
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = "";
|
|
|
|
|
-
|
|
|
|
|
- let ids = document.querySelectorAll("#operate2");
|
|
|
|
|
- ids.forEach((item, index) => {
|
|
|
|
|
- item.style["z-index"] = "99";
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
|
|
|
- item.drugList = [];
|
|
|
|
|
- });
|
|
|
|
|
- this._splitDataToView();
|
|
|
|
|
- }, 500);
|
|
|
|
|
|
|
+ return this.drugBlur1(e, scope)
|
|
|
},
|
|
},
|
|
|
drugBlur1(e, scope) {
|
|
drugBlur1(e, scope) {
|
|
|
- // 调用 父级合理用药接口
|
|
|
|
|
-
|
|
|
|
|
- // 失去焦点 展示滚动条
|
|
|
|
|
- if (scope.row.id % 2 == 0) {
|
|
|
|
|
- document.getElementsByClassName(
|
|
|
|
|
- "el-table__body-wrapper"
|
|
|
|
|
- )[1].style.overflow = "auto";
|
|
|
|
|
- } else {
|
|
|
|
|
- document.getElementsByClassName(
|
|
|
|
|
- "el-table__body-wrapper"
|
|
|
|
|
- )[0].style.overflow = "auto";
|
|
|
|
|
- }
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
|
|
+ medicineBlurTimer = setTimeout(() => {
|
|
|
|
|
+ this.index = -1;
|
|
|
let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = "";
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = "";
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
|
|
|
- index
|
|
|
|
|
- ].showSearch = false;
|
|
|
|
|
|
|
+ this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].showSearch = false;
|
|
|
|
|
+ this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].drugList = [];
|
|
|
let ids = document.querySelectorAll("#operate2");
|
|
let ids = document.querySelectorAll("#operate2");
|
|
|
ids.forEach((item, index) => {
|
|
ids.forEach((item, index) => {
|
|
|
item.style["z-index"] = "99";
|
|
item.style["z-index"] = "99";
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
|
|
|
- item.drugList = [];
|
|
|
|
|
- });
|
|
|
|
|
this._splitDataToView();
|
|
this._splitDataToView();
|
|
|
}, 500);
|
|
}, 500);
|
|
|
},
|
|
},
|
|
@@ -2594,6 +2554,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 获取表格药品列表
|
|
// 获取表格药品列表
|
|
|
async getTableDrug(key, page, index, load = true) {
|
|
async getTableDrug(key, page, index, load = true) {
|
|
|
|
|
+ if (medicineBlurTimer) clearTimeout(medicineBlurTimer);
|
|
|
if (!load) return;
|
|
if (!load) return;
|
|
|
let pharmacyName = "";
|
|
let pharmacyName = "";
|
|
|
// let type = 0
|
|
// let type = 0
|
|
@@ -2612,6 +2573,7 @@ export default {
|
|
|
pharmacyid: this.recipe_tabs[this.recipe_tabs_c].pharmacyID
|
|
pharmacyid: this.recipe_tabs[this.recipe_tabs_c].pharmacyID
|
|
|
};
|
|
};
|
|
|
let res = await getTableDrug(params);
|
|
let res = await getTableDrug(params);
|
|
|
|
|
+ if (this.index !== index) return;
|
|
|
|
|
|
|
|
if (res.ResultCode == 0) {
|
|
if (res.ResultCode == 0) {
|
|
|
// 计算方式3
|
|
// 计算方式3
|