data_center/public/admin/assets/editTow.519bc47f.js

2 lines
7.5 KiB
JavaScript

import{B as z,C as K,a5 as Q,D as G,L as H}from"./element-plus.9c2fdfa8.js";import{u as J}from"./vue-router.e2f4a118.js";import{P as W}from"./index.3fc23cf2.js";import{r as I,v as C,d as X}from"./index.b57b84f0.js";import Y from"./list_two.06cab31a.js";import{d as w,s as Z,r as f,$ as g,o as s,c as ee,U as a,L as o,u as c,k as te,K as r,Q as p,R as i}from"./@vue.53f8d7c3.js";function le(m){return I.post({url:"/task_scheduling_plan.task_scheduling_plan/add",params:m})}function ue(m){return I.post({url:"/task_scheduling_plan.task_scheduling_plan/edit",params:m})}function fe(m){return I.get({url:"/task.scheduling/plan",params:m})}const ae={class:"edit-popup"},oe=w({name:"taskEidt"}),de=w({...oe,props:{task:{type:Object,defualt:()=>{}},company_id:{type:String,default:""}},emits:["success","close"],setup(m,{expose:A,emit:U}){const v=J(),D=U,B=Z(),_=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),j=m,V=f(!1),q=async(n=null)=>{var t;try{E.value.clearValidate&&((t=E.value)==null||t.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]=""}))},O=()=>{var n;if(_.value=="show")return(n=B.value)==null?void 0:n.close();E.value.validate(async t=>{var u;if(t){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 ue(d):await le(d),(u=B.value)==null||u.close(),D("success")}})},P=(n="add")=>{var t;_.value=n,(t=B.value)==null||t.open()},L=()=>{D("close")};return A({open:P,updatedForm:q}),(n,t)=>{const u=z,d=K,M=Q,N=G,$=H;return s(),ee("div",ae,[a(W,{ref_key:"popupRef",ref:B,title:c(k),async:!0,width:"800px",onConfirm:O,onClose:L,clickModalClose:c(_)=="show",button:c(_)!="show"},{default:o(()=>[a(N,{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":t[0]||(t[0]=l=>e.id=l),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(M,{disabled:c(V),modelValue:e.datetime,"onUpdate:modelValue":t[1]||(t[1]=l=>e.datetime=l),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":t[2]||(t[2]=l=>e.template_name=l),onClick:t[3]||(t[3]=l=>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":t[4]||(t[4]=l=>e.templateInfo.content=l),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":t[5]||(t[5]=l=>e.templateInfo.stage_day_one=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5929\u6570",type:"number"},{append:o(()=>[i("\u5929")]),_:1},8,["modelValue"])]),_:1}),a(d,{label:"\u4E00\u9636\u6BB5\u91D1\u989D"},{default:o(()=>[a(u,{disabled:"",modelValue:e.templateInfo.money,"onUpdate:modelValue":t[6]||(t[6]=l=>e.templateInfo.money=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91D1\u989D",type:"number"},{append:o(()=>[i("\u5143")]),_:1},8,["modelValue"])]),_:1}),a(d,{label:"\u4E8C\u9636\u6BB5\u5929\u6570"},{default:o(()=>[a(u,{disabled:"",modelValue:e.templateInfo.stage_day_two,"onUpdate:modelValue":t[7]||(t[7]=l=>e.templateInfo.stage_day_two=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5929\u6570",type:"number"},{append:o(()=>[i("\u5929")]),_:1},8,["modelValue"])]),_:1}),a(d,{label:"\u4E8C\u9636\u6BB5\u91D1\u989D"},{default:o(()=>[a(u,{disabled:"",modelValue:e.templateInfo.money_two,"onUpdate:modelValue":t[8]||(t[8]=l=>e.templateInfo.money_two=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91D1\u989D",type:"number"},{append:o(()=>[i("\u5143")]),_:1},8,["modelValue"])]),_:1}),h(+e.templateInfo.type)?(s(),r(d,{key:2,label:"\u4E09\u9636\u6BB5\u5929\u6570"},{default:o(()=>[a(u,{disabled:"",modelValue:e.templateInfo.stage_day_three,"onUpdate:modelValue":t[9]||(t[9]=l=>e.templateInfo.stage_day_three=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5929\u6570",type:"number"},{append:o(()=>[i("\u5929")]),_:1},8,["modelValue"])]),_:1})):p("",!0),h(+e.templateInfo.type)?(s(),r(d,{key:3,label:"\u4E09\u9636\u6BB5\u91D1\u989D"},{default:o(()=>[a(u,{disabled:"",modelValue:e.templateInfo.new_money_three,"onUpdate:modelValue":t[10]||(t[10]=l=>e.templateInfo.new_money_three=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91D1\u989D",type:"number"},{append:o(()=>[i("\u5143")]),_:1},8,["modelValue"])]),_:1})):p("",!0),+e.templateInfo.types==2?(s(),r(d,{key:4,label:"\u957F\u671F\u91D1\u989D"},{default:o(()=>[a(u,{disabled:"",modelValue:e.templateInfo.money_three,"onUpdate:modelValue":t[11]||(t[11]=l=>e.templateInfo.money_three=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91D1\u989D",type:"number"},{append:o(()=>[i("\u5143")]),_:1},8,["modelValue"])]),_:1})):p("",!0),e.templateInfo.type==32?(s(),r(d,{key:5,label:"\u4E2D\u8F6C\u70B9"},{default:o(()=>{var l,F,y;return[a(u,{disabled:"",placeholder:"\u8BF7\u9009\u62E9\u4E2D\u8F6C\u70B9",value:(y=(F=(l=e.templateInfo)==null?void 0:l.extend)==null?void 0:F.transfer)==null?void 0:y.address},null,8,["value"])]}),_:1})):p("",!0),e.templateInfo.type==32?(s(),r(d,{key:6,label:"\u7EC8\u70B9"},{default:o(()=>{var l,F,y;return[a(u,{disabled:"",placeholder:"\u8BF7\u9009\u62E9\u7EC8\u70B9",value:(y=(F=(l=e.templateInfo)==null?void 0:l.extend)==null?void 0:F.terminus)==null?void 0:y.address},null,8,["value"])]}),_:1})):p("",!0),e.templateInfo.type==35?(s(),r(d,{key:7,label:"\u5145\u503C\u91D1\u989D(\u5143)",prop:"recharge"},{default:o(()=>[a(u,{disabled:"",placeholder:"\u8BF7\u8F93\u5165\u5145\u503C\u91D1\u989D(\u5143)",modelValue:e.templateInfo.recharge,"onUpdate:modelValue":t[12]||(t[12]=l=>e.templateInfo.recharge=l),type:"number"},null,8,["modelValue"])]),_:1})):p("",!0)]),_:1},8,["rules","model"])]),_:1},8,["title","clickModalClose","button"]),a($,{modelValue:c(b),"onUpdate:modelValue":t[13]||(t[13]=l=>te(b)?b.value=l:null),title:"\u9009\u62E9\u4EFB\u52A1\u5B89\u6392",width:"60%"},{default:o(()=>[a(Y,{onCustomEvent:S,company_id:j.company_id},null,8,["company_id"])]),_:1},8,["modelValue"])])}}});const ne=X(de,[["__scopeId","data-v-cb07b410"]]),ce=Object.freeze(Object.defineProperty({__proto__:null,default:ne},Symbol.toStringTag,{value:"Module"}));export{ne as E,fe as a,ce as e};