1 |
- import{_ as X,d as Y,p as $,W as ee,x as c,aO as ue,aP as T,Z as le,y as ae,r as p,aD as oe,o as d,c as D,H as te,m as C,G as f,D as o,l,F as g,E as k,a as ne,h as R,M as re,aQ as ie,bL as se,z as de,aZ as v,cI as me}from"./index.js";import{convertInvoiceTitleData as z,convertInvoiceTitle as U}from"./columns.d95d092.js";import{h as L}from"./index.684ecd6b.js";import pe from"./choose-form.be2b18.js";import M from"./invoice-title.cefc23.js";import{A as ce}from"./configs.55e4fd8d.js";import"./index.8ad79f80.js";import"./orderRecord.4d98a397.js";import"./porder.9a85976d.js";import"./choose-modal.042c8b.js";import"./date-range.4010f801.js";const ve={class:"addEditForm"},fe={"w-full":""},_e={class:"flex justify-end w-full"},ye=Y({__name:"add-edit-form",setup(De){const{push:O}=$(),{companyList:V,currentCompany:H}=ee(),_=c(null),N=c(null),E=ue(),B=T(!1),P=T(0),S={buyer:"",email:"",remark:"",invtype:"",companyNo:"",exam_remark:"",companyType:"01",platform_type:"",orderArr:[]},x=c([]),a=c({...S}),A=le({...ce});function j(){const{invtype:t}=a.value;A.email[0].required=t==="special_electronic"||t==="electronic"||t==="fully_digitalized_special_electronic"||t==="fully_digitalized_normal_electronic"}const y=c({}),F=c({});function I(t,e){if(!e)return t?y.value={}:F.value={};if(t){const{invoiceType:r,denomination:i}=e;P.value=Number(i)*1e4;const n=r.split(",");a.value.invtype="",x.value=se.filter(({value:s})=>n.includes(s))}t?y.value=z(U(e)):F.value=z(U(e))}const G=I.bind(null,!0),Z=I.bind(null,!1);async function q(t,e=!0){a.value[e?"companyNo":"buyer"]=t;const{code:r,data:i,message:n}=await L({companyNo:t});de(()=>{_.value&&_.value.validateField("companyNo")}),E({code:r,message:n,handler:()=>G(i.list[0])})}async function Q({companyNo:t,companyName:e}){a.value.buyer=e;const{code:r,data:i,message:n}=await L({noRela:!0,size:1e3});E({code:r,message:n,handler:()=>{const s=i.list.find(({companyNo:m})=>m===t);Z(s||{})}})}async function W(){var t;try{const{data:e,orderArr:r,totalCommonPrice:i,totalCommonCount:n}=((t=N.value)==null?void 0:t.getOpenInvInfo())||{},{winv_fee:s,payNo:m}=e;if(await _.value.validate(),!m){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(a.value.invtype==="fully_digitalized_special_electronic"||a.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:h,remark:w,exam_remark:u}=a.value;B.value=!0;const{code:J,message:K}=await me({email:h,payNo:m,remark:w,invtype:b,orderArr:r,exam_remark:u});B.value=!1,E({code:J,message:K,handler:()=>O("/InvoiceSales/invoiceApply")})}catch(e){const{warn:r}=console;r(e)}}return ae(()=>q(H.value.companyNo)),(t,e)=>{const r=p("el-option"),i=p("el-select"),n=p("el-form-item"),s=p("el-col"),m=p("el-input"),b=p("ElButton"),h=p("el-row"),w=oe("loading");return d(),D("div",ve,[te((d(),f(C(ie),{model:a.value,rules:A,ref_key:"formRef",ref:_,"status-icon":"",size:"small"},{default:o(()=>[l(h,{gutter:"10"},{default:o(()=>[l(s,{span:12},{default:o(()=>[l(n,{label:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",prop:"companyNo"},{default:o(()=>[l(i,{disabled:"",style:{width:"100%"},placeholder:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",modelValue:a.value.companyNo,"onUpdate:modelValue":e[0]||(e[0]=u=>a.value.companyNo=u)},{default:o(()=>[(d(!0),D(g,null,k(C(V),u=>(d(),f(r,{key:u.companyCode,value:u.companyCode,label:u.companyName},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(M,{detail:y.value},null,8,["detail"])]),_:1}),l(s,{span:12},{default:o(()=>[l(n,{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934",prop:"companyNo"},{default:o(()=>[l(i,{style:{width:"100%"},placeholder:"\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934",disabled:"",modelValue:a.value.buyer,"onUpdate:modelValue":e[1]||(e[1]=u=>a.value.buyer=u)},{default:o(()=>[(d(!0),D(g,null,k(C(V),u=>(d(),f(r,{key:u.companyCode,value:u.companyCode,label:u.companyName},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),a.value.buyer?(d(),f(M,{key:0,detail:F.value},null,8,["detail"])):ne("v-if",!0)]),_:1}),l(s,{span:6},{default:o(()=>[l(n,{label:"\u53D1\u7968\u7C7B\u578B",prop:"invtype"},{default:o(()=>[l(i,{modelValue:a.value.invtype,"onUpdate:modelValue":e[2]||(e[2]=u=>a.value.invtype=u),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(()=>[(d(!0),D(g,null,k(x.value,u=>(d(),f(r,{key:u.value,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(n,{label:"\u7535\u5B50\u90AE\u7BB1",prop:"email"},{default:o(()=>[l(m,{modelValue:a.value.email,"onUpdate:modelValue":e[3]||(e[3]=u=>a.value.email=u),placeholder:"\u7535\u5B50\u90AE\u7BB1"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:18},{default:o(()=>[l(n,{label:"\u7533\u8BF7\u5907\u6CE8",prop:"exam_remark"},{default:o(()=>[l(m,{"w-full":"",modelValue:a.value.exam_remark,"onUpdate:modelValue":e[4]||(e[4]=u=>a.value.exam_remark=u),rows:5,type:"textarea",maxlength:"2000",placeholder:"\u7533\u8BF7\u5907\u6CE8","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:24},{default:o(()=>[l(n,{label:"\u53D1\u7968\u5907\u6CE8",prop:"remark"},{default:o(()=>[R("div",fe,[l(m,{"w-full":"",modelValue:a.value.remark,"onUpdate:modelValue":e[5]||(e[5]=u=>a.value.remark=u),rows:3,type:"textarea",maxlength:"2000","show-word-limit":"",placeholder:"\u53D1\u7968\u5907\u6CE8"},null,8,["modelValue"])])]),_:1})]),_:1}),l(s,{span:24},{default:o(()=>[l(n,{label:"\u8BA2\u5355\u5BF9\u8D26"},{default:o(()=>[l(pe,{ref_key:"chooseFormRef",ref:N,onGetBuyer:e[6]||(e[6]=u=>Q(u)),platformType:a.value.platform_type},null,8,["platformType"])]),_:1})]),_:1}),R("div",_e,[l(b,{type:"primary",size:"",onClick:W},{default:o(()=>[re("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model","rules"])),[[w,C(B)]])])}}});var xe=X(ye,[["__scopeId","data-v-755d9d29"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/invoiceApply/components/form-copy/add-edit-form.vue"]]);export{xe as default};
|