MobileIndex-bbdb268b.js 9.5 KB

1
  1. import{d as G,g as R,as as U,r as s,M as H,y as J,z as K,h as A,C as _,a as r,o as j,k as O,w as B,j as l,i as e,Q as Z,a6 as n,c as $,R as tt,l as rt,A as at,at as h,au as P,av as et,aw as d,q as it,L as ot,s as ct,v as lt,__tla as st}from"./index-abaca7e8.js";import{_ as _t,__tla as nt}from"./ContentWrap.vue_vue_type_script_setup_true_lang-9818245e.js";import{g as mt,c as pt,u as ut,__tla as dt}from"./spu-58800749.js";import yt,{__tla as ft}from"./InfoForm-38155499.js";import ht,{__tla as Pt}from"./DescriptionForm-b61af0dc.js";import gt,{__tla as vt}from"./OtherForm-004264a4.js";import kt,{__tla as Ft}from"./SkuForm-8979b3c8.js";import Bt,{__tla as wt}from"./DeliveryForm-d6b812e7.js";import Dt,{__tla as St}from"./Service-db08b50e.js";import{A as bt,__tla as Tt}from"./AfterSale-ad2e0ae0.js";import Et,{__tla as It}from"./Apply-b00b74bc.js";import xt,{__tla as Ct}from"./Comment-eec694a2.js";import{u as Nt,__tla as Rt}from"./useMessage-7c79d01b.js";import{_ as Ut}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as At}from"./el-card-ff5a526a.js";import{__tla as jt}from"./UploadImgs-9d0787c5.js";import{__tla as qt}from"./UploadImgs.vue_vue_type_style_index_0_scoped_3d27d917_lang-787db1dd.js";import{__tla as zt}from"./el-image-viewer-45c4debe.js";import"./tree-fd3a041e.js";import{__tla as Mt}from"./category-6f60247b.js";import{__tla as Lt}from"./brand-6b4fd521.js";import{__tla as Qt}from"./formRules-04bbe1b7.js";import{__tla as Vt}from"./style.css_vue_type_style_index_0_src_true_lang-097712b4.js";import{__tla as Wt}from"./index-9ba9fadc.js";import{__tla as Xt}from"./SkuList.vue_vue_type_script_setup_true_lang-937def20.js";import{__tla as Yt}from"./el-image-56fee7ab.js";import{__tla as Gt}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-8933ee1b.js";import{__tla as Ht}from"./index-1a54edc6.js";import{__tla as Jt}from"./UploadImg-47ac0338.js";import{__tla as Kt}from"./UploadFile.vue_vue_type_style_index_0_scoped_2570c8e9_lang-af6b82f0.js";import{__tla as Ot}from"./PcComponents.css_vue_type_style_index_0_src_bf8feb19_scoped_bf8feb19_lang-b209d228.js";import{__tla as Zt}from"./ProductAttributes.vue_vue_type_script_setup_true_lang-e4222778.js";import{__tla as $t}from"./el-text-a044817c.js";import{__tla as tr}from"./property-7254be88.js";import{__tla as rr}from"./ProductPropertyAddForm.vue_vue_type_script_setup_true_lang-e855895f.js";import{__tla as ar}from"./Dialog-a2f7c92a.js";import{__tla as er}from"./MobileSkuList-d6f6a0ba.js";import{__tla as ir}from"./index-79b44574.js";import{__tla as or}from"./dict-885a7988.js";import"./constants-e43f22dd.js";import{__tla as cr}from"./index-e692387c.js";import{__tla as lr}from"./index.vue_vue_type_script_setup_true_lang-f7ebf07b.js";import{__tla as sr}from"./index-e37a1056.js";import{__tla as _r}from"./index-e93f6059.js";import{__tla as nr}from"./formatTime-0c1ba065.js";let q,mr=Promise.all([(()=>{try{return st}catch{}})(),(()=>{try{return nt}catch{}})(),(()=>{try{return dt}catch{}})(),(()=>{try{return ft}catch{}})(),(()=>{try{return Pt}catch{}})(),(()=>{try{return vt}catch{}})(),(()=>{try{return Ft}catch{}})(),(()=>{try{return wt}catch{}})(),(()=>{try{return St}catch{}})(),(()=>{try{return Tt}catch{}})(),(()=>{try{return It}catch{}})(),(()=>{try{return Ct}catch{}})(),(()=>{try{return Rt}catch{}})(),(()=>{try{return At}catch{}})(),(()=>{try{return jt}catch{}})(),(()=>{try{return qt}catch{}})(),(()=>{try{return zt}catch{}})(),(()=>{try{return Mt}catch{}})(),(()=>{try{return Lt}catch{}})(),(()=>{try{return Qt}catch{}})(),(()=>{try{return Vt}catch{}})(),(()=>{try{return Wt}catch{}})(),(()=>{try{return Xt}catch{}})(),(()=>{try{return Yt}catch{}})(),(()=>{try{return Gt}catch{}})(),(()=>{try{return Ht}catch{}})(),(()=>{try{return Jt}catch{}})(),(()=>{try{return Kt}catch{}})(),(()=>{try{return Ot}catch{}})(),(()=>{try{return Zt}catch{}})(),(()=>{try{return $t}catch{}})(),(()=>{try{return tr}catch{}})(),(()=>{try{return rr}catch{}})(),(()=>{try{return ar}catch{}})(),(()=>{try{return er}catch{}})(),(()=>{try{return ir}catch{}})(),(()=>{try{return or}catch{}})(),(()=>{try{return cr}catch{}})(),(()=>{try{return lr}catch{}})(),(()=>{try{return sr}catch{}})(),(()=>{try{return _r}catch{}})(),(()=>{try{return nr}catch{}})()]).then(async()=>{let w,D,S,b;w={class:"top",style:{position:"relative",overflow:"hidden"}},D={class:"bottom"},S={key:0},b=(v=>(ct("data-v-0a3a51d4"),v=v(),lt(),v))(()=>l("div",{style:{clear:"both"}},null,-1)),q=Ut(G({name:"ProductSpuForm",__name:"MobileIndex",emits:["success"],setup(v,{emit:z}){const T=Nt(),M=R({value:0}),L=R({value:!1});U("highPrecisionChange",L);const Q=z;U("spuTypeChange",M);const{t:E}=at(),y=s(!1),o=s("info"),p=s(!0),I=s(),x=s(),C=s(),N=s(),V=s(),c=s({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:"",highPrecisionPrice:0,firstBrokeragePrice:0,secondBrokeragePrice:0}],description:"",sort:0,giveIntegral:0,virtualSalesCount:0}),W=H(),k=s(Number(W.params.id)),X=async()=>{var f,m,i,t;y.value=!0;try{await((f=r(I))==null?void 0:f.validate()),await((m=r(x))==null?void 0:m.validate()),await((i=r(C))==null?void 0:i.validate()),await((t=r(N))==null?void 0:t.validate());const u=et(r(c.value));u.skus.forEach(a=>{a.name=u.name,a.price=d(a.price),a.highPrecisionPrice=(100*a.highPrecisionPrice).toFixed(6),a.marketPrice=d(a.marketPrice),a.promotionFee=d(a.promotionFee),a.costPrice=d(a.costPrice),a.settlementPrice=d(a.settlementPrice),a.highPrecisionSettlementPrice=(100*a.highPrecisionSettlementPrice).toFixed(6),a.firstBrokeragePrice=d(a.firstBrokeragePrice),a.secondBrokeragePrice=d(a.secondBrokeragePrice)});const g=[];u.sliderPicUrls.forEach(a=>{typeof a=="object"?g.push(a.url):g.push(a)}),u.sliderPicUrls=g;const F=u;k.value?(await ut(F),T.success(E("common.updateSuccess"))):(await pt(F),T.success(E("common.createSuccess"))),close(),Q("success")}finally{y.value=!1}};return J(()=>{(async()=>{var m;const f=k.value;if(f){y.value=!0;try{const i=await mt(f);(m=i.skus)==null||m.forEach(t=>{p.value?(t.price=h(t.price),t.marketPrice=h(t.marketPrice),t.highPrecisionPrice=t.highPrecisionPrice/100,t.settlementPrice=h(t.settlementPrice),t.highPrecisionSettlementPrice=t.highPrecisionSettlementPrice/100,t.costPrice=h(t.costPrice),t.firstBrokeragePrice=h(t.firstBrokeragePrice),t.secondBrokeragePrice=h(t.secondBrokeragePrice)):(t.price=P(t.price),t.marketPrice=P(t.marketPrice),t.settlementPrice=P(t.settlementPrice),t.highPrecisionSettlementPrice=t.highPrecisionSettlementPrice/100,t.highPrecisionPrice=t.highPrecisionPrice/100,t.costPrice=P(t.costPrice),t.firstBrokeragePrice=P(t.firstBrokeragePrice),t.secondBrokeragePrice=P(t.secondBrokeragePrice))}),c.value=i}finally{y.value=!1}}})(),document.getElementsByTagName("section")[1].style.padding="0px",document.getElementsByTagName("section")[1].style.width="100%",document.getElementsByTagName("section")[1].querySelector("div").style.border="none",document.getElementsByTagName("section")[1].style.background="#f5f7f9"}),K(()=>{document.getElementsByTagName("section")[1].style.width="auto",document.getElementsByTagName("section")[1].style.padding="20px",document.getElementsByTagName("section")[1].style.background="var(--el-color-white)"}),(f,m)=>{const i=A("van-tab"),t=A("van-tabs"),u=it,g=_t,F=ot;return _((j(),O(g,{style:{"overflow-y":"auto"},class:"ContentWrap"},{default:B(()=>{var a;return[l("div",w,[e(t,{active:r(o),"onUpdate:active":m[0]||(m[0]=Y=>Z(o)?o.value=Y:null)},{default:B(()=>[e(i,{title:"\u57FA\u672C\u4FE1\u606F",name:"info"}),e(i,{title:"\u4EF7\u683C/\u89C4\u683C/\u578B\u53F7",name:"sku"}),e(i,{title:"\u8BE6\u60C5",name:"description"}),e(i,{title:"\u8BC4\u4EF7",name:"comment"}),e(i,{title:"\u5BA2\u670D",name:"service"}),e(i,{title:"\u552E\u540E",name:"aftersale"}),e(i,{title:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"}),e(i,{title:"\u7533\u8BF7\u8BB0\u5F55",name:"apply"})]),_:1},8,["active"])]),l("div",D,[_(l("div",null,[e(yt,{ref_key:"infoRef",ref:I,"is-detail":r(p),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[n,r(o)=="info"]]),_(l("div",null,[e(kt,{ref_key:"skuRef",ref:x,isDetail:!1,propFormData:r(c)},null,8,["propFormData"])],512),[[n,r(o)=="sku"]]),_(l("div",null,[e(Bt,{ref_key:"deliveryRef",ref:C,"is-detail":r(p),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[n,r(o)=="delivery"]]),_(l("div",null,[e(ht,{ref_key:"descriptionRef",ref:N,"is-detail":r(p),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[n,r(o)=="description"]]),_(l("div",null,[e(gt,{ref_key:"otherRef",ref:V,"is-detail":r(p),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[n,r(o)=="other"]]),_(l("div",null,[e(xt,{"is-detail":r(p),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[n,r(o)=="comment"]]),_(l("div",null,[e(Dt,{"is-detail":r(p),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[n,r(o)=="service"]]),_(l("div",null,[e(bt,{productId:r(k),openSource:"Spu"},null,8,["productId"])],512),[[n,r(o)=="aftersale"]]),r(o)=="apply"?(j(),$("div",S,[e(Et,{productId:r(k),propFormData:r(c)},null,8,["productId","propFormData"])])):tt("",!0)]),b,_(e(u,{loading:r(y),type:"primary",onClick:X,style:{position:"fixed",width:"90%",bottom:"0px",left:"50%",transform:"translateX(-50%)","z-index":"111111"}},{default:B(()=>[rt(" \u4FDD\u5B58 ")]),_:1},8,["loading"]),[[n,r(o)=="sku"&&((a=r(c))==null?void 0:a.checkStatus)]])]}),_:1})),[[F,r(y)]])}}}),[["__scopeId","data-v-0a3a51d4"]])});export{mr as __tla,q as default};