choose-modal.11fe92.js 4.3 KB

1
  1. import{_ as E,d as q,aV as M,x as m,bG as R,aO as Y,A as S,dZ as A,r as v,aD as H,o as i,G as D,D as o,H as I,m as l,aQ as L,l as t,cn as r,d_ as N,c as j,F as G,E as T,dv as _,h as z,bY as O,M as P,ar as Q,d$ as Z,e0 as $}from"./index.js";const J={style:{display:"flex","justify-content":"flex-end"}},K=q({__name:"choose-modal",props:{visible:{type:Boolean,required:!0},data:{type:null,required:!0},type:{type:String,required:!0}},emits:["refresh"],setup(d,{emit:F}){const c=d,s=M(c,"visible"),g=m(null),{run:V,data:y,loading:b}=R({initalData:[],success(n){y.value=n.item}}),u=m({inv_fee:0,return_inv_fee:0,cost_fee:0,return_cost_fee:0,day_time:""}),p=m(!1),h=Y();S(()=>s.value,()=>{!s.value||(u.value={...c.data},V(A({size:1e3,pid:"58"})))});const C={uid:[{required:!0,message:"\u8BF7\u9009\u62E9\u7528\u6237",trigger:"change"}],day_time:[{required:!0,message:"\u8BF7\u9009\u62E9\u65F6\u95F4",trigger:"change"}],inv_fee:[{required:!0,message:"\u8BF7\u8F93\u5165\u5F00\u7968\u91D1\u989D",trigger:"change"}],return_inv_fee:[{required:!0,message:"\u8BF7\u8F93\u5165\u9000\u7968\u91D1\u989D",trigger:"change"}],cost_fee:[{required:!0,message:"\u8BF7\u8F93\u5165\u5F00\u7968\u6210\u672C\u91D1\u989D",trigger:"change"}],return_cost_fee:[{required:!0,message:"\u8BF7\u8F93\u5165\u9000\u7968\u6210\u672C\u91D1\u989D",trigger:"change"}]};async function B(){try{await g.value.validate(),p.value=!0;const n=c.type==="create"?Z:$,{code:a,message:f}=await n(u.value);p.value=!1,h({code:a,message:f,responseCode:1,handler:()=>{s.value=!1,F("refresh")}})}catch{}}function w(){u.value={inv_fee:0,return_inv_fee:0,cost_fee:0,return_cost_fee:0,day_time:""}}return(n,a)=>{const f=v("el-option"),x=v("el-select"),U=v("el-dialog"),k=H("loading");return i(),D(U,{top:"10vh","close-on-click-modal":!1,modelValue:l(s),"onUpdate:modelValue":a[6]||(a[6]=e=>Q(s)?s.value=e:null),title:(d.type==="create"?"\u6DFB\u52A0":"\u7F16\u8F91")+"\u91C7\u8D2D\u5458\u5F00\u7968\u8865\u5145",center:"",width:"1040px",onClose:w},{default:o(()=>[I((i(),D(l(L),{"label-width":"120px",rules:C,ref_key:"formRef",ref:g,model:u.value},{default:o(()=>[t(l(r),{label:"\u6708\u4EFD",prop:"day_time"},{default:o(()=>[t(l(N),{modelValue:u.value.day_time,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value.day_time=e),style:{width:"100%"},placeholder:"\u6708\u4EFD","value-format":"YYYY-MM",type:"month",disabledDate:e=>e.getTime()>Date.now(),disabled:d.type==="update"},null,8,["modelValue","disabledDate","disabled"])]),_:1}),t(l(r),{label:"\u91C7\u8D2D\u5458",prop:"uid"},{default:o(()=>[t(x,{placeholder:"\u91C7\u8D2D\u5458",modelValue:u.value.uid,"onUpdate:modelValue":a[1]||(a[1]=e=>u.value.uid=e),"w-full":"",filterable:"",disabled:d.type==="update"},{default:o(()=>[(i(!0),j(G,null,T(l(y),e=>(i(),D(f,{key:e.account_id,value:e.account_id,label:e.nickname,disabled:e.status=="0"},null,8,["value","label","disabled"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),t(l(r),{label:"\u5F00\u7968\u91D1\u989D",prop:"inv_fee"},{default:o(()=>[t(l(_),{modelValue:u.value.inv_fee,"onUpdate:modelValue":a[2]||(a[2]=e=>u.value.inv_fee=e),placeholder:"\u5F00\u7968\u91D1\u989D",unit:"\u5143"},null,8,["modelValue"])]),_:1}),t(l(r),{label:"\u9000\u7968\u91D1\u989D",prop:"return_inv_fee"},{default:o(()=>[t(l(_),{modelValue:u.value.return_inv_fee,"onUpdate:modelValue":a[3]||(a[3]=e=>u.value.return_inv_fee=e),placeholder:"\u9000\u7968\u91D1\u989D",unit:"\u5143"},null,8,["modelValue"])]),_:1}),t(l(r),{label:"\u5F00\u7968\u6210\u672C\u91D1\u989D",prop:"cost_fee"},{default:o(()=>[t(l(_),{modelValue:u.value.cost_fee,"onUpdate:modelValue":a[4]||(a[4]=e=>u.value.cost_fee=e),placeholder:"\u5F00\u7968\u6210\u672C\u91D1\u989D",unit:"\u5143"},null,8,["modelValue"])]),_:1}),t(l(r),{label:"\u9000\u7968\u6210\u672C\u91D1\u989D",prop:"return_cost_fee"},{default:o(()=>[t(l(_),{modelValue:u.value.return_cost_fee,"onUpdate:modelValue":a[5]||(a[5]=e=>u.value.return_cost_fee=e),placeholder:"\u9000\u7968\u6210\u672C\u91D1\u989D",unit:"\u5143"},null,8,["modelValue"])]),_:1}),z("div",J,[t(l(O),{type:"primary",onClick:B},{default:o(()=>[P("\u4FDD\u5B58")]),_:1})])]),_:1},8,["model"])),[[k,l(b)||p.value]])]),_:1},8,["modelValue","title"])}}});var X=E(K,[["__scopeId","data-v-0cd6f8a2"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/system/managerSetting/component/choose-modal.vue"]]);export{X as default};