Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

2 lines
3.6KB

  1. import{o as I,p as b}from"./purchaseResults.872500ae.js";import{p as x}from"./projectStore.0dd65f8f.js";import{d as O,r as f,J as C,L as H,c as i,e as S,G as k,i as r,g as q,h as l,j as v,q as B}from"./index.2dada31c.js";const $={class:"dialog-footer"},E=O({name:"implementPlanDialog"}),R=Object.assign(E,{props:{visible:{type:Boolean,default:!1},data:{type:Object,default:()=>{}}},emits:["close"],setup(D,{expose:Y,emit:g}){const{proxy:w}=B(),s=D,d=g,a=f({}),u=f(),T=(n,e,t)=>new Date(e).getTime()>=new Date(a.value.finalInspectionDate).getTime()?t(new Error("\u9879\u76EE\u5F00\u5DE5\u65F6\u95F4\u5FC5\u987B\u5728\u9879\u76EE\u7EC8\u9A8C\u65F6\u95F4\u4E4B\u524D")):new Date(e).getTime()>=new Date(a.value.startTrialOperationDate).getTime()?t(new Error("\u9879\u76EE\u5F00\u5DE5\u65F6\u95F4\u5FC5\u987B\u5728\u9879\u76EE\u8BD5\u8FD0\u884C\u5F00\u59CB\u65F6\u95F4\u4E4B\u524D")):t(),_=(n,e,t)=>new Date(e).getTime()<=new Date(a.value.projectStartDate).getTime()?t(new Error("\u9879\u76EE\u8BD5\u8FD0\u884C\u5F00\u59CB\u65F6\u95F4\u5FC5\u987B\u5728\u9879\u76EE\u5F00\u5DE5\u65F6\u95F4\u4E4B\u540E")):new Date(e).getTime()>=new Date(a.value.finalInspectionDate).getTime()?t(new Error("\u9879\u76EE\u521D\u9A8C\u65F6\u95F4\u5FC5\u987B\u5728\u9879\u76EE\u7EC8\u9A8C\u65F6\u95F4\u4E4B\u524D")):t(),y={projectStartDate:[{required:!0,message:"\u8BF7\u8F93\u5165"},{validator:T}],startTrialOperationDate:[{required:!0,message:"\u8BF7\u9009\u62E9"},{validator:_}],finalInspectionDate:[{required:!0,message:"\u8BF7\u9009\u62E9"}]},m=f(!1),V=async n=>{!n||await n.validate(async e=>{if(e){m.value=!0;try{const t={...a.value,projectId:s.data.id};await b(t),w.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),m.value=!1,d("close",!0)}catch{m.value=!1}}})};return C(()=>s.visible,async n=>{if(n){await H(),u.value.clearValidate();const e=await x(s.data.id),t=await I(s.data.id);a.value=t!=null&&t.data?{...t.data,finalInspectionDate:e.data.planAcceptanceTime}:{finalInspectionDate:e.data.planAcceptanceTime}}}),Y({formRef:u}),(n,e)=>{const t=i("el-date-picker"),p=i("el-form-item"),M=i("el-form"),c=i("el-button"),j=i("el-dialog");return S(),k(j,{"model-value":D.visible,title:"\u586B\u5199\u5B9E\u65BD\u8BA1\u5212",onClose:e[5]||(e[5]=o=>d("close"))},{footer:r(()=>[q("span",$,[l(c,{type:"primary",loading:m.value,onClick:e[3]||(e[3]=o=>V(u.value))},{default:r(()=>e[6]||(e[6]=[v("\u63D0\u4EA4")])),_:1},8,["loading"]),l(c,{onClick:e[4]||(e[4]=o=>d("close"))},{default:r(()=>e[7]||(e[7]=[v("\u5173\u95ED")])),_:1})])]),default:r(()=>[l(M,{ref_key:"formRef",ref:u,model:a.value,rules:y,"label-suffix":"\uFF1A","label-width":"140"},{default:r(()=>[l(p,{label:"\u9879\u76EE\u5F00\u5DE5\u65F6\u95F4",prop:"projectStartDate"},{default:r(()=>[l(t,{modelValue:a.value.projectStartDate,"onUpdate:modelValue":e[0]||(e[0]=o=>a.value.projectStartDate=o),type:"date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"\u8BF7\u9009\u62E9"},null,8,["modelValue"])]),_:1}),l(p,{label:"\u8BD5\u8FD0\u884C\u5F00\u59CB\u65F6\u95F4",prop:"startTrialOperationDate"},{default:r(()=>[l(t,{modelValue:a.value.startTrialOperationDate,"onUpdate:modelValue":e[1]||(e[1]=o=>a.value.startTrialOperationDate=o),type:"date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"\u8BF7\u9009\u62E9"},null,8,["modelValue"])]),_:1}),l(p,{label:"\u9879\u76EE\u7EC8\u9A8C\u65F6\u95F4",prop:"finalInspectionDate"},{default:r(()=>[l(t,{modelValue:a.value.finalInspectionDate,"onUpdate:modelValue":e[2]||(e[2]=o=>a.value.finalInspectionDate=o),type:"date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"\u8BF7\u9009\u62E9"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{R as default};