value
2023-08-24 57480442a2445e49e7bf25dd52fce5cf85c262a3
src/views/inspectionManagement/commissionInspection/addCommision.vue
@@ -7,9 +7,14 @@
               <div class="tableBox-header">
                  <el-button class="split" @click="dialogueFormVisible = true" type="primary" size="small"
                     style="background-color: rgb(1, 102, 226);">添加样品</el-button>
                  <!-- <el-input v-model="searchData" class="input-form split" placeholder="扫描二维码录入样品..."
                     prefix-icon="el-icon-search" style="width: 200px;">
                  </el-input> -->
                  <!--        <el-input
          v-model="searchData"
          class="input-form split"
          placeholder="扫描二维码录入样品..."
          prefix-icon="el-icon-search"
          style="width: 200px;"
        >
        </el-input>-->
                  <el-button type="primary" size="small" style="background-color: rgb(1, 102, 226);">重置</el-button>
               </div>
               <el-table ref="detectionInfo" :max-height="800" :cell-style="{textAlign: 'center'}"
@@ -41,20 +46,13 @@
                     </template>
                  </el-table-column>
               </el-table>
               <!-- 分页器 -->
               <div>
                  <el-pagination class="pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                     :current-page="currentPage" :page-sizes="[100, 200, 300, 400]" :page-size="100"
                     layout="total, sizes, prev, pager, next, jumper" :total="400">
                  </el-pagination>
               </div>
            </div>
            <div class="secondBox">
               <el-row class="header">
                  <el-col :span="12">基本信息</el-col>
                  <el-col :span="12" style="text-align: right;">
                     <!-- 点击返回,当前页面值为false -->
                     <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">打印委托单</el-button>
                     <!-- <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">打印委托单</el-button> -->
                  </el-col>
               </el-row>
               <el-form :model="infoForm" ref="infoForm" class="infoForm" label-position="right" label-width="100px"
@@ -138,6 +136,8 @@
                  <div class="submitBtn">
                     <el-button type="primary" size="small" @click="submitInspection"
                        style="background-color: rgb(1, 102, 226);">提交</el-button>
                     <!-- 点击返回,当前页面值为false -->
                     <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">打印委托单</el-button>
                  </div>
               </el-form>
            </div>
@@ -149,19 +149,16 @@
                  <el-row :gutter="50">
                     <el-col :span="10">
                        <el-form-item label="样品编号:">
                           <el-select style="width: 160px;" v-model="addPointerForm.sampleNumber" size="small"
                              placeholder="请选择样品编号">
                              <el-option v-for="options in samplecodeoptions" :value="options.value"
                                 :key="options.key">{{ options.value }}</el-option>
                           </el-select>
                           <el-input style="width: 160px;" v-model="addPointerForm.sampleNumber" size="small" disabled>
                           </el-input>
                        </el-form-item>
                     </el-col>
                     <el-col :span="10">
                        <el-form-item label="样品名称:">
                           <el-select style="width: 160px;" v-model="addPointerForm.sampleName" size="small"
                              placeholder="请选择样品名称">
                              <el-option v-for="options in sampleoptions" :value="options.value"
                                 :key="options.key">{{ options.value }}</el-option>
                              placeholder="请选择样品名称" @change="upMaterialName">
                              <el-option v-for="options in sampleoptions" :value="options.key"
                                 :label="options.value"></el-option>
                           </el-select>
                        </el-form-item>
                     </el-col>
@@ -170,7 +167,7 @@
                     <el-col :span="10">
                        <el-form-item label="规格型号:">
                           <el-select style="width: 160px;" v-model="addPointerForm.specificationsModels" size="small"
                              placeholder="请选择样品名称">
                              placeholder="请先选择样品名称">
                              <el-option v-for="options in model_spe_options" :value="options.value"
                                 :key="options.key">{{ options.value }}</el-option>
                           </el-select>
@@ -226,9 +223,6 @@
      addInspection,
      isIfViewUUID
   } from '@/api/inspection/commisioninspection'
   import {
      time
   } from 'echarts';
   export default {
      data() {
         return {
@@ -283,13 +277,7 @@
               key: '1',
               value: ''
            }],
            model_spe_options: [{
               key: '1',
               value: '选项1'
            }, {
               key: '2',
               value: '选项2'
            }],
            model_spe_options: [],
            sampleDeliveryMode: [{
               key: '1',
               value: '送样'
@@ -297,19 +285,20 @@
               key: '2',
               value: '上门'
            }],
            dialogueFormVisible: false
            dialogueFormVisible: false,
            showDetail: false,
            viewId: null
         }
      },
      created() {
         this.viewId = this.$route.params.viewId
         this.$store.commit('settings/SAVE_LINK',this.viewId)
         this.getlink(this.$route.params.viewId)
         console.log();
      },
      mounted() {
         // this.getSampleName()
         // this.getModelSpecification()
         this.getSampleName()
      },
      methods: {
         // 获取链接link
         getlink(viewId) {
            if (viewId == null) {
               this.$message.error('当前链接不在有效期内,系统自动关闭')
@@ -333,16 +322,10 @@
                  value: item.name
               }
            })
            this.samplecodeoptions = res.data.map((item) => {
               return {
                  key: item.id.toString(),
                  value: item.code
               }
            })
         },
         async getModelSpecification() {
         async getModelSpecification(val) {
            const res = await getModelSpecification({
               materialId: '1'
               materialId: val
            })
            this.model_spe_options = res.data.map((item) => {
               return {
@@ -357,6 +340,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
            this.detectionInfo.push(tmp)
@@ -393,6 +377,31 @@
               sampleDeliveryPhone: this.infoForm.sendertel,
               sampleSender: this.infoForm.sender
            })
            //       const res = await addInspection({
            //   completionDeadline: "2023-08-03",
            //   contactAddress: "江苏南通",
            //   contactNumber: "12321423432",
            //   contacts: "小黑",
            //   entrustRemarks: "委托备注YPBH123456789YPBH123456789YPBH123456789",
            //   entrusted: "阿里巴巴",
            //   inspectionTime: "2023-08-03",
            //   linkDetectionList: [
            //     {
            //       "experiment": "做梦",
            //       "remarks": "通过了",
            //       "sampleName": "发动机",
            //       "sampleNumber": "YPBH123456789",
            //       "samplesNumber": 20,
            //       "specificationsModels": "GGXH-AAAAA",
            //       "unit": "百度"
            //     }
            //   ],
            //   reportNumber: 23,
            //   sampleDeliveryMode: 1,
            //   sampleDeliveryPhone: "123456789676",
            //   sampleSender: "小白"
            // })
            // console.log(res)
            this.infoForm.commisioncode = res.data
            if (res.data) {
               this.$message({
@@ -401,6 +410,7 @@
               })
               // 跳转页面
               this.$router.push('/inspectionManagement/commissionInspection')
               this.showDetail = true
            } else {
               this.$message.error(res.message)
            }
@@ -414,75 +424,90 @@
         deleteRow(row) {
            console.log(row)
            row = null
         },
         upMaterialName(val){
            console.log(val);
            this.getModelSpecification(val)
         }
      }
   }
</script>
<style lang="scss" scoped>
   .add_commision{
      padding: 20px;
   }
   .firstBox {
      .title {
         padding: 15px 10px;
         font-size: 18px;
         background-color: #0166e2;
         color: #fff;
         border-radius: 4px;
      }
   .content-main {
      padding: 20px 40px;
      background-color: #f0f2f5;
      width: 100%;
      height: 100vh;
      .tableBox {
         background-color: #fff;
         padding: 0px 20px;
         margin: 0px -15px;
         flex: 1;
         background: #fff;
         /* padding: 20px 20px 10px 20px; */
         display: flex;
         flex-direction: column;
      .firstBox {
         .title {
            padding: 15px 10px;
            font-size: 18px;
            background-color: #0166e2;
            color: #fff;
            border-radius: 4px;
            margin-bottom: 20px;
         }
         .tableBox-header {
            padding: 20px 0px;
         .tableBox {
            background-color: #fff;
            padding: 0px 20px;
            flex: 1;
            background: #fff;
            /* padding: 20px 20px 10px 20px; */
            display: flex;
            flex-direction: column;
            .split {
               margin-right: 15px;
            .tableBox-header {
               padding: 20px 0px;
               .split {
                  margin-right: 15px;
               }
            }
            .el-table {
               flex: 1;
            }
            >div:nth-child(3) {
               display: flex;
               justify-content: end;
               margin: 10px 0;
            }
         }
      }
         .el-table {
            flex: 1;
      .secondBox {
         .header {
            display: flex;
            justify-content: space-between;
            padding: 10px 20px;
            margin-top: 10px;
         }
         >div:nth-child(3) {
         .submitBtn {
            display: flex;
            justify-content: end;
            margin: 10px 0;
            margin-right: 40px;
            margin-top: 20px;
         }
      }
   }
   .secondBox {
      margin: 0px -15px;
      .infoForm {
         background-color: #fff;
         padding: 20px 50px;
      .header {
         display: flex;
         justify-content: space-between;
         padding: 10px 20px;
         margin-top: 10px;
         .formwrapper {
            margin: 20px 0px;
            padding-left: 30px;
            .el-row {
               margin: 10px 0px;
            }
         }
      }
      .submitBtn {
         display: flex;
         justify-content: end;
         margin-right: 156px;
         margin-top: 20px;
      }
   }
   .infoForm {
      background-color: #fff;
      padding: 20px 50px;
   }
</style>