import{_ as G}from"./EditDialog.vue_vue_type_script_setup_true_lang.0f14a8ef.js";import{b as M,g as O,d as R}from"./materialTitle.b5bc5ee4.js";import{d as S,b as k,p as F,r,c as n,e as p,f as V,g as i,h as e,i as l,u as o,F as A,j as H,k as v,m as _,t as J,q as K,A as Q,y as B,N as W,E as X,_ as Y}from"./index.0308b213.js";import"./useInstance.233fbdde.js";const Z={class:"filter-form"},ee=_("\u67E5\u8BE2"),te={class:"data"},le={class:"operation-container"},oe={class:"operation-btn"},ae=_("\u6DFB\u52A0"),se={class:"table"},ne=_("\u5305\u542B"),ue=_("\u9009\u62E9"),ie={class:"table-operation-btn"},de={class:"top"},_e=_("\u7F16\u8F91"),ce=_("\u5220\u9664"),re={class:"bottom"},pe={class:"pagination"},me=S({setup(fe){const a=k({page:1,limit:10,goods_id:"",keywords:""}),E=k({list:[]}),x=()=>{M().then(u=>{E.list=u})};x(),F(()=>a.agentid,()=>{x()});const f=k({list:[],count:0});r([]);const m=()=>{O(a).then(u=>{f.list=u.list,f.count=u.count})};m(),r(!1),r(!1),F(()=>[a.page,a.limit],()=>{m()});const w=()=>{m()};let c=r(!1),g=r(!1),b=r(0);const z=()=>{b.value=0,g.value=!0,B(()=>{c.value=!0})},L=u=>{b.value=u,g.value=!0,B(()=>{c.value=!0})},N=()=>{b.value=0,B(()=>{g.value=!1}),m()},U=u=>{W.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u6570\u636E\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{R({id:u}).then(()=>{X({message:"\u5220\u9664\u6210\u529F",type:"success"}),m()})}).catch(()=>{})};return(u,s)=>{const q=n("el-option"),T=n("el-select"),y=n("el-form-item"),I=n("el-input"),h=n("el-button"),P=n("el-form"),d=n("el-table-column"),D=n("el-tag"),$=n("el-table"),j=n("el-pagination");return p(),V(A,null,[i("div",Z,[e(P,{model:o(a),"label-width":"90px"},{default:l(()=>[e(y,{class:"tn-el-form-item",label:"\u5546\u54C1"},{default:l(()=>[e(T,{modelValue:o(a).goods_id,"onUpdate:modelValue":s[0]||(s[0]=t=>o(a).goods_id=t),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1",filterable:"",clearable:""},{default:l(()=>[(p(!0),V(A,null,H(o(E).list,(t,C)=>(p(),v(q,{key:`statcenter-store-store-${C}`,value:t.id,label:t.title},{default:l(()=>[_(J(t.title),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(y,{class:"tn-el-form-item",label:"\u6807\u9898"},{default:l(()=>[e(I,{modelValue:o(a).keywords,"onUpdate:modelValue":s[1]||(s[1]=t=>o(a).keywords=t),placeholder:"\u8BF7\u8F93\u5165\u6807\u9898"},null,8,["modelValue"])]),_:1}),e(y,null,{default:l(()=>[e(h,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:w},{default:l(()=>[ee]),_:1})]),_:1})]),_:1},8,["model"])]),i("div",te,[i("div",le,[i("div",oe,[e(h,{class:"btn",type:"primary",onClick:z},{default:l(()=>[ae]),_:1})])]),i("div",se,[e($,{data:o(f).list},{default:l(()=>[e(d,{label:"ID",prop:"id"}),e(d,{label:"\u5546\u54C1id",prop:"goods_id"}),e(d,{label:"\u5546\u54C1\u540D\u79F0",prop:"goods.title"}),e(d,{label:"\u6807\u9898",prop:"title"}),e(d,{label:"\u6700\u591A\u9009\u62E9",prop:"max_quantity"}),e(d,{label:"\u6700\u5C11\u9009\u62E9",prop:"min_quantity"}),e(d,{label:"\u7C7B\u578B",prop:"type"},{default:l(({row:t})=>[t.type==1?(p(),v(D,{key:0,type:"success"},{default:l(()=>[ne]),_:1})):(p(),v(D,{key:1,type:"danger"},{default:l(()=>[ue]),_:1}))]),_:1}),e(d,{fixed:"right",label:"\u64CD\u4F5C",width:"290px"},{default:l(({row:t})=>[i("div",ie,[i("div",de,[e(h,{size:"small",type:"primary",onClick:C=>L(t.id)},{default:l(()=>[_e]),_:2},1032,["onClick"]),e(h,{size:"small",type:"danger",onClick:C=>U(t.id)},{default:l(()=>[ce]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])]),i("div",re,[i("div",pe,[e(j,{currentPage:o(a).page,"onUpdate:currentPage":s[2]||(s[2]=t=>o(a).page=t),"page-size":o(a).limit,"onUpdate:page-size":s[3]||(s[3]=t=>o(a).limit=t),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:o(f).count},null,8,["currentPage","page-size","total"])])]),o(g)?(p(),v(G,{key:0,modelValue:o(c),"onUpdate:modelValue":s[4]||(s[4]=t=>K(c)?c.value=t:c=t),id:o(b),onOnClose:N},null,8,["modelValue","id"])):Q("",!0)],64)}}});const ye=Y(me,[["__scopeId","data-v-da416cb2"]]);export{ye as default};
