SpuSelect-985ea190.js 7.5 KB

1
  1. import{d as ae,p as P,r as n,B as te,o as S,l as k,w as o,i as a,j as d,a as t,Q as le,C as re,M as oe,a2 as H,t as ne,dG as ie,y as se,U as ue,E as _e,I as pe,v as ce,J as me,s as de,L as fe,N as ve,_ as ye,__tla as he}from"./index-afaf388d.js";import{_ as ge,__tla as we}from"./Dialog-82c2009c.js";import{_ as Se,__tla as ke}from"./ContentWrap-abe0694e.js";import{_ as be,__tla as xe}from"./index-89d02e79.js";import{E as Ce,__tla as Ve}from"./el-image-caa301d0.js";import{__tla as Ue}from"./el-image-viewer-9330e340.js";import{E as Te,__tla as De}from"./el-tree-select-190eecb6.js";import{g as Ie,__tla as ze}from"./index-c82fc2ba.js";import{d as Ne,__tla as Re}from"./formatTime-42952e7f.js";import{c as Ee,__tla as Le}from"./index-6149057d.js";import{h as Ye,d as Be}from"./tree-0af4953a.js";import{g as Pe,__tla as He}from"./category-f4ef186a.js";import{g as Me,f as Je,__tla as je}from"./spu-4d82f8bd.js";import{u as Ge,__tla as Ke}from"./useMessage-a290df31.js";import Qe,{__tla as Xe}from"./SkuList-ec41fe68.js";import{__tla as qe}from"./el-card-9c18d881.js";import{__tla as Ae}from"./index-0eed91e1.js";import{__tla as Fe}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-6a6e9523.js";import{__tla as Oe}from"./UploadImg-f909692d.js";import{__tla as We}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-e548deac.js";import{__tla as Ze}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-f19c84d5.js";let M,$e=Promise.all([(()=>{try{return he}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return qe}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Oe}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return Ze}catch{}})()]).then(async()=>{M=ye(ae({name:"PromotionSpuSelect",__name:"SpuSelect",props:{isSelectSku:P.bool.def(!1),radio:P.bool.def(!1)},emits:["confirm"],setup(U,{expose:J,emit:j}){const b=U,f=Ge(),T=n(0),D=n([]),x=n(!1),m=n(!1),I=n(""),s=n({pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]}),C=n([]),V=n(),z=n(),v=n(),y=n(!1),h=n(),u=n(0),c=n([]),G=l=>{var _;const e=(_=z.value)==null?void 0:_.getSkuTableRef();if(u.value===0)return f.warning("\u8BF7\u5148\u9009\u62E9\u5546\u54C1\u518D\u9009\u62E9\u76F8\u5E94\u7684\u89C4\u683C\uFF01\uFF01\uFF01"),void(e==null?void 0:e.clearSelection());if(l.length!==0)if(b.radio){if(c.value=[l.map(i=>i.id)[0]],l.length>1)return e==null||e.clearSelection(),void(e==null?void 0:e.toggleRowSelection(l.pop(),!0))}else c.value=l.map(i=>i.id);else c.value=[]},K=l=>{var e,_;if(l.length!==0){if(u.value=l.map(i=>i.id)[0],c.value.length>0&&(c.value=[]),l.length>1)return(e=V.value)==null||e.clearSelection(),void((_=V.value)==null?void 0:_.toggleRowSelection(l.pop(),!0));N(l[0],l)}else u.value=0},N=async(l,e)=>{var i;if(u.value!==0){if(l.id!==u.value)return f.warning("\u4F60\u5DF2\u9009\u62E9\u5546\u54C1\u8BF7\u5148\u53D6\u6D88"),void(h.value=[u.value]);if(y.value&&((i=v.value)==null?void 0:i.id)===l.id)return}if(v.value={},C.value=[],y.value=!1,(e==null?void 0:e.length)===0)return void(h.value=[]);const _=await Me(l.id);C.value=Ie(_),v.value=_,y.value=!0,h.value=[l.id]},R=j,Q=()=>{u.value!==0?b.isSelectSku&&c.value.length===0?f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1\u5C5E\u6027"):(b.isSelectSku?R("confirm",u.value,c.value):R("confirm",u.value),m.value=!1,u.value=0,c.value=[]):f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1")};J({open:()=>{I.value="\u5546\u54C1\u9009\u62E9",m.value=!0}});const g=async()=>{x.value=!0;try{const l=await Je(s.value);D.value=l.list,T.value=l.total}finally{x.value=!1}},E=()=>{g()},X=()=>{s.value={pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]},g()},L=n();return te(async()=>{await g();const l=await Pe({});L.value=Ye(l,"id","parentId")}),(l,e)=>{const _=ue,i=_e,q=Te,A=pe,Y=ce,w=me,F=de,p=fe,O=Ce,W=be,Z=Se,$=ge,ee=ve;return S(),k($,{modelValue:t(m),"onUpdate:modelValue":e[6]||(e[6]=r=>se(m)?m.value=r:null),appendToBody:!0,title:t(I),width:"70%"},{footer:o(()=>[a(w,{type:"primary",onClick:Q},{default:o(()=>[d("\u786E \u5B9A")]),_:1}),a(w,{onClick:e[5]||(e[5]=r=>m.value=!1)},{default:o(()=>[d("\u53D6 \u6D88")]),_:1})]),default:o(()=>[a(Z,null,{default:o(()=>[a(F,{gutter:20,class:"mb-10px"},{default:o(()=>[a(i,{span:6},{default:o(()=>[a(_,{modelValue:t(s).name,"onUpdate:modelValue":e[0]||(e[0]=r=>t(s).name=r),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",onKeyup:le(E,["enter"])},null,8,["modelValue"])]),_:1}),a(i,{span:6},{default:o(()=>[a(q,{modelValue:t(s).categoryId,"onUpdate:modelValue":e[1]||(e[1]=r=>t(s).categoryId=r),data:t(L),props:t(Be),"check-strictly":"",class:"w-1/1","node-key":"id",placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B"},null,8,["modelValue","data","props"])]),_:1}),a(i,{span:6},{default:o(()=>[a(A,{modelValue:t(s).createTime,"onUpdate:modelValue":e[2]||(e[2]=r=>t(s).createTime=r),"default-time":[new Date("1 00:00:00"),new Date("1 23:59:59")],class:"!w-240px","end-placeholder":"\u7ED3\u675F\u65E5\u671F","start-placeholder":"\u5F00\u59CB\u65E5\u671F",type:"daterange","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","default-time"])]),_:1}),a(i,{span:6},{default:o(()=>[a(w,{onClick:E},{default:o(()=>[a(Y,{class:"mr-5px",icon:"ep:search"}),d(" \u641C\u7D22 ")]),_:1}),a(w,{onClick:X},{default:o(()=>[a(Y,{class:"mr-5px",icon:"ep:refresh"}),d(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1}),re((S(),k(t(oe),{ref_key:"spuListRef",ref:V,data:t(D),"expand-row-keys":t(h),"row-key":"id",onExpandChange:N,onSelectionChange:K},{default:o(()=>[U.isSelectSku?(S(),k(p,{key:0,type:"expand",width:"30"},{default:o(()=>[t(y)?(S(),k(t(Qe),{key:0,ref_key:"skuListRef",ref:z,isComponent:!0,isDetail:!0,"prop-form-data":t(v),"property-list":t(C),onSelectionChange:G},null,8,["prop-form-data","property-list"])):H("",!0)]),_:1})):H("",!0),a(p,{type:"selection",width:"55"}),a(p,{key:"id",align:"center",label:"\u5546\u54C1\u7F16\u53F7",prop:"id"}),a(p,{label:"\u5546\u54C1\u56FE","min-width":"80"},{default:o(({row:r})=>[a(O,{src:r.picUrl,class:"h-30px w-30px",onClick:ea=>{return B=r.picUrl,void Ee({zIndex:99999999,urlList:[B]});var B}},null,8,["src","onClick"])]),_:1}),a(p,{"show-overflow-tooltip":!0,label:"\u5546\u54C1\u540D\u79F0","min-width":"300",prop:"name"}),a(p,{align:"center",label:"\u5546\u54C1\u552E\u4EF7","min-width":"90",prop:"price"},{default:o(({row:r})=>[d(ne(t(ie)(r.price)),1)]),_:1}),a(p,{align:"center",label:"\u9500\u91CF","min-width":"90",prop:"salesCount"}),a(p,{align:"center",label:"\u5E93\u5B58","min-width":"90",prop:"stock"}),a(p,{align:"center",label:"\u6392\u5E8F","min-width":"70",prop:"sort"}),a(p,{formatter:t(Ne),align:"center",label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:"180"},null,8,["formatter"])]),_:1},8,["data","expand-row-keys"])),[[ee,t(x)]]),a(W,{limit:t(s).pageSize,"onUpdate:limit":e[3]||(e[3]=r=>t(s).pageSize=r),page:t(s).pageNo,"onUpdate:page":e[4]||(e[4]=r=>t(s).pageNo=r),total:t(T),onPagination:g},null,8,["limit","page","total"])]),_:1})]),_:1},8,["modelValue","title"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/promotion/components/SpuSelect.vue"]])});export{$e as __tla,M as default};