hdy
2024-03-23 21508c20a9b80b959d935bdf4ed55002fcff8d16
jcdm-ui/src/views/main/em/inspectionPlan/index.vue
@@ -214,10 +214,10 @@
      </el-form>
      <el-tabs type="border-card" >
        <el-tab-pane label="设备清单" >
          <Checkmachinery ref="machinerylist"  @inSelected="onMachineryAdd"></Checkmachinery>
          <Checkmachinery ref="machinerylist"  :id="form.id" :planCode="form.planCode" @inSelected="onMachineryAdd" ></Checkmachinery>
        </el-tab-pane>
        <el-tab-pane label="点检项目">
          <Checksubject ref="subjectlist"      @subSelected="subMachineryAdd"></Checksubject>
          <Checksubject ref="subjectlist"    :id="form.id"  @subSelected="subMachineryAdd"></Checksubject>
            </el-tab-pane>
          </el-tabs>
      <el-divider></el-divider>
@@ -238,6 +238,7 @@
  name: "InspectionPlan",
  dicts: ['plan_status','plan_type','dimension'],
  components:{Checkmachinery,Checksubject},
  data() {
    return {
      // 遮罩层
@@ -246,6 +247,7 @@
      optType: null,
      // 选中数组
      ids: [],
      planCodes: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
@@ -345,7 +347,16 @@
    this.getList();
  },
  methods: {
    /** 查询点检保养计划列表 */
    clearCheckmachineryList(){
      this.$refs.machinerylist.clearCheckmachineryList()
    },
    clearSubjectList() {
      this.subjectList = [];
    },
    clearMachineryList(){
      this.machineryList =[];
    },
      /** 查询点检保养计划列表 */
    getList() {
      this.loading = true;
      listInspectionPlan(this.queryParams).then(response => {
@@ -358,6 +369,7 @@
    cancel() {
      this.open = false;
      this.reset();
      this.clearCheckmachineryList()
    },
    // 表单重置
    reset() {
@@ -406,18 +418,22 @@
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.planCode =selection.map(item => item.planCode)
      this.single = selection.length!==1
      this.multiple = !selection.length
      console.log(this.planCode)
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.titleName = "添加点检保养计划";
      console.log(this.machineryList)
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
@@ -464,7 +480,9 @@
          }
        }
      });
      this.clearSubjectList();
      this.clearMachineryList();
      this.clearCheckmachineryList()
    },
    /** 删除按钮操作 */
    handleDelete(row) {