<template>
  <storage-collect-info :is-in="false" :columns="columns" :list="list"></storage-collect-info>
</template>

<script>
import storageCollectInfo from './storageCollectInfo'
import { getAction } from '@api/manage'
export default {
  name: 'storageInCollect',
  components: {
    storageCollectInfo
  },
  data() {
    return {
      list: '/kc/kcDepositoryInGoods/storageDetailPage',
      columns: [
        {
          title: '仓库',
          align: 'center',
          dataIndex: 'depositoryName',
          width: 80
        },
        {
          title: '出库类型',
          align: 'center',
          dataIndex: 'stockType',
          width: 80,
          customRender(text, record) {
            console.log(text)
            if (text == null && (record.feeId != null || record.feeGoodId)) {
              return '销售出库'
            }
          }
        },
        {
          title: '商品名称',
          align: 'center',
          dataIndex: 'goodName',
          width: 80
        },
        {
          title: '商品规格',
          align: 'center',
          dataIndex: 'spec',
          width: 80
        },
        {
          title: '商品分类',
          align: 'center',
          dataIndex: 'goodTypeName',
          width: 80
        },
        {
          title: '单位',
          align: 'center',
          dataIndex: 'goodUnitName',
          width: 80
        },
        {
          title: '出库时间',
          align: 'center',
          dataIndex: 'createTime',
          width: 80,
        },
        {
          title: '出库数量',
          align: 'center',
          dataIndex: 'num',
          width: 80,
          customRender(text, record) {
            return -text
          }
        },
        {
          title: '申请人',
          align: 'center',
          dataIndex: 'createAt',
          width: 80
        },
        {
          title: '审批人',
          align: 'center',
          dataIndex: 'verifyAt',
          width: 80
        },
        // {
        //   title: '预警状态',
        //   align: 'center',
        //   dataIndex: 'id',
        //   customRender(text, record) {
        //     return record.stockWarning >= record.num ? '预警' : '正常'
        //   }
        // }
      ],

    }

  },
  created() {
  },
  methods: {
    getStockType(text){
      if (text === 1){
        return '采购入库'
      } else if (text === 1){
        return '销售退货'
      } else if (text === 2){
        return '盘盈入库'
      } else if (text === 3){
        return '其他入库'
      } else if (text === 4){
        return '调拨入库'
      } else if (text === 5){

      }
    }

  }
};
</script>

<style scoped>
.main {
  height: 70% !important;
}
</style>
