2 lines
8.3 KiB
JavaScript
2 lines
8.3 KiB
JavaScript
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:"惠普",unit:"台",price:3200}],i=Math.floor(Math.random()*3)+2;for(let u=0;u<i;u++){const c=r[u%r.length],g=Math.floor(Math.random()*10)+1;e.push({seqNo:String(u+1),materialName:c.name,materialCode:c.code,spec:c.spec,brand:c.brand,unit:c.unit,referencePrice:c.price,expectedQuantity:g,amount:c.price*g,contactPerson:N[Math.floor(Math.random()*N.length)],applyDate:t.applyDate,expectedDate:t.expectedDate,projectAttribute:["一类项目","二类项目","三类项目"][Math.floor(Math.random()*3)],requirementIntro:"满足项目基本需求,质量符合标准",remark:""})}return e};U(()=>S.modelValue,t=>{_.value=t,t&&(h.value=[],v())}),U(_,t=>{k("update:modelValue",t)});const C=()=>{var t;_.value=!1,h.value=[],(t=w.value)==null||t.clearSelection()};return(t,e)=>{const r=s("el-input"),i=s("el-form-item"),u=s("el-date-picker"),c=s("el-option"),g=s("el-select"),m=s("el-button"),M=s("el-form"),d=s("el-table-column"),j=s("el-tag"),D=s("el-table"),P=s("el-pagination"),X=s("el-dialog"),Z=oe("loading");return L(),R(X,{modelValue:_.value,"onUpdate:modelValue":e[6]||(e[6]=l=>_.value=l),title:"选择年度招采计划",width:"1400px",onClose:C},{footer:n(()=>[a(m,{onClick:C},{default:n(()=>[...e[9]||(e[9]=[f("取消",-1)])]),_:1}),a(m,{type:"primary",onClick:J,disabled:h.value.length===0},{default:n(()=>[...e[10]||(e[10]=[f("确认选择",-1)])]),_:1},8,["disabled"])]),default:n(()=>[a(M,{model:o,inline:!0,class:"search-form"},{default:n(()=>[a(i,{label:"单据号"},{default:n(()=>[a(r,{modelValue:o.documentNo,"onUpdate:modelValue":e[0]||(e[0]=l=>o.documentNo=l),placeholder:"请输入单据号",clearable:""},null,8,["modelValue"])]),_:1}),a(i,{label:"年度"},{default:n(()=>[a(u,{modelValue:o.year,"onUpdate:modelValue":e[1]||(e[1]=l=>o.year=l),type:"year",placeholder:"请选择年度",clearable:""},null,8,["modelValue"])]),_:1}),a(i,{label:"项目名称"},{default:n(()=>[a(r,{modelValue:o.projectName,"onUpdate:modelValue":e[2]||(e[2]=l=>o.projectName=l),placeholder:"请输入项目名称",clearable:""},null,8,["modelValue"])]),_:1}),a(i,{label:"项目类型"},{default:n(()=>[a(g,{modelValue:o.projectType,"onUpdate:modelValue":e[3]||(e[3]=l=>o.projectType=l),placeholder:"请选择项目类型",clearable:"",style:{width:"100%"}},{default:n(()=>[a(c,{label:"工程类",value:"工程类"}),a(c,{label:"服务类",value:"服务类"})]),_:1},8,["modelValue"])]),_:1}),a(i,null,{default:n(()=>[a(m,{type:"primary",onClick:A},{default:n(()=>[...e[7]||(e[7]=[f("查询",-1)])]),_:1}),a(m,{onClick:H},{default:n(()=>[...e[8]||(e[8]=[f("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"]),te((L(),R(D,{ref_key:"tableRef",ref:w,data:z.value,style:{width:"100%"},border:"",stripe:"",onSelectionChange:Y,"highlight-current-row":""},{default:n(()=>[a(d,{type:"selection",width:"55",selectable:G}),a(d,{prop:"documentNo",label:"单据号",width:"130"}),a(d,{prop:"year",label:"年度",width:"80"}),a(d,{prop:"planNo",label:"计划号",width:"120"}),a(d,{prop:"seqNo",label:"序号",width:"70"}),a(d,{prop:"projectName",label:"项目名称",width:"150"}),a(d,{prop:"projectType",label:"项目类型",width:"90"},{default:n(l=>[a(j,{type:l.row.projectType==="工程类"?"primary":"success"},{default:n(()=>[f(T(l.row.projectType),1)]),_:2},1032,["type"])]),_:1}),a(d,{prop:"department",label:"所属部门",width:"120"}),a(d,{prop:"company",label:"所属公司",width:"180"}),a(d,{prop:"contactPerson",label:"项目对接人",width:"100"}),a(d,{prop:"budgetAmount",label:"预算金额(万元)",width:"120"},{default:n(l=>{var I;return[f(T(((I=l.row.budgetAmount)==null?void 0:I.toFixed(2))||"0.00"),1)]}),_:1}),a(d,{prop:"biddingMethod",label:"招标方式",width:"90"},{default:n(l=>[a(j,{type:l.row.biddingMethod==="招标"?"warning":"info"},{default:n(()=>[f(T(l.row.biddingMethod),1)]),_:2},1032,["type"])]),_:1}),a(d,{prop:"projectIntro",label:"项目简介",width:"150","show-overflow-tooltip":""})]),_:1},8,["data"])),[[Z,V.value]]),ae("div",ne,[a(P,{"current-page":p.currentPage,"onUpdate:currentPage":e[4]||(e[4]=l=>p.currentPage=l),"page-size":p.pageSize,"onUpdate:pageSize":e[5]||(e[5]=l=>p.pageSize=l),total:p.total,"page-sizes":[10,20,50,100],layout:"total, sizes, prev, pager, next, jumper",onSizeChange:Q,onCurrentChange:W},null,8,["current-page","page-size","total"])])]),_:1},8,["modelValue"])}}},pe=ee(re,[["__scopeId","data-v-f8c91229"]]);export{pe as S};
|