SkuForm-dff242fe.js 5.4 KB

1
  1. import{d as A,ac as H,r as f,e as C,aM as q,o as p,c as w,f as t,w as l,a,F as D,H as z,y as i,x as k,a0 as n,bq as G,ad as I,ae as M,C as X,G as E,_ as J,__tla as K}from"./index-8dc1e40a.js";import{g as Q,__tla as W}from"./index-c31b5019.js";import Y,{__tla as Z}from"./ProductAttributes-5fd61aa5.js";import $,{__tla as aa}from"./ProductPropertyAddForm-e7ce6cc1.js";import{u as ea,__tla as ta}from"./useMessage-7a27dd80.js";import{r as P,__tla as ra}from"./formRules-467f9efe.js";import b,{__tla as la}from"./SkuList-d3adf088.js";import{__tla as sa}from"./el-text-13e93c25.js";import{__tla as oa}from"./property-22343ea6.js";import{__tla as _a}from"./Dialog-41802231.js";import{__tla as pa}from"./el-image-6a48e9f1.js";import{__tla as ia}from"./el-image-viewer-3b8905e6.js";import{__tla as ma}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-703a828c.js";import{__tla as ca}from"./index-519182c1.js";import{__tla as ua}from"./UploadImg-c2c75279.js";import{__tla as fa}from"./UploadImgs.vue_vue_type_style_index_0_scoped_9d666400_lang-c25ae3d0.js";import{__tla as na}from"./UploadFile.vue_vue_type_style_index_0_scoped_436eca1b_lang-fa07b40d.js";let F,da=Promise.all([(()=>{try{return K}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return ta}catch{}})(),(()=>{try{return ra}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return ma}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return na}catch{}})()]).then(async()=>{F=J(A({name:"ProductSpuSkuForm",__name:"SkuForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:H.bool.def(!1)},emits:["update:activeName"],setup(_,{expose:x,emit:S}){const h=[{name:"stock",rule:e=>e>=0,message:"\u5546\u54C1\u5E93\u5B58\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 1 \uFF01\uFF01\uFF01"},{name:"price",rule:e=>e>=.01,message:"\u5546\u54C1\u9500\u552E\u4EF7\u683C\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.01 \u5143\uFF01\uFF01\uFF01"},{name:"marketPrice",rule:e=>e>=.01,message:"\u5546\u54C1\u5E02\u573A\u4EF7\u683C\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.01 \u5143\uFF01\uFF01\uFF01"},{name:"costPrice",rule:e=>e>=.01,message:"\u5546\u54C1\u6210\u672C\u4EF7\u683C\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E 0.00 \u5143\uFF01\uFF01\uFF01"}],V=ea(),g=_,T=f(),d=f(),s=f([]),m=f(),r=C({specType:!1,subCommissionType:!1,skus:[]}),R=C({specType:[P],subCommissionType:[P]});q(()=>g.propFormData,e=>{e&&(G(r,e),s.value=Q(e))},{immediate:!0});const B=S;x({validate:async()=>{if(d)try{m.value.validateSku(),await a(d).validate(),Object.assign(g.propFormData,r)}catch(e){throw V.error("\u3010\u5E93\u5B58\u4EF7\u683C\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),B("update:activeName","sku"),e}}});const L=()=>{for(const e of r.skus)e.firstBrokeragePrice=0,e.secondBrokeragePrice=0},U=()=>{s.value=[],r.skus=[{price:0,marketPrice:0,costPrice:0,barCode:"",picUrl:"",stock:0,weight:0,volume:0,firstBrokeragePrice:0,secondBrokeragePrice:0}]},j=e=>{m.value.generateTableData(e)};return(e,c)=>{const u=I,v=M,o=X,N=E,O=z;return p(),w(D,null,[t(O,{ref_key:"formRef",ref:d,model:a(r),rules:a(R),"label-width":"120px",disabled:_.isDetail},{default:l(()=>[t(o,{label:"\u5206\u9500\u7C7B\u578B",props:"subCommissionType"},{default:l(()=>[t(v,{modelValue:a(r).subCommissionType,"onUpdate:modelValue":c[0]||(c[0]=y=>a(r).subCommissionType=y),onChange:L,class:"w-80"},{default:l(()=>[t(u,{label:!1},{default:l(()=>[i("\u9ED8\u8BA4\u8BBE\u7F6E")]),_:1}),t(u,{label:!0,class:"radio"},{default:l(()=>[i("\u5355\u72EC\u8BBE\u7F6E")]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(o,{label:"\u5546\u54C1\u89C4\u683C",props:"specType"},{default:l(()=>[t(v,{modelValue:a(r).specType,"onUpdate:modelValue":c[1]||(c[1]=y=>a(r).specType=y),onChange:U,class:"w-80"},{default:l(()=>[t(u,{label:!1,class:"radio"},{default:l(()=>[i("\u5355\u89C4\u683C")]),_:1}),t(u,{label:!0},{default:l(()=>[i("\u591A\u89C4\u683C")]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(r).specType?n("",!0):(p(),k(o,{key:0},{default:l(()=>[t(a(b),{ref_key:"skuListRef",ref:m,"prop-form-data":a(r),"property-list":a(s),"rule-config":h},null,8,["prop-form-data","property-list"])]),_:1})),a(r).specType?(p(),k(o,{key:1,label:"\u5546\u54C1\u5C5E\u6027"},{default:l(()=>[t(N,{class:"mb-10px mr-15px",onClick:a(T).open},{default:l(()=>[i("\u6DFB\u52A0\u5C5E\u6027")]),_:1},8,["onClick"]),t(Y,{"property-list":a(s),onSuccess:j,"is-detail":_.isDetail},null,8,["property-list","is-detail"])]),_:1})):n("",!0),a(r).specType&&a(s).length>0?(p(),w(D,{key:2},[_.isDetail?n("",!0):(p(),k(o,{key:0,label:"\u6279\u91CF\u8BBE\u7F6E"},{default:l(()=>[t(a(b),{"is-batch":!0,"prop-form-data":a(r),"property-list":a(s)},null,8,["prop-form-data","property-list"])]),_:1})),t(o,{label:"\u89C4\u683C\u5217\u8868"},{default:l(()=>[t(a(b),{ref_key:"skuListRef",ref:m,"prop-form-data":a(r),"property-list":a(s),"rule-config":h,"is-detail":_.isDetail},null,8,["prop-form-data","property-list","is-detail"])]),_:1})],64)):n("",!0)]),_:1},8,["model","rules","disabled"]),t($,{ref_key:"attributesAddFormRef",ref:T,propertyList:a(s)},null,8,["propertyList"])],64)}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/product/spu/form/SkuForm.vue"]])});export{da as __tla,F as default};