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.d5254df7.js";import{r as I,B as C,d as W}from"./index.5f96f8d7.js";import X from"./list_two.863babcc.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),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":l[6]||(l[6]=t=>e.templateInfo.money=t),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":l[7]||(l[7]=t=>e.templateInfo.stage_day_two=t),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":l[8]||(l[8]=t=>e.templateInfo.money_two=t),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":l[9]||(l[9]=t=>e.templateInfo.stage_day_three=t),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":l[10]||(l[10]=t=>e.templateInfo.new_money_three=t),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":l[11]||(l[11]=t=>e.templateInfo.money_three=t),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 t,F,B;return[a(u,{disabled:"",placeholder:"\u8BF7\u9009\u62E9\u4E2D\u8F6C\u70B9",value:(B=(F=(t=e.templateInfo)==null?void 0:t.extend)==null?void 0:F.transfer)==null?void 0:B.address},null,8,["value"])]}),_:1})):p("",!0),e.templateInfo.type==32?(s(),r(d,{key:6,label:"\u7EC8\u70B9"},{default:o(()=>{var t,F,B;return[a(u,{disabled:"",placeholder:"\u8BF7\u9009\u62E9\u7EC8\u70B9",value:(B=(F=(t=e.templateInfo)==null?void 0:t.extend)==null?void 0:F.terminus)==null?void 0:B.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":l[12]||(l[12]=t=>e.templateInfo.recharge=t),type:"number"},null,8,["modelValue"])]),_:1})):p("",!0)]),_:1},8,["rules","model"])]),_:1},8,["title","clickModalClose","button"]),a(N,{modelValue:c(b),"onUpdate:modelValue":l[13]||(l[13]=t=>ee(b)?b.value=t:null),title:"\u9009\u62E9\u4EFB\u52A1\u5B89\u6392",width:"60%"},{default:o(()=>[a(X,{onCustomEvent:S,company_id:U.company_id},null,8,["company_id"])]),_:1},8,["modelValue"])])}}});const de=W(oe,[["__scopeId","data-v-cb07b410"]]),fe=Object.freeze(Object.defineProperty({__proto__:null,default:de},Symbol.toStringTag,{value:"Module"}));export{de as E,_e as a,fe as e};
|