SpuSelect-f5bdf896.js 7.4 KB

1
  1. import{d as ae,ag as M,r as n,k as te,o as S,v as k,w as o,f as a,m as d,a as t,R as le,x as re,H as oe,P as H,t as ne,as as ie,O as se,V as ue,E as _e,B as pe,n as ce,C as me,i as de,G as fe,I as ve,_ as he,__tla as ye}from"./index-430b3151.js";import{_ as ge,__tla as we}from"./Dialog-cd42c639.js";import{_ as Se,__tla as ke}from"./ContentWrap-60842994.js";import{_ as xe,__tla as be}from"./index-c425c88f.js";import{E as Ve,__tla as Ce}from"./el-image-c98b70f9.js";import{__tla as Te}from"./el-image-viewer-467ebe35.js";import{E as ze,__tla as Ue}from"./el-tree-select-eb1ce80a.js";import{g as Ie,__tla as De}from"./index-b3ba5914.js";import{d as Re,__tla as Ee}from"./formatTime-00eecbb7.js";import{c as Ne,__tla as Pe}from"./index-255e3b1c.js";import{h as Ye,d as Le}from"./tree-0af4953a.js";import{g as Me,__tla as He}from"./category-61e1eb2c.js";import{g as Be,d as Ke,__tla as Ge}from"./spu-fa11f657.js";import{u as Oe,__tla as je}from"./useMessage-d226ba89.js";import qe,{__tla as Ae}from"./SkuList-6f86be5a.js";import{__tla as Fe}from"./el-card-dee5b36b.js";import{__tla as Je}from"./index-555139e7.js";import{__tla as Qe}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-f5de6f1b.js";import{__tla as We}from"./UploadImg-2f818d4f.js";import{__tla as Xe}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-7ba47553.js";import{__tla as Ze}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-3bbc6c3b.js";let B,$e=Promise.all([(()=>{try{return ye}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return Ge}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Je}catch{}})(),(()=>{try{return Qe}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return Ze}catch{}})()]).then(async()=>{B=he(ae({name:"PromotionSpuSelect",__name:"SpuSelect",props:{isSelectSku:M.bool.def(!1),radio:M.bool.def(!1)},emits:["confirm"],setup(T,{expose:K,emit:G}){const x=T,f=Oe(),z=n(0),U=n([]),b=n(!1),m=n(!1),I=n(""),s=n({pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]}),V=n([]),C=n(),D=n(),v=n(),h=n(!1),y=n(),u=n(0),c=n([]),O=l=>{var _;const e=(_=D.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(x.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=[]},j=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=C.value)==null||e.clearSelection(),void((_=C.value)==null?void 0:_.toggleRowSelection(l.pop(),!0));R(l[0],l)}else u.value=0},R=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(y.value=[u.value]);if(h.value&&((i=v.value)==null?void 0:i.id)===l.id)return}if(v.value={},V.value=[],h.value=!1,(e==null?void 0:e.length)===0)return void(y.value=[]);const _=await Be(l.id);V.value=Ie(_),v.value=_,h.value=!0,y.value=[l.id]},E=G,q=()=>{u.value!==0?x.isSelectSku&&c.value.length===0?f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1\u5C5E\u6027"):(x.isSelectSku?E("confirm",u.value,c.value):E("confirm",u.value),m.value=!1,u.value=0,c.value=[]):f.warning("\u6CA1\u6709\u9009\u62E9\u4EFB\u4F55\u5546\u54C1")};K({open:()=>{I.value="\u5546\u54C1\u9009\u62E9",m.value=!0}});const g=async()=>{b.value=!0;try{const l=await Ke(s.value);U.value=l.list,z.value=l.total}finally{b.value=!1}},N=()=>{g()},A=()=>{s.value={pageNo:1,pageSize:10,tabType:0,name:"",categoryId:null,createTime:[]},g()},P=n();return te(async()=>{await g();const l=await Me({});P.value=Ye(l,"id","parentId")}),(l,e)=>{const _=ue,i=_e,F=ze,J=pe,Y=ce,w=me,Q=de,p=fe,W=Ve,X=xe,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(Q,{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(N,["enter"])},null,8,["modelValue"])]),_:1}),a(i,{span:6},{default:o(()=>[a(F,{modelValue:t(s).categoryId,"onUpdate:modelValue":e[1]||(e[1]=r=>t(s).categoryId=r),data:t(P),props:t(Le),"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(J,{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:N},{default:o(()=>[a(Y,{class:"mr-5px",icon:"ep:search"}),d(" \u641C\u7D22 ")]),_:1}),a(w,{onClick:A},{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:C,data:t(U),"expand-row-keys":t(y),"row-key":"id",onExpandChange:R,onSelectionChange:j},{default:o(()=>[T.isSelectSku?(S(),k(p,{key:0,type:"expand",width:"30"},{default:o(()=>[t(h)?(S(),k(t(qe),{key:0,ref_key:"skuListRef",ref:D,isComponent:!0,isDetail:!0,"prop-form-data":t(v),"property-list":t(V),onSelectionChange:O},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(W,{src:r.picUrl,class:"h-30px w-30px",onClick:ea=>{return L=r.picUrl,void Ne({zIndex:99999999,urlList:[L]});var L}},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(b)]]),a(X,{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(z),onPagination:g},null,8,["limit","page","total"])]),_:1})]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/promotion/components/SpuSelect.vue"]])});export{$e as __tla,B as default};