activityDetailDia.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <script setup>
  2. import { ref,watch} from 'vue';
  3. import moment from 'moment';
  4. import { useRouter} from 'vue-router';
  5. import DatePicker from 'vue-datepicker-next';
  6. import { InfoFilled } from '@element-plus/icons-vue'
  7. import { roadshowInterence } from '@/api/api.js';
  8. const props = defineProps({
  9. title: {
  10. type: String
  11. },
  12. isShow: {
  13. type: Boolean
  14. },
  15. form: {
  16. type: Object
  17. },
  18. fromType: {
  19. type: String,
  20. default: 'researcher'
  21. }
  22. })
  23. const emits=defineEmits(['update:isShow'])
  24. const companyInfo=ref(null)
  25. const tableColumns=ref([])
  26. const tableData=ref([])
  27. watch(()=>props.isShow,(newval)=>{
  28. if(newval) {
  29. initState();
  30. console.log(props.form)
  31. getStatisticDetail();
  32. }
  33. })
  34. /* 获取列表 */
  35. const getStatisticDetail=()=>{
  36. const { startDate,endDate,userid,key } = props.form;
  37. const typeMapObj = {
  38. 试用路演: 'try_out',
  39. 正式路演: 'formal',
  40. 公开会议: 'meeting',
  41. }
  42. roadshowInterence.statisticDetailList({
  43. DataType: typeMapObj[key] && typeMapObj[key],
  44. StartDate: startDate,
  45. EndDate: endDate,
  46. AdminId: userid,
  47. AdminType: props.fromType
  48. }).then(res => {
  49. const { Ret,Data } = res;
  50. if(Ret !== 200) return
  51. tableData.value = Data || [];
  52. })
  53. }
  54. /* 取消 */
  55. const cancel=()=>{
  56. emits('update:isShow', false);
  57. }
  58. /* 获取客户信息 */
  59. const getCompanyInfo=async(CompanyId)=>{
  60. const { Data } = await roadshowInterence.componyDetail({ CompanyId });
  61. companyInfo.value = Data;
  62. }
  63. const initState=()=>{
  64. const dynamic_column = props.fromType === 'researcher' ? {
  65. label: '发起人',
  66. key: 'SellerName',
  67. minwidthsty: '100px'
  68. } : {
  69. label: '研究员',
  70. key: 'ResearcherName',
  71. minwidthsty: '100px',
  72. }
  73. tableColumns.value = props.title === '路演详情'
  74. ? [
  75. {
  76. label: '时间',
  77. key: 'time',
  78. minwidthsty: '180px',
  79. },
  80. {
  81. label: '客户名称',
  82. key: 'company',
  83. minwidthsty: '100px',
  84. },
  85. {
  86. label: '路演形式',
  87. key: 'RoadshowType',
  88. minwidthsty: '120px',
  89. },
  90. { ...dynamic_column }
  91. ]
  92. : [
  93. {
  94. label: '时间',
  95. key: 'time',
  96. minwidthsty: '180px',
  97. },
  98. {
  99. label: '会议主题',
  100. key: 'Theme',
  101. minwidthsty: '100px',
  102. },
  103. {
  104. label: '合作方',
  105. key: 'CooperationName',
  106. minwidthsty: '120px',
  107. },
  108. {
  109. label: '会议形式',
  110. key: 'RoadshowType',
  111. minwidthsty: '120px',
  112. },
  113. { ...dynamic_column }
  114. ]
  115. }
  116. </script>
  117. <template>
  118. <el-dialog
  119. v-dialogDrag
  120. :title="props.title"
  121. :model-value="props.isShow"
  122. :modal-append-to-body="false"
  123. @close="cancel"
  124. width="850px"
  125. class="statistic-dialog-cont"
  126. >
  127. <el-table
  128. :data="tableData"
  129. class="table-cont"
  130. max-height="300"
  131. border
  132. >
  133. <el-table-column
  134. v-for="item in tableColumns"
  135. :key="item.label"
  136. :label="item.label"
  137. :width="item.widthsty"
  138. :min-width="item.minwidthsty"
  139. align="center"
  140. >
  141. <template #default="{row}">
  142. <span v-if="item.key === 'time'">
  143. {{
  144. moment(new Date(row.StartDate + " " + row.StartTime)).format(
  145. "MM.DD(ddd) HH:mm - "
  146. ) + moment(new Date(row.EndDate + " " + row.EndTime)).format("HH:mm")
  147. }}
  148. </span>
  149. <span v-else-if="item.key === 'RoadshowType'">
  150. {{row.RoadshowType}} {{ row.RoadshowType === '线上' ? `(${row.RoadshowPlatform} )` : `(${row.Province}${row.City})`}}
  151. </span>
  152. <span v-else-if="item.key === 'company'">
  153. {{ row.CooperationName || row.CompanyName }} <span v-if="props.fromType == 'seller' || props.fromType == 'special'">{{`(${row.CompanyStatus})`}} </span>
  154. <el-tooltip effect="dark" placement="top-start" v-if="row.CompanyId" popper-class="company-tip-poper">
  155. <el-icon :size="14" style="vertical-align: text-top;" @mouseenter.native="getCompanyInfo(row.CompanyId)" ><InfoFilled /></el-icon>
  156. <template #content v-if="companyInfo">
  157. <div>
  158. <p style="margin: 6px 0;">客户状态:{{companyInfo.Status}}</p>
  159. <p style="margin: 6px 0;">所属行业:{{companyInfo.IndustryName}}</p>
  160. <p style="margin: 6px 0;text-indent: -70px;margin-left: 70px;">开通品种:{{companyInfo.PermissionName}}</p>
  161. <p style="margin: 6px 0;">累计报告阅读次数:{{companyInfo.ReportReadTotal}}</p>
  162. </div>
  163. </template>
  164. </el-tooltip>
  165. </span>
  166. <span v-else>{{ row[item.key] || '——' }}</span>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. </el-dialog>
  171. </template>
  172. <style lang="scss" scoped>
  173. .table-cont {
  174. margin: 10px 0 40px;
  175. }
  176. </style>
  177. <style lang="scss">
  178. .company-tip-poper {
  179. max-width: 400px;
  180. }
  181. </style>