1 |
- import{d as ha,u as ka,I as ga,r as o,P as Pa,o as y,q as v,aX as ba,a,w as m,g as i,m as I,O as P,v as d,t as aa,f as c,_ as wa,aY as Ca,N as ea,a3 as b,h as Ba,aZ as ta,aq as U,ar as S,a_ as T,aS as Fa,V as Da,W as Ia,B as Ua,a$ as Sa,H as Ta,p as Va,j as xa,__tla as Ea}from"./index-2eab2d23.js";import{_ as Ra,__tla as $a}from"./ContentWrap.vue_vue_type_script_setup_true_lang-5a63038a.js";import{_ as ja,__tla as Aa}from"./SPuUploadImg-4b5016f1.js";import{u as La,__tla as Ya}from"./tagsView-fd4f3d23.js";import{g as qa,u as ra,d as za,c as Ga,a as Ha,__tla as Na}from"./spu-73047b60.js";import Oa,{__tla as Wa}from"./InfoForm-7faea2d0.js";import Xa,{__tla as Za}from"./DescriptionForm-7e64fe15.js";import Ja,{__tla as Ka}from"./OtherForm-f34a583e.js";import Ma,{__tla as Qa}from"./SkuForm-4d15ae27.js";import ae,{__tla as ee}from"./DeliveryForm-b244d671.js";import te,{__tla as re}from"./Service-39db17d3.js";import{A as le,__tla as oe}from"./AfterSale-82845424.js";import se,{__tla as ie}from"./Comment-0718ca3a.js";import{P as L}from"./constants-40f13f5e.js";import{u as ce,__tla as _e}from"./useMessage-171aa63e.js";import{_ as ue}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as ne}from"./el-card-c558f0ec.js";import{__tla as me}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-4db00aa5.js";import{__tla as de}from"./index-d3f876ab.js";import{__tla as pe}from"./el-image-viewer-5d14bc77.js";import{__tla as fe}from"./UploadImgs-88de5939.js";import{__tla as ye}from"./UploadImgs.vue_vue_type_style_index_0_scoped_0ff04634_lang-20f165d6.js";import"./tree-fd3a041e.js";import{__tla as ve}from"./category-c573377b.js";import{__tla as he}from"./brand-f2788f28.js";import{__tla as ke}from"./formRules-228bd511.js";import{__tla as ge}from"./style.css_vue_type_style_index_0_src_true_lang-2706eaa9.js";import{__tla as Pe}from"./index-6bdb8877.js";import{__tla as be}from"./SkuList.vue_vue_type_script_setup_true_lang-d7f9bf43.js";import{__tla as we}from"./el-image-2171f3ff.js";import{__tla as Ce}from"./UploadImg-90fe71c2.js";import{__tla as Be}from"./UploadFile.vue_vue_type_style_index_0_scoped_2570c8e9_lang-df9c704a.js";import{__tla as Fe}from"./ProductAttributes.vue_vue_type_script_setup_true_lang-ac3c1619.js";import{__tla as De}from"./el-text-b1163e3d.js";import{__tla as Ie}from"./property-64c4a36d.js";import{__tla as Ue}from"./ProductPropertyAddForm.vue_vue_type_script_setup_true_lang-a3ddb9c8.js";import{__tla as Se}from"./Dialog-c2716df6.js";import{__tla as Te}from"./index-8bc1e5b3.js";import{__tla as Ve}from"./dict-1ad71b6f.js";import{__tla as xe}from"./index-3562b2a3.js";let la,Ee=Promise.all([(()=>{try{return Ea}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Ya}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return Wa}catch{}})(),(()=>{try{return Za}catch{}})(),(()=>{try{return Ka}catch{}})(),(()=>{try{return Qa}catch{}})(),(()=>{try{return ee}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return me}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 be}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Be}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ie}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return xe}catch{}})()]).then(async()=>{let Y,q,z,G,H,N,O,W;Y={class:"my-header"},q={class:"my-header-left"},z={class:"my-header-right"},G=["onClick"],H={class:"left"},N={class:"right"},O=(V=>(Va("data-v-76253efb"),V=V(),xa(),V))(()=>i("div",{style:{clear:"both"}},null,-1)),W={class:"dialog-footer"},la=ue(ha({name:"ProductSpuForm",__name:"index",emits:["success"],setup(V,{expose:oa,emit:sa}){const{t:x}=Ba(),k=ce();ka(),ga(),La();const p=o(!1),u=o("info"),l=o(!1),X=o(),Z=o(),J=o(),K=o(),ia=o(),n=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}),ca=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}),w=o(!1),E=o(""),C=o(0),B=o(),_a=o(""),g=o(),R=o(""),ua=o(0),F=o(!1);oa({open:async(s,e,h,t)=>{C.value=t,g.value=e,ua.value=h,w.value=!0,B.value=e.id,_a.value=e.picUrl,F.value=!1,await ma(),u.value="info",R.value=s,E.value=x("action."+s),s=="view"?E.value="\u67E5\u770B":s=="create"&&(n.value=ta(ca.value)),R.value=="view"?l.value=!0:l.value=!1}});const na=()=>{F.value=!F.value},ma=async()=>{var e;const s=B.value;if(s){p.value=!0;try{const h=await qa(s);(e=h.skus)==null||e.forEach(t=>{l.value?(t.price=U(t.price),t.marketPrice=U(t.marketPrice),t.costPrice=U(t.costPrice),t.firstBrokeragePrice=U(t.firstBrokeragePrice),t.secondBrokeragePrice=U(t.secondBrokeragePrice)):(t.price=S(t.price),t.marketPrice=S(t.marketPrice),t.costPrice=S(t.costPrice),t.firstBrokeragePrice=S(t.firstBrokeragePrice),t.secondBrokeragePrice=S(t.secondBrokeragePrice))}),n.value=h}finally{p.value=!1}}},$=sa,M=async s=>{try{const e=s===L.RECYCLE.status?"\u52A0\u5165\u5230\u56DE\u6536\u7AD9":"\u6062\u590D\u5230\u4ED3\u5E93";await k.confirm(`\u786E\u8BA4\u8981"${g.value.name}"${e}\u5417\uFF1F`),await ra({id:g.value.id,status:s}),k.success(e+"\u6210\u529F"),j(),$("success")}catch{}},da=async()=>{try{const s=g.value.status?"\u4E0B\u67B6":"\u4E0A\u67B6",e=g.value.status?0:1;await k.confirm(`\u786E\u8BA4\u8981${s}"${g.value.name}"\u5417\uFF1F`),await ra({id:g.value.id,status:e}),k.success(s+"\u6210\u529F"),j(),$("success")}catch{}},pa=async()=>{var s,e,h,t;p.value=!0;try{await((s=a(X))==null?void 0:s.validate()),await((e=a(Z))==null?void 0:e.validate()),await((h=a(J))==null?void 0:h.validate()),await((t=a(K))==null?void 0:t.validate());const _=ta(a(n.value));_.skus.forEach(r=>{r.name=_.name,r.price=T(r.price),r.marketPrice=T(r.marketPrice),r.costPrice=T(r.costPrice),r.firstBrokeragePrice=T(r.firstBrokeragePrice),r.secondBrokeragePrice=T(r.secondBrokeragePrice)});const D=[];_.sliderPicUrls.forEach(r=>{typeof r=="object"?D.push(r.url):D.push(r)}),_.sliderPicUrls=D;const A=_;B.value?(await Ha(A),k.success(x("common.updateSuccess"))):(await Ga(A),k.success(x("common.createSuccess"))),j(),$("success")}finally{p.value=!1}},j=()=>{w.value=!1};return(s,e)=>{const h=Fa,t=ja,_=Da,D=Ia,A=Ra,r=Ua,fa=Sa,ya=Ta,Q=Pa("hasPermi");return y(),v(fa,{modelValue:a(w),"onUpdate:modelValue":e[5]||(e[5]=f=>ea(w)?w.value=f:null),title:a(E),fullscreen:a(F),"show-close":!1,width:"70%",draggable:"",class:"dialog"},ba({header:m(({close:f})=>[i("div",Y,[i("div",q,aa(a(E)),1),i("div",z,[i("span",{onClick:na},[c(a(wa),{icon:a(F)?"zmdi:fullscreen-exit":"zmdi:fullscreen"},null,8,["icon"])]),i("span",{onClick:f},[c(h,null,{default:m(()=>[c(a(Ca))]),_:1})],8,G)])])]),default:m(()=>[d((y(),v(A,{style:{"max-height":"560px","min-height":"560px","overflow-y":"auto","border-bottom":"none"}},{default:m(()=>[i("div",H,[c(t,{modelValue:a(n).picUrl,"onUpdate:modelValue":e[0]||(e[0]=f=>a(n).picUrl=f),disabled:a(l)},null,8,["modelValue","disabled"]),c(D,{modelValue:a(u),"onUpdate:modelValue":e[1]||(e[1]=f=>ea(u)?u.value=f:null),"tab-position":"left",class:"child-tabs"},{default:m(()=>[c(_,{label:"\u57FA\u672C\u4FE1\u606F",name:"info"}),c(_,{label:"\u4EF7\u683C/\u89C4\u683C/\u578B\u53F7",name:"sku"}),c(_,{label:"\u8BE6\u60C5",name:"description"}),a(l)?(y(),v(_,{key:0,label:"\u8BC4\u4EF7",name:"comment"})):P("",!0),a(l)?(y(),v(_,{key:1,label:"\u5BA2\u670D",name:"service"})):P("",!0),a(l)?(y(),v(_,{key:2,label:"\u552E\u540E",name:"aftersale"})):P("",!0),c(_,{label:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"})]),_:1},8,["modelValue"])]),i("div",N,[d(i("div",null,[c(Oa,{ref_key:"infoRef",ref:X,"is-detail":a(l),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[b,a(u)=="info"]]),d(i("div",null,[c(Ma,{ref_key:"skuRef",ref:Z,"is-detail":a(l),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[b,a(u)=="sku"]]),d(i("div",null,[c(ae,{ref_key:"deliveryRef",ref:J,"is-detail":a(l),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[b,a(u)=="delivery"]]),d(i("div",null,[c(Xa,{ref_key:"descriptionRef",ref:K,"is-detail":a(l),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[b,a(u)=="description"]]),d(i("div",null,[c(Ja,{ref_key:"otherRef",ref:ia,"is-detail":a(l),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[b,a(u)=="other"]]),d(i("div",null,[c(se,{"is-detail":a(l),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[b,a(u)=="comment"]]),d(i("div",null,[c(te,{"is-detail":a(l),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[b,a(u)=="service"]]),d(i("div",null,[c(le,{productId:a(B),openSource:"Spu"},null,8,["productId"])],512),[[b,a(u)=="aftersale"]])]),O]),_:1})),[[ya,a(p)]])]),_:2},[a(l)?void 0:{name:"footer",fn:m(()=>[i("div",W,[a(l)||a(C)==4||a(R)=="create"?P("",!0):(y(),v(r,{key:0,loading:a(p),type:"danger",plain:"",onClick:e[2]||(e[2]=f=>M(a(L).RECYCLE.status))},{default:m(()=>[I(" \u505C\u7528 ")]),_:1},8,["loading"])),a(l)||a(C)!=4?P("",!0):d((y(),v(r,{key:1,loading:a(p),type:"danger",plain:"",onClick:e[3]||(e[3]=f=>(async va=>{try{await k.delConfirm(),await za(va),k.success(x("common.delSuccess")),j(),$("success")}catch{}})(a(B)))},{default:m(()=>[I(" \u5220\u9664 ")]),_:1},8,["loading"])),[[Q,["product:spu:delete"]]]),a(l)||a(C)!=4?P("",!0):d((y(),v(r,{key:2,loading:a(p),type:"primary",onClick:e[4]||(e[4]=f=>M(a(L).DISABLE.status))},{default:m(()=>[I(" \u6062\u590D ")]),_:1},8,["loading"])),[[Q,["product:spu:update"]]]),a(l)||a(R)=="create"||a(C)==4?P("",!0):(y(),v(r,{key:3,loading:a(p),type:"primary",onClick:da},{default:m(()=>[I(aa(a(g).status==0?"\u4E0A\u67B6":"\u4E0B\u67B6"),1)]),_:1},8,["loading"])),a(l)?P("",!0):(y(),v(r,{key:4,loading:a(p),type:"primary",onClick:pa},{default:m(()=>[I(" \u4FDD\u5B58 ")]),_:1},8,["loading"]))])]),key:"0"}]),1032,["modelValue","title","fullscreen"])}}}),[["__scopeId","data-v-76253efb"]])});export{Ee as __tla,la as default};
|