|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div>
|
|
|
|
|
|
|
+ <div class="medicine-editor-wrapper">
|
|
|
<div class="table-container">
|
|
<div class="table-container">
|
|
|
<div class="t-con-header flex-vertical-between">
|
|
<div class="t-con-header flex-vertical-between">
|
|
|
<div class="t-con-radio flex-vertical-center-l" v-if="false">
|
|
<div class="t-con-radio flex-vertical-center-l" v-if="false">
|
|
@@ -706,6 +706,20 @@ export default {
|
|
|
},
|
|
},
|
|
|
mounted() {},
|
|
mounted() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ _splitDataToView(totalData) {
|
|
|
|
|
+ if (!Array.isArray(totalData)) totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
|
|
|
+ const forceUpdate = (data) => Object.assign({}, data);
|
|
|
|
|
+ this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
|
|
|
|
|
+ (item, index) => {
|
|
|
|
|
+ return item.id % 2 !== 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ ).map(forceUpdate);
|
|
|
|
|
+ this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
|
|
|
|
|
+ (item, index) => {
|
|
|
|
|
+ return item.id % 2 === 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ ).map(forceUpdate);
|
|
|
|
|
+ },
|
|
|
// 打开父级安全合理用药监测
|
|
// 打开父级安全合理用药监测
|
|
|
openSafeDrug() {
|
|
openSafeDrug() {
|
|
|
this.$parent.opensafeD();
|
|
this.$parent.opensafeD();
|
|
@@ -772,6 +786,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 监听键盘事件
|
|
// 监听键盘事件
|
|
|
drugDown(e, scope) {
|
|
drugDown(e, scope) {
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+ e.preventDefault();
|
|
|
let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
|
|
|
|
|
|
let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
@@ -795,36 +811,22 @@ export default {
|
|
|
|
|
|
|
|
// 表格 fixed 时 去 下标 为 1
|
|
// 表格 fixed 时 去 下标 为 1
|
|
|
|
|
|
|
|
- // if (totalData[index].drugList.length > 5) {
|
|
|
|
|
- // document.querySelectorAll(
|
|
|
|
|
- // `#infiniteList${scope.row.id}`
|
|
|
|
|
- // )[1].scrollTop += 36;
|
|
|
|
|
-
|
|
|
|
|
- // console.log(
|
|
|
|
|
- // document.querySelectorAll(`#infiniteList${scope.row.id}`)[1]
|
|
|
|
|
- // .scrollTop,
|
|
|
|
|
- // "top"
|
|
|
|
|
- // );
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (totalData[index].drugList.length > 5) {
|
|
|
|
|
+ const el = document.querySelectorAll(`.medicine-editor-wrapper #infiniteList${scope.row.id}`)[0];
|
|
|
|
|
+ if (el) el.scrollTop += 36;
|
|
|
|
|
+ }
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
|
|
|
totalData.filter((item, index) => {
|
|
totalData.filter((item, index) => {
|
|
|
// this.getSelectType('中药药品用法', index)
|
|
// this.getSelectType('中药药品用法', index)
|
|
|
return (item.id = index + 1);
|
|
return (item.id = index + 1);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this._splitDataToView(totalData);
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
},
|
|
},
|
|
|
drugUp(e, scope) {
|
|
drugUp(e, scope) {
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+ e.preventDefault();
|
|
|
let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
|
let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
|
// 如果到最后一个 判断是否需要分页
|
|
// 如果到最后一个 判断是否需要分页
|
|
@@ -834,30 +836,16 @@ export default {
|
|
|
totalData[index].search_i -= 1;
|
|
totalData[index].search_i -= 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (
|
|
|
|
|
- document.querySelectorAll(`#infiniteList${scope.row.id}`)[1].scrollTop >
|
|
|
|
|
- 0
|
|
|
|
|
- ) {
|
|
|
|
|
- document.querySelectorAll(
|
|
|
|
|
- `#infiniteList${scope.row.id}`
|
|
|
|
|
- )[1].scrollTop -= 36;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const el = document.querySelectorAll(`.medicine-editor-wrapper #infiniteList${scope.row.id}`)[0];
|
|
|
|
|
+ if (el && el.scrollTop > 0) el.scrollTop -= 36;
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
|
|
|
totalData.filter((item, index) => {
|
|
totalData.filter((item, index) => {
|
|
|
// this.getSelectType('中药药品用法', index)
|
|
// this.getSelectType('中药药品用法', index)
|
|
|
return (item.id = index + 1);
|
|
return (item.id = index + 1);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this._splitDataToView(totalData);
|
|
|
},
|
|
},
|
|
|
drugEnter(scope) {
|
|
drugEnter(scope) {
|
|
|
this.chooseDis1(
|
|
this.chooseDis1(
|
|
@@ -872,16 +860,7 @@ export default {
|
|
|
|
|
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].usage = e;
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].usage = e;
|
|
|
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this._splitDataToView(totalData);
|
|
|
},
|
|
},
|
|
|
doseFocus(scope) {
|
|
doseFocus(scope) {
|
|
|
let width = window.innerWidth;
|
|
let width = window.innerWidth;
|
|
@@ -926,17 +905,17 @@ export default {
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1
|
|
|
) {
|
|
) {
|
|
|
// console.log(document.querySelectorAll('#searchD' + (scope.row.id + 1)), '啦啦啦')
|
|
// console.log(document.querySelectorAll('#searchD' + (scope.row.id + 1)), '啦啦啦')
|
|
|
- document.querySelectorAll("#searchD" + (scope.row.id + 1))[0].focus();
|
|
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #searchD" + (scope.row.id + 1))[0].focus();
|
|
|
} else {
|
|
} else {
|
|
|
try {
|
|
try {
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
|
if (item.name && !item.dose && scope.row.id < item.id) {
|
|
if (item.name && !item.dose && scope.row.id < item.id) {
|
|
|
- document.querySelectorAll("#dose" + item.id)[0].focus();
|
|
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #dose" + item.id)[0].focus();
|
|
|
throw Error();
|
|
throw Error();
|
|
|
}
|
|
}
|
|
|
if (!item.name) {
|
|
if (!item.name) {
|
|
|
// console.log(document.querySelectorAll('#searchD' + item.id), '啦啦啦')
|
|
// console.log(document.querySelectorAll('#searchD' + item.id), '啦啦啦')
|
|
|
- document.querySelectorAll("#searchD" + item.id)[0].focus();
|
|
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #searchD" + item.id)[0].focus();
|
|
|
throw Error();
|
|
throw Error();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1270,13 +1249,13 @@ export default {
|
|
|
if (Number(e) > Number(kucun)) {
|
|
if (Number(e) > Number(kucun)) {
|
|
|
this.$message.warning("当前库存不足");
|
|
this.$message.warning("当前库存不足");
|
|
|
|
|
|
|
|
- document.querySelectorAll("#dose" + scope.row.id)[0].style.border =
|
|
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #dose" + scope.row.id)[0].style.border =
|
|
|
"1px solid red";
|
|
"1px solid red";
|
|
|
- document.querySelectorAll("#dose" + scope.row.id)[0].style.color =
|
|
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #dose" + scope.row.id)[0].style.color =
|
|
|
"red";
|
|
"red";
|
|
|
} else {
|
|
} else {
|
|
|
- document.querySelectorAll("#dose" + scope.row.id)[0].style.border = "";
|
|
|
|
|
- document.querySelectorAll("#dose" + scope.row.id)[0].style.color = "";
|
|
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #dose" + scope.row.id)[0].style.border = "";
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #dose" + scope.row.id)[0].style.color = "";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let price = this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
let price = this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
@@ -1300,22 +1279,13 @@ export default {
|
|
|
scope.row.id - 1
|
|
scope.row.id - 1
|
|
|
].total = total;
|
|
].total = total;
|
|
|
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this._splitDataToView(totalData);
|
|
|
|
|
|
|
|
if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum) {
|
|
if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum) {
|
|
|
- this.countNowRecipeMoney();
|
|
|
|
|
|
|
+ // this.countNowRecipeMoney();
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- // 表一 选中药品
|
|
|
|
|
|
|
+ this.countNowRecipeMoney();
|
|
|
|
|
+ },// 表一 选中药品
|
|
|
chooseDis1(scope, index, item, from = "now") {
|
|
chooseDis1(scope, index, item, from = "now") {
|
|
|
let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
|
let isHas = false;
|
|
let isHas = false;
|
|
@@ -1328,15 +1298,20 @@ export default {
|
|
|
this.$message.warning("请勿重复添加药品");
|
|
this.$message.warning("请勿重复添加药品");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
let obj = {
|
|
let obj = {
|
|
|
- color: "#000",
|
|
|
|
|
|
|
+ color: item.kc == 0 ? "red" : "#000",
|
|
|
id: scope.row.id,
|
|
id: scope.row.id,
|
|
|
name: item.ypmc,
|
|
name: item.ypmc,
|
|
|
spec: item.gg, // 规格
|
|
spec: item.gg, // 规格
|
|
|
- dose: "", // 剂量
|
|
|
|
|
|
|
+ // dose: "", // 剂量
|
|
|
|
|
+ dose: scope.row.color == "red" ? scope.row.dose : "",
|
|
|
unit: item.dw, // 单位
|
|
unit: item.dw, // 单位
|
|
|
- // usage: item.usagestr, // 用法
|
|
|
|
|
- usage: "",
|
|
|
|
|
|
|
+ usage:
|
|
|
|
|
+ scope.row.color == "red"
|
|
|
|
|
+ ? this.usageList[0].key
|
|
|
|
|
+ : scope.row.usage || item.usagestr || this.usageList[0].key, // 用法
|
|
|
|
|
+ //usage: "",
|
|
|
// price: item.lsjg,
|
|
// price: item.lsjg,
|
|
|
price: item.price,
|
|
price: item.price,
|
|
|
total: 0,
|
|
total: 0,
|
|
@@ -1351,7 +1326,6 @@ export default {
|
|
|
Object.assign(totalData[scope.row.id - 1], obj);
|
|
Object.assign(totalData[scope.row.id - 1], obj);
|
|
|
|
|
|
|
|
// 调用 父级合理用药接口
|
|
// 调用 父级合理用药接口
|
|
|
- let father = this.$parent;
|
|
|
|
|
|
|
|
|
|
if (scope.row.id == totalData.length) {
|
|
if (scope.row.id == totalData.length) {
|
|
|
totalData.push({
|
|
totalData.push({
|
|
@@ -1371,22 +1345,15 @@ export default {
|
|
|
return (item.id = index + 1);
|
|
return (item.id = index + 1);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this._splitDataToView(totalData);
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
+ let ids = document.querySelectorAll(".medicine-editor-wrapper #dose" + scope.row.id);
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #dose" + scope.row.id)[0].focus();
|
|
|
}, 500);
|
|
}, 500);
|
|
|
|
|
+
|
|
|
|
|
+ this.countNowRecipeMoney();
|
|
|
},
|
|
},
|
|
|
// 表一和表二 数据添加
|
|
// 表一和表二 数据添加
|
|
|
addDis1(scope, type = "click") {
|
|
addDis1(scope, type = "click") {
|
|
@@ -1429,29 +1396,20 @@ export default {
|
|
|
|
|
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
|
|
|
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this._splitDataToView(totalData);
|
|
|
if (type != "click") return;
|
|
if (type != "click") return;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
if (
|
|
if (
|
|
|
scope.row.id ==
|
|
scope.row.id ==
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1
|
|
|
) {
|
|
) {
|
|
|
- document.querySelectorAll("#searchD" + (scope.row.id + 1))[0].focus();
|
|
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #searchD" + (scope.row.id + 1))[0].focus();
|
|
|
} else {
|
|
} else {
|
|
|
try {
|
|
try {
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
|
if (!item.name) {
|
|
if (!item.name) {
|
|
|
// console.log(document.querySelectorAll('#searchD' + item.id), '啦啦啦')
|
|
// console.log(document.querySelectorAll('#searchD' + item.id), '啦啦啦')
|
|
|
- document.querySelectorAll("#searchD" + item.id)[0].focus();
|
|
|
|
|
|
|
+ document.querySelectorAll(".medicine-editor-wrapper #searchD" + item.id)[0].focus();
|
|
|
throw Error();
|
|
throw Error();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1476,16 +1434,7 @@ export default {
|
|
|
// father.getRationalMed(item.medid)
|
|
// father.getRationalMed(item.medid)
|
|
|
return (item.id = index + 1);
|
|
return (item.id = index + 1);
|
|
|
});
|
|
});
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
|
|
|
|
|
- (item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this._splitDataToView(totalData);
|
|
|
this.countNowRecipeMoney();
|
|
this.countNowRecipeMoney();
|
|
|
},
|
|
},
|
|
|
clickName(scope) {
|
|
clickName(scope) {
|
|
@@ -1515,11 +1464,8 @@ export default {
|
|
|
scope.row.id - 1
|
|
scope.row.id - 1
|
|
|
].search_i = 0;
|
|
].search_i = 0;
|
|
|
|
|
|
|
|
|
|
+ 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);
|
|
|
- setTimeout(() => {
|
|
|
|
|
- // console.log(document.querySelectorAll('#searchD' + scope.row.id));
|
|
|
|
|
- document.querySelectorAll("#searchD" + scope.row.id)[0].focus();
|
|
|
|
|
- }, 800);
|
|
|
|
|
},
|
|
},
|
|
|
// 输入框获取 药品列表
|
|
// 输入框获取 药品列表
|
|
|
searchDrug(e, scope) {
|
|
searchDrug(e, scope) {
|
|
@@ -1536,8 +1482,7 @@ export default {
|
|
|
let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
|
// console.log(this.recipe_tabs[this.recipe_tabs_c].totalTableD[index], '我是key')
|
|
// console.log(this.recipe_tabs[this.recipe_tabs_c].totalTableD[index], '我是key')
|
|
|
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = e;
|
|
|
|
|
- let ids = document.querySelectorAll("#operate2");
|
|
|
|
|
|
|
+ let ids = document.querySelectorAll(".medicine-editor-wrapper #operate2");
|
|
|
ids.forEach((item, index) => {
|
|
ids.forEach((item, index) => {
|
|
|
item.style["z-index"] = "auto";
|
|
item.style["z-index"] = "auto";
|
|
|
});
|
|
});
|
|
@@ -1551,21 +1496,15 @@ export default {
|
|
|
// ].showSearch = false
|
|
// ].showSearch = false
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- });
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
|
|
|
+ totalData[index].key = e;
|
|
|
|
|
+ totalData[index].search_i = 0;
|
|
|
|
|
+ this._splitDataToView(totalData);
|
|
|
this.index = scope.row.id - 1;
|
|
this.index = scope.row.id - 1;
|
|
|
|
|
|
|
|
// this.getTableDrug(scope.row.key, 1, scope.row.id - 1)
|
|
// this.getTableDrug(scope.row.key, 1, scope.row.id - 1)
|
|
|
|
|
|
|
|
- debounce(this.getTableDrug(scope.row.key, 1, index), 10000);
|
|
|
|
|
|
|
+ debounce(this.getTableDrug(e, 1, index), 10000);
|
|
|
},
|
|
},
|
|
|
drugFocus(scope) {
|
|
drugFocus(scope) {
|
|
|
this.medIndex = scope.$index;
|
|
this.medIndex = scope.$index;
|
|
@@ -1588,7 +1527,7 @@ export default {
|
|
|
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 = "";
|
|
|
|
|
|
|
|
- let ids = document.querySelectorAll("#operate2");
|
|
|
|
|
|
|
+ let ids = document.querySelectorAll(".medicine-editor-wrapper #operate2");
|
|
|
ids.forEach((item, index) => {
|
|
ids.forEach((item, index) => {
|
|
|
item.style["z-index"] = "99";
|
|
item.style["z-index"] = "99";
|
|
|
});
|
|
});
|
|
@@ -1596,16 +1535,7 @@ export default {
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
|
item.drugList = [];
|
|
item.drugList = [];
|
|
|
});
|
|
});
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- });
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this._splitDataToView();
|
|
|
}, 500);
|
|
}, 500);
|
|
|
},
|
|
},
|
|
|
drugBlur1(e, scope) {
|
|
drugBlur1(e, scope) {
|
|
@@ -1627,7 +1557,7 @@ export default {
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
|
index
|
|
index
|
|
|
].showSearch = false;
|
|
].showSearch = false;
|
|
|
- let ids = document.querySelectorAll("#operate2");
|
|
|
|
|
|
|
+ let ids = document.querySelectorAll(".medicine-editor-wrapper #operate2");
|
|
|
ids.forEach((item, index) => {
|
|
ids.forEach((item, index) => {
|
|
|
item.style["z-index"] = "99";
|
|
item.style["z-index"] = "99";
|
|
|
});
|
|
});
|
|
@@ -1635,16 +1565,7 @@ export default {
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
|
item.drugList = [];
|
|
item.drugList = [];
|
|
|
});
|
|
});
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- });
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this._splitDataToView();
|
|
|
}, 500);
|
|
}, 500);
|
|
|
},
|
|
},
|
|
|
// 合并表一 表二
|
|
// 合并表一 表二
|
|
@@ -1994,7 +1915,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 切换中药类型时 切换 药房 获取 药品里面有没有这条数据
|
|
// 切换中药类型时 切换 药房 获取 药品里面有没有这条数据
|
|
|
- async changePharmacy(type) {
|
|
|
|
|
|
|
+ async changePharmacy(type, val) {
|
|
|
|
|
+ if (!type) type = this.recipe_tabs[this.recipe_tabs_c].lastType || '';
|
|
|
|
|
+ if (!val) val = this.recipe_tabs[this.recipe_tabs_c].radio || '';
|
|
|
|
|
+ this.recipe_tabs[this.recipe_tabs_c].radio = val;
|
|
|
|
|
+
|
|
|
let drugIds = [];
|
|
let drugIds = [];
|
|
|
const loading = this.$loading({
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
lock: true,
|
|
@@ -2005,7 +1930,7 @@ export default {
|
|
|
|
|
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
|
|
|
if (item.name) {
|
|
if (item.name) {
|
|
|
- let idDose = item.medid + "&" + (item.dose || item.oldDose);
|
|
|
|
|
|
|
+ let idDose = item.medid + "&" + (item.dose || item.oldDose) + "&" + (item.usage || "");
|
|
|
// drugIds.push(item.medid)
|
|
// drugIds.push(item.medid)
|
|
|
item.oldDose = item.dose;
|
|
item.oldDose = item.dose;
|
|
|
drugIds.push(idDose);
|
|
drugIds.push(idDose);
|
|
@@ -2013,8 +1938,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
let pharmacyName = "";
|
|
let pharmacyName = "";
|
|
|
- let type1 = "";
|
|
|
|
|
- type1 = this.recipe_tabs[this.recipe_tabs_c].radio.split("@")[1];
|
|
|
|
|
|
|
+ val = val.split("@")[1];
|
|
|
type = type.split("@")[1];
|
|
type = type.split("@")[1];
|
|
|
|
|
|
|
|
this.recipe_tabs[this.recipe_tabs_c].pharmacyID = this.recipe_tabs[
|
|
this.recipe_tabs[this.recipe_tabs_c].pharmacyID = this.recipe_tabs[
|
|
@@ -2022,7 +1946,7 @@ export default {
|
|
|
].radio.split("@")[0];
|
|
].radio.split("@")[0];
|
|
|
|
|
|
|
|
let params = {
|
|
let params = {
|
|
|
- type: type1,
|
|
|
|
|
|
|
+ type: val || type,
|
|
|
pharmacyid: this.recipe_tabs[this.recipe_tabs_c].pharmacyID,
|
|
pharmacyid: this.recipe_tabs[this.recipe_tabs_c].pharmacyID,
|
|
|
drugIds,
|
|
drugIds,
|
|
|
preType: this.recipe_tabs[this.recipe_tabs_c].preType,
|
|
preType: this.recipe_tabs[this.recipe_tabs_c].preType,
|
|
@@ -2035,6 +1959,12 @@ export default {
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(
|
|
|
(item1, index1) => {
|
|
(item1, index1) => {
|
|
|
if (item1.name) {
|
|
if (item1.name) {
|
|
|
|
|
+ const getUsage = (function (list = [], value = '') {
|
|
|
|
|
+ if (!Array.isArray(list) || list.length === 0) return void 0;
|
|
|
|
|
+ const option = value && list.find(item => item.value === value || item.key == value);
|
|
|
|
|
+ return option ? option.key : list[0].key;
|
|
|
|
|
+ }).bind(null, this.usageList);
|
|
|
|
|
+
|
|
|
res.Data.forEach((item, index) => {
|
|
res.Data.forEach((item, index) => {
|
|
|
if (item == item1.medid) {
|
|
if (item == item1.medid) {
|
|
|
item1.color = "red";
|
|
item1.color = "red";
|
|
@@ -2049,7 +1979,7 @@ export default {
|
|
|
spec: item.gg, // 规格
|
|
spec: item.gg, // 规格
|
|
|
dose: item.dose, // 剂量
|
|
dose: item.dose, // 剂量
|
|
|
unit: item.dw, // 单位
|
|
unit: item.dw, // 单位
|
|
|
- usage: item1.usagestr || item1.usage || "", // 用法
|
|
|
|
|
|
|
+ usage: item.usagestr || item.usage, // || this.usegeList[0].key, // 用法
|
|
|
// usage: "",
|
|
// usage: "",
|
|
|
// price: item.lsjg,
|
|
// price: item.lsjg,
|
|
|
price: item.price,
|
|
price: item.price,
|
|
@@ -2063,6 +1993,7 @@ export default {
|
|
|
usageList: [],
|
|
usageList: [],
|
|
|
oldDose: item1.oldDose
|
|
oldDose: item1.oldDose
|
|
|
};
|
|
};
|
|
|
|
|
+ /* 修正 */ item1.usage = item1.useage = getUsage(item1.usage);
|
|
|
|
|
|
|
|
item1.color = "#000";
|
|
item1.color = "#000";
|
|
|
}
|
|
}
|
|
@@ -2082,16 +2013,7 @@ export default {
|
|
|
return (item.id = index + 1);
|
|
return (item.id = index + 1);
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- });
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this._splitDataToView();
|
|
|
|
|
|
|
|
// this.recipe_tabs[this.recipe_tabs_c].lastType = this.recipe_tabs[this.recipe_tabs_c]
|
|
// this.recipe_tabs[this.recipe_tabs_c].lastType = this.recipe_tabs[this.recipe_tabs_c]
|
|
|
// .radio // 存储这一次的 药房类型
|
|
// .radio // 存储这一次的 药房类型
|
|
@@ -2100,7 +2022,7 @@ export default {
|
|
|
].radio; // 存储这一次的 药房类型
|
|
].radio; // 存储这一次的 药房类型
|
|
|
loading.close();
|
|
loading.close();
|
|
|
// console.log(this.recipe_tabs[this.recipe_tabs_c].totalTableD);
|
|
// console.log(this.recipe_tabs[this.recipe_tabs_c].totalTableD);
|
|
|
- this.getPharmacyMsg(this.recipe_tabs[this.recipe_tabs_c].pharmacyID);
|
|
|
|
|
|
|
+ await this.getPharmacyMsg(this.recipe_tabs[this.recipe_tabs_c].pharmacyID);
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.countNowRecipeMoney();
|
|
this.countNowRecipeMoney();
|
|
|
}, 500);
|
|
}, 500);
|
|
@@ -2175,22 +2097,23 @@ export default {
|
|
|
return (item.id = index + 1);
|
|
return (item.id = index + 1);
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 != 0;
|
|
|
|
|
- });
|
|
|
|
|
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
|
|
|
|
|
- this.recipe_tabs_c
|
|
|
|
|
- ].totalTableD.filter((item, index) => {
|
|
|
|
|
- return item.id % 2 == 0;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this._splitDataToView();
|
|
|
} else {
|
|
} else {
|
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
this.recipe_tabs[this.recipe_tabs_c].totalTableD[
|
|
|
index
|
|
index
|
|
|
].loadMore = false;
|
|
].loadMore = false;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (page === 1) {
|
|
|
|
|
+ const el = document.querySelectorAll(`.medicine-editor-wrapper #infiniteList${index+1}`)[0];
|
|
|
|
|
+ if (el && el.scrollTop > 0) el.scrollTop = 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ const el = document.querySelectorAll(`.medicine-editor-wrapper #searchD${index+1}`)[0];
|
|
|
|
|
+ console.log(el);
|
|
|
|
|
+ if (el) el.focus();
|
|
|
|
|
+ }, 100);
|
|
|
},
|
|
},
|
|
|
// 获取省数据
|
|
// 获取省数据
|
|
|
async getProver() {
|
|
async getProver() {
|