1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- (function(){
- Vue.component('hospital-filter',{
- template:'<div style="height: 400px;overflow: auto;margin-bottom: 50px;">\
- <el-tabs v-model="activeName" :stretch="true">\
- <el-tab-pane label="等级医院" name="0">\
- <div class="ptb10 c-f14 plr15 c-border-b ui-grid c-cursor-p" :class="{\'bgc-f2f3f4\':hospitalCode==item.code}" v-for="(item,index) in hopitalList" :key="index" @click="selHospitalItem(item)" >\
- <div class="ui-col-1">\
- {{item.name}}\
- </div>\
- </div>\
- </el-tab-pane>\
- <el-tab-pane label="社区医院" name="1">\
- <div class="ptb10 c-f14 plr15 c-border-b ui-grid c-cursor-p" :class="{\'bgc-f2f3f4\':hospitalCode==item.code}" v-for="(item,index) in chopitalList" :key="index" @click="selHospitalItem(item)" >\
- <div class="ui-col-1">\
- {{item.name}}\
- </div>\
- </div>\
- </el-tab-pane>\
- </el-tabs>\
- <div id="footer">\
- <div class="c-row btn-wrap c-border-top fr">\
- <div class="div-foot-btn mr20" @click="resetClick">\
- <a href="#" class="c-666 f-fs16">取消</a>\
- </div>\
- <div class="div-foot-btn active" @click="confirmClick">\
- <a href="#" class="c-666 f-fs16">确认</a>\
- </div>\
- </div>\
- </div>\
- </div>',
- props:['chopitalList','hopitalList','initarea'],
- data: function(){
- return {
- activeName:0,
- hospitalCode:"",
- hospitalItem:{},
- chopitalList:[],
- hopitalList:[],
- }
- },
- mounted: function(){
- this.selectHospital(this,1,'hopitalList')
- },
- watch:{
- activeName(v) {
- if(v == 0) {
- this.selectHospital(this,1,'hopitalList')
- }else{
- this.selectHospital(this,2,'chopitalList')
- }
- },
- },
- methods: {
- selectHospital(vm,index,param) {
- var url = "/specialistStatistics/selectHospital",
- params = {
- town:vm.initarea,
- level:index
- };
- statisticAPI.selectHospital(params).then(function(res) {
- if(res.status == 200) {
- vm[param] = res.data
- } else {
- vm.$message.error(res.msg)
- }
- })
- },
- resetClick:function(){
- this.$emit('vuedals:close', {});
- },
- confirmClick:function(){
- var vm = this;
- if(vm.hospitalCode){
- //触发刷新
- this.$emit('vuedals:close', {
- hospitalItem: vm.hospitalItem,
- hospitalCode: vm.hospitalCode,
- activeName:vm.activeName,
- });
- }else{
- vm.$message.error("请选择医院")
- }
- },
- selHospitalItem:function(item){
- var vm = this;
- vm.hospitalItem = item
- vm.hospitalCode = item.code
- }
- }
- });
-
- })()
|