src/views/business/productOrder/components/addOrder.vue
@@ -463,10 +463,10 @@
            </div>
          </el-col>
          <el-col v-if="distributeData.userId" :span="22" class="search_thing">
            <div class="search_label"><span class="required-span">* </span>试验室:</div>
            <div class="search_label">试验室:</div>
            <div class="search_input">
              <el-select v-model="distributeData.sonLaboratory" filterable placeholder="请选择" size="small" style="width: 100%;">
                <el-option v-for="item in sonLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
                <el-option v-for="item in newJuLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
@@ -602,6 +602,7 @@
import limsTable from "@/components/Table/lims-table.vue";
import {selectCustomPageList} from "@/api/system/customer";
import {mapGetters} from "vuex";
import { bigEval } from "@/utils/bigEval";
import {addQuarter, updateQuarterOnOrder} from "@/api/business/finishedProductSampling";
export default {
@@ -613,8 +614,11 @@
  },
  computed:{
    ...mapGetters(["nickName", 'nameEn', 'userName']),
    newJuLaboratoryList() {
      return (this.dict.type.sys_sub_lab || []).filter(item => item.label === '新聚')
    },
  },
  dicts: ['check_type1', 'urgency_level', 'form_type', 'sample_status_list'],
  dicts: ['check_type1', 'urgency_level', 'form_type', 'sample_status_list', 'sys_sub_lab'],
  data() {
    return {
      active: '',
@@ -690,9 +694,6 @@
        ],
        production: [
          { required: true, message: '请填写生产单位', trigger: 'blur' }
        ],
        productionEn: [
          { required: true, message: '请填写生产单位EN', trigger: 'blur' }
        ],
      },
      sample: {
@@ -860,6 +861,37 @@
    this.getInfo();
  },
  methods: {
    /**
     * 获取小数的最大位数
     * @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;
    },
    getInfo() {
      this.selectStandardTreeList()
      this.getAuthorizedPerson();
@@ -1045,7 +1077,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)
              }
@@ -1074,7 +1112,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
            }
          }
@@ -1306,7 +1350,7 @@
        })
      }else{
        // 常规提交
        addInsOrder({insOrder: this.addObj, sampleList: sampleList}).then(res => {
        addInsOrder({insOrder: {...this.addObj,typeSource:-1}, sampleList: sampleList}).then(res => {
          this.saveLoad = false
          this.$message.success('已提交')
          this.bsm3Dia = false;
@@ -1335,6 +1379,7 @@
              this.distributeData.appointed = ress.data
            })
            setTimeout(() => {
              this.distributeData.sonLaboratory = this.newJuLaboratoryList.length > 0 ? this.newJuLaboratoryList[0].value : ''
              this.issuedDialogVisible = true;
            }, 1000)
          })
@@ -1351,10 +1396,6 @@
        }
        if (this.distributeData.userId == null || this.distributeData.userId == '') {
          this.$message.error('指派人员未填写')
          return
        }
        if (this.distributeData.userId&&(this.distributeData.sonLaboratory== null ||this.distributeData.sonLaboratory== '')) {
          this.$message.error('试验室未填写')
          return
        }
        this.upLoad = true;
@@ -1386,8 +1427,8 @@
          this.addObj.code = selects.code
          this.addObj.phone = selects.phone
          this.addObj.companyId = selects.departId
          this.addObj.production = '中天科技装备电缆有限公司'
          this.addObj.productionEn = 'Zhongtian Technology Industrial Wire&Cable System CO.,LTD'
          this.addObj.production = ''
          this.addObj.productionEn = ''
          if(this.active==1){
            this.selectInsOrderTemplate()
          }
@@ -2180,8 +2221,8 @@
        })
      },
      changeUser(){
        if(this.sonLaboratoryList.length>0){
          this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
        if(this.newJuLaboratoryList.length>0){
          this.distributeData.sonLaboratory = this.newJuLaboratoryList[0].value
        }
      },
      addProductList(productList,row,index){