import{_ as L,d as N,w as F,W as U,bD as Y,x as M,ad as S,$ as P,r as c,o as m,c as _,l as t,C as n,b as D,F as b,D as x,M as g,L as B,u as f,aY as v}from"./index.1d1a5ecb.js";import I from"./company-select.a6b560c6.js";import{h as w}from"./export.07022066.js";import"./index.464acba2.js";import"./xlsx.ed122d16.js";var $=[{value:"710",label:"\u56DE\u6B3E\u6838\u9500\u660E\u7EC6\u8868",time:"",end:"",url:"ole"},{value:"711",label:"\u56DE\u7968\u660E\u7EC6\u8868",time:"",end:"",url:"ie"},{value:"712",label:"\u7ECF\u8425\u5206\u6790\u62A5\u8868",time:"",end:"",url:"ae"},{value:"713",label:"\u6536\u5165\u6210\u672C\u660E\u7EC6\u8868",time:"",url:"oie"},{value:"714",label:"\u5E94\u6536\u53F0\u8D26\u8868",time:"",end:"",url:"sbe"},{value:"715",label:"\u7528\u53CB\u9500\u7968\u8868",time:"",end:"",url:"pie"}];const O=[{url:"pe",value:"716",label:"\u8BA2\u5355\u5BF9\u8D26\u6C47\u603B\u8868",time:"",end:""},{url:"cm",value:"716",label:"\u91C7\u8D2D\u7BA1\u7406\u8868",time:"",end:""}];const R={class:"main"},W={style:{width:"100%","text-align":"center"}},j={style:{width:"1200px","text-align":"left",display:"inline-block",margin:"14vh 2vh 0 0"}},q={name:"commission"},H=N({...q,setup(T){const s=F($),d=F(O),{currentCompany:E}=U(),C=F([]),u=Y({currentLine:-1,loading:!1});async function V(a,i){const e=E.value.companyNo;if(!e){v.warning("\u8BF7\u9009\u62E9\u4E1A\u52A1\u516C\u53F8!");return}a.time.length===2?await w({url:a.url,name:a.label,onStart:()=>{u.currentLine=i,u.loading=!0},onSuccess:()=>{u.currentLine=-1,u.loading=!1},onFail:()=>{u.currentLine=-1,u.loading=!1},params:{start:a.time[0],company:e,end:a.time[1]}}):v.warning("\u8BF7\u9009\u62E9\u65F6\u95F4\u533A\u95F4!")}async function A(a,i){const e=E.value.companyNo,{supplierNo:p}=a;if(!e){v.warning("\u8BF7\u9009\u62E9\u4E1A\u52A1\u516C\u53F8!");return}if(e===p){v.warning("\u5356\u65B9\u516C\u53F8\u4E0E\u4E1A\u52A1\u516C\u53F8\u4E0D\u80FD\u4E00\u81F4!");return}a.time.length===2?await w({url:a.url,name:a.label,onStart:()=>{u.currentLine=i,u.loading=!0},onSuccess:()=>{u.currentLine=-1,u.loading=!1},onFail:()=>{u.currentLine=-1,u.loading=!1},params:{start:a.time[0],companyNo:e,end:a.time[1],supplierNo:p}}):v.warning("\u8BF7\u9009\u62E9\u65F6\u95F4\u533A\u95F4!")}return M(()=>{const a=S().getMenuActions("commission");C.value=a,s.value.forEach((i,e)=>{s.value[e].time="",s.value[e].end=""}),d.value.forEach((i,e)=>{d.value[e].time="",d.value[e].end="",d.value[e].supplierNo=""})}),P(()=>{}),(a,i)=>{const e=c("el-col"),p=c("el-date-picker"),h=c("el-button"),y=c("el-row"),k=c("PagePower");return m(),_("div",R,[t(k,{"is-show":C.value.some(l=>l==="001")},{default:n(()=>[D("div",W,[D("div",j,[(m(!0),_(b,null,x(s.value,(l,o)=>(m(),_("div",{key:l.value+o,style:{padding:"10px 20px"}},[t(y,{style:{width:"100%"}},{default:n(()=>[t(e,{span:7,class:"tr",style:{padding:"0 30px 0 0","line-height":"32px"}},{default:n(()=>[g(B(l.label),1)]),_:2},1024),t(e,{span:8},{default:n(()=>[t(p,{modelValue:l.time,"onUpdate:modelValue":r=>l.time=r,type:"daterange","range-separator":"\u81F3","value-format":"YYYY-MM-DD","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),t(e,{span:3},{default:n(()=>[t(h,{type:"primary",loading:f(u).currentLine===o&&f(u).loading,onClick:r=>V(l,o)},{default:n(()=>[g(" \u5BFC\u51FA ")]),_:2},1032,["loading","onClick"])]),_:2},1024)]),_:2},1024)]))),128)),(m(!0),_(b,null,x(d.value,(l,o)=>(m(),_("div",{key:l.value+o,style:{padding:"10px 20px"}},[t(y,{style:{width:"100%"}},{default:n(()=>[t(e,{span:7,class:"tr",style:{padding:"0 30px 0 0","line-height":"32px"}},{default:n(()=>[g(B(l.label),1)]),_:2},1024),t(e,{span:8},{default:n(()=>[t(p,{modelValue:l.time,"onUpdate:modelValue":r=>l.time=r,type:"daterange","range-separator":"\u81F3","value-format":"YYYY-MM-DD","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),t(e,{span:6},{default:n(()=>[t(I,{modelValue:l.supplierNo,"onUpdate:modelValue":r=>l.supplierNo=r},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),t(e,{span:3},{default:n(()=>[t(h,{type:"primary",loading:f(u).currentLine===o+s.value.length&&f(u).loading,onClick:r=>A(l,o+s.value.length)},{default:n(()=>[g(" \u5BFC\u51FA ")]),_:2},1032,["loading","onClick"])]),_:2},1024)]),_:2},1024)]))),128))])])]),_:1},8,["is-show"])])}}});var X=L(H,[["__scopeId","data-v-772d5bee"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/parameter/commission/index.vue"]]);export{X as default};
