123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- Vue.component('comD', {
- template: ' <div class="tab4">\
- <template>\
- <span>就诊时间:</span> \
- <el-date-picker v-model="time1" type="date" placeholder="开始日期" :picker-options="pickerOptions0">\
- </el-date-picker>\
- <el-date-picker v-model="time2" type="date" placeholder="结束日期" :picker-options="pickerOptions1">\
- </el-date-picker>\
- <span>药品名称:</span> \
- <div class="modelSearch" >\
- <div class="m-form-control">\
- <input type="text" data-type="select" id="dataArr">\
- </div>\
- </div>\
- <a href="#" @click="handleZidian"> 查看药品字典 </a>\
- <span>就诊类型:</span> \
- <el-select v-model="eventType" class="inputbox" placeholder="请选择">\
- <el-option v-for="item in event_type" :key="item.code" :label="item.name" :value="item.code">\
- </el-option>\
- </el-select>\
- <div class="search" @click="searchClick">搜索</div>\
- </template>\
- <el-table :data="tableData" border style="width: 100%">\
- <el-table-column prop="event_date" label="就诊时间">\
- </el-table-column>\
- <el-table-column prop="patient_name" label="姓名">\
- </el-table-column>\
- <el-table-column label="就诊类型" width="140">\
- <template slot-scope="scope">\
- <span v-if="scope.row.event_type == 0">门急诊</span>\
- <span v-else>住院</span>\
- </template>\
- </el-table-column>\
- <el-table-column prop="HDSD00_04_023" label="药品名称">\
- </el-table-column>\
- <el-table-column prop="HDSD00_04_021" label="规格">\
- </el-table-column>\
- <el-table-column prop="HDSD00_04_027" label="用法" >\
- </el-table-column>\
- <el-table-column prop="HDSD00_04_028" label="总量">\
- </el-table-column>\
- <el-table-column fixed="right" label="操作">\
- <template slot-scope="scope">\
- <el-button @click="handleClick(scope.row)" type="text" size="small">查看详情</el-button>\
- </template>\
- </el-table-column>\
- </el-table>\
- <div class="flex f_y_c f_x_e">\
- <el-pagination @size-change="handleSizeChange" background @current-change="handleCurrentChange" :current-page="currentPage"\
- :page-sizes=" pageSizeArr" :page-size="pageSize" layout="total,sizes,prev, pager, next, jumper"\
- :total="total">\
- </el-pagination>\
- </div>\
- </template>\
- </div>\
- </div> ',
- data: function () {
- vm=this;
- return {
- currentPage: 1, //初始页
- pageSize: 10, // 每页的数据
- tableData: [],
- pageSizeArr: [10, 20, 30, 50],
- total: 0,
- event_type: [{
- "code": '0',
- "name": '门急诊'
- }, {
- "code": '1',
- "name": '住院'
- }],
- time1: new Date(getLastMonthStartDate()),
- time2: new Date(getLastMonthEndDate()),
- pickerOptions0: {
- disabledDate: function (time) {
- if (vm.time2) {
- let currentTime = vm.time2;
- let threeMonths = currentTime.setMonth(currentTime.getMonth() - 1);
- currentTime.setMonth(currentTime.getMonth() + 1)
- return time.getTime() > vm.time2 || time.getTime() < threeMonths;
- } else {
- return time.getTime() > Date.now();
- }
- }
- },
- pickerOptions1: {
- disabledDate: function (time) {
- if (vm.time1) {
- let currentTime = vm.time1;
- let threeMonths = currentTime.setMonth(currentTime.getMonth() + 1);
- currentTime.setMonth(currentTime.getMonth() - 1)
- return time.getTime() < vm.time1 || time.getTime() > threeMonths;
- } else {
- return time.getTime() > Date.now();
- }
- },
- },
- drugName: '',
- eventType: '0',
- options: [],
- inspect: '',
- }
- },
- mounted: function () {
- this.getData()
- this.formInit()
- },
- methods: {
- handleCurrentChange: function (val) {
- this.currentPage = val;
- this.getData()
- },
- handleSizeChange: function (val) {
- this.pageSize = val;
- this.initData()
- },
- initData: function () { //初始化
- this.currentPage = 1;
- this.getData()
- },
- searchClick: function () {
- console.log(this.drugName)
- this.initData()
- },
- formInit: function () {
- var url = httpRequest.server + '/gateway/hos-admin/api/v1.0/standardCenter/lastVersionDrug/list'
- $("#dataArr").customCombo(url, {
- token: sessionStorage.asstoken,
- tenant_name: 'jkzl',
- code: "STD_MEDICINE",
- }, false, false, false, {
- valueField: "id",//id
- textField: 'value',//name
- conditionSearchClick: function (g) {
- debugger
- var searchParm = g.rules.length > 0 ? g.rules[0].value : '';
- var parms = g.grid.get("parms");
- if (searchParm) {
- parms.filters = "value?" + searchParm + ' g1;stdDatasetCode?' + searchParm + ' g1;';
- } else {
- parms.filters = "";
- }
- g.grid.set({
- parms: parms,
- newPage: 1
- });
- g.grid.reload();
- }
- }, {
- columns: [
- { display: '名称', name: 'value', width: 210, align: 'left' }
- ],
- });
- },
- getData: function () {
- var vm = this;
- var params = {
- start: this.time1.format('yyyy-MM-dd'),
- end: this.time2.format('yyyy-MM-dd'),
- drugName: $('#dataArr').val(),
- eventType: this.eventType,
- size: this.pageSize,
- page: this.currentPage
- }
- GlobalEventBus.$emit('setLoading', {
- loading: true
- }); //缓存效果
- bigDataOutApi.drugAnalysis(params).then(function (res) {
- console.log(res)
- GlobalEventBus.$emit('setLoading');
- vm.tableData = res.detailModelList;
- vm.tableData = vm.tableData.map(function (item) {
- item.event_date = new Date(item.event_date).format('yyyy-MM-dd')
- return item;
- })
- vm.total = res.totalCount;
- }).catch(function (err) {
- console.log(err)
- GlobalEventBus.$emit('setLoading');
- })
- },
- handleClick: function (row) {
- console.log(row)
- demographic_id = row.demographic_id,
- medication = row.HDSD00_04_023,
- eventdate = row.event_date_real
- var url = httpRequest.server + '/profile/app/medication/html/medication.html?' +
- 'healthProblemName=' + '&demographic_id=' + demographic_id + '&medication=' + medication + '&eventdate=' + eventdate
- console.log(url)
- var width = 1000 + 'px';
- var height = 600 + 'px';
- top.layer.open({
- id: 'Lay_xiangqingD',
- type: 2,
- title: false,
- closeBtn: 0,
- shade: 0.5,
- shadeClose: true,
- area: [width, height],
- content: url
- })
- },
- handleZidian: function () {
- var url = httpRequest.server + '/bigScreenShow/page/bigDataOut/html/yaopinzidian.html?'
- console.log(url)
- var width = 1000 + 'px';
- var height = 600 + 'px';
- top.layer.open({
- id: 'Lay_zidian',
- type: 2,
- title: false,
- closeBtn: 0,
- shade: 0.5,
- shadeClose: true,
- area: [width, height],
- content: url
- })
- }
- }
- })
|