import{a7 as c,bq as f,_ as H,d as Q,j as G,Q as J,m as A,V as K,aH as O,az as b,O as W,r as v,ao as X,B as Y,o as I,A as N,x as o,f as r,h as i,bm as C,H as s,D as R,a as Z}from"./index.js";import{u as uu}from"./use-page-search.dfa27a70.js";import{N as eu,n as tu}from"./index.d92aef.js";import{O as lu,o as ou}from"./index.fc8072.js";import{e as ru,a as nu,b as au}from"./index.004a0bb2.js";import{t as iu,c as su,s as pu,a as y}from"./shared.110b48c6.js";import{x as du}from"./status.b7512d56.js";import{r as h}from"./columnRenderHelper.8411add2.js";import{u as B,w as mu}from"./execl-upload.8692a4ce.js";import{h as Eu}from"./export.d1a777b9.js";import"./index.71c29d4d.js";import"./index.e25db4d1.js";const cu=[{type:"selection",width:40},{prop:"id",label:"ID",width:"40px"},{label:"\u4E1A\u52A1\u7F16\u53F7",prop:"invoiceCode",width:150},{label:"\u7C7B\u578B",width:80,cellRenderer({row:e}){return c(f,{type:"primary",size:"small"},{default:()=>{var l;return(l=iu.find(t=>t.value==e.type))==null?void 0:l.label}})}},{label:"\u5BFC\u5165\u65B9\u5F0F",width:100,cellRenderer({row:e}){return c(f,{type:"primary",size:"small"},{default:()=>{var l;return(l=su.find(t=>t.value==e.channel))==null?void 0:l.label}})}},{label:"\u6570\u636E\u6765\u6E90",width:90,cellRenderer({row:e}){return c(f,{type:"primary",size:"small"},{default:()=>{var l;return(l=pu.find(t=>t.value==e.source))==null?void 0:l.label}})}},{label:"\u72B6\u6001",width:90,cellRenderer({row:e}){var l;return c(f,{type:(l=y.find(t=>t.value==e.status))==null?void 0:l.type,size:"small"},{default:()=>{var t;return(t=y.find(_=>_.value==e.status))==null?void 0:t.label}})}},{label:"\u5F02\u5E38\u539F\u56E0",width:120,prop:"error_remark"},{label:"\u8D2D\u4E70\u65B9\u516C\u53F8",width:150,...h("buyer_code","buyer_name","\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7:")},{label:"\u9500\u552E\u65B9\u516C\u53F8",prop:"seller_code",width:150,...h("seller_code","seller_name","\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7:")},{label:"\u8BA2\u5355\u7F16\u53F7",prop:"orderCode",width:160},{label:"\u8BA2\u5355\u4E3B\u7F16\u53F7",prop:"cxCode",width:160},{label:"\u5546\u54C1\u7F16\u53F7",prop:"goodNo",width:120},{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",width:120},{label:"\u5355\u4F4D",prop:"unit",width:60},{label:"\u5546\u54C1\u6570\u91CF",prop:"num",width:100},{label:"\u5546\u54C1\u5355\u4EF7",prop:"goodPrice",width:100},{label:"\u8BA2\u5355\u603B\u91D1\u989D",prop:"totalPrice",width:120},{label:"\u7A0E\u76EE",prop:"cat_code",width:120},{label:"\u7A0E\u7387",width:60,cellRenderer({row:e}){return e.tax+"%"}},{label:"\u5173\u8054\u91D1\u989D",prop:"inv_fee",width:120},{label:"\u53D1\u7968\u8D2D\u4E70\u65B9\u516C\u53F8",width:120,...h("inv_buyer_code","inv_buyer_name","\u8D2D\u4E70\u65B9\u516C\u53F8\u540D\u79F0\u7EB3\u7A0E\u53F7:")},{label:"\u53D1\u7968\u9500\u552E\u65B9\u516C\u53F8",width:180,...h("inv_seller_code","inv_seller_name","\u53D1\u7968\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7:")},{label:"\u53D1\u7968\u53F7\u7801",prop:"inv_number",width:100},{label:"\u53D1\u7968\u7C7B\u578B",width:180,cellRenderer({row:e}){var l;return(l=du.find(t=>t.value===e.inv_type))==null?void 0:l.label}},{label:"\u53D1\u7968\u660E\u7EC6ID",prop:"inv_item_id",width:100},{label:"\u8D27\u7269\u6216\u5E94\u7A0E\u52B3\u52A1\u3001\u670D\u52A1\u540D\u79F0",prop:"inv_good_name",width:170},{label:"\u7C7B\u76EE\u7F16\u53F7",prop:"cat_code",width:100},{label:"\u89C4\u683C\u578B\u53F7",prop:"inv_spec",width:80},{label:"\u53D1\u7968\u5546\u54C1\u5355\u4F4D",prop:"inv_unit",width:100},{label:"\u53D1\u7968\u5546\u54C1\u6570\u91CF",prop:"inv_num",width:100},{label:"\u7A0E\u524D\u5355\u4EF7",prop:"inv_subprice",width:100},{label:"\u7A0E\u524D\u603B\u4EF7",prop:"inv_subtotal",width:100},{label:"\u53D1\u7968\u7A0E\u7387",prop:"inv_tax",width:80},{label:"\u53D1\u7968\u7A0E\u989D",prop:"inv_tax_total",width:80},{label:"\u7A0E\u540E\u5355\u4EF7",prop:"inv_price",width:100},{label:"\u7A0E\u540E\u603B\u989D",prop:"inv_total",width:100},{label:"\u7C7B\u76EE\u7F16\u53F7\u72B6\u6001",width:100,cellRenderer({row:e}){return c(f,{size:"small",type:e.cat_diff=="0"?"danger":"success"},{default:()=>e.cat_diff=="0"?"\u4E0D\u4E00\u81F4":"\u4E00\u81F4"})}},{label:"\u7A0E\u7387\u72B6\u6001",prop:"TODO",width:100,cellRenderer({row:e}){return c(f,{size:"small",type:e.tax_diff=="0"?"danger":"success"},{default:()=>e.tax_diff=="0"?"\u4E0D\u4E00\u81F4":"\u4E00\u81F4"})}},{label:"\u5907\u6CE8",prop:"remark",width:100},{label:"\u5173\u8054\u5546\u54C1ID",prop:"goodNo",width:80,cellRenderer({row:e}){return e.ProductRela.length===0?null:e.ProductRela[0].id}},{label:"\u5173\u8054\u5546\u54C1\u540D\u79F0",prop:"goodName",width:100,cellRenderer({row:e}){return e.ProductRela.length===0?null:e.ProductRela[0].goodName}},{label:"\u521B\u5EFA\u4EBA",prop:"apply_name",width:"100px"},{label:"\u521B\u5EFA\u65F6\u95F4",prop:"create_time",width:"140px"},{label:"\u64CD\u4F5C",fixed:"right",width:50,slot:"operation"}],fu={columns:cu,title:"\u5546\u54C1\u7BA1\u7406",permissions:["007"],companyProp:"buyer_code",apis:{httpList:(e={})=>ru({...e,channel:[1,2],type:[1,3]}),httpAdd:!0}},S={formItems:[{field:"inv_seller_code",type:"inv-out-query",placeholder:"\u53D1\u7968\u9500\u552E\u65B9\u516C\u53F8"},{field:"status",placeholder:"\u72B6\u6001",options:y,type:"select"}]},bu="inOutManager",Fu=Q({__name:"index",setup(e){const l=G(),t=J({orderImportVisible:!1,notOrderImportVisible:!1}),_={pageSearchHook:()=>uu(void 0,void 0,S)},a=A(null),{isSuperUser:P}=K(),p=A([]),z=O({success(){b.success("\u5220\u9664\u6210\u529F"),a==null||a.value.onSearch(!0)}}),V=O({success(){b.success("\u53D6\u6D88\u6210\u529F"),a==null||a.value.onSearch(!0)}}),M={content:{create:()=>l.push("/invoiceInOut/inManagerDetail"),preview:({id:d})=>l.push("/invoiceInOut/inManagerDetail?id="+d)}},{getCurrentLicense:x,currentCompany:T}=W();function k(d="notOrder"){const u=d==="notOrder"?tu:ou,m=d==="notOrder"?"\u5165\u5E93\u6A21\u677F-\u975E\u8BA2\u5355\u5546\u54C1.xlsx":"\u5165\u5E93\u6A21\u677F-\u8BA2\u5355\u5546\u54C1.xlsx",E=B.book_new(),w=B.json_to_sheet(u),g=B.json_to_sheet([{\u8D2D\u4E70\u65B9\u7EB3\u7A0E\u53F7:x(),\u8D2D\u4E70\u65B9\u540D\u79F0:T.value.companyName}]);B.book_append_sheet(E,w,"sheet1"),B.book_append_sheet(E,g,"sheet2"),mu(E,m,{bookType:"xlsx"})}function $(){if(p.value.length===0){b.warning('\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u6761\u72B6\u6001\u4E3A "\u5F85\u5BA1\u6838" \u6216 "\u5F02\u5E38" \u7684\u6570\u636E');return}if(p.value.some(({status:u})=>u!="1"&&u!="4")){b.warning('\u53EA\u80FD\u9009\u62E9\u72B6\u6001\u4E3A "\u5F85\u5BA1\u6838" \u6216 "\u5F02\u5E38" \u7684\u6570\u636E');return}z.run(nu({id:p.value.map(({id:u})=>u)}))}function L(){if(p.value.length===0){b.warning('\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u6761\u72B6\u6001\u4E3A "\u6B63\u5E38" \u6216 "\u8BA1\u63D0" \u7684\u6570\u636E');return}if(p.value.some(({status:u})=>u!="2"&&u!="3")){b.warning('\u53EA\u80FD\u9009\u62E9\u72B6\u6001\u4E3A "\u6B63\u5E38" \u6216 "\u8BA1\u63D0" \u7684\u6570\u636E');return}V.run(au({type:"1",item_ids:p.value.map(({id:u})=>u),remark:""}))}const D=A(!1);async function U(){await Eu({url:"/cxinv/FinancialManager/export",name:"\u5165\u5E93\u7BA1\u7406",onStart:()=>D.value=!0,onSuccess:()=>D.value=!1,onFail:()=>D.value=!1,params:{type:["1","3"],channel:["1","2"],inv_buyer_code:x(),...a.value.getBasicParams()}})}return(d,u)=>{const m=v("ElDropdownItem"),E=v("ElDropdownMenu"),w=v("ElDropdown"),g=v("PageContainer"),j=v("PageAuth"),q=X("loading");return Y((I(),N(j,{pageName:bu},{default:o(()=>[r(g,{hooks:_,events:M,searchConfig:i(S),contentConfig:i(fu),"get-content-ref":n=>a.value=n,onContentSelectChange:u[4]||(u[4]=n=>p.value=n)},{content_header:o(()=>[r(i(C),{size:"small",type:"primary",onClick:U},{default:o(()=>u[9]||(u[9]=[s(" \u5BFC\u51FA ")])),_:1}),r(i(C),{size:"small",type:"primary",onClick:L},{default:o(()=>u[10]||(u[10]=[s(" \u6279\u91CF\u53D6\u6D88 ")])),_:1}),r(i(C),{style:{"margin-right":"10px"},size:"small",type:"danger",onClick:$},{default:o(()=>u[11]||(u[11]=[s(" \u6279\u91CF\u5220\u9664 ")])),_:1}),i(P)?Z("v-if",!0):(I(),N(w,{key:0},{dropdown:o(()=>[r(E,null,{default:o(()=>[r(m,{onClick:u[0]||(u[0]=n=>t.orderImportVisible=!0)},{default:o(()=>u[13]||(u[13]=[s("\u8BA2\u5355\u5546\u54C1")])),_:1}),r(m,{onClick:u[1]||(u[1]=n=>t.notOrderImportVisible=!0)},{default:o(()=>u[14]||(u[14]=[s("\u975E\u8BA2\u5355\u5546\u54C1")])),_:1})]),_:1})]),default:o(()=>[r(i(C),{size:"small",type:"primary",style:{"margin-right":"10px","margin-top":"1px"},icon:i(R)("arrow-up-line")},{default:o(()=>u[12]||(u[12]=[s("\u5165\u5E93\u6570\u636E\u5BFC\u5165 ")])),_:1},8,["icon"])]),_:1})),r(w,null,{dropdown:o(()=>[r(E,null,{default:o(()=>[r(m,{onClick:u[2]||(u[2]=n=>k("order"))},{default:o(()=>u[16]||(u[16]=[s("\u8BA2\u5355\u5546\u54C1")])),_:1}),r(m,{onClick:u[3]||(u[3]=n=>k("notOrder"))},{default:o(()=>u[17]||(u[17]=[s("\u975E\u8BA2\u5355\u5546\u54C1")])),_:1})]),_:1})]),default:o(()=>[r(i(C),{size:"small",style:{"margin-right":"10px","margin-top":"1px"},icon:i(R)("arrow-down-line")},{default:o(()=>u[15]||(u[15]=[s(" \u5165\u5E93\u6A21\u677F\u4E0B\u8F7D")])),_:1},8,["icon"])]),_:1})]),_:1},8,["searchConfig","contentConfig","get-content-ref"]),r(lu,{visible:t.orderImportVisible,"onUpdate:visible":u[5]||(u[5]=n=>t.orderImportVisible=n),onRefresh:u[6]||(u[6]=n=>{var F;return(F=a.value)==null?void 0:F.onSearch()})},null,8,["visible"]),r(eu,{visible:t.notOrderImportVisible,"onUpdate:visible":u[7]||(u[7]=n=>t.notOrderImportVisible=n),onRefresh:u[8]||(u[8]=n=>{var F;return(F=a.value)==null?void 0:F.onSearch()})},null,8,["visible"])]),_:1})),[[q,D.value]])}}});var Ou=H(Fu,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inManager/index.vue"]]);export{Ou as default};