moreShopAdmin/dist/assets/edit.a8d3123f.js

2 lines
5.8 KiB
JavaScript

import{D as y,C as k,w as U,F as q,L as w}from"./element-plus.3a5be7a7.js";import{_ as v}from"./picker.1e07f33b.js";import{q as x}from"./index.077791ea.js";import{a as R,b as S,c as h}from"./store_product.91ecc44b.js";import{d as c,s as A,r as P,Z as n,o as N,K as T,L as a,a as I,S as L,u as l,U as o,R as j}from"./@vue.18505fe0.js";import"./lodash.60201f64.js";import{a as K}from"./vue-router.886c5f5a.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.8ae0c638.js";import"./axios.2b8d80bd.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.164c0d34.js";import"./index.643cac86.js";import"./index.vue_vue_type_script_setup_true_lang.0cb80fdf.js";import"./index.51db1d5e.js";import"./usePaging.6a6670f9.js";import"./vuedraggable.d1fd737a.js";import"./vue.feef8fd6.js";import"./sortablejs.c8f4cbb7.js";import"./pinia.a969beab.js";import"./css-color-function.b82a2ce7.js";import"./color.b905eb26.js";import"./clone.e1fb2883.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.495afef3.js";import"./vue-clipboard3.cb649e18.js";import"./clipboard.4592e390.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";const M={class:"mb-4 text-lg font-bold"},O=c({name:"storeProductEdit"}),he=c({...O,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Z,{expose:F,emit:z}){const d=A(),{removeTab:f}=x(),p=P("add"),u=n({image:"",store_name:"",bar_code:"",cate_id:"",price:"",unit:"",stock:"",cost:"",purchase:"",rose:"0"}),_=n({store_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",trigger:["blur"]}],bar_code:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801",trigger:["blur"]}],cate_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u5206\u7C7B",trigger:["blur","change"]}],price:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u4EF7\u683C",trigger:["blur"]}],unit:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u5355\u4F4D",trigger:["blur","change"]}],stock:[{required:!0,message:"\u8BF7\u8F93\u5165\u5E93\u5B58",trigger:["blur"]}],cost:[{required:!0,message:"\u8BF7\u8F93\u5165\u6210\u672C\u4EF7",trigger:["blur"]}],purchase:[{required:!0,message:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u4EF7",trigger:["blur"]}],image:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u56FE\u7247",trigger:["blur","change"]}]}),i=async s=>{for(const e in u)s[e]!=null&&s[e]!=null&&(u[e]=s[e])},b=async s=>{const e=await R({id:s.id});i(e)},g=K(),C=async()=>{var e;f(),g.push({path:"/store/store_product"}),await((e=d.value)==null?void 0:e.validate());const s={...u};p.value=="edit"?await S(s):await h(s)};return F({setFormData:i,getDetail:b}),(s,e)=>{const B=v,t=y,m=k,V=U,E=q,D=w;return N(),T(D,null,{default:a(()=>[I("div",M,L(l(p)=="add"?"\u6DFB\u52A0\u5546\u54C1":"\u7F16\u8F91\u5546\u54C1"),1),o(E,{ref_key:"formRef",ref:d,model:l(u),"label-width":"90px",rules:l(_)},{default:a(()=>[o(t,{label:"\u5546\u54C1\u56FE\u7247",prop:"image"},{default:a(()=>[o(B,{modelValue:l(u).image,"onUpdate:modelValue":e[0]||(e[0]=r=>l(u).image=r),limit:1},null,8,["modelValue"])]),_:1}),o(t,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:a(()=>[o(m,{modelValue:l(u).store_name,"onUpdate:modelValue":e[1]||(e[1]=r=>l(u).store_name=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",readonly:!1},null,8,["modelValue"])]),_:1}),o(t,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:a(()=>[o(m,{modelValue:l(u).bar_code,"onUpdate:modelValue":e[2]||(e[2]=r=>l(u).bar_code=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801",readonly:!1},null,8,["modelValue"])]),_:1}),o(t,{label:"\u5546\u54C1\u5206\u7C7B",prop:"cate_id"},{default:a(()=>[o(m,{modelValue:l(u).cate_id,"onUpdate:modelValue":e[3]||(e[3]=r=>l(u).cate_id=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u5206\u7C7B",readonly:!1},null,8,["modelValue"])]),_:1}),o(t,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price"},{default:a(()=>[o(m,{modelValue:l(u).price,"onUpdate:modelValue":e[4]||(e[4]=r=>l(u).price=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u4EF7\u683C",readonly:!1},null,8,["modelValue"])]),_:1}),o(t,{label:"\u5546\u54C1\u5355\u4F4D",prop:"unit"},{default:a(()=>[o(m,{modelValue:l(u).unit,"onUpdate:modelValue":e[5]||(e[5]=r=>l(u).unit=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u5355\u4F4D",readonly:!1},null,8,["modelValue"])]),_:1}),o(t,{label:"\u5E93\u5B58",prop:"stock"},{default:a(()=>[o(m,{modelValue:l(u).stock,"onUpdate:modelValue":e[6]||(e[6]=r=>l(u).stock=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5E93\u5B58",readonly:!1},null,8,["modelValue"])]),_:1}),o(t,{label:"\u6210\u672C\u4EF7",prop:"cost"},{default:a(()=>[o(m,{modelValue:l(u).cost,"onUpdate:modelValue":e[7]||(e[7]=r=>l(u).cost=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6210\u672C\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),o(t,{label:"\u91C7\u8D2D\u4EF7",prop:"purchase"},{default:a(()=>[o(m,{modelValue:l(u).purchase,"onUpdate:modelValue":e[8]||(e[8]=r=>l(u).purchase=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),o(t,{label:"\u4E0A\u6D6E\u6BD4\u4F8B",prop:"rose"},{default:a(()=>[o(m,{modelValue:l(u).rose,"onUpdate:modelValue":e[9]||(e[9]=r=>l(u).rose=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4E0A\u6D6E\u6BD4\u4F8B",readonly:!1},null,8,["modelValue"])]),_:1}),o(t,{label:""},{default:a(()=>[o(V,{onClick:C,type:"primary",class:"w-40"},{default:a(()=>[j("\u63D0\u4EA4")]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})}}});export{he as default};