1 |
- import{_ as Y,d as $,p as ee,W as ue,x as d,aO as ae,aP as I,Z as le,y as oe,r as p,aD as te,o as m,c as C,H as ne,m as w,G as _,D as o,l as a,F as N,E as g,a as re,h as T,M as ie,aQ as se,bL as me,z as de,aZ as v,cI as pe}from"./index.js";import{convertInvoiceTitleData as R,convertInvoiceTitle as z}from"./columns.d95d09.js";import{h as U}from"./index.684ecd6b.js";import ce from"./choose-form.5ef709.js";import L from"./invoice-title.5ab0f3.js";import{A as ve}from"./configs.55e4fd8d.js";import"./index.8ad79f80.js";import"./orderRecord.4d98a397.js";import"./porder.9a85976d.js";import"./choose-modal.c9a6fa.js";import"./date-range.4010f801.js";const _e={class:"addEditForm"},fe={"w-full":""},ye={class:"flex justify-end w-full"},Ce=$({__name:"add-edit-form",setup(De){const{push:S}=ee(),{companyList:M,currentCompany:O}=ue(),f=d(null),A=d(null),D=ae(),F=I(!1),G=I(0),H=d([{companyName:"\u5317\u4EAC\u6CF0\u6587\u521B\u4F9B\u5E94\u94FE\u7BA1\u7406\u6709\u9650\u516C\u53F8",companyNo:"GS2402020907088731"},{companyName:"\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8",companyNo:"GS2203161855277894",disabled:!0}]),P={buyer:"",email:"",remark:"",invtype:"",companyNo:"",exam_remark:"",companyType:"01",platform_type:"",orderArr:[]},k=d([]),l=d({...P}),V=le({...ve});function j(){const{invtype:t}=l.value;V.email[0].required=t==="special_electronic"||t==="electronic"||t==="fully_digitalized_special_electronic"||t==="fully_digitalized_normal_electronic"}const y=d({}),E=d({});function x(t,u){if(!u)return t?y.value={}:E.value={};if(t){const{invoiceType:r,denomination:i}=u;G.value=Number(i)*1e4;const n=r.split(",");l.value.invtype="",k.value=me.filter(({value:s})=>n.includes(s))}t?y.value=R(z(u)):E.value=R(z(u))}const W=x.bind(null,!0),Z=x.bind(null,!1);async function q(t,u=!0){l.value[u?"companyNo":"buyer"]=t;const{code:r,data:i,message:n}=await U({companyNo:t});de(()=>{f.value&&f.value.validateField("companyNo")}),D({code:r,message:n,handler:()=>W(i.list[0])})}async function Q(t){const{code:u,data:r,message:i}=await U({noRela:!0,size:1e3});D({code:u,message:i,handler:()=>{const n=r.list.find(({companyNo:s})=>s===t);Z(n||{})}})}async function J(){var t;try{const{data:u,orderArr:r,totalCommonPrice:i,totalCommonCount:n}=((t=A.value)==null?void 0:t.getOpenInvInfo())||{},{winv_fee:s,payNo:c}=u;if(await f.value.validate(),!c){v.warning("\u8BF7\u9009\u62E9\u5BF9\u8D26\u5355");return}if(r.length===0){v.warning("\u8BF7\u81F3\u5C11\u9009\u4E2D\u4E00\u4E2A\u8BA2\u5355");return}if(Number(i)>Number(s)){v.warning("\u5F00\u7968\u603B\u91D1\u989D\u4E0D\u80FD\u5927\u4E8E\u672A\u5F00\u7968\u91D1\u989D");return}if(l.value.invtype==="fully_digitalized_special_electronic"||l.value.invtype==="fully_digitalized_normal_electronic"){if(Number(i)>1e3*1e4)return v.error("\u8BA2\u5355\u603B\u91D1\u989D\u4E0D\u80FD\u8D85\u8FC71000\u4E07")}else if(Number(i)>Number(y.value.denomination.split("\u4E07\u5143")[0]*1e4)){v.warning("\u5F00\u7968\u603B\u91D1\u989D\u4E0D\u80FD\u8D85\u8FC7\u9500\u552E\u65B9\u516C\u53F8\u5F00\u7968\u6700\u5927\u9762\u989D");return}if(n>150){v.warning("\u9009\u62E9\u7684\u901A\u7528\u8BA2\u5355\u4E0D\u80FD\u8D85\u8FC7150\u4E2A");return}const{invtype:B,email:b,remark:h,exam_remark:e}=l.value;F.value=!0;const{code:K,message:X}=await pe({email:b,payNo:c,remark:h,invtype:B,orderArr:r,exam_remark:e});F.value=!1,D({code:K,message:X,handler:()=>S("/InvoiceSales/invoiceApply")})}catch(u){const{warn:r}=console;r(u)}}return oe(()=>q(O.value.companyNo)),(t,u)=>{const r=p("el-option"),i=p("el-select"),n=p("el-form-item"),s=p("el-col"),c=p("el-input"),B=p("ElButton"),b=p("el-row"),h=te("loading");return m(),C("div",_e,[ne((m(),_(w(se),{model:l.value,rules:V,ref_key:"formRef",ref:f,"status-icon":"",size:"small"},{default:o(()=>[a(b,{gutter:"10"},{default:o(()=>[a(s,{span:12},{default:o(()=>[a(n,{label:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",prop:"companyNo"},{default:o(()=>[a(i,{disabled:"",style:{width:"100%"},placeholder:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",modelValue:l.value.companyNo,"onUpdate:modelValue":u[0]||(u[0]=e=>l.value.companyNo=e)},{default:o(()=>[(m(!0),C(N,null,g(w(M),e=>(m(),_(r,{key:e.companyCode,value:e.companyCode,label:e.companyName},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(L,{detail:y.value},null,8,["detail"])]),_:1}),a(s,{span:12},{default:o(()=>[a(n,{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934",prop:"companyNo"},{default:o(()=>[a(i,{style:{width:"100%"},placeholder:"\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934",modelValue:l.value.buyer,"onUpdate:modelValue":u[1]||(u[1]=e=>l.value.buyer=e),onChange:Q},{default:o(()=>[(m(!0),C(N,null,g(H.value,e=>(m(),_(r,{key:e.companyNo,value:e.companyNo,label:e.companyName,disabled:e.disabled},null,8,["value","label","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1}),l.value.buyer?(m(),_(L,{key:0,detail:E.value},null,8,["detail"])):re("v-if",!0)]),_:1}),a(s,{span:6},{default:o(()=>[a(n,{label:"\u53D1\u7968\u7C7B\u578B",prop:"invtype"},{default:o(()=>[a(i,{modelValue:l.value.invtype,"onUpdate:modelValue":u[2]||(u[2]=e=>l.value.invtype=e),style:{width:"100%"},onChange:j,"no-data-text":"\u8BF7\u9009\u62E9\u5176\u4ED6\u9500\u552E\u65B9\u516C\u53F8",placeholder:"\u53D1\u7968\u7C7B\u578B"},{default:o(()=>[(m(!0),C(N,null,g(k.value,e=>(m(),_(r,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u7535\u5B50\u90AE\u7BB1",prop:"email"},{default:o(()=>[a(c,{modelValue:l.value.email,"onUpdate:modelValue":u[3]||(u[3]=e=>l.value.email=e),placeholder:"\u7535\u5B50\u90AE\u7BB1"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:18},{default:o(()=>[a(n,{label:"\u7533\u8BF7\u5907\u6CE8",prop:"exam_remark"},{default:o(()=>[a(c,{"w-full":"",modelValue:l.value.exam_remark,"onUpdate:modelValue":u[4]||(u[4]=e=>l.value.exam_remark=e),rows:5,type:"textarea",maxlength:"2000",placeholder:"\u7533\u8BF7\u5907\u6CE8","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:24},{default:o(()=>[a(n,{label:"\u53D1\u7968\u5907\u6CE8",prop:"remark"},{default:o(()=>[T("div",fe,[a(c,{"w-full":"",modelValue:l.value.remark,"onUpdate:modelValue":u[5]||(u[5]=e=>l.value.remark=e),rows:3,type:"textarea",maxlength:"2000","show-word-limit":"",placeholder:"\u53D1\u7968\u5907\u6CE8"},null,8,["modelValue"])])]),_:1})]),_:1}),a(s,{span:24},{default:o(()=>[a(n,{label:"\u8BA2\u5355\u5BF9\u8D26"},{default:o(()=>[a(ce,{ref_key:"chooseFormRef",ref:A,customerNo:l.value.buyer,platformType:l.value.platform_type},null,8,["customerNo","platformType"])]),_:1})]),_:1}),T("div",ye,[a(B,{type:"primary",size:"",onClick:J},{default:o(()=>[ie("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model","rules"])),[[h,w(F)]])])}}});var xe=Y(Ce,[["__scopeId","data-v-2efb12b2"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/invoiceApply/components/currentcy-form-wanyu/add-edit-form.vue"]]);export{xe as default};
|