1 |
- import{_ as Ce,d as be,x as p,W as G,p as Fe,aO as De,Z as Be,A as Q,y as Ee,b4 as ke,r as m,aD as ge,o as _,c as N,H as Z,G as b,D as t,l as e,F as T,E as O,m as h,a as Ae,h as x,M as f,L as w,bP as Ne,J,K as xe,aQ as Ve,aZ as C,cH as Ie,bL as Se,z as Re,Q as Te,R as Oe}from"./index.js";import{h as K}from"./index.684ecd6b.js";import ze from"./order-dialog.729139.js";import Ue from"./edit-order.bded52.js";import W from"./invoice-title.2e64c3.js";import{convertInvoiceTitleData as Y,convertInvoiceTitle as X}from"./columns.88d730.js";import{A as Le}from"./configs.55e4fd8d.js";import"./search-check.7fc4c9.js";import"./inv-open.a495ad22.js";import"./search-batch.e603de.js";import"./search-batch-main.ca505f.js";const je=F=>(Te("data-v-21656682"),F=F(),Oe(),F),qe={class:"addEditForm"},Me={flex:"","justify-between":"","w-full":"","mb-2":""},Pe={class:"flex"},$e=je(()=>x("span",null,"\u64CD\u4F5C",-1)),He={"w-full":""},Ge=be({__name:"add-edit-form",setup(F){const ee=p("order"),{companyList:z}=G(),{push:le}=Fe(),U=p(null),L=p(null),D=p(null),c=p({}),V=De(),j=p(!1),v=p([]),{currentCompany:ue}=G(),q=p(0),B=150,oe={companyNo:"",buyNo:"",invtype:"",email:"",remark:"",exam_remark:"",orderArr:[],companyType:"01",platform_type:""},M=p([]),a=p({...oe}),P=Be({...Le});function ae(o,l){L.value.onDisplay({row:l})}function te({row:o,inv_fee:l,num:n}){c.value[o.sequenceNo]={num:n,inv_fee:l,platform_type:o.platform_type}}const ne=(o,l)=>{const n=l===v.value.length-1;if(v.value.length===1)return a.value.remark=a.value.remark.split(o).join("");a.value.remark=a.value.remark.split(n?";"+o:o+";").join("")},re=o=>{const{sequenceNo:l,poCode:n}=v.value[o];ne(n,o),delete c.value[l],v.value.splice(o,1)};function $(){return{orderArr:Object.keys(c.value).map(n=>{const{inv_fee:r,num:i,platform_type:s}=c.value[n];return{platform_type:s,sequenceNo:n,inv_fee:r,num:i}})}}function ie(){D.value.validate(async o=>{if(!o)return;if(a.value.remark.length>184)return C.error("\u53D1\u7968\u5907\u6CE8\u4E0D\u80FD\u8D85\u8FC7184\u4E2A\u5B57\u7B26");if(v.value.length>B)return C.error(`\u8BA2\u5355\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7${B}\u4E2A`);const{orderArr:l}=$(),n=l.reduce((s,{inv_fee:y})=>s+Number(y),0);if(a.value.invtype==="fully_digitalized_special_electronic"||a.value.invtype==="fully_digitalized_normal_electronic"){if(n>1e3*1e4)return C.error("\u8BA2\u5355\u603B\u91D1\u989D\u4E0D\u80FD\u8D85\u8FC71000\u4E07")}else if(n>q.value)return C.error("\u8BA2\u5355\u603B\u91D1\u989D\u8D85\u8FC7\u6700\u5927\u5F00\u7968\u9762\u989D");const{code:r,message:i}=await Ie({relaComNo:a.value.companyNo,...a.value,...$(),is_comon:"1"});V({code:r,message:i,handler:()=>le("/InvoiceSales/invoiceApply")})})}function se(){const{invtype:o}=a.value;P.email[0].required=o==="special_electronic"||o==="electronic"||o==="fully_digitalized_special_electronic"||o==="fully_digitalized_normal_electronic"}function de(){const{companyNo:o,buyNo:l,platform_type:n}=a.value;if(!o||!l)return C.warning("\u8BF7\u9009\u62E9\u9500\u552E\u516C\u53F8\u62AC\u5934\u548C\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934");if(!n)return C.warning("\u8BF7\u9009\u62E9\u5E73\u53F0\u7C7B\u578B");U.value.show(o,n)}function pe(o){a.value.remark="",o.forEach((l,n)=>{const{sequenceNo:r,platform_type:i,winv_fee:s,winv_num:y,poCode:k}=l;c.value[r]||(c.value[r]={inv_fee:s,num:y,platform_type:i},v.value.push(l),a.value.remark+=n===0?k:";"+k)})}const I=p({}),S=p({});function H(o,l){if(!l)return o?I.value={}:S.value={};if(o){const{invoiceType:n,denomination:r}=l;q.value=Number(r)*1e4;const i=n.split(",");a.value.invtype="",M.value=Se.filter(({value:s})=>i.includes(s))}o?I.value=Y(X(l)):S.value=Y(X(l))}const ce=H.bind(null,!0),me=H.bind(null,!1);async function ve(o){a.value.companyNo=o;const{code:l,data:n,message:r}=await K({companyNo:o});Re(()=>{D.value&&D.value.validateField("companyNo")}),V({code:l,message:r,handler:()=>ce(n.list[0])})}Q(()=>a.value.platform_type,()=>{a.value.remark="",v.value=[],c.value={}},{immediate:!0});async function _e(o){const{code:l,data:n,message:r}=await K({noRela:!0,size:1e3});V({code:l,message:r,handler:()=>{const i=n.list.find(({companyNo:s})=>s===o);me(i||{})}})}Ee(async()=>{await ve(ue.value.companyNo),a.value.buyNo="GS2404151642335170",_e("GS2404151642335170")});const E=p("0.00");return Q(()=>c.value,o=>{E.value="0.00",Object.keys(c.value).map(n=>{const{inv_fee:r}=c.value[n];E.value=Number(ke(E.value,r)).toFixed(2)})},{deep:!0}),(o,l)=>{const n=m("el-option"),r=m("el-select"),i=m("el-form-item"),s=m("el-col"),y=m("el-input"),k=m("el-switch"),R=m("el-tag"),g=m("el-button"),d=m("el-table-column"),fe=m("el-table"),ye=m("el-row"),we=ge("loading");return _(),N("div",qe,[Z((_(),b(h(Ve),{ref_key:"formRef",ref:D,model:a.value,rules:P,"status-icon":"",size:"small"},{default:t(()=>[e(ye,null,{default:t(()=>[e(s,{span:12},{default:t(()=>[e(i,{label:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",prop:"companyNo"},{default:t(()=>[e(r,{style:{width:"100%"},placeholder:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",disabled:"",modelValue:a.value.companyNo,"onUpdate:modelValue":l[0]||(l[0]=u=>a.value.companyNo=u)},{default:t(()=>[(_(!0),N(T,null,O(h(z),u=>(_(),b(n,{key:u.companyCode,value:u.companyCode,label:u.companyName},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(W,{detail:I.value},null,8,["detail"])]),_:1}),e(s,{span:12},{default:t(()=>[e(i,{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934",prop:"companyNo"},{default:t(()=>[e(r,{style:{width:"100%"},placeholder:"\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934",modelValue:a.value.buyNo,"onUpdate:modelValue":l[1]||(l[1]=u=>a.value.buyNo=u),disabled:""},{default:t(()=>[(_(!0),N(T,null,O(h(z),u=>(_(),b(n,{key:u.companyCode,value:u.companyCode,label:u.companyName},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),a.value.buyNo?(_(),b(W,{key:0,detail:S.value},null,8,["detail"])):Ae("v-if",!0)]),_:1}),e(s,{span:6},{default:t(()=>[e(i,{label:"\u53D1\u7968\u7C7B\u578B",prop:"invtype"},{default:t(()=>[e(r,{modelValue:a.value.invtype,"onUpdate:modelValue":l[2]||(l[2]=u=>a.value.invtype=u),style:{width:"100%"},onChange:se,placeholder:"\u53D1\u7968\u7C7B\u578B","no-data-text":"\u8BF7\u9009\u62E9\u5176\u4ED6\u9500\u552E\u65B9\u516C\u53F8"},{default:t(()=>[(_(!0),N(T,null,O(M.value,u=>(_(),b(n,{key:u.value,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(i,{label:"\u7535\u5B50\u90AE\u7BB1",prop:"email"},{default:t(()=>[e(y,{modelValue:a.value.email,"onUpdate:modelValue":l[3]||(l[3]=u=>a.value.email=u),placeholder:"\u7535\u5B50\u90AE\u7BB1"},null,8,["modelValue"])]),_:1}),e(i,{label:"\u5E73\u53F0\u7C7B\u578B",prop:"platform_type"},{default:t(()=>[e(k,{modelValue:a.value.platform_type,"onUpdate:modelValue":l[4]||(l[4]=u=>a.value.platform_type=u),size:"small","active-text":"toC","inactive-text":"toB","active-value":"2","inactive-value":"1"},null,8,["modelValue"])]),_:1})]),_:1}),e(s,{span:18},{default:t(()=>[e(i,{label:"\u7533\u8BF7\u5907\u6CE8",prop:"exam_remark"},{default:t(()=>[e(y,{"w-full":"",modelValue:a.value.exam_remark,"onUpdate:modelValue":l[5]||(l[5]=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}),Z(e(s,{span:24},{default:t(()=>[e(i,{label:"\u8BA2\u5355\u5217\u8868"},{default:t(()=>[x("div",Me,[x("div",Pe,[e(R,{type:v.value.length>B?"danger":"info"},{default:t(()=>[f(w(v.value.length)+" / "+w(B),1)]),_:1},8,["type"]),e(R,{style:{"margin-left":"10px"},type:"primary",size:"small"},{default:t(()=>[f(w(E.value)+"\u5143",1)]),_:1})]),e(g,{type:"primary",onClick:de},{default:t(()=>[f("\u6DFB\u52A0")]),_:1})]),e(fe,{data:v.value,stripe:"",border:"","max-height":"300"},{default:t(()=>[e(d,{prop:"sequenceNo",label:"\u9500\u552E\u8BA2\u5355\u7F16\u7801","show-overflow-tooltip":"",width:"150"}),e(d,{prop:"cxCode",label:"\u9500\u552E\u8BA2\u5355\u4E3B\u7F16\u7801","show-overflow-tooltip":"",width:"150"}),e(d,{prop:"poCode",label:"\u5E73\u53F0\u8BA2\u5355\u7F16\u7801","show-overflow-tooltip":"",width:"150"}),e(d,{prop:"customerNo",label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u7F16\u7801",width:"150","show-overflow-tooltip":""}),e(d,{prop:"customerName",label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0","show-overflow-tooltip":"",width:"200"}),e(d,{prop:"plat_pay_fee",label:"\u5E73\u53F0\u516C\u53F8\u5DF2\u56DE\u6B3E","show-overflow-tooltip":"",width:"110"}),e(d,{prop:"inv_cat_code",label:"\u7C7B\u76EE\u7F16\u7801","show-overflow-tooltip":"",width:"110"}),e(d,{prop:"inv_cat_name",label:"\u8D27\u7269\u548C\u52B3\u52A1\u540D\u79F0","show-overflow-tooltip":"",width:"110"}),e(d,{prop:"inv_good_name",label:"\u5F00\u7968\u5546\u54C1\u540D\u79F0","show-overflow-tooltip":"",width:"110"}),e(d,{prop:"inv_tax",label:"\u5F00\u7968\u7A0E\u7387","show-overflow-tooltip":"",width:"80"},{default:t(({row:u})=>[f(w(u.inv_tax?Number(u.inv_tax)*100+"%":""),1)]),_:1}),e(d,{prop:"winv_num",label:"\u672A\u5F00\u7968\u6570\u91CF","show-overflow-tooltip":"",width:"110"}),e(d,{prop:"winv_fee",label:"\u672A\u5F00\u7968\u91D1\u989D","show-overflow-tooltip":"",width:"110"}),e(d,{label:"\u5E73\u53F0\u7C7B\u578B",width:"110","show-overflow-tooltip":""},{default:t(({row:u})=>[e(R,{size:"small"},{default:t(()=>{var A;return[f(w((A=h(Ne).find(he=>he.value===String(u.platform_type)))==null?void 0:A.label),1)]}),_:2},1024)]),_:1}),e(d,{label:"\u5F00\u7968\u91D1\u989D",width:"110","show-overflow-tooltip":""},{default:t(({row:u})=>[f(w(c.value[u.sequenceNo].inv_fee),1)]),_:1}),e(d,{label:"\u5F00\u7968\u6570\u91CF","show-overflow-tooltip":""},{default:t(({row:u})=>[f(w(c.value[u.sequenceNo].num),1)]),_:1}),e(d,{label:"\u4E1A\u52A1\u5458","show-overflow-tooltip":"",prop:"ownerName",width:"80"}),e(d,{fixed:"right",width:"70"},{header:t(()=>[$e]),default:t(u=>[e(g,{size:"small",type:"primary",link:"",icon:h(J)("edits"),onClick:A=>ae(u.$index,u.row)},null,8,["icon","onClick"]),e(g,{size:"small",type:"danger",link:"",icon:h(J)("delete"),onClick:A=>re(u.$index)},null,8,["icon","onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},512),[[xe,ee.value==="order"]]),e(s,{span:24},{default:t(()=>[e(i,{label:"\u53D1\u7968\u5907\u6CE8",prop:"remark"},{default:t(()=>[x("div",He,[e(y,{"w-full":"",modelValue:a.value.remark,"onUpdate:modelValue":l[6]||(l[6]=u=>a.value.remark=u),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:t(()=>[e(g,{loading:j.value,type:"primary",onClick:ie},{default:t(()=>[f("\u4FDD\u5B58")]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["model","rules"])),[[we,j.value]]),e(ze,{ref_key:"modelRef",ref:U,onSaveBtnClick:pe},null,512),e(Ue,{ref_key:"editOrderRef",ref:L,onSaveBtnClick:te},null,512)])}}});var al=Ce(Ge,[["__scopeId","data-v-21656682"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/invoiceApply/components/currentcy-form/add-edit-form.vue"]]);export{al as default};
|