zouyu
2023-09-09 2c4d645aa617a737d636964a7a52a1602e717e30
src/views/experiment/inspectionApplication/index.vue
@@ -167,7 +167,7 @@
                        <el-row :gutter="100">
                           <el-col :span="10">
                              <el-form-item label="委托编号">
                                 <el-input style="width: 300px" type="text" disabled :value="commisionSelection.entrust_coding"
                                 <el-input style="width: 300px" type="text" disabled :value="commisionSelection.entrustCoding"
                                    placeholder="请输入来料日期" autocomplete="off" />
                              </el-form-item>
                           </el-col>
@@ -196,20 +196,20 @@
                           <el-col :span="10">
                              <el-form-item label="规格型号:">
                                 <el-input style="width: 300px" type="text" disabled :value="commisionSelection.specifications"
                                    placeholder="请输入型号规格" autocomplete="off" />
                                    placeholder="请输入规格型号" autocomplete="off" />
                              </el-form-item>
                           </el-col>
                           <el-col :span="10">
                              <el-form-item label="送达时间">
                                 <el-input style="width: 300px" type="text" disabled :value="commisionSelection.supplier"
                                    placeholder="请输入单位" autocomplete="off" />
                                 <el-input style="width: 300px" type="text" disabled :value="commisionSelection.formTime"
                                    placeholder="请输入送达时间" autocomplete="off" />
                              </el-form-item>
                           </el-col>
                        </el-row>
                        <el-row :gutter="100">
                           <el-col :span="10">
                              <el-form-item label="完成期限">
                                 <el-input style="width: 300px" type="text" disabled :value="commisionSelection.completionDeadline"
                                 <el-input style="width: 300px" type="text" disabled :value="commisionSelection.endTime"
                                    placeholder="请输入完成期限" autocomplete="off" />
                              </el-form-item>
                           </el-col>
@@ -245,7 +245,7 @@
                           <el-col :span="10">
                              <el-form-item label="规格型号:">
                                    <el-cascader style="width: 300px" v-model="finishedTable.modelandspecification" 
                                    :options="specificationList" :show-all-levels="false" @change="changeSpe"
                                    :options="specificationList" @change="changeSpe"
                                    :props="{label:'name',value:'id',children:'children'}"></el-cascader>
                              </el-form-item>
                           </el-col>
@@ -363,11 +363,6 @@
                        </div>
                     </template>
                  </el-table-column>
                  <el-table-column label="操作" min-width="8%">
                     <template slot-scope="scope">
                        <el-button type="text" size="small">删除</el-button>
                     </template>
                  </el-table-column>
               </el-table>
               <span slot="footer" class="dialog-footer">
                  <el-button @click="commisionVisible = false">取 消</el-button>
@@ -422,7 +417,7 @@
            selectedValue: null,
            infoForm: {},
            commisionSelection: {
               entrust_coding: '',
               entrustCoding: '',
               entrusted: '',
               samples_number: '',
               sample_name: '',
@@ -492,7 +487,7 @@
               };
               this.infoForm = {};
               this.commisionSelection = {
                  entrust_coding: '',
                  entrustCoding: '',
                  entrusted: '',
                  samples_number: '',
                  sample_name: '',
@@ -513,15 +508,18 @@
      },
      methods: {
         changeSpe(val){
            console.log(val);
            this.tmp.specificationsId = val[val.length-1];
            let arr1 = this.specificationList[0].children.filter(item=>{
               return item.id==val[1]
            let arr1 = this.specificationList.filter(item=>{
               return item.id==val[0]
            });
            let arr2 = arr1[0].children.filter(item=>{
               return item.id = val[2]
               return item.id = val[1]
            })
            let speName = arr1[0].name + "-" + arr2[0].name;
            this.speName = speName;
            console.log(arr1);
            console.log(arr2);
         },
         getSpecifications(val){
@@ -537,7 +535,7 @@
         },
         async selectSpecificationByMaterielId(mId){
            await getSpecificationByMaterielId({id : mId}).then(res=>{
               this.specificationList = new Array(res.data);
               this.specificationList = res.data.children;
            }).catch(error => {
               this.$message.error(error.message);
            });
@@ -664,7 +662,7 @@
                  })
               }
            }
            this.total = this.inspectionTable.length
            this.total = this.res.data.total;
         },
         reset() {
            this.countSize = 1;
@@ -686,11 +684,11 @@
         },
         handleCommisionSelection() {
            this.commisionSelection = this.tmp
            this.commisionSelection.checkdate = []
            this.commisionVisible = false
         },
         handleRawMaterialSelection() {
            this.infoForm = this.tmp
            console.log(this.infoForm);
            this.rawmaterialVisible = false
         },
         handleRadioChange() {
@@ -725,6 +723,7 @@
                        checkdate.push(item['updateTime'])
                        item['checkdate'] = checkdate // 检验日期
                     })
                     this.commisionTable = res.data
                  })
               }
@@ -733,6 +732,7 @@
         // 新增检验
         async addInspection() {
            let obj = {};
            //原材料
            if (this.type === 0) {
               obj = {
                  endTime: this.infoForm.checkdate[1],
@@ -749,6 +749,7 @@
                  version: this.version
               }
            }
            //委托
            if (this.type === 2) {
               obj = {
                  endTime: this.commisionSelection.checkdate[1],
@@ -765,14 +766,17 @@
                  version: this.version
               }
            }
            //成品
            if (this.type === 1) {
               obj = {
                  supplier:"supplier",
                  formTime: "2023-09-09",
                  endTime: this.finishedTable.checkdate[1],
                  mcode: this.finishedTable.code,
                  name: this.tmp.name,
                  num: parseInt(this.finishedTable.amount),
                  specifications: this.speName,
                  specificationId: this.finishedTable.modelandspecification[2],
                  specificationId: this.finishedTable.modelandspecification[1],
                  startTime: this.finishedTable.checkdate[0],
                  type: this.type,
                  unit: this.finishedTable.unit,
@@ -802,20 +806,8 @@
            this.currentPage = val
            this.selectInspectsList()
         },
         //    //表单校验
         // validateForm(infoForm){
         //    console.log(this.infoForm);
         //    if (infoForm.checkdate == undefined) {
         //         alert('请输入检验时间');
         //       return false;
         //    }
         //    // 校验通过
         //    return true;
         // },
         //确定跳转
         QUEding() {
            console.log(this.infoForm);
            if (this.type==0 &&(this.infoForm.checkdate[0] == undefined || this.infoForm.checkdate[1] == undefined)) {
               this.$message({
                  message: '请选择检验时间',