Vue.component('comD', {
template: '
\
\
就诊时间: \
\
\
\
\
药品名称: \
\
查看药品字典 \
就诊类型: \
\
\
\
\
搜索
\
\
\
\
\
\
\
\
\
门急诊\
住院\
\
\
\
\
\
\
\
\
\
\
\
\
查看详情\
\
\
\
\
\
\
\
\
\
',
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
})
}
}
})