ERP-admin/build/admin/assets/bindGoods.0fec830a.js

2 lines
7.2 KiB
JavaScript

import{C as H,D as J,w as I,F as W,T as N,O as R,b as S,Q as T,R as q,G as X}from"./element-plus.8c800afc.js";import{_ as O}from"./index.vue_vue_type_script_setup_true_lang.7b224fce.js";import{u as K}from"./usePaging.6a6670f9.js";import{u as M}from"./useDictOptions.080d297e.js";import{a as Y,b as oo}from"./goods.a5b72a03.js";import{d as E,r as w,Z as Q,o as h,c as Z,U as o,L as l,u as t,R as b,M as U,K as L,a as g,j as $,ap as eo}from"./@vue.18505fe0.js";import{b as lo}from"./index.2398c167.js";import{a as to}from"./merchant.ef5e36f5.js";import{u as ao}from"./vue-router.886c5f5a.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.ef95d8c0.js";import"./axios.77245e3c.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.be6e4bb5.js";import"./pinia.a969beab.js";import"./css-color-function.6061d63f.js";import"./color.1580a89c.js";import"./clone.4ed29f58.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.b29ee5e2.js";import"./vue-clipboard3.15c43b43.js";import"./clipboard.4a3580c9.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";const uo={class:"mt-4"},no={class:"flex mt-4 justify-end"},so={class:"flex mt-4 justify-end"},io=E({name:"goodsLists"}),ro=E({...io,props:{mer_id:Number},emits:["offPop"],setup(j,{emit:y}){let m=j;w(!1),w(!1);const C=y,r=Q({name:"",class:"",brand:"",unit:"",code:"",warehouse:"",retail_name:"",sort:""}),v=w([]),V=_=>{v.value=_.map(({id:a})=>a)};M("");const{pager:n,getLists:d,resetParams:A,resetPage:G}=K({fetchFun:Y,params:r}),F=async()=>{let _=n.lists.filter(e=>v.value.includes(e.id)),a={mer_id:m.mer_id,bind_data:[]};_.forEach(e=>{a.bind_data.push({goods_id:e.id,nums:e.num})}),await oo(a),C("offPop")},s=()=>{C("offPop")};return d(),(_,a)=>{const e=H,c=J,f=I,B=W,D=N,u=R,x=S,P=T,k=O,p=q;return h(),Z("div",null,[o(D,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[o(B,{class:"mb-[-16px]",model:t(r),inline:""},{default:l(()=>[o(c,{label:"\u5546\u54C1\u540D\u79F0",prop:"name"},{default:l(()=>[o(e,{class:"w-[280px]",modelValue:t(r).name,"onUpdate:modelValue":a[0]||(a[0]=i=>t(r).name=i),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(c,{label:"\u5546\u54C1\u54C1\u724C",prop:"brand"},{default:l(()=>[o(e,{class:"w-[280px]",modelValue:t(r).brand,"onUpdate:modelValue":a[1]||(a[1]=i=>t(r).brand=i),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u54C1\u724C"},null,8,["modelValue"])]),_:1}),o(c,{label:"\u5546\u54C1\u5355\u4F4D",prop:"unit"},{default:l(()=>[o(e,{class:"w-[280px]",modelValue:t(r).unit,"onUpdate:modelValue":a[2]||(a[2]=i=>t(r).unit=i),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u5355\u4F4D"},null,8,["modelValue"])]),_:1}),o(c,null,{default:l(()=>[o(f,{type:"primary",onClick:t(G)},{default:l(()=>[b("\u67E5\u8BE2")]),_:1},8,["onClick"]),o(f,{onClick:t(A)},{default:l(()=>[b("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),U((h(),L(D,{class:"!border-none",shadow:"never"},{default:l(()=>[g("div",uo,[o(P,{data:t(n).lists,onSelectionChange:V},{default:l(()=>[o(u,{type:"selection",width:"55"}),o(u,{label:"ID",prop:"id",width:"55"}),o(u,{label:"\u5546\u54C1\u56FE\u7247",prop:"imgs"},{default:l(({row:i})=>[o(x,{style:{width:"50px",height:"50px"},src:i.imgs},null,8,["src"])]),_:1}),o(u,{label:"\u5546\u54C1\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),o(u,{label:"\u89C4\u683C\u578B\u53F7",prop:"spec","show-overflow-tooltip":""}),o(u,{label:"\u5546\u54C1\u5206\u7C7B",prop:"class_name","show-overflow-tooltip":""}),o(u,{label:"\u5546\u54C1\u54C1\u724C",prop:"brand_name","show-overflow-tooltip":""}),o(u,{label:"\u5546\u54C1\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),o(u,{label:"\u8D2D\u8D27\u4EF7\u683C",prop:"buy","show-overflow-tooltip":""}),o(u,{label:"\u9500\u8D27\u4EF7\u683C",prop:"sell","show-overflow-tooltip":""}),o(u,{label:"\u96F6\u552E\u4EF7\u683C",prop:"retail","show-overflow-tooltip":""}),o(u,{label:"\u6807\u7B7E",prop:"sys_labels_text","show-overflow-tooltip":""}),o(u,{label:"\u6570\u91CF",prop:"num",width:"170"},{default:l(({row:i})=>[o(e,{type:"number",modelValue:i.num,"onUpdate:modelValue":z=>i.num=z,clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6570\u91CF"},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])]),g("div",no,[o(k,{modelValue:t(n),"onUpdate:modelValue":a[3]||(a[3]=i=>$(n)?n.value=i:null),onChange:t(d)},null,8,["modelValue","onChange"])]),g("div",so,[o(f,{type:"primary",onClick:F},{default:l(()=>[b("\u786E\u8BA4\u7ED1\u5B9A")]),_:1}),o(f,{onClick:s},{default:l(()=>[b("\u53D6\u6D88")]),_:1})])]),_:1})),[[p,t(n).loading]])])}}}),po={class:"mt-4"},mo={class:"flex mt-4 justify-end"},_o=E({name:"merchantLists"}),Jo=E({..._o,setup(j){const y=ao(),m=w(!1);let C=y.query.mer_id;const r=Q({mer_id:C}),v=w([]),V=F=>{v.value=F.map(({mer_id:s})=>s)};M("mer_category_type,merchat_type,show_status,off_status,financial_type");const{pager:n,getLists:d,resetParams:A,resetPage:G}=K({fetchFun:to,params:r});return d(),(F,s)=>{const _=lo,a=I,e=R,c=S,f=T,B=O,D=N,u=ro,x=X,P=eo("perms"),k=q;return h(),Z("div",null,[U((h(),L(D,{class:"!border-none",shadow:"never"},{default:l(()=>[U((h(),L(a,{type:"primary",onClick:s[0]||(s[0]=p=>m.value=!0)},{icon:l(()=>[o(_,{name:"el-icon-Plus"})]),default:l(()=>[b(" \u5546\u54C1\u7ED1\u5B9A ")]),_:1})),[[P,["merchat.merchant/add"]]]),g("div",po,[o(f,{data:t(n).lists,onSelectionChange:V},{default:l(()=>[o(e,{type:"selection",width:"55"}),o(e,{label:"\u5546\u54C1\u56FE\u7247",prop:"imgs"},{default:l(({row:p})=>[o(c,{style:{width:"50px",height:"50px"},src:p.goods_info.imgs},null,8,["src"])]),_:1}),o(e,{label:"\u5546\u54C1\u540D\u79F0",prop:"goods_info.name","show-overflow-tooltip":""}),o(e,{label:"\u89C4\u683C\u578B\u53F7",prop:"goods_info.spec","show-overflow-tooltip":""}),o(e,{label:"\u5546\u54C1\u5206\u7C7B",prop:"goods_info.class_name","show-overflow-tooltip":""}),o(e,{label:"\u5546\u54C1\u54C1\u724C",prop:"goods_info.brand_name","show-overflow-tooltip":""}),o(e,{label:"\u5546\u54C1\u5355\u4F4D",prop:"goods_info.unit_name","show-overflow-tooltip":""}),o(e,{label:"\u8D2D\u8D27\u4EF7\u683C",prop:"goods_info.buy","show-overflow-tooltip":""}),o(e,{label:"\u9500\u8D27\u4EF7\u683C",prop:"goods_info.sell","show-overflow-tooltip":""}),o(e,{label:"\u96F6\u552E\u4EF7\u683C",prop:"goods_info.retail","show-overflow-tooltip":""}),o(e,{label:"\u6807\u7B7E",prop:"goods_info.sys_labels_text","show-overflow-tooltip":""}),o(e,{label:"\u6570\u91CF",prop:"nums",width:"170"})]),_:1},8,["data"])]),g("div",mo,[o(B,{modelValue:t(n),"onUpdate:modelValue":s[1]||(s[1]=p=>$(n)?n.value=p:null),onChange:t(d)},null,8,["modelValue","onChange"])])]),_:1})),[[k,t(n).loading]]),o(x,{modelValue:t(m),"onUpdate:modelValue":s[3]||(s[3]=p=>$(m)?m.value=p:null),title:"\u7ED1\u5B9A\u5546\u54C1",width:"70%"},{default:l(()=>[o(u,{onOffPop:s[2]||(s[2]=p=>(m.value=!1,t(d)())),mer_id:t(C)},null,8,["mer_id"])]),_:1},8,["modelValue"])])}}});export{Jo as default};