1 |
- import{d as ae,p as B,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 G,t as ne,dG as ie,y as ue,U as se,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-390579cd.js";import{_ as ge,__tla as we}from"./Dialog-cc73e431.js";import{_ as Se,__tla as ke}from"./ContentWrap-a04cd098.js";import{_ as be,__tla as xe}from"./index-82cedac6.js";import{E as Ce,__tla as Ve}from"./el-image-cfde91bc.js";import{__tla as Te}from"./el-image-viewer-2414ea0c.js";import{E as Ue,__tla as Ie}from"./el-tree-select-ab238926.js";import{g as De,__tla as Ne}from"./index-12eb86f9.js";import{d as Re,__tla as ze}from"./formatTime-926628b1.js";import{c as Ee,__tla as Le}from"./index-0046df56.js";import{h as Pe,d as Ye}from"./tree-0af4953a.js";import{g as Be,__tla as Ge}from"./category-aef51cc4.js";import{g as He,f as Me,__tla as Ke}from"./spu-96bd3d99.js";import{u as je,__tla as Ae}from"./useMessage-6684a162.js";import Je,{__tla as Oe}from"./SkuList-cb7ecf94.js";import{__tla as Qe}from"./el-card-f2f59395.js";import{__tla as qe}from"./index-034a84e0.js";import{__tla as Fe}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-a450ab09.js";import{__tla as We}from"./UploadImg-7d2a5bd9.js";import{__tla as Xe}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-9973df8c.js";import{__tla as Ze}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-d7ac34ab.js";let H,$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 Te}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return Ge}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return Oe}catch{}})(),(()=>{try{return Qe}catch{}})(),(()=>{try{return qe}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return Ze}catch{}})()]).then(async()=>{H=ye(ae({name:"PromotionSpuSelect",__name:"SpuSelect",props:{isSelectSku:B.bool.def(!1),radio:B.bool.def(!1)},emits:["confirm"],setup(T,{expose:M,emit:K}){const b=T,f=je(),U=n(0),I=n([]),x=n(!1),m=n(!1),D=n(""),u=n({pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]}),C=n([]),V=n(),N=n(),v=n(),y=n(!1),h=n(),s=n(0),c=n([]),j=l=>{var _;const e=(_=N.value)==null?void 0:_.getSkuTableRef();if(s.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=[]},A=l=>{var e,_;if(l.length!==0){if(s.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));R(l[0],l)}else s.value=0},R=async(l,e)=>{var i;if(s.value!==0){if(l.id!==s.value)return f.warning("\u4F60\u5DF2\u9009\u62E9\u5546\u54C1\u8BF7\u5148\u53D6\u6D88"),void(h.value=[s.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 He(l.id);C.value=De(_),v.value=_,y.value=!0,h.value=[l.id]},z=K,J=()=>{s.value!==0?b.isSelectSku&&c.value.length===0?f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1\u5C5E\u6027"):(b.isSelectSku?z("confirm",s.value,c.value):z("confirm",s.value),m.value=!1,s.value=0,c.value=[]):f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1")};M({open:()=>{D.value="\u5546\u54C1\u9009\u62E9",m.value=!0}});const g=async()=>{x.value=!0;try{const l=await Me(u.value);I.value=l.list,U.value=l.total}finally{x.value=!1}},E=()=>{g()},O=()=>{u.value={pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]},g()},L=n();return te(async()=>{await g();const l=await Be({});L.value=Pe(l,"id","parentId")}),(l,e)=>{const _=se,i=_e,Q=Ue,q=pe,P=ce,w=me,F=de,p=fe,W=Ce,X=be,Z=Se,$=ge,ee=ve;return S(),k($,{modelValue:t(m),"onUpdate:modelValue":e[6]||(e[6]=r=>ue(m)?m.value=r:null),appendToBody:!0,title:t(D),width:"70%"},{footer:o(()=>[a(w,{type:"primary",onClick:J},{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(u).name,"onUpdate:modelValue":e[0]||(e[0]=r=>t(u).name=r),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",onKeyup:le(E,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),a(i,{span:6},{default:o(()=>[a(Q,{modelValue:t(u).categoryId,"onUpdate:modelValue":e[1]||(e[1]=r=>t(u).categoryId=r),data:t(L),props:t(Ye),"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(q,{modelValue:t(u).createTime,"onUpdate:modelValue":e[2]||(e[2]=r=>t(u).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(P,{class:"mr-5px",icon:"ep:search"}),d(" \u641C\u7D22 ")]),_:1}),a(w,{onClick:O},{default:o(()=>[a(P,{class:"mr-5px",icon:"ep:refresh"}),d(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1}),re((S(),k(t(oe),{ref_key:"spuListRef",ref:V,data:t(I),"expand-row-keys":t(h),"row-key":"id",onExpandChange:R,onSelectionChange:A},{default:o(()=>[T.isSelectSku?(S(),k(p,{key:0,type:"expand",width:"30"},{default:o(()=>[t(y)?(S(),k(t(Je),{key:0,ref_key:"skuListRef",ref:N,isComponent:!0,isDetail:!0,"prop-form-data":t(v),"property-list":t(C),onSelectionChange:j},null,8,["prop-form-data","property-list"])):G("",!0)]),_:1})):G("",!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(W,{src:r.picUrl,class:"h-30px w-30px",onClick:ea=>{return Y=r.picUrl,void Ee({zIndex:99999999,urlList:[Y]});var Y}},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(Re),align:"center",label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:"180"},null,8,["formatter"])]),_:1},8,["data","expand-row-keys"])),[[ee,t(x)]]),a(X,{limit:t(u).pageSize,"onUpdate:limit":e[3]||(e[3]=r=>t(u).pageSize=r),page:t(u).pageNo,"onUpdate:page":e[4]||(e[4]=r=>t(u).pageNo=r),total:t(U),onPagination:g},null,8,["limit","page","total"])]),_:1})]),_:1},8,["modelValue","title"])}}}),[["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/mall/promotion/components/SpuSelect.vue"]])});export{$e as __tla,H as default};
|