allocationDetailDialog.vue 2.66 KB
<!-- 盘点详情弹窗弹窗 -->
<template>
  <GLDialog bigTitle="详细信息" :visible.sync="allocationDetailVisible" class="inventoryDetailDailog" mode="big" okText="关闭"
    @onCancel="handleClose" @onOk="handleClose">
    <div>
      <div class="d2-container-content">
        <GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams"
          :beforeSearchFn="beforeSearchFn">
        </GLTable>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" size="small" @click="handleClose">关闭</el-button>
    </span>
  </GLDialog>
</template>

<script>
import { membraneTypeList } from '@/utils/constants.js'
export default {
  name: 'allocationDetailDialog',
  data() {
    return {
      membraneTypeList: membraneTypeList,
      searchForm: {
        id: ''
      },
      searchFormSearch: {},
      searchSelectObj: {},
      showFormData: [],
      getListApi: this.$apis.stockManage.stockAllocateDetailPage,
      tableParams: {
        btnId: new Date().getTime() + parseInt(Math.random() * 1000),
        listName: 'list',
        tableOption: false,
        tableColumns: [
          {
            label: '商品名称',
            prop: 'goodsName'
          },
          {
            label: '商品编码',
            prop: 'productCode',
            // width: 250
          },
          {
            label: '系列',
            prop: 'sourceMaterialName'
          },
          {
            label: '所属分类',
            prop: 'goodsTypeName'
          },
          {
            label: '调拨数量',
            prop: 'allocateNumber',
            formatter: cellValue => {
              return cellValue.allocateNumber || cellValue.allocateNumber == 0 ? parseFloat(cellValue.allocateNumber).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
            }
          }
        ]
      },
      baseData: {}
    }
  },

  props: {
    allocationDetailVisible: {
      type: Boolean,
      default: false
    },
    allocationInfo: {
      type: Object,
      default: () => { }
    }
  },

  computed: {},
  mounted() {
    console.log(11111111)
  },

  methods: {
    beforeSearchFn() {
      return new Promise(resolve => {
        this.searchForm.id = this.allocationInfo.id
        this.searchFormSearch = this.$common.utils.deepClone(this.searchForm)
        resolve()
      })
    },

    handleClose() {
      this.$emit('dialogClose')
    }
  }
}
</script>
<style scoped>
.count-txt {
  font-weight: 700;
  color: #2a58ad;
  margin: 0 2px;
}

.inventoryDetailDailog .el-dialog {
  margin-top: 20vh !important;
  min-width: 700px;
}
</style>