TblTradeTenderInfoTab2List.vue 4.5 KB
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading">
      </a-table>
    </div>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction } from '@api/manage'

  export default {
    name: "TblTradeTenderInfoTab2List",
    mixins:[JeecgListMixin],
    components: {  },
    props:{
      mainId:{
        type:String,
        default:'',
        required:false
      }
    },
    watch:{
      mainId:{
        immediate: true,
        handler(val) {
          if(!this.mainId){
            this.clearList()
          }else{
            this.queryParam['tradeId'] = val
            this.loadData(1);
          }
        }
      }
    },
    data () {
      return {
        loading: false,
        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: 'ghsmc'
          },
          {
            title: '专票单价',
            align: 'center',
            dataIndex: 'zpdj'
          },
          {
            title: '专票税率(%)',
            align: 'center',
            dataIndex: 'zpsl'
          },
          {
            title: '普票单价',
            align: 'center',
            dataIndex: 'ppdj'
          },
          {
            title: '普票税率(%)',
            align: 'center',
            dataIndex: 'ppsl'
          },
          {
            title: '无票单价',
            align: 'center',
            dataIndex: 'wpdj'
          },
          {
            title: '是否含运费',
            align: 'center',
            dataIndex: 'sfhyf'
          },
          {
            title: '运费',
            align: 'center',
            dataIndex: 'yf'
          },
          {
            title: '发货地址',
            align: 'center',
            dataIndex: 'fhdz'
          },
          {
            title: '最小出货量',
            align: 'center',
            dataIndex: 'zxchl'
          },
          {
            title: 'L/T(交货周期天)',
            align: 'center',
            dataIndex: 'jhzqt'
          },
          {
            title: '价格评价',
            align: 'center',
            dataIndex: 'jgpj'
          },
          {
            title: '是否需要重新询价',
            align: 'center',
            dataIndex: 'sfxycxxj',
            customRender: (text, record) => {
              if (text == 'Y') {
                return '是'
              } else if (text == 'N') {
                return '否'
              }
            }
          },
          {
            title: '原因/备注',
            align: 'center',
            dataIndex: 'bz'
          }
        ],
        url: {
          getTenderInfo: "/trade/tblTradeBidSub/getTenderInfo",
        },
        dictOptions:{
        }
      }
    },
    created() {
    },
    computed: {
      importExcelUrl(){
        return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
      }
    },
    methods: {
      clearData(){
        this.dataSource = []
      },
      loadData(rows){
        this.loading = true
        console.log("row:tab2",rows)
        this.dataSource = []
        const row = rows[0]
        console.log("row",row)
        const materialCode = row.code
        const xjbswjh = row.xjbswjh
        const param = {
          xjbswjh:xjbswjh,
          wlbm:materialCode
        }
        getAction(this.url.getTenderInfo, param).then((res) => {
          if (res.success) {
            if (res.result) {
              console.log("result...........",res.result)
              this.dataSource = res.result
            }
          }
        })
        this.loading = false
      },
      clearList(){
        this.dataSource=[]
        this.selectedRowKeys=[]
        this.ipagination.current = 1
      }

    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>