licp
2024-12-20 d975fc4756806f5b51f006c19c33571b9b8c0b3b
src/components/do/b1-ins-order/equip-config.vue
@@ -2,7 +2,7 @@
  <div class="ins_order_config">
    <div>
      <el-row class="title">
        <el-col :span="6" style="padding-left: 20px;">电缆配置</el-col>
        <el-col :span="6" style="padding-left: 20px;text-align: left;">子样品配置</el-col>
        <el-col :span="18" style="text-align: right;">
          <el-button size="medium" type="primary" @click="addChild" v-if="active==1">添加子样品</el-button>
          <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-if="active==1">保 存</el-button>
@@ -48,7 +48,7 @@
          <template slot-scope="scope">
            <el-select v-model="scope.row.standardMethodListId" :disabled="scope.row.model==null||active>1"
              placeholder="检验标准" size="small" :loading="methodLoad" @change="(value)=>methodChange(value, scope.row)"
              @focus="methodFocus" :readonly="active>1" style="width: 100%;">
              @focus="methodFocus" :readonly="active>1" style="width: 100%;" multiple>
              <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
              </el-option>
            </el-select>
@@ -81,7 +81,7 @@
          <template slot-scope="scope">
            <el-input size="small" placeholder="要求值" v-model="scope.row.ask" clearable type="textarea"
              :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)"
              v-if="active==1&&isAskOnlyRead"></el-input>
              v-if="active==1"></el-input>
            <span v-else>{{ scope.row.ask }}</span>
          </template>
        </el-table-column>
@@ -220,11 +220,11 @@
        })
      },
      save() {
        if(this.sampleList.length === 0){
        if (this.sampleList.length === 0) {
          this.$message.error('缺少配置无法保存')
          return
        }
        this.parentSample.forEach(a=>{
        this.parentSample.forEach(a => {
          a.childSampleList = this.sampleList
        })
        this.$message.success('已保存')
@@ -240,17 +240,11 @@
        this.selectStandardTree = true
      },
      selectSample(val) {
        if(val === null)return
        if (val === null) return
        this.sampleIds = [val.id]
      },
      rowClick(row, column, event) {
        this.currentMethod = row
        let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
        if (obj && obj.code == '委托要求') {
          this.isAskOnlyRead = true
        } else {
          this.isAskOnlyRead = false
        }
        this.sampleId = row.id
        if (this.active !== 1) {
          this.sampleIds = []
@@ -275,7 +269,7 @@
      },
      handleChangeModel(e) {
        let num = this.selectTree.split('-').length;
        if (num == 4) {
        if (num != 5) {
          this.selectTree = this.selectTree + ' - ' + e
        } else {
          let arr = this.selectTree.split('-')
@@ -286,16 +280,10 @@
      methodChange(val, row) {
        if (val === null || val === '') return
        this.currentMethod = row
        let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
        if (obj && obj.code == '委托要求') {
          this.isAskOnlyRead = true
        } else {
          this.isAskOnlyRead = false
        }
        this.getProductLoad = true
        this.$axios.post(this.$api.standardTree.selectStandardProductList, {
          model: row.model + '-' + row.modelNum,
          standardMethodListId: val,
          standardMethodListId: val.join(','),
          factory: this.selectTree,
        }, {
          headers: {
@@ -458,7 +446,13 @@
        this.addObj.factory = trees[0]
        this.addObj.laboratory = trees[1]
        this.addObj.sampleType = trees[2]
        this.addObj.sample = trees[3]
        if(trees[3]===''){
          this.addObj.sample = (trees[4] == undefined ? null : trees[4])
        }else if(trees[3]===undefined){
          this.addObj.sample = trees[2]
        }else{
          this.addObj.sample = trees[3]
        }
        this.addObj.model = (trees[4] == undefined ? null : trees[4])
        this.selectStandardTree = false
        this.sample.joinName = null
@@ -467,7 +461,7 @@
        this.sample.sample = this.addObj.sample
        this.sample.model = this.addObj.model
        this.sample.unit = this.addObj.unit
        this.sample.standardMethodListId = null
        this.sample.standardMethodListId = []
        this.sample.insProduct = []
        this.sample.id = this.count
        this.sample.num = this.addObj.sampleNum
@@ -496,7 +490,11 @@
      },
      getNodeParent(val) {
        if (val.parent != null) {
          this.selectTree += ' - ' + val.label
          if (val.data.children === null) {
            this.selectTree += ' - ' + val.label + ' - ' + ''
          } else {
            this.selectTree += ' - ' + val.label
          }
          this.getNodeParent(val.parent)
        }
      },