2 lines
7.6 KiB
JavaScript
2 lines
7.6 KiB
JavaScript
|
import{B as $,C as z,a5 as K,D as Q,L as G}from"./element-plus.10e48c93.js";import{u as H}from"./vue-router.9f65afb1.js";import{P as J}from"./index.c570839a.js";import{r as I,B as C,d as W}from"./index.f095bcc5.js";import X from"./list_two.e613afc1.js";import{d as w,s as Y,r as f,$ as g,o as s,c as Z,U as a,L as o,K as r,Q as p,u as c,R as i,k as ee}from"./@vue.51d7f2d8.js";function le(m){return I.post({url:"/task_scheduling_plan.task_scheduling_plan/add",params:m})}function te(m){return I.post({url:"/task_scheduling_plan.task_scheduling_plan/edit",params:m})}function _e(m){return I.get({url:"/task_scheduling_plan.task_scheduling_plan/lists",params:m})}const ue={class:"edit-popup"},ae=w({name:"taskEidt"}),oe=w({...ae,props:{task:{type:Object,defualt:()=>{}},company_id:{type:String,default:""}},emits:["success","close"],setup(m,{expose:A,emit:D}){const U=m,v=H(),y=Y(),_=f("add");f({});const b=f(!1),k=f("\u521B\u5EFA\u65E5\u7A0B\u5B89\u6392"),x=n=>{e.start_time=C(n[0]).split(" ")[0],e.end_time=C(n[1]).split(" ")[0]},e=g({id:"",create_user_id:"",status:"",template_id:"",scheduling_id:"",template_name:"",start_time:"",end_time:"",datetime:"",content:"",templateInfo:{}}),T=g({datetime:{required:!0,message:"\u8BF7\u9009\u62E9\u65F6\u95F4\u8303\u56F4",trigger:"blur"},template_id:{required:!0,message:"\u8BF7\u9009\u62E9\u4EFB\u52A1\u5B89\u6392",trigger:"change"}}),R=g([31,32,33,34,35,45,48,49]),h=n=>!R.includes(n);function S(n){b.value=!1,e.template_id=n.id,e.template_name=n.title}const E=f(null),V=f(!1),j=async(n=null)=>{var l;try{E.value.clearValidate&&((l=E.value)==null||l.clearValidate())}catch(u){console.log(u)}_.value=="show"?(k.value="\u67E5\u770B\u65E5\u7A0B\u5B89\u6392",V.value=!0,Object.keys(e).forEach(u=>{n[u]!=null&&n[u]!=null&&(e[u]=n[u])}),e.datetime=[e.start_time.split(" ")[0],e.end_time.split(" ")[0]]):(V.value=!1,Object.keys(e).forEach(u=>{e[u]=""}))},q=()=>{var n;if(_.value=="show")return(n=y.value)==null?void 0:n.close();E.value.validate(async l=>{var u;if(l){const d={...e};v.query.id&&(d.scheduling_id=v.query.id.toString()),d.start_time=d.start_time.split(" ")[0],d.end_time=d.end_time.split(" ")[0],_.value=="edit"?await te(d):await le(d),(u=y.value)==null||u.close(),D("success")}})},O=(n="add")=>{var l;_.value=n,(l=y.value)==null||l.open()},P=()=>{D("close")};return A({open:O,updatedForm:j}),(n,l)=>{const u=$,d=z,L=K,M=Q,N=G;return s(),Z("div",ue,[a(J,{ref_key:"popupRef",ref:y,title:c(k),async:!0,width:"800px",onConfirm:q,onClose:P,clickModalClose:c(_)=="show",button:c(_)!="show"},{default:o(()=>[a(M,{ref_key:"formRef",ref:E,rules:T,class:"formdata",model:e,"label-width":"120px"},{default:o(()=>[e.id?(s(),r(d,{key:0,label:"\u4EFB\u52A1ID",prop:"id"},{default:o(()=>[a(u,{disabled:!0,modelValue:e.id,"onUpdate:modelValue":l[0]||(l[0]=t=>e.id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EFB\u52A1ID"},null,8,["modelValue"])]),_:1})):p("",!0),a(d,{label:"\u4EFB\u52A1\u65E5\u671F",prop:"datetime"},{default:o(()=>[a(L,{disabled:c(V),modelValue:e.datetime,"onUpdate:modelValue":l[1]||(l[1]=t=>e.datetime=t),name:"datetime",type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65F6\u95F4","end-placeholder":"\u7ED3\u675F\u65F6\u95F4",onChange:x},null,8,["disabled","modelValue"])]),_:1}),a(d,{label:"\u4EFB\u52A1\u5B89\u6392",prop:"template_id"},{default:o(()=>[a(u,{disabled:c(V),modelValue:e.template_name,"onUpdate:modelValue":l[2]||(l[2]=t=>e.template_name=t),onClick:l[3]||(l[3]=t=>b.value=!0),name:"template_id",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u5B89\u6392"},null,8,["disabled","modelValue"])]),_:1}),e.template_name?(s(),r(d,{key:1,label:"\u4EFB\u52A1\u63CF\u8FF0"},{default:o(()=>[a(u,{disabled:"",modelValue:e.templateInfo.content,"onUpdate:modelValue":l[4]||(l[4]=t=>e.templateInfo.content=t),placeholder:"\u6CA1\u6709\u4EFB\u52A1\u63CF\u8FF0"},null,8,["modelValue"])]),_:1})):p("",!0),a(d,{label:"\u4E00\u9636\u6BB5\u5929\u6570"},{default:o(()=>[a(u,{disabled:"",modelValue:e.templateInfo.stage_day_one,"onUpdate:modelValue":l[5]||(l[5]=t=>e.templateInfo.stage_day_one=t),c
|