index.f45a5b8a.js 5.1 KB

1
  1. import{a3 as _,aE as v,Z as p,_ as N,d as k,w as D,aT as P,r as d,o as b,G as A,C as f,l as E,u as F,J as R,a as S,au as g}from"./index.1d5f2f42.js";import{d as H,e as L,f as I}from"./index.73b16657.js";import{r as z}from"./columnRenderHelper.b302b7f4.js";import{u as O}from"./use-page-search.5b2e253c.js";import{u as q}from"./use-page-modal.2492035a.js";import{u as W}from"./useCompany.f3b703c8.js";const h=[{value:"1",label:"\u7ACB\u5373\u6267\u884C"},{value:"2",label:"\u5EF6\u8FDF\u6267\u884C"}],Y=[{value:"1",label:"\u5F85\u6267\u884C",type:"warning"},{value:"2",label:"\u6267\u884C\u5B8C\u6210",type:"success"},{value:"3",label:"\u6267\u884C\u5931\u8D25",type:"error"},{value:"4",label:"\u6267\u884C\u4E2D",type:""}],T=[{type:"selection",width:40,align:"center",hide:({checkList:e})=>!e.includes("\u52FE\u9009\u5217")},{label:"\u5E8F\u53F7",type:"index",width:70,hide:({checkList:e})=>!e.includes("\u5E8F\u53F7\u5217")},{label:"\u62A5\u8868\u540D\u79F0",prop:"name"},{label:"\u6267\u884C\u7C7B\u578B",prop:"type",width:"90px",cellRenderer:({row:e,props:r})=>_(v,{size:r.size,type:String(e.type)==="1"?"":"success"},{default:()=>{var u;return(u=h.find(t=>String(e.type)===t.value))==null?void 0:u.label}})},{label:"\u72B6\u6001",prop:"status",width:"90px",cellRenderer:({row:e,props:r})=>{const{type:u,label:t}=Y.find(o=>String(e.status)===o.value);return _(v,{size:r.size,type:u},{default:()=>t})}},{label:"\u5F00\u59CB\u65F6\u95F4",prop:"start",width:"140px",formatter:({start:e})=>p(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u7ED3\u675F\u65F6\u95F4",prop:"end",width:"140px",formatter:({end:e})=>p(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyName",...z("companyNo","companyName","\u4E1A\u52A1\u516C\u53F8\u7F16\u7801:")},{label:"\u7533\u8BF7\u4EBA",prop:"apply_name",width:"70px"},{label:"\u521B\u5EFA\u65F6\u95F4",prop:"addtime",width:"140px",formatter:({addtime:e})=>p(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",width:80,slot:"operation"}],V={title:"\u62A5\u8868\u7533\u8BF7\u8BB0\u5F55",superUserNoAction:!0,columns:T,showDelete:e=>String(e.status)=="1",apis:{httpList:H,httpAdd:L,httpDelete:I}},w={colLayout:{xl:3,lg:4,md:6,sm:8,xs:12},formItems:[{field:"status",type:"select",placeholder:"\u6267\u884C\u72B6\u6001",options:Y},{field:"type",type:"select",placeholder:"\u6267\u884C\u7C7B\u578B",options:h},{field:"name",type:"input",placeholder:"\u62A5\u8868\u540D\u79F0"},{field:"apply_name",type:"input",placeholder:"\u7533\u8BF7\u4EBA"}]},j={title:"\u62A5\u8868\u7533\u8BF7",colLayout:{span:24},itemStyle:{},formItems:[{field:"id",type:"select",label:"\u62A5\u8868",labelWidth:"120px",placeholder:"\u8BF7\u9009\u62E9\u62A5\u8868",rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u62A5\u8868"}],options:[],otherOptions:{disabled:!0}},{field:"type",type:"select",label:"\u6267\u884C\u7C7B\u578B",labelWidth:"120px",placeholder:"\u6267\u884C\u7C7B\u578B",rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u6267\u884C\u7C7B\u578B"}],options:h},{field:"create_timer",type:"date_picker",label:"\u62A5\u8868\u65F6\u95F4",labelWidth:"120px",placeholder:"\u8BF7\u9009\u62E9\u62A5\u8868\u65F6\u95F4",rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u62A5\u8868\u65F6\u95F4"}],otherOptions:{type:"daterange",startProp:"start",endProp:"end",startPlaceholder:"\u8D77\u59CB\u65F6\u95F4",endPlaceholder:"\u7ED3\u675F\u65F6\u95F4"}}]},G=k({__name:"index",setup(e){const r="reportRecord",u=D(j),{currentCompany:t}=W(),o=D([]);async function x(){const s=[];if(!t.value.companyNo){o.value=[],u.value.formItems[0].options=o.value;return}const{code:i,data:l}=await httpListRecordAll({companyNo:t.value.companyNo});i===0&&l.forEach(a=>{const n={value:a.id,label:a.name,disabled:String(a.status)=="0"};s.push(n)}),o.value=s,u.value.formItems[0].options=o.value}const M={pageSearchHook:()=>O(void 0,void 0,w),pageModalHook:s=>q({pageContentRef:s,confirmCallback:({create_timer:i,type:l})=>{const a=p(i[0]).format("YYYY-MM-DD"),n=p(i[1]).format("YYYY-MM-DD"),c=24*60*60*1e3,m=new Date(a).valueOf(),y=(new Date(n).valueOf()+c-m)/c,B=t.value.companyNo;return String(l)==="1"&&y>31?(g.warning("\u7ACB\u5373\u6267\u884C\u65F6\uFF0C\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC731\u5929\uFF01"),!1):String(l)==="2"&&y>62?(g.warning("\u5EF6\u65F6\u6267\u884C\u65F6\uFF0C\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC762\u5929\uFF01"),!1):B?{end:n,start:a,companyNo:B}:(g.warning("\u8BF7\u9009\u62E9\u4E1A\u52A1\u516C\u53F8\uFF01"),!1)}})};return P(()=>{t.value.companyNo&&x()}),(s,i)=>{const l=d("ElButton"),a=d("el-link"),n=d("PageContainer"),c=d("PageAuth");return b(),A(c,{pageName:r},{default:f(()=>[E(n,{hooks:M,"content-config":F(V),"search-config":F(w),"modal-config":u.value},{content_action:f(({status:m,down_url:C})=>[String(m)==="2"?(b(),A(a,{key:0,href:C,target:"_blank",underline:!1},{default:f(()=>[E(l,{link:"",size:"small",type:"primary",icon:F(R)("download-line")},null,8,["icon"])]),_:2},1032,["href"])):S("v-if",!0)]),_:1},8,["content-config","search-config","modal-config"])]),_:1})}}});var $=N(G,[["__file","D:/work/rep-v3/report-v3/src/views/reportCollection/sale/components/reportRecord/index.vue"]]);export{$ as default};