12345678 |
- import{_ as j,d as M,ag as le,o as d,G as y,u as i,w as S,b3 as oe,Z as ce,x as pe,r as D,aC as te,c as I,l as e,C as l,F as L,D as ee,b as G,M as C,H,L as V,bo as se,a as F,aY as K,z as Y,aX as fe,aP as J,aW as me,aq as ve,bI as he,q as ye,al as we,bJ as ge,bK as ue,W as Ce,aQ as ae,bL as be,bM as Fe,bw as ne,aR as De}from"./index.56c69f5a.js";import{h as _e,a as Ee,b as Be,c as Ne}from"./index.2e257471.js";import{B as de}from"./basic-descriptions.5f176484.js";import{o as re}from"./orderRecord.9d7001b8.js";import"./porder.30193b2b.js";import{s as Q,c as X,d as Z,e as Se}from"./status.2df4810d.js";import{m as ke,d as Pe,a as W}from"./calc.850c7422.js";const xe=M({__name:"purchase-descriptions",props:{data:{type:Object,required:!0},showTicketColumn:{type:Boolean,required:!1},isPurchPay:{type:Boolean,required:!1}},setup(o){const z=o,E=["inv_tag_fee","inv_status","ainv_fee","winv_fee","inv_fee","remark"],w=le(()=>!z.isPurchPay||z.showTicketColumn?re:re.filter(b=>!E.includes(b.field)));return(b,g)=>(d(),y(i(de),{data:o.data,columns:i(w)},null,8,["data","columns"]))}});var qe=j(xe,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/ReconciliationForm/src/cpns/purchase-descriptions.vue"]]);const Ae={"w-full":"",flex:"","justify-between":""},Ve={flex:"","mt-2":"","justify-between":""},ze=M({__name:"single-mode",props:{supplierNo:{type:String,required:!1},companyNo:{type:String,required:!1}},emits:["selection"],setup(o,{emit:z}){const E=o,w=S(null),b=S([]),{data:g,loading:A,run:N}=oe({isList:!0,success:k=>f.total=k.count}),r=S({timer:[],sequenceNo:"",goodNo:"",goodName:"",cgder:"",cxCode:"",sendstatus:"",cgdsource:"",cgdtype:"",code:"",qrdCode:""}),f=ce({pageSize:15,currentPage:1,total:0});async function P(){A.value=!0;const{companyNo:k,supplierNo:a}=E,{currentPage:c,pageSize:p}=f,{timer:v,...m}=r.value,s={...m,start:v[0],end:v[1],is_comon:"0",status:"0",supplierNo:a,companyNo:k,page:c,size:p};N(_e(s))}function _(){f.currentPage=1,r.value={timer:[],sequenceNo:"",goodNo:"",goodName:"",cgder:"",cxCode:"",sendstatus:"",cgdsource:"",cgdtype:"",code:"",qrdCode:""},P()}function U(k){b.value=k}function O(){const k=b.value.filter(({totalPrice:a})=>Number(a)===0);if(k.length!==0){K.warning(`\u91C7\u8D2D\u5355${k.map(({sequenceNo:a})=>a).join("\u3001")}\u6DFB\u52A0\u5931\u8D25,\u603B\u8D27\u6B3E\u4E0D\u80FD\u4E3A0\u5143`);return}z("selection",i(b))}const $=()=>{f.currentPage=1,P()};return pe(()=>{P()}),(k,a)=>{const c=D("ElDatePicker"),p=D("ElCol"),v=D("ElInput"),m=D("ElRow"),s=D("ElOption"),T=D("ElSelect"),R=D("ElButton"),u=D("ElTableColumn"),t=D("ElTag"),h=D("ElPagination"),x=te("loading");return d(),I(L,null,[e(m,{gutter:5,"mb-1":""},{default:l(()=>[e(p,{span:6},{default:l(()=>[e(c,{size:"small",type:"daterange",modelValue:r.value.timer,"onUpdate:modelValue":a[0]||(a[0]=n=>r.value.timer=n),"start-placeholder":"\u5F00\u59CB\u65F6\u95F4","end-placeholder":"\u7ED3\u675F\u65F6\u95F4","value-format":"YYYY-MM-DD",style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e(p,{span:6},{default:l(()=>[e(v,{size:"small",placeholder:"\u91C7\u8D2D\u5355\u7F16\u7801",modelValue:r.value.sequenceNo,"onUpdate:modelValue":a[1]||(a[1]=n=>r.value.sequenceNo=n)},null,8,["modelValue"])]),_:1}),e(p,{span:6},{default:l(()=>[e(v,{size:"small",placeholder:"\u91C7\u8D2D\u4E3B\u5355\u7F16\u7801",modelValue:r.value.cxCode,"onUpdate:modelValue":a[2]||(a[2]=n=>r.value.cxCode=n)},null,8,["modelValue"])]),_:1}),e(p,{span:6},{default:l(()=>[e(v,{size:"small",placeholder:"\u9500\u552E\u8BA2\u5355\u7F16\u7801",modelValue:r.value.qrdCode,"onUpdate:modelValue":a[3]||(a[3]=n=>r.value.qrdCode=n)},null,8,["modelValue"])]),_:1})]),_:1}),e(m,{gutter:5,"mb-2":""},{default:l(()=>[e(p,{span:6},{default:l(()=>[e(v,{size:"small",placeholder:"\u5546\u54C1\u7F16\u7801",modelValue:r.value.goodNo,"onUpdate:modelValue":a[4]||(a[4]=n=>r.value.goodNo=n)},null,8,["modelValue"])]),_:1}),e(p,{span:6},{default:l(()=>[e(v,{size:"small",placeholder:"\u5546\u54C1\u540D\u79F0",modelValue:r.value.goodName,"onUpdate:modelValue":a[5]||(a[5]=n=>r.value.goodName=n)},null,8,["modelValue"])]),_:1}),e(p,{span:6},{default:l(()=>[e(v,{size:"small",placeholder:"\u91C7\u8D2D\u5458\u540D\u79F0",modelValue:r.value.cgder,"onUpdate:modelValue":a[6]||(a[6]=n=>r.value.cgder=n)},null,8,["modelValue"])]),_:1}),e(p,{span:6},{default:l(()=>[e(T,{placeholder:"\u53D1\u8D27\u72B6\u6001",modelValue:r.value.sendstatus,"onUpdate:modelValue":a[7]||(a[7]=n=>r.value.sendstatus=n),size:"small",clearable:"","w-full":""},{default:l(()=>[(d(!0),I(L,null,ee(i(Q),n=>(d(),y(s,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(m,{"mb-2":""},{default:l(()=>[G("div",Ae,[e(p,{span:12,style:{display:"flex",gap:"10px"}},{default:l(()=>[e(T,{modelValue:r.value.cgdsource,"onUpdate:modelValue":a[8]||(a[8]=n=>r.value.cgdsource=n),size:"small",placeholder:"\u8BA2\u5355\u6765\u6E90",clearable:"","w-full":""},{default:l(()=>[(d(!0),I(L,null,ee(i(X),n=>(d(),y(s,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e(T,{modelValue:r.value.cgdtype,"onUpdate:modelValue":a[9]||(a[9]=n=>r.value.cgdtype=n),size:"small","w-full":"",placeholder:"\u5546\u54C1\u6765\u6E90",clearable:""},{default:l(()=>[(d(!0),I(L,null,ee(i(Z),n=>(d(),y(s,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(p,{span:3},{default:l(()=>[e(R,{size:"small",onClick:P,type:"primary"},{default:l(()=>[C("\u641C\u7D22")]),_:1}),e(R,{size:"small",onClick:_},{default:l(()=>[C("\u91CD\u7F6E")]),_:1})]),_:1})])]),_:1}),H((d(),y(i(se),{ref_key:"tableRef",ref:w,size:"small",data:i(g),onSelectionChange:U,"max-height":"580px"},{default:l(()=>[e(u,{type:"selection",fixed:"left",align:"center",width:"40"}),e(u,{label:"\u91C7\u8D2D\u5355\u7F16\u7801",prop:"sequenceNo","show-overflow-tooltip":"",width:"150"}),e(u,{label:"\u9500\u552E\u8BA2\u5355\u7F16\u7801",prop:"qrdCode","show-overflow-tooltip":"",width:"150"}),e(u,{label:"\u91C7\u8D2D\u4E3B\u5355\u7F16\u7801",prop:"cxCode","show-overflow-tooltip":"",width:"150"}),e(u,{label:"\u91C7\u8D2D\u5355\u4FE1\u606F"},{default:l(()=>[e(u,{label:"\u4F9B\u8D27\u5546",prop:"supplierName",width:"160","show-overflow-tooltip":""}),e(u,{label:"\u652F\u4ED8\u65B9\u5F0F",prop:"pay_type",width:"85","show-overflow-tooltip":""}),e(u,{label:"\u53D1\u8D27\u72B6\u6001",prop:"sendStatus",width:"90","show-overflow-tooltip":""},{default:l(({row:n})=>[e(t,{size:"small"},{default:l(()=>{var q;return[C(V((q=i(Q).find(B=>B.value===String(n.sendStatus)))==null?void 0:q.label),1)]}),_:2},1024)]),_:1}),e(u,{label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyName",width:"180","show-overflow-tooltip":""}),e(u,{label:"\u8BA2\u5355\u6765\u6E90",prop:"cgdSource",width:"100","show-overflow-tooltip":""},{default:l(({row:n})=>[e(t,{size:"small"},{default:l(()=>{var q;return[C(V((q=i(X).find(B=>B.value===String(n.cgdSource)))==null?void 0:q.label),1)]}),_:2},1024)]),_:1}),e(u,{label:"\u603B\u8D27\u6B3E",prop:"totalPrice",width:"80","show-overflow-tooltip":""})]),_:1}),e(u,{label:"\u5546\u54C1\u4FE1\u606F"},{default:l(()=>[e(u,{label:"\u5546\u54C1\u7F16\u7801",prop:"goodNo",width:"150","show-overflow-tooltip":""}),e(u,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",width:"180","show-overflow-tooltip":""}),e(u,{label:"\u5546\u54C1\u6765\u6E90",prop:"cgdType",width:"90","show-overflow-tooltip":""},{default:l(({row:n})=>[e(t,{size:"small"},{default:l(()=>{var q;return[C(V((q=i(Z).find(B=>B.value===String(n.cgdType)))==null?void 0:q.label),1)]}),_:2},1024)]),_:1}),e(u,{label:"\u5546\u54C1\u6570\u91CF",prop:"goodNum",width:"90","show-overflow-tooltip":""})]),_:1}),e(u,{label:"\u91C7\u8D2D\u5458",prop:"ownerName",width:"70","show-overflow-tooltip":""})]),_:1},8,["data"])),[[x,i(A)]]),F(" \u5206\u9875\u5668 "),G("div",Ve,[e(h,{"current-page":f.currentPage,"onUpdate:currentPage":a[10]||(a[10]=n=>f.currentPage=n),"page-size":f.pageSize,"onUpdate:pageSize":a[11]||(a[11]=n=>f.pageSize=n),total:f.total,"page-sizes":[15,50,100],layout:"sizes, prev, pager, next",onCurrentChange:P,onSizeChange:a[12]||(a[12]=()=>$())},null,8,["current-page","page-size","total"]),e(R,{type:"primary",onClick:O},{default:l(()=>[C("\u4FDD\u5B58")]),_:1})])],64)}}});var Te=j(ze,[["__scopeId","data-v-c8e26204"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/ReconciliationForm/src/cpns/single-mode.vue"]]);const Re={flex:"","w-full":"","justify-end":"","mt-2":""},Ie=M({__name:"batch-mode",props:{supplierNo:{type:String,required:!1},companyNo:{type:String,required:!1},type:{type:String,required:!0}},emits:["selection"],setup(o,{emit:z}){const E=o,w=S(""),b=S(E.type),g=S(k(b.value)),A=S(null),{run:N,loading:r,data:f}=oe({success:a=>{}}),P=" ",_=`
- `;function U(a=""){if(!a)return"";let c=a;const p=c.includes(P),v=c.includes(_);return p&&(c=c.split(P).join("")),v&&(c=c.split(_).join("")),c}function O(){const a=U(w.value),c=a.replace(/[,。;、; .]/g,",").replace(/(^,*)|(,*$)/g,""),p=c.split(",");if(c.length===0||p.length===0){K.warning("\u4E0D\u80FD\u89E3\u6790\u7A7A\u6587\u672C"),w.value=a;return}N(Ee(b.value=="2"?{size:100,cgdNoArr:p,companyNo:E.companyNo,supplierNo:E.supplierNo,is_comon:"0"}:{size:100,qrdNoArr:p,companyNo:E.companyNo,supplierNo:E.supplierNo,is_comon:"0"})),w.value=""}function $(){const a=f.value.filter(({totalPrice:c})=>Number(c)===0);if(a.length!==0){K.warning(`\u91C7\u8D2D\u5355${a.map(({sequenceNo:c})=>c).join("\u3001")}\u6DFB\u52A0\u5931\u8D25,\u603B\u8D27\u6B3E\u4E0D\u80FD\u4E3A0\u5143`);return}z("selection",i(f))}function k(a){return`\u8F93\u5165${a==="2"?"\u91C7\u8D2D\u5355":"\u9500\u552E\u5355"}\u7F16\u7801(\u5C0F\u4E8E100\u6761)\uFF0C\u7CFB\u7EDF\u652F\u6301\u7684\u5206\u5272\u7B26\u4E3A\u9017\u53F7(,)\u3001\u53E5\u53F7(.)\u3001\u5206\u53F7(;)\u3001\u987F\u53F7(\u3001)\uFF0C\u56DE\u8F66\u540E\u5F00\u59CB\u89E3\u6790\u3002`}return Y(()=>E.type,a=>{b.value=a,g.value=k(a),w.value="",r.value=!1,f.value=[]},{immediate:!0}),(a,c)=>{const p=D("ElInput"),v=D("el-table-column"),m=D("ElTableColumn"),s=D("ElTag"),T=D("ElButton"),R=te("loading");return d(),I(L,null,[e(p,{rows:4,modelValue:w.value,"onUpdate:modelValue":c[0]||(c[0]=u=>w.value=u),style:{"margin-bottom":"10px"},placeholder:g.value,type:"textarea",onKeydown:fe(O,["enter"])},null,8,["modelValue","placeholder","onKeydown"]),H((d(),y(i(se),{ref_key:"tableRef",ref:A,size:"small",data:i(f),"max-height":"580px"},{default:l(()=>[e(v,{type:"index",width:"50","show-overflow-tooltip":"",label:"\u5E8F\u53F7"}),e(m,{label:"\u91C7\u8D2D\u5355\u7F16\u7801",prop:"sequenceNo","show-overflow-tooltip":"",width:"150"}),e(m,{label:"\u9500\u552E\u8BA2\u5355\u7F16\u7801",prop:"qrdCode","show-overflow-tooltip":"",width:"150"}),e(m,{label:"\u91C7\u8D2D\u4E3B\u5355\u7F16\u7801","show-overflow-tooltip":"",prop:"cxCode",width:"150"}),e(m,{label:"\u91C7\u8D2D\u5355\u4FE1\u606F"},{default:l(()=>[e(m,{label:"\u4F9B\u8D27\u5546",prop:"supplierName",width:"160","show-overflow-tooltip":""}),e(m,{label:"\u652F\u4ED8\u65B9\u5F0F",prop:"pay_type",width:"85","show-overflow-tooltip":""}),e(m,{label:"\u53D1\u8D27\u72B6\u6001",prop:"sendStatus",width:"90","show-overflow-tooltip":""},{default:l(({row:u})=>[e(s,{size:"small"},{default:l(()=>{var t;return[C(V((t=i(Q).find(h=>h.value===String(u.sendStatus)))==null?void 0:t.label),1)]}),_:2},1024)]),_:1}),e(m,{label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyName",width:"180","show-overflow-tooltip":""}),e(m,{label:"\u8BA2\u5355\u6765\u6E90",prop:"cgdSource",width:"100","show-overflow-tooltip":""},{default:l(({row:u})=>[e(s,{size:"small"},{default:l(()=>{var t;return[C(V((t=i(X).find(h=>h.value===String(u.cgdSource)))==null?void 0:t.label),1)]}),_:2},1024)]),_:1}),e(m,{label:"\u603B\u8D27\u6B3E",prop:"totalPrice",width:"80","show-overflow-tooltip":""})]),_:1}),e(m,{label:"\u5546\u54C1\u4FE1\u606F"},{default:l(()=>[e(m,{label:"\u5546\u54C1\u7F16\u7801",prop:"goodNo",width:"150","show-overflow-tooltip":""}),e(m,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",width:"180","show-overflow-tooltip":""}),e(m,{label:"\u5546\u54C1\u6765\u6E90",prop:"cgdType",width:"90","show-overflow-tooltip":""},{default:l(({row:u})=>[e(s,{size:"small"},{default:l(()=>{var t;return[C(V((t=i(Z).find(h=>h.value===String(u.cgdType)))==null?void 0:t.label),1)]}),_:2},1024)]),_:1}),e(m,{label:"\u5546\u54C1\u6570\u91CF",prop:"goodNum",width:"90","show-overflow-tooltip":""})]),_:1}),e(m,{label:"\u91C7\u8D2D\u5458",prop:"ownerName",width:"70","show-overflow-tooltip":""})]),_:1},8,["data"])),[[R,i(r)]]),G("div",Re,[e(T,{type:"primary",onClick:$},{default:l(()=>[C("\u4FDD\u5B58")]),_:1})])],64)}}});var Oe=j(Ie,[["__scopeId","data-v-6a6f6fd0"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/ReconciliationForm/src/cpns/batch-mode.vue"]]);const Ue=M({__name:"purchase-modal",props:{supplierNo:{type:String,required:!1},companyNo:{type:String,required:!1}},emits:["pushOrder"],setup(o,{expose:z,emit:E}){const w=S(!1),b=S("1");function g(A){w.value=!1,E("pushOrder",A)}return z({onDisplay:()=>w.value=!0}),(A,N)=>{const r=D("el-radio"),f=D("el-radio-group"),P=D("ElDialog");return d(),y(P,{"close-on-click-modal":!1,top:"5vh",modelValue:w.value,"onUpdate:modelValue":N[1]||(N[1]=_=>w.value=_),title:"\u9009\u62E9\u91C7\u8D2D\u5355",center:"","destroy-on-close":"",width:"1040px"},{default:l(()=>[e(f,{modelValue:b.value,"onUpdate:modelValue":N[0]||(N[0]=_=>b.value=_)},{default:l(()=>[e(r,{label:"1"},{default:l(()=>[C("\u52FE\u9009\u67E5\u627E")]),_:1}),e(r,{label:"2"},{default:l(()=>[C("\u6279\u91CF\u67E5\u627E(\u91C7\u8D2D\u5355\u53F7)")]),_:1}),e(r,{label:"3"},{default:l(()=>[C("\u6279\u91CF\u67E5\u627E(\u9500\u552E\u5355\u53F7)")]),_:1})]),_:1},8,["modelValue"]),b.value==="1"?(d(),y(Te,{key:0,"company-no":o.companyNo,"supplier-no":o.supplierNo,onSelection:g},null,8,["company-no","supplier-no"])):(d(),y(Oe,{key:1,"company-no":o.companyNo,"supplier-no":o.supplierNo,type:b.value,onSelection:g},null,8,["company-no","supplier-no","type"]))]),_:1},8,["modelValue"])}}});var $e=j(Ue,[["__scopeId","data-v-ed8ff04a"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/ReconciliationForm/src/cpns/purchase-modal.vue"]]);const je={class:"flex justify-end w-full"},Me=M({__name:"edit-modal",emits:["save"],setup(o,{expose:z,emit:E}){const w=ye(),b=J(!1),g=S({}),A=[{field:"sequenceNo",label:"\u9500\u552E\u5355\u7F16\u53F7",span:6},{field:"cxCode",label:"\u9500\u552E\u5355\u4E3B\u7F16\u53F7",span:6},{field:"goodNo",label:"\u5546\u54C1\u7F16\u7801",span:6},{field:"goodPrice",label:"\u5546\u54C1\u5355\u4EF7"},{field:"goodName",label:"\u5546\u54C1\u540D\u79F0",span:24},{field:"goodNum",label:"\u5546\u54C1\u603B\u6570\u91CF",span:8},{field:"ainv_num",label:"\u5DF2\u5F00\u7968\u6570\u91CF",span:8},{field:"winv_num",label:"\u672A\u5F00\u7968\u6570\u91CF",span:8},{field:"totalPrice",label:"\u8BA2\u5355\u603B\u91D1\u989D",span:8},{field:"ainv_fee",label:"\u5DF2\u5F00\u7968\u91D1\u989D",span:8},{field:"winv_fee",label:"\u672A\u5F00\u7968\u91D1\u989D",span:8},{label:"\u672C\u6B21\u5F00\u7968\u91D1\u989D",render(){return g.value.inv_fee},span:8},{label:"\u672C\u6B21\u5F00\u7968\u6570\u91CF",span:8,render(){return we(ge,{precision:0,min:0,max:g.value.winv_fee,modelValue:g.value.num,onChange:r=>g.value.num=r})}}];Y(()=>g.value.num,r=>{g.value.inv_fee=Number(ke(r,g.value.goodPrice)).toFixed(2),w.proxy.$forceUpdate()},{deep:!0});function N(){E("save",g.value),b.value=!1}return z({onDisplay:r=>{b.value=!0,g.value={...r,num:r.num,inv_fee:r.inv_fee}}}),(r,f)=>(d(),y(i(he),{width:"1024px",modelValue:i(b),"onUpdate:modelValue":f[0]||(f[0]=P=>ve(b)?b.value=P:null),title:"\u7F16\u8F91",center:""},{default:l(()=>[e(i(de),{data:g.value,columns:A},null,8,["data"]),G("div",je,[e(i(me),{type:"primary",onClick:N},{default:l(()=>[C(" \u4FDD\u5B58 ")]),_:1})])]),_:1},8,["modelValue"]))}});var Le=j(Me,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/ReconciliationForm/src/cpns/edit-modal.vue"]]);const Ye={flex:"","justify-between":"","w-full":"","mb-1":""},Ge={key:0,class:"mb-2"},Ke=M({__name:"purchase-table",props:{companyNo:{type:String,required:!1},supplierNo:{type:String,required:!1},purchaseOrders:{type:null,required:!0},readonly:{type:Boolean,required:!0},isPurchPay:{type:Boolean,required:!1},totalCommonPrice:{type:Number,required:!1},totalCommonCount:{type:Number,required:!1},edit:{type:Boolean,required:!1}},emits:["push","delete","choose","edit","selectionChange","batchSelection","batchCancelSelection"],setup(o,{expose:z,emit:E}){const w=o,b=S(null),g=S([]),A=S(null),N=S(null),r=J(-1);function f(c,p){var v,m,s;try{v=c.toString().split(".")[1].length}catch{v=0}try{m=p.toString().split(".")[1].length}catch{m=0}return s=Math.pow(10,Math.max(v,m)),(c*s+p*s)/s}const P=le(()=>w.purchaseOrders.length),_=le(()=>{const{purchaseOrders:c}=w,p=c.reduce((v,{totalPrice:m})=>f(v,m||0),0);return Number(p).toFixed(2)}),U=c=>{var p;r.value=c,(p=N.value)==null||p.onDisplay(w.purchaseOrders[c])},O=c=>{E("edit",c,r.value),r.value=-1},$=c=>{g.value=c};function k(){const{supplierNo:c,companyNo:p}=w;if(!c||!p)return K.warning("\u8BF7\u9009\u62E9\u4F9B\u5E94\u5546\u548C\u4E1A\u52A1\u516C\u53F8");A.value.onDisplay()}function a(c=!0){if(g.value.length===0){K.warning("\u8BF7\u9009\u62E9\u901A\u7528\u8BA2\u5355");return}const p=g.value.map(({id:v})=>v);E(c?"batchSelection":"batchCancelSelection",p),b.value.clearSelection()}return z({getOpenInvInfo:()=>g.value.map(({num:c,inv_fee:p,sequenceNo:v})=>({num:c,inv_fee:p,sequenceNo:v}))}),(c,p)=>{const v=D("ElTag"),m=D("ElButton"),s=D("ElTableColumn"),T=D("IconifyIconOffline"),R=D("ElTable");return d(),I("div",null,[G("div",Ye,[o.edit?F("v-if",!0):(d(),y(v,{key:0,type:"warning"},{default:l(()=>[C(" \u5171\u8BA1:"+V(i(P))+"\u4E2A\u8BA2\u5355,\u5171\u8BA1 "+V(i(_))+" \u5143 ",1)]),_:1})),F(` <ElButton \r
- v-if="purchaseOrders.length !== 0 && edit" \r
- type="primary"\r
- size="small"\r
- @click="onOpenInv"\r
- >\u5F00\u7968\u7533\u8BF7\r
- </ElButton> `),!o.readonly&&!o.isPurchPay?(d(),y(m,{key:1,type:"primary",onClick:k},{default:l(()=>[C("\u6DFB\u52A0\u91C7\u8D2D\u5355 ")]),_:1})):F("v-if",!0)]),o.edit&&o.purchaseOrders.length!==0?(d(),I("div",Ge,[e(v,{class:"mr-[10px]"},{default:l(()=>[C(V(o.totalCommonCount)+"/150 ",1)]),_:1}),e(v,{class:"mr-[10px]"},{default:l(()=>[C(V(o.totalCommonPrice)+"\u5143",1)]),_:1}),e(m,{onClick:a},{default:l(()=>[C("\u6279\u91CF\u9009\u4E2D\u8BA2\u5355")]),_:1}),e(m,{onClick:p[0]||(p[0]=u=>a(!1))},{default:l(()=>[C("\u6279\u91CF\u53D6\u6D88\u9009\u4E2D\u8BA2\u5355")]),_:1})])):F("v-if",!0),e(R,{ref_key:"tableRef",ref:b,"row-key":"id",size:"small",data:o.purchaseOrders,"max-height":"400",onSelectionChange:$},{default:l(()=>[o.edit?(d(),y(s,{key:0,fixed:"left",type:"selection"})):F("v-if",!0),o.edit?(d(),y(s,{key:1,fixed:"left",label:"\u5E8F\u53F7",type:"index"})):F("v-if",!0),o.edit?(d(),y(s,{key:2,fixed:"left",width:"65px",label:"\u662F\u5426\u9009\u4E2D"},{default:l(({row:u})=>[u.isSelection?(d(),y(T,{key:0,icon:"success",style:{color:"#67C23A"}})):F("v-if",!0)]),_:1})):F("v-if",!0),o.edit?F("v-if",!0):(d(),y(s,{key:3,label:"\u91C7\u8D2D\u5355\u7F16\u7801","show-overflow-tooltip":"",prop:"sequenceNo",width:"150"})),e(s,{label:"\u9500\u552E\u8BA2\u5355\u7F16\u7801","show-overflow-tooltip":"",prop:o.edit?"sequenceNo":"qrdCode",width:"150"},null,8,["prop"]),e(s,{label:o.edit?"\u9500\u552E\u4E3B\u5355\u53F7":"\u91C7\u8D2D\u4E3B\u5355\u53F7","show-overflow-tooltip":"",prop:"cxCode",width:"150"},null,8,["label"]),o.edit?(d(),y(s,{key:4,label:"\u91C7\u8D2D\u5355\u7F16\u7801","show-overflow-tooltip":"",prop:"cgdNo",width:"165"})):F("v-if",!0),o.edit?F("v-if",!0):(d(),y(s,{key:5,label:"\u91C7\u8D2D\u5355\u4FE1\u606F"},{default:l(()=>[o.edit?F("v-if",!0):(d(),y(s,{key:0,label:"\u4F9B\u8D27\u5546",prop:"supplierName","min-width":"160","show-overflow-tooltip":""})),o.readonly?F("v-if",!0):(d(),y(s,{key:1,label:"\u652F\u4ED8\u65B9\u5F0F",prop:"pay_type","min-width":"160","show-overflow-tooltip":""})),o.edit?F("v-if",!0):(d(),y(s,{key:2,label:"\u9500\u552E\u5355\u53D1\u8D27\u72B6\u6001",prop:"qrdSend",width:"110","show-overflow-tooltip":""},{default:l(({row:u})=>[e(v,null,{default:l(()=>{var t;return[C(V(((t=i(Q).find(h=>h.value===String(u.qrdSend)))==null?void 0:t.label)||"--"),1)]}),_:2},1024)]),_:1})),e(s,{label:"\u5165\u5E93\u72B6\u6001",prop:"sendStatus",width:"90","show-overflow-tooltip":""},{default:l(({row:u})=>[e(v,null,{default:l(()=>{var t;return[C(V(((t=i(Se).find(h=>h.value===String(u.sendStatus)))==null?void 0:t.label)||"--"),1)]}),_:2},1024)]),_:1}),i(ue)?F("v-if",!0):(d(),y(s,{key:3,label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyName","min-width":"180","show-overflow-tooltip":""})),i(ue)?F("v-if",!0):(d(),y(s,{key:4,label:"\u8BA2\u5355\u6765\u6E90",prop:"cgdSource",width:"100","show-overflow-tooltip":""},{default:l(({row:u})=>[e(v,null,{default:l(()=>{var t;return[C(V((t=i(X).find(h=>h.value===u.cgdSource))==null?void 0:t.label),1)]}),_:2},1024)]),_:1})),e(s,{label:"\u603B\u8D27\u6B3E",prop:"totalPrice",width:"80","show-overflow-tooltip":""}),e(s,{label:"\u5F00\u7968\u91D1\u989D",prop:"inv_fee",width:"80","show-overflow-tooltip":""})]),_:1})),e(s,{label:"\u5546\u54C1\u4FE1\u606F"},{default:l(()=>[e(s,{label:"\u5546\u54C1\u7F16\u7801",prop:"goodNo",width:"150","show-overflow-tooltip":""}),e(s,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",width:"180","show-overflow-tooltip":""}),e(s,{label:"\u5546\u54C1\u5355\u4EF7",prop:"goodPrice","show-overflow-tooltip":""}),i(ue)?F("v-if",!0):(d(),y(s,{key:0,label:"\u5546\u54C1\u6765\u6E90",prop:"cgdType",width:"90","show-overflow-tooltip":""},{default:l(({row:u})=>[e(v,null,{default:l(()=>{var t;return[C(V((t=i(Z).find(h=>h.value===String(u.cgdType)))==null?void 0:t.label),1)]}),_:2},1024)]),_:1})),e(s,{label:"\u5546\u54C1\u6570\u91CF",prop:"goodNum",width:"90","show-overflow-tooltip":""}),e(s,{label:"\u91C7\u8D2D\u5458",prop:"ownerName",width:"75","show-overflow-tooltip":""}),e(s,{label:"\u7A0E\u7387",prop:"tax","show-overflow-tooltip":""},{default:l(({row:u})=>[C(V(u.tax)+"% ",1)]),_:1})]),_:1}),o.edit?(d(),I(L,{key:6},[e(s,{label:"\u672A\u5F00\u7968\u91D1\u989D",prop:"winv_fee",width:"90","show-overflow-tooltip":""}),e(s,{label:"\u672C\u6B21\u5F00\u7968\u91D1\u989D",prop:"inv_fee",width:"110","show-overflow-tooltip":""}),e(s,{label:"\u672A\u5F00\u7968\u6570\u91CF",prop:"winv_num",width:"90","show-overflow-tooltip":""}),e(s,{label:"\u672C\u6B21\u5F00\u7968\u6570\u91CF",prop:"num",width:"110","show-overflow-tooltip":""})],64)):F("v-if",!0),!o.readonly&&!o.edit?(d(),y(s,{key:7,label:"\u64CD\u4F5C",fixed:"right"},{default:l(({$index:u})=>[e(m,{link:"",type:"primary",onClick:()=>E("delete",u)},{default:l(()=>[C(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})):F("v-if",!0),o.edit?(d(),y(s,{key:8,label:"\u64CD\u4F5C",width:"65",fixed:"right"},{default:l(({$index:u})=>[e(m,{link:"",type:"primary",onClick:t=>U(u)},{default:l(()=>[C("\u7F16\u8F91")]),_:2},1032,["onClick"])]),_:1})):F("v-if",!0)]),_:1},8,["data"]),e($e,{ref_key:"PurchaseModalRef",ref:A,companyNo:o.companyNo,supplierNo:o.supplierNo,onPushOrder:p[1]||(p[1]=u=>E("push",u))},null,8,["companyNo","supplierNo"]),e(Le,{ref_key:"editModalRef",ref:N,onSave:O},null,512)])}}});var ie=j(Ke,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/ReconciliationForm/src/cpns/purchase-table.vue"]]);const We={cids:{required:!0,trigger:"change",message:"\u8BF7\u6DFB\u52A0\u91C7\u8D2D\u5355\u4FE1\u606F"},companyNo:{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u4E1A\u52A1\u516C\u53F8"},supplierNo:{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u4F9B\u5E94\u5546"}},He={class:"w-full"},Je={key:0,class:"w-full flex justify-end"},Qe={key:0,flex:"","gap-10":""},Xe={key:0,class:"flex w-full justify-end"},Ze=M({__name:"index",props:{id:{type:String,required:!1},isPurch:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},isPurchPay:{type:Boolean,required:!1},showTicketColumn:{type:Boolean,required:!1},edit:{type:Boolean,required:!0},cover:{type:Boolean,required:!1},platformType:{type:String,required:!1}},emits:["create","choose","getRecord","openInv","clear"],setup(o,{expose:z,emit:E}){const w=o,b=S(null),{currentCompany:g}=Ce(),A=S([]),N=J("0.00"),r=J(0),f=S({companyNo:"",supplierNo:"",companyItem:{},cids:[]}),P=S(null),_=S([]),{run:U,data:O,loading:$}=oe({initalData:{},success:function(u){w.cover&&(_.value=[],f.value.cids=[]),E("getRecord",u),k(u[w.edit?"qrdlist":"cgdlist"].map((t,h)=>({...t,goodPrice:Number(Pe(t.totalPrice,t.goodNum)).toFixed(8),cgdNo:u.cgdlist[h].name,num:t.winv_num,inv_fee:t.winv_fee,isSelection:!1}))),N.value="0.00",r.value=0}});function k(u){if(!!u)for(let t=0;t<u.length;t++){const h=u[t];f.value.cids.includes(h.id)||(_.value.push(h),f.value.cids.push(h.id))}}function a(u){_.value.splice(u,1),f.value.cids.splice(u,1)}function c(u){f.value.companyItem=u}async function p(){try{await P.value.validate(),E("create",i(f))}catch{}}const v=()=>U(w.edit?Be({payNo:w.id}):Ne({payNo:w.id})),m=u=>{const{code:t,name:h,type:x}=u,q=x==="3"||x==="\u4E1A\u52A1\u516C\u53F8"?"(\u5DF2\u5347\u7EA7\u4E3A\u4E1A\u52A1\u516C\u53F8)":"";return t+" / "+h+q},s=u=>{const{companyNo:t,company_name:h}=u;return t+" / "+h},T=(u,t)=>{const{inv_fee:h,num:x}=u;_.value[t].inv_fee=h,_.value[t].num=x;const n=_.value.reduce((q,B)=>W(q,B.isSelection?B.inv_fee:0),0);r.value=_.value.reduce((q,B)=>W(q,B.isSelection?1:0),0),N.value=Number(n).toFixed(2)};function R(u,t=!0){_.value.forEach(x=>{x.isSelection=t?u.includes(x.id):!u.includes(x.id)});const h=_.value.reduce((x,n)=>W(x,n.isSelection?n.inv_fee:0),0);r.value=_.value.reduce((x,n)=>W(x,n.isSelection?1:0),0),N.value=Number(h).toFixed(2)}return Y(()=>w.id,u=>u&&v(),{immediate:!0}),Y(()=>g.value,({companyNo:u})=>{f.value[w.isPurch?"companyNo":"supplierNo"]=u},{immediate:!0}),Y(()=>w.platformType,()=>{O.value={},_.value=[],f.value.cids=[],E("clear")}),z({detail:O,refresh:()=>v(),getOpenInvInfo:()=>({orderArr:_.value.filter(({isSelection:u})=>u).map(({num:u,inv_fee:t,sequenceNo:h})=>({num:u,inv_fee:t,sequenceNo:h})),totalCommonPrice:N.value,totalCommonCount:r.value,data:O.value})}),(u,t)=>{const h=D("ElButton"),x=D("ElInput"),n=D("ElFormItem"),q=te("loading");return H((d(),I("div",He,[o.isPurchPay?(d(),I("div",Je,[e(h,{text:"",type:"primary",onClick:t[0]||(t[0]=()=>E("choose"))},{default:l(()=>[C(" \u9009\u62E9")]),_:1})])):F("v-if",!0),o.readonly?(d(),y(qe,{key:1,showTicketColumn:o.showTicketColumn,isPurchPay:o.isPurchPay,data:i(O)},null,8,["showTicketColumn","isPurchPay","data"])):F("v-if",!0),o.isPurchPay?F("v-if",!0):H((d(),y(i(De),{key:2,class:"w-full",ref_key:"formRef",ref:P,model:f.value,rules:i(We)},{default:l(()=>[o.readonly?F("v-if",!0):(d(),I("div",Qe,[e(n,{label:"\u4E70\u65B9\u516C\u53F8",prop:"companyNo"},{default:l(()=>[o.isPurch?(d(),y(x,{key:1,style:{width:"300px"},value:i(g).companyName,disabled:""},null,8,["value"])):(d(),y(i(ae),{key:0,value:f.value.companyNo,"onUpdate:value":t[1]||(t[1]=B=>f.value.companyNo=B),style:{width:"386px"},api:i(be),placeholder:"\u8BF7\u9009\u62E9\u4E70\u65B9\u516C\u53F8","request-prop":"company_name","response-label-prop":"company_name","response-val-prop":"companyNo","disabled-value":i(g).companyNo,getLabel:s,onItemChange:c},null,8,["value","api","disabled-value"]))]),_:1}),e(n,{label:"\u5356\u65B9\u516C\u53F8",prop:"supplierNo"},{default:l(()=>[o.isPurch?(d(),y(i(ae),{key:1,value:f.value.supplierNo,"onUpdate:value":t[2]||(t[2]=B=>f.value.supplierNo=B),style:{width:"386px"},api:i(Fe),placeholder:"\u8BF7\u9009\u62E9\u5356\u65B9\u516C\u53F8","request-prop":"name","response-label-prop":"name","response-val-prop":"code","disabled-value":i(g).companyNo,getLabel:m},null,8,["value","api","disabled-value"])):(d(),y(x,{key:0,style:{width:"300px"},value:i(g).companyName,disabled:""},null,8,["value"]))]),_:1})])),e(n,{label:o.readonly?"":"\u91C7\u8D2D\u5355\u4FE1\u606F",prop:o.readonly?"":"cids"},{default:l(()=>[e(ie,ne({class:"w-full mt-1",ref_key:"purchaseTableRef",ref:b},f.value,{readonly:o.readonly,edit:o.edit,totalCommonPrice:i(N),totalCommonCount:i(r),purchaseOrders:_.value,onDelete:a,onPush:k,onEdit:T,onSelectionChange:t[3]||(t[3]=B=>A.value=B),onBatchSelection:R,onBatchCancelSelection:t[4]||(t[4]=B=>R(B,!1))}),null,16,["readonly","edit","totalCommonPrice","totalCommonCount","purchaseOrders"])]),_:1},8,["label","prop"]),e(n,null,{default:l(()=>[o.readonly?F("v-if",!0):(d(),I("div",Xe,[e(h,{type:"primary",onClick:p,loading:o.loading},{default:l(()=>[C("\u4FDD\u5B58")]),_:1},8,["loading"])]))]),_:1})]),_:1},8,["model","rules"])),[[q,o.loading]]),o.isPurchPay?(d(),y(ie,ne({key:3,ref_key:"purchaseTableRef",ref:b,class:"w-full mt-1"},f.value,{edit:o.edit,totalCommonPrice:i(N),totalCommonCount:i(r),readonly:o.readonly,isPurchPay:o.isPurchPay,purchaseOrders:_.value,onDelete:a,onPush:k,onEdit:T,onSelectionChange:t[5]||(t[5]=B=>A.value=B),onBatchSelection:R,onBatchCancelSelection:t[6]||(t[6]=B=>R(B,!1))}),null,16,["edit","totalCommonPrice","totalCommonCount","readonly","isPurchPay","purchaseOrders"])):F("v-if",!0)])),[[q,i($)||o.loading]])}}});var ru=j(Ze,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/ReconciliationForm/src/index.vue"]]);export{ru as R};
|