moreShopAdmin/build/admin/assets/edit.5034f985.js

2 lines
9.5 KiB
JavaScript
Raw Normal View History

2024-06-05 09:03:47 +08:00
import{a0 as W,G as X,H as Y,k as ee,D as ue,C as le,w as te,M as oe,b as ae,N as re,F as se,I as ie,L as de}from"./element-plus.1e96d4ee.js";import{a as pe,b as ne,c as me,_ as _e}from"./store_product.c1237077.js";import{_ as ce}from"./picker.eed5e871.js";import{q as fe}from"./index.8ad484bc.js";import{d as R,s as Fe,r as F,Z as S,i as be,ap as Ee,o as b,K as E,L as a,a as h,S as L,u as t,U as u,R as p,Q as w,M as ge,j as Ce}from"./@vue.18505fe0.js";import"./lodash.60201f64.js";import{a as Be,u as Ve}from"./vue-router.101084e3.js";import{a as ve}from"./store_category.94a3f372.js";import{a as De}from"./store_product_unit.0bd3f2b3.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.e14923a1.js";import"./system_store.4e5aabc8.js";import"./index.f7cd38f9.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./index.1d858e72.js";import"./index.a067caac.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"},we=h("div",{class:"w-full",style:{color:"#64748b"}},"\u53EF\u9009\u62E9\u5C06\u5546\u54C1\u540C\u6B65\u5230\u54EA\u4E9B\u95E8\u5E97\u4F7F\u7528",-1),he={class:"mb-2"},ke=R({name:"storeProductEdit"}),yu=R({...ke,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ue,{emit:qe}){const k=Fe(),{removeTab:x}=fe(),m=F("add"),l=S({id:"",image:"",store_name:"",bar_code:"",cate_arr:[],cate_id:"",price:"",unit:"",stock:"",cost:"",purchase:"",rose:"0",is_return:1,is_store_all:1}),f=F(!1),_=F([]),N=r=>{_.value=_.value.filter(e=>e.id!==r)},P=r=>{r.forEach(e=>{_.value.find(d=>d.id==e.id)||_.value.push(e)}),f.value=!1};let C,B,V=F(!1),v;be(()=>{});const z=r=>(v=r,V.value=!0,U.lazyLoad(B,C),!1),U={value:"id",label:"name",lazy:!0,lazyLoad(r,e){C||(C=e),B||(B=r);let d=r.value||0,s={};V.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(c=>(c.leaf=c.is_children==0,V.value=!1,c)))})}},q=F([]);(()=>{De({}).then(r=>{q.value=r.lists})})();const I=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"]}],cate_arr:[{required:!0,message:"\u8BF7\u9009\u62E9\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"]}]}),M=async r=>{for(const e in l)r[e]!=null&&r[e]!=null&&(l[e]=r[e]);l.cate_arr[0]&&(l.cate_arr=l.cate_arr.map(e=>Number(e)))},T=async r=>{const e=await pe({id:r.id});M(e)},$=Be()