moreShopAdmin/build/admin/assets/add.916e51d0.js

2 lines
5.0 KiB
JavaScript

import{C as U,D as R,w as A,M as I,b as T,N as $,F as N,I as P,L}from"./element-plus.4a7d92a3.js";import{_ as O}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.b098b91e.js";import{k as j}from"./index.9f02ca4f.js";import"./lodash.9dc701ad.js";import{u as M,a as S}from"./vue-router.101084e3.js";import{a as K}from"./beforehand_order.1081c654.js";import{d as C,s as Z,r as s,Z as q,o as z,K as G,L as l,a as c,U as e,u as p,R as h,j as H}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.49ccb93e.js";import"./store_product.1da3e690.js";import"./store_branch_product.f27de953.js";import"./warehouse_product_storege.cd9088e9.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 J=c("div",{class:"mb-4 text-lg font-bold"},"\u9884\u5B9A\u5355\u6DFB\u52A0",-1),Q={class:"flex-1 w-full"},W={class:"mb-2"},X=C({name:"storeProductEdit"}),je=C({...X,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Y,{emit:ee}){M();const V=Z();j(),s([]);const u=q({total_price:"",warehouse_id:"",supplier_id:"",code:"",total_price:0,remark:"",outstanding_amount:0,completed_amount:0}),m=s(!1),d=s([]),v=a=>{d.value=d.value.filter(t=>t.id!==a)},F=a=>{a.forEach(t=>{d.value.find(i=>i.id==t.id)||d.value.push(t)}),m.value=!1};s(!1),s([]);function b(a){a.total_price=(a.nums*a.purchases).toFixed(2),a.total_price>0&&(u.total_price=(parseFloat(u.total_price)+parseFloat(a.total_price)).toFixed(2))}const E=S(),w=async()=>{const a=d.value.map(t=>({product_id:t.id,nums:t.nums,purchase:t.purchases||0,total_price:t.total_price||0,manufacture:t.manufacture,expiration_date:t.expiration_date}));K({product_arr:a,...u}).then(t=>{setTimeout(()=>{E.push({path:"/order/beforehand_order"})},2e3)})};return(a,t)=>{const i=U,_=R,f=A,r=I,g=T,x=$,B=N,k=O,y=P,D=L;return z(),G(D,null,{default:l(()=>[J,c("div",null,[e(B,{ref_key:"formRef",ref:V,model:p(u),"label-width":"90px"},{default:l(()=>[e(_,{label:"\u603B\u4EF7",prop:"total_price"},{default:l(()=>[e(i,{modelValue:p(u).total_price,"onUpdate:modelValue":t[0]||(t[0]=o=>p(u).total_price=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u603B\u4EF7",readonly:!1,style:{width:"240px"}},null,8,["modelValue"])]),_:1}),e(_,{label:"\u5907\u6CE8"},{default:l(()=>[e(i,{modelValue:p(u).remark,"onUpdate:modelValue":t[1]||(t[1]=o=>p(u).remark=o),type:"input",rows:"4"},null,8,["modelValue"])]),_:1}),e(_,{label:"\u5546\u54C1",prop:"store_id"},{default:l(()=>[c("div",Q,[c("div",W,[e(f,{type:"primary",onClick:t[2]||(t[2]=o=>m.value=!0)},{default:l(()=>[h("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),e(x,{data:p(d)},{default:l(()=>[e(r,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),e(r,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:l(({row:o})=>[e(g,{style:{width:"50px",height:"50px"},src:o.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(r,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),e(r,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),e(r,{label:"\u6570\u91CF","min-width":"150"},{default:l(({row:o})=>[e(i,{modelValue:o.nums,"onUpdate:modelValue":n=>o.nums=n,onChange:n=>b(o)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(r,{label:"\u4EF7\u683C","min-width":"150"},{default:l(({row:o})=>[e(i,{modelValue:o.purchases,"onUpdate:modelValue":n=>o.purchases=n,onChange:n=>b(o)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(r,{label:"\u603B\u4EF7","min-width":"150"},{default:l(({row:o})=>[e(i,{modelValue:o.total_price,"onUpdate:modelValue":n=>o.total_price=n},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(r,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:o})=>[e(f,{type:"danger",link:"",onClick:n=>v(o.id)},{default:l(()=>[h(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),e(_,{label:""},{default:l(()=>[e(f,{onClick:w,type:"primary",class:"w-40"},{default:l(()=>[h("\u63D0\u4EA4")]),_:1})]),_:1})]),_:1},8,["model"])]),e(y,{modelValue:p(m),"onUpdate:modelValue":t[3]||(t[3]=o=>H(m)?m.value=o:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:l(()=>[e(k,{onOnBindStore:F})]),_:1},8,["modelValue"])]),_:1})}}});export{je as default};