TblTradeBidSubList.vue 9.2 KB
<template>
  <div >
    <!-- table区域-begin -->
    <div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="true"
        :loading="loading"
      >

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img
            v-else
            :src="getImgView(text)"
            :preview="record.id"
            height="25px"
            alt=""
            style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">投标</a>

          <!-- <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown> -->
        </span>

      </a-table>
    </div>

    <tbl-trade-bid-sub-modal ref="modalForm" @ok="modalFormOk" :formType="'tb'"/>
  </div>
</template>

<script>
  import { getAction } from '@api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TblTradeBidSubModal from './modules/TblTradeBidSubModal'
  import '@/assets/less/TableExpand.less'

  export default {
    name: 'TblTradeBidSubList',
    mixins: [JeecgListMixin],
    components: {
      TblTradeBidSubModal
    },
    props: {
      record: {
        type: Object,
        default: null
      }
    },
    data () {
      return {
        description: '投标表管理页面',
        disableMixinCreated: true,
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function (t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '询价标书文件号',
            align: 'center',
            dataIndex: 'xjbswjh'
          },
          {
            title: '物料编码',
            align: 'center',
            dataIndex: 'wlbm'
          },
          {
            title: '物料长描述',
            align: 'center',
            dataIndex: 'tenderInfo.miaoshu'
          },
          {
            title: '需求数量',
            align: 'center',
            dataIndex: 'tenderInfo.xqsl'
          },
          {
            title: '需求交货期',
            align: 'center',
            dataIndex: 'tenderInfo.xqjhq'
          },
          {
            title: '品牌',
            align: 'center',
            dataIndex: 'tenderInfo.pinpai'
          },
          {
            title: '送货地址',
            align: 'center',
            dataIndex: 'tenderInfo.shdz'
          },
          {
            title: '优先等级',
            align: 'center',
            dataIndex: 'tenderInfo.yxdj'
          },
          {
            title: '询价计划完成日期',
            align: 'center',
            dataIndex: 'tenderInfo.xjjhwcsj'
          },
          {
            title: '标的类型',
            align: 'center',
            dataIndex: 'tenderInfo.bdlx'
          },

          // {
          //   title:'库存数据',
          //   align:"center",
          //   dataIndex: 'kcsj'
          // },
          // {
          //   title:'在途库存',
          //   align:"center",
          //   dataIndex: 'ztkf'
          // },
          // {
          //   title:'库存单价(含税运)(元)',
          //   align:"center",
          //   dataIndex: 'kcdj'
          // },
          // {
          //   title:'在途单价(含税运)(元)',
          //   align:"center",
          //   dataIndex: 'ztdj'
          // },
          // {
          //   title:'历史投标价(元)',
          //   align:"center",
          //   dataIndex: 'lstbj'
          // },
          // {
          //   title:'历史中标价(元)',
          //   align:"center",
          //   dataIndex: 'lszbj'
          // },
          // {
          //   title:'投标价格(元)',
          //   align:"center",
          //   dataIndex: 'tbjg'
          // },
          // {
          //   title:'中标价',
          //   align:"center",
          //   dataIndex: 'zbj'
          // },
          // {
          //   title:'单价差异',
          //   align:"center",
          //   dataIndex: 'djchay'
          // },
          // {
          //   title:'数量',
          //   align:"center",
          //   dataIndex: 'sl'
          // },
          // {
          //   title:'时间',
          //   align:"center",
          //   dataIndex: 'sj'
          // },
          // {
          //   title:'是否中标',
          //   align:"center",
          //   dataIndex: 'sfzb'
          // },
          // {
          //   title:'是否已采购完成',
          //   align:"center",
          //   dataIndex: 'sfcgwc'
          // },
          // {
          //   title:'交货时间',
          //   align:"center",
          //   dataIndex: 'jhsj'
          // },
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            fixed: 'right',
            width: 147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: '/trade/tblTradeBidSub/list',
          delete: '/trade/tblTradeBidSub/delete',
          deleteBatch: '/trade/tblTradeBidSub/deleteBatch',
          exportXlsUrl: '/trade/tblTradeBidSub/exportXls',
          importExcelUrl: 'trade/tblTradeBidSub/importExcel'

        },
        dictOptions: {},
        superFieldList: []
      }
    },
    created() {
      this.getSuperFieldList()
    },
    computed: {
      importExcelUrl: function() {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    },
    watch: {
      record: {
        immediate: true,
        handler() {
          if (this.record != null) {
            this.loadData(this.record)
          }
        }
      }
    },
    methods: {
      modalFormOk() {
        this.loadData(this.record)
      },
      initDictConfig() {
      },
      getSuperFieldList() {
        let fieldList = []
        fieldList.push({ type: 'string', value: 'tradeId', text: '关联招标id', dictCode: '' })
        fieldList.push({ type: 'string', value: 'xjbswjh', text: '询价标书文件号', dictCode: '' })
        fieldList.push({ type: 'string', value: 'wlbm', text: '物料编码', dictCode: '' })
        fieldList.push({ type: 'string', value: 'kcsj', text: '库存数据', dictCode: '' })
        fieldList.push({ type: 'string', value: 'ztkf', text: '在途库存', dictCode: '' })
        fieldList.push({ type: 'string', value: 'kcdj', text: '库存单价(含税运)(元)', dictCode: '' })
        fieldList.push({ type: 'string', value: 'ztdj', text: '在途单价(含税运)(元)', dictCode: '' })
        fieldList.push({ type: 'string', value: 'lstbj', text: '历史投标价(元)', dictCode: '' })
        fieldList.push({ type: 'string', value: 'lszbj', text: '历史中标价(元)', dictCode: '' })
        fieldList.push({ type: 'string', value: 'tbjg', text: '投标价格(元)', dictCode: '' })
        fieldList.push({ type: 'string', value: 'zbj', text: '中标价', dictCode: '' })
        fieldList.push({ type: 'string', value: 'djchay', text: '单价差异', dictCode: '' })
        fieldList.push({ type: 'string', value: 'sl', text: '数量', dictCode: '' })
        fieldList.push({ type: 'string', value: 'sj', text: '时间', dictCode: '' })
        fieldList.push({ type: 'string', value: 'sfzb', text: '是否中标', dictCode: '' })
        fieldList.push({ type: 'string', value: 'sfcgwc', text: '是否已采购完成', dictCode: '' })
        fieldList.push({ type: 'string', value: 'jhsj', text: '交货时间', dictCode: '' })
        this.superFieldList = fieldList
      },
      loadData(record) {
        this.loading = true
        this.dataSource = []
        getAction(this.url.list, { xjbswjh: record.xjbswjh }).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
          }
        }).finally(() => {
          this.loading = false
        })
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>