1 |
- import{_ as q,d as na,u as ma,O as da,r,P as pa,o as k,l as h,w as n,C as v,a,g,i as o,y as M,a1 as U,j as B,a2 as C,t as fa,n as ya,aJ as Q,dF as D,dG as F,dH as I,z as va,A as ka,J as ha,H as ga,K as Pa,cu as wa,N as ba,__tla as Ua}from"./index-b2b3c6c4.js";import{_ as Ba,__tla as Ca}from"./ContentWrap-e91b2b5a.js";import{_ as Da,__tla as Fa}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-2554109a.js";import{u as Ia,__tla as Ra}from"./tagsView-6c80c80f.js";import{g as Sa,u as W,d as Va,c as Ea,a as Ta,__tla as xa}from"./spu-ed9fb429.js";import Ha,{__tla as $a}from"./InfoForm-c044b48f.js";import ja,{__tla as za}from"./DescriptionForm-f48102f6.js";import La,{__tla as Aa}from"./OtherForm-d2e91f61.js";import Ga,{__tla as Ja}from"./SkuForm-9b4fd3cb.js";import Xa,{__tla as Ya}from"./DeliveryForm-e695f052.js";import{c as j}from"./constants-a1da293a.js";import{u as Ka,__tla as Na}from"./useMessage-a5edbb0f.js";import{__tla as Oa}from"./el-card-bd6e27c9.js";import{__tla as qa}from"./index-677601df.js";import{__tla as Ma}from"./el-image-viewer-b5664270.js";import{__tla as Qa}from"./UploadImgs-5ed43a7f.js";import{__tla as Wa}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-0ec352e2.js";import"./tree-0af4953a.js";import{__tla as Za}from"./category-39c7fbf6.js";import{__tla as at}from"./brand-1965037f.js";import{__tla as tt}from"./formRules-6084ed5c.js";import{__tla as et}from"./Editor-b514e2f8.js";import{__tla as rt}from"./index-94a35483.js";import{__tla as lt}from"./SkuList-c798f670.js";import{__tla as st}from"./el-image-d434829d.js";import{__tla as it}from"./UploadImg-5f639045.js";import{__tla as ot}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-5cfa6a42.js";import{__tla as ct}from"./ProductAttributes-2f4a78c3.js";import{__tla as _t}from"./el-text-466bfabe.js";import{__tla as ut}from"./property-791930dd.js";import{__tla as nt}from"./ProductPropertyAddForm-13cebfe2.js";import{__tla as mt}from"./Dialog-70b24cbf.js";import{__tla as dt}from"./index-333bd70f.js";import{__tla as pt}from"./dict-7f0cc6d2.js";let Z,ft=Promise.all([(()=>{try{return Ua}catch{}})(),(()=>{try{return Ca}catch{}})(),(()=>{try{return Fa}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return Ya}catch{}})(),(()=>{try{return Na}catch{}})(),(()=>{try{return Oa}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Ma}catch{}})(),(()=>{try{return Qa}catch{}})(),(()=>{try{return Wa}catch{}})(),(()=>{try{return Za}catch{}})(),(()=>{try{return at}catch{}})(),(()=>{try{return tt}catch{}})(),(()=>{try{return et}catch{}})(),(()=>{try{return rt}catch{}})(),(()=>{try{return lt}catch{}})(),(()=>{try{return st}catch{}})(),(()=>{try{return it}catch{}})(),(()=>{try{return ot}catch{}})(),(()=>{try{return ct}catch{}})(),(()=>{try{return _t}catch{}})(),(()=>{try{return ut}catch{}})(),(()=>{try{return nt}catch{}})(),(()=>{try{return mt}catch{}})(),(()=>{try{return dt}catch{}})(),(()=>{try{return pt}catch{}})()]).then(async()=>{let z,L,A;z=q(Da,[["__scopeId","data-v-ba706063"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/components/UploadFile/src/SPuUploadImg.vue"]]),L={class:"left"},A={class:"right"},Z=q(na({name:"ProductSpuForm",__name:"index",emits:["success"],setup(yt,{expose:aa,emit:ta}){const{t:R}=ya(),f=Ka();ma(),da(),Ia();const _=r(!1),m=r("info"),i=r(!1),G=r(),J=r(),X=r(),Y=r(),K=r(),u=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}),ea=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}),P=r(!1),$=r(""),S=r(0),w=r(),ra=r(""),d=r(),V=r(""),la=r(0);aa({open:async(l,e,p,t)=>{S.value=t,d.value=e,la.value=p,P.value=!0,w.value=e.id,ra.value=e.picUrl,await sa(),m.value="info",V.value=l,$.value=R("action."+l),l=="view"?$.value="\u67E5\u770B":l=="create"&&(u.value=Q(ea.value)),V.value=="view"?i.value=!0:i.value=!1}});const sa=async()=>{var e;console.log(w.value);const l=w.value;if(l){_.value=!0;try{const p=await Sa(l);(e=p.skus)==null||e.forEach(t=>{i.value?(t.price=D(t.price),t.marketPrice=D(t.marketPrice),t.costPrice=D(t.costPrice),t.firstBrokeragePrice=D(t.firstBrokeragePrice),t.secondBrokeragePrice=D(t.secondBrokeragePrice)):(t.price=F(t.price),t.marketPrice=F(t.marketPrice),t.costPrice=F(t.costPrice),t.firstBrokeragePrice=F(t.firstBrokeragePrice),t.secondBrokeragePrice=F(t.secondBrokeragePrice))}),u.value=p}finally{_.value=!1}}},E=ta,N=async l=>{try{const e=l===j.RECYCLE.status?"\u52A0\u5165\u5230\u56DE\u6536\u7AD9":"\u6062\u590D\u5230\u4ED3\u5E93";await f.confirm(`\u786E\u8BA4\u8981"${d.value.name}"${e}\u5417\uFF1F`),await W({id:d.value.id,status:l}),f.success(e+"\u6210\u529F"),T(),E("success")}catch{}},ia=async()=>{console.log(d.value.status);try{const l=d.value.status?"\u4E0B\u67B6":"\u4E0A\u67B6",e=d.value.status?0:1;await f.confirm(`\u786E\u8BA4\u8981${l}"${d.value.name}"\u5417\uFF1F`),await W({id:d.value.id,status:e}),f.success(l+"\u6210\u529F"),T(),E("success")}catch{}},oa=async()=>{var l,e,p,t,x;_.value=!0;try{await((l=a(G))==null?void 0:l.validate()),await((e=a(J))==null?void 0:e.validate()),await((p=a(X))==null?void 0:p.validate()),await((t=a(Y))==null?void 0:t.validate()),await((x=a(K))==null?void 0:x.validate());const c=Q(a(u.value));c.skus.forEach(s=>{s.name=c.name,s.price=I(s.price),s.marketPrice=I(s.marketPrice),s.costPrice=I(s.costPrice),s.firstBrokeragePrice=I(s.firstBrokeragePrice),s.secondBrokeragePrice=I(s.secondBrokeragePrice)});const b=[];c.sliderPicUrls.forEach(s=>{typeof s=="object"?b.push(s.url):b.push(s)}),c.sliderPicUrls=b;const H=c;w.value?(await Ta(H),f.success(R("common.updateSuccess"))):(await Ea(H),f.success(R("common.createSuccess"))),T(),E("success")}finally{_.value=!1}},T=()=>{P.value=!1};return(l,e)=>{const p=z,t=va,x=ka,c=ha,b=ga,H=Pa,s=Ba,ca=wa,O=pa("hasPermi"),_a=ba;return k(),h(ca,{modelValue:a(P),"onUpdate:modelValue":e[5]||(e[5]=y=>M(P)?P.value=y:null),title:a($),width:"70%",class:"dialog"},{default:n(()=>[v((k(),h(s,null,{default:n(()=>[g("div",L,[o(p,{modelValue:a(u).picUrl,"onUpdate:modelValue":e[0]||(e[0]=y=>a(u).picUrl=y),disabled:a(i)},null,8,["modelValue","disabled"]),o(x,{modelValue:a(m),"onUpdate:modelValue":e[1]||(e[1]=y=>M(m)?m.value=y:null),"tab-position":"left",class:"child-tabs"},{default:n(()=>[o(t,{label:"\u57FA\u7840\u8BBE\u7F6E",name:"info"}),o(t,{label:"\u4EF7\u683C\u5E93\u5B58",name:"sku"}),o(t,{label:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"}),o(t,{label:"\u5546\u54C1\u8BE6\u60C5",name:"description"}),o(t,{label:"\u5176\u5B83\u8BBE\u7F6E",name:"other"})]),_:1},8,["modelValue"])]),g("div",A,[v(g("div",null,[o(Ha,{ref_key:"infoRef",ref:G,"is-detail":a(i),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[U,a(m)=="info"]]),v(g("div",null,[o(Ga,{ref_key:"skuRef",ref:J,"is-detail":a(i),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[U,a(m)=="sku"]]),v(g("div",null,[o(Xa,{ref_key:"deliveryRef",ref:X,"is-detail":a(i),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[U,a(m)=="delivery"]]),v(g("div",null,[o(ja,{ref_key:"descriptionRef",ref:Y,"is-detail":a(i),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[U,a(m)=="description"]]),v(g("div",null,[o(La,{ref_key:"otherRef",ref:K,"is-detail":a(i),propFormData:a(u)},null,8,["is-detail","propFormData"])],512),[[U,a(m)=="other"]])]),o(H,{style:{clear:"both"}},{default:n(()=>[o(b,{style:{float:"right"}},{default:n(()=>[a(i)||a(S)==4||a(V)=="create"?C("",!0):(k(),h(c,{key:0,loading:a(_),type:"danger",plain:"",onClick:e[2]||(e[2]=y=>N(a(j).RECYCLE.status))},{default:n(()=>[B(" \u505C\u7528 ")]),_:1},8,["loading"])),a(i)||a(S)!=4?C("",!0):v((k(),h(c,{key:1,loading:a(_),type:"danger",plain:"",onClick:e[3]||(e[3]=y=>(async ua=>{try{await f.delConfirm(),await Va(ua),f.success(R("common.delSuccess")),T(),E("success")}catch{}})(a(w)))},{default:n(()=>[B(" \u5220\u9664 ")]),_:1},8,["loading"])),[[O,["product:spu:delete"]]]),a(i)||a(S)!=4?C("",!0):v((k(),h(c,{key:2,loading:a(_),type:"primary",onClick:e[4]||(e[4]=y=>N(a(j).DISABLE.status))},{default:n(()=>[B(" \u6062\u590D ")]),_:1},8,["loading"])),[[O,["product:spu:update"]]]),a(i)||a(V)=="create"?C("",!0):(k(),h(c,{key:3,loading:a(_),type:"primary",onClick:ia},{default:n(()=>[B(fa(a(d).status==0?"\u4E0A\u67B6":"\u4E0B\u67B6"),1)]),_:1},8,["loading"])),a(i)?C("",!0):(k(),h(c,{key:4,loading:a(_),type:"primary",onClick:oa},{default:n(()=>[B(" \u4FDD\u5B58 ")]),_:1},8,["loading"]))]),_:1})]),_:1})]),_:1})),[[_a,a(_)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-473675a6"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/product/spu/form/index.vue"]])});export{ft as __tla,Z as default};
|