index-13186246.js 11 KB

1
  1. import{d as ge,f as ee,as as te,r as a,o as u,j as h,aN as be,a as e,w as y,k as c,m as re,t as ae,l as d,i as o,_ as Fe,aO as we,D as k,R as ie,a6 as w,c as j,B as Be,av as le,at as g,au as b,aw as F,aP as De,Y as Se,Z as Ue,q as Ce,az as Ie,M as Te,v as xe,x as Ve,__tla as Re}from"./index-20ebf448.js";import{_ as je,__tla as ze}from"./ContentWrap.vue_vue_type_script_setup_true_lang-1b6576d3.js";import{_ as Ae,__tla as Ee}from"./SPuUploadImg-ddbcde97.js";import{g as $e,a as qe,c as Ge,u as Me,__tla as Ne}from"./spu-c43b7da0.js";import Oe,{__tla as Ye}from"./InfoForm-040d00bd.js";import Ze,{__tla as He}from"./DescriptionForm-ff7fabce.js";import Je,{__tla as Ke}from"./OtherForm-a6ac5b26.js";import Le,{__tla as Qe}from"./SkuForm-356874e0.js";import We,{__tla as Xe}from"./DeliveryForm-99b26498.js";import et,{__tla as tt}from"./Service-8786b6b2.js";import{A as rt,__tla as at}from"./AfterSale-956c508a.js";import it,{__tla as lt}from"./Comment-d85e1d11.js";import ot,{__tla as ct}from"./Apply-f95c87e8.js";import{u as st,__tla as _t}from"./useMessage-30c4ae17.js";import{_ as nt}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as mt}from"./el-card-924b4902.js";import{__tla as ut}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-4c57c0b6.js";import{__tla as pt}from"./index-a4ee0efc.js";import{__tla as dt}from"./el-image-viewer-b5599f30.js";import{__tla as ht}from"./UploadImgs-d167787d.js";import{__tla as yt}from"./UploadImgs.vue_vue_type_style_index_0_scoped_3d27d917_lang-47e6acc6.js";import"./tree-fd3a041e.js";import{__tla as ft}from"./category-87cc181b.js";import{__tla as vt}from"./brand-bb461e42.js";import{__tla as Pt}from"./formRules-9ef8a476.js";import{__tla as kt}from"./style.css_vue_type_style_index_0_src_true_lang-201f1166.js";import{__tla as gt}from"./index-7aaff9c2.js";import{__tla as bt}from"./SkuList.vue_vue_type_script_setup_true_lang-46efe723.js";import{__tla as Ft}from"./el-image-46b9dd8b.js";import{__tla as wt}from"./UploadImg-48fb8157.js";import{__tla as Bt}from"./UploadFile.vue_vue_type_style_index_0_scoped_2570c8e9_lang-76566e29.js";import{__tla as Dt}from"./PcComponents.css_vue_type_style_index_0_src_bf8feb19_scoped_bf8feb19_lang-94ea6f88.js";import{__tla as St}from"./ProductAttributes.vue_vue_type_script_setup_true_lang-cf5114ed.js";import{__tla as Ut}from"./el-text-3a1cfd94.js";import{__tla as Ct}from"./property-f93c130f.js";import{__tla as It}from"./ProductPropertyAddForm.vue_vue_type_script_setup_true_lang-b54b3459.js";import{__tla as Tt}from"./Dialog-94c42e54.js";import{__tla as xt}from"./MobileSkuList-9b79ef63.js";import{__tla as Vt}from"./index-7451c1b3.js";import{__tla as Rt}from"./dict-11f81c64.js";import"./constants-e43f22dd.js";import{__tla as jt}from"./index-f2d10317.js";import{__tla as zt}from"./index.vue_vue_type_script_setup_true_lang-86a1d212.js";import{__tla as At}from"./index-aa345822.js";import{__tla as Et}from"./index-a68067b6.js";import{__tla as $t}from"./formatTime-2ebec930.js";let oe,qt=Promise.all([(()=>{try{return Re}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return Ye}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return Ke}catch{}})(),(()=>{try{return Qe}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return tt}catch{}})(),(()=>{try{return at}catch{}})(),(()=>{try{return lt}catch{}})(),(()=>{try{return ct}catch{}})(),(()=>{try{return _t}catch{}})(),(()=>{try{return mt}catch{}})(),(()=>{try{return ut}catch{}})(),(()=>{try{return pt}catch{}})(),(()=>{try{return dt}catch{}})(),(()=>{try{return ht}catch{}})(),(()=>{try{return yt}catch{}})(),(()=>{try{return ft}catch{}})(),(()=>{try{return vt}catch{}})(),(()=>{try{return Pt}catch{}})(),(()=>{try{return kt}catch{}})(),(()=>{try{return gt}catch{}})(),(()=>{try{return bt}catch{}})(),(()=>{try{return Ft}catch{}})(),(()=>{try{return wt}catch{}})(),(()=>{try{return Bt}catch{}})(),(()=>{try{return Dt}catch{}})(),(()=>{try{return St}catch{}})(),(()=>{try{return Ut}catch{}})(),(()=>{try{return Ct}catch{}})(),(()=>{try{return It}catch{}})(),(()=>{try{return Tt}catch{}})(),(()=>{try{return xt}catch{}})(),(()=>{try{return Vt}catch{}})(),(()=>{try{return Rt}catch{}})(),(()=>{try{return jt}catch{}})(),(()=>{try{return zt}catch{}})(),(()=>{try{return At}catch{}})(),(()=>{try{return Et}catch{}})(),(()=>{try{return $t}catch{}})()]).then(async()=>{let z,A,E,$,q,G,M,N,O,Y,Z;z={class:"my-header"},A={class:"my-header-left"},E={class:"my-header-right"},$=["onClick"],q={class:"left"},G={class:"right"},M={key:0},N={key:1},O={key:2},Y=(C=>(xe("data-v-4bbbab6a"),C=C(),Ve(),C))(()=>c("div",{style:{clear:"both"}},null,-1)),Z={class:"dialog-footer"},oe=nt(ge({name:"ProductSpuForm",__name:"index",emits:["success"],setup(C,{expose:ce,emit:se}){const _e=ee({value:0});te("spuTypeChange",_e);const ne=ee({value:!1});te("highPrecisionChange",ne);const{t:V}=Be(),I=st(),f=a(!1),n=a("info"),i=a(!1),H=a(),J=a(),K=a(),L=a(),me=a(),m=a({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}),ue=a({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}),B=a(!1),T=a(""),Q=a(0),D=a(),pe=a(""),v=a(),R=a(""),de=a(0),S=a(!1);ce({open:async(s,l,p,t)=>{Q.value=t,v.value=l,de.value=p,B.value=!0,D.value=l.id,pe.value=l.picUrl,S.value=!1,await ye(),n.value="info",R.value=s,T.value=V("action."+s),s=="view"?T.value="\u67E5\u770B":s=="create"&&(m.value=le(ue.value)),R.value=="view"?i.value=!0:i.value=!1}});const he=()=>{S.value=!S.value},ye=async()=>{var l;const s=D.value;if(s){f.value=!0;try{const p=await $e(s);(l=p.skus)==null||l.forEach(t=>{i.value?(t.price=g(t.price),t.settlementPrice=g(t.settlementPrice),t.highPrecisionPrice=t.highPrecisionPrice/100,t.highPrecisionSettlementPrice=t.highPrecisionSettlementPrice/100,t.marketPrice=g(t.marketPrice),t.costPrice=g(t.costPrice),t.promotionFee=g(t.promotionFee),t.firstBrokeragePrice=g(t.firstBrokeragePrice),t.secondBrokeragePrice=g(t.secondBrokeragePrice)):(t.highPrecisionPrice=t.highPrecisionPrice/100,t.price=b(t.price),t.settlementPrice=b(t.settlementPrice),t.highPrecisionSettlementPrice=t.highPrecisionSettlementPrice/100,t.marketPrice=b(t.marketPrice),t.costPrice=b(t.costPrice),t.promotionFee=b(t.promotionFee),t.firstBrokeragePrice=b(t.firstBrokeragePrice),t.secondBrokeragePrice=b(t.secondBrokeragePrice))}),m.value=p}finally{f.value=!1}}},W=se,fe=async()=>{try{const s=v.value.status?"\u4E0B\u67B6":"\u4E0A\u67B6",l=v.value.status?0:1;await I.confirm(`\u786E\u8BA4\u8981${s}"${v.value.name}"\u5417\uFF1F`),await qe({id:v.value.id,status:l}),I.success(s+"\u6210\u529F"),X(),W("success")}catch{}},ve=async()=>{var s,l,p,t;f.value=!0;try{await((s=e(H))==null?void 0:s.validate()),await((l=e(J))==null?void 0:l.validate()),await((p=e(K))==null?void 0:p.validate()),await((t=e(L))==null?void 0:t.validate());const _=le(e(m.value));_.skus.forEach(r=>{r.name=_.name,r.price=F(r.price),r.marketPrice=F(r.marketPrice),r.promotionFee=F(r.promotionFee),r.costPrice=F(r.costPrice),r.settlementPrice=F(r.settlementPrice),r.highPrecisionPrice=r.highPrecisionPrice?(100*r.highPrecisionPrice).toFixed(6):0,r.highPrecisionSettlementPrice=r.highPrecisionSettlementPrice?(100*r.highPrecisionSettlementPrice).toFixed(6):0,r.firstBrokeragePrice=F(r.firstBrokeragePrice),r.secondBrokeragePrice=F(r.secondBrokeragePrice)});const U=[];_.sliderPicUrls.forEach(r=>{typeof r=="object"?U.push(r.url):U.push(r)}),_.sliderPicUrls=U;const x=_;D.value?(await Me(x),I.success(V("common.updateSuccess"))):(await Ge(x),I.success(V("common.createSuccess"))),X(),W("success")}finally{f.value=!1}},X=()=>{B.value=!1};return(s,l)=>{const p=De,t=Ae,_=Se,U=Ue,x=je,r=Ce,Pe=Ie,ke=Te;return u(),h(Pe,{modelValue:e(B),"onUpdate:modelValue":l[2]||(l[2]=P=>ie(B)?B.value=P:null),title:e(T),"close-on-click-modal":!1,fullscreen:e(S),"show-close":!1,width:"70%",draggable:"",class:"dialog"},be({header:y(({close:P})=>[c("div",z,[c("div",A,ae(e(T)),1),c("div",E,[c("span",{onClick:he},[o(e(Fe),{icon:e(S)?"zmdi:fullscreen-exit":"zmdi:fullscreen"},null,8,["icon"])]),c("span",{onClick:P},[o(p,null,{default:y(()=>[o(e(we))]),_:1})],8,$)])])]),default:y(()=>[k((u(),h(x,{style:{"max-height":"560px","min-height":"560px","overflow-y":"auto","border-bottom":"none"}},{default:y(()=>[c("div",q,[o(t,{modelValue:e(m).picUrl,"onUpdate:modelValue":l[0]||(l[0]=P=>e(m).picUrl=P),disabled:e(i),fileSize:.3},null,8,["modelValue","disabled"]),o(U,{modelValue:e(n),"onUpdate:modelValue":l[1]||(l[1]=P=>ie(n)?n.value=P:null),"tab-position":"left",class:"child-tabs"},{default:y(()=>[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(i)?(u(),h(_,{key:0,label:"\u8BC4\u4EF7",name:"comment"})):d("",!0),e(i)?(u(),h(_,{key:1,label:"\u5BA2\u670D",name:"service"})):d("",!0),e(i)?(u(),h(_,{key:2,label:"\u552E\u540E",name:"aftersale"})):d("",!0),o(_,{label:"\u7269\u6D41\u8BBE\u7F6E",name:"delivery"}),e(i)?(u(),h(_,{key:3,label:"\u7533\u8BF7\u8BB0\u5F55",name:"apply"})):d("",!0)]),_:1},8,["modelValue"])]),c("div",G,[k(c("div",null,[o(Oe,{ref_key:"infoRef",ref:H,"is-detail":e(i),propFormData:e(m)},null,8,["is-detail","propFormData"])],512),[[w,e(n)=="info"]]),k(c("div",null,[o(Le,{ref_key:"skuRef",ref:J,"is-detail":e(i),propFormData:e(m)},null,8,["is-detail","propFormData"])],512),[[w,e(n)=="sku"]]),k(c("div",null,[o(We,{ref_key:"deliveryRef",ref:K,"is-detail":e(i),propFormData:e(m)},null,8,["is-detail","propFormData"])],512),[[w,e(n)=="delivery"]]),k(c("div",null,[o(Ze,{ref_key:"descriptionRef",ref:L,"is-detail":e(i),propFormData:e(m)},null,8,["is-detail","propFormData"])],512),[[w,e(n)=="description"]]),k(c("div",null,[o(Je,{ref_key:"otherRef",ref:me,"is-detail":e(i),propFormData:e(m)},null,8,["is-detail","propFormData"])],512),[[w,e(n)=="other"]]),e(n)=="comment"?(u(),j("div",M,[o(it,{"is-detail":e(i),propFormData:e(m)},null,8,["is-detail","propFormData"])])):d("",!0),k(c("div",null,[o(et,{"is-detail":e(i),propFormData:e(m)},null,8,["is-detail","propFormData"])],512),[[w,e(n)=="service"]]),e(n)=="aftersale"?(u(),j("div",N,[o(rt,{productId:e(D),openSource:"Spu"},null,8,["productId"])])):d("",!0),e(n)=="apply"?(u(),j("div",O,[o(ot,{productId:e(D),propFormData:e(m)},null,8,["productId","propFormData"])])):d("",!0)]),Y]),_:1})),[[ke,e(f)]])]),_:2},[e(i)?void 0:{name:"footer",fn:y(()=>[c("div",Z,[e(i)||e(R)=="create"||e(Q)==4||e(v).status==-1?d("",!0):(u(),h(r,{key:0,loading:e(f),type:"primary",onClick:fe},{default:y(()=>[re(ae(e(v).status==0?"\u4E0A\u67B6":"\u4E0B\u67B6"),1)]),_:1},8,["loading"])),e(i)?d("",!0):(u(),h(r,{key:1,loading:e(f),type:"primary",onClick:ve},{default:y(()=>[re(" \u4FDD\u5B58 ")]),_:1},8,["loading"]))])]),key:"0"}]),1032,["modelValue","title","fullscreen"])}}}),[["__scopeId","data-v-4bbbab6a"]])});export{qt as __tla,oe as default};