lkk
2025-01-14 ad4fe11495d320e59d137f9fa1019792c21d12ea
src/views/system/tijian/index.vue
@@ -590,14 +590,6 @@
                  prop="allProName"
                  :show-overflow-tooltip="true"
                />
                <!-- :selectable="checkSelectable" -->
                <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                <template slot-scope="scope">
                  <el-button size="mini" type="text" icon="el-icon-circle-check" @click="handleSeach(scope.row)"
                    v-hasPermi="['system:package:Seach']">套餐详情
                  </el-button>
                </template>
</el-table-column> -->
              </el-table>
            </div>
          </div>
@@ -715,18 +707,6 @@
        </el-tab-pane>
        <el-tab-pane label="单项" name="second">
          <div class="tab8">
            <!-- <div class="tab7">
              <v-tree-transfer
                :treeData="treedataList"
                :defaultProps="{ children: 'tjProjectList', label: 'proName' }"
                :defaultKeys="defaultKeys"
                @changeKeys="changeCategoryKeys"
                :key="datekey"
              ></v-tree-transfer> -->
            <!-- <el-tree :data="data" show-checkbox node-key="proId" :props="defaultProps" :default-checked-keys="treeList"
                @check-change="handleCurrentChecked">
              </el-tree> -->
            <!-- </div> -->
            <el-row :gutter="20">
              <el-col :span="6">
                <div
@@ -959,11 +939,11 @@
                  ref="inputNumber"
                  style="width: 150px"
                  v-model="discount"
                  :precision="2"
                  :precision="1"
                  :step="0.1"
                  :max="10"
                  :min="0"
                  @change="numberChange"
                  @change="debounceNumberChange"
                  :disabled="isfalse"
                ></el-input-number>
              </el-form-item>
@@ -972,7 +952,9 @@
                  placeholder="实收金额"
                  v-model="TotalPrice"
                  style="width: 206px"
                ></el-input>
                  @input="changeXianjia"
                  @blur="numberChangeXianPrice(discount, discount)"
                />
              </el-form-item>
              <br />
@@ -1108,17 +1090,18 @@
              <el-table-column label="折扣">
                <template slot-scope="scope">
                  <!-- 只输入纯数字折扣 -->
                  <el-input
                  <el-input-number
                    v-model.number="scope.row.discount"
                    @input="validateDiscount(scope.row)"
                    placeholder="输入折扣"
                    size="small"
                    type="number"
                    min="0"
                    step="1"
                    max="10"
                    :precision="1"
                    :step="0.1"
                    :max="10"
                    :min="0"
                  >
                  </el-input>
                  </el-input-number>
                </template>
              </el-table-column>
              <el-table-column prop="nowPrice" label="实收金额">
@@ -1275,11 +1258,11 @@
                <el-input-number
                  style="width: 140px"
                  v-model="discount"
                  :precision="2"
                  :precision="1"
                  :step="0.1"
                  :max="10"
                  :min="0"
                  @change="numberChange"
                  @change="debounceNumberChange"
                  :disabled="isfalse"
                ></el-input-number>
              </el-form-item>
@@ -1730,6 +1713,19 @@
  mounted() {},
  methods: {
    debounceNumberChange(currentValue, oldValue) {
      clearTimeout(this.debounceTimer);
      this.debounceTimer = setTimeout(() => {
        this.numberChange(currentValue, oldValue);
      }, 300);
    },
    changeXianjia() {
      // 原始折扣率计算
      if (this.TotalPrice1 !== 0) {
        this.discount =
          (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10;
      }
    },
    clear() {
      this.form.firmId = "";
    },
@@ -2130,25 +2126,6 @@
        this.srcUrl = response.url;
      });
    },
    // base64转文件
    // dataURLtoFile(image, filename) {
    //   var arr = image.split(",");
    //   var mime = arr[0].match(/:(.*?);/)[1];
    //   var bstr = atob(arr[1]);
    //   var n = bstr.length;
    //   var u8arr = new Uint8Array(n);
    //   while (n--) {
    //     u8arr[n] = bstr.charCodeAt(n);
    //   }
    //   return new File([u8arr], filename, { type: mime });
    // },
    // 关闭摄像头
    // stopNavigator() {
    //   this.thisVideo.srcObject.getTracks()[0].stop();
    //   this.beat = false;
    // },
    handleClose(done) {
      this.$confirm("确认关闭?")
@@ -2160,11 +2137,6 @@
    /** 查询信息列表 */
    getList() {
      // listCustomer(this.queryParams).then((response) => {
      //   this.customerList = response.rows;
      //   this.total = response.total;
      //   this.loading = false;
      // });
      getInfo().then((response) => {
        this.getInfodis = response.user.discount;
        if (this.getInfodis === null) {
@@ -2221,8 +2193,6 @@
    },
    /** 重置按钮操作 */
    resetQuery() {
      // this.resetForm("form");
      // this.form = {};
      if (this.confirm === true) {
        this.$tab.refreshPage();
      } else {
@@ -2263,19 +2233,61 @@
            item.discount = this.discount;
            const ordPrice = new Big(item.ordPrice);
            const discount = new Big(item.discount);
            const result = ordPrice.times(discount.div(10)); // ordPrice * (discount / 10)
            const result = ordPrice.times(discount.div(10));
            item.nowPrice = result.toNumber();
            this.TotalPrice = this.tableData1.reduce((sum, item) => {
              return sum.plus(new Big(item.nowPrice || "0"));
            }, new Big(0));
          });
          // ----------------------------------------------------------
        })
        .catch(() => {
          this.discount = oldValue;
        });
    },
    numberChangeXianPrice(currentValue, oldValue) {
      this.$confirm("确定修改所有子项的折扣吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.discount = currentValue;
          if (this.discount < this.getInfodis) {
            this.discount = this.getInfodis;
          }
          let totalYsprice = new Big(0);
          this.tableData1.forEach((item) => {
            item.discount = this.discount;
            const ordPrice = new Big(item.ordPrice);
            const discount = new Big(item.discount);
            const result = ordPrice.times(discount.div(10));
            item.nowPrice = result.toNumber();
            totalYsprice = totalYsprice.plus(new Big(item.nowPrice));
          });
          if (!totalYsprice.eq(this.TotalPrice)) {
            const diff = new Big(this.TotalPrice).minus(totalYsprice);
            if (this.tableData1.length > 0) {
              const lastItem = this.tableData1[this.tableData1.length - 1];
              const newYsPrice = new Big(lastItem.nowPrice)
                .plus(diff)
                .toNumber();
              console.log(
                "hhh",
                this.tableData1[this.tableData1.length - 1].nowPrice,
                newYsPrice
              );
              this.$set(
                this.tableData1[this.tableData1.length - 1],
                "nowPrice",
                newYsPrice
              );
            }
          }
        })
        .catch(() => {
          this.discount = oldValue;
        });
    },
    /** 登记提交按钮 */
    submitForm() {
      let _this = this;
@@ -2524,15 +2536,7 @@
        }
      } else {
        this.$message.warning("请放置身份证后再点击读取");
      } /* if (resultObj.resultFlag == "-1") {
          if (resultObj.errorMsg == "端口打开失败") {
            //alert("读卡器未连接");
          } else {
            //alert(resultObj.errorMsg);
          }
        } else if (resultObj.resultFlag == "-2") {
          //alert(resultObj.errorMsg);
        } */
      }
    },
    // TODO 以下代码可能是泾川使用的
    jingChuanHandlerWebSocketResult(resultObj) {
@@ -2684,23 +2688,9 @@
          alert("请检查读卡器连接是否正常");
        };
      } else {
        // if (_this.inputSSS.indexOf(":1") != -1) {
        //   var str1 = _this.inputSSS.indexOf(":1");
        //   var result1 = _this.inputSSS.substring(0, str1);
        //   var str2 = _this.inputSSS.indexOf(":1");
        //   var result2 = _this.inputSSS.substring(
        //     str2 + 2,
        //     _this.inputSSS.length
        //   );
        //   _this.inputSSS = result1 + result2;
        // }
        _this.inputSSS = _this.inputSSS.replace(":1", "");
        var websocket = null;
        var url = this.valueUrls;
        // var url = 'ws://'+ getIp() +':6789/websocket'
        if ("WebSocket" in window) {
          websocket = new WebSocket(url);
        } else if ("MozWebSocket" in window) {
@@ -2873,53 +2863,6 @@
      }
    },
    // 点击多选框获取选中数据
    // handleSelectionChange(selection, row) {
    //   this.tableData = selection;
    //   if (selection.length > 1) {
    //     let del_row = selection.shift();
    //     this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
    //   }
    // this.single = selection.length !== 1;
    // this.multiple = !selection.length;
    // this.tableData.forEach((item) => {
    //   this.fData = item.tjProjectList;
    // });
    // if (selection[0]) {
    //   this.DataList = [];
    // this.data = JSON.parse(JSON.stringify(this.dXData));
    //     if (selection[0].tjProjectList) {
    //       selection[0].tjProjectList.forEach((selectionitem) => {
    //         this.treedataList.forEach((item) => {
    //           if (selectionitem.proName == item.proName) {
    //             item.disabled = true;
    //             item.tjProjectList = [];
    //           }
    //           if (item.tjProjectList) {
    //             item.tjProjectList.forEach((item1) => {
    //               if (selectionitem.proName == item1.proName) {
    //                 item1.disabled = true;
    //                 item1.tjProjectList = [];
    //               }
    //               if (item1.tjProjectList) {
    //                 item1.tjProjectList.forEach((item2) => {
    //                   if (selectionitem.proName == item2.proName) {
    //                     item2.disabled = true;
    //                     item2.tjProjectList = [];
    //                   }
    //                 });
    //               }
    //             });
    //           }
    //         });
    //       });
    //     }
    //   } else {
    //     this.treedataList = JSON.parse(JSON.stringify(this.dXData));
    //     return;
    //   }
    // },
    resetpackage() {
      this.discount = 10;
      if (this.form.cusIdcard) {
@@ -2931,6 +2874,13 @@
      _this.pacId = "";
      this.proIds = [];
      this.tjCategory = "12";
      this.DataList = []; // 清空已选项目列表
      this.checkedkey = []; // 清空树的选中状态
      this.checkedListkey = [];
      this.TreedataList = [];
      this.$refs.tree.setCheckedKeys([]); // 重置树选中状态
      let data = {
        cusId,
        pacId: _this.pacId,
@@ -3431,6 +3381,7 @@
                      this.treeList.push(item9.proId);
                    });
                  }
                  this.TotalPrice = 0;
                  this.TotalPrice1 += item.ordPrice;
                  this.TotalPrice += item.nowPrice;
@@ -3473,6 +3424,7 @@
                      this.treeList.push(item9.proId);
                    });
                  }
                  this.TotalPrice = 0;
                  this.TotalPrice1 += item.ordPrice;
                  this.TotalPrice += item.nowPrice;
@@ -3746,8 +3698,6 @@
    listgetOrder(data) {
      getOrder(data).then((res) => {
        this.$modal.msgSuccess("提交成功");
        // this.dialogVisibles = true;
        // this.url = window.webkitURL.createObjectURL(res); //将后端返回的blob文件读取出url
        //调接口显示导检单
        const tjNumber = res.msg;
        const viewNum = "792931586196398080";