import{U as Q,G as X,H as ee,k as L,J as oe,K as te,D as ue,C as le,w as ae,M as re,b as se,N as ie,F as ne,I as pe,L as de}from"./element-plus.91c68cc0.js";import{_ as me}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.52d1f352.js";import{_ as _e}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.eb5e0636.js";import{k as fe}from"./index.892cd835.js";import{b as ce}from"./warehouse_order.f814c590.js";import{d as S,s as Ee,r as s,Z as we,ap as ve,o as h,K as B,L as u,a as f,U as o,u as r,j as k,c as be,T as he,a9 as ke,R as n,S as De,M as Ce}from"./@vue.76ce7aa3.js";import"./lodash.4e6d2a38.js";import{u as Be,a as ye}from"./vue-router.10bd5b90.js";import{a as Ve}from"./store_product_unit.4033c4f1.js";import{a as ge}from"./warehouse.5516f674.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.863ae816.js";import"./usePaging.f8c888e4.js";import"./useDictOptions.bbcac283.js";import"./store_product.77fb3e55.js";import"./store_branch_product.2061e0ca.js";import"./warehouse_product_storege.2c62fabd.js";import"./system_store.7c50d15d.js";import"./axios.659d5af3.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.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.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";const Fe={class:"flex-1 w-full"},xe={class:"mb-2"},Ue={class:"flex-1 w-full"},Ae={class:"mb-2"},Le=S({name:"storeProductEdit"}),xo=S({...Le,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Se,{emit:Re}){const y=Be(),R=Ee();fe(),s("add");const p=s(""),V=s([]);s(0);const d=we({store_id:"",manufacture:"",remark:""});y.query.warehouse_id&&(p.value=parseInt(y.query.warehouse_id));const I=()=>{ge({}).then(l=>{V.value=l.lists})},E=s(!1),c=s([]),M=l=>{c.value=c.value.filter(e=>e.id!==l)},O=l=>{c.value=[],c.value.push(l),D(),E.value=!1},w=s(!1),m=s([]),P=l=>{m.value=m.value.filter(e=>e.id!==l)},T=l=>{l.forEach(e=>{m.value.find(i=>i.id==e.id)||m.value.push(e)}),w.value=!1},$=s([]);(()=>{Ve({}).then(l=>{$.value=l.lists})})();const b=s(1),N=s(!0),D=()=>{m.value.map(l=>({id:l.product_id,stock:l.new_stock||0,stocks:l.stock||0}))},Y=ye(),j=async()=>{if(p.value==""){L.error("\u8BF7\u9009\u62E9\u4ED3\u5E93");return}if(D(),N.value==!1)return;const l=m.value.map(i=>({id:i.product_id,stock:i.new_stock||0,batch:i.batch||0})),e=c.value.map(i=>i.id);if(e.length>1){L.error("\u95E8\u5E97\u4E0D\u80FD\u8D85\u8FC7\u4E00\u4E2A");return}ce({product_arr:l,store_arr:e,stock_type:b.value,warehouse_id:p.value,delivery_time:d.manufacture,mark:d.remark}).then(i=>{setTimeout(()=>{Y.push({path:"/warehouse/outbound_order"})},2e3)})};return I(),(l,e)=>{const i=oe,q=te,_=ue,G=Q,g=le,v=ae,a=re,F=se,x=ie,U=X,K=ee,W=ne,H=_e,A=pe,J=me,Z=de,z=ve("perms");return h(),B(Z,null,{default:u(()=>[e[16]||(e[16]=f("div",{class:"mb-4 text-lg font-bold"},"\u51FA\u5E93\u5546\u54C1\u5230\u95E8\u5E97",-1)),f("div",null,[o(W,{ref_key:"formRef",ref:R,model:r(d),"label-width":"90px"},{default:u(()=>[o(_,{label:"\u4ED3\u5E93",prop:"uid"},{default:u(()=>[o(q,{modelValue:r(p),"onUpdate:modelValue":e[0]||(e[0]=t=>k(p)?p.value=t:null),style:{width:"240px"}},{default:u(()=>[(h(!0),be(he,null,ke(r(V),t=>(h(),B(i,{key:t.id,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(_,{label:"\u9001\u8D27\u65F6\u95F4"},{default:u(()=>[o(G,{readonly:!1,class:"flex-1 !flex",modelValue:r(d).manufacture,"onUpdate:modelValue":e[1]||(e[1]=t=>r(d).manufacture=t),clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u751F\u4EA7\u65E5\u671F"},null,8,["modelValue"])]),_:1}),o(_,{label:"\u5907\u6CE8"},{default:u(()=>[o(g,{modelValue:r(d).remark,"onUpdate:modelValue":e[2]||(e[2]=t=>r(d).remark=t),type:"input",rows:"4"},null,8,["modelValue"])]),_:1}),o(_,{label:"\u95E8\u5E97",prop:"store_id"},{default:u(()=>[f("div",Fe,[f("div",xe,[o(v,{type:"primary",onClick:e[3]||(e[3]=t=>E.value=!0)},{default:u(()=>e[8]||(e[8]=[n("\u6DFB\u52A0\u95E8\u5E97")])),_:1})]),o(x,{data:r(c)},{default:u(()=>[o(a,{label:"ID",prop:"id","show-overflow-tooltip":""}),o(a,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),o(a,{label:"\u624B\u673A\u53F7\u7801",prop:"phone","show-overflow-tooltip":""}),o(a,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"detailed_address","show-overflow-tooltip":""}),o(a,{label:"\u95E8\u5E97logo",prop:"image","show-overflow-tooltip":""},{default:u(({row:t})=>[o(F,{src:t.image,class:"w-[40px] h-[40px]","preview-teleported":!0},null,8,["src"])]),_:1}),o(a,{label:"\u8425\u4E1A\u72B6\u6001",prop:"is_show","show-overflow-tooltip":""},{default:u(({row:t})=>[n(De(t.is_show?"\u8425\u4E1A":"\u6253\u70CA"),1)]),_:1}),o(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:u(({row:t})=>[Ce((h(),B(v,{type:"danger",link:"",onClick:C=>M(t.id)},{default:u(()=>e[9]||(e[9]=[n(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[z,["system_store.system_store/delete"]]])]),_:1})]),_:1},8,["data"])])]),_:1}),o(_,{label:"\u5546\u54C1",prop:"store_id"},{default:u(()=>[f("div",Ue,[f("div",Ae,[o(v,{type:"primary",onClick:e[4]||(e[4]=t=>w.value=!0)},{default:u(()=>e[10]||(e[10]=[n("\u6DFB\u52A0\u5546\u54C1")])),_:1})]),o(x,{data:r(m)},{default:u(()=>[o(a,{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),o(a,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:u(({row:t})=>[o(F,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),o(a,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),o(a,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),o(a,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),o(a,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""}),o(a,{label:"\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""}),o(a,{label:"\u5206\u914D\u5E93\u5B58","min-width":"150"},{default:u(({row:t})=>[o(g,{modelValue:t.new_stock,"onUpdate:modelValue":C=>t.new_stock=C,onChange:D},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:u(({row:t})=>[o(v,{type:"danger",link:"",onClick:C=>P(t.id)},{default:u(()=>e[11]||(e[11]=[n(" \u5220\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),o(_,{label:"\u5E93\u5B58\u7C7B\u578B",prop:"stock_type"},{default:u(()=>[o(K,{modelValue:r(b),"onUpdate:modelValue":e[5]||(e[5]=t=>k(b)?b.value=t:null),class:"ml-6"},{default:u(()=>[o(U,{value:1,label:1},{default:u(()=>e[12]||(e[12]=[n("\u5206\u914D\u552E\u5356\u5E93\u5B58")])),_:1}),o(U,{value:2,label:2},{default:u(()=>e[13]||(e[13]=[n("\u5206\u914D\u5151\u6362\u5E93\u5B58")])),_:1})]),_:1},8,["modelValue"]),e[14]||(e[14]=f("span",{class:"text-info text-xs ml-6"},"\u9ED8\u8BA4\u4E3A\u5206\u914D\u552E\u5356\u5E93\u5B58, \u5982\u9700\u5206\u914D\u5151\u6362\u5E93\u5B58\u8BF7\u9009\u62E9\u5206\u914D\u5151\u6362\u5E93\u5B58",-1))]),_:1}),o(_,{label:""},{default:u(()=>[o(v,{onClick:j,type:"primary",class:"w-40"},{default:u(()=>e[15]||(e[15]=[n("\u63D0\u4EA4")])),_:1})]),_:1})]),_:1},8,["model"])]),o(A,{modelValue:r(E),"onUpdate:modelValue":e[6]||(e[6]=t=>k(E)?E.value=t:null),title:"\u9009\u62E9\u95E8\u5E97",width:"70%"},{default:u(()=>[o(H,{onOnBindStore:O,is_selection:0})]),_:1},8,["modelValue"]),o(A,{modelValue:r(w),"onUpdate:modelValue":e[7]||(e[7]=t=>k(w)?w.value=t:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:u(()=>[o(J,{onOnBindStore:T,is_warehouse:"1",warehouse_id:r(p)},null,8,["warehouse_id"])]),_:1},8,["modelValue"])]),_:1})}}});export{xo as default};