Browse Source

bug-712:协定方,单次数量修改后,单次金额没有变化

张田田 5 days ago
parent
commit
e0e4d099a9

+ 1 - 3
src/views/business/NonDrugList.vue

@@ -1219,9 +1219,7 @@ export default {
         } else {
           this.$message.error(res.ResultInfo || "操作失败");
         }
-      } catch (e) {
-        this.$message.error(e.message || "操作失败");
-      }
+      } catch (e) {}
     },
 
     // ===== 项目删除 =====

+ 4 - 12
src/views/business/components/AcupointTable.vue

@@ -724,6 +724,9 @@ export default {
     },
   },
   watch: {
+    singleCount() {
+      this.updatePrice();
+    },
     detailTables: {
       handler() {
         this.calcPrice();
@@ -1302,22 +1305,11 @@ export default {
     },
     // 根据详情重新计算 singleCount 并更新价格(用于穴位详情变化时)
     calcPrice() {
-      const price = this.currentUnitPrice || this.unitPrice || 0;
       const totalFromDetails = this.calcTotalCount();
       if (totalFromDetails > 0 && !this._isLoadingTab) {
         this.singleCount = totalFromDetails;
       }
-      this.singlePrice = (this.singleCount * price).toFixed(2);
-      this.coursePrice = (
-        this.treatCount * parseFloat(this.singlePrice)
-      ).toFixed(2);
-      this.saveCurrentTabData();
-      let total = 0;
-      Object.values(this.prescriptionDataMap).forEach((d) => {
-        total += parseFloat(d.coursePrice) || 0;
-      });
-      this.totalPrice = total.toFixed(2);
-      this.emitStatistics();
+      this.updatePrice();
     },
     calcTotalCount() {
       let total = 0;