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