12
wwl
2025-01-02 01217cd5e6695c0651554a2355695f0ce60bb67d
src/views/system/tijian/index.vue
@@ -505,9 +505,9 @@
                <el-input placeholder="应收金额" v-model="TotalPrice1" disabled style="width: 150px"></el-input>
              </el-form-item>
              <el-form-item label="优惠">
                <!-- {{ discount }} -->
                <el-input-number ref="inputNumber" style="width: 150px" v-model="discount" :precision="2" :step="0.1"
                  :max="10" :min="1" @change="numberChange" :disabled="isfalse"></el-input-number>
                  :max="10" :min="0" @change="numberChange" :disabled="isfalse"></el-input-number>
              </el-form-item>
              <el-form-item label="实收金额">
                <el-input placeholder="实收金额" v-model="TotalPrice" style="width: 150px"></el-input>
@@ -582,13 +582,13 @@
          <div style="
              padding: 0px 6px;
              border: 1px solid #e6ebf5;
              max-height: 420px;
              max-height: 650%;
              overflow: auto;
              width: 916px;
              margin-left: 35px;
            ">
            <el-table :data="tableData1" border style="width: 100%" height="250">
            <el-table :data="tableData1" border style="width: 100%;">
              <el-table-column prop="proName" label="项目" width="180">
              </el-table-column>
              <el-table-column prop="proType" label="性别" width="50">
@@ -668,7 +668,7 @@
                  :disabled="true"></el-input>
              </el-form-item>
              <el-form-item label="优惠">
                <el-input-number style="width: 140px" v-model="discount" :precision="2" :step="0.1" :max="10" :min="1"
                <el-input-number style="width: 140px" v-model="discount" :precision="2" :step="0.1" :max="10" :min="0"
                  @change="numberChange" :disabled="isfalse"></el-input-number>
              </el-form-item>
              <el-form-item label="实收金额">
@@ -756,6 +756,7 @@
</template>
<script>
import Big from 'big.js';
import selectName from "@/components/selectName";
import { dataURLtoFile, random } from "./file";
import { getInfo } from "@/api/login";
@@ -786,6 +787,7 @@
  getconfigKey,
  getHistryTjOrderProByCusIdCard,
  readCertCardInfos,
  gaibianzhekou
} from "@/api/system/tijian";
import { addComp } from "@/api/system/comp";
import { getCompany, queryCompany } from "@/api/team/tuanti";
@@ -1093,10 +1095,20 @@
    isAll(value) {
      return value === '' || value === null;
    },
    // 更新实收金额
    updateProPrice(row) {
      row.nowPrice = Number(row.ordPrice) * (Number(row.discount) / 10);
      const ordPrice = new Big(row.ordPrice);
      const discount = new Big(row.discount);
      const result = ordPrice.times(discount.div(10));  // ordPrice * (discount / 10)
      row.nowPrice = result.toNumber();
      this.TotalPrice = this.tableData1.reduce((sum, item) => {
        return sum.plus(new Big(item.nowPrice || '0'));
      }, new Big(0));
      this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1)*100)/100)*10
    },
    openname() {
      this.$refs.bbb.open = true;
@@ -1592,7 +1604,7 @@
      if (this.discount <= this.getInfodis) {
        this.discount = this.getInfodis;
      }
      this.TotalPrice = (this.TotalPrice1 * (this.discount / 10)).toFixed(2);
      // this.TotalPrice = (this.TotalPrice1 * (this.discount / 10)).toFixed(2);
    },
    /** 登记提交按钮 */
@@ -2210,6 +2222,7 @@
    // },
    resetpackage() {
      this.discount = 10
      if (this.form.cusIdcard) {
        var cusId = this.form.cusIdcard;
      } else {
@@ -2740,7 +2753,7 @@
              }
            });
          } else {
            console.log(失败了);
          }
        });
      } else {
@@ -2777,7 +2790,7 @@
              }
            });
          } else {
            console.log(失败了);
          }
        });
      }
@@ -3091,8 +3104,13 @@
        let paidIn = this.TotalPrice.toString();
        let discount = this.discount;
        this.tjFlowingWater = { copeWith, paidIn, discount };
        const newArray = this.tableData1
          .filter(item => item.discount < 10)  // 过滤出 discount < 10 的项
          .map(item => ({ discount: item.discount, parentProId: item.parentProId, cusIdCard: item.cusId }));  // 创建新的对象,包含 discount 和 id
        gaibianzhekou(newArray).then((res) => {
          if (res.code === 200) {
        let data;
        if (pacId || this.tjOrderList.length > 0) {
          data = {
            photo: this.srcUrl,
@@ -3103,6 +3121,7 @@
            tjType,
            tjCategory: this.tjCategory,
          };
          this.listgetOrder(data);
        } else if (pacId || this.tjOrderList.length > 0) {
          data = {
@@ -3121,6 +3140,11 @@
          });
        }
      } else {
            this.$modal.msgError("改变折扣错误");
          }
        })
      } else {
        this.$modal.msgError("请选择体检类别");
      }
    },