index.vue 3.82 KB
Newer Older
jingnan's avatar
jingnan committed
1 2 3
<!--
 * @Author: gjn
 * @Date: 2023-08-01 10:28:07
4
 * @Description:批量签审_验收入库申请
jingnan's avatar
jingnan committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
-->
<template>
  <div class="warehouseApply">
    <dee-as-com
      ref="search"
      :lay-config="{ typeName: 'InStorageRequestItem', layKey: 'warehouse_search'}"
      :basic-data="defaultData"
      @searchEvent="searchEvent"
    />
    <!-- tab页签 -->
    <el-tabs v-model="active" type="border-card" class="detailTabs">
      <el-tab-pane :label="'器材验收单(' + totals.MaterialTotal + ')'" name="Material">
        <dee-as-com
          ref="MaterialTable"
          class="list-table"
          :basic-data=" { selectData: selectData }"
          :lay-config="{ typeName: 'InStorageRequestItem', layKey: 'material_table'}"
22
          @requestSuccess="onRequestSuccess($event,'Material')"
jingnan's avatar
jingnan committed
23 24 25 26 27 28 29 30
        />
      </el-tab-pane>
      <el-tab-pane :label="'机载系统设备验收单(' + totals.AirEquipmentTotal + ')'" name="AirEquipment">
        <dee-as-com
          ref="AirEquipmentTable"
          class="list-table"
          :lay-config="{ typeName: 'InStorageRequestItem', layKey: 'airEquipment_table'}"
          :basic-data=" { selectData: selectData }"
31
          @requestSuccess="onRequestSuccess($event,'AirEquipment')"
jingnan's avatar
jingnan committed
32 33 34 35 36 37 38 39
        />
      </el-tab-pane>
      <el-tab-pane :label="'外包产品验收单(' + totals.OutSourceTotal + ')'" name="OutSource">
        <dee-as-com
          ref="OutSourceTable"
          class="list-table"
          :lay-config="{ typeName: 'InStorageRequestItem', layKey: 'outSource_table'}"
          :basic-data=" { selectData: selectData }"
40
          @requestSuccess="onRequestSuccess($event,'OutSource')"
jingnan's avatar
jingnan committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
        />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
export default {
  name: 'WarehouseApply',
  components: {},
  props: {
    selectData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      active: 'Material',
      defaultData: {},
      totals: {
        MaterialTotal: 0,
        AirEquipmentTotal: 0,
        OutSourceTotal: 0
      },
      billTypeList: [],
      searchItems: [],
      tabNames: [
        'Material',
        'AirEquipment',
        'OutSource'
      ]
    }
  },
  computed: {
  },
  watch: {
    selectData: {
      immediate: true,
      deep: true,
      handler(val) {
        if (val && val.taskKey) {
          this.$nextTick(() => {
            this.getTableData()
          })
        }
      }
    }
  },
  created() {
  },
  mounted() {
93 94 95 96 97 98 99
    this.$bus.$on('refreshInstorageItem', () => {
      this.$nextTick(() => {
        if (this.$refs[this.active + 'Table']) {
          this.$refs[this.active + 'Table'].$refs.asCom.getData(this.searchItems)
        }
      })
    })
jingnan's avatar
jingnan committed
100 101 102
  },
  // 组件方法
  methods: {
103 104
    onRequestSuccess(res, tabName) {
      this.$set(this.totals, tabName + 'Total', res.items.totalElements)
jingnan's avatar
jingnan committed
105 106 107
    },
    searchEvent(val) {
      this.searchItems = val.items
jingnan's avatar
jingnan committed
108 109 110
      this.getTableData()
    },
    getTableData() {
111 112 113 114 115 116
      this.tabNames.forEach(item => {
        const el = this.$refs[item + 'Table']
        if (el && el.$refs.asCom) {
          el.$refs.asCom.getData(this.searchItems)
        }
      })
jingnan's avatar
jingnan committed
117 118 119 120 121 122 123 124
    }
  }
}
</script>

<style  lang='scss'>
.warehouseApply{
  width: 100%;
jingnan's avatar
jingnan committed
125 126
  // height: calc(100% - 50px);
  height: 100%;
jingnan's avatar
jingnan committed
127
  box-sizing: border-box;
jingnan's avatar
jingnan committed
128
  // padding:0 4px;
129 130 131
  // .search-form-box-com .search-box-col{
  //   width: 100%!important;
  // }
jingnan's avatar
jingnan committed
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
  .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;
    }
  }
}
</style>