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.a63a26dd.js";import{_ as Q}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.d977ec57.js";import{a as W}from"./vue-router.101084e3.js";import{a as X}from"./beforehand_order.eeff8c95.js";import{a as Y}from"./system_store.647f3391.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.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.a0347919.js";import"./index.82413aa0.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.acc136cb.js";import"./store_branch_product.d52c9fad.js";import"./warehouse_product_storege.d7208584.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};
|