1 |
- import{d as L,f as x,aq as E,r as m,L as M,x as O,y as W,h as I,B as n,a as r,o as N,j as X,w as F,k as l,i as t,P as G,a4 as p,c as H,l as J,m as Q,z as V,ar as v,as as y,at as Y,au as P,q as Z,K as $}from"./index-92f7a16c.js";import{_ as ee}from"./ContentWrap.vue_vue_type_script_setup_true_lang-93cdc892.js";import{g as re,c as ie,u as te}from"./spu-7bbcf2cd.js";import oe from"./InfoForm-fff40575.js";import ae from"./DescriptionForm-5ea82a80.js";import se from"./OtherForm-8ce33f73.js";import ce from"./SkuForm-b8b5bf3c.js";import le from"./DeliveryForm-e85af03a.js";import me from"./Service-abb87787.js";import{A as ne}from"./AfterSale-d83f2ca1.js";import pe from"./Apply-eea07826.js";import de from"./Comment-fcdb87f9.js";import{u as ue}from"./useMessage-f6048a9f.js";import{_ as Pe}from"./_plugin-vue_export-helper-1b428a4d.js";import"./el-card-e60c275e.js";import"./UploadImgs-905a3324.js";import"./UploadImgs.vue_vue_type_style_index_0_scoped_bad238b9_lang-c7fc1fae.js";import"./el-image-viewer-668f12f8.js";import"./tree-0af4953a.js";import"./category-8e584cf1.js";import"./brand-412278ee.js";import"./formRules-ffb17ad4.js";import"./style.css_vue_type_style_index_0_src_true_lang-d17c7064.js";import"./index-2e6bfa2a.js";import"./SkuList.vue_vue_type_script_setup_true_lang-b6defbcf.js";import"./el-image-b5c91f66.js";import"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-9ca6f58d.js";import"./index-53ab5084.js";import"./UploadImg-7f651e4b.js";import"./UploadFile.vue_vue_type_style_index_0_scoped_a9e67aa2_lang-10e7d64a.js";import"./PcComponents.css_vue_type_style_index_0_src_5455114c_scoped_5455114c_lang-b0291120.js";import"./ProductAttributes.vue_vue_type_script_setup_true_lang-df1f238e.js";import"./el-text-79d6dacd.js";import"./property-0d16eb70.js";import"./ProductPropertyAddForm.vue_vue_type_script_setup_true_lang-360676a1.js";import"./Dialog-524c7d28.js";import"./MobileSkuList-595645c2.js";import"./index-6d030a99.js";import"./dict-b31d62c6.js";import"./constants-e43f22dd.js";import"./index-672652a7.js";import"./index.vue_vue_type_script_setup_true_lang-059ec67a.js";import"./index-579dde8f.js";import"./index-7812e0eb.js";import"./formatTime-71947df8.js";const fe={class:"top",style:{position:"relative",overflow:"hidden"}},ge={class:"bottom"},ve={key:0},ye=Pe(L({name:"ProductSpuForm",__name:"MobileIndex",emits:["success"],setup(he,{emit:C}){const D=ue(),U=x({value:0}),R=x({value:!1});E("highPrecisionChange",R);const q=C;E("spuTypeChange",U);const{t:w}=V(),f=m(!1),a=m("info"),d=m(!0),b=m(),S=m(),_=m(),T=m(),j=m(),c=m({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}),z=M(),k=m(Number(z.params.id)),A=async()=>{var g,s,o,e;f.value=!0;try{await((g=r(b))==null?void 0:g.validate()),await((s=r(S))==null?void 0:s.validate()),await((o=r(_))==null?void 0:o.validate()),await((e=r(T))==null?void 0:e.validate());const u=Y(r(c.value));u.skus.forEach(i=>{i.name=u.name,i.price=P(i.price),i.highPrecisionPrice=(100*i.highPrecisionPrice).toFixed(6),i.marketPrice=P(i.marketPrice),i.promotionFee=P(i.promotionFee),i.costPrice=P(i.costPrice),i.settlementPrice=P(i.settlementPrice),i.highPrecisionSettlementPrice=(100*i.highPrecisionSettlementPrice).toFixed(6),i.firstBrokeragePrice=P(i.firstBrokeragePrice),i.secondBrokeragePrice=P(i.secondBrokeragePrice)});const h=[];u.sliderPicUrls.forEach(i=>{typeof i=="object"?h.push(i.url):h.push(i)}),u.sliderPicUrls=h;const B=u;k.value?(await te(B),D.success(w("common.updateSuccess"))):(await ie(B),D.success(w("common.createSuccess"))),close(),q("success")}finally{f.value=!1}};return O(()=>{(async()=>{var s;const g=k.value;if(g){f.value=!0;try{const o=await re(g);(s=o.skus)==null||s.forEach(e=>{d.value?(e.price=v(e.price),e.marketPrice=v(e.marketPrice),e.highPrecisionPrice=e.highPrecisionPrice/100,e.settlementPrice=v(e.settlementPrice),e.highPrecisionSettlementPrice=e.highPrecisionSettlementPrice/100,e.costPrice=v(e.costPrice),e.firstBrokeragePrice=v(e.firstBrokeragePrice),e.secondBrokeragePrice=v(e.secondBrokeragePrice)):(e.price=y(e.price),e.marketPrice=y(e.marketPrice),e.settlementPrice=y(e.settlementPrice),e.highPrecisionSettlementPrice=e.highPrecisionSettlementPrice/100,e.highPrecisionPrice=e.highPrecisionPrice/100,e.costPrice=y(e.costPrice),e.firstBrokeragePrice=y(e.firstBrokeragePrice),e.secondBrokeragePrice=y(e.secondBrokeragePrice))}),c.value=o}finally{f.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"}),W(()=>{document.getElementsByTagName("section")[1].style.width="auto",document.getElementsByTagName("section")[1].style.padding="20px",document.getElementsByTagName("section")[1].style.background="var(--el-color-white)"}),(g,s)=>{const o=I("van-tab"),e=I("van-tabs"),u=Z,h=ee,B=$;return n((N(),X(h,{style:{"overflow-y":"auto"},class:"ContentWrap"},{default:F(()=>{var i;return[l("div",fe,[t(e,{active:r(a),"onUpdate:active":s[0]||(s[0]=K=>G(a)?a.value=K:null)},{default:F(()=>[t(o,{title:"\u57FA\u672C\u4FE1\u606F",name:"info"}),t(o,{title:"\u4EF7\u683C/\u89C4\u683C/\u578B\u53F7",name:"sku"}),t(o,{title:"\u8BE6\u60C5",name:"description"}),t(o,{title:"\u8BC4\u4EF7",name:"comment"}),t(o,{title:"\u5BA2\u670D",name:"service"}),t(o,{title:"\u552E\u540E",name:"aftersale"}),t(o,{title:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"}),t(o,{title:"\u7533\u8BF7\u8BB0\u5F55",name:"apply"})]),_:1},8,["active"])]),l("div",ge,[n(l("div",null,[t(oe,{ref_key:"infoRef",ref:b,"is-detail":r(d),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[p,r(a)=="info"]]),n(l("div",null,[t(ce,{ref_key:"skuRef",ref:S,isDetail:!1,propFormData:r(c)},null,8,["propFormData"])],512),[[p,r(a)=="sku"]]),n(l("div",null,[t(le,{ref_key:"deliveryRef",ref:_,"is-detail":r(d),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[p,r(a)=="delivery"]]),n(l("div",null,[t(ae,{ref_key:"descriptionRef",ref:T,"is-detail":r(d),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[p,r(a)=="description"]]),n(l("div",null,[t(se,{ref_key:"otherRef",ref:j,"is-detail":r(d),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[p,r(a)=="other"]]),n(l("div",null,[t(de,{"is-detail":r(d),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[p,r(a)=="comment"]]),n(l("div",null,[t(me,{"is-detail":r(d),propFormData:r(c)},null,8,["is-detail","propFormData"])],512),[[p,r(a)=="service"]]),n(l("div",null,[t(ne,{productId:r(k),openSource:"Spu"},null,8,["productId"])],512),[[p,r(a)=="aftersale"]]),r(a)=="apply"?(N(),H("div",ve,[t(pe,{productId:r(k),propFormData:r(c)},null,8,["productId","propFormData"])])):J("",!0)]),s[2]||(s[2]=l("div",{style:{clear:"both"}},null,-1)),n(t(u,{loading:r(f),type:"primary",onClick:A,style:{position:"fixed",width:"90%",bottom:"0px",left:"50%",transform:"translateX(-50%)","z-index":"111111"}},{default:F(()=>s[1]||(s[1]=[Q(" \u4FDD\u5B58 ")])),_:1},8,["loading"]),[[p,r(a)=="sku"&&((i=r(c))==null?void 0:i.checkStatus)]])]}),_:1})),[[B,r(f)]])}}}),[["__scopeId","data-v-ad31d55c"]]);export{ye as default};
|