hdy
2024-03-16 406ad2e52a8963f1748c399b0da9dfae8cd58b49
jcdm-ui/src/views/main/em/inspectionPlan/machinery.vue
@@ -23,7 +23,7 @@
        >删除</el-button>
      </el-col>
    </el-row>
    <MachinerySelect ref="machinerySelect" @onSelected="onMachineryAdd"></MachinerySelect>
    <MachinerySelect ref="machinerySelect" @onSelected="onMachineryAdd" ></MachinerySelect>
    <el-table v-loading="loading" :data="checkmachineryList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="设备编码" align="center" prop="equipmentCode" />
@@ -114,14 +114,21 @@
      this.$refs.machinerySelect.showFlag = true;
    },
      //设备资源选择回调
    onMachineryAdd(rows){
      if(rows !=null && rows.length >0){
         rows.forEach(row => {
            row.planId = this.planId;
           addInspectionPlanArchives(row).then(response =>{
              this.getList();
            });
         });
    // onMachineryAdd(rows){
    //   if(rows !=null && rows.length >0){
    //      rows.forEach(row => {
    //         row.planId = this.planId;
    //        addInspectionPlanArchives(row).then(response =>{
    //           this.getList();
    //         });
    //      });
    //   }
    // },
    onMachineryAdd(selectedRows){
      if(selectedRows !=null && selectedRows.length >0){
        this.checkmachineryList.spareField1 = this.planCode
        this.checkmachineryList = selectedRows
        console.log(this.checkmachineryList)
      }
    },
    /** 删除按钮操作 */