index-30678b3a.js 6.7 KB

1
  1. import{d as q,u as A,O as J,r as s,B as K,C as O,a,o as S,l as x,w as c,i as _,y as d,j as E,a2 as X,n as G,aq as h,ar as k,as as L,at as P,z as M,A as Q,J as W,H as Y,K as Z,N as $,_ as aa,__tla as ta}from"./index-af173888.js";import{_ as ra,__tla as ea}from"./ContentWrap-b959c1be.js";import{u as la,__tla as _a}from"./tagsView-cc773b9b.js";import{g as ia,c as oa,u as ca,__tla as sa}from"./spu-41f2bf16.js";import ma,{__tla as ua}from"./InfoForm-5466244e.js";import na,{__tla as pa}from"./DescriptionForm-a750c92e.js";import fa,{__tla as da}from"./OtherForm-edc6fcda.js";import ya,{__tla as va}from"./SkuForm-325f51c2.js";import ha,{__tla as ka}from"./DeliveryForm-8736af1a.js";import{u as Pa,__tla as ga}from"./useMessage-170c1b43.js";import{__tla as Na}from"./el-card-178b9654.js";import{__tla as wa}from"./UploadImgs-8cdc0566.js";import{__tla as Ba}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-9154d28f.js";import{__tla as Da}from"./el-image-viewer-0d82b94c.js";import{__tla as Ua}from"./UploadImg-adf73e38.js";import{__tla as Fa}from"./index-4db4ba8b.js";import"./tree-02f455f9.js";import{__tla as ba}from"./category-8ca28490.js";import{__tla as Ra}from"./brand-121a30c3.js";import{__tla as Ca}from"./formRules-515a78c5.js";import{__tla as Sa}from"./Editor-c9f3a63b.js";import{__tla as xa}from"./index-0994e210.js";import{__tla as Ea}from"./SkuList-d8139bf9.js";import{__tla as Ia}from"./el-image-fdde0035.js";import{__tla as Ta}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-d9f75960.js";import{__tla as Va}from"./ProductAttributes-adc6133a.js";import{__tla as ja}from"./el-text-0fe23cf3.js";import{__tla as za}from"./property-306cc22d.js";import{__tla as Ha}from"./ProductPropertyAddForm-6452b25c.js";import{__tla as qa}from"./Dialog-987c90a1.js";import{__tla as Aa}from"./index-c06100e3.js";import{__tla as Ja}from"./dict-093d1dfa.js";import"./constants-a3c69b57.js";let I,Ka=Promise.all([(()=>{try{return ta}catch{}})(),(()=>{try{return ea}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return va}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return ga}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return wa}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return Fa}catch{}})(),(()=>{try{return ba}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return Ca}catch{}})(),(()=>{try{return Sa}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return Ta}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Ja}catch{}})()]).then(async()=>{I=aa(q({name:"ProductSpuForm",__name:"index",setup(Oa){const{t:N}=G(),w=Pa(),{push:T,currentRoute:V}=A(),{params:B,name:j}=J(),{delView:z}=la(),p=s(!1),r=s("info"),m=s(!1),D=s(),U=s(),F=s(),b=s(),R=s(),u=s({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}),H=async()=>{var f,e,i,t,y;p.value=!0;try{await((f=a(D))==null?void 0:f.validate()),await((e=a(U))==null?void 0:e.validate()),await((i=a(F))==null?void 0:i.validate()),await((t=a(b))==null?void 0:t.validate()),await((y=a(R))==null?void 0:y.validate());const n=L(a(u.value));n.skus.forEach(l=>{l.name=n.name,l.price=P(l.price),l.marketPrice=P(l.marketPrice),l.costPrice=P(l.costPrice),l.firstBrokeragePrice=P(l.firstBrokeragePrice),l.secondBrokeragePrice=P(l.secondBrokeragePrice)});const v=[];n.sliderPicUrls.forEach(l=>{typeof l=="object"?v.push(l.url):v.push(l)}),n.sliderPicUrls=v;const g=n;B.id?(await ca(g),w.success(N("common.updateSuccess"))):(await oa(g),w.success(N("common.createSuccess"))),C()}finally{p.value=!1}},C=()=>{z(a(V)),T({name:"ProductSpu"})};return K(async()=>{await(async()=>{var e;j==="ProductSpuDetail"&&(m.value=!0);const f=B.id;if(f){p.value=!0;try{const i=await ia(f);(e=i.skus)==null||e.forEach(t=>{m.value?(t.price=h(t.price),t.marketPrice=h(t.marketPrice),t.costPrice=h(t.costPrice),t.firstBrokeragePrice=h(t.firstBrokeragePrice),t.secondBrokeragePrice=h(t.secondBrokeragePrice)):(t.price=k(t.price),t.marketPrice=k(t.marketPrice),t.costPrice=k(t.costPrice),t.firstBrokeragePrice=k(t.firstBrokeragePrice),t.secondBrokeragePrice=k(t.secondBrokeragePrice))}),u.value=i}finally{p.value=!1}}})()}),(f,e)=>{const i=M,t=Q,y=W,n=Y,v=Z,g=ra,l=$;return O((S(),x(g,null,{default:c(()=>[_(t,{modelValue:a(r),"onUpdate:modelValue":e[5]||(e[5]=o=>d(r)?r.value=o:null)},{default:c(()=>[_(i,{label:"\u57FA\u7840\u8BBE\u7F6E",name:"info"},{default:c(()=>[_(ma,{ref_key:"infoRef",ref:D,activeName:a(r),"onUpdate:activeName":e[0]||(e[0]=o=>d(r)?r.value=o:null),"is-detail":a(m),propFormData:a(u)},null,8,["activeName","is-detail","propFormData"])]),_:1}),_(i,{label:"\u4EF7\u683C\u5E93\u5B58",name:"sku"},{default:c(()=>[_(ya,{ref_key:"skuRef",ref:U,activeName:a(r),"onUpdate:activeName":e[1]||(e[1]=o=>d(r)?r.value=o:null),"is-detail":a(m),propFormData:a(u)},null,8,["activeName","is-detail","propFormData"])]),_:1}),_(i,{label:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"},{default:c(()=>[_(ha,{ref_key:"deliveryRef",ref:F,activeName:a(r),"onUpdate:activeName":e[2]||(e[2]=o=>d(r)?r.value=o:null),"is-detail":a(m),propFormData:a(u)},null,8,["activeName","is-detail","propFormData"])]),_:1}),_(i,{label:"\u5546\u54C1\u8BE6\u60C5",name:"description"},{default:c(()=>[_(na,{ref_key:"descriptionRef",ref:b,activeName:a(r),"onUpdate:activeName":e[3]||(e[3]=o=>d(r)?r.value=o:null),"is-detail":a(m),propFormData:a(u)},null,8,["activeName","is-detail","propFormData"])]),_:1}),_(i,{label:"\u5176\u5B83\u8BBE\u7F6E",name:"other"},{default:c(()=>[_(fa,{ref_key:"otherRef",ref:R,activeName:a(r),"onUpdate:activeName":e[4]||(e[4]=o=>d(r)?r.value=o:null),"is-detail":a(m),propFormData:a(u)},null,8,["activeName","is-detail","propFormData"])]),_:1})]),_:1},8,["modelValue"]),_(v,null,{default:c(()=>[_(n,{style:{float:"right"}},{default:c(()=>[a(m)?X("",!0):(S(),x(y,{key:0,loading:a(p),type:"primary",onClick:H},{default:c(()=>[E(" \u4FDD\u5B58 ")]),_:1},8,["loading"])),_(y,{onClick:C},{default:c(()=>[E("\u8FD4\u56DE")]),_:1})]),_:1})]),_:1})]),_:1})),[[l,a(p)]])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/product/spu/form/index.vue"]])});export{Ka as __tla,I as default};