"use strict";var _=Object.defineProperty,h=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var c=(t,i,s)=>i in t?_(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,m=(t,i)=>{for(var s in i||(i={}))g.call(i,s)&&c(t,s,i[s]);if(d)for(var s of d(i))v.call(i,s)&&c(t,s,i[s]);return t},p=(t,i)=>h(t,y(i));var e=require("../common/vendor.js"),f=require("../api/inquiryOrder.js");require("../common/request.js");const x={data(){return{statusBarHeight:e.index.getStorageSync("menuInfo").statusBarHeight,orderKey:null,patient:null,durations:[{name:"\u4E00\u5468\u5185",disabled:!1},{name:"\u4E00\u4E2A\u6708\u5185",disabled:!1},{name:"\u534A\u5E74\u5185",disabled:!1},{name:"\u534A\u5E74\u4EE5\u4E0A",disabled:!1}],isVisits:[{name:"\u672A\u5C31\u8BCA",disabled:!1},{name:"\u5C31\u8BCA\u8FC7",disabled:!1}],title:"",isVisit:"\u5C31\u8BCA\u8FC7",duration:"\u4E00\u5468\u5185",inquiryType:null,orderType:null,doctorId:null,fileList1:[]}},onLoad(t){this.inquiryType=t.inquiryType,this.orderType=t.orderType,this.doctorId=t.doctorId,console.log(this.inquiryType),console.log(this.orderType),console.log(this.doctorId),this.confirm()},onShow(){var t=this;e.index.$on("refreshOrderPatient",i=>{t.patient=i})},methods:{leftClick(){console.log("leftClick"),e.index.showModal({title:"\u63D0\u793A",content:"\u786E\u8BA4\u5173\u95ED\u5417",success:function(t){t.confirm?e.index.navigateBack():t.cancel}})},submitOrder(){if(this.patient==null){e.index.showToast({icon:"none",title:"\u8BF7\u9009\u62E9\u5C31\u8BCA\u4EBA"});return}if(this.isVisit=="\u672A\u5C31\u8BCA"){e.index.showToast({icon:"none",title:"\u4EC5\u652F\u6301\u590D\u8BCA"});return}this.orderKey==null&&this.confirm();var t=[];this.fileList1.forEach(function(s){t.push(s.url)});var i={orderKey:this.orderKey,patientId:this.patient.patientId,title:this.title,isVisit:this.isVisit,duration:this.duration,inquiryType:this.inquiryType,orderType:this.orderType,doctorId:this.doctorId,reportImages:t.toString()};e.index.showLoading({title:"\u6B63\u5728\u5904\u7406\u4E2D..."}),f.create(i).then(s=>{if(e.index.hideLoading(),s.code==200){var r=["YyaBF62vH1GPKY0tume8C2C5UETxcKrVsaTKdBW5eok"];e.index.requestSubscribeMessage({tmplIds:r,success(o){setTimeout(function(){e.index.redirectTo({url:"./inquiryPay?orderId="+s.order.orderId})},200)},fail(o){setTimeout(function(){e.index.redirectTo({url:"./inquiryPay?orderId="+s.order.orderId})},200)}});return}else e.index.showToast({icon:"none",title:s.msg})},s=>{})},confirm(){let t={};f.confirm(t).then(i=>{i.code==200&&(this.orderKey=i.orderKey)},i=>{})},addPatient(){e.index.navigateTo({url:"/pages_user/patient"})},deletePic(t){this[`fileList${t.name}`].splice(t.index,1)},async afterRead(t){let i=[].concat(t.file),s=this[`fileList${t.name}`].length;i.map(r=>{this[`fileList${t.name}`].push(p(m({},r),{status:"uploading",message:"\u4E0A\u4F20\u4E2D"}))});for(let r=0;r<i.length;r++){const o=await this.uploadFilePromise(i[r].url);let u=this[`fileList${t.name}`][s];this[`fileList${t.name}`].splice(s,1,Object.assign(u,{status:"success",message:"",url:o})),s++}},uploadFilePromise(t){return new Promise((i,s)=>{e.index.uploadFile({url:e.index.getStorageSync("requestPath")+"/app/common/uploadOSS",filePath:t,name:"file",formData:{user:"test"},success:r=>{setTimeout(()=>{console.log(JSON.parse(r.data).url),i(JSON.parse(r.data).url)},1e3)}})})}}};if(!Array){const t=e.resolveComponent("u-navbar"),i=e.resolveComponent("u-alert"),s=e.resolveComponent("u--textarea"),r=e.resolveComponent("u-radio"),o=e.resolveComponent("u-radio-group"),u=e.resolveComponent("u-upload");(t+i+s+r+o+u)()}const C=()=>"../uni_modules/uview-plus/components/u-navbar/u-navbar.js",F=()=>"../uni_modules/uview-plus/components/u-alert/u-alert.js",T=()=>"../uni_modules/uview-plus/components/u--textarea/u--textarea.js",b=()=>"../uni_modules/uview-plus/components/u-radio/u-radio.js",B=()=>"../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js",P=()=>"../uni_modules/uview-plus/components/u-upload/u-upload.js";Math||(C+F+T+b+B+P)();function q(t,i,s,r,o,u){return e.e({a:e.o(u.leftClick),b:e.p({title:"\u75C7\u72B6\u63CF\u8FF0"}),c:o.statusBarHeight,d:e.p({fontSize:"16",description:`\u5C0A\u656C\u7684\u7528\u6237\uFF0C\u60A8\u597D!\r
			\u4E3A\u4E86\u60A8\u7684\u5065\u5EB7\uFF0C\u8BF7\u8BA4\u771F\u586B\u5199\u4EE5\u4E0B\u5185\u5BB9\uFF0C\u4EE5\u4FBF\u66F4\u597D\u5730\u4E3A\u60A8\u63D0\u4F9B\u54A8\u8BE2\u5EFA\u8BAE`}),e:o.patient==null},o.patient==null?{f:e.o(n=>u.addPatient())}:{},{g:o.patient!=null},o.patient!=null?e.e({h:e.t(o.patient.patientName),i:o.patient.sex==1},o.patient.sex==1?{}:{},{j:o.patient.sex==2},o.patient.sex==2?{}:{},{k:e.t(t.$getAge(o.patient.birthday)),l:e.t(t.$parseIdCard(o.patient.idCard)),m:e.o(n=>u.addPatient())}):{},{n:e.o(n=>o.title=n),o:e.p({maxlength:"500",placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",count:!0,modelValue:o.title}),p:e.f(o.durations,(n,a,l)=>({a,b:"8a2d8f20-4-"+l+",8a2d8f20-3",c:e.p({customStyle:{marginRight:"5px"},label:n.name,name:n.name,activeColor:"#C39A58"})})),q:e.o(n=>o.duration=n),r:e.p({iconPlacement:"left",modelValue:o.duration}),s:e.f(o.isVisits,(n,a,l)=>({a,b:"8a2d8f20-6-"+l+",8a2d8f20-5",c:e.p({customStyle:{marginRight:"5px"},label:n.name,name:n.name,activeColor:"#C39A58"})})),t:e.o(n=>o.isVisit=n),v:e.p({iconPlacement:"left",modelValue:o.isVisit}),w:e.o(u.afterRead),x:e.o(u.deletePic),y:e.p({fileList:o.fileList1,name:"1",maxCount:5}),z:e.o(n=>u.submitOrder())})}var I=e._export_sfc(x,[["render",q],["__scopeId","data-v-8a2d8f20"],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_order/inquiryForm1.vue"]]);wx.createPage(I);
