1 |
- import{d as Be,g as le,at as ie,r as i,T as De,o as n,k as y,aO as Se,a as e,w as f,j as c,l as I,S as d,D as g,t as oe,i as o,n as Te,aP as xe,R as se,a7 as B,c as j,B as Ie,aw as ce,au as w,av as F,ax as b,aQ as Ue,Z as Ve,$ as Ee,s as Re,aA as Ae,M as $e,v as ze,x as je,_ as Le,__tla as Ye}from"./index-2f799233.js";import{_ as Me,__tla as Oe}from"./ContentWrap-9da801df.js";import{_ as Qe,__tla as Ze}from"./SPuUploadImg-121cd89e.js";import{g as qe,a as _e,d as Ge,c as He,u as Je,__tla as Ke}from"./spu-980b34a1.js";import Ne,{__tla as We}from"./InfoForm-2a08666c.js";import Xe,{__tla as et}from"./DescriptionForm-aa3c5dea.js";import tt,{__tla as at}from"./OtherForm-7be1840a.js";import rt,{__tla as lt}from"./SkuForm-5e8f39e5.js";import it,{__tla as ot}from"./DeliveryForm-068fb530.js";import st,{__tla as ct}from"./Service-c0bda3f4.js";import{A as _t,__tla as nt}from"./AfterSale-babc95d3.js";import mt,{__tla as ut}from"./Comment-dabeb569.js";import pt,{__tla as dt}from"./Apply-0bed427f.js";import{P as L}from"./constants-d55a3460.js";import{u as yt,__tla as ft}from"./useMessage-e567ad40.js";import{__tla as ht}from"./el-card-c64c83d1.js";import{__tla as vt}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-ac19fa49.js";import{__tla as Pt}from"./index-5f6db4a5.js";import{__tla as gt}from"./el-image-viewer-8e9e3571.js";import{__tla as kt}from"./UploadImgs-0a2b8085.js";import{__tla as wt}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-872107b3.js";import"./tree-0af4953a.js";import{__tla as Ft}from"./category-6df467a3.js";import{__tla as bt}from"./brand-51caed7c.js";import{__tla as Ct}from"./formRules-8aa12f76.js";import{__tla as Bt}from"./Editor-3a97a075.js";import{__tla as Dt}from"./index-7549c07e.js";import{__tla as St}from"./SkuList-c1eb35ef.js";import{__tla as Tt}from"./el-image-4d26fa76.js";import{__tla as xt}from"./UploadImg-d46c0539.js";import{__tla as It}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-bc6f7cfd.js";import{__tla as Ut}from"./PcComponents.css_vue_type_style_index_0_src_00d8480b_scoped_00d8480b_lang-80062d91.js";import{__tla as Vt}from"./ProductAttributes-a03a7812.js";import{__tla as Et}from"./el-text-58158748.js";import{__tla as Rt}from"./property-9f44e48e.js";import{__tla as At}from"./ProductPropertyAddForm-ac5c62a7.js";import{__tla as $t}from"./Dialog-6fd39e06.js";import{__tla as zt}from"./MobileSkuList-c5d6aa78.js";import{__tla as jt}from"./index-6810ba49.js";import{__tla as Lt}from"./dict-20c916e2.js";import{__tla as Yt}from"./index-36dfbc52.js";import{__tla as Mt}from"./index-e6cd813f.js";import{__tla as Ot}from"./index-1c180a16.js";import{__tla as Qt}from"./index-8cb2149a.js";import{__tla as Zt}from"./formatTime-2157894c.js";let ne,qt=Promise.all([(()=>{try{return Ye}catch{}})(),(()=>{try{return Oe}catch{}})(),(()=>{try{return Ze}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return et}catch{}})(),(()=>{try{return at}catch{}})(),(()=>{try{return lt}catch{}})(),(()=>{try{return ot}catch{}})(),(()=>{try{return ct}catch{}})(),(()=>{try{return nt}catch{}})(),(()=>{try{return ut}catch{}})(),(()=>{try{return dt}catch{}})(),(()=>{try{return ft}catch{}})(),(()=>{try{return ht}catch{}})(),(()=>{try{return vt}catch{}})(),(()=>{try{return Pt}catch{}})(),(()=>{try{return gt}catch{}})(),(()=>{try{return kt}catch{}})(),(()=>{try{return wt}catch{}})(),(()=>{try{return Ft}catch{}})(),(()=>{try{return bt}catch{}})(),(()=>{try{return Ct}catch{}})(),(()=>{try{return Bt}catch{}})(),(()=>{try{return Dt}catch{}})(),(()=>{try{return St}catch{}})(),(()=>{try{return Tt}catch{}})(),(()=>{try{return xt}catch{}})(),(()=>{try{return It}catch{}})(),(()=>{try{return Ut}catch{}})(),(()=>{try{return Vt}catch{}})(),(()=>{try{return Et}catch{}})(),(()=>{try{return Rt}catch{}})(),(()=>{try{return At}catch{}})(),(()=>{try{return $t}catch{}})(),(()=>{try{return zt}catch{}})(),(()=>{try{return jt}catch{}})(),(()=>{try{return Lt}catch{}})(),(()=>{try{return Yt}catch{}})(),(()=>{try{return Mt}catch{}})(),(()=>{try{return Ot}catch{}})(),(()=>{try{return Qt}catch{}})(),(()=>{try{return Zt}catch{}})()]).then(async()=>{let Y,M,O,Q,Z,q,G,H,J,K,N;Y={class:"my-header"},M={class:"my-header-left"},O={class:"my-header-right"},Q=["onClick"],Z={class:"left"},q={class:"right"},G={key:0},H={key:1},J={key:2},K=(U=>(ze("data-v-473675a6"),U=U(),je(),U))(()=>c("div",{style:{clear:"both"}},null,-1)),N={class:"dialog-footer"},ne=Le(Be({name:"ProductSpuForm",__name:"index",emits:["success"],setup(U,{expose:me,emit:ue}){const pe=le({value:0});ie("spuTypeChange",pe);const de=le({value:!1});ie("highPrecisionChange",de);const{t:V}=Ie(),k=yt(),h=i(!1),m=i("info"),l=i(!1),W=i(),X=i(),ee=i(),te=i(),ye=i(),u=i({name:"",categoryId:void 0,keyword:"",picUrl:"",producerArea:"",spuType:void 0,spuPayType:void 0,sliderPicUrls:[],introduction:"",deliveryTypes:[],deliveryTemplateId:void 0,brandId:void 0,specType:!1,subCommissionType:!1,highPrecision:!1,skus:[{price:0,marketPrice:0,costPrice:0,settlementPrice:0,barCode:"",picUrl:"",stock:0,weight:0,volume:0,promotionFee:0,mark:"",highPrecisionPrice:0,highPrecisionSettlementPrice:0,firstBrokeragePrice:0,secondBrokeragePrice:0}],description:"",sort:0,giveIntegral:0,virtualSalesCount:0}),fe=i({name:"",categoryId:void 0,keyword:"",picUrl:"",producerArea:"",spuType:void 0,spuPayType:void 0,sliderPicUrls:[],introduction:"",deliveryTypes:[],deliveryTemplateId:void 0,brandId:void 0,specType:!1,subCommissionType:!1,skus:[{price:0,marketPrice:0,costPrice:0,settlementPrice:0,barCode:"",picUrl:"",stock:0,weight:0,volume:0,promotionFee:0,mark:"",highPrecisionPrice:0,highPrecisionSettlementPrice:0,firstBrokeragePrice:0,secondBrokeragePrice:0}],description:"",sort:0,giveIntegral:0,virtualSalesCount:0}),D=i(!1),E=i(""),S=i(0),C=i(),he=i(""),p=i(),R=i(""),ve=i(0),T=i(!1);me({open:async(s,r,P,t)=>{S.value=t,p.value=r,ve.value=P,D.value=!0,C.value=r.id,he.value=r.picUrl,T.value=!1,await ge(),m.value="info",R.value=s,E.value=V("action."+s),s=="view"?E.value="\u67E5\u770B":s=="create"&&(u.value=ce(fe.value)),R.value=="view"?l.value=!0:l.value=!1}});const Pe=()=>{T.value=!T.value},ge=async()=>{var r;const s=C.value;if(s){h.value=!0;try{const P=await qe(s);(r=P.skus)==null||r.forEach(t=>{l.value?(t.price=w(t.price),t.settlementPrice=w(t.settlementPrice),t.highPrecisionPrice=t.highPrecisionPrice/100,t.highPrecisionSettlementPrice=t.highPrecisionSettlementPrice/100,t.marketPrice=w(t.marketPrice),t.costPrice=w(t.costPrice),t.promotionFee=w(t.promotionFee),t.firstBrokeragePrice=w(t.firstBrokeragePrice),t.secondBrokeragePrice=w(t.secondBrokeragePrice)):(t.highPrecisionPrice=t.highPrecisionPrice/100,t.price=F(t.price),t.settlementPrice=F(t.settlementPrice),t.highPrecisionSettlementPrice=t.highPrecisionSettlementPrice/100,t.marketPrice=F(t.marketPrice),t.costPrice=F(t.costPrice),t.promotionFee=F(t.promotionFee),t.firstBrokeragePrice=F(t.firstBrokeragePrice),t.secondBrokeragePrice=F(t.secondBrokeragePrice))}),u.value=P}finally{h.value=!1}}},A=ue,ae=async s=>{try{const r=s===L.RECYCLE.status?"\u52A0\u5165\u5230\u56DE\u6536\u7AD9":"\u6062\u590D\u5230\u4ED3\u5E93";await k.confirm(`\u786E\u8BA4\u8981"${p.value.name}"${r}\u5417\uFF1F`),await _e({id:p.value.id,status:s}),k.success(r+"\u6210\u529F"),$(),A("success")}catch{}},ke=async()=>{try{const s=p.value.status?"\u4E0B\u67B6":"\u4E0A\u67B6",r=p.value.status?0:1;await k.confirm(`\u786E\u8BA4\u8981${s}"${p.value.name}"\u5417\uFF1F`),await _e({id:p.value.id,status:r}),k.success(s+"\u6210\u529F"),$(),A("success")}catch{}},we=async()=>{var s,r,P,t;h.value=!0;try{await((s=e(W))==null?void 0:s.validate()),await((r=e(X))==null?void 0:r.validate()),await((P=e(ee))==null?void 0:P.validate()),await((t=e(te))==null?void 0:t.validate());const _=ce(e(u.value));_.skus.forEach(a=>{a.name=_.name,a.price=b(a.price),a.highPrecisionPrice=(100*a.highPrecisionPrice).toFixed(6),a.marketPrice=b(a.marketPrice),a.promotionFee=b(a.promotionFee),a.costPrice=b(a.costPrice),a.settlementPrice=b(a.settlementPrice),a.highPrecisionSettlementPrice=(100*a.highPrecisionSettlementPrice).toFixed(6),a.firstBrokeragePrice=b(a.firstBrokeragePrice),a.secondBrokeragePrice=b(a.secondBrokeragePrice)});const x=[];_.sliderPicUrls.forEach(a=>{typeof a=="object"?x.push(a.url):x.push(a)}),_.sliderPicUrls=x;const z=_;C.value?(await Je(z),k.success(V("common.updateSuccess"))):(await He(z),k.success(V("common.createSuccess"))),$(),A("success")}finally{h.value=!1}},$=()=>{D.value=!1};return(s,r)=>{const P=Ue,t=Qe,_=Ve,x=Ee,z=Me,a=Re,Fe=Ae,be=$e,re=De("hasPermi");return n(),y(Fe,{modelValue:e(D),"onUpdate:modelValue":r[5]||(r[5]=v=>se(D)?D.value=v:null),title:e(E),"close-on-click-modal":!1,fullscreen:e(T),"show-close":!1,width:"70%",draggable:"",class:"dialog"},Se({header:f(({close:v})=>[c("div",Y,[c("div",M,oe(e(E)),1),c("div",O,[c("span",{onClick:Pe},[o(e(Te),{icon:e(T)?"zmdi:fullscreen-exit":"zmdi:fullscreen"},null,8,["icon"])]),c("span",{onClick:v},[o(P,null,{default:f(()=>[o(e(xe))]),_:1})],8,Q)])])]),default:f(()=>[g((n(),y(z,{style:{"max-height":"560px","min-height":"560px","overflow-y":"auto","border-bottom":"none"}},{default:f(()=>[c("div",Z,[o(t,{modelValue:e(u).picUrl,"onUpdate:modelValue":r[0]||(r[0]=v=>e(u).picUrl=v),disabled:e(l),fileSize:.3},null,8,["modelValue","disabled"]),o(x,{modelValue:e(m),"onUpdate:modelValue":r[1]||(r[1]=v=>se(m)?m.value=v:null),"tab-position":"left",class:"child-tabs"},{default:f(()=>[o(_,{label:"\u57FA\u672C\u4FE1\u606F",name:"info"}),o(_,{label:"\u4EF7\u683C/\u89C4\u683C/\u578B\u53F7",name:"sku"}),o(_,{label:"\u8BE6\u60C5",name:"description"}),e(l)?(n(),y(_,{key:0,label:"\u8BC4\u4EF7",name:"comment"})):d("",!0),e(l)?(n(),y(_,{key:1,label:"\u5BA2\u670D",name:"service"})):d("",!0),e(l)?(n(),y(_,{key:2,label:"\u552E\u540E",name:"aftersale"})):d("",!0),o(_,{label:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"}),e(l)?(n(),y(_,{key:3,label:"\u7533\u8BF7\u8BB0\u5F55",name:"apply"})):d("",!0)]),_:1},8,["modelValue"])]),c("div",q,[g(c("div",null,[o(Ne,{ref_key:"infoRef",ref:W,"is-detail":e(l),propFormData:e(u)},null,8,["is-detail","propFormData"])],512),[[B,e(m)=="info"]]),g(c("div",null,[o(rt,{ref_key:"skuRef",ref:X,"is-detail":e(l),propFormData:e(u)},null,8,["is-detail","propFormData"])],512),[[B,e(m)=="sku"]]),g(c("div",null,[o(it,{ref_key:"deliveryRef",ref:ee,"is-detail":e(l),propFormData:e(u)},null,8,["is-detail","propFormData"])],512),[[B,e(m)=="delivery"]]),g(c("div",null,[o(Xe,{ref_key:"descriptionRef",ref:te,"is-detail":e(l),propFormData:e(u)},null,8,["is-detail","propFormData"])],512),[[B,e(m)=="description"]]),g(c("div",null,[o(tt,{ref_key:"otherRef",ref:ye,"is-detail":e(l),propFormData:e(u)},null,8,["is-detail","propFormData"])],512),[[B,e(m)=="other"]]),e(m)=="comment"?(n(),j("div",G,[o(mt,{"is-detail":e(l),propFormData:e(u)},null,8,["is-detail","propFormData"])])):d("",!0),g(c("div",null,[o(st,{"is-detail":e(l),propFormData:e(u)},null,8,["is-detail","propFormData"])],512),[[B,e(m)=="service"]]),e(m)=="aftersale"?(n(),j("div",H,[o(_t,{productId:e(C),openSource:"Spu"},null,8,["productId"])])):d("",!0),e(m)=="apply"?(n(),j("div",J,[o(pt,{productId:e(C),propFormData:e(u)},null,8,["productId","propFormData"])])):d("",!0)]),K]),_:1})),[[be,e(h)]])]),_:2},[e(l)?void 0:{name:"footer",fn:f(()=>[c("div",N,[e(l)||e(S)==4||e(R)=="create"||e(p).status==-1?d("",!0):(n(),y(a,{key:0,loading:e(h),type:"danger",plain:"",onClick:r[2]||(r[2]=v=>ae(e(L).RECYCLE.status))},{default:f(()=>[I(" \u505C\u7528 ")]),_:1},8,["loading"])),!e(l)&&e(S)==4||e(p).status==-1?g((n(),y(a,{key:1,loading:e(h),type:"danger",plain:"",onClick:r[3]||(r[3]=v=>(async Ce=>{try{await k.delConfirm(),await Ge(Ce),k.success(V("common.delSuccess")),$(),A("success")}catch{}})(e(C)))},{default:f(()=>[I(" \u5220\u9664 ")]),_:1},8,["loading"])),[[re,["product:spu:delete"]]]):d("",!0),!e(l)&&e(S)==4||e(p).status==-1?g((n(),y(a,{key:2,loading:e(h),type:"primary",onClick:r[4]||(r[4]=v=>ae(e(L).DISABLE.status))},{default:f(()=>[I(" \u6062\u590D ")]),_:1},8,["loading"])),[[re,["product:spu:update"]]]):d("",!0),e(l)||e(R)=="create"||e(S)==4||e(p).status==-1?d("",!0):(n(),y(a,{key:3,loading:e(h),type:"primary",onClick:ke},{default:f(()=>[I(oe(e(p).status==0?"\u4E0A\u67B6":"\u4E0B\u67B6"),1)]),_:1},8,["loading"])),e(l)?d("",!0):(n(),y(a,{key:4,loading:e(h),type:"primary",onClick:we},{default:f(()=>[I(" \u4FDD\u5B58 ")]),_:1},8,["loading"]))])]),key:"0"}]),1032,["modelValue","title","fullscreen"])}}}),[["__scopeId","data-v-473675a6"],["__file","D:/zx/mall-newfeifan-zx-business/src/views/mall/product/spu/form/index.vue"]])});export{qt as __tla,ne as default};
|