moreShopAdmin/dist/admin/assets/add.311eb974.js

2 lines
5.5 KiB
JavaScript
Raw Normal View History

2024-10-12 20:57:03 +08:00
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.a63a26dd.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.7f970e74.js";import{a as K}from"./vue-router.101084e3.js";import{a as M}from"./beforehand_order.bbd130de.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 c,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.4884cfc2.js";import"./axios.932d3f8a.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import"./usePaging.6a6670f9.js";import"./useDictOptions.9de2964f.js";import"./index.97aad766.js";import"./lodash.2473fc51.js";import"./pinia.a969beab.js";import"./css-color-function.9f6a56f3.js";import"./color.d1bc3784.js";import"./clone.83700f2e.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.fcc9be76.js";import"./vue-clipboard3.9e751565.js";import"./clipboard.dda64e67.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.33986396.js";import"./store_branch_product.4e58eed5.js";import"./warehouse_product_storege.dc9ed562.js";const W=c("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,f=R,g=I,h=P,p=T,k=L,D=O,w=j,x=H,U=G,A=S;return z(),J(A,null,{default:l(()=>[W,c("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(f,{label:1},{default:l(()=>[m("\u94FA\u8D27\u8BA2\u5355")]),_:1}),e(f,{label:2},{default:l(()=>[m("\u644A\u8D29\u8BA2\u5355")]),_:1}),e(f,{label:3},{default:l(()=>[m("\u4E00\u6761\u9F99\u8BA2\u5355")]),_: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(()=>[c("div",X,[c("div",Y,[e(h,{type:"primary",onClick:t[3]||(t[3]=o=>s.value=!0)},{default:l(()=>[m("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),e(D,{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(k,{style:{width:"50px",height:"50px"},src:o.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(p,{label:"\u554