2 lines
7.5 KiB
JavaScript
2 lines
7.5 KiB
JavaScript
import{G as j,H as W,M as G,J as H,N as J,Q as K,L as Q,C as Z,B as q,w as z,b as X,D as ee}from"./element-plus.2acb577d.js";import{_ as le}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.58202ffc.js";import{j as te}from"./index.81df6f20.js";import"./lodash.6bfd3540.js";import{u as oe,a as ae}from"./vue-router.4c04f9b6.js";import{c as ue}from"./warehouse_order.f55e8b52.js";import{a as re}from"./warehouse.77723b1e.js";import{a as ne}from"./supplier.62efcbb1.js";import{d as k,s as de,r as _,Z as pe,o as f,K as D,L as o,a as V,U as t,u as a,c as x,T as g,a9 as U,R as E,i as se}from"./@vue.821a47ec.js";import"./lodash-es.df44a280.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.81e2759c.js";import"./@element-plus.dabbc398.js";import"./dayjs.d2a77ee0.js";import"./axios.9e996410.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.a280d02d.js";import"./usePaging.23706826.js";import"./useDictOptions.4fbfb4d7.js";import"./store_product.b6de24f6.js";import"./warehouse_storege.3c4c7710.js";import"./pinia.fefed778.js";import"./css-color-function.8ff67959.js";import"./color.bfa08e9a.js";import"./clone.660f80c4.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.dcb32030.js";import"./vue-clipboard3.e681583f.js";import"./clipboard.3ad9b20b.js";import"./echarts.42bea269.js";import"./tslib.60310f1a.js";import"./zrender.2cb48b70.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8864a4be.js";const ie={class:"flex-1 w-full"},me={class:"mb-2"},_e=k({name:"storeProductEdit"}),tl=k({..._e,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(fe,{emit:ce}){oe();const B=de();te();const F=_([]),u=pe({total_price:"",warehouse_id:"",supplier_id:"",code:"",total_price:0,remark:"",outstanding_amount:0,completed_amount:0}),A=()=>{re({}).then(r=>{F.value=r.lists})},m=_(!1),i=_([]),L=r=>{i.value=i.value.filter(l=>l.id!==r)},T=r=>{r.forEach(l=>{i.value.find(h=>h.id==l.id)||i.value.push(l)}),m.value=!1},c=_(!1),v=_([]),Y=(r="")=>{c.value=!0,ne({mer_name:r}).then(l=>{v.value=l.lists,setTimeout(()=>{c.value=!1},300)}).catch(l=>{setTimeout(()=>{c.value=!1},300)})};function w(r){r.total_price=r.nums*r.purchases,r.total_price>0&&(u.total_price=parseFloat(u.total_price)+parseFloat(r.total_price))}const M=ae(),R=async()=>{const r=i.value.map(l=>({product_id:l.id,nums:l.nums,purchase:l.purchases||0,total_price:l.total_price||0,manufacture:l.manufacture,expiration_date:l.expiration_date}));ue({product_arr:r,...u}).then(l=>{setTimeout(()=>{M.push({path:"/warehouse/warehouse_order"})},2e3)})};return A(),(r,l)=>{const h=j,C=W,p=Z,s=q,b=z,d=G,P=X,y=H,$=J,I=ee,N=le,O=K,S=Q;return f(),D(S,null,{default:o(()=>[l[11]||(l[11]=V("div",{class:"mb-4 text-lg font-bold"},"\u5546\u54C1\u5165\u5E93\u64CD\u4F5C",-1)),V("div",null,[t(I,{ref_key:"formRef",ref:B,model:a(u),"label-width":"90px"},{default:o(()=>[t(p,{label:"\u4ED3\u5E93",prop:"uid"},{default:o(()=>[t(C,{modelValue:a(u).warehouse_id,"onUpdate:modelValue":l[0]||(l[0]=e=>a(u).warehouse_id=e),style:{width:"240px"}},{default:o(()=>[(f(!0),x(g,null,U(a(F),e=>(f(),D(h,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(p,{label:"\u4F9B\u5E94\u5546",prop:"supplier_id"},{default:o(()=>[t(C,{modelValue:a(u).supplier_id,"onUpdate:modelValue":l[1]||(l[1]=e=>a(u).supplier_id=e),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u4F9B\u5E94\u5546\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":Y,loading:a(c),style:{width:"240px"}},{default:o(()=>[(f(!0),x(g,null,U(a(v),e=>(f(),D(h,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1}),t(p,{label:"\u603B\u4EF7",prop:"total_price"},{default:o(()=>[t(s,{modelValue:a(u).total_price,"onUpdate:modelValue":l[2]||(l[2]=e=>a(u).total_price=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u603B\u4EF7",readonly:!1,style:{width:"240px"}},null,8,["modelValue"])]),_:1}),t(p,{label:"\u5DF2\u7ED3\u91D1\u989D",prop:"completed_amount"},{default:o(()=>[t(s,{modelValue:a(u).completed_amount,"onUpdate:modelValue":l[3]||(l[3]=e=>a(u).completed_amount=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5DF2\u7ED3\u91D1\u989D",readonly:!1,style:{width:"240px"}},null,8,["modelValue"])]),_:1}),t(p,{label:"\u672A\u7ED3\u91D1\u989D",prop:"outstanding_amount"},{default:o(()=>[t(s,{modelValue:a(u).outstanding_amount,"onUpdate:modelValue":l[4]||(l[4]=e=>a(u).outstanding_amount=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u672A\u63A5\u91D1\u989D",readonly:!1,style:{width:"240px"}},null,8,["modelValue"])]),_:1}),t(p,{label:"\u5907\u6CE8"},{default:o(()=>[t(s,{modelValue:a(u).remark,"onUpdate:modelValue":l[5]||(l[5]=e=>a(u).remark=e),type:"input",rows:"4"},null,8,["modelValue"])]),_:1}),t(p,{label:"\u5546\u54C1",prop:"store_id"},{default:o(()=>[V("div",ie,[V("div",me,[t(b,{type:"primary",onClick:l[6]||(l[6]=e=>m.value=!0)},{default:o(()=>l[8]||(l[8]=[E("\u6DFB\u52A0\u5546\u54C1")])),_:1})]),t($,{data:a(i)},{default:o(()=>[t(d,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),t(d,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:o(({row:e})=>[t(P,{style:{width:"50px",height:"50px"},src:e.image,"preview-teleported":!0},null,8,["src"])]),_:1}),t(d,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),t(d,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),t(d,{label:"\u751F\u4EA7\u65E5\u671F","min-width":"240"},{default:o(({row:e})=>[t(y,{readonly:!1,class:"flex-1 !flex",modelValue:e.manufacture,"onUpdate:modelValue":n=>e.manufacture=n,clearable:"",type:"datetime","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u751F\u4EA7\u65E5\u671F"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(d,{label:"\u4FDD\u8D28\u671F","min-width":"240"},{default:o(({row:e})=>[t(y,{readonly:!1,class:"flex-1 !flex",modelValue:e.expiration_date,"onUpdate:modelValue":n=>e.expiration_date=n,clearable:"",type:"datetime","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u4FDD\u8D28\u671F"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(d,{label:"\u6570\u91CF","min-width":"150"},{default:o(({row:e})=>[t(s,{modelValue:e.nums,"onUpdate:modelValue":n=>e.nums=n,onChange:n=>w(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),t(d,{label:"\u4EF7\u683C","min-width":"150"},{default:o(({row:e})=>[t(s,{modelValue:e.purchases,"onUpdate:modelValue":n=>e.purchases=n,onChange:n=>w(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),t(d,{label:"\u603B\u4EF7","min-width":"150"},{default:o(({row:e})=>[t(s,{modelValue:e.total_price,"onUpdate:modelValue":n=>e.total_price=n},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(d,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:e})=>[t(b,{type:"danger",link:"",onClick:n=>L(e.id)},{default:o(()=>l[9]||(l[9]=[E(" \u5220\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),t(p,{label:""},{default:o(()=>[t(b,{onClick:R,type:"primary",class:"w-40"},{default:o(()=>l[10]||(l[10]=[E("\u63D0\u4EA4")])),_:1})]),_:1})]),_:1},8,["model"])]),t(O,{modelValue:a(m),"onUpdate:modelValue":l[7]||(l[7]=e=>se(m)?m.value=e:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:o(()=>[t(N,{onOnBindStore:T})]),_:1},8,["modelValue"])]),_:1})}}});export{tl as default};
|