2025-01-06 10:21:22 +08:00
|
|
|
import{P as fe,Q as be,M as Fe,x as ce,y as Ee,k as Ce,D as Ve,C as ye,w as we,N as ve,O as Be,G as ge,H as De,b as ke,F as Ue,L as xe,K as Ae}from"./element-plus.352c7be0.js";import{_ as Re}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.1e8bf5cd.js";import{_ as Se}from"./picker.50399696.js";import{k as Le}from"./index.323fb8c0.js";import{b as qe,d as Pe,e as Te}from"./store_product.7132027e.js";import{d as G,s as he,r as f,Z as I,i as Ne,ap as ze,o as i,K as b,L as t,a as k,S as T,u as a,U as u,j as O,R as p,c as U,T as h,Q as V,a9 as j,M as Me}from"./@vue.76ce7aa3.js";import"./lodash.41b9567d.js";import{a as $e,u as Ie}from"./vue-router.10bd5b90.js";import{a as Oe}from"./store_category.3e8de623.js";import{a as je}from"./store_product_unit.bdee657f.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.567dc22a.js";import"./usePaging.f8c888e4.js";import"./useDictOptions.3226a4b7.js";import"./system_store.f15e5fac.js";import"./index.2a0d2494.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.cf0d972e.js";import"./index.32e5c0c2.js";import"./index.252f9259.js";import"./vuedraggable.1d6c5910.js";import"./vue.6c4d4a7c.js";import"./sortablejs.a0474a26.js";import"./axios.b4cbdbc9.js";import"./jspdf.75308076.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.js";import"./css-color-function.f23177ae.js";import"./color.a6ad6672.js";import"./clone.954ba32c.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.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";const Ge={class:"mb-4 text-lg font-bold"},Ke={key:1},Qe={class:"mb-2"},He=G({name:"storeProductEdit"}),Hu=G({...He,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ze,{emit:Je}){const N=he(),x=f("info");Le();const E=f("add"),K=(o,e)=>{console.log(o,e)},v=f([]),d=f([]),Q=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"},{label:"\u6761\u7801",prop:"bar_code",width:"180"}]),H=()=>{v.value.push({sku_name:"",purchase:0,cost:0,price:0,bar_code:"",editable:!0})},Z=o=>{v.value.splice(o,1)},s=I({id:"",image:"",store_name:"",store_info:"",product_type:0,cate_arr:[],cate_id:"",swap:"",batch:1,store_batch:1,manufacturer_information:"",rose:"0",is_return:1,is_store_all:1,spec_type:0}),y=f(!1),C=f([]),J=o=>{C.value=C.value.filter(e=>e.id!==o)},W=o=>{o.forEach(e=>{C.value.find(F=>F.id==e.id)||C.value.push(e)}),y.value=!1};let A,R;const S=f(!1);let L;Ne(()=>{});const X=o=>(L=o,S.value=!0,z.lazyLoad(R,A),!1),z={value:"id",label:"name",lazy:!0,lazyLoad(o,e){A||(A=e),R||(R=o);const F=o.value||0;let r={};S.value?(r={name:L},L||(r={pid:F,page_size:1e4})):r={pid:F,page_size:1e4},Oe({...r}).then(m=>{e(m.lists.map(n=>(n.leaf=n.is_children==0,S.value=!1,n)))})}},q=f([]);(()=>{je({}).then(o=>{q.value=o.lists})})();const Y=I({store_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",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_arr:[{required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",trigger:["blur","change"]}],image:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u56FE\u7247",trigger:["blur","change"]}]}),ee=async o=>{for(const
|
|
|
|
\u8054\u7CFB\u7535\u8BDD`,readonly:!1},null,8,["modelValue"])]),_:1}),u(r,{label:"\u9000\u8D27",prop:"is_return"},{default:t(()=>[u(g,{modelValue:a(s).is_return,"onUpdate:modelValue":e[5]||(e[5]=l=>a(s).is_return=l)},{default:t(()=>[u(n,{label:1},{default:t(()=>e[23]||(e[23]=[p("\u652F\u6301")])),_:1}),u(n,{label:0},{default:t(()=>e[24]||(e[24]=[p("\u4E0D\u652F\u6301")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),u(P,{label:"\u5546\u54C1\u89C4\u683C",name:"spec"},{default:t(()=>[u(r,{label:"\u89C4\u683C\u7C7B\u578B"},{default:t(()=>[u(g,{modelValue:a(s).spec_type,"onUpdate:modelValue":e[6]||(e[6]=l=>a(s).spec_type=l)},{default:t(()=>[u(n,{label:0},{default:t(()=>e[25]||(e[25]=[p("\u5355\u89C4\u683C")])),_:1}),u(n,{label:1},{default:t(()=>e[26]||(e[26]=[p("\u591A\u89C4\u683C")])),_:1})]),_:1},8,["modelValue"])]),_:1}),a(s).spec_type==0?(i(),U(h,{key:0},[u(r,{label:"\u89C4\u683C\u540D\u79F0",prop:"sku_name"},{default:t(()=>[u(m,{modelValue:a(d).sku_name,"onUpdate:modelValue":e[7]||(e[7]=l=>a(d).sku_name=l),class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89C4\u683C\u540D\u79F0",readonly:!1},null,8,["modelValue"])]),_:1}),u(r,{label:"\u5546\u54C1\u5355\u4F4D",prop:"unit"},{default:t(()=>[u(M,{class:"w-[500px]",modelValue:a(d).unit,"onUpdate:modelValue":e[8]||(e[8]=l=>a(d).unit=l),options:a(q),props:{value:"id",label:"name",emitPath:!1},placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5355\u4F4D"},null,8,["modelValue","options"])]),_:1}),u(r,{label:"\u4F9B\u8D27\u4EF7",prop:"purchase"},{default:t(()=>[u(m,{modelValue:a(d).purchase,"onUpdate:modelValue":e[9]||(e[9]=l=>a(d).purchase=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4F9B\u8D27\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),u(r,{label:"\u5546\u6237\u4EF7",prop:"cost"},{default:t(()=>[u(m,{modelValue:a(d).cost,"onUpdate:modelValue":e[10]||(e[10]=l=>a(d).cost=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u6237\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),u(r,{label:"\u4F1A\u5458\u4EF7",prop:"vip_price"},{default:t(()=>[u(m,{modelValue:a(d).vip_price,"onUpdate:modelValue":e[11]||(e[11]=l=>a(d).vip_price=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4F1A\u5458\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),u(r,{label:"\u7EC8\u7AEF\u96F6\u552E\u4EF7",prop:"price"},{default:t(()=>[u(m,{modelValue:a(d).price,"onUpdate:modelValue":e[12]||(e[12]=l=>a(d).price=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7EC8\u7AEF\u96F6\u552E\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),u(r,{label:"\u96F6\u552E\u8D77\u6279\u91CF",prop:"batch"},{default:t(()=>[u(m,{modelValue:a(d).batch,"onUpdate:modelValue":e[13]||(e[13]=l=>a(d).batch=l),type:"number",class:"w-[500px]",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u96F6\u552E\u8D77\u6279\u91CF",readonly:!1},null,8,["modelValue"])]),_:1}),u(r,{label:"\u95E8\u5E97\u8D77\u6279\u91CF",prop:"store_batch"},{default:t(()=>[u(m,{modelValue:a(d).store_batch,"onUpdate:modelValue":e[14]||(e[14]=l=>a(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),a(s).spec_type==1?(i(),b(r,{key:1},{default:t(()=>[u(w,{onClick:H,class:"mb-2"},{default:t(()=>e[27]||(e[27]=[p("\u6DFB\u52A0\u89C4\u683C")])),_:1}),u($,{data:a(v),style:{width:"100%"}},{default:t(()=>[u(_,{label:"\u5355\u4F4D",width:"180"},{default:t(l=>[l.row.editable?(i(),b(oe,{key:0,modelValue:l.row.unit,"onUpdate:modelValue":c=>l.row.unit=c,placeholder:"\u8BF7\u9009\u62E9\u5355\u4F4D"},{default:t(()=>[(i(!0),U(h,null,j(a(q),c=>(i(),b(ae,{key:c.id,label:c.name,value:c.id},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):V("",!0)]),_:1}),(i(!0),U(h,null,j(a(Q),(l,c)=>(i(),b(_,{key:c,prop:l.prop,label:l.label,width:l.width},{default:t(D=>[D.row.editable?(i(),b(m,{key:0,modelValue:D.row[l.prop],"onUpdate:modelValue":_e=>D.row[l.prop]=_e},null,8,["modelValue","o
|