moreShopAdmin/build/admin/assets/add.958a1905.js

2 lines
9.3 KiB
JavaScript

import{k as Z,C as $,D as R,w as I,F as M,M as O,b as T,N as K,O as Q,G as W,H as X,U as ee,J as le,K as te,I as oe,L as ae}from"./element-plus.4a7d92a3.js";import{_ as ue}from"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import{d as D,Z as N,r as v,o as w,c as S,U as e,L as o,u as a,aa as ne,R as i,M as re,a as F,j as Y,s as se,K as P,T as de,a9 as ie}from"./@vue.18505fe0.js";import{u as pe}from"./usePaging.6a6670f9.js";import{u as me}from"./useDictOptions.b027b472.js";import{a as _e}from"./store_product.f1012f05.js";import{a as ce}from"./vue-router.101084e3.js";import{a as fe}from"./beforehand_order.8d40cf80.js";import{a as he}from"./system_store.c7d57ffd.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.9fc4c153.js";import"./lodash.9dc701ad.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 be={class:"mt-4"},Ve={class:"flex mt-4 justify-end"},Ce=D({name:"systemStoreLists"}),Ee=D({...Ce,emits:["onBindStore"],setup(j,{emit:L}){const V=N({store_name:"",is_warehouse:1}),u=v([]);v();const b=n=>{u.value=n.map(({id:l})=>l)};me("");const _=()=>{C()},{pager:f,getLists:C,resetParams:g,resetPage:B}=pe({fetchFun:_e,params:V});C();const k=L,y=()=>{const n=f.lists.filter(l=>u.value.includes(l.id));if(!n.length)return Z.error("\u8BF7\u5148\u9009\u62E9\u5546\u54C1");k("onBindStore",n)};return(n,l)=>{const r=$,s=R,c=I,x=M,p=O,U=T,A=K,E=ue,d=Q;return w(),S("div",null,[e(x,{class:"mb-[-16px]",model:a(V),inline:""},{default:o(()=>[e(s,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:o(()=>[e(r,{class:"w-[200px]",modelValue:a(V).store_name,"onUpdate:modelValue":l[0]||(l[0]=h=>a(V).store_name=h),onKeydown:l[1]||(l[1]=ne(h=>_(),["enter"])),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(s,null,{default:o(()=>[e(c,{type:"primary",onClick:a(B)},{default:o(()=>[i("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(c,{onClick:a(g)},{default:o(()=>[i("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),re((w(),S("div",be,[e(A,{data:a(f).lists,onSelectionChange:b,height:300},{default:o(()=>[e(p,{type:"selection",width:"55"}),e(p,{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),e(p,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:o(({row:h})=>[e(U,{style:{width:"50px",height:"50px"},src:h.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(p,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),e(p,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),e(p,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),e(p,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""}),e(p,{label:"\u4ED3\u5E93\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""})]),_:1},8,["data"])])),[[d,a(f).loading]]),F("div",Ve,[e(E,{modelValue:a(f),"onUpdate:modelValue":l[2]||(l[2]=h=>Y(f)?f.value=h:null),onChange:a(C)},null,8,["modelValue","onChange"])]),e(c,{class:"w-full mt-4",type:"primary",onClick:y},{default:o(()=>[i("\u6DFB\u52A0\u5546\u54C1")]),_:1})])}}}),ve=F("div",{class:"mb-4 text-lg font-bold"},"\u9884\u5B9A\u5355\u6DFB\u52A0",-1),we={class:"flex-1 w-full"},Fe={class:"mb-2"},ge=D({name:"storeProductEdit"}),sl=D({...ge,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(j,{emit:L}){const V=se(),u=N({warehouse_id:"",supplier_id:"",code:"",total_price:0,order_type:1,store_id:"",nikename:"",phone:"",address:"",arrival_time:"",mark:""}),b=v(!1),_=v([]),f=n=>{_.value=_.value.filter(l=>l.id!==n)},C=n=>{n.forEach(l=>{_.value.find(r=>r.id==l.id)||(u.order_type!=2&&(l.purchase=l.price),_.value.push(l))}),b.value=!1};function g(n){n.total_price=(n.nums*n.purchase).toFixed(2),n.total_price>0&&(u.total_price=(parseFloat(u.total_price)+parseFloat(n.total_price)).toFixed(2))}const B=ce(),k=async()=>{const n=_.value.map(l=>({product_id:l.id,nums:l.nums,purchase:l.purchase||0,total_price:l.total_price||0,mark:l.mark}));fe({product_arr:n,...u}).then(l=>{setTimeout(()=>{B.push({path:"/order/beforehand_order"})},2e3)})},y=v([]);return he({page_no:1,page_size:100}).then(n=>{y.value=n.lists}),(n,l)=>{const r=$,s=R,c=W,x=X,p=le,U=te,A=ee,E=I,d=O,h=T,z=K,G=M,q=Ee,H=oe,J=ae;return w(),P(J,null,{default:o(()=>[ve,F("div",null,[e(G,{ref_key:"formRef",ref:V,model:a(u),"label-width":"90px"},{default:o(()=>[e(s,{label:"\u603B\u4EF7",prop:"total_price"},{default:o(()=>[e(r,{modelValue:a(u).total_price,"onUpdate:modelValue":l[0]||(l[0]=t=>a(u).total_price=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u603B\u4EF7",readonly:!1,style:{width:"240px"}},null,8,["modelValue"])]),_:1}),e(s,{label:"\u8BA2\u5355\u7C7B\u578B",prop:"order_type"},{default:o(()=>[e(x,{modelValue:a(u).order_type,"onUpdate:modelValue":l[1]||(l[1]=t=>a(u).order_type=t)},{default:o(()=>[e(c,{label:1},{default:o(()=>[i("\u94FA\u8D27\u8BA2\u5355")]),_:1}),e(c,{label:2},{default:o(()=>[i("\u644A\u8D29\u8BA2\u5355")]),_:1}),e(c,{label:3},{default:o(()=>[i("\u4E00\u6761\u9F99\u8BA2\u5355")]),_:1}),e(c,{label:5},{default:o(()=>[i("\u4ED3\u5E93\u8865\u8D27")]),_:1}),e(c,{label:6},{default:o(()=>[i("\u5F80\u671F\u8865\u5355")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(s,{label:"\u95E8\u5E97",prop:"store_id",style:{width:"300px"}},{default:o(()=>[e(U,{modelValue:a(u).store_id,"onUpdate:modelValue":l[2]||(l[2]=t=>a(u).store_id=t),placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",size:"large"},{default:o(()=>[(w(!0),S(de,null,ie(a(y),t=>(w(),P(p,{key:t.id,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(s,{label:"\u9001\u8D27\u65F6\u95F4",style:{width:"300px"}},{default:o(()=>[e(A,{readonly:!1,class:"flex-1 !flex",modelValue:a(u).arrival_time,"onUpdate:modelValue":l[3]||(l[3]=t=>a(u).arrival_time=t),clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u751F\u4EA7\u65E5\u671F"},null,8,["modelValue"])]),_:1}),e(s,{label:"\u59D3\u540D",style:{width:"240px"}},{default:o(()=>[e(r,{modelValue:a(u).nikename,"onUpdate:modelValue":l[4]||(l[4]=t=>a(u).nikename=t),type:"input"},null,8,["modelValue"])]),_:1}),e(s,{label:"\u624B\u673A",style:{width:"240px"}},{default:o(()=>[e(r,{modelValue:a(u).phone,"onUpdate:modelValue":l[5]||(l[5]=t=>a(u).phone=t),type:"input"},null,8,["modelValue"])]),_:1}),e(s,{label:"\u5730\u5740"},{default:o(()=>[e(r,{modelValue:a(u).address,"onUpdate:modelValue":l[6]||(l[6]=t=>a(u).address=t),type:"input"},null,8,["modelValue"])]),_:1}),e(s,{label:"\u5907\u6CE8"},{default:o(()=>[e(r,{modelValue:a(u).mark,"onUpdate:modelValue":l[7]||(l[7]=t=>a(u).mark=t),type:"input",rows:"4"},null,8,["modelValue"])]),_:1}),e(s,{label:"\u5546\u54C1",prop:"product_id"},{default:o(()=>[F("div",we,[F("div",Fe,[e(E,{type:"primary",onClick:l[8]||(l[8]=t=>b.value=!0)},{default:o(()=>[i("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),e(z,{data:a(_)},{default:o(()=>[e(d,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),e(d,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:o(({row:t})=>[e(h,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(d,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),e(d,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),e(d,{label:"\u6570\u91CF"},{default:o(({row:t})=>[e(r,{modelValue:t.nums,"onUpdate:modelValue":m=>t.nums=m,onChange:m=>g(t)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(d,{label:"\u4EF7\u683C"},{default:o(({row:t})=>[e(r,{modelValue:t.purchase,"onUpdate:modelValue":m=>t.purchase=m,onChange:m=>g(t)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(d,{label:"\u603B\u4EF7"},{default:o(({row:t})=>[e(r,{modelValue:t.total_price,"onUpdate:modelValue":m=>t.total_price=m},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(d,{label:"\u5907\u6CE8"},{default:o(({row:t})=>[e(r,{modelValue:t.mark,"onUpdate:modelValue":m=>t.mark=m},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(d,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:t})=>[e(E,{type:"danger",link:"",onClick:m=>f(t.id)},{default:o(()=>[i(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),e(s,{label:""},{default:o(()=>[e(E,{onClick:k,type:"primary",class:"w-40"},{default:o(()=>[i("\u63D0\u4EA4")]),_:1})]),_:1})]),_:1},8,["model"])]),e(H,{modelValue:a(b),"onUpdate:modelValue":l[9]||(l[9]=t=>Y(b)?b.value=t:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:o(()=>[e(q,{onOnBindStore:C})]),_:1},8,["modelValue"])]),_:1})}}});export{sl as default};