TblTradeTenderInfoSubTable.vue 8.1 KB
<template>
  <div>
    <a-table ref="table1" rowKey="id" size="middle" bordered :loading="loading" :columns="columns" :dataSource="dataSource"
      :pagination="true">

      <!-- 内嵌table区域 begin -->
      <template slot="expandedRowRender" slot-scope="record">
        <TblTradeInquiryInfoList :record="record" />
      </template>
      <!-- 内嵌table区域 end -->

      <template slot="htmlSlot" slot-scope="text">
        <div v-html="text"></div>
      </template>

      <template slot="imgSlot" slot-scope="text,record">
        <div style="font-size: 12px;font-style: italic;">
          <span v-if="!text">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" alt="" style="max-width:80px;height:25px;" />
        </div>
      </template>

      <template slot="fileSlot" slot-scope="text">
        <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
        <a-button v-else ghost type="primary" icon="download" size="small" @click="downloadFile(text)">
          <span>下载</span>
        </a-button>
      </template>
      
      <span slot="action" slot-scope="text, record">
        <a @click="handleAdd(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>
    
    <tbl-trade-inquiry-info-modal ref="modalForm" @ok="modalFormOk" ></tbl-trade-inquiry-info-modal>
  </div>
</template>

<script>
  import { getAction } from '@api/manage'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import { mixinDevice } from '@/utils/mixin'
  import TblTradeInquiryInfoList from '../TblTradeInquiryInfoList'
  import '@/assets/less/TableExpand.less'
  import TblTradeInquiryInfoModal from '../modules/TblTradeInquiryInfoModal'
  

  export default {
    name: 'TblTradeTenderInfoSubTable',
    mixins: [JeecgListMixin,mixinDevice],
    components: {
      TblTradeInquiryInfoList,
      TblTradeInquiryInfoModal
    },
    props: {
      record: {
        type: Object,
        default: null,
      }
    },
    data() {
      return {
        description: '贸易招标信息内嵌列表',
        disableMixinCreated: true,
        loading: false,
        dataSource: [],
        columns: [{
            title: '询价标书文件号',
            align: 'center',
            dataIndex: 'xjbswjh',
          },
          {
            title: '物料编码',
            align: 'center',
            dataIndex: 'code',
          },
          // {
          //   title: '标段(包)名称',
          //   align: 'center',
          //   dataIndex: 'tenderName',
          // },
          {
            title: '物料长描述',
            align: 'center',
            dataIndex: 'miaoshu',
          },
          // {
          //   title: '计量单位',
          //   align: 'center',
          //   dataIndex: 'jldw',
          // },
          {
            title: '需求数量',
            align: 'center',
            dataIndex: 'xqsl',
          },
          {
            title: '需求交货期',
            align: 'center',
            dataIndex: 'xqjhq',
          },
          {
            title: '品牌',
            align: 'center',
            dataIndex: 'pinpai',
          },
          // {
          //   title: '税率',
          //   align: 'center',
          //   dataIndex: 'sl',
          // },
          // {
          //   title: '响应单价',
          //   align: 'center',
          //   dataIndex: 'xydj',
          // },
          // {
          //   title: '响应数量',
          //   align: 'center',
          //   dataIndex: 'xysl',
          // },
          // {
          //   title: '响应交货期',
          //   align: 'center',
          //   dataIndex: 'xyjhq',
          // },
          // {
          //   title: '响应说明',
          //   align: 'center',
          //   dataIndex: 'xysm',
          // },
          // {
          //   title: '响应品牌',
          //   align: 'center',
          //   dataIndex: 'xypp',
          // },
          // {
          //   title: '响应币种',
          //   align: 'center',
          //   dataIndex: 'xybz',
          // },
          // {
          //   title: '交货期否决项',
          //   align: 'center',
          //   dataIndex: 'jhqfjx',
          // },
          // {
          //   title: '付款方式否决项',
          //   align: 'center',
          //   dataIndex: 'fkfsfjx',
          // },
          // {
          //   title: '规格型号否决项',
          //   align: 'center',
          //   dataIndex: 'ggxhfjx',
          // },
          // {
          //   title: '品牌否决项',
          //   align: 'center',
          //   dataIndex: 'ppfjx',
          // },
          // {
          //   title: '需求单位',
          //   align: 'center',
          //   dataIndex: 'xqdw',
          // },
          // {
          //   title: '备注',
          //   align: 'center',
          //   dataIndex: 'bz',
          // },
          // {
          //   title: '询价标书文件号',
          //   align: 'center',
          //   dataIndex: 'xjbswjh',
          // },
          // {
          //   title: '项目类型',
          //   align: 'center',
          //   dataIndex: 'xmlx',
          // },
          {
            title: '送货地址',
            align: 'center',
            dataIndex: 'shdz',
          },
          {
            title: '优先等级',
            align: 'center',
            dataIndex: 'yxdj',
          },
          {
            title: '询价计划完成日期',
            align: 'center',
            dataIndex: 'xjjhwcsj',
          },
          {
            title: '标的类型',
            align: 'center',
            dataIndex: 'bdlx',
          },
          {
            title: '库存数据',
            align: 'center',
            dataIndex: 'kcsj',
          }, {
            title: '在途库存',
            align: 'center',
            dataIndex: 'ztkc',
          }, {
            title: '最近中标单价',
            align: 'center',
            dataIndex: 'zjzbdj',
          }, {
            title: '中标次数',
            align: 'center',
            dataIndex: 'zbcs',
          }, {
            title: '最后一次中标时间',
            align: 'center',
            dataIndex: 'zhzbsj',
          }, {
            title: '最后一次未中标时间',
            align: 'center',
            dataIndex: 'zhwzbsj',
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: '/trade/tblTradePriceInquiry/queryTblTradeTenderInfoByMainId',
        },
      }
    },
    watch: {
      record: {
        immediate: true,
        handler() {
          if (this.record != null) {
            this.loadData(this.record)
          }
        }
      }
    },
    methods: {
      modalFormOk(){
        this.loadData(this.record)
        console.log(898989)
      },
      handleAdd(record){
        this.$refs.modalForm.tradeId = record.id;
        this.$refs.modalForm.add();
        this.$refs.modalForm.title = "新增";
        this.$refs.modalForm.disableSubmit = false;
      },
      loadData(record) {
        this.loading = true
        this.dataSource = []
        getAction(this.url.list, {
          id: record.xjbswjh
        }).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
          }
        }).finally(() => {
          this.loading = false
        })
      },

    },
  }
</script>

<style scoped>

</style>