import{az as v,d as T,b as k,r as g,c as n,e as c,f as b,g as m,h as t,i as o,F as E,j as z,k as h,u,m as f,t as $,A as G,E as H,_ as J}from"./index.0308b213.js";const K=p=>v.request({url:"addon/spellrice.web.Goods/list",params:p}),O=p=>v.post("addon/spellrice.web.Goods/Del",{id:p}),Q=p=>v.post("addon/spellrice.web.Goods/Sort",p),W={class:"filter-form"},X={class:"table"},Y={class:"store-info"},Z=["src"],ee=f("\u65B0\u8001\u7528\u6237"),te=f("\u4E0B\u67B6\u6B64\u5546\u54C1"),le={class:"bottom"},oe=f("\u63D0\u4EA4"),ae={key:0,class:"pagination"},se=T({setup(p){const i=k({agentid:0,page:1,limit:10,sid:0});let d=k({count:0,pages:0,page:1,limit:10,spellrices:[],stores:[],is_agent:0,agents:[]}),C=g([]),y=g([]);const B=g(""),A=g(""),_=()=>{K(i).then(l=>{C.value=l.agents,y.value=l.stores,d.count=l.count,d.spellrices=l.spellrices})};_();const w=l=>{i.agentid=l,_()},P=l=>{i.sid=l,_()},S=l=>{O(l).then(a=>{H({message:"\u4E0B\u67B6\u6210\u529F",type:"success"}),_()})},U=()=>{let l=[],a=[];d.spellrices.forEach(r=>{l.push(r.mall_displayorder),a.push(r.id)}),d.spellrices.forEach(r=>a.push(r.id)),Q({mall_displayorder:l,ids:a}).then(r=>{})},N=()=>{_()},q=()=>{_()};return(l,a)=>{const r=n("el-option"),D=n("el-select"),F=n("el-form-item"),j=n("el-form"),I=n("el-input"),s=n("el-table-column"),L=n("el-tag"),V=n("el-button"),M=n("el-table"),R=n("el-pagination");return c(),b(E,null,[m("div",W,[t(j,{model:u(i),"label-width":"90px"},{default:o(()=>[t(F,{class:"tn-el-form-item",label:"\u9009\u62E9\u4EE3\u7406\u533A\u57DF"},{default:o(()=>[t(D,{modelValue:B.value,"onUpdate:modelValue":a[0]||(a[0]=e=>B.value=e),class:"m-2",placeholder:"\u9009\u62E9\u4EE3\u7406\u533A\u57DF",size:"large",filterable:"",onChange:w},{default:o(()=>[(c(!0),b(E,null,z(u(C),e=>(c(),h(r,{key:e.id,label:e.title,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(F,{class:"tn-el-form-item",label:"\u9009\u62E9\u95E8\u5E97"},{default:o(()=>[t(D,{modelValue:A.value,"onUpdate:modelValue":a[1]||(a[1]=e=>A.value=e),class:"m-2",placeholder:"\u9009\u62E9\u95E8\u5E97",size:"large",filterable:"",onChange:P},{default:o(()=>[(c(!0),b(E,null,z(u(y),e=>(c(),h(r,{key:e.id,label:e.title,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),m("div",X,[t(M,{data:u(d).spellrices},{default:o(()=>[t(s,{label:"\u6392\u5E8F",width:"100px"},{default:o(({row:e})=>[t(I,{type:"text",modelValue:e.mall_displayorder,"onUpdate:modelValue":x=>e.mall_displayorder=x},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(s,{label:"\u95E8\u5E97",width:"100px"},{default:o(({row:e})=>[m("div",Y,[m("img",{class:"store-image",src:e.goods.thumb},null,8,Z)])]),_:1}),t(s,{label:"\u83DC\u54C1\u540D\u79F0",prop:"goods.title",width:"250px"}),t(s,{label:"\u83DC\u54C1\u72B6\u6001",width:"100px"},{default:o(({row:e})=>[t(L,{type:e.goods.status===1?"success":"danger","disable-transitions":""},{default:o(()=>[f($(e.goods.status?"\u4E0A\u67B6\u4E2D":"\u5DF2\u4E0B\u67B6"),1)]),_:2},1032,["type"])]),_:1}),t(s,{label:"\u6240\u5C5E\u95E8\u5E97",prop:"store"}),t(s,{label:"\u539F\u4EF7",prop:"goods.price"}),t(s,{label:"\u6D3B\u52A8\u4EF7\u683C",prop:"discount_price"}),t(s,{label:"\u6BCF\u5355\u9650\u8D2D",prop:"order_limit"}),t(s,{label:"\u6D3B\u52A8\u5E93\u5B58",prop:"discount_total"}),t(s,{label:"\u4ECA\u5929\u5269\u4F59\u5E93\u5B58",prop:"discount_available_total"}),t(s,{label:"\u9762\u5411\u7FA4\u4F53"},{default:o(()=>[ee]),_:1}),t(s,{label:"\u64CD\u4F5C"},{default:o(({row:e})=>[t(V,{type:"danger",onClick:x=>S(e.id)},{default:o(()=>[te]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),m("div",le,[m("div",null,[u(d).spellrices.length>0?(c(),h(V,{key:0,type:"success",onClick:U},{default:o(()=>[oe]),_:1})):G("",!0)]),u(d).spellrices.length>0?(c(),b("div",ae,[t(R,{currentPage:u(i).page,"onUpdate:currentPage":a[2]||(a[2]=e=>u(i).page=e),"page-size":u(i).limit,"onUpdate:page-size":a[3]||(a[3]=e=>u(i).limit=e),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:u(d).count,onSizeChange:N,onCurrentChange:q},null,8,["currentPage","page-size","total"])])):G("",!0)])],64)}}});const ne=J(se,[["__scopeId","data-v-f8e867e9"]]);export{ne as default};
