1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- function queryYongyaoList(page,pagesize,begindate,enddate) {
- //拼请求内容
- d.show();
- var params = {};
- params.page = page;
- params.pagesize = pagesize;
- params.start = begindate+" 00:00:00";
- params.end = enddate+" 23:59:59";
- sendPost("patient/health_record/list_medication", params, "json", "post", queryListFailed, queryYongyaoListSuccesss);
- }
- /**
- * 健康指标图表查询成功处理方法
- */
- function queryYongyaoListSuccesss(res) {
- if (res.status == 200) {
- d.close();
- if (res.list.length > 0) {
- showYongyaoList(res.list);
- if(res.list.length<10){
- $("#view_more_yongyao").hide();
- }else{
- $("#view_more_yongyao").show();
- }
- }else{
- $("#view_more_yongyao").hide();
- }
- } else {
- //非200则为失败
- queryListFailed(res);
- }
- }
- /**
- * 显示查询结果
- * @param {Object} list
- */
- function showYongyaoList(list) {
- page = page+1;
- for (var i = 0; i < list.length; i++) {
- var data = list[i];
- if (!data) {
- continue;
- }
- addRowYongyao(data.record_date, data.medicines);
- }
- setTimeout(function () {
- scroller1.myScroll.refresh();
- }, 1000);
- }
- /**
- * tbody添加一行tr
- * @param {Object} dateStr
- * @param {Object} value1
- * @param {Object} value2
- */
- function addRowYongyao(date, medicines) {
- if(date.length > 5){
- date = date.substr(5, 5);
- }
- if(date){
- date = date.replace("-",".");
- }
- var tb = document.querySelector("#drug_list");
- var tr = document.createElement("tr");
- var html ="";
- html+="<tr>"
- html+= "<td class='width-40 c-color'>"+date+"</td>"
- html+= "<td class='width-60 c-color'>"+medicines+"</td>"
- html+="</tr>"
- tr.innerHTML = html;
- tb.appendChild(tr);
- }
|