index-962da1ec.js 11 KB

1
  1. import{d as Pa,u as wa,J as Fa,r as o,Q as ba,o as m,v as y,aY as Ca,a,w as d,g as c,n as x,P as v,x as g,t as ta,f as i,j as Ba,aZ as Da,O as ra,a4 as w,c as la,h as Ua,a_ as oa,ar as F,as as b,a$ as C,aT as Ia,W as Ta,X as xa,C as Sa,b0 as Ea,I as Ra,p as Va,k as $a,_ as Aa,__tla as ja}from"./index-11e4820e.js";import{_ as za,__tla as La}from"./ContentWrap-694014d4.js";import{_ as Ya,__tla as Xa}from"./SPuUploadImg-7c6bd56b.js";import{u as Ha,__tla as Ja}from"./tagsView-4d7a359f.js";import{g as Oa,u as sa,d as Qa,c as Wa,a as Za,__tla as qa}from"./spu-6512fa25.js";import Ga,{__tla as Ka}from"./InfoForm-22c23d54.js";import Ma,{__tla as Na}from"./DescriptionForm-28f3a0e1.js";import ae,{__tla as ee}from"./OtherForm-b1be3184.js";import te,{__tla as re}from"./SkuForm-8fc43ee5.js";import le,{__tla as oe}from"./DeliveryForm-f226e0e5.js";import se,{__tla as ie}from"./Service-d6b8d510.js";import{A as ce,__tla as _e}from"./AfterSale-0daefdbb.js";import ne,{__tla as ue}from"./Comment-29a0879b.js";import{P as z}from"./constants-40f13f5e.js";import{u as me,__tla as de}from"./useMessage-06ddf735.js";import{__tla as pe}from"./ContentWrap.vue_vue_type_script_setup_true_lang-11f85821.js";import{__tla as fe}from"./el-card-919c14be.js";import{__tla as ye}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-8854a0f2.js";import{__tla as ve}from"./index-4203485c.js";import{__tla as he}from"./el-image-viewer-c4f5814f.js";import{__tla as ke}from"./UploadImgs-0c26a9a3.js";import{__tla as ge}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-fafbf7e3.js";import"./tree-0af4953a.js";import{__tla as Pe}from"./category-1517c494.js";import{__tla as we}from"./brand-6f3f160b.js";import{__tla as Fe}from"./formRules-a3633e47.js";import{__tla as be}from"./Editor-0f5cadc2.js";import{__tla as Ce}from"./index-ef554548.js";import{__tla as Be}from"./SkuList-6b80ba7b.js";import{__tla as De}from"./el-image-17e8bc54.js";import{__tla as Ue}from"./UploadImg-a1807be8.js";import{__tla as Ie}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-bab9318f.js";import{__tla as Te}from"./ProductAttributes-f024aca6.js";import{__tla as xe}from"./el-text-ff6dcf4e.js";import{__tla as Se}from"./property-9c164d16.js";import{__tla as Ee}from"./ProductPropertyAddForm-051de3c9.js";import{__tla as Re}from"./Dialog-bbfaf85c.js";import{__tla as Ve}from"./index-c5bb7afe.js";import{__tla as $e}from"./dict-4072dcec.js";import{__tla as Ae}from"./index-85087f4c.js";import{__tla as je}from"./index-c8f58bd0.js";import{__tla as ze}from"./index-dd73c59d.js";import{__tla as Le}from"./index-63b1dc70.js";let ia,Ye=Promise.all([(()=>{try{return ja}catch{}})(),(()=>{try{return La}catch{}})(),(()=>{try{return Xa}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Ka}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return ee}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return ve}catch{}})(),(()=>{try{return he}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Be}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return $e}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Le}catch{}})()]).then(async()=>{let L,Y,X,H,J,O,Q,W,Z,q;L={class:"my-header"},Y={class:"my-header-left"},X={class:"my-header-right"},H=["onClick"],J={class:"left"},O={class:"right"},Q={key:0},W={key:1},Z=(S=>(Va("data-v-473675a6"),S=S(),$a(),S))(()=>c("div",{style:{clear:"both"}},null,-1)),q={class:"dialog-footer"},ia=Aa(Pa({name:"ProductSpuForm",__name:"index",emits:["success"],setup(S,{expose:ca,emit:_a}){const{t:E}=Ua(),P=me();wa(),Fa(),Ha();const p=o(!1),n=o("info"),l=o(!1),G=o(),K=o(),M=o(),N=o(),na=o(),u=o({name:"",categoryId:void 0,keyword:"",picUrl:"",producerArea:"",spuType:void 0,sliderPicUrls:[],introduction:"",deliveryTypes:[],deliveryTemplateId:void 0,brandId:void 0,specType:!1,subCommissionType:!1,skus:[{price:0,marketPrice:0,costPrice:0,barCode:"",picUrl:"",stock:0,weight:0,volume:0,promotionFee:0,mark:"",firstBrokeragePrice:0,secondBrokeragePrice:0}],description:"",sort:0,giveIntegral:0,virtualSalesCount:0}),ua=o({name:"",categoryId:void 0,keyword:"",picUrl:"",producerArea:"",spuType:void 0,sliderPicUrls:[],introduction:"",deliveryTypes:[],deliveryTemplateId:void 0,brandId:void 0,specType:!1,subCommissionType:!1,skus:[{price:0,marketPrice:0,costPrice:0,barCode:"",picUrl:"",stock:0,weight:0,volume:0,promotionFee:0,mark:"",firstBrokeragePrice:0,secondBrokeragePrice:0}],description:"",sort:0,giveIntegral:0,virtualSalesCount:0}),B=o(!1),R=o(""),D=o(0),U=o(),ma=o(""),h=o(),V=o(""),da=o(0),I=o(!1);ca({open:async(s,t,k,e)=>{D.value=e,h.value=t,da.value=k,B.value=!0,U.value=t.id,ma.value=t.picUrl,I.value=!1,await fa(),n.value="info",V.value=s,R.value=E("action."+s),s=="view"?R.value="\u67E5\u770B":s=="create"&&(u.value=oa(ua.value)),V.value=="view"?l.value=!0:l.value=!1}});const pa=()=>{I.value=!I.value},fa=async()=>{var t;const s=U.value;if(s){p.value=!0;try{const k=await Oa(s);(t=k.skus)==null||t.forEach(e=>{l.value?(e.price=F(e.price),e.marketPrice=F(e.marketPrice),e.costPrice=F(e.costPrice),e.promotionFee=F(e.promotionFee),e.firstBrokeragePrice=F(e.firstBrokeragePrice),e.secondBrokeragePrice=F(e.secondBrokeragePrice)):(e.price=b(e.price),e.marketPrice=b(e.marketPrice),e.costPrice=b(e.costPrice),e.promotionFee=b(e.promotionFee),e.firstBrokeragePrice=b(e.firstBrokeragePrice),e.secondBrokeragePrice=b(e.secondBrokeragePrice))}),u.value=k}finally{p.value=!1}}},$=_a,aa=async s=>{try{const t=s===z.RECYCLE.status?"\u52A0\u5165\u5230\u56DE\u6536\u7AD9":"\u6062\u590D\u5230\u4ED3\u5E93";await P.confirm(`\u786E\u8BA4\u8981"${h.value.name}"${t}\u5417\uFF1F`),await sa({id:h.value.id,status:s}),P.success(t+"\u6210\u529F"),A(),$("success")}catch{}},ya=async()=>{console.log(h.value.status);try{const s=h.value.status?"\u4E0B\u67B6":"\u4E0A\u67B6",t=h.value.status?0:1;await P.confirm(`\u786E\u8BA4\u8981${s}"${h.value.name}"\u5417\uFF1F`),await sa({id:h.value.id,status:t}),P.success(s+"\u6210\u529F"),A(),$("success")}catch{}},va=async()=>{var s,t,k,e;p.value=!0;try{await((s=a(G))==null?void 0:s.validate()),await((t=a(K))==null?void 0:t.validate()),await((k=a(M))==null?void 0:k.validate()),await((e=a(N))==null?void 0:e.validate());const _=oa(a(u.value));_.skus.forEach(r=>{console.log(r.promotionFee),r.name=_.name,r.price=C(r.price),r.marketPrice=C(r.marketPrice),r.costPrice=C(r.costPrice),r.promotionFee=C(r.promotionFee),r.firstBrokeragePrice=C(r.firstBrokeragePrice),r.secondBrokeragePrice=C(r.secondBrokeragePrice)});const T=[];_.sliderPicUrls.forEach(r=>{typeof r=="object"?T.push(r.url):T.push(r)}),_.sliderPicUrls=T;const j=_;U.value?(await Za(j),P.success(E("common.updateSuccess"))):(await Wa(j),P.success(E("common.createSuccess"))),A(),$("success")}finally{p.value=!1}},A=()=>{B.value=!1};return(s,t)=>{const k=Ia,e=Ya,_=Ta,T=xa,j=za,r=Sa,ha=Ea,ka=Ra,ea=ba("hasPermi");return m(),y(ha,{modelValue:a(B),"onUpdate:modelValue":t[5]||(t[5]=f=>ra(B)?B.value=f:null),title:a(R),fullscreen:a(I),"show-close":!1,width:"70%",draggable:"",class:"dialog"},Ca({header:d(({close:f})=>[c("div",L,[c("div",Y,ta(a(R)),1),c("div",X,[c("span",{onClick:pa},[i(a(Ba),{icon:a(I)?"zmdi:fullscreen-exit":"zmdi:fullscreen"},null,8,["icon"])]),c("span",{onClick:f},[i(k,null,{default:d(()=>[i(a(Da))]),_:1})],8,H)])])]),default:d(()=>[g((m(),y(j,{style:{"max-height":"560px","min-height":"560px","overflow-y":"auto","border-bottom":"none"}},{default:d(()=>[c("div",J,[i(e,{modelValue:a(u).picUrl,"onUpdate:modelValue":t[0]||(t[0]=f=>a(u).picUrl=f),disabled:a(l)},null,8,["modelValue","disabled"]),i(T,{modelValue:a(n),"onUpdate:modelValue":t[1]||(t[1]=f=>ra(n)?n.value=f:null),"tab-position":"left",class:"child-tabs"},{default:d(()=>[i(_,{label:"\u57FA\u672C\u4FE1\u606F",name:"info"}),i(_,{label:"\u4EF7\u683C/\u89C4\u683C/\u578B\u53F7",name:"sku"}),i(_,{label:"\u8BE6\u60C5",name:"description"}),a(l)?(m(),y(_,{key:0,label:"\u8BC4\u4EF7",name:"comment"})):v("",!0),a(l)?(m(),y(_,{key:1,label:"\u5BA2\u670D",name:"service"})):v("",!0),a(l)?(m(),y(_,{key:2,label:"\u552E\u540E",name:"aftersale"})):v("",!0),i(_,{label:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"})]),_:1},8,["modelValue"])]),c("div",O,[g(c("div",null,[i(Ga,{ref_key:"infoRef",ref:G,"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[w,a(n)=="info"]]),g(c("div",null,[i(te,{ref_key:"skuRef",ref:K,"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[w,a(n)=="sku"]]),g(c("div",null,[i(le,{ref_key:"deliveryRef",ref:M,"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[w,a(n)=="delivery"]]),g(c("div",null,[i(Ma,{ref_key:"descriptionRef",ref:N,"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[w,a(n)=="description"]]),g(c("div",null,[i(ae,{ref_key:"otherRef",ref:na,"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[w,a(n)=="other"]]),a(n)=="comment"?(m(),la("div",Q,[i(ne,{"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])])):v("",!0),g(c("div",null,[i(se,{"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[w,a(n)=="service"]]),a(n)=="aftersale"?(m(),la("div",W,[i(ce,{productId:a(U),openSource:"Spu"},null,8,["productId"])])):v("",!0)]),Z]),_:1})),[[ka,a(p)]])]),_:2},[a(l)?void 0:{name:"footer",fn:d(()=>[c("div",q,[a(l)||a(D)==4||a(V)=="create"?v("",!0):(m(),y(r,{key:0,loading:a(p),type:"danger",plain:"",onClick:t[2]||(t[2]=f=>aa(a(z).RECYCLE.status))},{default:d(()=>[x(" \u505C\u7528 ")]),_:1},8,["loading"])),a(l)||a(D)!=4?v("",!0):g((m(),y(r,{key:1,loading:a(p),type:"danger",plain:"",onClick:t[3]||(t[3]=f=>(async ga=>{try{await P.delConfirm(),await Qa(ga),P.success(E("common.delSuccess")),A(),$("success")}catch{}})(a(U)))},{default:d(()=>[x(" \u5220\u9664 ")]),_:1},8,["loading"])),[[ea,["product:spu:delete"]]]),a(l)||a(D)!=4?v("",!0):g((m(),y(r,{key:2,loading:a(p),type:"primary",onClick:t[4]||(t[4]=f=>aa(a(z).DISABLE.status))},{default:d(()=>[x(" \u6062\u590D ")]),_:1},8,["loading"])),[[ea,["product:spu:update"]]]),a(l)||a(V)=="create"||a(D)==4?v("",!0):(m(),y(r,{key:3,loading:a(p),type:"primary",onClick:ya},{default:d(()=>[x(ta(a(h).status==0?"\u4E0A\u67B6":"\u4E0B\u67B6"),1)]),_:1},8,["loading"])),a(l)?v("",!0):(m(),y(r,{key:4,loading:a(p),type:"primary",onClick:va},{default:d(()=>[x(" \u4FDD\u5B58 ")]),_:1},8,["loading"]))])]),key:"0"}]),1032,["modelValue","title","fullscreen"])}}}),[["__scopeId","data-v-473675a6"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/product/spu/form/index.vue"]])});export{Ye as __tla,ia as default};