| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559 | 
							- var template = ''
 
- $.ajax('../../../component/statistics/ActivityRegister/index.html', {
 
-   data: {},
 
-   dataType: 'html',
 
-   cache: false,
 
-   timeout: 60000,
 
-   async: false,
 
-   error: function (res) {},
 
-   success: function (res) {
 
-     template = res
 
-   }
 
- })
 
- Vue.component('activity-register', {
 
-   template: template,
 
-   props: {
 
-     header: {}
 
-   },
 
-   data() {
 
-     return {
 
-       years: [],
 
-       yearType: '1',
 
-       chooseYear: null,
 
-       chooseTime: null,
 
-       form: {
 
-         range: 'town'
 
-       },
 
-       tableData: [],
 
-       dialogShow: false,
 
-       info: {},
 
-       page: 1,
 
-       size: 10,
 
-       total: 0,
 
-       page1: 1,
 
-       size1: 10,
 
-       total1: 0,
 
-       loading: false,
 
-       exportLoading: false,
 
-       rangeOptions: [
 
-         { label: '按区', value: 'town' },
 
-         { label: '按社区', value: 'hospital' }
 
-       ],
 
-       areaOptions: [
 
-         { label: '思明区', value: '350203' },
 
-         { label: '海沧区', value: '350205' },
 
-         { label: '湖里区', value: '350206' },
 
-         { label: '集美区', value: '350211' },
 
-         { label: '同安区', value: '350212' },
 
-         { label: '翔安区', value: '350213' }
 
-       ],
 
-       level: 0,
 
-       tableHeader: [],
 
-       dialogShow: false,
 
-       query: {},
 
-       query1: {},
 
-       dialogTableData: [],
 
-       dialogHeader: [
 
-         { label: '活动名称', prop: 'title' },
 
-         { label: '活动一级类别', prop: 'firstClassify' },
 
-         { label: '活动二级类别', prop: 'secondClassify' },
 
-         { label: '活动状态', prop: 'activityStatus' },
 
-         { label: '主办机构', prop: 'organizer' },
 
-         { label: '预计报名人数', prop: 'num' },
 
-         { label: '已报名人数', prop: 'joinNum' },
 
-         { label: '参与社区医院数量', prop: 'hospitalNum', width: '140' },
 
-         { label: '活动创建时间', prop: 'createTime' },
 
-         { label: '报名截止时间', prop: 'registrationEndTime' },
 
-         { label: '活动下线时间', prop: 'offlineEndTime' }
 
-       ],
 
-       dialogLoading: false,
 
-       dialogExportLoading: false,
 
-       dialogShow1: false,
 
-       dialogTableData1: [],
 
-       dialogHeader1: [
 
-         { label: '姓名', prop: 'name' },
 
-         { label: '性别', prop: 'sex' },
 
-         { label: '年龄', prop: 'age' },
 
-         { label: '证件号码', prop: 'idcard', width: '140' },
 
-         { label: '手机号码', prop: 'mobile' },
 
-         { label: '签约机构', prop: 'hospitalName' },
 
-         { label: '签约医生', prop: 'doctorName' },
 
-         { label: '活动名称', prop: 'title' },
 
-         { label: '活动一级类别', prop: 'firstClassify', width: '120' },
 
-         { label: '活动二级类别', prop: 'secondClassify', width: '120' },
 
-         { label: '主办机构', prop: 'organizer' },
 
-         { label: '获得积分', prop: 'total' },
 
-         { label: '获得奖励金额', prop: 'feeTotal', width: '120' },
 
-         { label: '参与活动时间', prop: 'updateTime', width: '160' }
 
-       ],
 
-       dialogLoading1: false,
 
-       dialogExportLoading1: false,
 
-       hospitalOptions: []
 
-     }
 
-   },
 
-   watch: {
 
-     header: {
 
-       handler() {
 
-         if (this.form.range == 'town') {
 
-           this.tableHeader = [
 
-             { label: '地区', prop: 'town', width: '120' },
 
-             { label: '社区', prop: 'hospital', width: '140' }
 
-           ].concat(this.header)
 
-         } else if (this.form.range == 'hospital') {
 
-           this.tableHeader = [{ label: '社区', prop: 'hospital', width: '140' }].concat(this.header)
 
-         }
 
-       }
 
-     }
 
-   },
 
-   methods: {
 
-     init() {
 
-       var vm = this
 
-       var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
 
-       if (selectedRole.code.indexOf('350200') > -1) {
 
-         this.level = 1 //  市卫健委
 
-         this.areaOptions = [
 
-           { label: '思明区', value: '350203' },
 
-           { label: '海沧区', value: '350205' },
 
-           { label: '湖里区', value: '350206' },
 
-           { label: '集美区', value: '350211' },
 
-           { label: '同安区', value: '350212' },
 
-           { label: '翔安区', value: '350213' }
 
-         ]
 
-       } else if (selectedRole.code.length == 6) {
 
-         this.level = 2 // 区管理
 
-         this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
 
-         this.form = {
 
-           range: 'town',
 
-           area: selectedRole.code
 
-         }
 
-         this.getHospital(selectedRole.code)
 
-       } else {
 
-         this.rangeOptions = [{ label: '按社区', value: 'hospital' }]
 
-         this.form = {
 
-           range: 'hospital',
 
-           area: selectedRole.code.substring(0, 6),
 
-           hospital: selectedRole.code
 
-         }
 
-         this.level = 3 // 社区管理
 
-         this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code.substring(0, 6) }]
 
-         this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
 
-       }
 
-       this.initTime()
 
-       setTimeout(function () {
 
-         vm.searchFn()
 
-       }, 200)
 
-     },
 
-     initTime() {
 
-       var vm = this
 
-       var now = new Date()
 
-       vm.nowyear = vm.chooseYear = now.getFullYear()
 
-       vm.years = []
 
-       for (i = vm.nowyear; i >= 2013; i--) {
 
-         vm.years.push(i)
 
-       }
 
-     },
 
-     searchFn() {
 
-       var vm = this
 
-       this.loading = true
 
-       var params = {
 
-         ...this.form,
 
-         isTotal: 1,
 
-         menu: this.header
 
-           .map(function (item) {
 
-             return item.prop
 
-           })
 
-           .join(',')
 
-       }
 
-       vm.tableData = []
 
-       if (this.yearType == '1') {
 
-         params.startDate = this.chooseYear + '-01-01'
 
-         params.endDate = this.chooseYear + '-12-31'
 
-       } else {
 
-         if (this.chooseTime) {
 
-           params.startDate = this.chooseTime[0]
 
-           params.endDate = this.chooseTime[1]
 
-         }
 
-       }
 
-       httpRequest.get('doctor/healthBank/clubEventStatistics', { data: params }).then(function (res) {
 
-         if (res.status == 200) {
 
-           vm.tableData = res.data.list.map(function (item) {
 
-             var data = JSON.parse(JSON.stringify(item))
 
-             if (vm.form.range == 'town') {
 
-               data.town = item.name
 
-               data.hasChildren = item.code && true
 
-             } else if (vm.form.range == 'hospital') {
 
-               data.hospital = item.name
 
-               data.hasChildren = false
 
-             }
 
-             return data
 
-           })
 
-         }
 
-         vm.loading = false
 
-       })
 
-     },
 
-     exportTable() {
 
-       var vm = this
 
-       var params = {
 
-         ...this.form,
 
-         menu: this.header
 
-           .map(function (item) {
 
-             return item.prop
 
-           })
 
-           .join(',')
 
-       }
 
-       if (this.yearType == '1') {
 
-         params.startDate = this.chooseYear + '-01-01'
 
-         params.endDate = this.chooseYear + '-12-31'
 
-       } else {
 
-         if (this.chooseTime) {
 
-           params.startDate = this.chooseTime[0]
 
-           params.endDate = this.chooseTime[1]
 
-         }
 
-       }
 
-       this.exportLoading = true
 
-       var fileName = `活动举办报名汇总${new Date().getTime()}.xls`
 
-       httpRequest.downLoadFileForAjax('doctor/healthBank/exportClubEventStatistics', fileName, params).then(function () {
 
-         vm.exportLoading = false
 
-       })
 
-     },
 
-     eliminateClick() {
 
-       var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
 
-       if (this.level == 1) {
 
-         this.form = {
 
-           range: 'town'
 
-         }
 
-       } else if (this.level == 2) {
 
-         this.form = {
 
-           range: 'town',
 
-           area: selectedRole.code
 
-         }
 
-         this.getHospital(selectedRole.code)
 
-       } else {
 
-         this.form = {
 
-           range: 'hospital',
 
-           area: selectedRole.code.substring(0, 6),
 
-           hospital: selectedRole.code
 
-         }
 
-         this.level = 3 // 社区管理
 
-         this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code.substring(0, 6) }]
 
-         this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
 
-       }
 
-       this.yearType = '1'
 
-       this.chooseYear = new Date().getFullYear()
 
-       this.chooseTime = null
 
-       this.$forceUpdate()
 
-     },
 
-     closeDialog() {
 
-       this.dialogShow = false
 
-     },
 
-     closeDialog1() {
 
-       this.dialogShow1 = false
 
-     },
 
-     getHospital(code) {
 
-       var vm = this
 
-       delete this.form.hospital
 
-       delete this.form.team
 
-       var params = {
 
-         type: 5,
 
-         code: code
 
-       }
 
-       httpRequest.post('common/district', { data: params }).then(function (res) {
 
-         vm.hospitalOptions = [{ code: '', name: '全部' }]
 
-         vm.hospitalOptions = vm.hospitalOptions.concat(res.list)
 
-       })
 
-     },
 
-     resetArea() {
 
-       if (this.level == 1) {
 
-         delete this.form.area
 
-         delete this.form.hospital
 
-         delete this.form.team
 
-       } else if (this.level == 2) {
 
-         delete this.form.hospital
 
-         delete this.form.team
 
-       } else {
 
-         delete this.form.team
 
-       }
 
-     },
 
-     load(row, treeNode, resolve) {
 
-       var params = {
 
-         menu: this.header
 
-           .map(function (item) {
 
-             return item.prop
 
-           })
 
-           .join(',')
 
-       }
 
-       var len = row.code.length
 
-       if (len == 6) {
 
-         params.range = 'hospital'
 
-         params.area = row.code
 
-       }
 
-       if (this.yearType == '1') {
 
-         params.startDate = this.chooseYear + '-01-01'
 
-         params.endDate = this.chooseYear + '-12-31'
 
-       } else {
 
-         if (this.chooseTime) {
 
-           params.startDate = this.chooseTime[0]
 
-           params.endDate = this.chooseTime[1]
 
-         }
 
-       }
 
-       httpRequest.get('doctor/healthBank/clubEventStatistics', { data: params }).then(function (res) {
 
-         if (res.status == 200) {
 
-           var children = res.data.list.map(function (item) {
 
-             var data = {
 
-               ...item
 
-             }
 
-             if (len == 6) {
 
-               data.hospital = item.name
 
-               data.hasChildren = false
 
-               data.town1 = row.code
 
-             }
 
-             return data
 
-           })
 
-           resolve(children)
 
-         }
 
-       })
 
-     },
 
-     searchActivityHold() {
 
-       var vm = this
 
-       this.dialogLoading = true
 
-       var params = {
 
-         range: this.form.range,
 
-         area: this.form.area ?? '',
 
-         hospital: this.form.hospital ?? '',
 
-         ...this.query,
 
-         page: this.page,
 
-         size: this.size
 
-       }
 
-       if (this.yearType == '1') {
 
-         params.startDate = this.chooseYear + '-01-01'
 
-         params.endDate = this.chooseYear + '-12-31'
 
-       } else {
 
-         if (this.chooseTime) {
 
-           params.startDate = this.chooseTime[0]
 
-           params.endDate = this.chooseTime[1]
 
-         }
 
-       }
 
-       httpRequest.get('doctor/healthBank/eventDetail', { data: params }).then(function (res) {
 
-         if (res.status == 200) {
 
-           vm.dialogTableData = res.detailModelList
 
-           vm.total = res.totalCount
 
-         }
 
-         vm.dialogLoading = false
 
-       })
 
-     },
 
-     exportActivityHold() {
 
-       var vm = this
 
-       var params = {
 
-         range: this.form.range,
 
-         area: this.form.area ?? '',
 
-         hospital: this.form.hospital ?? '',
 
-         ...this.query
 
-       }
 
-       if (this.yearType == '1') {
 
-         params.startDate = this.chooseYear + '-01-01'
 
-         params.endDate = this.chooseYear + '-12-31'
 
-       } else {
 
-         if (this.chooseTime) {
 
-           params.startDate = this.chooseTime[0]
 
-           params.endDate = this.chooseTime[1]
 
-         }
 
-       }
 
-       this.dialogExportLoading = true
 
-       var fileName = `活动举办明细${new Date().getTime()}.xls`
 
-       httpRequest.downLoadFileForAjax('doctor/healthBank/exportEventDetail', fileName, params).then(function () {
 
-         vm.dialogExportLoading = false
 
-       })
 
-     },
 
-     searchActivityRegistry() {
 
-       var vm = this
 
-       this.dialogLoading1 = true
 
-       var params = {
 
-         range: this.form.range,
 
-         area: this.form.area,
 
-         hospital: this.form.hospital,
 
-         ...this.query1,
 
-         page: this.page1,
 
-         size: this.size1
 
-       }
 
-       if (this.yearType == '1') {
 
-         params.startDate = this.chooseYear + '-01-01'
 
-         params.endDate = this.chooseYear + '-12-31'
 
-       } else {
 
-         if (this.chooseTime) {
 
-           params.startDate = this.chooseTime[0]
 
-           params.endDate = this.chooseTime[1]
 
-         }
 
-       }
 
-       httpRequest.get('doctor/healthBank/eventRegistrationDetail', { data: params }).then(function (res) {
 
-         if (res.status == 200) {
 
-           vm.dialogTableData1 = res.detailModelList
 
-           vm.total1 = res.totalCount
 
-         }
 
-         vm.dialogLoading1 = false
 
-       })
 
-     },
 
-     exportActivityRegistry() {
 
-       var vm = this
 
-       var params = {
 
-         range: this.form.range,
 
-         area: this.form.area ?? '',
 
-         hospital: this.form.hospital ?? '',
 
-         ...this.query1
 
-       }
 
-       if (this.yearType == '1') {
 
-         params.startDate = this.chooseYear + '-01-01'
 
-         params.endDate = this.chooseYear + '-12-31'
 
-       } else {
 
-         if (this.chooseTime) {
 
-           params.startDate = this.chooseTime[0]
 
-           params.endDate = this.chooseTime[1]
 
-         }
 
-       }
 
-       this.dialogExportLoading1 = true
 
-       var fileName = `活动报名明细${new Date().getTime()}.xls`
 
-       httpRequest.downLoadFileForAjax('doctor/healthBank/exportEventRegistrationDetail', fileName, params).then(function () {
 
-         vm.dialogExportLoading1 = false
 
-       })
 
-     },
 
-     handleCurrentChange(val, type) {
 
-       if (type == 1) {
 
-         this.page = val
 
-         this.searchActivityHold()
 
-       } else {
 
-         this.page1 = val
 
-         this.searchActivityRegistry()
 
-       }
 
-     },
 
-     handleSizeChange(val, type) {
 
-       if (type == 1) {
 
-         this.size = val
 
-         this.searchActivityHold()
 
-       } else {
 
-         this.size1 = val
 
-         this.searchActivityRegistry()
 
-       }
 
-     },
 
-     getClass(row, prop) {
 
-       if (
 
-         [
 
-           'eventTotal',
 
-           'eventDoneNum',
 
-           'eventIngNum',
 
-           'eventNotStartNum',
 
-           'healthSportNum',
 
-           'healthEduNum',
 
-           'promoteBusinessNum',
 
-           'signUpTotal',
 
-           'healthSportSignUpNum',
 
-           'healthEduSignUpNum',
 
-           'promoteBusinessSignUpNum'
 
-         ].includes(prop) &&
 
-         row.code
 
-       ) {
 
-         return 'pointer c-409eff'
 
-       } else {
 
-         return ''
 
-       }
 
-     },
 
-     openDialog(row, prop) {
 
-       var range
 
-       if (row.code.length == 6) {
 
-         range = 'town'
 
-       } else if (row.code.length == 10) {
 
-         range = 'hospital'
 
-       }
 
-       if (['eventTotal', 'eventDoneNum', 'eventIngNum', 'eventNotStartNum', 'healthSportNum', 'healthEduNum', 'promoteBusinessNum'].includes(prop)) {
 
-         this.query = {
 
-           title: '',
 
-           firstClassify: '',
 
-           secondClassify: '',
 
-           activityStatus: '',
 
-           range: range
 
-         }
 
-         switch (prop) {
 
-           case 'eventTotal':
 
-             this.query.activityStatus = ''
 
-             break
 
-           case 'eventDoneNum':
 
-             this.query.activityStatus = '6'
 
-             break
 
-           case 'eventIngNum':
 
-             this.query.activityStatus = '2'
 
-             break
 
-           case 'eventNotStartNum':
 
-             this.query.activityStatus = '4'
 
-             break
 
-           case 'healthSportNum':
 
-             this.query.firstClassify = '健康运动类'
 
-             break
 
-           case 'healthEduNum':
 
-             this.query.firstClassify = '健康教育类'
 
-             break
 
-           case 'promoteBusinessNum':
 
-             this.query.firstClassify = '促进业务类'
 
-             break
 
-         }
 
-         if (range == 'town') {
 
-           this.query.area = row.code
 
-         } else if (range == 'hospital') {
 
-           this.query.hospital = row.code
 
-         }
 
-         this.dialogShow = true
 
-         this.searchActivityHold()
 
-         this.page = 1
 
-       } else if (['signUpTotal', 'healthSportSignUpNum', 'healthEduSignUpNum', 'promoteBusinessSignUpNum'].includes(prop)) {
 
-         this.query1 = {
 
-           title: '',
 
-           hospitalName: '',
 
-           doctorName: '',
 
-           firstClassify: '',
 
-           secondClassify: '',
 
-           range: range
 
-         }
 
-         if (range == 'town') {
 
-           this.query1.area = row.code
 
-         } else if (range == 'hospital') {
 
-           this.query1.hospital = row.code
 
-         }
 
-         var dict = {
 
-           signUpTotal: '',
 
-           healthSportSignUpNum: '健康运动类',
 
-           healthEduSignUpNum: '健康教育类',
 
-           promoteBusinessSignUpNum: '促进业务类'
 
-         }
 
-         this.query1.firstClassify = dict[prop]
 
-         this.dialogShow1 = true
 
-         this.searchActivityRegistry()
 
-         this.page1 = 1
 
-       }
 
-     },
 
-     previewRegisterDetail(row, prop) {
 
-       this.query1 = {
 
-         activityId: row.id,
 
-         title: row.title,
 
-         hospitalName: '',
 
-         doctorName: '',
 
-         firstClassify: row.firstClassify,
 
-         secondClassify: row.secondClassify
 
-       }
 
-       if (prop == 'title') {
 
-         this.dialogShow1 = true
 
-         this.searchActivityRegistry()
 
-       }
 
-     },
 
-     getSecondClassifyList(val) {
 
-       return getSecondClassifyList(val)
 
-     }
 
-   },
 
-   mounted() {
 
-     this.init()
 
-   }
 
- })
 
 
  |