123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731 |
- // 基本信息(包括userAgent)
- var baseInfo = null,
- // 基础环境信息(包括当前webview、encry相关)
- baseEnv = null,
- docInfo = null,
- fv_id = null,
- pro_id = null,
- title = "",
- followupClass = null,
- patientCode = null,
- otherPeople = '',
- activeField = ""; //记录输入框修改时的id
- var project_data;
-
-
- var $form = $("#question_form"),
- BP_D_OPS = BP_U_OPS = WEIGHT_OPS = HEART_RATE_OPS = BS_FPG_OPS = null; //历史记录下拉选择模板
-
-
- // 获取登录相关信息
- var getBaseInfo = function() {
- docInfo = JSON.parse(plus.storage.getItem("docInfo"));
- fv_id = baseEnv.webview.followup_id;
- pro_id = baseEnv.webview.project_id;
- title = baseEnv.webview.title;
- followupClass = baseEnv.webview.followupClass;
- patientCode = baseEnv.webview.patientCode;
- otherPeople = baseEnv.webview.otherPeople;
- // 登录的相关信息
- var userAgent = JSON.parse(plus.storage.getItem("userAgent"));
- return {
- userAgent: userAgent
- }
-
- },
- // 获取基础环境信息
- getBaseEnvPromise = function () {
-
- var env = {
- webview: plus.webview.currentWebview()
- };
-
- // 因为有异步请求,需要等待数据返回之后进行处理,所以返回Promise
- return Promise.resolve().then(function(res) {
- return env;
- });
- },
- initPage = function(){
- plus.nativeUI.showWaiting();
- $("#title").text(title);
- if(otherPeople){
- $('#btn_group').hide();
- $('#question_form').css('pointer-events','none')
- }else{
- $('#btn_group').show();
- $('#question_form').css('pointer-events','')
- }
-
- //统一模板
- project_data = gTemplate[pro_id];
- sendPost("/doctor/followup/getFollowupProjectData", {id: fv_id,followupProject: pro_id}, null,
- function(res){
- for(key in project_data){
- project_data[key].value = res.data?res.data[key]:'';
- if(project_data[key].type==4 || project_data[key].type==3) {
- if(project_data[key].value){
- project_data[key].valueLength = project_data[key].value.length;
- }
- }
- }
- if(pro_id == 5){
- if(followupClass == 1){//高血压
- project_data = _.pick(project_data, 'HYP_FOLLOWUP_TYPE_CODE', 'HYP_COMPLICATION_DETAIL');
- }else if(followupClass == 2){//糖尿病
- project_data = _.pick(project_data, 'DIA_FOLLOWUP_TYPE_CODE', 'DIA_COMPLICATION_DETAIL');
- }
- }
- //处理拒绝转诊字段不统一问题
- if(pro_id == 9){
- project_data.DISAGREE_TRANSFER.value = res.data?res.data['REFUSE_REFERRAL_WHY']:''
- }
- var html = template("item", {data:project_data,followupClass:followupClass});
- var link = "";
- if(pro_id == 8){//健康教育
- link = '<div class="li-link c-f16 pt10 plr10"><a href="javascript:;" data-href="edu_history.html" data-type="edu" onclick="openNewPage(this)">从健康指导、健康教育记录获取</a></div>';
- }
- $form.append(link+html);
- if(pro_id == 8){//健康教育
- $('#jkjy').attr('data-id',res.data?res.data['HEALTH_EDUCATE']:'')
- }
- initMobiscroll();
- checkBtnEnable();
- if(pro_id == 7){//控制目标
- $("input[name=CONTROL_CONSTITUTOR]").val(docInfo.name);
- }
- plus.nativeUI.closeWaiting();
- },'GET');
- },
- initMobiscroll = function(){
- //随访日期选择
- $('[data-val=date]').mobiscroll({
- preset: 'date',
- theme: 'ios',
- display:'bottom',
- lang: 'zh',
- dateFormat: 'yy-mm-dd',
- showLabel: false
- });
- //选择下拉选择
- if(pro_id == 8){
- var html = '<option disabled selected></option>';
- var datas = project_data['HEALTH_EDUCATE'].list
- for(var key in datas){
- if(key == $('#jkjy').attr('data-id')){
- html += '<option selected value="'+key+'">'+datas[key]+'</option>';
- }else{
- html += '<option value="'+key+'">'+datas[key]+'</option>';
- }
- }
- $('#jkjy').html(html);
- $('#jkjy').mobiscroll().select({
- theme: 'ios',
- lang: 'zh',
- display: 'bottom',
- placeholder:'请选择',
- rows:4,
- onSelect: function ( valueText, inst) {
- $('#jkjy').attr('data-id',inst._tempValue)
- $('#jkjy').attr('data-name',valueText)
- }
- })
- }
- //绑定数字键盘
- $.each(document.querySelectorAll('input[type=number]'), function(index, el){
- var name = el.name;
- if(name == "BP_U" || name == "BP_D" || name=="CONTROL_BP_U"|| name=="CONTROL_BP_D"){
- $(el).mobiscroll().numpad({
- theme: 'ios',
- display: 'bottom',
- lang: 'zh',
- placeholder: '0',
- fill: 'rtl',
- allowLeadingZero: true,
- template: 'ddd',
- scale:0,
- buttons: ['set','cancel'],
- onShow: function(html, inst){
- activeField = this.name;
- var linkHtml = "<div class='mob-link' data-type='2'><a>您可从居民血压记录中获取</a></div>";
- html.find(".dwwr").before(linkHtml);
- var dialog = html.find("[role=dialog]"),
- top = dialog.css("top");
- dialog.css('top', (parseFloat(top)-30)+"px");
- },
- onSelect: function(valueText, inst){
- var value = parseFloat($('.mbsc-np-dsp').text());
- $(this).val(value);
- }
- });
- }else if(name=="HEART_RATE" || name=="DAILY_SMOKING" || name=="CONTROL_EXERCISE_DURATION_MINS" || name=="SOMKING_EXP" || name=="EXERCISE_DURATION_MINS" || name=="EXERCISE_DURATION_MINS_EXP"){
- $(el).mobiscroll().numpad({
- theme: 'ios',
- display: 'bottom',
- lang: 'zh',
- placeholder: '0',
- fill: 'rtl',
- allowLeadingZero: true,
- template: 'ddd',
- scale:0,
- buttons: ['set','cancel'],
- onSelect: function(valueText, inst){
- var value = parseFloat($('.mbsc-np-dsp').text());
- $(this).val(value);
- }
- })
- }else if(name == "RENAL_FUNCTION_CREATININE" || name=="DRINK_EXP" || name=="DAILY_DRINKING" || name=="DAILY_STAPLE" || name == "WEIGHT_EXP"){
- $(el).mobiscroll().numpad({
- theme: 'ios',
- display: 'bottom',
- lang: 'zh',
- placeholder: '0',
- fill: 'rtl',
- allowLeadingZero: true,
- template: 'ddd.d',
- scale:0,
- buttons: ['set','cancel'],
- onSelect: function(valueText, inst){
- var value = parseFloat($('.mbsc-np-dsp').text());
- $(this).val(value);
- }
- })
- }else if(name == "BS_FPG" || name == "NO_BS_FPG" || name == "RANDOM_BLOOD_SUGAR" || name == "CONTROL_BS_FPG" || name == "CONTROL_NO_BS_FPG"){
- $(el).mobiscroll().numpad({
- theme: 'ios',
- display: 'bottom',
- lang: 'zh',
- placeholder: '0',
- fill: 'rtl',
- template: 'dd.d',
- allowLeadingZero: true,
- buttons: ['set','cancel'],
- onSelect: function(valueText, inst){
- var value = parseFloat($('.mbsc-np-dsp').text());
- $(this).val(value);
- },
- onShow: function(html, inst){
- activeField = this.name;
- var linkHtml = "<div class='mob-link' data-type='1'><a>您可从居民血糖记录中获取</a></div>";
- html.find(".dwwr").before(linkHtml);
- var dialog = html.find("[role=dialog]"),
- top = dialog.css("top");
- dialog.css('top', (parseFloat(top)-30)+"px");
- },
- validate: function(value){
- var v = value.length > 0 ? value.join("") : 0;
- return {invalid: parseFloat(v)<=0};
- }
- });
- }else if(name == "WEIGHT" || name == "HEIGHT" || name == "CONTROL_WEIGHT"){
- $(el).mobiscroll().numpad({
- theme: 'ios',
- display: 'bottom',
- lang: 'zh',
- placeholder: '0',
- fill: 'rtl',
- template: 'ddd.d',
- allowLeadingZero: true,
- buttons: ['set','cancel'],
- onSelect: function(valueText, inst){
- var value = parseFloat($('.mbsc-np-dsp').text());
- $(this).val(value);
- },
- onShow: function(html, inst){
- activeField = this.name;
- var linkHtml = "<div class='mob-link' data-type='3'><a>您可从居民身高体重记录中获取</a></div>";
- html.find(".dwwr").before(linkHtml);
- var dialog = html.find("[role=dialog]"),
- top = dialog.css("top");
- dialog.css('top', (parseFloat(top)-30)+"px");
- },
- validate: function(value){
- var v = value.length > 0 ? value.join("") : 0;
- return {invalid: parseFloat(v)<=0};
- }
- })
- }else{
- $(el).mobiscroll().numpad({
- theme: 'ios',
- display: 'bottom',
- lang: 'zh',
- // placeholder: '0',
- // fill: 'rtl',
- // allowLeadingZero: true,
- // scale:0,
- // buttons: ['set','cancel'],
- // onBeforeShow: function(inst){
- // inst.settings.leftButton = {text:".", value:"."};
- // inst.settings.maxLength = 4;
- // inst.settings.maxScale = 4;
- // },
- onSelect: function(valueText, inst){
- var value = parseFloat($('.mbsc-np-dsp').text())
- $(this).val(value)
- },
- // validate: function(value){
- // var v = value.length > 0 ? value.join("") : 0;
- // return {invalid: parseFloat(v)<=0};
- // }
- })
- }
- })
- },
- checkBtnEnable = function(){
- var radios = $('input[type=radio]:checked').val();
- var checkboxs = $('input[type=checkbox]:checked').val();
- var textareas = $.trim($('textarea').val());
- var numbers = 0;
- var texts = 0;
- if ($('input[type=text]').length > 0 ) texts = $('input[type=text]').val().length;
-
- if(undefined == radios && undefined == checkboxs && '' == textareas) {
- $('#active_save').hide();
- $('#disable_save').show();
- } else {
- $('#active_save').show();
- $('#disable_save').hide();
- }
- $("input[type=number]").each(function(){
- var value = $(this).val();
- if(value.length>0){
- $('#active_save').show();
- $('#disable_save').hide();
- }
- });
- $("input[type=text]").each(function(){
- var value = $(this).val();
- if(value.length>0){
- $('#active_save').show();
- $('#disable_save').hide();
- }
- });
- },
- //获得收缩压和舒张压和心率等历史记录
- getXueyaHistoryData = function(){
- var url = "doctor/health_index/getHealthIndexHistory",
- params = {patient:patientCode, type: 2, page:0, pagesize: 3};
- sendGet(url, params, null, function(res){
- if(res.status == 200){
- var BP_D_list = [],
- BP_U_list = [],
- HEART_RATE_list = [];
- for(i=0; i<res.data.length; i++){
- var item = res.data[i];
- if(item.sys){
- BP_D_list.push({
- time: item.time.substr(0, item.time.length-3),
- value: item.sys,
- text: item.sys+"mmHg",
- jsonStr: JSON.stringify(item)
- });
- }
- if(item.dia){
- BP_U_list.push({
- time: item.time.substr(0, item.time.length-3),
- value: item.dia,
- text: item.dia+"mmHg",
- jsonStr: JSON.stringify(item)
- });
- }
- if(item.pul){
- HEART_RATE_list.push({
- time: item.time.substr(0, item.time.length-3),
- value: item.pul,
- text: item.pul+'次/分',
- jsonStr: JSON.stringify(item)
- });
- }
- }
- if(BP_D_list.length > 0){
- BP_D_OPS = template('option_tmp', {list: BP_D_list, id: "BP_D", type:2, title: "血压"});
- }
- if(BP_U_list.length > 0){
- BP_U_OPS = template('option_tmp', {list: BP_U_list, id: "BP_U", type:2, title: "血压"});
- }
- if(HEART_RATE_list.length > 0){
- HEART_RATE_OPS = template('option_tmp', {list: HEART_RATE_list, id: "HEART_RATE", type:2, title: "心率"});
- }
- }else{
- mui.toast(res.msg);
- }
- });
- },
- //获得体重的历史记录
- getWeightHistoryData = function(){
- var url = "doctor/health_index/getHealthIndexHistory",
- params = {patient:patientCode, type: 3, page:0, pagesize: 3};
- sendGet(url, params, null, function(res){
- if(res.status == 200){
- var weight = [];
- for(i=0; i<res.data.length; i++){
- var item = res.data[i];
- weight.push({
- time: item.time,
- value: item.weight,
- text: item.weight+"Kg"
- });
- }
- if(weight.length > 0){
- WEIGHT_OPS = template('option_tmp', {list: weight, id: "WEIGHT", type:3, title:"体重"});
- }
- }else{
- mui.toast(res.msg);
- }
- });
- },
- //获得血糖的历史记录
- getXuetangHistoryData = function(){
- var url = "doctor/health_index/getHealthIndexHistory",
- params = {patient:patientCode, type: 1, page:0, pagesize: 3};
- sendGet(url, params, null, function(res){
- if(res.status == 200){
- var list = [];
- for(i=0; i< res.data.length; i++){
- var item = res.data[i];
- list.push({
- time: item.time.substr(0, item.time.length-3),
- value: item.gi,
- text: item.text
- });
- }
- if(list.length > 0){
- BS_FPG_OPS = template('option_tmp', {list: list, id: "BS_FPG", type:1, title:"血糖"});
- }
- }else{
- mui.toast(res.msg);
- }
- });
- },
- openNewPage = function(ele){
- var url = ele.getAttribute("data-href"),
- type = ele.getAttribute("data-type");
- openWebview(url, {type: type, patientCode: patientCode});
- },
- bindEvents = function(){
- $form.on("change","input",function(){
- if(this.value){
- $("#disable_save").hide();
- $("#active_save").show();
- }else{
- var list = $("input"),
- len = list.length,
- empty = true;
- for(i=0; i< len; i++){
- var value = list[i].value;
- if(value){
- empty = false;
- }
- }
-
- if(empty){
- $("#disable_save").show();
- $("#active_save").hide();
- }
-
- }
- //计算BMI值 体质指数(BMI)=体重(kg)÷身高^2(m)
- var name = $(this).attr("name");
- switch(name){
- case "WEIGHT":
- case "WEIGHT_EXP":
- case "HEIGHT":
- var w = parseFloat($("input[name=WEIGHT]").val()),
- ex_w = parseFloat($("input[name=WEIGHT_EXP]").val()),
- h = parseFloat($("input[name=HEIGHT]").val());
- var BMI = w/(h/100 * h/100),
- EX_BMI = ex_w/(h/100 * h/100);
- if(!isNaN(BMI)){
- $("input[name=BMI]").val(BMI.toFixed(2));
- }
- if(!isNaN(EX_BMI)){
- $("input[name=BMI_EXP]").val(EX_BMI.toFixed(2));
- }
- break;
- }
- })
-
- //添加获取历史记录的按钮事件
- $("body").on("tap", ".mob-link", function(){
- var type = $(this).attr("data-type");
- openWebview("history_record.html",{
- accessData:{
- type: type,
- id: activeField,
- patientCode: patientCode
- }
- });
- $("input[name="+activeField+"]").mobiscroll("hide");
- })
-
- //判断checkbox和radio控件
- $form.on("click","input[type=checkbox]",function(){
- if(this.checked){
- $("#disable_save").hide();
- $("#active_save").show();
- this.value = 1;
- }else{
- this.value = 0;
- }
- });
- $form.on("click","input[type=radio]",function(){
- $("#disable_save").hide();
- $("#active_save").show();
- });
- $form.on("click",".c-check",function(){
- var hideType = $(this).attr('has-hide')
- var name = $(this).find('input').attr('name')
- var $list = $(this).closest('.c-list')
- var $textarea;
- if(hideType == "4") {
- $textarea = $list.find('textarea[name="'+name+'"]')
- if($(this).find('input')[0].checked) {
- $textarea.closest('li').show()
- } else {
- $textarea.closest('li').hide()
- }
- }
- });
-
- $("#active_save").on("click", function(){
- if(pro_id == 2) {
- var xy_d = $('input[name="BP_D"]').val()
- var xy_u = $('input[name="BP_U"]').val()
- if(!(xy_d && xy_u)) {
- mui.toast("收缩压和舒张压必填");
- return ;
- }
- }
- if(pro_id == 5) {
- var xtExam = $('input[name="DIA_FOLLOWUP_TYPE_CODE"]:checked').val()
- var xyExam = $('input[name="HYP_FOLLOWUP_TYPE_CODE"]:checked').val()
- if($('input[name="DIA_FOLLOWUP_TYPE_CODE"]').length>0){
- if(!xtExam){
- mui.toast("请完善必填项");
- return ;
- }
- }
- if($('input[name="HYP_FOLLOWUP_TYPE_CODE"]').length>0){
- if(!xyExam){
- mui.toast("请完善必填项");
- return ;
- }
- }
- }
- if(pro_id == 3) { // 实验室检查,空腹血糖、餐后血糖、随机血糖、三项需必填一项
- var bsValue = $('input[name="BS_FPG"]').val()
- || $('input[name="NO_BS_FPG"]').val()
- || $('input[name="RANDOM_BLOOD_SUGAR"]').val()
- if(!bsValue) {
- mui.toast("血糖必填一项");
- return ;
- }
- }
- // if(pro_id == 4) { // 运动频率、摄盐情况变更为必填
- // var exercise = $('input[name="EXERCISE_FREQ_CODE"]:checked').val()
- // var salt = $('input[name="SALT_TAKEN_LEVEL_CODE"]:checked').val()
- // if(!exercise) {
- // mui.toast("请选择运动频率");
- // return ;
- // }
- // if(!salt) {
- // mui.toast("请选择摄盐情况");
- // return ;
- // }
- // }
- if(pro_id == 8) { // 健康教育
- var Value = $('#jkjy').attr('data-id');
- if(!Value) {
- mui.toast("健康教育必填");
- return ;
- }
- }
- if(pro_id == 9) { // 转诊原因及机构科室变更为必填
- var disagree = $('input[name="DISAGREE_TRANSFER"]').val()
- if(!disagree || disagree=="0"){
- disagree = 0
- }else{
- disagree = 1
- }
- var tranferReson = $('textarea[name="TRANSFER_RESON"]').val().trim()
- var tranferOrgDept = $('textarea[name="TRANSFER_ORG_DEPT"]').val().trim()
- if(!tranferReson) {
- mui.toast("请输入转诊原因");
- return ;
- }
- if(!tranferOrgDept) {
- mui.toast("请输入转诊机构科室");
- return ;
- }
- if(disagree == 0){
- $('textarea[name="DISAGREE_TRANSFER"]').val('')
- }else{
- if(!$('textarea[name="DISAGREE_TRANSFER"]').val().trim()){
- mui.toast("请输入拒绝原因");
- return ;
- }
- }
- }
-
- plus.nativeUI.showWaiting();
- var url = "doctor/followup/saveFollowupProjectData",
- params = {id: fv_id, followupProject:pro_id},
- data = {};
- $form.serializeArray().map(function(x){data[x.name]=x.value;});
- if(pro_id == 7){
- data.CONTROL_CONSTITUTOR_DOCTORCODE = docInfo.code;
- }
- if(pro_id == 8){
- data.HEALTH_EDUCATE = $('#jkjy').attr('data-id');
- }
- //处理拒绝转诊字段不统一问题
- if(pro_id == 9){
- data.REFUSE_REFERRAL = disagree;
- data.REFUSE_REFERRAL_WHY = $('textarea[name="DISAGREE_TRANSFER"]').val().trim();
- delete data.DISAGREE_TRANSFER
- }
- params.followupProjectData = JSON.stringify(data);
- sendPost(url, params, null, function(res){
- plus.nativeUI.closeWaiting();
- mui.toast(res.msg);
- if(res.status == 200){
- var preWebview = plus.webview.getWebviewById('fvDetail'),
- preWebview2 = plus.webview.getWebviewById('xf_fvDetail'),
- curWebview = plus.webview.currentWebview();
-
- setTimeout(function(){
- if(preWebview){
- mui.fire(preWebview,"refresh")
- }
- if(preWebview2){
- mui.fire(preWebview2,"refresh")
- }
- },500)
- setTimeout(function(){
- curWebview.close();
- },1000)
- }
- }, 'POST');
- });
-
- $("body").on('keyup', "textarea", function(){
- var value = this.value,
- $count = $(this).siblings("p").find(".other-count");
- if($.trim(value) == ""){
- this.value = "";
- $count.text(0);
- }else{
- $count.text(value.length);
- }
- });
- };
- // 页面业务处理流程开始
- new Promise(function(resolve, reject) {
- // TODO 临时放开
- //resolve(true);
- mui.plusReady(function() {
- // plus已经准备好,可以往下执行
- resolve(true);
- });
- }).then(function() {
-
- // 获取基础环境信息
- return getBaseEnvPromise().then(function(env) {
- baseEnv = env;
- }).then(function() {
- // 获取登录医生信息
- baseInfo = getBaseInfo();
-
- //初始化页面内容
- initPage();
- // 绑定页面事件
- bindEvents();
- })
- }).catch(function(e) {
- plus.nativeUI.closeWaiting();
- console && console.error(e);
- });
- window.addEventListener("fillValue", function(e){
- var id = e.detail.id,
- value2 = e.detail.value2;
- value = e.detail.value;
- $("input[name="+id+"]").val(value);
- if(activeField == "WEIGHT" || activeField == "HEIGHT"){
- $("input[name=WEIGHT]").val(value)
- $("input[name=HEIGHT]").val(value2)
- var w = $("input[name=WEIGHT]").val(),
- h = $("input[name=HEIGHT]").val();
- var BMI = w/(h/100 * h/100);
- if(!isNaN(BMI)){
- $("input[name=BMI]").val(BMI.toFixed(2));
- }
- }
- //填充血压
- if(activeField == "BP_D" || activeField == "BP_U"){
- var $bpu = $("input[name=BP_U]"),
- $bpd = $("input[name=BP_D]");
- $bpd.val(value)
- $bpu.val(value2)
- }
- if(activeField == "CONTROL_BP_U" || activeField == "CONTROL_BP_D"){
- var $bpu = $("input[name=CONTROL_BP_D]"),
- $bpd = $("input[name=CONTROL_BP_U]");
- $bpd.val(value2)
- $bpu.val(value)
- }
- $("#disable_save").hide();
- $("#active_save").show();
- })
- window.addEventListener("fillEdu", function(e){
- //填充教育信息
- var info = JSON.parse(e.detail.info);
- var dateStr = info.czrq ? info.czrq.substr(0,10) : info.createTime.substr(0, 10);
- var type = e.detail.type;
- $("input[data-val=date]").val(dateStr);
- $("input[name=ARCHIVE_OPERATOR_NAME]").val(info.doctorName);
- var content = "";
- if(type == "zhidao"){
- plus.nativeUI.showWaiting();
- var url = "doctor/health/guidance/id",
- params = {id: info.id};
- sendPost(url, params, null, function(res){
- if(res.status == 200){
- content = res.data.content;
- var content1 = content.replace(/\ /g, "");
- content1 = content1.replace(/<[^>]+?>/g, "");
- content1 = content1.substr(0, 2000);
- $("textarea[name=EDUCATE_CONTENT]").val(content1);
- $(".other-count").text(content1.length);
- }
- plus.nativeUI.closeWaiting();
- }, 'POST', '', true);
- }
- if(type == "edu"){
- var url = "/third/jkEdu/Article/getArticalById",
- params = {articleId: info.code, userType: 1};
- sendPost(url, params, null, function(res){
- if(res.status == 200){
- content = res.data.articleContent;
- //出去文本中的html标签的内容
- var content1 = content.replace(/\ /g, "");
- content1 = content1.replace(/<[^>]+?>/g, "");
- content1 = content1.substr(0, 2000);
- $("textarea[name=EDUCATE_CONTENT]").val(content1);
- $(".other-count").text(content1.length);
- }
- }, 'GET', '', true);
- }
- $("#disable_save").hide();
- $("#active_save").show();
- });
- window.addEventListener("filldyy", function(e){
- var info = JSON.parse(e.detail.info),
- text = info.orgName+" "+info.deptName;
-
- $("[name=TRANSFER_ORG_DEPT]").val(text);
- $("[name=TRANSFER_ORG_DEPT]").siblings("p").find(".other-count").text(text.length);
- });
|