1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/archives/add_archives"],{"0465":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n("a34a"));function a(t){return t&&t.__esModule?t:{default:t}}function u(t,e,n,i,a,u,r){try{var o=t[u](r),s=o.value}catch(c){return void n(c)}o.done?e(s):Promise.resolve(s).then(i,a)}function r(t){return function(){var e=this,n=arguments;return new Promise((function(i,a){var r=t.apply(e,n);function o(t){u(r,i,a,o,s,"next",t)}function s(t){u(r,i,a,o,s,"throw",t)}o(void 0)}))}}var o={onLoad:function(e){var n=new Date,i=n.getFullYear(),a=n.getMonth()+1,u=n.getDate()>=10?n.getDate():"0"+n.getDate();this.time=i+"-"+a+"-"+u,e.info&&(this.info=JSON.parse(e.info)),""!=this.info&&(t.setNavigationBarTitle({title:"修改档案"}),this.name=this.info.name,this.imgList=[this.info.avatar],this.date=this.info.birthday,this.value=this.list[this.info.sex-1].name,this.guanxi=this.guanxilist[this.info.relationship_type].label,this.idcrad=this.info.card_number)},onShow:function(){},data:function(){return{imgList:"",name:"",list:[{name:"男",disabled:!1},{name:"女",disabled:!1}],value:"男",date:"请选择出生日期",show:!1,guanxi:"请选择",guanxiindex:-1,guanxilist:[{value:"1",label:"父亲"},{value:"2",label:"母亲"},{value:"3",label:"祖父"},{value:"4",label:"祖母"},{value:"5",label:"外祖父"},{value:"6",label:"外祖母"},{value:"7",label:"叔侄"},{value:"8",label:"其他"}],idcrad:"",touxiang:"",time:"",info:""}},methods:{ChooseImage:function(){var e=this;t.chooseImage({count:1,sizeType:["compressed"],sourceType:["album","camera"],success:function(t){e.imgList=t.tempFilePaths,e.$request.upload("/api/v1/common/uploadFile",e.imgList[0]).then((function(t){var n=JSON.parse(t);0==n.status&&(e.touxiang=n.data.url,console.log(e.touxiang))}))}})},radioGroupChange:function(t){this.value=t},bindDateChange:function(t){var e=t.detail;this.date=e.value},confirm:function(t){this.guanxiindex=t.detail.value,this.guanxi=this.guanxilist[t.detail.value].label},addarchives:function(){var e=r(i.default.mark((function e(){var n,a;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=0,n="男"==this.value?1:2,void 0!=this.imgList[0]){e.next=5;break}return t.showToast({title:"请上传头像",icon:"none"}),e.abrupt("return",!1);case 5:if(""!=this.name){e.next=8;break}return t.showToast({title:"请填写名称",icon:"none"}),e.abrupt("return",!1);case 8:if("请选择出生日期"!=this.date){e.next=11;break}return t.showToast({title:"请填写日期",icon:"none"}),e.abrupt("return",!1);case 11:if(-1!=this.guanxiindex){e.next=14;break}return t.showToast({title:"请选择被保人关系",icon:"none"}),e.abrupt("return",!1);case 14:return e.next=16,this.$request.post("/api/v1/patient/createPatient",{name:this.name,sex:n,avatar:this.touxiang,birthday:this.date,relationship_type:this.guanxiindex,card_type:1,card_number:this.idcrad});case 16:a=e.sent,0==a.status&&(t.showToast({title:"提交成功",icon:"none",duration:1500}),setTimeout((function(){t.navigateBack({delta:1})}),1500));case 18:case"end":return e.stop()}}),e,this)})));function n(){return e.apply(this,arguments)}return n}(),editarchives:function(){var e=r(i.default.mark((function e(){var n,a;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=0,n="男"==this.value?1:2,void 0!=this.imgList[0]){e.next=5;break}return t.showToast({title:"请上传头像",icon:"none"}),e.abrupt("return",!1);case 5:if(""!=this.name){e.next=8;break}return t.showToast({title:"请填写名称",icon:"none"}),e.abrupt("return",!1);case 8:if("请选择出生日期"!=this.date){e.next=11;break}return t.showToast({title:"请填写日期",icon:"none"}),e.abrupt("return",!1);case 11:if(-1!=this.guanxiindex){e.next=14;break}return t.showToast({title:"请选择被保人关系",icon:"none"}),e.abrupt("return",!1);case 14:return e.next=16,this.$request.post("/api/v1/patient/updatePatient",{id:this.info.id,name:this.name,sex:n,avatar:this.touxiang,birthday:this.date,relationship_type:this.guanxiindex,card_type:1,card_number:this.idcrad});case 16:a=e.sent,0==a.status&&(t.showToast({title:"修改成功",icon:"none",duration:1500}),setTimeout((function(){t.navigateBack({delta:1})}),1500));case 18:case"end":return e.stop()}}),e,this)})));function n(){return e.apply(this,arguments)}return n}()}};e.default=o}).call(this,n("543d")["default"])},2216:function(t,e,n){"use strict";n.r(e);var i=n("0465"),a=n.n(i);for(var u in i)"default"!==u&&function(t){n.d(e,t,(function(){return i[t]}))}(u);e["default"]=a.a},2705:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return i}));var i={uRadioGroup:function(){return Promise.all([n.e("common/vendor"),n.e("uview-ui/components/u-radio-group/u-radio-group")]).then(n.bind(null,"8225"))},uRadio:function(){return n.e("uview-ui/components/u-radio/u-radio").then(n.bind(null,"e9ba"))}},a=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.show=!t.show})},u=[]},"2c6d":function(t,e,n){},"5e08":function(t,e,n){"use strict";var i=n("2c6d"),a=n.n(i);a.a},"7f95":function(t,e,n){"use strict";n.r(e);var i=n("2705"),a=n("2216");for(var u in a)"default"!==u&&function(t){n.d(e,t,(function(){return a[t]}))}(u);n("5e08");var r,o=n("f0c5"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"cc306336",null,!1,i["a"],r);e["default"]=s.exports},"9bf8":function(t,e,n){"use strict";(function(t){n("02cf");i(n("66fd"));var e=i(n("7f95"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])}},[["9bf8","common/runtime","common/vendor"]]]);
|