index-b7c94dd1.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 s,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 Va,p as Ra,k as $a,_ as za,__tla as Aa}from"./index-89fa41f9.js";import{_ as ja,__tla as La}from"./ContentWrap-3b35ebb8.js";import{_ as Ya,__tla as Ja}from"./SPuUploadImg-957be6de.js";import{u as Oa,__tla as Qa}from"./tagsView-61ac48b8.js";import{g as Wa,u as ia,d as Xa,c as Za,a as qa,__tla as Ga}from"./spu-7cbbdc27.js";import Ha,{__tla as Ka}from"./InfoForm-226d89b6.js";import Ma,{__tla as Na}from"./DescriptionForm-f1705a09.js";import ae,{__tla as ee}from"./OtherForm-efd1236a.js";import te,{__tla as re}from"./SkuForm-fcb0fddf.js";import le,{__tla as oe}from"./DeliveryForm-393723ee.js";import ie,{__tla as se}from"./Service-b8ebc3ea.js";import{A as ce,__tla as _e}from"./AfterSale-7cb05997.js";import ne,{__tla as ue}from"./Comment-950c143c.js";import{P as j}from"./constants-40f13f5e.js";import{u as me,__tla as de}from"./useMessage-fcfad84c.js";import{__tla as pe}from"./ContentWrap.vue_vue_type_script_setup_true_lang-50710b25.js";import{__tla as fe}from"./el-card-fccba201.js";import{__tla as ye}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-e9ea7b56.js";import{__tla as ve}from"./index-b3af54ea.js";import{__tla as he}from"./el-image-viewer-e38f9782.js";import{__tla as ke}from"./UploadImgs-1a5dce53.js";import{__tla as ge}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-04281f84.js";import"./tree-0af4953a.js";import{__tla as Pe}from"./category-d127d5f2.js";import{__tla as we}from"./brand-d703560d.js";import{__tla as Fe}from"./formRules-646bc8c6.js";import{__tla as be}from"./Editor-e4651bd8.js";import{__tla as Ce}from"./index-57e22788.js";import{__tla as Be}from"./SkuList-263d9e50.js";import{__tla as De}from"./el-image-d51e6233.js";import{__tla as Ue}from"./UploadImg-68daee7d.js";import{__tla as Ie}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-a5cf96aa.js";import{__tla as Te}from"./ProductAttributes-1245af69.js";import{__tla as xe}from"./el-text-cb74cff1.js";import{__tla as Se}from"./property-ea96a8a4.js";import{__tla as Ee}from"./ProductPropertyAddForm-e1f9ffbe.js";import{__tla as Ve}from"./Dialog-890fafd8.js";import{__tla as Re}from"./index-de20f1a9.js";import{__tla as $e}from"./dict-dca1abd1.js";import{__tla as ze}from"./index-794ba0dc.js";import{__tla as Ae}from"./index-2c8b4efb.js";import{__tla as je}from"./index-0eb42f11.js";import{__tla as Le}from"./index-1b5135b0.js";let sa,Ye=Promise.all([(()=>{try{return Aa}catch{}})(),(()=>{try{return La}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return Qa}catch{}})(),(()=>{try{return Ga}catch{}})(),(()=>{try{return Ka}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return ee}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return se}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 Ve}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return $e}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Le}catch{}})()]).then(async()=>{let L,Y,J,O,Q,W,X,Z,q,G;L={class:"my-header"},Y={class:"my-header-left"},J={class:"my-header-right"},O=["onClick"],Q={class:"left"},W={class:"right"},X={key:0},Z={key:1},q=(S=>(Ra("data-v-473675a6"),S=S(),$a(),S))(()=>c("div",{style:{clear:"both"}},null,-1)),G={class:"dialog-footer"},sa=za(Pa({name:"ProductSpuForm",__name:"index",emits:["success"],setup(S,{expose:ca,emit:_a}){const{t:E}=Ua(),P=me();wa(),Fa(),Oa();const p=o(!1),n=o("info"),l=o(!1),H=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),V=o(""),D=o(0),U=o(),ma=o(""),h=o(),R=o(""),da=o(0),I=o(!1);ca({open:async(i,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",R.value=i,V.value=E("action."+i),i=="view"?V.value="\u67E5\u770B":i=="create"&&(u.value=oa(ua.value)),R.value=="view"?l.value=!0:l.value=!1}});const pa=()=>{I.value=!I.value},fa=async()=>{var t;const i=U.value;if(i){p.value=!0;try{const k=await Wa(i);(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 i=>{try{const t=i===j.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 ia({id:h.value.id,status:i}),P.success(t+"\u6210\u529F"),z(),$("success")}catch{}},ya=async()=>{console.log(h.value.status);try{const i=h.value.status?"\u4E0B\u67B6":"\u4E0A\u67B6",t=h.value.status?0:1;await P.confirm(`\u786E\u8BA4\u8981${i}"${h.value.name}"\u5417\uFF1F`),await ia({id:h.value.id,status:t}),P.success(i+"\u6210\u529F"),z(),$("success")}catch{}},va=async()=>{var i,t,k,e;p.value=!0;try{await((i=a(H))==null?void 0:i.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 A=_;U.value?(await qa(A),P.success(E("common.updateSuccess"))):(await Za(A),P.success(E("common.createSuccess"))),z(),$("success")}finally{p.value=!1}},z=()=>{B.value=!1};return(i,t)=>{const k=Ia,e=Ya,_=Ta,T=xa,A=ja,r=Sa,ha=Ea,ka=Va,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(V),fullscreen:a(I),"show-close":!1,width:"70%",draggable:"",class:"dialog"},Ca({header:d(({close:f})=>[c("div",L,[c("div",Y,ta(a(V)),1),c("div",J,[c("span",{onClick:pa},[s(a(Ba),{icon:a(I)?"zmdi:fullscreen-exit":"zmdi:fullscreen"},null,8,["icon"])]),c("span",{onClick:f},[s(k,null,{default:d(()=>[s(a(Da))]),_:1})],8,O)])])]),default:d(()=>[g((m(),y(A,{style:{"max-height":"560px","min-height":"560px","overflow-y":"auto","border-bottom":"none"}},{default:d(()=>[c("div",Q,[s(e,{modelValue:a(u).picUrl,"onUpdate:modelValue":t[0]||(t[0]=f=>a(u).picUrl=f),disabled:a(l)},null,8,["modelValue","disabled"]),s(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(()=>[s(_,{label:"\u57FA\u672C\u4FE1\u606F",name:"info"}),s(_,{label:"\u4EF7\u683C/\u89C4\u683C/\u578B\u53F7",name:"sku"}),s(_,{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),s(_,{label:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"})]),_:1},8,["modelValue"])]),c("div",W,[g(c("div",null,[s(Ha,{ref_key:"infoRef",ref:H,"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[w,a(n)=="info"]]),g(c("div",null,[s(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,[s(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,[s(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,[s(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",X,[s(ne,{"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])])):v("",!0),g(c("div",null,[s(ie,{"is-detail":a(l),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[w,a(n)=="service"]]),a(n)=="aftersale"?(m(),la("div",Z,[s(ce,{productId:a(U),openSource:"Spu"},null,8,["productId"])])):v("",!0)]),q]),_:1})),[[ka,a(p)]])]),_:2},[a(l)?void 0:{name:"footer",fn:d(()=>[c("div",G,[a(l)||a(D)==4||a(R)=="create"?v("",!0):(m(),y(r,{key:0,loading:a(p),type:"danger",plain:"",onClick:t[2]||(t[2]=f=>aa(a(j).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 Xa(ga),P.success(E("common.delSuccess")),z(),$("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(j).DISABLE.status))},{default:d(()=>[x(" \u6062\u590D ")]),_:1},8,["loading"])),[[ea,["product:spu:update"]]]),a(l)||a(R)=="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","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/spu/form/index.vue"]])});export{Ye as __tla,sa as default};