3 lines
80 KiB
JavaScript
3 lines
80 KiB
JavaScript
|
|
import{_ as fe,k as A,K as ae,o as K,c as ne,e,f as l,h as i,m as pe,L as _e,a as T,t as g,M as se,N as xe,F as me,j as V,q as Ve,E as H,i as ve,O as ce,g as he,r as ge,n as we,P as Ce,Q as ye,R as Te,I as De,S as Ne}from"./index-C1KISTGN.js";import{M as Se,A as je}from"./AnnualProcurementPlanDialog-ChZoZHwC.js";import{S as Ue}from"./SelectAnnualPlanDialog-BZD-2g5o.js";const Ye={class:"table-toolbar"},ke={__name:"PreBidApplicationDialog",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","submit"],setup(re,{emit:J}){const O=re,Q=J,z=A(O.modelValue),M=A("apply"),R=A(null),W=A(null),m=A(!1),$=A(!1),q=A(0),D=[{name:"招标文件模板(空白)",format:"xlsx",size:"12KB"}],G=()=>{const o=["序号","物料名称","物料编码","规格型号","品牌","计量单位","参考价(元)","预计数量","金额(元)","对接人","需求简介","备注"].join(",")+`
|
||
|
|
`,N=new Blob([o],{type:"application/vnd.ms-excel"}),U=URL.createObjectURL(N),r=document.createElement("a");r.href=U,r.download="招标文件模板.xlsx",r.click(),URL.revokeObjectURL(U),H.success("模板文件下载成功")},Z=ve(()=>{if(!s.planNo)return"";const x=new Date,o=x.getFullYear()+String(x.getMonth()+1).padStart(2,"0")+String(x.getDate()).padStart(2,"0"),N=Math.floor(Math.random()*1e3).toString().padStart(3,"0");return`ZB${o}${N}`}),s=Ve({applicant:"管理员",applyTime:new Date,phone:"",applicantCompany:"",type:"",planNo:"",projectCode:"",projectName:"",projectType:"",biddingType:"",expectedBiddingTime:null,budgetAmount:0,department:"",company:"",contactPerson:"",materials:[],files:[],templateUploadFiles:[],approveOpinion:"",approver:"审批管理员",approveRemark:""}),f={phone:[{required:!0,message:"请输入联系电话",trigger:"blur"},{pattern:/^1[3-9]\d{9}$/,message:"请输入正确的手机号码",trigger:"blur"}],applicantCompany:[{required:!0,message:"请选择所属公司",trigger:"change"}],type:[{required:!0,message:"请选择类型",trigger:"change"}],planNo:[{required:!0,message:"请选择计划号",trigger:"blur"}],biddingType:[{required:!0,message:"请选择招标类型",trigger:"change"}],expectedBiddingTime:[{required:!0,message:"请选择预计招标时间",trigger:"change"}],approveOpinion:[{required:!0,message:"请选择审批意见",trigger:"change"}]},I=[{name:"张三",department:"采购部",position:"采购专员",phone:"138-0001-0001"},{name:"李四",department:"采购部",position:"采购主管",phone:"138-0001-0002"},{name:"王五",department:"技术部",position:"技术经理",phone:"138-0001-0003"},{name:"赵六",department:"财务部",position:"财务专员",phone:"138-0001-0004"},{name:"孙七",department:"行政部",position:"行政主管",phone:"138-0001-0005"},{name:"周八",department:"运营部",position:"运营经理",phone:"138-0001-0006"},{name:"吴九",department:"人力资源部",position:"人事专员",phone:"138-0001-0007"},{name:"郑十",department:"市场部",position:"市场主管",phone:"138-0001-0008"}];ae(()=>O.modelValue,x=>{z.value=x,x&&ce(()=>{var o,N;(o=R.value)==null||o.clearValidate(),(N=W.value)==null||N.clearValidate(),M.value="apply"})}),ae(()=>s.planNo,()=>{s.projectCode=Z.value}),ae(z,x=>{Q("update:modelValue",x)});const ue=()=>{m.value=!0},Y=x=>{const o=x.planInfo;s.planNo=o.planNo,s.projectCode=Z.value,s.projectName=o.projectName,s.projectType=o.projectType,s.budgetAmount=o.budgetAmount,s.department=o.department,s.company=o.company,s.contactPerson=o.contactPerson,s.materials=x.materials.map((N,U)=>({...N,seqNo:String(U+1),brand:""})),H.success("已选择年度招采计划")},n=()=>{const x=s.materials.length+1;s.materials.push({seqNo:String(x),materialName:"",materialCode:"",spec:"",brand:"",unit:"",referencePrice:0,expectedQuantity:1,amount:0,contactPerson:"",applyDate:new Date,expectedDate:null,projectAttribute:"",requirementIntro:"",remark:""})},E=()=>{s.materials=[]},P=x=>{s.materials.splice(x,1)},v=x=>{const o=s.materials[x];o.amount=(o.referencePrice||0)*(o.expectedQuantity||0)},h=x=>{q.value=x,$.value=!0},ee=x=>{s.materials[q.value].contactPerson=x.name,$.value=!1},k=x=>{if(!x)return"";const o=new Date(x);return`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")}`},F=()=>{z.value=!1,le()},le=()=>{Object.assign(s,{applicant:"管理员",applyTime:new Date,phone:"",applicantCompany:"",type:"",planNo:"",projectCode:"",projectName:"",projectType:"",biddingType:"",expectedBiddingTime:null,budgetAmount:0,department:"",company:"",contactPerson:"",materials:[],files:[],templateUploadFiles:[],approveOpinion:"",approver:"审批管理员",approveRemark:""})},X=()=>{const x=M.value==="apply"?R.value:W.value;if(!x){H.warning("表单未初始化");return}x.validate(o=>{if(o){const N={...s,tabType:M.value};Q("submit",N),F()}else return H.error("请填写完整信息"),!1})};return(x,o)=>{const N=V("el-divider"),U=V("el-input"),r=V("el-form-item"),a=V("el-col"),j=V("el-date-picker"),c=V("el-row"),y=V("el-option
|