1 |
- import{N as e,z as l,o,f as a,g as t,w as i,m as r,k as n,u as d,i as s,l as c,F as m,E as u,G as p,s as f,x as B,aE as h,P as v,K as b,ap as y,n as T,j as g,L as _,J as x}from"./index-ba48620e.js";import{b as V,a as k,d as w}from"./phone-international-input.dd3ca29e.js";import{a as S,_ as z}from"./s-layout.04b95866.js";import{_ as U}from"./_plugin-vue_export-helper.1b428a4d.js";import"./useGoods.edb8879f.js";const M=U({__name:"edit",setup(U){const M=e(null),I=e(!1),N=l({showRegion:!1,model:{invoiceType:1,invoiceTitleType:1,invoiceTitle:"",taxIDNumber:""},rules:{},protocol:!1});function D(){N.protocol=!N.protocol}const j={invoiceType:{rules:[{required:!0,errorMessage:"请选择发票类型"}]},invoiceTitleType:{rules:[{required:!0,errorMessage:"请选择抬头类型"}]},invoiceTitle:{rules:[{required:!0,errorMessage:"请输入发票抬头"}]},taxIDNumber:{rules:[{required:!0,errorMessage:"请输入单位税号"}]}},C=e=>{N.model.invoiceType=e.detail.value,N.model.invoiceTitleType=1},G=e=>{N.model.invoiceTitleType=e.detail.value},q=async()=>{if(!(await B(M).validate().catch((e=>{console.log("error: ",e)}))))return;if(!N.protocol)return I.value=!0,void setTimeout((function(){I.value=!1}),500);const e={...N.model},{code:l}=N.model.id>0?await h.updateAddress(e):await h.createAddress(e);0===l&&f.$router.back()},A=()=>{v({title:"提示",content:"确认删除此收货地址吗?",success:async function(e){if(!e.confirm)return;const{code:l}=await h.deleteAddress(N.model.id);0===l&&f.$router.back()}})};return o((async e=>{})),(e,l)=>{const o=b,B=y,h=r(T("uni-forms-item"),V),v=r(T("uni-easyinput"),k),U=g,F=_,$=r(T("uni-forms"),w),E=x,R=r(T("su-fixed"),S),W=r(T("s-layout"),z);return a(),t(W,{title:N.model.id?"编辑发票抬头":"新增发票抬头"},{default:i((()=>[n($,{ref_key:"invoiceFormRef",ref:M,modelValue:N.model,"onUpdate:modelValue":l[12]||(l[12]=e=>N.model=e),rules:j,validateTrigger:"bind",labelWidth:"160",labelAlign:"left",border:"",labelStyle:{fontWeight:"bold"}},{default:i((()=>[n(U,{class:"bg-white form-box ss-p-x-30"},{default:i((()=>[n(h,{name:"invoiceType",label:"发票类型"},{default:i((()=>[n(B,{onChange:C},{default:i((()=>[n(o,{value:"1",checked:1==N.model.invoiceType,color:"var(--ui-BG-Main)",class:"radio ss-m-r-30",style:{transform:"scale(0.9)"}},{default:i((()=>[d("纸质普票 ")])),_:1},8,["checked"]),n(o,{value:"2",checked:2==N.model.invoiceType,color:"var(--ui-BG-Main)",class:"radio",style:{transform:"scale(0.9)"}},{default:i((()=>[d("专用发票")])),_:1},8,["checked"])])),_:1})])),_:1}),1==N.model.invoiceType?(a(),t(h,{key:0,name:"invoiceTitleType",label:"抬头类型",class:"form-item"},{default:i((()=>[n(B,{class:"uni-flex uni-row radio-group",onChange:G},{default:i((()=>[n(o,{value:"1",checked:1==N.model.invoiceTitleType,color:"var(--ui-BG-Main)",class:"radio ss-m-r-30",style:{transform:"scale(0.9)"}},{default:i((()=>[d("个人 ")])),_:1},8,["checked"]),n(o,{value:"2",checked:2==N.model.invoiceTitleType,color:"var(--ui-BG-Main)",style:{transform:"scale(0.9)"},class:"radio"},{default:i((()=>[d("单位")])),_:1},8,["checked"])])),_:1})])),_:1})):s("",!0),n(h,{name:"invoiceTitle",label:"发票抬头",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.invoiceTitle,"onUpdate:modelValue":l[0]||(l[0]=e=>N.model.invoiceTitle=e),placeholder:"请输入发票抬头",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1}),2==N.model.invoiceTitleType?(a(),c(m,{key:1},[n(h,{name:"taxIDNumber",label:"单位税号",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.taxIDNumber,"onUpdate:modelValue":l[1]||(l[1]=e=>N.model.taxIDNumber=e),type:"number",placeholder:"请输入单位税号",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1}),n(h,{name:"invoiceTitle",label:"注册地址",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.invoiceTitle,"onUpdate:modelValue":l[2]||(l[2]=e=>N.model.invoiceTitle=e),type:"number",placeholder:"选填",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1}),n(h,{name:"invoiceTitle",label:"注册电话",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.invoiceTitle,"onUpdate:modelValue":l[3]||(l[3]=e=>N.model.invoiceTitle=e),type:"number",placeholder:"选填",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1}),n(h,{name:"invoiceTitle",label:"开户银行",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.invoiceTitle,"onUpdate:modelValue":l[4]||(l[4]=e=>N.model.invoiceTitle=e),type:"number",placeholder:"选填",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1}),n(h,{name:"invoiceTitle",label:"银行账号",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.invoiceTitle,"onUpdate:modelValue":l[5]||(l[5]=e=>N.model.invoiceTitle=e),type:"number",placeholder:"选填",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1})],64)):s("",!0),2==N.model.invoiceType?(a(),c(m,{key:2},[n(h,{name:"taxIDNumber",label:"单位税号",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.taxIDNumber,"onUpdate:modelValue":l[6]||(l[6]=e=>N.model.taxIDNumber=e),type:"number",placeholder:"请输入单位税号",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1}),n(h,{name:"invoiceTitle",label:"注册地址",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.invoiceTitle,"onUpdate:modelValue":l[7]||(l[7]=e=>N.model.invoiceTitle=e),type:"number",placeholder:"必填",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1}),n(h,{name:"invoiceTitle",label:"注册电话",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.invoiceTitle,"onUpdate:modelValue":l[8]||(l[8]=e=>N.model.invoiceTitle=e),type:"number",placeholder:"必填",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1}),n(h,{name:"invoiceTitle",label:"开户银行",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.invoiceTitle,"onUpdate:modelValue":l[9]||(l[9]=e=>N.model.invoiceTitle=e),type:"number",placeholder:"必填",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1}),n(h,{name:"invoiceTitle",label:"银行账号",class:"form-item"},{default:i((()=>[n(v,{modelValue:N.model.invoiceTitle,"onUpdate:modelValue":l[10]||(l[10]=e=>N.model.invoiceTitle=e),type:"number",placeholder:"必填",inputBorder:!1,placeholderStyle:"color:#BBBBBB;font-size:30rpx;font-weight:400;line-height:normal"},null,8,["modelValue"])])),_:1})],64)):s("",!0)])),_:1}),2==N.model.invoiceType?(a(),t(U,{key:0,class:"ss-m-y-20 bg-white ss-p-x-30 ss-flex ss-row-between ss-col-center default-box"},{default:i((()=>[n(U,{class:u(["default-box-title",{shake:I.value}])},{default:i((()=>[n(F,{class:"radio ss-flex ss-col-center",onClick:D},{default:i((()=>[n(o,{checked:N.protocol,color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},onClick:p(D,["stop"])},null,8,["checked"]),n(U,{class:"agreement-text ss-flex ss-col-center ss-m-l-8"},{default:i((()=>[d(" 我已阅读并同意 "),n(U,{class:"tcp-text",onClick:l[11]||(l[11]=p((e=>{return l="专用发票抬头确认书",void f.$router.go("/pages/public/richtext",{title:l});var l}),["stop"]))},{default:i((()=>[d(" 《专用发票抬头确认书》 ")])),_:1})])),_:1})])),_:1})])),_:1},8,["class"])])),_:1})):s("",!0)])),_:1},8,["modelValue"]),n(R,{bottom:"",opacity:!1,bg:"",placeholder:"",noFixed:!1,index:10},{default:i((()=>[n(U,{class:"footer-box ss-flex-col ss-row-between ss-p-20"},{default:i((()=>[n(U,{class:"ss-m-b-20"},{default:i((()=>[n(E,{class:"ss-reset-button save-btn ui-Shadow-Main",onClick:q},{default:i((()=>[d("保存")])),_:1})])),_:1}),N.model.id?(a(),t(E,{key:0,class:"ss-reset-button cancel-btn",onClick:A},{default:i((()=>[d(" 删除 ")])),_:1})):s("",!0)])),_:1})])),_:1})])),_:1},8,["title"])}}},[["__scopeId","data-v-8b9ab6a6"]]);export{M as default};
|