1 |
- import{aA as c,d as S,P as j,r as m,x as C,o as w,C as g,A as i,f as l,a,D as B,k as A,a2 as O,a9 as q,V as J,W as M,J as R,Z as T,_ as W,__tla as Z}from"./index-0b2503c4.js";import{_ as E,__tla as G}from"./Dialog-3207cd36.js";import{u as K,__tla as L}from"./useMessage-d05433ee.js";let f,_,H,X=Promise.all([(()=>{try{return Z}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return L}catch{}})()]).then(async()=>{_={getPartitionBrothersPage:async o=>await c.get({url:"/distri/partition-brothers/page",params:o}),getPartitionBrothers:async o=>await c.get({url:"/distri/partition-brothers/get?id="+o}),createPartitionBrothers:async o=>await c.post({url:"/distri/partition-brothers/create",data:o}),updatePartitionBrothers:async o=>await c.put({url:"/distri/partition-brothers/update",data:o}),deletePartitionBrothers:async o=>await c.delete({url:"/distri/partition-brothers/delete?id="+o}),exportPartitionBrothers:async o=>await c.download({url:"/distri/partition-brothers/export-excel",params:o})},f=W(S({name:"PartitionBrothersForm",__name:"PartitionBrothersForm",emits:["success"],setup(o,{expose:x,emit:z}){const{t:h}=j(),y=K(),d=m(!1),b=m(""),u=m(!1),V=m(""),t=m({id:void 0,userId:void 0,partNo:void 0,price:void 0,hasHit:void 0,afterHitQuota:void 0,size:void 0}),I=C({hasHit:[{required:!0,message:"\u662F\u5426\u78B0\u649E 0\u4E3A\u672A\u78B0\u649E 1\u4E3A\u5DF2\u78B0\u649E\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),v=m();x({open:async(s,e)=>{if(d.value=!0,b.value=h("action."+s),V.value=s,Q(),e){u.value=!0;try{t.value=await _.getPartitionBrothers(e)}finally{u.value=!1}}}});const U=z,N=async()=>{await v.value.validate(),u.value=!0;try{const s=t.value;V.value==="create"?(await _.createPartitionBrothers(s),y.success(h("common.createSuccess"))):(await _.updatePartitionBrothers(s),y.success(h("common.updateSuccess"))),d.value=!1,U("success")}finally{u.value=!1}},Q=()=>{var s;t.value={id:void 0,userId:void 0,partNo:void 0,price:void 0,hasHit:void 0,afterHitQuota:void 0,size:void 0},(s=v.value)==null||s.resetFields()};return(s,e)=>{const n=q,p=J,D=M,P=R,k=E,F=T;return w(),g(k,{title:a(b),modelValue:a(d),"onUpdate:modelValue":e[7]||(e[7]=r=>O(d)?d.value=r:null)},{footer:i(()=>[l(P,{onClick:N,type:"primary",disabled:a(u)},{default:i(()=>[B("\u786E \u5B9A")]),_:1},8,["disabled"]),l(P,{onClick:e[6]||(e[6]=r=>d.value=!1)},{default:i(()=>[B("\u53D6 \u6D88")]),_:1})]),default:i(()=>[A((w(),g(D,{ref_key:"formRef",ref:v,model:a(t),rules:a(I),"label-width":"100px"},{default:i(()=>[l(p,{label:"\u7528\u6237ID",prop:"userId"},{default:i(()=>[l(n,{modelValue:a(t).userId,"onUpdate:modelValue":e[0]||(e[0]=r=>a(t).userId=r),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237ID"},null,8,["modelValue"])]),_:1}),l(p,{label:"\u5206\u533A\u7F16\u53F7",prop:"partNo"},{default:i(()=>[l(n,{modelValue:a(t).partNo,"onUpdate:modelValue":e[1]||(e[1]=r=>a(t).partNo=r),placeholder:"\u8BF7\u8F93\u5165\u5206\u533A\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),l(p,{label:"\u4E1A\u7EE9",prop:"price"},{default:i(()=>[l(n,{modelValue:a(t).price,"onUpdate:modelValue":e[2]||(e[2]=r=>a(t).price=r),placeholder:"\u8BF7\u8F93\u5165\u4E1A\u7EE9"},null,8,["modelValue"])]),_:1}),l(p,{label:"\u662F\u5426\u78B0\u649E 0\u4E3A\u672A\u78B0\u649E 1\u4E3A\u5DF2\u78B0\u649E",prop:"hasHit"},{default:i(()=>[l(n,{modelValue:a(t).hasHit,"onUpdate:modelValue":e[3]||(e[3]=r=>a(t).hasHit=r),placeholder:"\u8BF7\u8F93\u5165\u662F\u5426\u78B0\u649E 0\u4E3A\u672A\u78B0\u649E 1\u4E3A\u5DF2\u78B0\u649E"},null,8,["modelValue"])]),_:1}),l(p,{label:"\u78B0\u649E\u540E\u989D\u5EA6",prop:"afterHitQuota"},{default:i(()=>[l(n,{modelValue:a(t).afterHitQuota,"onUpdate:modelValue":e[4]||(e[4]=r=>a(t).afterHitQuota=r),placeholder:"\u8BF7\u8F93\u5165\u78B0\u649E\u540E\u989D\u5EA6"},null,8,["modelValue"])]),_:1}),l(p,{label:"\u662F\u5426\u662F\u5927\u533A 0\u4E3A\u5C0F\u533A 1\u4E3A\u5927\u533A",prop:"size"},{default:i(()=>[l(n,{modelValue:a(t).size,"onUpdate:modelValue":e[5]||(e[5]=r=>a(t).size=r),placeholder:"\u8BF7\u8F93\u5165\u662F\u5426\u662F\u5927\u533A 0\u4E3A\u5C0F\u533A 1\u4E3A\u5927\u533A"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[F,a(u)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/distri/partitionbrothers/PartitionBrothersForm.vue"]]),H=Object.freeze(Object.defineProperty({__proto__:null,default:f},Symbol.toStringTag,{value:"Module"}))});export{f as P,X as __tla,_ as a,H as b};
|