import{d as x,B as ee,y as le,x as ae,r as k,o as te,c as p,e as d,f as S,h as a,i as l,F as O,H as E,G as m,g,t as b,j as f,k as oe,T as se,u as s,q as ue}from"./index.a2494fc2.js";import{h as D,f as w,c as _,b as q,e as L,g as M}from"./uploadAction.0eabe13b.js";import{s as re}from"./purchaseResults.47ae601f.js";import{d as ne}from"./projectCollectionEnter.417bcc1b.js";import{o as ie}from"./index.7c249f3d.js";function F(N=!0){return[{required:N,message:"\u8BF7\u8F93\u5165\u7EDF\u4E00\u4FE1\u7528\u4EE3\u7801"},{pattern:/^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/g,message:"\u683C\u5F0F\u9519\u8BEF\uFF0C\u7EDF\u4E00\u4FE1\u7528\u4EE3\u7801\u7531\u5341\u516B\u4F4D\u7684\u6570\u5B57\u6216\u5927\u5199\u82F1\u6587\u5B57\u6BCD\u7EC4\u6210"}]}const de={class:"fillPurchasingResult footerPage"},pe={class:"flex justify-between"},ce={class:"el-upload__tip"},me={class:"el-upload__tip"},fe={class:"el-upload__tip"},_e={class:"el-upload__tip"},ve={class:"el-upload__tip"},ge={class:"footer"},be=x({name:"fillPurchasingResult"}),De=Object.assign(be,{setup(N){const C=ee.dictStore.uploadUrl,{proxy:j}=ue(),I=le(),P=ae(),R=k(),A=(c,u,n)=>{if(u==="")return n(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7"));if(/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(u))n();else return n(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7"))},B={bidName:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u6BB5\u540D\u79F0"}],supplier:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F9B\u5E94\u5546"}],supplierContact:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F9B\u5E94\u5546\u8054\u7CFB\u4EBA"}],supplierContactInfo:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F9B\u5E94\u5546\u8054\u7CFB\u65B9\u5F0F"},{validator:A,trigger:"blur"}],purchaseMethod:[{required:!0,message:"\u8BF7\u9009\u62E9\u91C7\u8D2D\u65B9\u5F0F"}],transactionAmount:[{required:!0,message:"\u8BF7\u8F93\u5165\u6210\u4EA4\u91D1\u989D"}],transactionTime:[{required:!0,message:"\u8BF7\u9009\u62E9\u6210\u4EA4\u65F6\u95F4"}],biddingDoc:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u6295\u6807\u6587\u4EF6"}],bidDoc:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u62DB\u6807\u6587\u4EF6"}],acceptanceLetter:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u4E2D\u6807\u901A\u77E5\u4E66"}]},o=k({sections:[{biddingDoc:[],bidDoc:[],acceptanceLetter:[]}],developCode:"",financialCode:""}),$=k(!1),H=async c=>{!c||c.validate(async u=>{if(u){$.value=!0;const n={projectId:P.query.id,tenders:o.value.sections.map(r=>({...r,biddingDoc:r.biddingDoc&&JSON.stringify(M(r.biddingDoc)),bidDoc:r.bidDoc&&JSON.stringify(M(r.bidDoc)),acceptanceLetter:r.acceptanceLetter&&JSON.stringify(M(r.acceptanceLetter))})),financialCode:o.value.financialCode,developCode:o.value.developCode};try{await re(n),$.value=!1,j.$message.success("\u63D0\u4EA4\u6210\u529F"),I.go(-1)}catch{$.value=!1}}})},J=()=>{var c;if(((c=o.value.sections)==null?void 0:c.length)>=10){j.$message.warning("\u6700\u591A\u6DFB\u52A010\u4E2A\u6807\u6BB5");return}o.value.sections.push({biddingDoc:[],bidDoc:[],acceptanceLetter:[]})},z=c=>{o.value.sections.splice(c,1)},T=k([]);return te(async()=>{T.value=(await ne()).data;const c=await ie({id:P.query.id});o.value.developCode=c.data.developCode}),(c,u)=>{const n=p("el-input"),r=p("el-form-item"),i=p("el-col"),y=p("el-row"),Y=p("el-card"),v=p("el-button"),W=p("el-radio"),Z=p("el-radio-group"),G=p("el-input-number"),K=p("el-date-picker"),U=p("el-upload"),Q=p("el-form");return d(),S("div",de,[a(Q,{ref_key:"formRef",ref:R,model:o.value,rules:B,"label-position":"right","label-width":"180px","label-suffix":":","scroll-to-error":""},{default:l(()=>[a(Y,{class:"w-full mb-16"},{default:l(()=>[a(y,null,{default:l(()=>[a(i,{span:12},{default:l(()=>[a(r,{label:"\u53D1\u6539\u7F16\u7801",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],prop:"developCode"},{default:l(()=>[a(n,{modelValue:o.value.developCode,"onUpdate:modelValue":u[0]||(u[0]=V=>o.value.developCode=V),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),a(i,{span:12},{default:l(()=>[a(r,{label:"\u8D22\u653F\u7F16\u7801",prop:"financialCode",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:l(()=>[a(n,{modelValue:o.value.financialCode,"onUpdate:modelValue":u[1]||(u[1]=V=>o.value.financialCode=V),placeholder:"\u8BF7\u586B\u5199"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),(d(!0),S(O,null,E(o.value.sections,(V,t)=>(d(),m(Y,{key:t,class:"w-full mb-16"},{header:l(()=>{var e;return[g("div",pe,[g("span",null,"\u6807\u6BB5"+b(t+1),1),((e=o.value.sections)==null?void 0:e.length)>1?(d(),m(v,{key:0,link:"",type:"danger",onClick:h=>z(t)},{default:l(()=>u[5]||(u[5]=[f("\u5220\u9664")])),_:2},1032,["onClick"])):oe("",!0)])]}),default:l(()=>[a(y,{gutter:40},{default:l(()=>[a(i,{span:12},{default:l(()=>[a(r,{label:"\u6807\u6BB5\u540D\u79F0",prop:`sections[${t}].bidName`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:l(()=>[a(n,{modelValue:o.value.sections[t].bidName,"onUpdate:modelValue":e=>o.value.sections[t].bidName=e,maxlength:"50",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),a(i,{span:12},{default:l(()=>[a(r,{label:"\u4F9B\u5E94\u5546",prop:`sections[${t}].supplier`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:l(()=>[a(n,{modelValue:o.value.sections[t].supplier,"onUpdate:modelValue":e=>o.value.sections[t].supplier=e,maxlength:"50",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),a(i,{span:12},{default:l(()=>[a(r,{label:"\u4F9B\u5E94\u5546\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801",prop:`sections[${t}].supplierSocialCreditCode`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:l(()=>[a(n,{modelValue:o.value.sections[t].supplierSocialCreditCode,"onUpdate:modelValue":e=>o.value.sections[t].supplierSocialCreditCode=e,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),a(i,{span:12},{default:l(()=>[a(r,{label:"\u4F9B\u5E94\u5546\u8054\u7CFB\u4EBA",prop:`sections[${t}].supplierContact`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:l(()=>[a(n,{modelValue:o.value.sections[t].supplierContact,"onUpdate:modelValue":e=>o.value.sections[t].supplierContact=e,maxlength:"50",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),a(i,{span:12},{default:l(()=>[a(r,{label:"\u4F9B\u5E94\u5546\u8054\u7CFB\u65B9\u5F0F",prop:`sections[${t}].supplierContactInfo`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:l(()=>[a(n,{modelValue:o.value.sections[t].supplierContactInfo,"onUpdate:modelValue":e=>o.value.sections[t].supplierContactInfo=e,maxlength:"11",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),a(i,{span:24},{default:l(()=>[a(r,{label:"\u91C7\u8D2D\u65B9\u5F0F",prop:`sections[${t}].purchaseMethod`,rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}]},{default:l(()=>[a(Z,{modelValue:o.value.sections[t].purchaseMethod,"onUpdate:modelValue":e=>o.value.sections[t].purchaseMethod=e},{default:l(()=>{var e;return[(d(!0),S(O,null,E((e=T.value)==null?void 0:e.filter(h=>h.type==="PURCHASE_METHOD"),(h,X)=>(d(),m(W,{key:X,label:h.value},{default:l(()=>[f(b(h.label),1)]),_:2},1032,["label"]))),128))]}),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),a(i,{span:12},{default:l(()=>[a(r,{label:"\u6210\u4EA4\u91D1\u989D",prop:`sections[${t}].transactionAmount`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:l(()=>[a(G,{modelValue:o.value.sections[t].transactionAmount,"onUpdate:modelValue":e=>o.value.sections[t].transactionAmount=e,placeholder:"\u8BF7\u586B\u5199",min:0,controls:!1,onMousewheel:u[2]||(u[2]=se(()=>{},["prevent"]))},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),a(i,{span:12},{default:l(()=>[a(r,{label:"\u6210\u4EA4\u65F6\u95F4",prop:`sections[${t}].transactionTime`,rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}]},{default:l(()=>[a(K,{modelValue:o.value.sections[t].transactionTime,"onUpdate:modelValue":e=>o.value.sections[t].transactionTime=e,type:"date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",placeholder:"\u8BF7\u9009\u62E9"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024)]),_:2},1024),a(y,{gutter:40},{default:l(()=>[a(i,{span:12},{default:l(()=>[["00","05"].includes(o.value.sections[t].purchaseMethod)?(d(),m(r,{key:0,label:"\u91C7\u8D2D\u4EE3\u7406\u673A\u6784"},{default:l(()=>[a(n,{modelValue:o.value.sections[t].agency,"onUpdate:modelValue":e=>o.value.sections[t].agency=e,maxlength:"50",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):(d(),m(r,{key:1,label:"\u91C7\u8D2D\u4EE3\u7406\u673A\u6784",prop:`sections[${t}].agency`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:l(()=>[a(n,{modelValue:o.value.sections[t].agency,"onUpdate:modelValue":e=>o.value.sections[t].agency=e,maxlength:"50",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]))]),_:2},1024),a(i,{span:12},{default:l(()=>[["00","05"].includes(o.value.sections[t].purchaseMethod)?(d(),m(r,{key:0,label:"\u91C7\u8D2D\u4EE3\u7406\u673A\u6784\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801"},{default:l(()=>[a(n,{modelValue:o.value.sections[t].purchaseSocialCreditCode,"onUpdate:modelValue":e=>o.value.sections[t].purchaseSocialCreditCode=e,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):(d(),m(r,{key:1,label:"\u91C7\u8D2D\u4EE3\u7406\u673A\u6784\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801",prop:`sections[${t}].purchaseSocialCreditCode`,rules:s(F)(!0)},{default:l(()=>[a(n,{modelValue:o.value.sections[t].purchaseSocialCreditCode,"onUpdate:modelValue":e=>o.value.sections[t].purchaseSocialCreditCode=e,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"]))]),_:2},1024),a(i,{span:12},{default:l(()=>[a(r,{label:"\u9884\u7B97\u6267\u884C\u786E\u8BA4\u4E66\u7F16\u53F7"},{default:l(()=>[a(n,{modelValue:o.value.sections[t].budgetExecConfirmNo,"onUpdate:modelValue":e=>o.value.sections[t].budgetExecConfirmNo=e,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024)]),_:2},1024),a(y,null,{default:l(()=>[a(i,{span:12},{default:l(()=>[a(r,{label:"\u6295\u6807\u6587\u4EF6",prop:`sections[${t}].biddingDoc`,rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20"}]},{default:l(()=>[a(U,{"file-list":o.value.sections[t].biddingDoc,"onUpdate:fileList":e=>o.value.sections[t].biddingDoc=e,class:"w-full",action:s(C),"on-success":e=>s(D)(e,o.value.sections[t].biddingDoc),"before-upload":e=>s(w)(e,{types:s(_)}),accept:s(_).map(e=>`.${e}`).join(","),"on-preview":s(q)},{tip:l(()=>[g("div",ce," \u652F\u6301"+b(s(L))+"\u6587\u4EF6 ",1)]),default:l(()=>[a(v,{type:"primary",plain:""},{default:l(()=>u[6]||(u[6]=[f("\u9009\u62E9\u6587\u4EF6")])),_:1})]),_:2},1032,["file-list","onUpdate:fileList","action","on-success","before-upload","accept","on-preview"])]),_:2},1032,["prop"])]),_:2},1024),a(i,{span:12},{default:l(()=>[o.value.sections[t].purchaseMethod!=="00"?(d(),m(r,{key:0,label:"\u62DB\u6807\u6587\u4EF6",prop:`sections[${t}].bidDoc`,rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20"}]},{default:l(()=>[a(U,{"file-list":o.value.sections[t].bidDoc,"onUpdate:fileList":e=>o.value.sections[t].bidDoc=e,class:"w-full",action:s(C),"on-success":e=>s(D)(e,o.value.sections[t].bidDoc),"before-upload":e=>s(w)(e,{types:s(_)}),accept:s(_).map(e=>`.${e}`).join(","),"on-preview":s(q)},{tip:l(()=>[g("div",me," \u652F\u6301"+b(s(L))+"\u6587\u4EF6 ",1)]),default:l(()=>[a(v,{type:"primary",plain:""},{default:l(()=>u[7]||(u[7]=[f("\u9009\u62E9\u6587\u4EF6")])),_:1})]),_:2},1032,["file-list","onUpdate:fileList","action","on-success","before-upload","accept","on-preview"])]),_:2},1032,["prop"])):(d(),m(r,{key:1,label:"\u62DB\u6807\u6587\u4EF6"},{default:l(()=>[a(U,{"file-list":o.value.sections[t].bidDoc,"onUpdate:fileList":e=>o.value.sections[t].bidDoc=e,class:"w-full",action:s(C),"on-success":e=>s(D)(e,o.value.sections[t].bidDoc),"before-upload":e=>s(w)(e,{types:s(_)}),accept:s(_).map(e=>`.${e}`).join(","),"on-preview":s(q)},{tip:l(()=>[g("div",fe," \u652F\u6301"+b(s(L))+"\u6587\u4EF6 ",1)]),default:l(()=>[a(v,{type:"primary",plain:""},{default:l(()=>u[8]||(u[8]=[f("\u9009\u62E9\u6587\u4EF6")])),_:1})]),_:2},1032,["file-list","onUpdate:fileList","action","on-success","before-upload","accept","on-preview"])]),_:2},1024))]),_:2},1024),a(i,{span:12},{default:l(()=>[["00","05"].includes(o.value.sections[t].purchaseMethod)?(d(),m(r,{key:1,label:"\u4E2D\u6807\u901A\u77E5\u4E66"},{default:l(()=>[a(U,{"file-list":o.value.sections[t].acceptanceLetter,"onUpdate:fileList":e=>o.value.sections[t].acceptanceLetter=e,class:"w-full",action:s(C),"on-success":e=>s(D)(e,o.value.sections[t].acceptanceLetter),"before-upload":e=>s(w)(e,{types:s(_)}),accept:s(_).map(e=>`.${e}`).join(","),"on-preview":s(q)},{tip:l(()=>[g("div",ve," \u652F\u6301"+b(s(L))+"\u6587\u4EF6 ",1)]),default:l(()=>[a(v,{type:"primary",plain:""},{default:l(()=>u[10]||(u[10]=[f("\u9009\u62E9\u6587\u4EF6")])),_:1})]),_:2},1032,["file-list","onUpdate:fileList","action","on-success","before-upload","accept","on-preview"])]),_:2},1024)):(d(),m(r,{key:0,label:"\u4E2D\u6807\u901A\u77E5\u4E66",prop:`sections[${t}].acceptanceLetter`,rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20"}]},{default:l(()=>[a(U,{"file-list":o.value.sections[t].acceptanceLetter,"onUpdate:fileList":e=>o.value.sections[t].acceptanceLetter=e,class:"w-full",action:s(C),"on-success":e=>s(D)(e,o.value.sections[t].acceptanceLetter),"before-upload":e=>s(w)(e,{types:s(_)}),accept:s(_).map(e=>`.${e}`).join(","),"on-preview":s(q)},{tip:l(()=>[g("div",_e," \u652F\u6301"+b(s(L))+"\u6587\u4EF6 ",1)]),default:l(()=>[a(v,{type:"primary",plain:""},{default:l(()=>u[9]||(u[9]=[f("\u9009\u62E9\u6587\u4EF6")])),_:1})]),_:2},1032,["file-list","onUpdate:fileList","action","on-success","before-upload","accept","on-preview"])]),_:2},1032,["prop"]))]),_:2},1024),a(i,{span:24},{default:l(()=>[a(y,{gutter:40},{default:l(()=>[a(i,{span:12},{default:l(()=>[a(r,{label:"\u76D1\u7406\u5355\u4F4D"},{default:l(()=>[a(n,{modelValue:o.value.sections[t].supervisingUnit,"onUpdate:modelValue":e=>o.value.sections[t].supervisingUnit=e,maxlength:"50",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024),a(i,{span:12},{default:l(()=>[a(r,{label:"\u76D1\u7406\u5355\u4F4D\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801",rules:s(F)(!1)},{default:l(()=>[a(n,{modelValue:o.value.sections[t].supervisingUnitCode,"onUpdate:modelValue":e=>o.value.sections[t].supervisingUnitCode=e,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["rules"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),g("p",null,[a(v,{type:"primary",plain:"",icon:"Plus",class:"w-full",onClick:J},{default:l(()=>u[11]||(u[11]=[f("\u6DFB\u52A0\u6807\u6BB5")])),_:1})])]),_:1},8,["model"]),g("div",ge,[a(v,{onClick:u[3]||(u[3]=V=>s(I).go(-1))},{default:l(()=>u[12]||(u[12]=[f(" \u8FD4\u56DE ")])),_:1}),a(v,{type:"primary",loading:$.value,onClick:u[4]||(u[4]=V=>H(R.value))},{default:l(()=>u[13]||(u[13]=[f(" \u63D0\u4EA4 ")])),_:1},8,["loading"])])])}}});export{De as default};