moreShopAdmin/build/admin/assets/add.8a68bd06.js

2 lines
5.5 KiB
JavaScript

import{G as R,H as I,C as $,D as N,w as P,M as T,b as L,N as O,F as j,I as G,L as S}from"./element-plus.4a7d92a3.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.7fd93299.js";import{a as K}from"./vue-router.101084e3.js";import{a as M}from"./beforehand_order.498ae2e0.js";import{d as C,s as Z,Z as q,r as V,o as z,K as J,L as l,a as f,U as e,u as d,R as m,j as Q}from"./@vue.18505fe0.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.d01b8cdf.js";import"./index.ef541146.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";import"./store_product.2fc0c3d6.js";import"./store_branch_product.aebbe425.js";import"./warehouse_product_storege.6a371d2a.js";const W=f("div",{class:"mb-4 text-lg font-bold"},"\u9884\u5B9A\u5355\u6DFB\u52A0",-1),X={class:"flex-1 w-full"},Y={class:"mb-2"},ee=C({name:"storeProductEdit"}),Se=C({...ee,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(oe,{emit:te}){const E=Z(),u=q({warehouse_id:"",supplier_id:"",code:"",total_price:0,order_type:1,mark:""}),s=V(!1),i=V([]),v=a=>{i.value=i.value.filter(t=>t.id!==a)},F=a=>{a.forEach(t=>{i.value.find(n=>n.id==t.id)||(u.order_type!=2&&(t.purchase=t.price),i.value.push(t))}),s.value=!1};function b(a){a.total_price=(a.nums*a.purchase).toFixed(2),a.total_price>0&&(u.total_price=(parseFloat(u.total_price)+parseFloat(a.total_price)).toFixed(2))}const B=K(),y=async()=>{const a=i.value.map(t=>({product_id:t.id,nums:t.nums,purchase:t.purchase||0,total_price:t.total_price||0,mark:t.mark}));M({product_arr:a,...u}).then(t=>{setTimeout(()=>{B.push({path:"/order/beforehand_order"})},2e3)})};return(a,t)=>{const n=$,_=N,c=R,g=I,h=P,p=T,D=L,k=O,w=j,x=H,U=G,A=S;return z(),J(A,null,{default:l(()=>[W,f("div",null,[e(w,{ref_key:"formRef",ref:E,model:d(u),"label-width":"90px"},{default:l(()=>[e(_,{label:"\u603B\u4EF7",prop:"total_price"},{default:l(()=>[e(n,{modelValue:d(u).total_price,"onUpdate:modelValue":t[0]||(t[0]=o=>d(u).total_price=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u603B\u4EF7",readonly:!1,style:{width:"240px"}},null,8,["modelValue"])]),_:1}),e(_,{label:"\u8BA2\u5355\u7C7B\u578B",prop:"order_type"},{default:l(()=>[e(g,{modelValue:d(u).order_type,"onUpdate:modelValue":t[1]||(t[1]=o=>d(u).order_type=o)},{default:l(()=>[e(c,{label:1},{default:l(()=>[m("\u94FA\u8D27\u8BA2\u5355")]),_:1}),e(c,{label:2},{default:l(()=>[m("\u644A\u8D29\u8BA2\u5355")]),_:1}),e(c,{label:3},{default:l(()=>[m("\u4E00\u6761\u9F99\u8BA2\u5355")]),_:1}),e(c,{label:5},{default:l(()=>[m("\u4ED3\u5E93\u8865\u8D27")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(_,{label:"\u5907\u6CE8"},{default:l(()=>[e(n,{modelValue:d(u).mark,"onUpdate:modelValue":t[2]||(t[2]=o=>d(u).mark=o),type:"input",rows:"4"},null,8,["modelValue"])]),_:1}),e(_,{label:"\u5546\u54C1",prop:"store_id"},{default:l(()=>[f("div",X,[f("div",Y,[e(h,{type:"primary",onClick:t[3]||(t[3]=o=>s.value=!0)},{default:l(()=>[m("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),e(k,{data:d(i)},{default:l(()=>[e(p,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),e(p,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:l(({row:o})=>[e(D,{style:{width:"50px",height:"50px"},src:o.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:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),e(p,{label:"\u6570\u91CF"},{default:l(({row:o})=>[e(n,{modelValue:o.nums,"onUpdate:modelValue":r=>o.nums=r,onChange:r=>b(o)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(p,{label:"\u4EF7\u683C"},{default:l(({row:o})=>[e(n,{modelValue:o.purchase,"onUpdate:modelValue":r=>o.purchase=r,onChange:r=>b(o)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(p,{label:"\u603B\u4EF7"},{default:l(({row:o})=>[e(n,{modelValue:o.total_price,"onUpdate:modelValue":r=>o.total_price=r},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(p,{label:"\u5907\u6CE8"},{default:l(({row:o})=>[e(n,{modelValue:o.mark,"onUpdate:modelValue":r=>o.mark=r},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(p,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:o})=>[e(h,{type:"danger",link:"",onClick:r=>v(o.id)},{default:l(()=>[m(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),e(_,{label:""},{default:l(()=>[e(h,{onClick:y,type:"primary",class:"w-40"},{default:l(()=>[m("\u63D0\u4EA4")]),_:1})]),_:1})]),_:1},8,["model"])]),e(U,{modelValue:d(s),"onUpdate:modelValue":t[4]||(t[4]=o=>Q(s)?s.value=o:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:l(()=>[e(x,{onOnBindStore:F})]),_:1},8,["modelValue"])]),_:1})}}});export{Se as default};