var $body = $('.yjk-body'); var d = dialog({contentType:'load', skin:'bk-popup'}); var userAgent = JSON.parse(window.localStorage.getItem(agentName)); var cache1 = window.localStorage.getItem("oneStep"+userAgent.uid); var cache2 = window.localStorage.getItem("twoStep"+userAgent.uid); var cache3 = window.localStorage.getItem("threeStep"+userAgent.uid); var cache4 = window.localStorage.getItem("fourStep"+userAgent.uid); //定义弹窗 function toast(msg){ dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:msg}).show() } var oneObj={},twoObj={},threeObj={},fourObj={}; $(function(){ oneObj = cache1?JSON.parse(cache1):''; twoObj = cache2?JSON.parse(cache2):''; threeObj = cache3?JSON.parse(cache3):''; fourObj = cache4?JSON.parse(cache4):''; var html = template('tpl_list',{oneData:oneObj,twoData:twoObj,threeData:threeObj,fourData:fourObj}) $body.html(html) bindEvents() }) function bindEvents(){ $('#ok_submit').on('tap',function(){ var params={ patient:userAgent.uid, name:oneObj.name, idcard:oneObj.idcardAll, ssc:oneObj.ssc, birthday:oneObj.birthday, mobile:oneObj.mobile, lastMenstrualDate:oneObj.lastMenstruation, allergyHistory:oneObj.allergy, maritalStatus:oneObj.marital, residentialAddress:oneObj.address,//现居住址 residentialProvince:"", residentialCity:"", residentialTown:"", permanentAddress:'',//户籍地址 permanentProvince:oneObj.permanentProvince,//户籍地址省份 permanentCity:oneObj.permanentCity,//户籍地址城市 permanentTown:"",//户籍地址区县 marryDate:oneObj.marital?twoObj.weddingDate:"" ,//结婚日期 spouseName:oneObj.marital?twoObj.spouseName:'',//配偶姓名 spouseBirthday:oneObj.marital?twoObj.spouseBirthday:'',//配偶生日 spouseMobile:oneObj.marital?twoObj.spouseMobile:'',//配偶手机 eatFolate:threeObj.folicacidCode,//服用叶酸 eatAcyeterion:threeObj.contrapillsCode,//服避孕药 smoke:threeObj.smokeCode,//吸烟(1是,0否) drink:threeObj.drinkCode,//饮酒(1是,0否) eatOtherDrugs:threeObj.otherPills,//其他药物 workUnit:fourObj.work,//工作单位 height:fourObj.height,//身高cm weight:fourObj.weight,//体重kg vaginalDeliveryTimes:fourObj.vaginalTimes,//阴道分娩次数 caesareanSectionTimes:fourObj.caesareanTimes,//剖宫产次数 menarcheAge:fourObj.menarche,//初潮(岁) menstrualPeriod:fourObj.period,//经期(天) menstrualCycle:fourObj.cycle,//周期(天) diseaseHistory:fourObj.diseaseHistory,//疾病史 operationHistory:fourObj.operationHistory,//手术史 otherInformation:fourObj.otherInformation//其他 } d.show(); sendPost("patient/prenatalnspector/addPreCard",{json:JSON.stringify(params)},'json','post', function(res){ d.close(); toast('请求失败') },function(res){ d.close(); if(res.status == 200){ window.localStorage.removeItem("oneStep"+userAgent.uid) window.localStorage.removeItem("twoStep"+userAgent.uid) window.localStorage.removeItem("threeStep"+userAgent.uid) window.localStorage.removeItem("fourStep"+userAgent.uid) dialog({ content: '
已成功提交,建卡后,请您定期到医院进行产前检查,接受孕期宣教,做好自我监控
', okValue: '好的', cancel: false, ok: function() { window.location.href="yunjianjihua.html" } }).showModal() }else{ toast(res.msg) } }) }) $('.edit').on('tap',function(){ var $url = $(this).attr('data-url') window.location.href=$url+'?isContinue=1' }) }