123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768 |
- var msgId, patiCode;
- var groupCode = [],
- groupName = [],
- healthManagementCode=[],
- healthManagementName=[],
- diseaseCode=[],
- diseaseName=[];
-
- var type, self, signStatus;
- var hzCode=""//患者CODE
- var signType=1
- var signedData = null;
- //添加服务类型的数据
- var currService;
- var refuseReason = "";//拒绝签约原因
- // 居民标签
- var $juminLabels = $('#jumin_labels input[data-val=jumin_labels]');
- var docInfo;
- mui.init();
- mui.plusReady(function() {
- plus.nativeUI.showWaiting();
- self = plus.webview.currentWebview();
- msgId = self.msgId;
- patiCode = self.patiCode;
- type = self.type;
- signStatus = self.signStatus;
- var status = self.status;
- docInfo = JSON.parse(plus.storage.getItem("docInfo"));
- initPage();
- bindEvents();
- });
- function initPage(){
- console.log("signStatus = "+signStatus);
- if(signStatus == 1 || signStatus == 8 || signStatus == 9) { //签约
- $(".demo-comtop").find("h1").text("签约处理");
- $('#btn_refuse').text("拒绝签约");
- $('#btn_agree').text("同意签约");
-
- var promise1 = getReqPromises([{url:"/doctor/family_contract/patient_signing",data:{patient: patiCode}},
- // {url:"/doctor/patient/disease_sanshi",data:{patient: patiCode}},
- // {url:"/doctor/family_contract/getSanshiSign",data:{patientCode:patiCode}},
- {url:"/doctor/admin-teams/team/"+ docInfo.code +"/teamsLimit",data:{},reqType: 'GET'},//获取签约团队
- {url:"/common/getDictByDictName?name=SIGN_EXPENSES",data:{},reqType: 'GET'},//设置政府补贴
- {url:"/doctor/sign/getSigndict", data:{}, reqType: "GET"}]);//获取服务团队的信息
- console.log(promise1);
-
- return promise1.then(function(datas){
- console.log(datas);
- var data0 = datas[0],
- data1 = datas[1],
- data2 = datas[2],
- data3 = datas[3];
- // data4 = datas[4];
- // data5 = datas[5];
- // setApplyData(data0,data1);
- // initData(1,data2);
- // getQytd(data3);
- // setExpenses(data4);
- // fillServiceDropdown(data5);
- setApplyData(data0);
- getQytd(data1);
- setExpenses(data2);
- fillServiceDropdown(data3);
-
- //改签获得历史签约团队
- if(signStatus == 9){
- getHisSignInfo();
- }
-
- $("#div_qianyue").removeClass("c-hide");
- $("#div_jieyue").addClass("c-hide");
- $('.c-main').removeClass('c-hide');
-
- plus.nativeUI.closeWaiting();
- }).catch(function(e) {
- console && console.error(e);
- });
- } else if(signStatus == 4) { //解约
- $(".demo-comtop").find("h1").text("解约处理");
- $('#btn_refuse').text("拒绝解约");
- $('#btn_agree').text("同意解约");
- if(self.reason) {
- $("#div_jieyue").find("textarea").val(self.reason);
- } else {
- $("#div_jieyue").find("textarea").attr("placeholder", "该居民无说明解约理由")
- }
- // 解约申请时间
- var applyUnsignDate = "";
- var promise2 = getReqPromises([{url:"/doctor/patient_group/patient",data:{code: patiCode}},//居民信息
- {url:"/doctor/family_contract/getSanshiSign",data:{patientCode:patiCode}},
- {url:"/doctor/admin-teams/team/"+ docInfo.code +"/teamsLimit",data:{},reqType: 'GET'},
- {url:"/common/getDictByDictName?name=SIGN_EXPENSES",data:{},reqType: 'GET'},
- {url:"/doctor/sign/getSigndict", data:{}, reqType: "GET"}]);//获取服务团队的信息
- return promise2.then(function(datas){
- var data0 = datas[0],
- data1 = datas[1],
- data2 = datas[2],
- data3 = datas[3];
- data4 = datas[4];
-
- if(data0.status == 200) {
- hzCode=data0.data.code;
- initData(2,data1);
- applyUnsignDate = data0.data.jtSign.applyUnsignDate;
- $("#pati_info").html(template("pati_info_tmpl", data0.data));
- var applySurrDate = applyUnsignDate.slice(0,16);
- $("#app_date").text("申请解约时间:"+applySurrDate);
- $('.c-main').removeClass('c-hide');
- }
- getQytd(data2);
- setExpenses(data3);
- fillServiceDropdown(data4);
-
- $("#div_jieyue").removeClass("c-hide");
- $("#div_qianyue").addClass("c-hide");
- plus.nativeUI.closeWaiting();
- })
- }
- }
- //获得历史签约信息
- function getHisSignInfo(){
- var url = "/doctor/sign/getPatientSignLogInfo",
- params = {patient:patiCode};
-
- sendPost(url, params, null, function(res){
- if(res.status == 200){
- var data = res.data,
- arr = [];
- if(data.oldHospitalName){
- arr.push(data.oldHospitalName);
- }
- if(data.oldTeamName){
- arr.push(data.oldTeamName);
- }
- if(data.OldLeaderName){
- arr.push(data.OldLeaderName);
- }
- if(data.OldDoctorName){
- arr.push(data.OldDoctorName);
- }
- if(data.OldHealthDoctorName){
- arr.push(data.OldHealthDoctorName);
- }
-
- var text = arr.join(",");
- $("#teamInfo").text(text);
- $("#hisInfo").show();
- }
- });
- }
- function setApplyData (data1,data2) {
- if(data1){
- if(data1.status == 200) {
- var data=data1.data,
- appDate = "";
- if(signStatus == 1 || signStatus == 8 || signStatus == 9) {
- console.log(data);
- appDate = data.applyDate ? data.applyDate.slice(0,16): "";
- $("#pati_info").html(template("pati_info_tmpl", data1.data));
- $("#app_date").text("申请签约时间:"+appDate);
- signedData = data1.data;
- }
- }else{
- mui.toast(res.msg);
- }
- }
- }
-
- //获取政府补贴数据
- function setExpenses(res){
- var expensesCode=[];
- var expensesName=[];
-
- if(res.status == 200) {
- var expensesList = res.list;
- for(var i = 0; i < expensesList.length; i++) {
- expensesCode.push(expensesList[i].code);
- expensesName.push(expensesList[i].value);
- }
- activExpensesM(expensesCode,expensesName);
- };
- }
-
- //设置政府补贴下拉框
- function activExpensesM(expensesCodes,expensesNames) {
- var $expensesInput = $('#li_expenses input[data-val=expenses]');
- $expensesInput.mobiscroll({
- theme: 'ios',
- lang: 'zh',
- customWheels: true,
- wheels: [
- [{
- keys: [expensesCodes[1],expensesCodes[0],expensesCodes[3],expensesCodes[2]],
- values: [expensesNames[1],expensesNames[0],expensesNames[3],expensesNames[2]]
- }]
- ],
- onSelect: function(valueText, inst) {
- var dd = eval("[" + valueText + "]");
- var name=dd[0].values
- $(this).val(name);
- currExpenses = dd[0].keys;
- $('#li_expenses input[data-val=expenses]').attr("data-code",currExpenses);
- }
- });
- // 获取政府补贴下拉框mibiscroll实例
- var expensesMobiscroll = $expensesInput.mobiscroll('getInst');
- var valueText = "{keys:'"+expensesCodes[0]+"',values:'"+expensesNames[0]+"'}";
- expensesMobiscroll.setVal([valueText]);
- $expensesInput.val(expensesNames[0]);
- $expensesInput.attr("data-code",expensesCodes[0]);
- }
- //普通 老年 高血 糖尿 孕妇 儿童 贫困 计生 重性 残疾 结核
- function filterSer(name){
- var $li = $('.dw-bf').find('div.dw-li');
- $li.addClass('dw-v');
- var nameArr = name.split(',');
- $.map(nameArr,function(item,index){
- if(item.trim() == '普通人群'){
- var arr = [2,3,6,7,8,9,10]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- if(item.trim() == '老年人'){
- var arr = [4,5]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- if(item.trim() == '高血压' ||item.trim() == '糖尿病'||item.trim() == '贫困人口'||item.trim() == '计生特殊人群'||item.trim() == '重性精神疾病'||item.trim() == '残疾人'||item.trim() == '结核病' ){
- var arr = [0]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- if(item.trim() == '0-6岁儿童'){
- var arr = [1,4]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- if(item.trim() == '孕产妇'){
- var arr = [1,5]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- })
- }
-
- //设置服务类型下拉
- function fillServiceDropdown(data){
- var $serviceSel = $('#selFuwu'),
- data = data.data,
- html="";
- for(i=0; i<data.length; i++){
- html += '<option value="'+data[i].code+'">'+data[i].name+'</option>'
- }
- $serviceSel.html(html);
- $serviceSel.mobiscroll().select({
- theme: 'ios',
- lang: 'zh',
- display: 'bottom',
- rows:6,
- placeholder:'请选择服务类型',
- onSelect: function ( valueText, inst) {
- // var vArr = valueText.split(',');
- //判断服务类型是否变更
- $juminLabels.val("").attr("data-code",JSON.stringify({health: "",disease: "", custom: "" }));
- currService = inst._tempValue?inst._tempValue.join(','):'';
- },
- onChange: function (event, inst) {
- filterSer(event)
- },
- onShow: function (event, inst) {
- filterSer(inst)
- }
- })
- }
- function validForm(){
- if(!$('#agreement_checkbox').hasClass('checked')) {
- mui.toast("您还未接受签约协议");
- return false;
- }
- if(!$.trim($doctorQytdInput.attr("data-code"))){
- mui.toast("请选择签约团队!");
- return false;
- }
- if($("#healthManagement input").val()==""){
- mui.toast("请选择健康管理师!");
- $("#btn_agree").attr("disabled",false);
- return false;
- }
- if(!currService){
- mui.toast("请选择服务类型!");
- return false;
- }
- var labelObj = $juminLabels.attr("data-code");
- labelObj = JSON.parse(labelObj);
- if(!labelObj.health) {
- mui.toast("请选择居民标签!");
- return false;
- }
-
- return true;
- }
-
- //分组选择
- var currGroupCode;//分组 不要了!
- var currdiseaseCode;// 病种类型CODE
- var currfamilyDoctorCode;//家庭医生CODE
- var currfamilyDoctorName;//家庭医生名字
- var currHealthManagement;
- var currHealthManagementname;
-
- function bindEvents(){
- //选择医生
- $("#doctor_zk input").on("click",function(){
- mui.openWindow('../../huanzhe/html/hospital_qianyue.html', 'hospital_qianyue', {
-
- });
- });
-
- $('#healthManagement input').on('tap', function(){
- mui.confirm('请先选择签约团队', "提示", ["确定"], function(){});
- })
-
- //选择分组
- $("body").on("click","#li_group",function(){
- mui.openWindow({
- url:"xiaoxichuli_fzgl.html",
- id:"xiaoxichuli_fzgl.html"
- })
- });
-
- //同意、拒绝
- var signUrl = "doctor/family_contract/sign"; //签约
- var surrUrl = "doctor/family_contract/surrender"; //解约
- $("#btn_agree").click(function() { //同意
- if($("#btn_agree").attr("disabled")){
- return false;
- }
- $("#btn_agree").attr("disabled",true);
-
- currHealthManagementName=$("#healthManagement input").val()//医生姓名
- var patientIDcard=$("#idcard").html()//身份证
- //console.log(currHealthManagementName)
-
- if(signStatus == 1 || signStatus == 8 || signStatus == 9) {
- var val = $("input").val().trim();
- var isValid = validForm();
- if(!isValid){
- $("#btn_agree").attr("disabled",false);
- return;
- }
-
- var juminLabels = JSON.parse($juminLabels.attr("data-code"));
- sendPost(signUrl, {
- signType:signType,
- majorDoctor:$("#doctor_zk input").attr("data-code"),
- majorDoctorName:$("#doctor_zk input").val(),
- healthLabel: juminLabels.health,
- customLabel: juminLabels.custom,
- disease: juminLabels.disease,
- patientIDcard:patientIDcard,
- adminTeamCode: $doctorQytdInput.attr("data-code"),
- msgid: msgId,
- patient: patiCode,
- healthDoctor:$("#healthManagement input").attr("data-code"),
- healthDoctorName:$("#healthManagement input").val(),
- type: 1,
- expenses:$("#li_expenses input").attr("data-code"),
- group:$("#li_group input").attr("data-code"),
- //添加服务类型数据
- sevId: currService
- }, function(){
- $("#btn_agree").attr("disabled",false);
- mui.toast("系统异常!");
- }, function(res) {
- $("#btn_agree").attr("disabled",false);
- if(res.status == 200) {
- mui.toast("签约成功!");
- mui.fire(self.opener(), "updata");
- var xxWv = plus.webview.getWebviewById("xiaoxi.html");
- if(xxWv) {
- mui.fire(xxWv, "updateQy");
- }
- var hzWv = plus.webview.getWebviewById("huanzhe.html");
- if(hzWv) {
- mui.fire(hzWv, "update");
- }
- var mainWv = plus.webview.getWebviewById("main");
- if(mainWv) {
- mui.fire(mainWv, "xSxS");
- }
- mui.later(function() {
- mui.back();
- }, 500)
- }else if(res.status==-2||res.status==-3||res.status==-4){
- mui.confirm(res.msg, "提示", ["我知道了"], function(){
-
- mui.fire(self.opener(),"updata");
-
- var xxWv = plus.webview.getWebviewById("xiaoxi.html");
- if(xxWv) {
- mui.fire(xxWv, "updateQy");
- }
- var hzWv = plus.webview.getWebviewById("huanzhe.html");
- if(hzWv) {
- mui.fire(hzWv, "update");
- }
- var mainWv = plus.webview.getWebviewById("main");
- if(mainWv) {
- mui.fire(mainWv, "xSxS");
- }
- mui.back();
- });
-
- } else {
- mui.toast(res.msg);
- }
- });
- } else if(signStatus == 4) {
- console.log(msgId+" "+patiCode)
- sendPost(surrUrl, {
- msgid: msgId,
- patient: patiCode,
- healthLabel:"",
- adminTeamCode:0,
- type: 1
- }, null, function(res) {
- $("#btn_agree").attr("disabled",false);
- // alert(JSON.stringify(res))
- if(res.status == 200) {
- mui.toast("解约成功!");
- mui.fire(self.opener(), "updata");
- var xxWv = plus.webview.getWebviewById("xiaoxi.html");
- if(xxWv) {
- mui.fire(xxWv, "updateQy");
- }
- var hzWv = plus.webview.getWebviewById("huanzhe.html");
- if(hzWv) {
- mui.fire(hzWv, "update");
- }
- var mainWv = plus.webview.getWebviewById("main");
- if(mainWv) {
- mui.fire(mainWv, "mainupdate");
- }
- mui.later(function() {
- mui.back();
- }, 500)
- } else {
- mui.toast(res.msg);
- }
- });
- }
- });
- $("#btn_refuse").click(function() { //拒绝
- refuseReason = $('#refuseReason').val();
- if($("#btn_refuse").attr("disabled")){
- return false;
- }
- $("#btn_agree").attr("disabled",true);
- var patientIDcard=$("#idcard").html()
- if(signStatus == 1) {
- sendPost(signUrl, {
- patientIDcard:patientIDcard,
- // group: "",
- msgid: msgId,
- patient: patiCode,
- adminTeamCode:0,
- type: 2,
- refuseReason: refuseReason
- }, function(res){
- alert("请求出错");
- //alert(JSON.stringify(res))
- }, function(res) {
- if(res.status == 200) {
- mui.toast("已拒绝签约!");
- mui.fire(self.opener(), "updata");
- var xxWv = plus.webview.getWebviewById("xiaoxi.html");
- if(xxWv) {
- mui.fire(xxWv, "updateQy");
- }
- var mainWv = plus.webview.getWebviewById("main");
- if(mainWv) {
- mui.fire(mainWv, "mainupdate");
- }
- mui.later(function() {
- mui.back();
- }, 500)
- } else {
- mui.toast(res.msg);
- }
- });
- } else if(signStatus == 4) {
- sendPost(surrUrl, {
- msgid: msgId,
- patient: patiCode,
- type: 2
- }, null, function(res) {
- if(res.status == 200) {
- mui.toast("已拒绝解约!");
- mui.fire(self.opener(), "updata");
- var xxWv = plus.webview.getWebviewById("xiaoxi.html");
- if(xxWv) {
- mui.fire(xxWv, "updateQy");
- }
- var mainWv = plus.webview.getWebviewById("main");
- if(mainWv) {
- mui.fire(mainWv, "mainupdate");
- }
- mui.later(function() {
- mui.back();
- }, 500)
- } else {
- mui.toast(res.msg);
- }
- });
- }
- });
- // 点击家庭医生签约协议(勾选框)
- $(document.body).on('click', '#agreement_checkbox', function() {
- $(this).toggleClass("checked");
- })
- // 选择居民标签
- .on("click","#jumin_labels",function(){
- var teamCode = $('#qytdNum').attr("data-code");
- if($.trim(teamCode)) {
- //判断当前服务类型是否已经选择
- if(!currService){
- mui.confirm('请先选择服务类型', "提示", ["确定"], function(){});
- return false;
- }
- mui.openWindow({
- url:"../../huanzhe/html/disease-label-choose.html",
- id:"disease-label-choose",
- extras: {
- teamCode: teamCode,
- showData: $juminLabels.attr("data-code") || null,
- patientCode: patiCode,
- serviceCode: currService
- }
- })
- } else {
- mui.confirm('请先选择签约团队', "提示", ["确定"], function(){
-
- });
- }
- });
-
- window.addEventListener('getDoctor', function(event) {
- console.log(event.detail.name)
- $("#doctor_zk input").val(event.detail.name);
- $("#doctor_zk input").attr("data-code",event.detail.code);
- // console.log(event.detail.code);
- // console.log(event.detail.name);
- });
-
- window.addEventListener("group", group);
-
- /*居民标签*/
- window.addEventListener("setJuMinLabels", function setJuMinLabels(e) {
- var health = e.detail.health,
- disease = e.detail.disease,
- custom = e.detail.custom,
- labelName = e.detail.labelName;
-
- $juminLabels.val(labelName).attr("data-code",JSON.stringify({health: health,disease: disease, custom: custom }));
- });
-
- $("textarea").on("input", function(){
- var text = $(this).val().trim(),
- len = text.length;
- $("#count").text(len);
- });
- //选择拒绝签约说明文本,直接将内容添加到textarea中
- $("#explain").on('click', '.text-tag', function(){
- var $this = $(this),
- text = $this.text(),
- tatext = $("textarea").val();
- if($this.hasClass("active")){
- $this.removeClass("active");
- var a = tatext.split(text);
- tatext = a.join("");
- $("textarea").val(tatext);
- $("#count").text(tatext.length);
- }else{
- $this.addClass("active");
- tatext += text;
- $("textarea").val(tatext);
- $("#count").text(tatext.length);
- }
- });
- }
- function activHealthM(codes, names) {
- healthManagementCode = codes;
- healthManagementName = names;
- $('#healthManagement input[data-val=healthManagement]').mobiscroll({
- theme: 'ios',
- lang: 'zh',
- customWheels: true,
- wheels: [
- [{
- keys: healthManagementCode,
- values: healthManagementName
- }]
- ],
- onSelect: function(valueText, inst) {
- var dd = eval("[" + valueText + "]");
- var name=dd[0].values
- $(this).val(name);
- currHealthManagement = dd[0].keys;
- $('#healthManagement input[data-val=healthManagement]').attr("data-code",currHealthManagement);
- }
- });
- };
-
- function initData(type,res){
- var data=res.data;
- console.log(JSON.stringify(data))
- /*if(data.hasSanshi=="true"){
- signType=type
- $(".no").show()
- //$("#healthManagement input").val(data.glsName).attr({"data-code":data.glsCode});//健康医生
- }*/
- }//判断是不是三师已经签约 回填
-
- /*分组事件*/
- function group(e) {
- var groupcode=e.detail.code
- var groupName=e.detail.name
- //console.log(groupName)
-
- $('#li_group input[data-val=li_group]').val(groupName).attr("data-code",groupcode)
- }
-
- //获取签约团队
- function getQytd(res){
- if(res.status == 200) {
- if(res.data.length == 0){
- alert("查无签约团队");
- return;
- }
- var teams = res.data,
- teamCodes=[],
- teamNames=[];
- // 萃取数组对象中code、name,返回一个数组
- teamCodes = _.pluck(teams, 'id');
- // teamNames = _.pluck(teams, 'name');
- for(var i = 0; i < teams.length; i++){
- var signTeam;
- var signCount = teams[i].signCount;
- var signLimitNumber = teams[i].signLimitNumber;
- if(signCount >= signLimitNumber){
- signTeam = teams[i].name + "<span class='filled'>(已达上限)</span>";
- }else{
- signTeam = teams[i].name + "(已签约"+signCount+"人)";
- }
- teamNames.push(signTeam);
- }
- qytdSelect(teamCodes, teamNames);
- }
- }
-
- //var $doctorQytdInput = $('#qytd input');
- var $doctorQytdInput = $('#qytdNum');
- // 设置团队下拉框
- function qytdSelect(teamCodes, teamNames) {
- $doctorQytdInput.mobiscroll({
- theme: 'ios',
- lang: 'zh',
- customWheels: true,
- wheels: [
- [{
- keys: teamCodes,
- values: teamNames
- }]
- ],
- onSelect: function(valueText, inst) {
- var valueTextZy = valueText.replace("<span class='filled'>", "<span class=\\\'filled\\\'>");
- var dd = eval("[" + valueTextZy + "]"),
- name=dd[0].values,
- currExpenses = dd[0].keys;
-
- $(this).html(name);
- $(this).removeClass("c-9e9e9e");
- var isFilled = $(this).find("span").hasClass("filled");
- if(isFilled){
- $('#btn_agree').addClass("disabled").attr("disabled", true);
- }else{
- $('#btn_agree').removeClass("disabled").attr("disabled", false);
- }
-
- if($(this).text().length>20){
- $doctorQytdInput.css({textAlign:'left'});
- }else{
- $doctorQytdInput.css({textAlign:'right'});
- }
- $doctorQytdInput.attr("data-code",currExpenses);
-
- $('#healthManagement input[data-val=healthManagement]').val("").attr("data-code","")
- getTeamMember(currExpenses);
- }
- });
- if(teamCodes.length == 1){
- setQytdSelect(teamCodes[0], teamNames[0]);
- getTeamMember(teamCodes[0]);
- }
- }
-
- function setQytdSelect(code, name) {
- // 获取全科医生下拉框mibiscroll实例
- var mobiscroll = $doctorQytdInput.mobiscroll('getInst');
- var valueText = "{keys:'"+code+"',values:'"+name+"'}";
- mobiscroll.setVal([valueText]);
- $doctorQytdInput.html(name);
- if($doctorQytdInput.html(name).toString().length>=12){
- $doctorQytdInput.css({textAlign:'left'});
- }else{
- $doctorQytdInput.css({textAlign:'right'});
- }
- $doctorQytdInput.attr("data-code", code);
- }
-
- //获取团队成员
- function getTeamMember(teamCode){
- plus.nativeUI.showWaiting();
-
- sendGet("/doctor/admin-teams/"+ teamCode + "/members", {}, null, function(res){
- if(res.status == 200){
- var jgs= [],
- jgCodes =[], jgNames = [];
-
- $.each(res.data, function(i, v) {
- if(v.level == 3 || v.level == 2)
- jgs.push(v);
- });
-
- // 萃取数组对象中code、name,返回一个数组
- jgCodes = _.pluck(jgs, 'code');
- jgNames = _.pluck(jgs, 'name');
- activHealthM(jgCodes, jgNames);
-
- } else
- mui.toast("获取团队成员失败!");
- plus.nativeUI.closeWaiting();
- })
- }
|