XpRecycleBinModal.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <a-modal
  3. :width="1200"
  4. :title="title"
  5. :visible="visible"
  6. :destroyOnClose="true"
  7. @cancel="handleCancel"
  8. cancelText="关闭"
  9. :okButtonProps="{style:{display:'none'}}">
  10. <a-form layout="inline" @keyup.enter.native="searchQuery" style="margin-bottom:15px">
  11. <a-form-item>
  12. <a-input placeholder="邮箱/姓名" v-model="queryParam.searchText"></a-input>
  13. </a-form-item>
  14. <a-form-item>
  15. <a-button type="primary" @click="searchQuery">查询</a-button>
  16. <a-button @click="searchReset" style="margin-left:8px">重置</a-button>
  17. </a-form-item>
  18. </a-form>
  19. <a-table
  20. ref="table"
  21. size="middle"
  22. :columns="columns"
  23. :loading="loading"
  24. :dataSource="dataSource"
  25. >
  26. <!-- 显示头像 -->
  27. <template slot="avatarslot" slot-scope="text, record, index">
  28. <div class="anty-img-wrap">
  29. <a-avatar shape="square" :src="url.getAvatar(record.avatar)" icon="user"/>
  30. </div>
  31. </template>
  32. <div slot="contactSlot" slot-scope="text, record">
  33. <a-popover>
  34. <template slot="content">
  35. {{text}}
  36. </template>
  37. <div style="width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{text}}</div>
  38. </a-popover>
  39. </div>
  40. <span slot="action" slot-scope="text, record">
  41. <a @click="enquiryDetail(record)"> 详情</a>
  42. </span>
  43. </a-table>
  44. <!--询盘详情-->
  45. <enquiry-detail ref="enquiryDetail"></enquiry-detail>
  46. </a-modal>
  47. </template>
  48. <script>
  49. import { putAction, deleteAction, postAction, getAction } from '/@/api/manage/manage'
  50. import enquiryDetail from '/@/views/adweb/enquiry/modules/enquiryDetail.vue'
  51. export default {
  52. name: 'XpRecycleBinModal',
  53. components:{enquiryDetail},
  54. data() {
  55. return {
  56. title: '',
  57. loading: false,
  58. innerVisible: false,
  59. dataSource: [],
  60. visible:false,
  61. columns: [],
  62. url: {
  63. list: '/adweb/adwebEnquiry/getWastedEnquiry',
  64. },
  65. disableMixinCreated:true,
  66. ip:'',
  67. }
  68. },
  69. methods: {
  70. init(ip){
  71. let that = this
  72. that.columns = [
  73. { title: '站点名称', align: 'left', dataIndex: 'siteName', scopedSlots: { customRender: 'contactSlot' }},
  74. { title: '姓名', align: 'left', dataIndex: 'contact', scopedSlots: { customRender: 'contactSlot' }},
  75. { title: '邮箱', align: 'left', dataIndex: 'fromEmail', scopedSlots: { customRender: 'contactSlot' } },
  76. { title: '电话', align: 'left', dataIndex: 'phone' },
  77. { title: '询盘时间', align: 'left', dataIndex: 'recordCtime' },
  78. { title: '操作', align: 'center', dataIndex: 'action', scopedSlots: { customRender: 'action' } }
  79. ]
  80. that.ip = ip
  81. that.loadData(ip);
  82. console.log(ip)
  83. that.visible = true
  84. },
  85. //询盘详情
  86. enquiryDetail(record){
  87. this.$nextTick(() => {
  88. this.$refs.enquiryDetail.init(record)
  89. })
  90. },
  91. searchQuery() {
  92. this.loadData(this.ip);
  93. },
  94. searchReset() {
  95. this.queryParam = {}
  96. this.loadData(this.ip);
  97. },
  98. handleCancel() {
  99. this.queryParam = {}
  100. this.visible = false
  101. },
  102. loadData(ip) {
  103. if(!this.url.list){
  104. this.$message.error("请设置url.list属性!")
  105. return
  106. }
  107. var params = this.getQueryParams();//查询条件
  108. this.loading = true;
  109. params.ip = ip;
  110. params.wasteEnquiryType = 'ip';
  111. getAction(this.url.list, params).then((res) => {
  112. if (res.success) {
  113. this.dataSource = res.result;
  114. }
  115. if(res.code===510){
  116. this.$message.warning(res.message)
  117. }
  118. this.loading = false;
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="less" scoped></style>