2025-03-20 10:46:42 +08:00

2 lines
6.1 KiB
JavaScript

import{G as H,H as J,J as K,M as Q,N as W,S as Z,T as z,Q as X,L as ee,k as f,C as oe,B as te,w as le,b as ue,D as ae}from"./element-plus.2acb577d.js";import{_ as re}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.58202ffc.js";import{j as se}from"./index.81df6f20.js";import{c as ne}from"./outbound_order.dff54b80.js";import"./lodash.6bfd3540.js";import{u as ie,a as pe}from"./vue-router.4c04f9b6.js";import{a as de}from"./warehouse.77723b1e.js";import{d as B,s as me,r as i,Z as _e,o as b,K as V,L as l,a as w,U as o,u as a,i as D,c as ce,T as fe,a9 as we,R as c}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 Ee={class:"flex-1 w-full"},be={class:"mb-2"},ve=B({name:"storeProductEdit"}),so=B({...ve,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(he,{emit:ke}){const v=ie(),g=me(),{removeTab:x}=se();i("add");const p=i(""),h=i([]);i(0);const s=_e({store_id:"",manufacture:"",remark:"",type:2});v.query.warehouse_id&&(p.value=parseInt(v.query.warehouse_id));const R=()=>{de({}).then(u=>{h.value=u.lists})};i(!1);const A=i([]),_=i(!1),U=()=>{p.value==""?f.error("\u8BF7\u5148\u9009\u62E9\u4ED3\u5E93"):_.value=!0},d=i([]),L=u=>{d.value=d.value.filter(e=>e.id!==u)},T=u=>{u.forEach(e=>{d.value.find(r=>r.id==e.id)||d.value.push(e)}),_.value=!1},P=i(!0),k=()=>{d.value.map(u=>({id:u.product_id,stock:u.new_stock||0,stocks:u.stock||0}))};pe();const S=async()=>{if(p.value==""){f.error("\u8BF7\u9009\u62E9\u4ED3\u5E93");return}if(k(),P.value==!1)return;const u=d.value.map(r=>({id:r.product_id,stock:r.new_stock||0,batch:r.batch||0})),e=A.value.map(r=>r.id);if(e.length>1){f.error("\u95E8\u5E97\u4E0D\u80FD\u8D85\u8FC7\u4E00\u4E2A");return}ne({product_arr:u,store_arr:e,type:s.type,warehouse_id:p.value,delivery_time:s.manufacture,mark:s.remark}).then(r=>{x(),f.success(r.msg)})};return R(),(u,e)=>{const r=H,I=J,m=oe,M=K,C=te,E=le,n=Q,O=ue,N=W,y=Z,Y=z,j=ae,q=re,G=X,$=ee;return b(),V($,null,{default:l(()=>[e[10]||(e[10]=w("div",{class:"mb-4 text-lg font-bold"},"\u51FA\u5E93\u5546\u54C1",-1)),w("div",null,[o(j,{ref_key:"formRef",ref:g,model:a(s),"label-width":"90px"},{default:l(()=>[o(m,{label:"\u4ED3\u5E93",prop:"uid"},{default:l(()=>[o(I,{modelValue:a(p),"onUpdate:modelValue":e[0]||(e[0]=t=>D(p)?p.value=t:null),style:{width:"240px"}},{default:l(()=>[(b(!0),ce(fe,null,we(a(h),t=>(b(),V(r,{key:t.id,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(m,{label:"\u51FA\u5E93\u65F6\u95F4",class:"w-[320px]"},{default:l(()=>[o(M,{readonly:!1,class:"flex-1 !flex",modelValue:a(s).manufacture,"onUpdate:modelValue":e[1]||(e[1]=t=>a(s).manufacture=t),clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u51FA\u5E93\u65E5\u671F"},null,8,["modelValue"])]),_:1}),o(m,{label:"\u5907\u6CE8"},{default:l(()=>[o(C,{modelValue:a(s).remark,"onUpdate:modelValue":e[2]||(e[2]=t=>a(s).remark=t),type:"input",rows:"4"},null,8,["modelValue"])]),_:1}),o(m,{label:"\u5546\u54C1",prop:"store_id"},{default:l(()=>[w("div",Ee,[w("div",be,[o(E,{type:"primary",onClick:U},{default:l(()=>e[5]||(e[5]=[c("\u6DFB\u52A0\u5546\u54C1")])),_:1})]),o(N,{data:a(d)},{default:l(()=>[o(n,{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),o(n,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:l(({row:t})=>[o(O,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),o(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),o(n,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),o(n,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),o(n,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""}),o(n,{label:"\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""}),o(n,{label:"\u5206\u914D\u5E93\u5B58","min-width":"150"},{default:l(({row:t})=>[o(C,{modelValue:t.new_stock,"onUpdate:modelValue":F=>t.new_stock=F,onChange:k},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(n,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:t})=>[o(E,{type:"danger",link:"",onClick:F=>L(t.id)},{default:l(()=>e[6]||(e[6]=[c(" \u5220\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),o(m,{label:"\u5E93\u5B58\u7C7B\u578B",prop:"type"},{default:l(()=>[o(Y,{modelValue:a(s).type,"onUpdate:modelValue":e[3]||(e[3]=t=>a(s).type=t),class:"ml-6"},{default:l(()=>[o(y,{value:2,label:2},{default:l(()=>e[7]||(e[7]=[c("\u62A5\u635F")])),_:1}),o(y,{value:1,label:1},{default:l(()=>e[8]||(e[8]=[c("\u9000\u4F9B\u5E94\u5546")])),_:1})]),_:1},8,["modelValue"])]),_:1}),o(m,{label:""},{default:l(()=>[o(E,{onClick:S,type:"primary",class:"w-40"},{default:l(()=>e[9]||(e[9]=[c("\u63D0\u4EA4")])),_:1})]),_:1})]),_:1},8,["model"])]),o(G,{modelValue:a(_),"onUpdate:modelValue":e[4]||(e[4]=t=>D(_)?_.value=t:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:l(()=>[o(q,{onOnBindStore:T,is_warehouse:"1",warehouse_id:a(p)},null,8,["warehouse_id"])]),_:1},8,["modelValue"])]),_:1})}}});export{so as default};