SkuForm-73cf8f7d.js 7.2 KB

1
  1. import{d as Q,ar as W,y as $,e as X,r as g,x as B,w as Y,o as i,c as D,a as e,C as c,A as r,f as a,a2 as m,F as j,V as Z,D as _,B as P,dy as ee,as as ae,at as te,U as re,J as le,_ as se,H as oe,K as ie,__tla as pe}from"./index-a9d538d5.js";import{g as _e,__tla as ce}from"./index-a5b4bb1c.js";import{_ as A,__tla as me}from"./ProductAttributes.vue_vue_type_script_setup_true_lang-ebacb462.js";import{_ as de,__tla as ue}from"./ProductPropertyAddForm.vue_vue_type_script_setup_true_lang-4a5d93b7.js";import{u as fe,__tla as ne}from"./useMessage-d5cbbfad.js";import{r as I,__tla as ye}from"./formRules-08c9aa65.js";import{_ as f,__tla as ke}from"./SkuList.vue_vue_type_script_setup_true_lang-d84a8045.js";import{_ as be}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as he}from"./el-text-e6b9efbd.js";import{__tla as ge}from"./property-9b7f233c.js";import{__tla as Te}from"./Dialog-f354f369.js";import{__tla as ve}from"./el-image-2dadd73e.js";import{__tla as De}from"./el-image-viewer-2e77a3e7.js";import{__tla as Pe}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-7f19656e.js";import{__tla as Re}from"./index-ab25a150.js";import{__tla as Ce}from"./UploadImg-4d05829d.js";import{__tla as Fe}from"./UploadImgs.vue_vue_type_style_index_0_scoped_3d27d917_lang-e129a17c.js";import{__tla as Se}from"./UploadFile.vue_vue_type_style_index_0_scoped_2570c8e9_lang-86429bd4.js";let N,we=Promise.all([(()=>{try{return pe}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return he}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return ve}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Se}catch{}})()]).then(async()=>{let R,C,F,S;R={key:1},C={class:"mobile-card-title"},F={class:"mobile-card-title"},S={class:"mobile-card-title"},N=be(Q({name:"ProductSpuSkuForm",__name:"SkuForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:W.bool.def(!1)},emits:["update:activeName"],setup(o,{expose:O,emit:H}){const J=$(),K=X(()=>J.getMobile),n=[{name:"picUrl",rule:l=>l!="",message:"\u5FC5\u987B\u4E0A\u4F20\u5546\u54C1\u56FE\u7247"},{name:"stock",rule:l=>l>=0,message:"\u5546\u54C1\u5E93\u5B58\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 1 \uFF01\uFF01\uFF01"},{name:"price",rule:l=>l>=.01,message:"\u5546\u54C1\u9500\u552E\u4EF7\u683C\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.01 \u5143\uFF01\uFF01\uFF01"},{name:"marketPrice",rule:l=>l>=.01,message:"\u5546\u54C1\u5E02\u573A\u4EF7\u683C\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.01 \u5143\uFF01\uFF01\uFF01"},{name:"costPrice",rule:l=>l>=.01,message:"\u5546\u54C1\u6210\u672C\u4EF7\u683C\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.00 \u5143\uFF01\uFF01\uFF01"},{name:"settlementPrice",rule:l=>l>=.01,message:"\u5546\u54C1\u7ED3\u7B97\u4EF7\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.00 \u5143"}],M=fe(),w=o,V=g(),d=g(),s=g([]),u=g(),t=B({specType:!1,subCommissionType:!1,skus:[]}),y=B({specType:[I],subCommissionType:[I]});Y(()=>w.propFormData,l=>{l&&(ee(t,l),s.value=_e(l))},{immediate:!0});const q=H;O({validate:async()=>{if(d)try{u.value.validateSku(),await e(d).validate(),Object.assign(w.propFormData,t)}catch(l){throw M.error("\u3010\u5E93\u5B58\u4EF7\u683C\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),q("update:activeName","sku"),l}}});const x=()=>{s.value=[],t.skus=[{price:0,marketPrice:0,costPrice:0,settlementPrice:0,barCode:"",picUrl:"",stock:0,promotionFee:0,mark:"",weight:0,volume:0,firstBrokeragePrice:0,secondBrokeragePrice:0,highPrecisionSettlementPrice:0}]},L=l=>{u.value.generateTableData(l)};return(l,k)=>{const b=ae,U=te,p=re,z=le,h=Z,T=se,E=oe,G=ie;return i(),D(j,null,[e(K)?(i(),D("div",R,[a(h,{ref_key:"formRef",ref:d,model:e(t),rules:e(y),disabled:o.isDetail,class:"mobile-card"},{default:r(()=>[P("div",C,[a(T,{icon:"ep:list"}),_(" \u5546\u54C1\u89C4\u683C ")]),a(p,{props:"specType"},{default:r(()=>[a(U,{modelValue:e(t).specType,"onUpdate:modelValue":k[1]||(k[1]=v=>e(t).specType=v),onChange:x,class:"w-80"},{default:r(()=>[a(b,{label:!1,class:"radio"},{default:r(()=>[_("\u5355\u89C4\u683C")]),_:1}),a(b,{label:!0},{default:r(()=>[_("\u591A\u89C4\u683C")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules","disabled"]),a(h,{ref_key:"formRef",ref:d,model:e(t),rules:e(y),disabled:o.isDetail,class:"mobile-card"},{default:r(()=>[P("div",F,[a(T,{icon:"ep:list"}),_(" \u5546\u54C1\u5C5E\u6027 ")]),e(t).specType?m("",!0):(i(),c(p,{key:0},{default:r(()=>[a(e(f),{ref_key:"skuListRef",ref:u,"prop-form-data":e(t),"property-list":e(s),"rule-config":n},null,8,["prop-form-data","property-list"])]),_:1})),e(t).specType?(i(),c(p,{key:1},{default:r(()=>[a(A,{"property-list":e(s),onSuccess:L,"is-detail":o.isDetail},null,8,["property-list","is-detail"])]),_:1})):m("",!0)]),_:1},8,["model","rules","disabled"]),e(t).specType&&e(s).length>0?(i(),c(h,{key:0,ref_key:"formRef",ref:d,model:e(t),rules:e(y),disabled:o.isDetail,class:"mobile-card"},{default:r(()=>[P("div",S,[a(T,{icon:"ep:list"}),_(" \u89C4\u683C\u5217\u8868 ")]),a(G,null,{default:r(()=>[a(E,{span:24},{default:r(()=>[a(p,null,{default:r(()=>[a(e(f),{ref_key:"skuListRef",ref:u,"prop-form-data":e(t),"property-list":e(s),"rule-config":n,"is-detail":o.isDetail},null,8,["prop-form-data","property-list","is-detail"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled"])):m("",!0)])):(i(),c(h,{key:0,ref_key:"formRef",ref:d,model:e(t),rules:e(y),"label-width":"120px",disabled:o.isDetail,class:"noBorder"},{default:r(()=>[a(p,{label:"\u5546\u54C1\u89C4\u683C",props:"specType"},{default:r(()=>[a(U,{modelValue:e(t).specType,"onUpdate:modelValue":k[0]||(k[0]=v=>e(t).specType=v),onChange:x,class:"w-80"},{default:r(()=>[a(b,{label:!1,class:"radio"},{default:r(()=>[_("\u5355\u89C4\u683C")]),_:1}),a(b,{label:!0},{default:r(()=>[_("\u591A\u89C4\u683C")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(t).specType?m("",!0):(i(),c(p,{key:0,class:"skulist"},{default:r(()=>[a(e(f),{ref_key:"skuListRef",ref:u,"prop-form-data":e(t),"property-list":e(s),"rule-config":n},null,8,["prop-form-data","property-list"])]),_:1})),e(t).specType?(i(),c(p,{key:1,label:"\u5546\u54C1\u5C5E\u6027"},{default:r(()=>[a(z,{class:"mb-10px mr-15px",onClick:e(V).open},{default:r(()=>[_("\u6DFB\u52A0\u5C5E\u6027")]),_:1},8,["onClick"]),a(A,{"property-list":e(s),onSuccess:L,"is-detail":o.isDetail},null,8,["property-list","is-detail"])]),_:1})):m("",!0),e(t).specType&&e(s).length>0?(i(),D(j,{key:2},[o.isDetail?m("",!0):(i(),c(p,{key:0,label:"\u6279\u91CF\u8BBE\u7F6E"},{default:r(()=>[a(e(f),{"is-batch":!0,"prop-form-data":e(t),"property-list":e(s)},null,8,["prop-form-data","property-list"])]),_:1})),a(p,{label:"\u89C4\u683C\u5217\u8868"},{default:r(()=>[a(e(f),{ref_key:"skuListRef",ref:u,"prop-form-data":e(t),"property-list":e(s),"rule-config":n,"is-detail":o.isDetail},null,8,["prop-form-data","property-list","is-detail"])]),_:1})],64)):m("",!0)]),_:1},8,["model","rules","disabled"])),a(de,{ref_key:"attributesAddFormRef",ref:V,propertyList:e(s)},null,8,["propertyList"])],64)}}}),[["__scopeId","data-v-145f1bd5"]])});export{we as __tla,N as default};