TblTradeInquiryInfoList.vue 9.3 KB
<template>
  <div>
    
  
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
          <!-- <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-inquiry-info-modal ref="modalForm" @ok="modalFormOk"></tbl-trade-inquiry-info-modal>
  </div>
</template>

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

  export default {
    name: 'TblTradeInquiryInfoList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      TblTradeInquiryInfoModal
    },
    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: 'ghsmc'
          },
          {
            title:'电话',
            align:"center",
            dataIndex: 'tel'
          },
          {
            title:'网络链接地址',
            align:"center",
            dataIndex: 'wldz'
          },
          {
            title:'微信号',
            align:"center",
            dataIndex: 'wxh'
          },
          {
            title:'单价(元)',
            align:"center",
            dataIndex: 'dj'
          },
          {
            title:'总价(元)',
            align:"center",
            dataIndex: 'zj'
          },
          {
            title:'票据',
            align:"center",
            dataIndex: 'piaoju'
          },
          {
            title:'票据税额比例',
            align:"center",
            dataIndex: 'pjsebl'
          },
          {
            title:'最小出货量',
            align:"center",
            dataIndex: 'zxchl'
          },
          {
            title:'L/T(交货周期天)',
            align:"center",
            dataIndex: 'jhzqt'
          },
          {
            title:'发货地址',
            align:"center",
            dataIndex: 'fhdz'
          },
          {
            title:'单价是否含运费',
            align:"center",
            dataIndex: 'djsfhyf'
          },
          {
            title:'含运费单价',
            align:"center",
            dataIndex: 'hyfdj'
          },
          {
            title:'价格评价',
            align:"center",
            dataIndex: 'jgpj'
          },
          {
            title:'含税价格(元)',
            align:"center",
            dataIndex: 'hsjg'
          },
          {
            title:'不含税价格(元)',
            align:"center",
            dataIndex: 'bhsjg'
          },
          {
            title:'是否需要重新询价',
            align:"center",
            dataIndex: 'sfxycxxj',
            customRender: (text,record)=>{
              if(text == 'Y'){
                return '是'
              }else if(text == 'N'){
                return '否'
              }
            },
          },
          {
            title:'原因/备注',
            align:"center",
            dataIndex: 'bz'
          },
          // {
          //   title:'关联招标id',
          //   align:"center",
          //   dataIndex: 'tradeId'
          // },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/trade/tblTradeInquiryInfo/list",
          delete: "/trade/tblTradeInquiryInfo/delete",
          deleteBatch: "/trade/tblTradeInquiryInfo/deleteBatch",
          exportXlsUrl: "/trade/tblTradeInquiryInfo/exportXls",
          importExcelUrl: "trade/tblTradeInquiryInfo/importExcel",
          
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      modalFormOk(){
        this.loadData(this.record)
      },
      // handleDelete(id){
      //    this.loadData(this.record)
      // },
      handleDelete: function (id) {
        if (!this.url.delete) {
          this.$message.error("请设置url.delete属性!")
          return
        }
        var that = this;
        deleteAction(that.url.delete, { id: id }).then((res) => {
          if (res.success) {
            that.$message.success(res.message);
            that.loadData(that.record)
          } else {
            that.$message.warning(res.message);
          }
        });
      },
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'ghsmc',text:'供货商名称',dictCode:''})
        fieldList.push({type:'string',value:'tel',text:'电话',dictCode:''})
        fieldList.push({type:'string',value:'wldz',text:'网络链接地址',dictCode:''})
        fieldList.push({type:'string',value:'wxh',text:'微信号',dictCode:''})
        fieldList.push({type:'string',value:'dj',text:'单价(元)',dictCode:''})
        fieldList.push({type:'string',value:'zj',text:'总价(元)',dictCode:''})
        fieldList.push({type:'string',value:'piaoju',text:'票据',dictCode:''})
        fieldList.push({type:'string',value:'pjsebl',text:'票据税额比例',dictCode:''})
        fieldList.push({type:'string',value:'zxchl',text:'最小出货量',dictCode:''})
        fieldList.push({type:'string',value:'lt',text:'L/T(交货周期天)',dictCode:''})
        fieldList.push({type:'string',value:'fhdz',text:'发货地址',dictCode:''})
        fieldList.push({type:'string',value:'djsfhyf',text:'单价是否含运费',dictCode:''})
        fieldList.push({type:'string',value:'hyfdj',text:'含运费单价',dictCode:''})
        fieldList.push({type:'string',value:'jgpj',text:'价格评价',dictCode:''})
        fieldList.push({type:'string',value:'hsjg',text:'含税价格(元)',dictCode:''})
        fieldList.push({type:'string',value:'bhsjg',text:'不含税价格(元)',dictCode:''})
        fieldList.push({type:'string',value:'sfxycxxj',text:'是否需要重新询价',dictCode:''})
        fieldList.push({type:'string',value:'bz',text:'原因/备注',dictCode:''})
        fieldList.push({type:'string',value:'tradeId',text:'关联招标id',dictCode:''})
        this.superFieldList = fieldList
      },
      loadData(record) {
        this.loading = true
        this.dataSource = []
        getAction(this.url.list, {
          tradeId: record.id
        }).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records
          }
        }).finally(() => {
          this.loading = false
        })
      },
    },
    watch: {
      record: {
        immediate: true,
        handler() {
          if (this.record != null) {
            this.loadData(this.record)
          }
        }
      }
    },
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>