SkuForm-a3b8855a.js 7.7 KB

1
  1. import{d as W,ah as Z,b as $,e as X,r as T,f as O,O as Y,o,c as P,a as e,j as p,w as r,i as a,l as m,F as U,J as ee,m as d,k as R,aV as te,ai as ae,aj as re,I as le,q as se,_ as oe,E as ie,s as pe,__tla as _e}from"./index-1e808f2e.js";import{g as ce,__tla as me}from"./index-89aca07e.js";import{_ as I,__tla as de}from"./ProductAttributes.vue_vue_type_script_setup_true_lang-ecf39234.js";import{_ as ue,__tla as fe}from"./ProductPropertyAddForm.vue_vue_type_script_setup_true_lang-f25e6775.js";import{u as ne,__tla as ye}from"./useMessage-5f9e8917.js";import{r as M,__tla as ke}from"./formRules-83fad61e.js";import{_ as n,__tla as be}from"./SkuList.vue_vue_type_script_setup_true_lang-7b9b16cc.js";import N,{__tla as he}from"./MobileSkuList-eb90d753.js";import{_ as ge}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as Te}from"./PcComponents.css_vue_type_style_index_0_src_bf8feb19_scoped_bf8feb19_lang-e58f9938.js";import{__tla as De}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-b3df4382.js";import{__tla as ve}from"./index-b59955b6.js";import{__tla as Pe}from"./el-image-viewer-dddb6285.js";import{__tla as Re}from"./UploadImg-3538b5a5.js";import{__tla as Le}from"./UploadImgs.vue_vue_type_style_index_0_scoped_3d27d917_lang-531188a2.js";import{__tla as Fe}from"./UploadFile.vue_vue_type_style_index_0_scoped_2570c8e9_lang-d79157f5.js";import{__tla as Se}from"./el-text-3aab5b45.js";import{__tla as we}from"./property-35f111c0.js";import{__tla as Ce}from"./Dialog-f44f9d78.js";import{__tla as Ve}from"./el-image-263fb014.js";let q,xe=Promise.all([(()=>{try{return _e}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return he}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return ve}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Ve}catch{}})()]).then(async()=>{let L,F,S,w;L={key:1},F={class:"mobile-card-title"},S={class:"mobile-card-title"},w={class:"mobile-card-title"},q=ge(W({name:"ProductSpuSkuForm",__name:"SkuForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:Z.bool.def(!1)},emits:["update:activeName"],setup(i,{expose:A,emit:E}){const J=$(),y=X(()=>J.getMobile),u=[{name:"stock",rule:l=>l>=0,message:"\u5546\u54C1\u5E93\u5B58\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 1 "},{name:"price",rule:l=>l>=.01,message:"\u5546\u54C1\u9500\u552E\u4EF7\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.01 \u5143"},{name:"marketPrice",rule:l=>l>=.01,message:"\u5546\u54C1\u5E02\u573A\u4EF7\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.01 \u5143"},{name:"costPrice",rule:l=>l>=.01,message:"\u5546\u54C1\u6210\u672C\u4EF7\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.00 \u5143"},{name:"settlementPrice",rule:l=>l>=.01,message:"\u5546\u54C1\u7ED3\u7B97\u4EF7\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.00 \u5143"}],z=ne(),C=i,V=T(),f=T(),s=T([]),c=T(),t=O({specType:!1,subCommissionType:!1,skus:[]}),k=O({specType:[M],subCommissionType:[M]});Y(()=>C.propFormData,l=>{l&&(te(t,l),s.value=ce(l))},{immediate:!0});const G=E;A({validate:async()=>{if(f)try{c.value.validateSku(),await e(f).validate(),Object.assign(C.propFormData,t)}catch(l){throw z.error("\u3010\u5E93\u5B58\u4EF7\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),G("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}]},j=l=>{c.value.generateTableData(l)};return(l,b)=>{const h=ae,B=re,_=le,H=se,g=ee,D=oe,K=ie,Q=pe;return o(),P(U,null,[e(y)?(o(),P("div",L,[a(g,{ref_key:"formRef",ref:f,model:e(t),rules:e(k),disabled:i.isDetail,class:"mobile-card"},{default:r(()=>[R("div",F,[a(D,{icon:"ep:list"}),d(" \u5546\u54C1\u89C4\u683C ")]),a(_,{props:"specType"},{default:r(()=>[a(B,{modelValue:e(t).specType,"onUpdate:modelValue":b[1]||(b[1]=v=>e(t).specType=v),onChange:x,class:"w-80"},{default:r(()=>[a(h,{label:!1,class:"radio"},{default:r(()=>[d("\u5355\u89C4\u683C")]),_:1}),a(h,{label:!0},{default:r(()=>[d("\u591A\u89C4\u683C")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules","disabled"]),a(g,{ref_key:"formRef",ref:f,model:e(t),rules:e(k),disabled:i.isDetail,class:"mobile-card"},{default:r(()=>[R("div",S,[a(D,{icon:"ep:list"}),d(" \u5546\u54C1\u5C5E\u6027 ")]),e(t).specType?m("",!0):(o(),p(_,{key:0},{default:r(()=>[e(y)?(o(),p(e(N),{key:1,ref_key:"skuListRef",ref:c,"prop-form-data":e(t),"is-detail":i.isDetail,"property-list":e(s),"rule-config":u},null,8,["prop-form-data","is-detail","property-list"])):(o(),p(e(n),{key:0,ref_key:"skuListRef",ref:c,"prop-form-data":e(t),"property-list":e(s),"rule-config":u},null,8,["prop-form-data","property-list"]))]),_:1})),e(t).specType?(o(),p(_,{key:1},{default:r(()=>[a(I,{"property-list":e(s),onSuccess:j,"is-detail":i.isDetail},null,8,["property-list","is-detail"])]),_:1})):m("",!0)]),_:1},8,["model","rules","disabled"]),e(t).specType&&e(s).length>0&&!e(y)?(o(),p(g,{key:0,ref_key:"formRef",ref:f,model:e(t),rules:e(k),disabled:i.isDetail,class:"mobile-card"},{default:r(()=>[R("div",w,[a(D,{icon:"ep:list"}),d(" \u89C4\u683C\u5217\u8868 ")]),a(Q,null,{default:r(()=>[a(K,{span:24},{default:r(()=>[a(_,null,{default:r(()=>[a(e(n),{ref_key:"skuListRef",ref:c,"prop-form-data":e(t),"property-list":e(s),"rule-config":u,"is-detail":i.isDetail},null,8,["prop-form-data","property-list","is-detail"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled"])):m("",!0),e(t).specType&&e(s).length>0&&e(y)?(o(),p(e(N),{key:1,ref_key:"skuListRef",ref:c,"prop-form-data":e(t),"property-list":e(s),"rule-config":u,"is-detail":i.isDetail},null,8,["prop-form-data","property-list","is-detail"])):m("",!0)])):(o(),p(g,{key:0,ref_key:"formRef",ref:f,model:e(t),rules:e(k),"label-width":"120px",disabled:i.isDetail,class:"noBorder"},{default:r(()=>[a(_,{label:"\u5546\u54C1\u89C4\u683C",props:"specType"},{default:r(()=>[a(B,{modelValue:e(t).specType,"onUpdate:modelValue":b[0]||(b[0]=v=>e(t).specType=v),onChange:x,class:"w-80"},{default:r(()=>[a(h,{label:!1,class:"radio"},{default:r(()=>[d("\u5355\u89C4\u683C")]),_:1}),a(h,{label:!0},{default:r(()=>[d("\u591A\u89C4\u683C")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(t).specType?m("",!0):(o(),p(_,{key:0,class:"skulist"},{default:r(()=>[a(e(n),{ref_key:"skuListRef",ref:c,"prop-form-data":e(t),"property-list":e(s),"rule-config":u},null,8,["prop-form-data","property-list"])]),_:1})),e(t).specType?(o(),p(_,{key:1,label:"\u5546\u54C1\u5C5E\u6027"},{default:r(()=>[a(H,{class:"mb-10px mr-15px",onClick:e(V).open},{default:r(()=>[d("\u6DFB\u52A0\u5C5E\u6027")]),_:1},8,["onClick"]),a(I,{"property-list":e(s),onSuccess:j,"is-detail":i.isDetail},null,8,["property-list","is-detail"])]),_:1})):m("",!0),e(t).specType&&e(s).length>0?(o(),P(U,{key:2},[i.isDetail?m("",!0):(o(),p(_,{key:0,label:"\u6279\u91CF\u8BBE\u7F6E"},{default:r(()=>[a(e(n),{"is-batch":!0,"prop-form-data":e(t),"property-list":e(s)},null,8,["prop-form-data","property-list"])]),_:1})),a(_,{label:"\u89C4\u683C\u5217\u8868"},{default:r(()=>[a(e(n),{ref_key:"skuListRef",ref:c,"prop-form-data":e(t),"property-list":e(s),"rule-config":u,"is-detail":i.isDetail},null,8,["prop-form-data","property-list","is-detail"])]),_:1})],64)):m("",!0)]),_:1},8,["model","rules","disabled"])),a(ue,{ref_key:"attributesAddFormRef",ref:V,propertyList:e(s)},null,8,["propertyList"])],64)}}}),[["__scopeId","data-v-ed42d988"]])});export{xe as __tla,q as default};