You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

implementPlanDialog.492b7f36.js 5.0KB

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