index.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. var template = ''
  2. $.ajax('../../../component/statistics/ActivityHoldDetail/index.html', {
  3. data: {},
  4. dataType: 'html',
  5. cache: false,
  6. timeout: 60000,
  7. async: false,
  8. error: function (res) {},
  9. success: function (res) {
  10. template = res
  11. }
  12. })
  13. Vue.component('activity-hold-detail', {
  14. template: template,
  15. data() {
  16. return {
  17. years: [],
  18. yearType: '1',
  19. chooseYear: null,
  20. chooseTime: null,
  21. form: {
  22. range: 'town',
  23. firstClassify: '',
  24. secondClassify: '',
  25. activityStatus: '',
  26. eventForm: '',
  27. eventAim: ''
  28. },
  29. tableData: [],
  30. dialogShow: false,
  31. info: {},
  32. page1: 1,
  33. size1: 10,
  34. total1: 0,
  35. page2: 1,
  36. size2: 10,
  37. total2: 0,
  38. page3: 1,
  39. size3: 10,
  40. total3: 0,
  41. loading: false,
  42. exportLoading: false,
  43. rangeOptions: [
  44. { label: '按区', value: 'town' },
  45. { label: '按社区', value: 'hospital' }
  46. ],
  47. areaOptions: [
  48. { label: '思明区', value: '350203' },
  49. { label: '海沧区', value: '350205' },
  50. { label: '湖里区', value: '350206' },
  51. { label: '集美区', value: '350211' },
  52. { label: '同安区', value: '350212' },
  53. { label: '翔安区', value: '350213' }
  54. ],
  55. level: 0,
  56. tableHeader: [
  57. { label: '活动名称', prop: 'title', width: '120' },
  58. { label: '活动一级类别', prop: 'firstClassify', width: '120' },
  59. { label: '活动二级类别', prop: 'secondClassify', width: '120' },
  60. { label: '活动状态', prop: 'activityStatus' },
  61. { label: '举办形式', prop: 'eventForm' },
  62. { label: '举办目的', prop: 'eventAim' },
  63. { label: '主办机构', prop: 'organizer', width: '140' },
  64. { label: '预计报名人数', prop: 'num', width: '120' },
  65. { label: '已报名人数', prop: 'joinNum' },
  66. { label: '参与社区医院数量', prop: 'hospitalNum', width: '140' },
  67. { label: '活动创建时间', prop: 'createTime', width: '120' },
  68. { label: '报名截止时间', prop: 'registrationEndTime', width: '120' },
  69. { label: '活动下线时间', prop: 'offlineEndTime', width: '120' }
  70. ],
  71. dialogShow: false,
  72. query: {},
  73. query1: {},
  74. dialogTableData: [],
  75. dialogHeader: [
  76. { label: '姓名', prop: 'name' },
  77. { label: '性别', prop: 'sex' },
  78. { label: '年龄', prop: 'age' },
  79. { label: '证件号码', prop: 'idcard', width: '120' },
  80. { label: '手机号码', prop: 'mobile' },
  81. { label: '签约机构', prop: 'hospitalName' },
  82. { label: '签约医生', prop: 'doctorName' },
  83. { label: '积分', prop: 'jfTotal' },
  84. { label: '奖励', prop: 'couponTotal' },
  85. { label: '排名', prop: 'ranking' }
  86. ],
  87. dialogLoading: false,
  88. dialogLoading1: false,
  89. activityId: null,
  90. dialogShow1: false,
  91. dialogTableData1: [],
  92. dialogHeader1: [
  93. { label: '姓名', prop: 'name' },
  94. { label: '性别', prop: 'sex' },
  95. { label: '年龄', prop: 'age' },
  96. { label: '证件号码', prop: 'idcard', width: '140' },
  97. { label: '手机号码', prop: 'mobile' },
  98. { label: '签约机构', prop: 'hospitalName' },
  99. { label: '签约医生', prop: 'doctorName' },
  100. { label: '活动名称', prop: 'title' },
  101. { label: '活动一级类别', prop: 'firstClassify', width: '120' },
  102. { label: '活动二级类别', prop: 'secondClassify', width: '120' },
  103. { label: '主办机构', prop: 'organizer' },
  104. { label: '获得积分', prop: 'total' },
  105. { label: '获得奖励金额', prop: 'feeTotal', width: '120' },
  106. { label: '参与活动时间', prop: 'updateTime', width: '160' }
  107. ],
  108. dialogExportLoading1: false,
  109. hospitalOptions: []
  110. }
  111. },
  112. methods: {
  113. init() {
  114. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  115. if (selectedRole.code.indexOf('350200') > -1) {
  116. this.level = 1 // 市卫健委
  117. this.areaOptions = [
  118. { label: '思明区', value: '350203' },
  119. { label: '海沧区', value: '350205' },
  120. { label: '湖里区', value: '350206' },
  121. { label: '集美区', value: '350211' },
  122. { label: '同安区', value: '350212' },
  123. { label: '翔安区', value: '350213' }
  124. ]
  125. } else if (selectedRole.code.length == 6) {
  126. this.level = 2 // 区管理
  127. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  128. this.form = {
  129. range: 'town',
  130. area: selectedRole.code,
  131. firstClassify: '',
  132. secondClassify: '',
  133. activityStatus: '',
  134. eventForm: '',
  135. eventAim: ''
  136. }
  137. this.getHospital(selectedRole.code)
  138. } else {
  139. this.rangeOptions = [{ label: '按社区', value: 'hospital' }]
  140. this.form = {
  141. range: 'hospital',
  142. area: selectedRole.code.substring(0, 6),
  143. hospital: selectedRole.code,
  144. firstClassify: '',
  145. secondClassify: '',
  146. activityStatus: '',
  147. eventForm: '',
  148. eventAim: ''
  149. }
  150. this.level = 3 // 社区管理
  151. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code.substring(0, 6) }]
  152. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  153. }
  154. this.initTime()
  155. this.searchFn()
  156. },
  157. initTime() {
  158. var vm = this
  159. var now = new Date()
  160. vm.nowyear = vm.chooseYear = now.getFullYear()
  161. vm.years = []
  162. for (i = vm.nowyear; i >= 2013; i--) {
  163. vm.years.push(i)
  164. }
  165. },
  166. searchFn() {
  167. var vm = this
  168. this.loading = true
  169. var params = {
  170. ...this.form,
  171. page: this.page1,
  172. size: this.size1
  173. }
  174. vm.tableData = []
  175. if (this.yearType == '1') {
  176. params.startDate = this.chooseYear + '-01-01'
  177. params.endDate = this.chooseYear + '-12-31'
  178. } else {
  179. if (this.chooseTime) {
  180. params.startDate = this.chooseTime[0]
  181. params.endDate = this.chooseTime[1]
  182. }
  183. }
  184. httpRequest.get('doctor/healthBank/eventDetail', { data: params }).then(function (res) {
  185. if (res.status == 200) {
  186. vm.tableData = res.detailModelList
  187. vm.total1 = res.totalCount
  188. }
  189. vm.loading = false
  190. })
  191. },
  192. exportTable() {
  193. var vm = this
  194. var params = {
  195. ...this.form,
  196. page: this.page,
  197. pageSize: this.size
  198. }
  199. if (this.yearType == '1') {
  200. params.startDate = this.chooseYear + '-01-01'
  201. params.endDate = this.chooseYear + '-12-31'
  202. } else {
  203. if (this.chooseTime) {
  204. params.startDate = this.chooseTime[0]
  205. params.endDate = this.chooseTime[1]
  206. }
  207. }
  208. this.exportLoading = true
  209. var fileName = `活动举办明细${new Date().getTime()}.xls`
  210. httpRequest.downLoadFileForAjax('doctor/healthBank/exportEventDetail', fileName, params).then(function () {
  211. vm.exportLoading = false
  212. })
  213. },
  214. eliminateClick() {
  215. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  216. if (this.level == 1) {
  217. this.form = {
  218. range: 'town',
  219. firstClassify: '',
  220. secondClassify: '',
  221. activityStatus: '',
  222. eventForm: '',
  223. eventAim: ''
  224. }
  225. } else if (this.level == 2) {
  226. this.form = {
  227. range: 'town',
  228. area: selectedRole.code,
  229. firstClassify: '',
  230. secondClassify: '',
  231. activityStatus: '',
  232. eventForm: '',
  233. eventAim: ''
  234. }
  235. this.getHospital(selectedRole.code)
  236. } else {
  237. this.form = {
  238. range: 'hospital',
  239. area: selectedRole.code.substring(0, 6),
  240. hospital: selectedRole.code,
  241. firstClassify: '',
  242. secondClassify: '',
  243. activityStatus: '',
  244. eventForm: '',
  245. eventAim: ''
  246. }
  247. }
  248. this.yearType = '1'
  249. this.chooseYear = new Date().getFullYear()
  250. this.chooseTime = null
  251. this.$forceUpdate()
  252. },
  253. openDialog(row, prop) {
  254. if (prop != 'title') {
  255. return
  256. }
  257. this.dialogShow1 = true
  258. this.page3 = 1
  259. this.query1 = {
  260. activityId: row.id,
  261. title: row.title,
  262. hospitalName: '',
  263. doctorName: '',
  264. firstClassify: row.firstClassify,
  265. secondClassify: row.secondClassify
  266. }
  267. this.dialogSearch1()
  268. },
  269. closeDialog() {
  270. this.dialogShow = false
  271. },
  272. previewDetailData(row) {
  273. this.dialogShow = true
  274. this.activityId = row.id
  275. this.query = {
  276. // sex: ''
  277. }
  278. this.page2 = 1
  279. this.dialogSearch()
  280. },
  281. getHospital(code) {
  282. var vm = this
  283. delete this.form.hospital
  284. delete this.form.team
  285. var params = {
  286. type: 5,
  287. code: code
  288. }
  289. httpRequest.post('common/district', { data: params }).then(function (res) {
  290. vm.hospitalOptions = [{ code: '', name: '全部' }]
  291. vm.hospitalOptions = vm.hospitalOptions.concat(res.list)
  292. })
  293. },
  294. resetArea() {
  295. if (this.level == 1) {
  296. delete this.form.area
  297. delete this.form.hospital
  298. delete this.form.team
  299. } else if (this.level == 2) {
  300. delete this.form.hospital
  301. delete this.form.team
  302. } else {
  303. delete this.form.team
  304. }
  305. },
  306. dialogSearch() {
  307. var vm = this
  308. this.dialogLoading = true
  309. var params = {
  310. ...this.query,
  311. activityId: this.activityId,
  312. page: this.page2,
  313. size: this.size2
  314. }
  315. httpRequest.get('doctor/healthBank/eventDataDetail', { data: params }).then(function (res) {
  316. if (res.status == 200) {
  317. vm.dialogTableData = res.detailModelList
  318. vm.total2 = res.totalCount
  319. }
  320. vm.dialogLoading = false
  321. })
  322. },
  323. dialogExport() {
  324. var vm = this
  325. var params = {
  326. ...this.query,
  327. activityId: this.activityId
  328. }
  329. if (this.yearType == '1') {
  330. params.startDate = this.chooseYear + '-01-01'
  331. params.endDate = this.chooseYear + '-12-31'
  332. } else {
  333. if (this.chooseTime) {
  334. params.startDate = this.chooseTime[0]
  335. params.endDate = this.chooseTime[1]
  336. }
  337. }
  338. this.exportLoading = true
  339. var fileName = `活动数据明细${new Date().getTime()}.xls`
  340. httpRequest.downLoadFileForAjax('doctor/healthBank/exportEventDataDetail', fileName, params).then(function () {
  341. vm.exportLoading = false
  342. })
  343. },
  344. getSecondClassifyList(val) {
  345. return getSecondClassifyList(val)
  346. },
  347. closeDialog1() {
  348. this.dialogShow1 = false
  349. },
  350. dialogSearch1() {
  351. var vm = this
  352. this.dialogLoading1 = true
  353. var params = {
  354. range: this.form.range,
  355. area: this.form.area,
  356. hospital: this.form.hospital,
  357. ...this.query1,
  358. page: this.page3,
  359. size: this.size3
  360. }
  361. if (this.yearType == '1') {
  362. params.startDate = this.chooseYear + '-01-01'
  363. params.endDate = this.chooseYear + '-12-31'
  364. } else {
  365. if (this.chooseTime) {
  366. params.startDate = this.chooseTime[0]
  367. params.endDate = this.chooseTime[1]
  368. }
  369. }
  370. httpRequest.get('doctor/healthBank/eventRegistrationDetail', { data: params }).then(function (res) {
  371. if (res.status == 200) {
  372. vm.dialogTableData1 = res.detailModelList
  373. vm.total3 = res.totalCount
  374. }
  375. vm.dialogLoading1 = false
  376. })
  377. },
  378. dialogExport1() {
  379. var vm = this
  380. var params = {
  381. range: this.form.range,
  382. area: this.form.area ?? '',
  383. hospital: this.form.hospital ?? '',
  384. ...this.query1
  385. }
  386. if (this.yearType == '1') {
  387. params.startDate = this.chooseYear + '-01-01'
  388. params.endDate = this.chooseYear + '-12-31'
  389. } else {
  390. if (this.chooseTime) {
  391. params.startDate = this.chooseTime[0]
  392. params.endDate = this.chooseTime[1]
  393. }
  394. }
  395. this.dialogExportLoading1 = true
  396. var fileName = `活动报名明细${new Date().getTime()}.xls`
  397. httpRequest.downLoadFileForAjax('doctor/healthBank/exportEventRegistrationDetail', fileName, params).then(function () {
  398. vm.dialogExportLoading1 = false
  399. })
  400. },
  401. handleCurrentChange(val, num) {
  402. if (num == 1) {
  403. this.page1 = val
  404. this.searchFn()
  405. } else if (num == 2) {
  406. this.page2 = val
  407. this.dialogSearch()
  408. } else {
  409. this.page3 = val
  410. this.dialogSearch1()
  411. }
  412. },
  413. handleSizeChange(val, num) {
  414. if (num == 1) {
  415. this.size1 = val
  416. this.searchFn()
  417. } else if (num == 2) {
  418. this.size2 = val
  419. this.dialogSearch()
  420. } else {
  421. this.size3 = val
  422. this.dialogSearch1()
  423. }
  424. }
  425. },
  426. mounted() {
  427. this.init()
  428. }
  429. })