moreShopAdmin/dist/admin/assets/add.b5a3b805.js

2 lines
5.0 KiB
JavaScript
Raw Normal View History

2024-10-07 13:46:16 +08:00
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.a63a26dd.js";import{_ as O}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.27211fce.js";import{k as j}from"./index.1aee185b.js";import"./lodash.2473fc51.js";import{u as M,a as S}from"./vue-router.101084e3.js";import{a as K}from"./beforehand_order.fde7acbe.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.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.5e70e33d.js";import"./store_product.6dc22f19.js";import"./store_branch_product.b1cf046d.js";import"./warehouse_product_storege.a03c2b23.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";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","on