detail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <template>
  2. <view class="activity-detail" v-if="info">
  3. <image :src="statusImg" mode="aspectFill" class="status-img" v-if="statusImg"></image>
  4. <!-- 路演 -->
  5. <block v-if="['路演','沙龙'].includes(info.RsCalendarItem.ActivityType)">
  6. <view class="section white-wrap">
  7. <view class="info-item flex">
  8. <view class="label">活动时间:</view>
  9. <view v-if="info.RsCalendarResearcherItem.StartDate === info.RsCalendarResearcherItem.EndDate">
  10. {{info.RsCalendarResearcherItem.StartDate}}({{info.RsCalendarResearcherItem.StartWeek}})
  11. {{info.RsCalendarResearcherItem.StartTime.substr(0,5)}}~{{info.RsCalendarResearcherItem.EndTime.substr(0,5)}}
  12. </view>
  13. <view v-else>
  14. {{info.RsCalendarResearcherItem.StartDate}}({{info.RsCalendarResearcherItem.StartWeek}})
  15. {{info.RsCalendarResearcherItem.StartTime.substr(0,5)}}~{{info.RsCalendarResearcherItem.EndDate}}({{info.RsCalendarResearcherItem.EndWeek}}){{info.RsCalendarResearcherItem.EndTime.substr(0,5)}}
  16. </view>
  17. </view>
  18. <view class="info-item flex" v-if="Role === 'seller'">
  19. <view class="label">研究员:</view>
  20. <view>{{info.RsCalendarResearcherItem.ResearcherName}}</view>
  21. </view>
  22. <view class="info-item flex">
  23. <view class="label">活动类型:</view>
  24. <view>{{info.RsCalendarItem.ActivityType}}</view>
  25. </view>
  26. <view class="info-item flex">
  27. <view class="label">路演形式:</view>
  28. <view>{{info.RsCalendarItem.RoadshowType}}</view>
  29. </view>
  30. <view class="info-item flex" v-if="info.RsCalendarItem.RoadshowPlatform">
  31. <view class="label">路演平台:</view>
  32. <view>{{info.RsCalendarItem.RoadshowPlatform}}</view>
  33. </view>
  34. <view class="info-item flex" v-if="info.RsCalendarItem.City">
  35. <view class="label">路演城市:</view>
  36. <view>{{info.RsCalendarItem.Province}}{{info.RsCalendarItem.City}}{{ info.RsCalendarItem.District||''}}</view>
  37. </view>
  38. <view class="info-item flex">
  39. <view class="label">客户名称:</view>
  40. <view>{{info.CompanyDetail.CompanyName}}</view>
  41. </view>
  42. </view>
  43. <view class="section white-wrap">
  44. <!-- 权益客户显示 -->
  45. <template v-if="Role.includes('rai')">
  46. <view class="info-item flex">
  47. <view class="label">客户状态:</view>
  48. <view>{{info.CompanyDetail.Status}}</view>
  49. </view>
  50. <view class="info-item flex">
  51. <view class="label">所属行业:</view>
  52. <view>{{info.CompanyDetail.IndustryName}}</view>
  53. </view>
  54. <view class="info-item flex">
  55. <view class="label">行业权限:</view>
  56. <view>{{info.CompanyDetail.PermissionName}}</view>
  57. </view>
  58. <view class="info-item flex">
  59. <view class="label">累计互动次数:</view>
  60. <view>{{info.CompanyDetail.ReportReadTotal}}</view>
  61. </view>
  62. </template>
  63. <template v-else>
  64. <template v-if="info.CompanyDetail.EnglishCompany===1">
  65. <view class="info-item flex">
  66. <view class="label">所属国家:</view>
  67. <view>{{info.CompanyDetail.EnglishCountry}}</view>
  68. </view>
  69. <view class="info-item flex">
  70. <view class="label">累计点击量:</view>
  71. <view>{{info.CompanyDetail.EnglishViewTotal}}</view>
  72. </view>
  73. </template>
  74. <template v-else>
  75. <view class="info-item flex">
  76. <view class="label">客户状态:</view>
  77. <view>{{info.CompanyDetail.Status}}</view>
  78. </view>
  79. <view class="info-item flex">
  80. <view class="label">所属行业:</view>
  81. <view>{{info.CompanyDetail.IndustryName}}</view>
  82. </view>
  83. <view class="info-item flex">
  84. <view class="label">开通品种:</view>
  85. <view>{{info.CompanyDetail.PermissionName}}</view>
  86. </view>
  87. <view class="info-item flex">
  88. <view class="label">累计阅读报告次数:</view>
  89. <view>{{info.CompanyDetail.ReportReadTotal}}</view>
  90. </view>
  91. </template>
  92. </template>
  93. <view class="line"></view>
  94. <view class="info-item flex" v-if="Role === 'researcher'">
  95. <view class="label">提交销售:</view>
  96. <view>{{info.RsCalendarItem.SysUserRealName}}</view>
  97. </view>
  98. <view class="info-item flex">
  99. <view class="label">提交时间:</view>
  100. <view>{{info.RsCalendarItem.CreateTime|formatTime}}</view>
  101. </view>
  102. <view class="info-item flex" v-if="['rai_seller','rai_group'].includes(Role)">
  103. <view class="label">提交人:</view>
  104. <view>
  105. {{info.RsCalendarItem.SysUserRealName}}
  106. </view>
  107. </view>
  108. </view>
  109. <view class="section white-wrap"
  110. v-if="info.RsCalendarResearcherItem.Status==2||info.RsCalendarResearcherItem.Status==3">
  111. <view class="info-item flex">
  112. <view class="label">审批时间:</view>
  113. <view>
  114. {{info.RsCalendarResearcherItem.Status==2?info.RsCalendarResearcherItem.ApproveTime:info.RsCalendarResearcherItem.RefuseTime | formatTime}}
  115. </view>
  116. </view>
  117. <view class="info-item flex" v-if="info.RsCalendarResearcherItem.Status==3">
  118. <view class="label">拒绝理由:</view>
  119. <view>{{info.RsCalendarResearcherItem.RefuseReason}}</view>
  120. </view>
  121. </view>
  122. <view class="section white-wrap" v-if="info.RsCalendarResearcherItem.Status==4">
  123. <view class="info-item flex">
  124. <view class="label">删除时间:</view>
  125. <view>{{info.RsCalendarResearcherItem.DeleteTime|formatTime}}</view>
  126. </view>
  127. <view class="info-item flex">
  128. <view class="label">删除原因:</view>
  129. <view>{{info.RsCalendarResearcherItem.DeleteReason}}</view>
  130. </view>
  131. </view>
  132. </block>
  133. <block v-else>
  134. <view class="section white-wrap">
  135. <view class="info-item flex">
  136. <view class="label">活动时间:</view>
  137. <view v-if="info.RsCalendarResearcherItem.StartDate === info.RsCalendarResearcherItem.EndDate">
  138. {{info.RsCalendarResearcherItem.StartDate}}({{info.RsCalendarResearcherItem.StartWeek}})
  139. {{info.RsCalendarResearcherItem.StartTime}}~{{info.RsCalendarResearcherItem.EndTime}}
  140. </view>
  141. <view v-else>
  142. {{info.RsCalendarResearcherItem.StartDate}}({{info.RsCalendarResearcherItem.StartWeek}})
  143. {{info.RsCalendarResearcherItem.StartTime}}~{{info.RsCalendarResearcherItem.EndDate}}({{info.RsCalendarResearcherItem.EndWeek}}){{info.RsCalendarResearcherItem.EndTime}}
  144. </view>
  145. </view>
  146. <view class="info-item flex" v-if="Role === 'seller'">
  147. <view class="label">研究员:</view>
  148. <view>{{info.RsCalendarResearcherItem.ResearcherName}}</view>
  149. </view>
  150. <view class="info-item flex">
  151. <view class="label">活动类型:</view>
  152. <view>{{info.RsCalendarItem.ActivityType}}</view>
  153. </view>
  154. <view class="info-item flex">
  155. <view class="label">会议形式:</view>
  156. <view>{{info.RsCalendarItem.RoadshowType}}</view>
  157. </view>
  158. <view class="info-item flex" v-if="info.RsCalendarItem.RoadshowPlatform">
  159. <view class="label">会议平台:</view>
  160. <view>{{info.RsCalendarItem.RoadshowPlatform}}</view>
  161. </view>
  162. <view class="info-item flex" v-if="info.RsCalendarItem.City">
  163. <view class="label">会议城市:</view>
  164. <view>{{info.RsCalendarItem.Province}}{{info.RsCalendarItem.City}}</view>
  165. </view>
  166. <view class="info-item flex">
  167. <view class="label">会议主题:</view>
  168. <view>{{info.RsCalendarItem.Theme}}</view>
  169. </view>
  170. <view class="info-item flex">
  171. <view class="label">合作方名称:</view>
  172. <view>{{info.RsCalendarItem.CooperationName}}</view>
  173. </view>
  174. <view class="info-item flex" v-if="Role === 'researcher'">
  175. <view class="label">提交销售:</view>
  176. <view>{{info.RsCalendarItem.SysUserRealName}}</view>
  177. </view>
  178. <view class="info-item flex">
  179. <view class="label">提交时间:</view>
  180. <view>{{info.RsCalendarItem.CreateTime|formatTime}}</view>
  181. </view>
  182. </view>
  183. <view class="section white-wrap"
  184. v-if="info.RsCalendarResearcherItem.Status==2||info.RsCalendarResearcherItem.Status==3">
  185. <view class="info-item flex">
  186. <view class="label">审批时间:</view>
  187. <view>
  188. {{info.RsCalendarResearcherItem.Status==2?info.RsCalendarResearcherItem.ApproveTime:info.RsCalendarResearcherItem.RefuseTime | formatTime}}
  189. </view>
  190. </view>
  191. <view class="info-item flex" v-if="info.RsCalendarResearcherItem.Status==3">
  192. <view class="label">拒绝理由:</view>
  193. <view>{{info.RsCalendarResearcherItem.RefuseReason}}</view>
  194. </view>
  195. </view>
  196. <view class="section white-wrap" v-if="info.RsCalendarResearcherItem.Status==4">
  197. <view class="info-item flex">
  198. <view class="label">删除时间:</view>
  199. <view>{{info.RsCalendarResearcherItem.DeleteTime | formatTime}}</view>
  200. </view>
  201. <view class="info-item flex">
  202. <view class="label">删除原因:</view>
  203. <view>{{info.RsCalendarResearcherItem.DeleteReason}}</view>
  204. </view>
  205. </view>
  206. </block>
  207. <!-- 审批按钮 -->
  208. <view class="fix-bottom-wrap btns-wrap flex" v-if="haveActiyityStart">
  209. <block v-if="info.RsCalendarResearcherItem.Status===1 && Role === 'researcher'">
  210. <button class="refuse-btn" @click="handleActions('refuse')">拒绝</button>
  211. <button class="pass-btn" @click="handleActions('accept')">接受</button>
  212. </block>
  213. <block v-else-if="info.RsCalendarResearcherItem.Status===1 && Role === 'seller'">
  214. <button class="pass-btn" @click="handleActions('back')">撤回</button>
  215. </block>
  216. <block v-else-if="info.RsCalendarResearcherItem.Status===2 && Role === 'seller'">
  217. <button class="pass-btn" @click="handleActions('edit')">修改</button>
  218. <button class="pass-btn" @click="handleActions('del')">删除</button>
  219. </block>
  220. <block v-else-if="[3,5].includes(info.RsCalendarResearcherItem.Status) && Role === 'seller'">
  221. <button class="pass-btn" @click="handleActions('reEdit')">修改重提</button>
  222. </block>
  223. </view>
  224. </view>
  225. </template>
  226. <script>
  227. import {
  228. apiRoadShowInfo,
  229. apiRoadShowApproved
  230. } from '@/api/approve/activity.js';
  231. import { backActivity,delActivity } from '@/api/roadshow/index.js'
  232. import {
  233. getRole,
  234. editInfoBack
  235. } from './checkRole.js';
  236. import moment from '@/pages-roadshow/utils/_moment.js';
  237. export default {
  238. computed: {
  239. statusImg() {
  240. if(!this.info) return ''
  241. switch (this.info.RsCalendarResearcherItem.Status) {
  242. case 2:
  243. return require('../static/roadshow/accept-ico.png') //同意
  244. case 3:
  245. return require('../static/roadshow/refuse-ico.png') //拒绝
  246. case 4:
  247. return require('../static/roadshow/del-ico.png') //删除
  248. case 5:
  249. return require('../static/roadshow/back-ico.png') //撤回
  250. case 6:
  251. return require('../static/roadshow/end-ico.png') //结束
  252. default: return ''
  253. }
  254. },
  255. Role() {
  256. let userinfo = this.$store.state.userInfo;
  257. return getRole(userinfo.RoleTypeCode);
  258. },
  259. /* 活动是否开始 */
  260. haveActiyityStart() {
  261. if(!this.info) return false
  262. const { StartDate,StartTime } = this.info.RsCalendarResearcherItem;
  263. return moment(`${StartDate} ${StartTime}`).valueOf() > new Date().getTime()
  264. }
  265. },
  266. data() {
  267. return {
  268. RsCalendarResearcherId: null, //活动研究员id
  269. RsCalendarId: null, //路演活动id
  270. info: null,
  271. }
  272. },
  273. onLoad(options) {
  274. this.RsCalendarResearcherId = options.RsCalendarResearcherId
  275. this.RsCalendarId = options.RsCalendarId
  276. },
  277. onShow() {
  278. this.getDetail();
  279. },
  280. methods: {
  281. // 获取详情
  282. async getDetail() {
  283. const res = await apiRoadShowInfo({
  284. RsCalendarId: this.RsCalendarId,
  285. RsCalendarResearcherId: this.RsCalendarResearcherId
  286. })
  287. if (res.code === 200) {
  288. this.info = res.data
  289. }
  290. },
  291. /* 所有操作 */
  292. handleActions(type) {
  293. const handleFns = {
  294. refuse: this.handleRefuse,
  295. accept: this.handlePass,
  296. back: this.revocationHandle,
  297. del: this.delHandle,
  298. reEdit: this.reEditHandle,
  299. edit:this.handleEdit
  300. }
  301. handleFns[type]();
  302. },
  303. /* 撤回操作 */
  304. revocationHandle() {
  305. uni.showModal({
  306. content: '确定要撤回该活动申请吗?',
  307. showCancel: true,
  308. cancelColor: '#A9AFB8',
  309. confirmColor: '#3385FF',
  310. success: async ({
  311. confirm,
  312. cancel
  313. }) => {
  314. if (confirm) {
  315. console.log('用户点击确定');
  316. const { code } = await backActivity({
  317. RsCalendarId: Number(this.RsCalendarId),
  318. RsCalendarResearcherId: Number(this.RsCalendarResearcherId)
  319. })
  320. if(code !==200) return
  321. this.getDetail()
  322. uni.$emit('activityApproveListUpdate', {
  323. RsCalendarId: this.RsCalendarId,
  324. RsCalendarResearcherId: this.RsCalendarResearcherId
  325. })
  326. } else if (cancel) {
  327. console.log('用户点击取消');
  328. }
  329. }
  330. })
  331. },
  332. /* 修改重提 */
  333. reEditHandle() {
  334. const { CompanyId,CompanyName,EnglishCompany } = this.info.CompanyDetail;
  335. const { ActivityType,RoadshowType,RoadshowPlatform,City,Province,Theme,CooperationName,ActivityCategory } = this.info.RsCalendarItem;
  336. const { ResearcherId,StartDate,EndDate,StartTime,EndTime,RsCalendarId,RsCalendarResearcherId } = this.info.RsCalendarResearcherItem;
  337. let form = editInfoBack({ActivityType,RoadshowType,RoadshowPlatform,City,Province,Theme,CooperationName,ActivityCategory,CompanyId,CompanyName,ResearcherId,StartDate,EndDate,StartTime,EndTime});
  338. let edit_id = RsCalendarId,edit_rs_id = RsCalendarResearcherId;
  339. if(CompanyId){
  340. uni.setStorageSync('roadshow_compantyId',CompanyId);
  341. uni.setStorageSync('roadshow_isEnglishCompany',EnglishCompany);
  342. }
  343. // uni.navigateTo({
  344. // url:`/pages-roadshow/addActivity/index?form=${JSON.stringify(form)}&edit_id=${edit_id}&edit_rs_id=${edit_rs_id}`
  345. // })
  346. uni.navigateTo({
  347. url:`/pages-roadshow/addActivity/index`,
  348. success: function(res) {
  349. // 通过eventChannel向被打开页面传送数据
  350. res.eventChannel.emit('emitBackData', {
  351. form: JSON.stringify(form),
  352. edit_id,
  353. edit_rs_id
  354. })
  355. }
  356. });
  357. },
  358. /* 删除 需删除理由 */
  359. delHandle() {
  360. uni.navigateTo({
  361. url: `./reason?RsCalendarId=${this.RsCalendarId}&RsCalendarResearcherId=${this.RsCalendarResearcherId}&type=del`
  362. })
  363. },
  364. handlePass() {
  365. uni.showModal({
  366. content: '接受申请后会加入您的日历,请确认!',
  367. showCancel: true,
  368. cancelColor: '#A9AFB8',
  369. confirmColor: '#3385FF',
  370. success: ({
  371. confirm,
  372. cancel
  373. }) => {
  374. if (confirm) {
  375. console.log('用户点击确定');
  376. this.passApprove()
  377. } else if (cancel) {
  378. console.log('用户点击取消');
  379. }
  380. }
  381. })
  382. },
  383. // 通过申请
  384. async passApprove() {
  385. const res = await apiRoadShowApproved({
  386. RsCalendarId: Number(this.RsCalendarId),
  387. RsCalendarResearcherId: Number(this.RsCalendarResearcherId)
  388. })
  389. if (res.code === 200) {
  390. this.getDetail()
  391. uni.$emit('activityApproveListUpdate', {
  392. RsCalendarId: this.RsCalendarId,
  393. RsCalendarResearcherId: this.RsCalendarResearcherId
  394. })
  395. }
  396. },
  397. handleRefuse() {
  398. uni.navigateTo({
  399. url: `./reason?RsCalendarId=${this.RsCalendarId}&RsCalendarResearcherId=${this.RsCalendarResearcherId}&type=refuse`
  400. })
  401. },
  402. handleEdit() {
  403. const { CompanyId,CompanyName,EnglishCompany } = this.info.CompanyDetail;
  404. const { ActivityType,RoadshowType,RoadshowPlatform,City,Province,Theme,CooperationName,ActivityCategory } = this.info.RsCalendarItem;
  405. const { ResearcherId,StartDate,EndDate,StartTime,EndTime,RsCalendarId,RsCalendarResearcherId } = this.info.RsCalendarResearcherItem;
  406. let form = editInfoBack({ActivityType,RoadshowType,RoadshowPlatform,City,Province,Theme,CooperationName,ActivityCategory,CompanyId,CompanyName,ResearcherId,StartDate,EndDate,StartTime,EndTime});
  407. let edit_id = RsCalendarId,edit_rs_id = RsCalendarResearcherId;
  408. if(CompanyId){
  409. uni.setStorageSync('roadshow_compantyId',CompanyId);
  410. uni.setStorageSync('roadshow_isEnglishCompany',EnglishCompany);
  411. }
  412. uni.navigateTo({
  413. url:`/pages-roadshow/addActivity/activityEdit`,
  414. success: function(res) {
  415. // 通过eventChannel向被打开页面传送数据
  416. res.eventChannel.emit('emitBackData', {
  417. form: JSON.stringify(form),
  418. edit_id,
  419. edit_rs_id
  420. })
  421. }
  422. });
  423. },
  424. }
  425. }
  426. </script>
  427. <style lang="scss" scoped>
  428. .activity-detail {
  429. .status-img {
  430. position: absolute;
  431. right: 0;
  432. top: 50rpx;
  433. width: 220rpx;
  434. height: 220rpx;
  435. z-index: 10;
  436. }
  437. .section {
  438. margin-bottom: 14rpx;
  439. padding: 33rpx 34rpx;
  440. .line {
  441. width: 100%;
  442. height: 0;
  443. border-top: 1px dashed rgba(112, 112, 112, .21);
  444. margin: 30rpx 0;
  445. }
  446. }
  447. .info-item {
  448. margin-bottom: 20rpx;
  449. .label {
  450. flex-shrink: 0;
  451. color: #666;
  452. margin-right: 20rpx;
  453. }
  454. }
  455. .btns-wrap {
  456. justify-content: center;
  457. button {
  458. width: 260rpx;
  459. height: 70rpx;
  460. border-radius: 28px;
  461. border: none;
  462. margin: 0 15px;
  463. font-size: 15px;
  464. color: #fff;
  465. line-height: 70rpx;
  466. }
  467. .pass-btn {
  468. background-color: #5890fb;
  469. }
  470. .refuse-btn {
  471. background-color: #f55768;
  472. }
  473. }
  474. }
  475. </style>