moreShopAdmin/build/admin/assets/edit11.3304e42f.js

4 lines
14 KiB
JavaScript
Raw Normal View History

2024-08-25 14:00:20 +08:00
import{G as ce,H as fe,a6 as be,x as Fe,y as Ee,k as Ce,D as Ve,C as ye,w as we,J as ge,K as Be,M as ve,N as De,b as he,F as ke,I as Ue,L as xe}from"./element-plus.4a7d92a3.js";import{_ as Ae}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.a130c88e.js";import{_ as Re}from"./picker.b29ccc60.js";import{k as Le}from"./index.e2348f6b.js";import{b as qe}from"./store_product.8be38f0f.js";import{d as G,s as Se,r as F,Z as $,i as Te,ap as ze,o as i,K as c,L as a,a as h,S as T,u as t,U as e,j as O,R as p,c as D,T as z,Q as V,a9 as j,M as Ie}from"./@vue.18505fe0.js";import"./lodash.9dc701ad.js";import{a as Ne,u as Me}from"./vue-router.101084e3.js";import{a as Pe}from"./store_category.68323416.js";import{a as $e}from"./store_product_unit.1209b8a7.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.7347fedc.js";import"./axios.4607972f.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import"./usePaging.6a6670f9.js";import"./useDictOptions.c2e674dc.js";import"./system_store.f26016bb.js";import"./index.08cec107.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./index.ba4db380.js";import"./index.79b9c6fb.js";import"./vuedraggable.1648e3a8.js";import"./vue.393dceb0.js";import"./sortablejs.382fadba.js";import"./pinia.a969beab.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.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.0d2736b7.js";import"./vue-clipboard3.7d5a7a5d.js";import"./clipboard.860a1cea.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";const Oe={class:"mb-4 text-lg font-bold"},je={key:1},Ge=h("div",{class:"w-full",style:{color:"#64748b"}}," \u53EF\u9009\u62E9\u5C06\u5546\u54C1\u540C\u6B65\u5230\u54EA\u4E9B\u95E8\u5E97\u4F7F\u7528 ",-1),Ke={class:"mb-2"},Ze=G({name:"storeProductEdit"}),ju=G({...Ze,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(He,{emit:Je}){const I=Se(),k=F("info");Le();const E=F("add"),K=(s,u)=>{console.log(s,u)},g=F([]),d=F([]),Z=F([{label:"\u89C4\u683C\u540D\u79F0",prop:"sku_name",width:"180"},{label:"\u4F9B\u8D27\u4EF7",prop:"purchase",width:"180"},{label:"\u5546\u6237\u4EF7",prop:"cost",width:"180"},{label:"\u96F6\u552E\u4EF7",prop:"price",width:"180"}]),H=()=>{g.value.push({sku_name:"",purchase:0,cost:0,price:0,editable:!0})},J=s=>{g.value.splice(s,1)},o=$({id:"",image:"",store_name:"",bar_code:"",store_info:"",product_type:0,cate_arr:[],cate_id:"",price:"",vip_price:"",unit:"",stock:"",swap:"",cost:"",purchase:"",batch:1,store_batch:1,manufacturer_information:"",rose:"0",is_return:1,is_store_all:1,spec_type:0}),Q=()=>{const u=o.bar_code.replace(/[^a-zA-Z0-9]/g,"");o.bar_code=u},y=F(!1),C=F([]),W=s=>{C.value=C.value.filter(u=>u.id!==s)},X=s=>{s.forEach(u=>{C.value.find(f=>f.id==u.id)||C.value.push(u)}),y.value=!1};let U,x;const A=F(!1);let R;Te(()=>{});const Y=s=>(R=s,A.value=!0,N.lazyLoad(x,U),!1),N={value:"id",label:"name",lazy:!0,lazyLoad(s,u){U||(U=u),x||(x=s);const f=s.value||0;let r={};A.value?(r={name:R},R||(r={pid:f,page_size:1e4})):r={pid:f,page_size:1e4},Pe({...r}).then(m=>{u(m.lists.map(n=>(n.leaf=n.is_children==0,A.value=!1,n)))})}},L=F([]);(()=>{$e({}).then(s=>{L.value=s.lists})})();const ee=$({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"]}],store_info:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u89C4\u683C",trigger:["blur"]}],cate_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u5206\u7C7B",trigger:["blur","change"]}],cate_ar
\u8054\u7CFB\u4EBA\u59D3\u540D
\u8054\u7CFB\u7535\u8BDD`,readonly:!1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u9000\u8D27",prop:"is_return"},{default:a(()=>[e(B,{modelValue:t(o).is_return,"onUpdate:modelValue":u[6]||(u[6]=l=>t(o).is_return=l)},{default:a(()=>[e(n,{label:1},{default:a(()=>[p("\u652F\u6301")]),_:1}),e(n,{label:0},{default:a(()=>[p("\u4E0D\u652F\u6301")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(S,{label:"\u5546\u54C1\u89C4\u683C",name:"spec"},{default:a(()=>[e(r,{label:"\u89C4\u683C\u7C7B\u578B"},{default:a(()=>[e(B,{modelValue:t(o).spec_type,"onUpdate:modelValue":u[7]||(u[7]=l=>t(o).spec_type=l)},{default:a(()=>[e(n,{label:0},{default:a(()=>[p("\u7EDF\u4E00\u89C4\u683C")]),_:1}),e(n,{label:1},{default:a(()=>[p("\u591A\u89C4\u683C")]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(o).spec_type==0?(i(),D(z,{key:0},[e(r,{label:"\u89C4\u683C\u540D\u79F0",prop:"sku_name"},{default:a(()=>[e(m,{modelValue:t(d).sku_name,"onUpdate:modelValue":u[8]||(u[8]=l=>t(d).sku_name=l),class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89C4\u683C\u540D\u79F0",readonly:!1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u5546\u54C1\u5355\u4F4D",prop:"unit"},{default:a(()=>[e(M,{class:"w-[500px]",modelValue:t(d).unit,"onUpdate:modelValue":u[9]||(u[9]=l=>t(d).unit=l),options:t(L),props:{value:"id",label:"name",emitPath:!1},placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5355\u4F4D"},null,8,["modelValue","options"])]),_:1}),e(r,{label:"\u4F9B\u8D27\u4EF7",prop:"purchase"},{default:a(()=>[e(m,{modelValue:t(d).purchase,"onUpdate:modelValue":u[10]||(u[10]=l=>t(d).purchase=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4F9B\u8D27\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u5546\u6237\u4EF7",prop:"cost"},{default:a(()=>[e(m,{modelValue:t(d).cost,"onUpdate:modelValue":u[11]||(u[11]=l=>t(d).cost=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u6237\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u4F1A\u5458\u4EF7",prop:"vip_price"},{default:a(()=>[e(m,{modelValue:t(d).vip_price,"onUpdate:modelValue":u[12]||(u[12]=l=>t(d).vip_price=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4F1A\u5458\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u7EC8\u7AEF\u96F6\u552E\u4EF7",prop:"price"},{default:a(()=>[e(m,{modelValue:t(d).price,"onUpdate:modelValue":u[13]||(u[13]=l=>t(d).price=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7EC8\u7AEF\u96F6\u552E\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u96F6\u552E\u8D77\u6279\u91CF",prop:"batch"},{default:a(()=>[e(m,{modelValue:t(d).batch,"onUpdate:modelValue":u[14]||(u[14]=l=>t(d).batch=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u96F6\u552E\u8D77\u6279\u91CF",readonly:!1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u95E8\u5E97\u8D77\u6279\u91CF",prop:"store_batch"},{default:a(()=>[e(m,{modelValue:t(d).store_batch,"onUpdate:modelValue":u[15]||(u[15]=l=>t(d).store_batch=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u8D77\u6279\u91CF",readonly:!1},null,8,["modelValue"])]),_:1})],64)):V("",!0),t(o).spec_type==1?(i(),c(r,{key:1},{default:a(()=>[e(w,{onClick:H,class:"mb-2"},{default:a(()=>[p("\u6DFB\u52A0\u89C4\u683C")]),_:1}),e(P,{data:t(g),style:{width:"100%"}},{default:a(()=>[e(_,{label:"\u5355\u4F4D",width:"180"},{default:a(l=>[l.row.editable?(i(),c(oe,{key:0,modelValue:l.row.unit,"onUpdate:modelValue":b=>l.row.unit=b,placeholder:"\u8BF7\u9009\u62E9\u5355\u4F4D"},{default:a(()=>[(i(!0),D(z,null,j(t(L),b=>(i(),c(te,{key:b.id,label:b.name,value:b.id},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):V("",!0)]),_:1}),(i(!0),D(z,null,j(t(Z),(l,b)=>(i(),c(_,{key:b,prop:l.prop,label:l.label,width:l.width},{default:a(v=>[v.row.editable?(i(),c(m,{key:0,modelValue:v.row[l.prop],"onUpdate:modelValue":_e=>v.row[l.prop]=_e},null,8,["modelValue","onUpdate:modelValue"])):(i(),D("span",je,T(v.row[l.prop]),1))]),_:2}