1 |
- import{_ as de,d as pe,E as d,a5 as ce,A as me,aC as ve,a7 as _e,H as fe,x as m,aA as he,o as h,c as B,O as U,N as g,K as o,y as e,L as j,M as $,u as f,aD as ye,b as A,W as y,T as D,R as M,P as we,aE as be,aS as F,$ as Ce,a0 as De}from"./index.1417328f.js";import{e as Fe,f as ke}from"./index.cc00443d.js";import{h as Ee}from"./index.0d44f987.js";import Be from"./order-dialog.a2b698d4.js";import ge from"./edit-order.4ff54a03.js";import P from"./invoice-title.407de326.js";import{convertInvoiceTitleData as z,convertInvoiceTitle as Ae}from"./columns.db7de4f0.js";import{A as xe}from"./configs.f20f2935.js";import{d as Ne}from"./status.727086c1.js";import"./use-page-search.7e7b4728.js";import"./inv-open.516190c3.js";import"./tootip.8c37fa8a.js";import"./basic-descriptions.cadaf928.js";const Ie=w=>(Ce("data-v-9bdd5bf4"),w=w(),De(),w),Ve={class:"addEditForm"},Se={flex:"","justify-between":"","w-full":"","mb-2":""},Re=y("\u6DFB\u52A0"),Te=Ie(()=>A("span",null,"\u64CD\u4F5C",-1)),Oe={"w-full":""},qe=y("\u4FDD\u5B58"),Le=pe({__name:"add-edit-form",setup(w){const H=d("order"),{companyList:K}=ce(),{push:W}=me(),x=d(null),N=d(null),I=d(null),v=d({}),V=ve(),S=d(!1),c=d([]),R=d(0),b=150,u=d({...{companyNo:"",buy_id:"",invtype:"",email:"",remark:"",exam_remark:"",orderArr:[],companyType:"01"}}),T=d([]),O=_e({...xe});function Y(t,l){N.value.onDisplay({row:l})}function G({row:t,inv_fee:l,num:n}){v.value[t.sequenceNo]={inv_fee:l,num:n}}const J=(t,l)=>{const n=l===c.value.length-1;if(c.value.length===1)return u.value.remark=u.value.remark.split(t).join("");u.value.remark=u.value.remark.split(n?";"+t:t+";").join("")},Q=t=>{const{sequenceNo:l,poCode:n}=c.value[t];J(n,t),delete v.value[l],c.value.splice(t,1)};function q(){return{orderArr:Object.keys(v.value).map(n=>{const{inv_fee:i,num:r}=v.value[n];return{sequenceNo:n,inv_fee:i,num:r}})}}function X(){I.value.validate(async t=>{if(!t)return;if(u.value.remark.length>184)return F.error("\u53D1\u7968\u5907\u6CE8\u4E0D\u80FD\u8D85\u8FC7184\u4E2A\u5B57\u7B26");if(c.value.length>b)return F.error(`\u8BA2\u5355\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7${b}\u4E2A`);const{orderArr:l}=q();if(l.reduce((s,{inv_fee:_})=>s+Number(_),0)>R.value)return F.error("\u8BA2\u5355\u603B\u91D1\u989D\u8D85\u8FC7\u6700\u5927\u5F00\u7968\u9762\u989D");const{code:i,message:r}=await ke({relaComNo:u.value.companyNo,...u.value,...q()});V({code:i,message:r,handler:()=>W("/InvoiceSales/invoiceApply")})})}function Z(){const{invtype:t}=u.value;O.email[0].required=t==="special_electronic"||t==="electronic"}function ee(){if(!u.value.companyNo)return F.warning("\u8BF7\u9009\u62E9\u9500\u552E\u516C\u53F8\u62AC\u5934");x.value.show(u.value.companyNo)}function le(t){u.value.remark="",t.forEach((l,n)=>{const{sequenceNo:i,winv_fee:r,winv_num:s,poCode:_}=l;v.value[i]||(v.value[i]={inv_fee:r,num:s},c.value.push(l),u.value.remark+=n===0?_:";"+_)})}const k=d({}),E=d({});function L(t,l){if(!l)return t?k.value={}:E.value={};if(t){const{invoiceType:n,denomination:i}=l;R.value=Number(i)*1e4;const r=n.split(",");u.value.invtype="",T.value=Ne.filter(({value:s})=>r.includes(s))}t?k.value=z(Ae(l)):E.value=z(l)}const ue=L.bind(null,!0),ae=L.bind(null,!1);async function oe(t){const{code:l,data:n,message:i}=await Ee({companyNo:t});V({code:l,message:i,handler:()=>ue(n.list[0])})}return fe(()=>u.value.companyNo,()=>{u.value.remark="",c.value=[],v.value={}}),(t,l)=>{const n=m("el-option"),i=m("el-select"),r=m("el-form-item"),s=m("el-col"),_=m("el-input"),te=m("el-tag"),C=m("el-button"),p=m("el-table-column"),ne=m("el-table"),re=m("el-row"),ie=he("loading");return h(),B("div",Ve,[U((h(),g(f(be),{ref_key:"formRef",ref:I,model:u.value,rules:O,"label-width":"100px","status-icon":"",size:"small"},{default:o(()=>[e(re,null,{default:o(()=>[e(s,{span:12},{default:o(()=>[e(r,{label:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",prop:"companyNo","label-width":"135px"},{default:o(()=>[e(i,{style:{width:"100%"},placeholder:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",modelValue:u.value.companyNo,"onUpdate:modelValue":l[0]||(l[0]=a=>u.value.companyNo=a),onChange:oe},{default:o(()=>[(h(!0),B(j,null,$(f(K),a=>(h(),g(n,{key:a.companyNo,value:a.companyNo,label:a.companyName},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(P,{detail:k.value},null,8,["detail"])]),_:1}),e(s,{span:12},{default:o(()=>[e(r,{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934",prop:"buy_id","label-width":"135px"},{default:o(()=>[e(f(ye),{"is-root":"",value:u.value.buy_id,"onUpdate:value":l[1]||(l[1]=a=>u.value.buy_id=a),api:f(Fe),style:{width:"100%"},placeholder:"\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934","request-prop":"name","response-label-prop":"invoice_title","response-val-prop":"id",onItemChange:f(ae)},null,8,["value","api","onItemChange"])]),_:1}),e(P,{detail:E.value},null,8,["detail"])]),_:1}),e(s,{span:6},{default:o(()=>[e(r,{"label-width":"100px",label:"\u53D1\u7968\u7C7B\u578B",prop:"invtype"},{default:o(()=>[e(i,{modelValue:u.value.invtype,"onUpdate:modelValue":l[2]||(l[2]=a=>u.value.invtype=a),style:{width:"100%"},onChange:Z,placeholder:"\u53D1\u7968\u7C7B\u578B","no-data-text":"\u8BF7\u9009\u62E9\u5176\u4ED6\u9500\u552E\u65B9\u516C\u53F8"},{default:o(()=>[(h(!0),B(j,null,$(T.value,a=>(h(),g(n,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(r,{"label-width":"100px",label:"\u7535\u5B50\u90AE\u7BB1",prop:"email"},{default:o(()=>[e(_,{modelValue:u.value.email,"onUpdate:modelValue":l[3]||(l[3]=a=>u.value.email=a),placeholder:"\u7535\u5B50\u90AE\u7BB1"},null,8,["modelValue"])]),_:1})]),_:1}),e(s,{span:18},{default:o(()=>[e(r,{label:"\u7533\u8BF7\u5907\u6CE8",prop:"exam_remark","label-width":"135px"},{default:o(()=>[e(_,{"w-full":"",modelValue:u.value.exam_remark,"onUpdate:modelValue":l[4]||(l[4]=a=>u.value.exam_remark=a),rows:3,type:"textarea",maxlength:"2000",placeholder:"\u7533\u8BF7\u5907\u6CE8","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1}),U(e(s,{span:24},{default:o(()=>[e(r,{label:"\u8BA2\u5355\u5217\u8868"},{default:o(()=>[A("div",Se,[e(te,{type:c.value.length>b?"danger":"info"},{default:o(()=>[y(D(c.value.length)+" / "+D(b),1)]),_:1},8,["type"]),e(C,{type:"primary",onClick:ee},{default:o(()=>[Re]),_:1})]),e(ne,{data:c.value,stripe:"",border:"","max-height":"300"},{default:o(()=>[e(p,{prop:"sequenceNo",label:"\u9500\u552E\u8BA2\u5355\u7F16\u53F7",width:"200"}),e(p,{prop:"poCode",label:"\u5E73\u53F0\u8BA2\u5355\u53F7","show-overflow-tooltip":"",width:"200"}),e(p,{prop:"workCode",label:"\u5176\u4ED6\u7F16\u53F7","show-overflow-tooltip":"",width:"200"}),e(p,{prop:"customerNo",label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u7F16\u53F7",width:"200"}),e(p,{prop:"customerName",label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0","show-overflow-tooltip":"",width:"200"}),e(p,{prop:"winv_num",label:"\u672A\u5F00\u7968\u6570\u91CF",width:"120"}),e(p,{prop:"winv_fee",label:"\u672A\u5F00\u7968\u91D1\u989D",width:"120"}),e(p,{label:"\u5F00\u7968\u91D1\u989D",width:"110"},{default:o(({row:a})=>[y(D(v.value[a.sequenceNo].inv_fee),1)]),_:1}),e(p,{label:"\u5F00\u7968\u6570\u91CF"},{default:o(({row:a})=>[y(D(v.value[a.sequenceNo].num),1)]),_:1}),e(p,{label:"\u4E1A\u52A1\u5458",prop:"ownerName",width:"80"}),e(p,{fixed:"right",width:"70"},{header:o(()=>[Te]),default:o(a=>[e(C,{size:"small",type:"primary",link:"",icon:f(M)("edits"),onClick:se=>Y(a.$index,a.row)},null,8,["icon","onClick"]),e(C,{size:"small",type:"danger",link:"",icon:f(M)("delete"),onClick:se=>Q(a.$index)},null,8,["icon","onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},512),[[we,H.value==="order"]]),e(s,{span:24},{default:o(()=>[e(r,{label:"\u53D1\u7968\u5907\u6CE8",prop:"remark"},{default:o(()=>[A("div",Oe,[e(_,{"w-full":"",modelValue:u.value.remark,"onUpdate:modelValue":l[5]||(l[5]=a=>u.value.remark=a),rows:3,type:"textarea",maxlength:"2000","show-word-limit":"",placeholder:"\u53D1\u7968\u5907\u6CE8"},null,8,["modelValue"])])]),_:1})]),_:1}),e(s,{span:24,flex:"","justify-end":""},{default:o(()=>[e(C,{loading:S.value,type:"primary",onClick:X},{default:o(()=>[qe]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["model","rules"])),[[ie,S.value]]),e(Be,{ref_key:"modelRef",ref:x,onSaveBtnClick:le},null,512),e(ge,{ref_key:"editOrderRef",ref:N,onSaveBtnClick:G},null,512)])}}});var Ze=de(Le,[["__scopeId","data-v-9bdd5bf4"],["__file","/Users/apple/Desktop/Company Projects/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/components/add-edit-form/add-edit-form.vue"]]);export{Ze as default};
|