|
|
@@ -1800,13 +1800,9 @@ export default {
|
|
|
// 表一 选中药品
|
|
|
chooseDis1(scope, index, item, from = "now") {
|
|
|
let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
|
|
|
- let isHas = false;
|
|
|
- totalData.forEach(item1 => {
|
|
|
- if (item1.medid === item.pid) {
|
|
|
- isHas = true;
|
|
|
- }
|
|
|
- });
|
|
|
- if (isHas) {
|
|
|
+ const i = totalData.findIndex(t => t.medid === item.pid);
|
|
|
+ const oneself = i === scope.row.id - 1;
|
|
|
+ if (i !== -1 && !oneself) {
|
|
|
this.$message.warning("请勿重复添加药品");
|
|
|
clearTimeout(medicineBlurTimer);
|
|
|
let index = scope.row.id ? scope.row.id - 1 : 0;
|
|
|
@@ -1821,10 +1817,10 @@ export default {
|
|
|
name: item.ypmc,
|
|
|
spec: item.gg, // 规格
|
|
|
// dose: "", // 剂量
|
|
|
- dose: scope.row.color == "red" ? scope.row.dose : "",
|
|
|
+ dose: scope.row.color === "red" || oneself ? scope.row.dose : "",
|
|
|
unit: item.dw, // 单位
|
|
|
usage:
|
|
|
- scope.row.color == "red"
|
|
|
+ oneself ? scope.row.usage : scope.row.color === "red"
|
|
|
? this.usageList[0].key
|
|
|
: scope.row.usage || item.usagestr || this.usageList[0].key, // 用法
|
|
|
//usage: "",
|