import{_ as aa,d as ka,u as ga,L as Pa,r,M as wa,o as P,x as w,w as c,g as _,t as ea,a,f as i,j as ba,bg as Ca,z as k,l as ta,$ as B,y as D,a0 as F,h as Ua,aG as ra,bh as I,bi as V,bj as E,bb as Ba,m as Da,n as Fa,G as Ia,C as Va,H as Ea,bk as Ra,K as Ta,__tla as xa}from"./index-8dc1e40a.js";import{_ as Sa,__tla as ja}from"./ContentWrap-0aca5216.js";import{_ as za,__tla as $a}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-703a828c.js";import{u as La,__tla as Ha}from"./tagsView-7673bb19.js";import{g as Ga,u as la,d as Xa,c as Ya,a as Aa,__tla as Ka}from"./spu-559f5d98.js";import Ma,{__tla as qa}from"./InfoForm-4adb417a.js";import Ja,{__tla as Na}from"./DescriptionForm-921bff78.js";import Oa,{__tla as Qa}from"./OtherForm-8cd81a4d.js";import Wa,{__tla as Za}from"./SkuForm-dff242fe.js";import ae,{__tla as ee}from"./DeliveryForm-77dc5a1d.js";import{c as L}from"./constants-a1da293a.js";import{u as te,__tla as re}from"./useMessage-7a27dd80.js";import{__tla as le}from"./el-card-18df90f0.js";import{__tla as se}from"./index-519182c1.js";import{__tla as ie}from"./el-image-viewer-3b8905e6.js";import{__tla as oe}from"./UploadImgs-c9e344db.js";import{__tla as ce}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-c25ae3d0.js";import"./tree-0af4953a.js";import{__tla as _e}from"./category-e7433506.js";import{__tla as ue}from"./brand-c4a32907.js";import{__tla as ne}from"./formRules-467f9efe.js";import{__tla as me}from"./Editor-78efff00.js";import{__tla as de}from"./index-c31b5019.js";import{__tla as pe}from"./SkuList-d3adf088.js";import{__tla as fe}from"./el-image-6a48e9f1.js";import{__tla as ye}from"./UploadImg-c2c75279.js";import{__tla as ve}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-fa07b40d.js";import{__tla as he}from"./ProductAttributes-5fd61aa5.js";import{__tla as ke}from"./el-text-13e93c25.js";import{__tla as ge}from"./property-22343ea6.js";import{__tla as Pe}from"./ProductPropertyAddForm-e7ce6cc1.js";import{__tla as we}from"./Dialog-41802231.js";import{__tla as be}from"./index-034c00d4.js";import{__tla as Ce}from"./dict-f13a3c8f.js";let sa,Ue=Promise.all([(()=>{try{return xa}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return Ka}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return Qa}catch{}})(),(()=>{try{return Za}catch{}})(),(()=>{try{return ee}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return ue}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 we}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Ce}catch{}})()]).then(async()=>{let H,G,X,Y,A,K,M;H=aa(za,[["__scopeId","data-v-ba706063"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/components/UploadFile/src/SPuUploadImg.vue"]]),G={class:"my-header"},X={class:"my-header-left"},Y={class:"my-header-right"},A=["onClick"],K={class:"left"},M={class:"right"},sa=aa(ka({name:"ProductSpuForm",__name:"index",emits:["success"],setup(Be,{expose:ia,emit:oa}){const{t:R}=Ua(),v=te();ga(),Pa(),La();const u=r(!1),d=r("info"),o=r(!1),q=r(),J=r(),N=r(),O=r(),Q=r(),n=r({name:"",categoryId:void 0,keyword:"",picUrl:"",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,firstBrokeragePrice:0,secondBrokeragePrice:0}],description:"",sort:0,giveIntegral:0,virtualSalesCount:0}),ca=r({name:"",categoryId:void 0,keyword:"",picUrl:"",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,firstBrokeragePrice:0,secondBrokeragePrice:0}],description:"",sort:0,giveIntegral:0,virtualSalesCount:0}),b=r(!1),T=r(""),x=r(0),C=r(),_a=r(""),p=r(),S=r(""),ua=r(0),U=r(!1);ia({open:async(l,e,f,t)=>{x.value=t,p.value=e,ua.value=f,b.value=!0,C.value=e.id,_a.value=e.picUrl,U.value=!1,await ma(),d.value="info",S.value=l,T.value=R("action."+l),l=="view"?T.value="\u67E5\u770B":l=="create"&&(n.value=ra(ca.value)),S.value=="view"?o.value=!0:o.value=!1}});const na=()=>{U.value=!U.value},ma=async()=>{var e;console.log(C.value);const l=C.value;if(l){u.value=!0;try{const f=await Ga(l);(e=f.skus)==null||e.forEach(t=>{o.value?(t.price=I(t.price),t.marketPrice=I(t.marketPrice),t.costPrice=I(t.costPrice),t.firstBrokeragePrice=I(t.firstBrokeragePrice),t.secondBrokeragePrice=I(t.secondBrokeragePrice)):(t.price=V(t.price),t.marketPrice=V(t.marketPrice),t.costPrice=V(t.costPrice),t.firstBrokeragePrice=V(t.firstBrokeragePrice),t.secondBrokeragePrice=V(t.secondBrokeragePrice))}),n.value=f}finally{u.value=!1}}},j=oa,W=async l=>{try{const e=l===L.RECYCLE.status?"\u52A0\u5165\u5230\u56DE\u6536\u7AD9":"\u6062\u590D\u5230\u4ED3\u5E93";await v.confirm(`\u786E\u8BA4\u8981"${p.value.name}"${e}\u5417\uFF1F`),await la({id:p.value.id,status:l}),v.success(e+"\u6210\u529F"),z(),j("success")}catch{}},da=async()=>{console.log(p.value.status);try{const l=p.value.status?"\u4E0B\u67B6":"\u4E0A\u67B6",e=p.value.status?0:1;await v.confirm(`\u786E\u8BA4\u8981${l}"${p.value.name}"\u5417\uFF1F`),await la({id:p.value.id,status:e}),v.success(l+"\u6210\u529F"),z(),j("success")}catch{}},pa=async()=>{var l,e,f,t,h;u.value=!0;try{await((l=a(q))==null?void 0:l.validate()),await((e=a(J))==null?void 0:e.validate()),await((f=a(N))==null?void 0:f.validate()),await((t=a(O))==null?void 0:t.validate()),await((h=a(Q))==null?void 0:h.validate());const g=ra(a(n.value));g.skus.forEach(s=>{s.name=g.name,s.price=E(s.price),s.marketPrice=E(s.marketPrice),s.costPrice=E(s.costPrice),s.firstBrokeragePrice=E(s.firstBrokeragePrice),s.secondBrokeragePrice=E(s.secondBrokeragePrice)});const y=[];g.sliderPicUrls.forEach(s=>{typeof s=="object"?y.push(s.url):y.push(s)}),g.sliderPicUrls=y;const $=g;C.value?(await Aa($),v.success(R("common.updateSuccess"))):(await Ya($),v.success(R("common.createSuccess"))),z(),j("success")}finally{u.value=!1}},z=()=>{b.value=!1};return(l,e)=>{const f=Ba,t=H,h=Da,g=Fa,y=Ia,$=Va,s=Ea,fa=Sa,ya=Ra,Z=wa("hasPermi"),va=Ta;return P(),w(ya,{modelValue:a(b),"onUpdate:modelValue":e[5]||(e[5]=m=>ta(b)?b.value=m:null),title:a(T),fullscreen:a(U),"show-close":!1,width:"70%",draggable:"",class:"dialog"},{header:c(({close:m})=>[_("div",G,[_("div",X,ea(a(T)),1),_("div",Y,[_("span",{onClick:na},[i(a(ba),{icon:a(U)?"zmdi:fullscreen-exit":"zmdi:fullscreen"},null,8,["icon"])]),_("span",{onClick:m},[i(f,null,{default:c(()=>[i(a(Ca))]),_:1})],8,A)])])]),default:c(()=>[k((P(),w(fa,null,{default:c(()=>[_("div",K,[i(t,{modelValue:a(n).picUrl,"onUpdate:modelValue":e[0]||(e[0]=m=>a(n).picUrl=m),disabled:a(o)},null,8,["modelValue","disabled"]),i(g,{modelValue:a(d),"onUpdate:modelValue":e[1]||(e[1]=m=>ta(d)?d.value=m:null),"tab-position":"left",class:"child-tabs"},{default:c(()=>[i(h,{label:"\u57FA\u7840\u8BBE\u7F6E",name:"info"}),i(h,{label:"\u4EF7\u683C\u5E93\u5B58",name:"sku"}),i(h,{label:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"}),i(h,{label:"\u5546\u54C1\u8BE6\u60C5",name:"description"}),i(h,{label:"\u5176\u5B83\u8BBE\u7F6E",name:"other"})]),_:1},8,["modelValue"])]),_("div",M,[k(_("div",null,[i(Ma,{ref_key:"infoRef",ref:q,"is-detail":a(o),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[B,a(d)=="info"]]),k(_("div",null,[i(Wa,{ref_key:"skuRef",ref:J,"is-detail":a(o),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[B,a(d)=="sku"]]),k(_("div",null,[i(ae,{ref_key:"deliveryRef",ref:N,"is-detail":a(o),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[B,a(d)=="delivery"]]),k(_("div",null,[i(Ja,{ref_key:"descriptionRef",ref:O,"is-detail":a(o),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[B,a(d)=="description"]]),k(_("div",null,[i(Oa,{ref_key:"otherRef",ref:Q,"is-detail":a(o),propFormData:a(n)},null,8,["is-detail","propFormData"])],512),[[B,a(d)=="other"]])]),i(s,{style:{clear:"both"}},{default:c(()=>[i($,{style:{float:"right"}},{default:c(()=>[a(o)||a(x)==4||a(S)=="create"?F("",!0):(P(),w(y,{key:0,loading:a(u),type:"danger",plain:"",onClick:e[2]||(e[2]=m=>W(a(L).RECYCLE.status))},{default:c(()=>[D(" \u505C\u7528 ")]),_:1},8,["loading"])),a(o)||a(x)!=4?F("",!0):k((P(),w(y,{key:1,loading:a(u),type:"danger",plain:"",onClick:e[3]||(e[3]=m=>(async ha=>{try{await v.delConfirm(),await Xa(ha),v.success(R("common.delSuccess")),z(),j("success")}catch{}})(a(C)))},{default:c(()=>[D(" \u5220\u9664 ")]),_:1},8,["loading"])),[[Z,["product:spu:delete"]]]),a(o)||a(x)!=4?F("",!0):k((P(),w(y,{key:2,loading:a(u),type:"primary",onClick:e[4]||(e[4]=m=>W(a(L).DISABLE.status))},{default:c(()=>[D(" \u6062\u590D ")]),_:1},8,["loading"])),[[Z,["product:spu:update"]]]),a(o)||a(S)=="create"?F("",!0):(P(),w(y,{key:3,loading:a(u),type:"primary",onClick:da},{default:c(()=>[D(ea(a(p).status==0?"\u4E0A\u67B6":"\u4E0B\u67B6"),1)]),_:1},8,["loading"])),a(o)?F("",!0):(P(),w(y,{key:4,loading:a(u),type:"primary",onClick:pa},{default:c(()=>[D(" \u4FDD\u5B58 ")]),_:1},8,["loading"]))]),_:1})]),_:1})]),_:1})),[[va,a(u)]])]),_:1},8,["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{Ue as __tla,sa as default};