import{_ as L,d as N,n as F,O as U,dL as Y,p as M,a6 as S,R as P,r as m,o as c,c as _,h as t,y as n,e as x,F as B,z as D,H as g,G as b,i as f,cm as v}from"./index.js";import I from"./company-select.a826b3.js";import{h as w}from"./export.97c4d705.js";import"./index.9e6aefa2.js";import"./xlsx.ed122d16.js";var O=[{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 R=[{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 H={class:"main"},$={style:{width:"100%","text-align":"center"}},j={style:{width:"1200px","text-align":"left",display:"inline-block",margin:"14vh 2vh 0 0"}},q={name:"commission"},z=N({...q,setup(G){const i=F(O),d=F(R),{currentCompany:E}=U(),y=F([]),u=Y({currentLine:-1,loading:!1});async function V(a,o){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=o,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,o){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=o,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");y.value=a,i.value.forEach((o,e)=>{i.value[e].time="",i.value[e].end=""}),d.value.forEach((o,e)=>{d.value[e].time="",d.value[e].end="",d.value[e].supplierNo=""})}),P(()=>{}),(a,o)=>{const e=m("el-col"),p=m("el-date-picker"),C=m("el-button"),h=m("el-row"),k=m("PagePower");return c(),_("div",H,[t(k,{"is-show":y.value.some(l=>l==="001")},{default:n(()=>[x("div",$,[x("div",j,[(c(!0),_(B,null,D(i.value,(l,r)=>(c(),_("div",{key:l.value+r,style:{padding:"10px 20px"}},[t(h,{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":s=>l.time=s,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(C,{type:"primary",loading:f(u).currentLine===r&&f(u).loading,onClick:s=>V(l,r)},{default:n(()=>[...o[0]||(o[0]=[g(" \u5BFC\u51FA ")])]),_:2},1032,["loading","onClick"])]),_:2},1024)]),_:2},1024)]))),128)),(c(!0),_(B,null,D(d.value,(l,r)=>(c(),_("div",{key:l.value+r,style:{padding:"10px 20px"}},[t(h,{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":s=>l.time=s,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":s=>l.supplierNo=s},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),t(e,{span:3},{default:n(()=>[t(C,{type:"primary",loading:f(u).currentLine===r+i.value.length&&f(u).loading,onClick:s=>A(l,r+i.value.length)},{default:n(()=>[...o[1]||(o[1]=[g(" \u5BFC\u51FA ")])]),_:2},1032,["loading","onClick"])]),_:2},1024)]),_:2},1024)]))),128))])])]),_:1},8,["is-show"])])}}});var X=L(z,[["__scopeId","data-v-772d5bee"],["__file","D:/work/jiesuan/settle-vue3/src/views/parameter/commission/index.vue"]]);export{X as default};
