moreShopAdmin/build/admin/assets/edit.14b7a615.js

2 lines
9.0 KiB
JavaScript
Raw Normal View History

2024-06-03 18:09:52 +08:00
import{a0 as W,G as X,H as Y,D as ee,C as ue,w as le,M as oe,b as te,N as ae,F as re,I as se,L as ie}from"./element-plus.1e96d4ee.js";import{a as de,b as pe,c as ne,_ as me}from"./store_product.5974de33.js";import{_ as _e}from"./picker.71241094.js";import{q as ce}from"./index.b0f5afd3.js";import{d as L,s as fe,r as F,Z as S,i as Fe,ap as be,o as b,K as E,L as r,a as w,S as A,u as o,U as u,R as c,Q as D,M as Ee,j as ge}from"./@vue.18505fe0.js";import"./lodash.60201f64.js";import{a as Ce,u as Be}from"./vue-router.101084e3.js";import{a as Ve}from"./store_category.318ca73c.js";import{a as ve}from"./store_product_unit.a637ff0a.js";import"./lodash-es.f52bd8b1.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.vue_vue_type_script_setup_true_lang.272adef5.js";import"./usePaging.6a6670f9.js";import"./useDictOptions.39c54f9f.js";import"./system_store.fa2b087c.js";import"./index.daae848a.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./index.66b5e065.js";import"./index.b9d3ac56.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 ye={class:"mb-4 text-lg font-bold"},De=w("div",{class:"w-full",style:{color:"#64748b"}},"\u53EF\u9009\u62E9\u5C06\u5546\u54C1\u540C\u6B65\u5230\u54EA\u4E9B\u95E8\u5E97\u4F7F\u7528",-1),we={class:"mb-2"},he=L({name:"storeProductEdit"}),yu=L({...he,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(ke,{emit:Ue}){const h=fe(),{removeTab:R}=ce(),n=F("add"),l=S({id:"",image:"",store_name:"",bar_code:"",cate_arr:[],cate_id:"",price:"",unit:"",stock:"",cost:"",purchase:"",rose:"0",is_store_all:1}),f=F(!1),m=F([]),x=a=>{m.value=m.value.filter(e=>e.id!==a)},P=a=>{a.forEach(e=>{m.value.find(d=>d.id==e.id)||m.value.push(e)}),f.value=!1};let g,C,B=F(!1),V;Fe(()=>{});const N=a=>(V=a,B.value=!0,k.lazyLoad(C,g),!1),k={value:"id",label:"name",emitPath:!1,lazy:!0,checkStrictly:!0,lazyLoad(a,e){g||(g=e),C||(C=a);let d=a.value||0,s={};B.value?(s={name:V},V||(s={pid:d,page_size:1e4})):s={pid:d,page_size:1e4},Ve({...s}).then(i=>{e(i.lists.map(_=>(_.leaf=_.is_children==0,B.value=!1,_)))})}},U=F([]);(()=>{ve({}).then(a=>{U.value=a.lists})})();const z=S({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 a=>{for(const e in l)a[e]!=null&&a[e]!=null&&(l[e]=a[e]);l.cate_arr[0]&&(l.cate_arr=l.cate_arr.map(e=>Number(e)))},T=async a=>{const e=await de({id:a.id});I(e)},M=Ce(),v=Be(),$=async()=>{var e;await((e=h.value)==null?void 0:e.validate());let a={...l};l.is_store_