123456789101112 |
- import{_ as ve,d as fe,w as d,W as M,n as _e,aO as ye,Z as he,z as we,x as Ce,r as m,aC as be,o as y,c as A,H as $,G as N,C as a,l as e,F as H,D as P,u as f,aQ as Fe,a as Be,b as V,M as h,L as w,J as Q,K as De,aR as Ee,aY as C,y as ke,Q as ge,R as xe}from"./index.fd765376.js";import{e as Ae,f as Ne}from"./index.d7755e1d.js";import{h as Ve}from"./index.2e55525b.js";import Ie from"./order-dialog.d9fd7180.js";import Re from"./edit-order.3326dbbb.js";import Y from"./invoice-title.b4b4e689.js";import{convertInvoiceTitleData as G,convertInvoiceTitle as Se}from"./columns.d2933744.js";import{A as Te}from"./configs.8facc263.js";import{u as Oe,f as Ue}from"./status.0f05917e.js";import"./search-check.545ceb76.js";import"./use-page-search.414f397e.js";import"./inv-open.d2f403b6.js";import"./tootip.99c35844.js";import"./search-batch.661d69b5.js";import"./basic-descriptions.6db97105.js";const qe=b=>(ge("data-v-9bdd5bf4"),b=b(),xe(),b),Le={class:"addEditForm"},je={flex:"","justify-between":"","w-full":"","mb-2":""},ze=qe(()=>V("span",null,"\u64CD\u4F5C",-1)),Me={"w-full":""},$e=fe({__name:"add-edit-form",setup(b){const J=d("order"),{companyList:K}=M(),{push:W}=_e(),I=d(null),R=d(null),F=d(null),v=d({}),S=ye(),T=d(!1),c=d([]),{currentCompany:Z}=M(),O=d(0),B=150,u=d({...{companyNo:"",buy_id:"",invtype:"",email:"",remark:"",exam_remark:"",orderArr:[],companyType:"01",platform_type:""}}),U=d([]),q=he({...Te});function X(t,l){R.value.onDisplay({row:l})}function ee({row:t,inv_fee:l,num:n}){v.value[t.sequenceNo]={inv_fee:l,num:n,platform_type:t.platform_type}}const le=(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("")},oe=t=>{const{sequenceNo:l,poCode:n}=c.value[t];le(n,t),delete v.value[l],c.value.splice(t,1)};function L(){return{orderArr:Object.keys(v.value).map(n=>{const{inv_fee:s,num:r,platform_type:i}=v.value[n];return{platform_type:i,sequenceNo:n,inv_fee:s,num:r}})}}function ue(){F.value.validate(async t=>{if(!t)return;if(u.value.remark.length>184)return C.error("\u53D1\u7968\u5907\u6CE8\u4E0D\u80FD\u8D85\u8FC7184\u4E2A\u5B57\u7B26");if(c.value.length>B)return C.error(`\u8BA2\u5355\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7${B}\u4E2A`);const{orderArr:l}=L();if(l.reduce((i,{inv_fee:_})=>i+Number(_),0)>O.value)return C.error("\u8BA2\u5355\u603B\u91D1\u989D\u8D85\u8FC7\u6700\u5927\u5F00\u7968\u9762\u989D");const{code:s,message:r}=await Ne({relaComNo:u.value.companyNo,...u.value,...L()});S({code:s,message:r,handler:()=>W("/InvoiceSales/invoiceApply")})})}function te(){const{invtype:t}=u.value;q.email[0].required=t==="special_electronic"||t==="electronic"}function ae(){const{companyNo:t,platform_type:l}=u.value;if(!t)return C.warning("\u8BF7\u9009\u62E9\u9500\u552E\u516C\u53F8\u62AC\u5934");if(!l)return C.warning("\u8BF7\u9009\u62E9\u5E73\u53F0\u7C7B\u578B");I.value.show(t,l)}function ne(t){u.value.remark="",t.forEach((l,n)=>{const{sequenceNo:s,platform_type:r,winv_fee:i,winv_num:_,poCode:D}=l;v.value[s]||(v.value[s]={inv_fee:i,num:_,platform_type:r},c.value.push(l),u.value.remark+=n===0?D:";"+D)})}const g=d({}),x=d({});function j(t,l){if(!l)return t?g.value={}:x.value={};if(t){const{invoiceType:n,denomination:s}=l;O.value=Number(s)*1e4;const r=n.split(",");u.value.invtype="",U.value=Ue.filter(({value:i})=>r.includes(i))}t?g.value=G(Se(l)):x.value=G(l)}const re=j.bind(null,!0),ie=j.bind(null,!1);async function se(t){u.value.companyNo=t;const{code:l,data:n,message:s}=await Ve({companyNo:t});ke(()=>{F.value&&F.value.validateField("companyNo")}),S({code:l,message:s,handler:()=>re(n.list[0])})}return we(()=>u.value.platform_type,()=>{u.value.remark="",c.value=[],v.value={}},{immediate:!0}),Ce(()=>{se(Z.value.companyNo)}),(t,l)=>{const n=m("el-option"),s=m("el-select"),r=m("el-form-item"),i=m("el-col"),_=m("el-input"),D=m("el-switch"),z=m("el-tag"),E=m("el-button"),p=m("el-table-column"),de=m("el-table"),pe=m("el-row"),me=be("loading");return y(),A("div",Le,[$((y(),N(f(Ee),{ref_key:"formRef",ref:F,model:u.value,rules:q,"label-width":"100px","status-icon":"",size:"small"},{default:a(()=>[e(pe,null,{default:a(()=>[e(i,{span:12},{default:a(()=>[e(r,{label:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",prop:"companyNo","label-width":"135px"},{default:a(()=>[e(s,{style:{width:"100%"},placeholder:"\u9500\u552E\u65B9\u516C\u53F8\u62AC\u5934",disabled:"",modelValue:u.value.companyNo,"onUpdate:modelValue":l[0]||(l[0]=o=>u.value.companyNo=o)},{default:a(()=>[(y(!0),A(H,null,P(f(K),o=>(y(),N(n,{key:o.companyCode,value:o.companyCode,label:o.companyName},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(Y,{detail:g.value},null,8,["detail"])]),_:1}),e(i,{span:12},{default:a(()=>[e(r,{label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u62AC\u5934",prop:"buy_id","label-width":"135px"},{default:a(()=>[e(f(Fe),{"is-root":"",value:u.value.buy_id,"onUpdate:value":l[1]||(l[1]=o=>u.value.buy_id=o),api:f(Ae),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(ie)},null,8,["value","api","onItemChange"])]),_:1}),e(Y,{detail:x.value},null,8,["detail"])]),_:1}),e(i,{span:6},{default:a(()=>[e(r,{"label-width":"100px",label:"\u53D1\u7968\u7C7B\u578B",prop:"invtype"},{default:a(()=>[e(s,{modelValue:u.value.invtype,"onUpdate:modelValue":l[2]||(l[2]=o=>u.value.invtype=o),style:{width:"100%"},onChange:te,placeholder:"\u53D1\u7968\u7C7B\u578B","no-data-text":"\u8BF7\u9009\u62E9\u5176\u4ED6\u9500\u552E\u65B9\u516C\u53F8"},{default:a(()=>[(y(!0),A(H,null,P(U.value,o=>(y(),N(n,{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(r,{"label-width":"100px",label:"\u7535\u5B50\u90AE\u7BB1",prop:"email"},{default:a(()=>[e(_,{modelValue:u.value.email,"onUpdate:modelValue":l[3]||(l[3]=o=>u.value.email=o),placeholder:"\u7535\u5B50\u90AE\u7BB1"},null,8,["modelValue"])]),_:1}),e(r,{"label-width":"100px",label:"\u5E73\u53F0\u7C7B\u578B",prop:"platform_type"},{default:a(()=>[e(D,{modelValue:u.value.platform_type,"onUpdate:modelValue":l[4]||(l[4]=o=>u.value.platform_type=o),size:"small","active-text":"toC","inactive-text":"toB","active-value":"2","inactive-value":"1"},null,8,["modelValue"]),Be(` <el-select\r
- v-model="ruleForm.platform_type"\r
- style="width: 100%"\r
- placeholder="\u5E73\u53F0\u7C7B\u578B"\r
- >\r
- <el-option\r
- v-for="option in useTypeOptions"\r
- :key="option.value"\r
- :label="option.label"\r
- :value="option.value"\r
- />\r
- </el-select> `)]),_:1})]),_:1}),e(i,{span:18},{default:a(()=>[e(r,{label:"\u7533\u8BF7\u5907\u6CE8",prop:"exam_remark","label-width":"135px"},{default:a(()=>[e(_,{"w-full":"",modelValue:u.value.exam_remark,"onUpdate:modelValue":l[5]||(l[5]=o=>u.value.exam_remark=o),rows:5,type:"textarea",maxlength:"2000",placeholder:"\u7533\u8BF7\u5907\u6CE8","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1}),$(e(i,{span:24},{default:a(()=>[e(r,{label:"\u8BA2\u5355\u5217\u8868"},{default:a(()=>[V("div",je,[e(z,{type:c.value.length>B?"danger":"info"},{default:a(()=>[h(w(c.value.length)+" / "+w(B),1)]),_:1},8,["type"]),e(E,{type:"primary",onClick:ae},{default:a(()=>[h("\u6DFB\u52A0")]),_:1})]),e(de,{data:c.value,stripe:"",border:"","max-height":"300"},{default:a(()=>[e(p,{prop:"sequenceNo",label:"\u9500\u552E\u8BA2\u5355\u7F16\u7801","show-overflow-tooltip":"",width:"150"}),e(p,{prop:"poCode",label:"\u5E73\u53F0\u8BA2\u5355\u7F16\u7801","show-overflow-tooltip":"",width:"150"}),e(p,{prop:"customerNo",label:"\u8D2D\u4E70\u65B9\u516C\u53F8\u7F16\u7801",width:"150","show-overflow-tooltip":""}),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","show-overflow-tooltip":"",width:"110"}),e(p,{prop:"winv_fee",label:"\u672A\u5F00\u7968\u91D1\u989D","show-overflow-tooltip":"",width:"110"}),e(p,{label:"\u5E73\u53F0\u7C7B\u578B",width:"110","show-overflow-tooltip":""},{default:a(({row:o})=>[e(z,{size:"small"},{default:a(()=>{var k;return[h(w((k=f(Oe).find(ce=>ce.value===String(o.platform_type)))==null?void 0:k.label),1)]}),_:2},1024)]),_:1}),e(p,{label:"\u5F00\u7968\u91D1\u989D",width:"110","show-overflow-tooltip":""},{default:a(({row:o})=>[h(w(v.value[o.sequenceNo].inv_fee),1)]),_:1}),e(p,{label:"\u5F00\u7968\u6570\u91CF","show-overflow-tooltip":""},{default:a(({row:o})=>[h(w(v.value[o.sequenceNo].num),1)]),_:1}),e(p,{label:"\u4E1A\u52A1\u5458","show-overflow-tooltip":"",prop:"ownerName",width:"80"}),e(p,{fixed:"right",width:"70"},{header:a(()=>[ze]),default:a(o=>[e(E,{size:"small",type:"primary",link:"",icon:f(Q)("edits"),onClick:k=>X(o.$index,o.row)},null,8,["icon","onClick"]),e(E,{size:"small",type:"danger",link:"",icon:f(Q)("delete"),onClick:k=>oe(o.$index)},null,8,["icon","onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},512),[[De,J.value==="order"]]),e(i,{span:24},{default:a(()=>[e(r,{label:"\u53D1\u7968\u5907\u6CE8",prop:"remark"},{default:a(()=>[V("div",Me,[e(_,{"w-full":"",modelValue:u.value.remark,"onUpdate:modelValue":l[6]||(l[6]=o=>u.value.remark=o),rows:3,type:"textarea",maxlength:"2000","show-word-limit":"",placeholder:"\u53D1\u7968\u5907\u6CE8"},null,8,["modelValue"])])]),_:1})]),_:1}),e(i,{span:24,flex:"","justify-end":""},{default:a(()=>[e(E,{loading:T.value,type:"primary",onClick:ue},{default:a(()=>[h("\u4FDD\u5B58")]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["model","rules"])),[[me,T.value]]),e(Ie,{ref_key:"modelRef",ref:I,onSaveBtnClick:ne},null,512),e(Re,{ref_key:"editOrderRef",ref:R,onSaveBtnClick:ee},null,512)])}}});var nl=ve($e,[["__scopeId","data-v-9bdd5bf4"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/components/add-edit-form/add-edit-form.vue"]]);export{nl as default};
|