"use strict";const e=require("../../common/vendor.js"),n=require("../../api/api.js");if(!Array){(e.resolveComponent("up-icon")+e.resolveComponent("up-textarea")+e.resolveComponent("up-button")+e.resolveComponent("up-picker"))()}Math||((()=>"../../uni_modules/uview-plus/components/u-icon/u-icon.js")+(()=>"../../uni_modules/uview-plus/components/u-textarea/u-textarea.js")+(()=>"../../uni_modules/uview-plus/components/u-button/u-button.js")+(()=>"../../uni_modules/uview-plus/components/u-picker/u-picker.js"))();const o={__name:"makeInvoice",setup(o){e.ref([]);let i=e.ref({invoiceType:null,subjectType:null,ordersIds:[]}),u=e.ref(!1),a=e.ref(!1);e.onLoad((async e=>{console.log(e),console.log(JSON.parse(decodeURIComponent(e.list))),i.value.ordersIds=JSON.parse(decodeURIComponent(e.list))}));const l=async()=>i.value.subjectType?i.value.invoiceType?(1!=!i.value.invoiceType||i.value.taxNumber)&&(1!=!i.value.subjectType||i.value.registrationPhone)&&(1!=!i.value.subjectType||2!=!i.value.invoiceType||i.value.taxNumber)?1!=!i.value.subjectType||2!=!i.value.invoiceType||i.value.registrationAddress?1!=!i.value.subjectType||2!=!i.value.invoiceType||i.value.registrationPhone?1!=!i.value.subjectType||2!=!i.value.invoiceType||i.value.bankName?1!=!i.value.subjectType||2!=!i.value.invoiceType||i.value.bankAccount?i.value.name?i.value.address?i.value.phone?i.value.email?(await n.apply(i.value),void e.index.navigateBack({delta:3})):e.index.showToast({title:"请输入收票人邮箱",icon:"none"}):e.index.showToast({title:"请输入收票人电话",icon:"none"}):e.index.showToast({title:"请输入收票人地址",icon:"none"}):e.index.showToast({title:"请输入收票人姓名",icon:"none"}):e.index.showToast({title:"请输入开户行账户",icon:"none"}):e.index.showToast({title:"请输入开户行名称",icon:"none"}):e.index.showToast({title:"请输入公司电话",icon:"none"}):e.index.showToast({title:"请输入公司地址",icon:"none"}):e.index.showToast({title:"请输入发票税号",icon:"none"}):e.index.showToast({title:"请选择发票类型",icon:"none"}):e.index.showToast({title:"请选择发票主体",icon:"none"}),t=e=>{i.value.invoiceType=e.value[0].id,u.value=!1,console.log(i.value.invoiceType)},r=e=>{i.value.subjectType=e.value[0].id,a.value=!1,2==e.value[0].id&&(i.value.invoiceType=1)},s=()=>{2!=i.value.subjectType&&(u.value=!0)},c=e.reactive([[{label:"增值税普通发票",id:1},{label:"增值税专用发票",id:2}]]),v=e.reactive([[{label:"企业",id:1},{label:"个人",id:2}]]);return(n,o)=>e.e({a:e.p({name:"error-circle-fill",color:"#3c9cff"}),b:e.t(e.unref(i).subjectType?v[0].find((n=>n.id==e.unref(i).subjectType)).label:"请选择"),c:e.unref(i).subjectType?"":"#808080",d:e.p({name:"arrow-down"}),e:e.o((n=>e.isRef(a)?a.value=!0:a=!0)),f:e.t(e.unref(i).invoiceType?c[0].find((n=>n.id==e.unref(i).invoiceType)).label:"请选择"),g:e.unref(i).invoiceType?"":"#808080",h:e.p({name:"arrow-down"}),i:e.o(s),j:e.unref(i).invoiceTitle,k:e.o((n=>e.unref(i).invoiceTitle=n.detail.value)),l:1==e.unref(i).subjectType},1==e.unref(i).subjectType?{m:e.unref(i).taxNumber,n:e.o((n=>e.unref(i).taxNumber=n.detail.value))}:{},{o:2==e.unref(i).invoiceType},2==e.unref(i).invoiceType?{p:e.unref(i).registrationAddress,q:e.o((n=>e.unref(i).registrationAddress=n.detail.value))}:{},{r:2==e.unref(i).invoiceType},2==e.unref(i).invoiceType?{s:e.unref(i).registrationPhone,t:e.o((n=>e.unref(i).registrationPhone=n.detail.value))}:{},{v:2==e.unref(i).invoiceType},2==e.unref(i).invoiceType?{w:e.unref(i).bankName,x:e.o((n=>e.unref(i).bankName=n.detail.value))}:{},{y:2==e.unref(i).invoiceType},2==e.unref(i).invoiceType?{z:e.unref(i).bankAccount,A:e.o((n=>e.unref(i).bankAccount=n.detail.value))}:{},{B:e.unref(i).name,C:e.o((n=>e.unref(i).name=n.detail.value)),D:e.unref(i).phone,E:e.o((n=>e.unref(i).phone=n.detail.value)),F:e.unref(i).address,G:e.o((n=>e.unref(i).address=n.detail.value)),H:e.unref(i).email,I:e.o((n=>e.unref(i).email=n.detail.value)),J:e.o((n=>e.unref(i).invoiceRemark=n)),K:e.p({placeholder:"请输入内容",modelValue:e.unref(i).invoiceRemark}),L:e.o(l),M:e.p({customStyle:{height:"80rpx",width:"230rpx"},color:"#4879e6",text:"确认开票",shape:"circle"}),N:e.o(t),O:e.o((n=>e.isRef(u)?u.value=!1:u=!1)),P:e.p({keyName:"label",show:e.unref(u),columns:c}),Q:e.o(r),R:e.o((n=>e.isRef(a)?a.value=!1:a=!1)),S:e.p({keyName:"label",show:e.unref(a),columns:v})})}},i=e._export_sfc(o,[["__scopeId","data-v-fc7ee96e"]]);wx.createPage(i);
