XpRecycleBinModal.vue 4.1 KB

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