licp
2024-07-23 da498efb165dbada586396baecc71c644e46b1e8
src/components/do/b1-ins-order/add.vue
@@ -565,8 +565,17 @@
          <el-col class="search_thing" :span="22">
            <div class="search_label"><span class="required-span" v-if="addObj.type == 2">* </span>指派人员:</div>
            <div class="search_input">
              <el-select v-model="distributeData.userId" placeholder="请选择" size="small" filterable style="width: 100%;">
              <el-select v-model="distributeData.userId" placeholder="请选择" size="small" filterable style="width: 100%;" @change="changeUser">
                <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
          </el-col>
          <el-col class="search_thing" :span="22" v-if="distributeData.userId">
            <div class="search_label"><span class="required-span">* </span>试验室:</div>
            <div class="search_input">
              <el-select v-model="distributeData.sonLaboratory" placeholder="请选择" size="small" filterable style="width: 100%;">
                <el-option v-for="item in sonLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </div>
@@ -984,7 +993,8 @@
        issuedDialogVisible: false,
        distributeData: {
          appointed: '',
          userId: ''
          userId: '',
          sonLaboratory:''
        },
        personList: [],
        upLoad: false,
@@ -1051,7 +1061,8 @@
        temperatureTitle: '',
        temperatureTestNum: '',
        isShowInput: false,
        temId: ''
        temId: '',
        sonLaboratoryList:[]
      }
    },
    watch: {
@@ -1230,7 +1241,7 @@
            item.tell = ask
          }
        })
        console.log('ask---', ask)
        // console.log('ask---', ask)
        this.temperatureShow = false
      },
      temperatureShowClose () {
@@ -1279,7 +1290,7 @@
      },
      handleTemperatureTestChange (value) {
        console.log('value---', value)
        // console.log('value---', value)
      },
      handleSelectionChange(val) {
        this.opticalProjectList = val;
@@ -1476,7 +1487,7 @@
              isHaveBushing = false
            }
          })
          console.log('isHaveBushing===', isHaveBushing)
          // console.log('isHaveBushing===', isHaveBushing)
          if (productListSelected && select[2] === '光缆' && isHaveBushing === false) {
            this.$message.error('光缆温度循环项目必须进行光纤配置')
@@ -1802,11 +1813,16 @@
          this.$message.error('指派人员未填写')
          return
        }
        if (this.distributeData.userId&&(this.distributeData.sonLaboratory== null ||this.distributeData.sonLaboratory== '')) {
          this.$message.error('试验室未填写')
          return
        }
        this.upLoad = true;
        this.$axios.post(this.$api.insOrder.upInsOrder, {
          orderId: this.distributeData.orderId,
          appointed: this.distributeData.appointed,
          userId: this.distributeData.userId
          userId: this.distributeData.userId,
          sonLaboratory:this.distributeData.sonLaboratory
        }).then(res => {
          if (res.code === 201) {
            this.upLoad = false
@@ -2070,7 +2086,7 @@
          this.circulateShow = false;
        }
        if ((row.inspectionItem === '温升试验' || row.inspectionItem === '热循环') && row.state === 1) {
          console.log('row---', row)
          // console.log('row---', row)
          this.temperatureTitle = `${row.inspectionItem}要求填写`
          this.isShowInput = row.inspectionItem === '热循环'
          this.temId = row.id
@@ -2323,7 +2339,7 @@
        }
      },
      handleAll(e) {
        console.log('e---', e)
        // console.log('e---', e)
        if (e.length > 0) {
          this.productList.map(m => {
            if(e.find(a=>a.id == m.id)){
@@ -2373,7 +2389,7 @@
            this.circulateShow = false;
          }
          if ((p.inspectionItem === '温升试验' || p.inspectionItem === '热循环') && p.state === 1) {
            console.log('p---', p)
            // console.log('p---', p)
            this.temperatureTitle = `${p.inspectionItem}要求填写`
            this.isShowInput = p.inspectionItem === '热循环'
            this.temId = p.id
@@ -2656,7 +2672,7 @@
      getTotal() {
        this.totalArr = []
        this.total = 0;
        console.log(this.sampleList)
        // console.log(this.sampleList)
        this.sampleList.forEach(item => {
          if (item.insProduct && item.insProduct.length > 0) {
            item.insProduct.forEach(a => {
@@ -2702,7 +2718,6 @@
            if (item.manHourGroup === '' || !item.manHourGroup) {
              return true
            } else {
              console.log(item)
              mySet.add(item.manHourGroup)
              let num2 = mySet.size
              if (num2 > num1) {
@@ -2715,6 +2730,20 @@
        })
        arr0.forEach(item => {
          this.total += Number(item.price)
        })
        let arr1 = this.totalArr.filter(item => item.state == 1)
        let mySet0 = new Set();
        this.sonLaboratoryList = []
        arr1.forEach(item => {
          let num1 = mySet0.size
          mySet0.add(item.sonLaboratory)
          let num2 = mySet0.size
          if(num2>num1){
            this.sonLaboratoryList.push({
              label:item.sonLaboratory,
              value:item.sonLaboratory,
            })
          }
        })
      },
      bsm2Up(val) {
@@ -2731,6 +2760,11 @@
        for (let a of set) {
          this.bsm2Val2.push(this.HaveJson(this.bsm2Val3[a - 1]))
        }
      },
      changeUser(){
        if(this.sonLaboratoryList.length>0){
          this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
        }
      }
    }
  }