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.
1 lines
7.9 KiB
1 lines
7.9 KiB
import{d as M,v as G,r as c,l as K,ag as L,M as A,k as o,h as d,c as m,a as _,t as I,u,e as t,w as r,F as y,O as v,m as b,i as j,_ as J,ac as Q,G as X,D as Z,ae as ee,bg as ae,H as te,K as le,E as se}from"./index-7e4fdde7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{u as k}from"./dict-bea2b24b.js";import{c as oe,a as re,b as ue,e as de,f as ne,h as ie}from"./orders-cdeae999.js";import{g as pe}from"./students-6c908cf7.js";const ce={class:"main-container"},me={class:"detail-head"},_e=_("span",{class:"iconfont iconxiangzuojiantou !text-xs"},null,-1),ye={class:"ml-[1px]"},ve=_("span",{class:"adorn"},"|",-1),be={class:"right"},fe={class:"fixed-footer-wrap"},he={class:"fixed-footer"},Me=M({__name:"orders_edit",setup(ge){const x=G(),D=parseInt(x.query.id),h=c(!1),B=x.meta.title,U={id:0,student_id:"",courses_id:"",courses_num:1,contract_id:"",amount:"",order_type:"",pay_type:"",payment_status:"",payment_time:0,type:"",staff_id:""},l=K({...U});D&&(async(f=0)=>{Object.assign(l,U);const a=await(await oe(f)).data;Object.keys(l).forEach(s=>{a[s]!=null&&(l[s]=a[s])})})(D);const C=c();c([]);let g=c([]);(async()=>{g.value=await(await k("zhjw_order_type")).data.dictionary})(),L(()=>g.value,()=>{l.order_type=g.value[0].value});let w=c([]);(async()=>{w.value=await(await k("zhjw_pay_type")).data.dictionary})(),L(()=>w.value,()=>{l.pay_type=w.value[0].value});let V=c([]);(async()=>{V.value=await(await k("zhjw_payment_status")).data.dictionary})(),L(()=>V.value,()=>{l.payment_status=V.value[0].value});let P=c([]);(async()=>{P.value=await(await k("is_radio")).data.dictionary})(),L(()=>P.value,()=>{l.is_deleted=P.value[0].value});const E=c([]);(async()=>{E.value=await(await re({})).data})();const T=c([]);(async()=>{T.value=await(await ue({})).data})();const S=c([]);(async()=>{S.value=await(await de({})).data})();const q=c([]);(async()=>{q.value=await(await pe({})).data})();const N=A(()=>({student_id:[{required:!0,message:o("studentIdPlaceholder"),trigger:"blur"}],courses_id:[{required:!0,message:"请选择课程",trigger:"blur"}],contract_id:[{required:!0,message:o("contractIdPlaceholder"),trigger:"blur"}],amount:[{required:!0,message:o("amountPlaceholder"),trigger:"blur"},{validator:(f,a,s)=>{const p=parseFloat(a);!/^\d+(\.\d{1,2})?$/.test(a)||p<.01||p>999999?s(new Error("请输入正确金额")):s()},trigger:"blur"}],order_type:[{required:!0,message:o("orderTypePlaceholder"),trigger:"blur"}],pay_type:[{required:!0,message:o("payTypePlaceholder"),trigger:"blur"}],payment_status:[{required:!0,message:o("paymentStatusPlaceholder"),trigger:"blur"}],payment_time:[{required:!0,message:o("paymentTimePlaceholder"),trigger:"blur"}]})),z=async f=>{h.value||!f||await f.validate(async a=>{a&&(h.value=!0,(D?ne:ie)(l).then(n=>{h.value=!1,history.back()}).catch(n=>{h.value=!1}))})},F=()=>{history.back()};return(f,a)=>{const s=J,p=Q,n=X,R=Z,W=ee,Y=ae,$=te,H=le,O=se;return d(),m("div",ce,[_("div",me,[_("div",{class:"left",onClick:a[0]||(a[0]=e=>F())},[_e,_("span",ye,I(u(o)("returnToPreviousPage")),1)]),ve,_("span",be,I(u(B)),1)]),t(H,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[t($,{model:l,"label-width":"90px",ref_key:"formRef",ref:C,rules:u(N),class:"page-form"},{default:r(()=>[t(n,{label:u(o)("studentId"),prop:"student_id"},{default:r(()=>[t(p,{class:"input-width",modelValue:l.student_id,"onUpdate:modelValue":a[1]||(a[1]=e=>l.student_id=e),clearable:"",placeholder:u(o)("studentIdPlaceholder")},{default:r(()=>[t(s,{label:"请选择",value:""}),(d(!0),m(y,null,v(E.value,(e,i)=>(d(),b(s,{key:i,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(n,{label:"签约人员",prop:"staff_id"},{default:r(()=>[t(p,{class:"input-width",modelValue:l.staff_id,"onUpdate:modelValue":a[2]||(a[2]=e=>l.staff_id=e),clearable:"",placeholder:"请选择签约人员"},{default:r(()=>[t(s,{label:"请选择",value:""}),(d(!0),m(y,null,v(q.value,(e,i)=>(d(),b(s,{key:i,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(n,{label:"课程",prop:"courses_id"},{default:r(()=>[t(p,{class:"input-width",modelValue:l.courses_id,"onUpdate:modelValue":a[3]||(a[3]=e=>l.courses_id=e),clearable:"",placeholder:"请选择课程"},{default:r(()=>[t(s,{label:"请选择",value:""}),(d(!0),m(y,null,v(S.value,(e,i)=>(d(),b(s,{key:i,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(n,{label:"课程数量",prop:"courses_num"},{default:r(()=>[t(R,{modelValue:l.courses_num,"onUpdate:modelValue":a[4]||(a[4]=e=>l.courses_num=e),clearable:"",placeholder:"请填写课程数量",class:"input-width"},null,8,["modelValue"])]),_:1}),t(n,{label:u(o)("contractId"),prop:"contract_id"},{default:r(()=>[t(p,{class:"input-width",modelValue:l.contract_id,"onUpdate:modelValue":a[5]||(a[5]=e=>l.contract_id=e),clearable:"",placeholder:u(o)("contractIdPlaceholder")},{default:r(()=>[t(s,{label:"请选择",value:""}),(d(!0),m(y,null,v(T.value,(e,i)=>(d(),b(s,{key:i,label:e.title,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(n,{label:u(o)("amount"),prop:"amount"},{default:r(()=>[t(W,{modelValue:l.amount,"onUpdate:modelValue":a[6]||(a[6]=e=>l.amount=e),clearable:"",placeholder:u(o)("amountPlaceholder"),class:"input-width",min:.01,max:999999},null,8,["modelValue","placeholder","min"])]),_:1},8,["label"]),t(n,{label:u(o)("orderType"),prop:"order_type"},{default:r(()=>[t(p,{class:"input-width",modelValue:l.order_type,"onUpdate:modelValue":a[7]||(a[7]=e=>l.order_type=e),clearable:"",placeholder:u(o)("orderTypePlaceholder")},{default:r(()=>[t(s,{label:"请选择",value:""}),(d(!0),m(y,null,v(u(g),(e,i)=>(d(),b(s,{key:i,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(n,{label:u(o)("payType"),prop:"pay_type"},{default:r(()=>[t(p,{class:"input-width",modelValue:l.pay_type,"onUpdate:modelValue":a[8]||(a[8]=e=>l.pay_type=e),clearable:"",placeholder:u(o)("payTypePlaceholder")},{default:r(()=>[t(s,{label:"请选择",value:""}),(d(!0),m(y,null,v(u(w),(e,i)=>(d(),b(s,{key:i,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(n,{label:u(o)("paymentStatus"),prop:"payment_status"},{default:r(()=>[t(p,{class:"input-width",modelValue:l.payment_status,"onUpdate:modelValue":a[9]||(a[9]=e=>l.payment_status=e),clearable:"",placeholder:u(o)("paymentStatusPlaceholder")},{default:r(()=>[t(s,{label:"请选择",value:""}),(d(!0),m(y,null,v(u(V),(e,i)=>(d(),b(s,{key:i,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(n,{label:"签约类型",prop:"type"},{default:r(()=>[t(p,{class:"input-width",modelValue:l.type,"onUpdate:modelValue":a[10]||(a[10]=e=>l.type=e),clearable:"",placeholder:"签约类型"},{default:r(()=>[t(s,{label:"请选择",value:""}),t(s,{label:"新签",value:1}),t(s,{label:"续费",value:2})]),_:1},8,["modelValue"])]),_:1}),t(n,{label:u(o)("paymentTime"),class:"input-width"},{default:r(()=>[t(Y,{class:"flex-1 !flex",modelValue:l.payment_time,"onUpdate:modelValue":a[11]||(a[11]=e=>l.payment_time=e),clearable:"",type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:u(o)("paymentTimePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1}),_("div",fe,[_("div",he,[t(O,{type:"primary",onClick:a[12]||(a[12]=e=>z(C.value))},{default:r(()=>[j(I(u(o)("save")),1)]),_:1}),t(O,{onClick:a[13]||(a[13]=e=>F())},{default:r(()=>[j(I(u(o)("cancel")),1)]),_:1})])])])}}});export{Me as default};
|
|
|