stockDetailDialog.vue 3.25 KB
<!-- 库存明细弹窗 -->
<template>
  <GLDialog bigTitle="库存明细" :visible.sync="dialogVisible" class="stockMonthDailog" width="700px" mode="big"
    :destroy-on-close="true" :close-on-click-modal="false" okText="关闭" :before-close="handleClose" :hasFooter="false"
    @onOk="handleClose" @onCancel="handleClose">
    <div>
      <div class="d2-container-content">
        <GLTable ref="recordTable" :get-list-api="getListApi" :search-form="searchForm" :table-params="tableParams"
          :pageConf="pageConf"></GLTable>
      </div>
    </div>
    <!-- <span slot="footer"
          class="dialog-footer">
      <el-button type="primary"
                 size="small"
                 @click="handleClose">关闭</el-button>
    </span> -->
  </GLDialog>
</template>

<script>
// import { mapActions, mapState } from 'vuex'
// import { merchantShopGoodsStockPage } from '@api/stockManage'
// import { membraneTypeList } from '@/utils/constants.js'
export default {
  name: 'StockDetailDialog',

  props: {
    visible: {
      type: Boolean,
      default: false
    },
    recordInfo: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {
      pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
      // userInfo: this.$store.state.d2admin.user.info,
      // membraneTypeList: membraneTypeList,
      searchForm: {
        upgradeGoodsId: '',
        yqMerchantId: ''
      },
      getListApi: this.$apis.stockManage.merchantShopGoodsStockPage,
      tableData: [],
      tableParams: {
        btnId: new Date().getTime() + parseInt(Math.random() * 1000),
        listName: 'list',
        // tableOption: false,
        tableColumns: [
          {
            label: '门店',
            prop: 'merchantName',
            width: '200px'
          },
          {
            label: '当前库存',
            prop: 'stock',
            width: '150px',
            formatter: cellValue => {
              return cellValue.stock || cellValue.stock == 0 ? parseFloat(cellValue.stock).toFixed(2) + (this.$membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
            }
          },
          {
            label: '膜卷号',
            prop: 'filmRollNo'
            // width: '200px'
          }
        ]
      }
    }
  },

  computed: {
    dialogVisible: {
      get() {
        return this.visible
      },
      set(val) {
        this.$emit('update:visible', val)
      }
    }
  },
  mounted() {
    console.log('111')

    if (this.recordInfo) {
      this.searchForm.yqMerchantId = this.recordInfo.yqMerchantId
      this.searchForm.upgradeGoodsId = this.recordInfo.upgradeGoodsId
    }
  },

  methods: {
    handleClose() {
      this.dialogVisible = false
    }
  }
}
</script>
<style scoped>
.count-txt {
  font-weight: 700;
  color: #2a58ad;
  margin: 0 2px;
}

.stockMonthDailog .el-dialog {
  margin-top: 20vh !important;
  min-width: 700px;
}

.stockMonthDailog .btn-tips img {
  width: 18px;
  height: 15px;
  margin-right: 9px;
  vertical-align: bottom;
}

.stockMonthDailog .btn-tips {
  display: inline-block;
  font-size: 12px;
  height: 14px;
  line-height: 14px;
  background-color: #fff2e5;
  color: #999999;
  margin-right: 24px;
  padding: 6.5px 10px;
}

.show-search {
  margin-left: -65px;
}</style>