zouyu
2026-05-07 b0d4df5f39525ae7fe252e8ee65d85fd71dca721
src/views/business/materialOrder/customsInspectionOrder.vue
@@ -462,6 +462,7 @@
import {dateFormat} from "@/utils/date";
import AuxiliaryWireCore from "../productOrder/components/auxiliaryWireCore.vue";
import cableConfig from "../productOrder/components/cable-config.vue";
import {bigEval} from "../../../utils/bigEval";
export default {
  name: "CustomsInspectionOrder",
  dicts: ['check_type', 'urgency_level'],
@@ -1206,6 +1207,37 @@
        this.saveLoad = false
      })
    },
    /**
     * 获取小数的最大位数
     * @param number  型号参数
     * @param ask     要求值
     * @param calcNum 计算值
     */
    getDecimalPlaces(number, ask, calcNum) {
      console.log("计算小数点-->", number, ask, calcNum);
      let count1 = 0;
      let count2 = 0;
      const reg = /(\d+\.)(\d+)/g;
      let matches = [];
      if (ask) {
        matches = ask.match(reg);
      }
      if (
        matches &&
        matches.length > 0 &&
        matches[0].toString().indexOf(".") > -1
      ) {
        count1 = matches[0].toString().split(".")[1].length;
      }
      if (number.toString().indexOf(".") > -1) {
        count2 = number.toString().split(".")[1].length;
      }
      if (calcNum.toString().indexOf(".") > -1) {
        const pointLength2 = calcNum.toString().split(".")[1].length;
        count2 = count2 > pointLength2 ? count2 : pointLength2;
      }
      return count1 > count2 ? count1 : count2;
    },
    handleAsk(ask,symbolItem, value) {
      try{
        let code = [">", "<", "=", ">", "<", "≥", "≤", "±", "*", "/"];
@@ -1218,7 +1250,13 @@
            let index = code.findIndex(b => m.includes(b))
            if (index > -1) {
              let arr = m.split(code[index]).filter(b => !!b)
              let num = eval(this.replaceAll(arr[0], symbolItem, value))
              let calcNum = this.$Big(
                bigEval(this.replaceAll(arr[0], symbolItem, value))
              );
              let num = calcNum.toFixed(
                this.getDecimalPlaces(value, ask, calcNum)
              );
              // let num = eval(this.replaceAll(arr[0], symbolItem, value))
              m = code[index] + '' + num
              arr1.push(m)
            }
@@ -1247,7 +1285,13 @@
          let index = code.findIndex(b => ask.includes(b))
          if (index > -1) {
            let arr = ask.split(code[index]).filter(b => !!b)
            let num = eval(this.replaceAll(arr[0], symbolItem, value))
            let calcNum = this.$Big(
              bigEval(this.replaceAll(arr[0], symbolItem, value))
            );
            let num = calcNum.toFixed(
              this.getDecimalPlaces(value, ask, calcNum)
            );
            // let num = eval(this.replaceAll(arr[0], symbolItem, value))
            return code[index] + '' + num
          }
        }
@@ -1840,10 +1884,10 @@
          this.$set(row, 'sectionCopy', row.section)
        }
      }
      if (row.ask.includes('[')) {
      if (row.ask && row.ask.includes('[')) {
        this.$set(row, 'askCopy', row.ask)
      }
      if (row.tell.includes('[')) {
      if (row.tell && row.tell.includes('[')) {
        this.$set(row, 'tellCopy', row.tell)
      }
      let arr = this.productList.filter(m=>m.state==1&&row.sectionCopy&&row.sectionCopy.includes(m.sectionCopy)&&m.ask&&m.sectionCopy.indexOf('[')==-1)
@@ -1906,10 +1950,10 @@
            this.$set(p, 'sectionCopy', p.section)
          }
        }
        if (p.ask.includes('[')) {
        if (p.ask && p.ask.includes('[')) {
          this.$set(p, 'askCopy', p.ask)
        }
        if (p.tell.includes('[')) {
        if (p.tell && p.tell.includes('[')) {
          this.$set(p, 'tellCopy', p.tell)
        }
        if (p.bsm === '1' && p.sectionCopy !== '' && p.sectionCopy !== null && p.sectionCopy !== undefined && p.state === 1) {