123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- var fuwujilu = {
- getInfo: function(){
- var url = "/patient/sign/sign_service_info",
- params = {doctor: request.doctor};
- d.show();
- getReqPromise(url, params, "json", "post").then(function(res){
- if(res.status == 200){
- fuwujilu.fillRespData(res.data);
- }else{
- fuwujilu.queryFailed(res);
- }
- });
- },
- fillRespData: function(data){
- d.close();
- $(".done-count").text(data.activeAmount || 0);
- var doingAmount = isNaN(data.amount-data.activeAmount) ? 0 : data.amount-data.activeAmount;
- $(".doing-count").text(doingAmount);
-
- var list = _.map(data.list, function(o){
- o.type = parseInt(o.type);
- o.jsonStr = JSON.stringify(o);
- return o;
- });
- var html = template("item2_tmp", {list: list});
- $("#recordList").empty().append(html);
- },
- queryFailed: function(res){
- d.close();
- if(res && res.msg) {
- dialog({
- contentType: 'tipsbox',
- skin: 'bk-popup',
- content: res.msg
- }).show();
- } else {
- dialog({
- contentType: 'tipsbox',
- skin: 'bk-popup',
- content: '加载失败'
- }).show();
- }
- },
- bindEvents: function(){
- $("body").on('tap', "#recordList .record-item", function(){
- var jsonData = $(this).attr("data-json");
- jsonData = JSON.parse(jsonData);
- var type = jsonData.type;
- var direct = "";
- switch (type){
- case 1:
- var userAgent = window.localStorage.getItem(agentName);
- var userInfo = JSON.parse(userAgent);
- var rep = userInfo.represented?userInfo.represented:userInfo.uid;
- //判断咨询是否结束
- if(jsonData.status == "0"){
- //进行中的咨询
- var parent = window.parent;
- parent.clickTab(1);
- }else{
- //已结束的咨询
- direct = "../../yszx/html/consulting-doctor.html?consult="+jsonData.consult+"&type=1&toUser="+rep+"&doctor=null"
- }
- break;
- case 2:
- break;
- case 3:
- var id = jsonData.code,
- orgCode = jsonData.org_code;
- direct = "../../wdyy/html/detail-appointment.html?id="+id+"&orgCode="+orgCode;
- break;
- case 4:
- var id = jsonData.article;
- direct = "../../jkjy/html/article2.html?dataId="+id;
- break;
- case 5:
- var id = jsonData.id;
- direct = "../../yszd/html/guidance-detail.html?id="+id;
- break;
- default:
-
- break;
- }
- if(direct){
- window.parent.location.href = direct;
- }else{
- if(type == 2){
- dialog({
- contentType: 'tipsbox',
- skin: 'bk-popup',
- content: "对不起,随访暂时无法查看详情"
- }).show();
- }
- }
-
- });
- }
- };
- template.helper("getTypeName", function(type){
- var typeName = "";
- type = parseInt(type);
- switch(type){
- case 1:
- typeName = "医生咨询";
- break;
- case 2:
- typeName = '随访';
- break;
- case 3:
- typeName = "待预约";
- break;
- case 4:
- typeName = "健康教育";
- break;
- case 5:
- typeName = "健康指导";
- break;
- }
- return typeName;
- });
- template.helper('formatDateTime', function(str){
- return str.substr(0, 19);
- });
|