zcui/frontend/dist/assets/SelectAnnualPlanDialog-BZD-2g5o.js

2 lines
8.3 KiB
JavaScript
Raw Normal View History

import{_ as ee,k as y,K as U,o as L,g as R,f as n,e as a,h as f,s as te,t as T,a as ae,j as s,q as B,W as oe,E as le}from"./index-C1KISTGN.js";const ne={class:"pagination-container"},re={__name:"SelectAnnualPlanDialog",props:{modelValue:{type:Boolean,default:!1},biddingType:{type:String,default:""}},emits:["update:modelValue","confirm"],setup(F,{emit:E}){const S=F,k=E,_=y(S.modelValue),V=y(!1),w=y(null),z=y([]),h=y([]),o=B({documentNo:"",year:null,projectName:"",projectType:""}),p=B({currentPage:1,pageSize:10,total:0}),b=["漱玉平民大药房连锁股份有限公司","山东漱玉平民大药房有限公司","济南漱玉平民大药房有限公司","青岛漱玉平民大药房有限公司","烟台漱玉平民大药房有限公司"],x=["采购部","财务部","技术部","行政部","人力资源部","运营部"],N=["张三","李四","王五","赵六","孙七","周八","吴九","郑十"],$=["2026年IT设备采购","2026年办公家具采购","2026年装修工程","2026年保洁服务","2026年车辆维护","2026年网络升级","2026年空调系统维护","2026年安保服务","2026年办公用品采购","2026年食堂服务","2026年消防系统升级","2026年电梯维护"],q=["为公司各部门提供办公设备支持","更换老旧办公家具,提升办公环境","对总部及各分公司进行装修升级","提供专业的保洁服务,保持环境整洁","对公司车辆进行定期维护保养","升级网络设备,提升网络速度和稳定性"],K=(()=>{const t=[];for(let e=0;e<30;e++){const r=2025+Math.floor(e/10),i=e%10+1,u=`PLAN-${r}-${String(i).padStart(3,"0")}`,c=`ND${r}${String(Math.floor(Math.random()*12)+1).padStart(2,"0")}${String(Math.floor(Math.random()*28)+1).padStart(2,"0")}${String(Math.floor(Math.random()*24)).padStart(2,"0")}${String(Math.floor(Math.random()*60)).padStart(2,"0")}${String(Math.floor(Math.random()*1e3)).padStart(3,"0")}`,g=new Date(r,Math.floor(Math.random()*12),Math.floor(Math.random()*28)+1),m=new Date(g);m.setMonth(m.getMonth()+Math.floor(Math.random()*6)+1);const M=Math.floor(Math.random()*500)+10,d=Math.random()>.5?"工程类":"服务类",j=M>100?"招标":"比价",D=b[Math.floor(Math.random()*b.length)],P=x[Math.floor(Math.random()*x.length)];t.push({id:e+1,documentNo:c,year:r,planNo:u,seqNo:String(i),projectName:$[e%$.length],projectType:d,department:P,company:D,contactPerson:N[Math.floor(Math.random()*N.length)],applyDate:g,expectedDate:m,budgetAmount:M,biddingMethod:j,projectIntro:q[e%q.length],lowestPrice:Math.floor(M*.9),lowestSupplier:b[Math.floor(Math.random()*b.length)],highestPrice:Math.floor(M*1.1),highestSupplier:b[Math.floor(Math.random()*b.length)]})}return t})(),A=()=>{v()},H=()=>{o.documentNo="",o.year=null,o.projectName="",o.projectType="",A()},v=()=>{V.value=!0,setTimeout(()=>{let t=[...K];if(o.documentNo&&(t=t.filter(e=>e.documentNo.toLowerCase().includes(o.documentNo.toLowerCase()))),o.year){const e=o.year.getFullYear();t=t.filter(r=>r.year===e)}o.projectName&&(t=t.filter(e=>e.projectName.toLowerCase().includes(o.projectName.toLowerCase()))),o.projectType&&(t=t.filter(e=>e.projectType===o.projectType)),S.biddingType&&(t=t.filter(e=>e.biddingMethod===S.biddingType)),z.value=t.slice((p.currentPage-1)*p.pageSize,p.currentPage*p.pageSize),p.total=t.length,V.value=!1},300)},Q=t=>{p.pageSize=t,v()},W=t=>{p.currentPage=t,v()},Y=t=>{var e,r;if(t.length>1){const i=t[t.length-1];(e=w.value)==null||e.clearSelection(),(r=w.value)==null||r.toggleRowSelection(i,!0),h.value=[i]}else h.value=t},G=()=>!0,J=()=>{if(h.value.length===0){le.warning("请选择一条数据");return}const t=h.value[0],e=O(t);k("confirm",{planInfo:t,materials:e}),C()},O=t=>{const e=[],r=[{name:"办公电脑",code:"M001",spec:"ThinkPad T14",brand:"联想",unit:"台",price:8500},{name:"办公显示器",code:"M002",spec:"27寸4K",brand:"戴尔",unit:"台",price:2e3},{name:"办公桌",code:"M003",spec:"1.8米实木",brand:"宜家",unit:"张",price:3500},{name:"办公椅",code:"M004",spec:"人体工学",brand:"赫曼米勒",unit:"把",price:2800},{name:"打印机",code:"M005",spec:"HP M404",brand