Fixiaobai
2023-08-30 5cd744dcc854a9203234fc95d55521c8caa8dd6d
src/views/inspectionManagement/commissionInspection/addCommision.vue
@@ -177,12 +177,11 @@
                     <el-col :span="11">
                        <el-form-item label="规格型号:">
                           <el-select v-model="addPointerForm.specificationsModels" size="small" placeholder="请先选择样品名称">
                              <el-option v-for="options in model_spe_options" :value="options.value"
                              <el-option v-for="options in model_sta_options" :value="options.value"
                                 :key="options.key">{{ options.value }}</el-option>
                           </el-select>
                        </el-form-item>
                     </el-col>
                  </el-row>
                  <el-row :gutter="50">
@@ -191,13 +190,11 @@
                           <el-input type="text" v-model="addPointerForm.unit" placeholder="请输入单位" autocomplete="off" />
                        </el-form-item>
                     </el-col>
                     <el-col :span="11">
                        <el-form-item label="样品数量:">
                           <el-input type="text" v-model="addPointerForm.samplesNumber" placeholder="请输入数量" autocomplete="off" />
                        </el-form-item>
                     </el-col>
                  </el-row>
                  <el-row :gutter="50">
                     <el-col :span="9">
@@ -210,7 +207,8 @@
                     </el-col>
                     <el-col :span="41">
                        <el-form-item label="备注:">
                           <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 20}"  style="width: 200px;" v-model="addPointerForm.remarks" placeholder="请输入备注" autocomplete="off" />
                           <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 20}" style="width: 200px;"
                              v-model="addPointerForm.remarks" placeholder="请输入备注" autocomplete="off" />
                        </el-form-item>
                     </el-col>
                  </el-row>
@@ -231,7 +229,8 @@
      getModelSpecification,
      getlink,
      addInspection,
      isIfViewUUID
      isIfViewUUID,
      getContractsSampleInfo
   } from '@/api/inspection/commisioninspection'
   export default {
      data() {
@@ -288,6 +287,8 @@
               value: ''
            }],
            model_spe_options: [],
            model_sta_options: [],
            model_options: [],
            sampleDeliveryMode: [{
               key: '1',
               value: '送样'
@@ -300,10 +301,31 @@
            viewId: null
         }
      },
      watch: {
         addPointerForm: {
            handler: function(val) {
               if(val.addway!=""){
                  this.model_sta_options = []
                  this.model_options.forEach(a=>{
                     if(a.specificationsName==val.addway){
                        this.model_sta_options = a.children.map(item=>{
                           return{
                              key: item.modelId,
                              value: item.modelName
                           }
                        })
                     }
                  })
               }
            },
            deep: true
         }
      },
      created() {
         this.viewId = this.$route.params.viewId
         this.$store.commit('settings/SAVE_LINK', this.viewId)
         this.getlink(this.$route.params.viewId)
         this.getContractsSampleInfo(this.$route.params.viewId)
      },
      mounted() {
         this.getSampleName()
@@ -324,6 +346,10 @@
               }
            })
         },
         async getContractsSampleInfo(viewId){
            let res=await getContractsSampleInfo({viewId})
            console.log(res.data);
         },
         async getSampleName() {
            const res = await getSampleName()
            this.sampleoptions = res.data.map((item) => {
@@ -338,6 +364,7 @@
            const res = await getModelSpecification({
               materialId: val
            })
            this.model_options = res.data
            this.model_spe_options = res.data.map((item) => {
               return {
                  key: item.specificationsId,
@@ -351,7 +378,7 @@
            for (let i = 1; i < this.addPointerForm.experiment.length; i++) {
               exper += ',' + this.addPointerForm.experiment[i]
            }
            // console.log(exper)
            this.addPointerForm.experiment = exper
            let tmp = this.addPointerForm
@@ -424,15 +451,15 @@
</script>
<style lang="scss" scoped>
.content-main{
  padding: 20px 40px;
  background-color: #f0f2f5;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  // align-items: center;
   .content-main {
      padding: 20px 40px;
      background-color: #f0f2f5;
      width: 100%;
      height: 100vh;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      // align-items: center;
      .firstBox {
         .title {