index.vue 4.67 KB
Newer Older
1 2 3 4 5 6 7 8
<!--
 * @Author: gjn
 * @Date: 2023-11-10 10:29:39
 * @Description:批量签审_检验入库响应
-->
<template>
  <div class="warehouseInTest">
    <dee-as-com
9 10 11 12
      ref="search"
      :lay-config="{ typeName: 'JobResponseInStorage', layKey: 'batchSign_jobResExp_search'}"
      :basic-data="defaultData"
      @searchEvent="searchEvent"
13
    />
14 15 16 17 18
    <!-- tab页签 -->
    <el-tabs v-model="active" type="border-card" class="detailTabs" @tab-click="tabClick">
      <el-tab-pane :label="'器材验收单(' + totals.MaterialTotal + ')'" name="Material">
        <dee-as-com
          ref="MaterialTable"
19
          v-dee-loading="loadingMaterial"
20 21 22 23 24 25 26 27 28 29
          class="list-table"
          :basic-data=" {...basicData,tableType:'Material'}"
          :lay-config="{ typeName: 'JobResponseInStorage', layKey: 'batchSign_jobResponseInTest'}"
          @requestSuccess="onRequestSuccess($event,'Material')"
          @selectionChange="selectionChange($event,'Material')"
        />
      </el-tab-pane>
      <el-tab-pane :label="'机载系统设备验收单(' + totals.AirEquipmentTotal + ')'" name="AirEquipment">
        <dee-as-com
          ref="AirEquipmentTable"
30
          v-dee-loading="loadingAirEquipment"
31
          class="list-table"
32
          :lay-config="{ typeName: 'JobResponseInStorage', layKey: 'airborne_batchSign_jobResponseInTest'}"
33 34 35 36 37 38 39 40
          :basic-data=" {...basicData,tableType:'AirEquipment'}"
          @requestSuccess="onRequestSuccess($event,'AirEquipment')"
          @selectionChange="selectionChange($event,'AirEquipment')"
        />
      </el-tab-pane>
      <el-tab-pane :label="'外包产品验收单(' + totals.OutSourceTotal + ')'" name="OutSource">
        <dee-as-com
          ref="OutSourceTable"
41
          v-dee-loading="loadingOutSource"
42
          class="list-table"
43
          :lay-config="{ typeName: 'JobResponseInStorage', layKey: 'outsource_batchSign_jobResponseInTest'}"
44 45 46 47 48 49
          :basic-data="{...basicData,tableType:'OutSource'}"
          @requestSuccess="onRequestSuccess($event,'OutSource')"
          @selectionChange="selectionChange($event,'OutSource')"
        />
      </el-tab-pane>
    </el-tabs>
50 51 52 53 54
  </div>
</template>

<script>
export default {
55
  name: 'WarehouseExamine',
56 57 58 59 60 61 62 63
  components: {},
  props: {
    selectData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
64
    const _that = this
65
    return {
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
      active: 'Material',
      defaultData: {},
      totals: {
        MaterialTotal: 0,
        AirEquipmentTotal: 0,
        OutSourceTotal: 0
      },
      billTypeList: [],
      searchItems: [],
      tabNames: [
        'Material',
        'AirEquipment',
        'OutSource'
      ],
      selectionRows: {},
81 82 83 84
      basicData: { selectData: _that.selectData, selectionRows: [] },
      loadingMaterial: false,
      loadingAirEquipment: false,
      loadingOutSource: false
85 86
    }
  },
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
  computed: {
  },
  watch: {
    selectData: {
      immediate: true,
      deep: true,
      handler(val) {
        if (val && val.taskKey) {
          this.$nextTick(() => {
            this.getTableData()
          })
        }
      }
    }
  },
  created() {
  },
104 105 106
  mounted() {
    this.$bus.$on('refreshBackItem', () => {
      this.$nextTick(() => {
107 108 109 110
        if (this.$refs[this.active + 'Table']) {
          (this.$refs[this.active + 'Table'].$refs.asCom.selfDrawerShow = false)
          this.$refs[this.active + 'Table'].$refs.asCom.getData(this.searchItems)
        }
111 112 113 114 115
      })
    })
  },
  // 组件方法
  methods: {
116
    onRequestSuccess(res, tabName) {
117
      this['loading' + tabName] = false
118 119 120 121 122 123 124 125
      this.$set(this.totals, tabName + 'Total', res.items.totalElements)
    },
    searchEvent(val) {
      this.searchItems = val.items
      this.getTableData()
    },
    getTableData() {
      this.tabNames.forEach(item => {
126
        this['loading' + item] = true
127 128 129 130 131 132 133 134 135 136 137
        const el = this.$refs[item + 'Table']
        if (el && el.$refs.asCom) {
          el.$refs.asCom.getData(this.searchItems)
        }
      })
    },
    selectionChange(val, tabName) {
      this.$set(this.basicData, 'selectionRows', val)
    },
    tabClick() {
      this.$set(this.basicData, 'selectionRows', [])
138 139 140 141 142 143 144 145 146 147 148
    }
  }
}
</script>

<style  lang='scss'>
.warehouseInTest{
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding:0 4px;
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
  .detailTabs {
    height: calc(100% - 40px);
    border: 0;
    .dee-table-header{
      padding: 0px 10px;
      .dee-tools{
       margin: 4px 0;
     }
    }
  }
  .el-tabs--border-card > .el-tabs__content {
    padding: 0px;
    height: calc(100% - 70px);
    .el-tab-pane{
      height: 100%;
    }
  }
  .el-tabs--border-card > .el-tabs__header {
    .el-tabs__nav-wrap {
      margin: 0px;
    }
    .el-tabs__item.is-active {
      color: #409eff;
    }
  }
174 175
}
</style>