1 |
- import{d as H,ah as J,Z as K,L as X,r as g,f as B,M as Y,o as i,c as D,a as e,x as c,w as r,g as a,Q as m,F as U,G as $,n as _,h as P,aW as ee,ai as ae,aj as te,B as re,D as le,q as se,E as oe,j as ie,_ as pe,__tla as _e}from"./index-52b99925.js";import{g as ce,__tla as me}from"./index-d67478b4.js";import M,{__tla as ue}from"./ProductAttributes-3b90698d.js";import de,{__tla as fe}from"./ProductPropertyAddForm-682089e9.js";import{u as ne,__tla as ye}from"./useMessage-c41e583e.js";import{r as z,__tla as ke}from"./formRules-d64fa1d2.js";import f,{__tla as be}from"./SkuList-1b916eef.js";import{__tla as he}from"./el-text-b9d50448.js";import{__tla as ge}from"./property-a0163f36.js";import{__tla as ve}from"./Dialog-01a79427.js";import{__tla as Te}from"./el-image-9d9dde0a.js";import{__tla as De}from"./el-image-viewer-8d62bae1.js";import{__tla as Pe}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-9a220cc6.js";import{__tla as Fe}from"./index-2375ba8a.js";import{__tla as we}from"./UploadImg-63fa00ce.js";import{__tla as Re}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-fd08a231.js";import{__tla as Se}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-85466023.js";let N,xe=Promise.all([(()=>{try{return _e}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return he}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return ve}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Se}catch{}})()]).then(async()=>{let F,w,R,S;F={key:1},w={class:"mobile-card-title"},R={class:"mobile-card-title"},S={class:"mobile-card-title"},N=pe(H({name:"ProductSpuSkuForm",__name:"SkuForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:J.bool.def(!1)},emits:["update:activeName"],setup(o,{expose:O,emit:q}){const A=K(),E=X(()=>A.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"}],G=ne(),x=o,C=g(),u=g(),s=g([]),d=g(),t=B({specType:!1,subCommissionType:!1,skus:[]}),y=B({specType:[z],subCommissionType:[z]});Y(()=>x.propFormData,l=>{l&&(ee(t,l),s.value=ce(l))},{immediate:!0});const I=q;O({validate:async()=>{if(u)try{d.value.validateSku(),await e(u).validate(),Object.assign(x.propFormData,t)}catch(l){throw G.error("\u3010\u5E93\u5B58\u4EF7\u683C\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),I("update:activeName","sku"),l}}});const L=()=>{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}]},V=l=>{d.value.generateTableData(l)};return(l,k)=>{const b=ae,j=te,p=re,Q=le,h=$,v=se,W=oe,Z=ie;return i(),D(U,null,[e(E)?(i(),D("div",F,[a(h,{ref_key:"formRef",ref:u,model:e(t),rules:e(y),disabled:o.isDetail,class:"mobile-card"},{default:r(()=>[P("div",w,[a(v,{icon:"ep:list"}),_(" \u5546\u54C1\u89C4\u683C ")]),a(p,{props:"specType"},{default:r(()=>[a(j,{modelValue:e(t).specType,"onUpdate:modelValue":k[1]||(k[1]=T=>e(t).specType=T),onChange:L,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:u,model:e(t),rules:e(y),disabled:o.isDetail,class:"mobile-card"},{default:r(()=>[P("div",R,[a(v,{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:d,"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(M,{"property-list":e(s),onSuccess:V,"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:u,model:e(t),rules:e(y),disabled:o.isDetail,class:"mobile-card"},{default:r(()=>[P("div",S,[a(v,{icon:"ep:list"}),_(" \u89C4\u683C\u5217\u8868 ")]),a(Z,null,{default:r(()=>[a(W,{span:24},{default:r(()=>[a(p,null,{default:r(()=>[a(e(f),{ref_key:"skuListRef",ref:d,"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:u,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(j,{modelValue:e(t).specType,"onUpdate:modelValue":k[0]||(k[0]=T=>e(t).specType=T),onChange:L,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:d,"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(Q,{class:"mb-10px mr-15px",onClick:e(C).open},{default:r(()=>[_("\u6DFB\u52A0\u5C5E\u6027")]),_:1},8,["onClick"]),a(M,{"property-list":e(s),onSuccess:V,"is-detail":o.isDetail},null,8,["property-list","is-detail"])]),_:1})):m("",!0),e(t).specType&&e(s).length>0?(i(),D(U,{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:d,"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:C,propertyList:e(s)},null,8,["propertyList"])],64)}}}),[["__scopeId","data-v-c6005340"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/spu/form/SkuForm.vue"]])});export{xe as __tla,N as default};
|