2024-09-02 16:03:23 +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 ve,K as Be,M as ge,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.1f0dd6ce.js";import{_ as Re}from"./picker.f82396e9.js";import{k as Se}from"./index.e5adcc1a.js";import{c as Le,d as qe,e as Te}from"./store_product.6593151e.js";import{d as G,s as Ne,r as c,Z as $,i as Pe,ap as ze,o as i,K as f,L as a,a as k,S as T,u as t,U as e,j as O,R as p,c as h,T as N,Q as V,a9 as j,M as Ie}from"./@vue.18505fe0.js";import"./lodash.9dc701ad.js";import{a as Me,u as $e}from"./vue-router.101084e3.js";import{a as Oe}from"./store_category.091ef262.js";import{a as je}from"./store_product_unit.53fbfa90.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.9bf2b6e5.js";import"./system_store.03c6e4f4.js";import"./index.010b215f.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./index.e6d2efc6.js";import"./index.bd0e91a8.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 Ge={class:"mb-4 text-lg font-bold"},Ke={key:1},He=k("div",{class:"w-full",style:{color:"#64748b"}}," \u53EF\u9009\u62E9\u5C06\u5546\u54C1\u540C\u6B65\u5230\u54EA\u4E9B\u95E8\u5E97\u4F7F\u7528 ",-1),Je={class:"mb-2"},Qe=G({name:"storeProductEdit"}),Ku=G({...Qe,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ze,{emit:We}){const P=Ne(),U=c("info");Se();const E=c("add"),K=(o,u)=>{console.log(o,u)},v=c([]),d=c([]),H=c([{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"}]),J=()=>{v.value.push({sku_name:"",purchase:0,cost:0,price:0,bar_code:"",editable:!0})},Q=o=>{v.value.splice(o,1)},s=$({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=c(!1),C=c([]),Z=o=>{C.value=C.value.filter(u=>u.id!==o)},W=o=>{o.forEach(u=>{C.value.find(b=>b.id==u.id)||C.value.push(u)}),y.value=!1};let x,A;const R=c(!1);let S;Pe(()=>{});const X=o=>(S=o,R.value=!0,z.lazyLoad(A,x),!1),z={value:"id",label:"name",lazy:!0,lazyLoad(o,u){x||(x=u),A||(A=o);const b=o.value||0;let r={};R.value?(r={name:S},S||(r={pid:b,page_size:1e4})):r={pid:b,page_size:1e4},Oe({...r}).then(m=>{u(m.lists.map(n=>(n.leaf=n.is_children==0,R.value=!1,n)))})}},L=c([]);(()=>{je({}).then(o=>{L.value=o.lists})})();const Y=$({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
|
|
|
|
\u8054\u7CFB\u7535\u8BDD`,readonly:!1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u9000\u8D27",prop:"is_return"},{default:a(()=>[e(g,{modelValue:t(s).is_return,"onUpdate:modelValue":u[5]||(u[5]=l=>t(s).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(q,{label:"\u5546\u54C1\u89C4\u683C",name:"spec"},{default:a(()=>[e(r,{label:"\u89C4\u683C\u7C7B\u578B"},{default:a(()=>[e(g,{modelValue:t(s).spec_type,"onUpdate:modelValue":u[6]||(u[6]=l=>t(s).spec_type=l)},{default:a(()=>[e(n,{label:0},{default:a(()=>[p("\u5355\u89C4\u683C")]),_:1}),e(n,{label:1},{default:a(()=>[p("\u591A\u89C4\u683C")]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(s).spec_type==0?(i(),h(N,{key:0},[e(r,{label:"\u89C4\u683C\u540D\u79F0",prop:"sku_name"},{default:a(()=>[e(m,{modelValue:t(d).sku_name,"onUpdate:modelValue":u[7]||(u[7]=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(I,{class:"w-[500px]",modelValue:t(d).unit,"onUpdate:modelValue":u[8]||(u[8]=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[9]||(u[9]=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[10]||(u[10]=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[11]||(u[11]=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[12]||(u[12]=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[13]||(u[13]=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[14]||(u[14]=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(s).spec_type==1?(i(),f(r,{key:1},{default:a(()=>[e(w,{onClick:J,class:"mb-2"},{default:a(()=>[p("\u6DFB\u52A0\u89C4\u683C")]),_:1}),e(M,{data:t(v),style:{width:"100%"}},{default:a(()=>[e(_,{label:"\u5355\u4F4D",width:"180"},{default:a(l=>[l.row.editable?(i(),f(oe,{key:0,modelValue:l.row.unit,"onUpdate:modelValue":F=>l.row.unit=F,placeholder:"\u8BF7\u9009\u62E9\u5355\u4F4D"},{default:a(()=>[(i(!0),h(N,null,j(t(L),F=>(i(),f(te,{key:F.id,label:F.name,value:F.id},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):V("",!0)]),_:1}),(i(!0),h(N,null,j(t(H),(l,F)=>(i(),f(_,{key:F,prop:l.prop,label:l.label,width:l.width},{default:a(D=>[D.row.editable?(i(),f(m,{key:0,modelValue:D.row[l.prop],"onUpdate:modelValue":_e=>D.row[l.prop]=_e},null,8,["modelValue","onUpdate:modelValue"])):(i(),h("span",Ke,T(D.row[l.prop]),1))]),_:2},1032,["
|