import{C as U,D as R,t as S,F as g}from"./element-plus.4a7d92a3.js";import{_ as h}from"./picker.1de5e2d7.js";import{P as A}from"./index.66d65d7d.js";import{a as I,b as P,c as j}from"./store_cash_finance_flow.67781b6b.js";import"./lodash.9dc701ad.js";import{d as v,s as f,r as z,b as L,Z as _,o as N,c as O,U as l,L as s,u as o}from"./@vue.18505fe0.js";const T={class:"edit-popup"},Z=v({name:"storeCashFinanceFlowEdit"}),W=v({...Z,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(q,{expose:V,emit:D}){const m=D,d=f(),i=f(),p=z("add"),E=L(()=>p.value=="edit"?"\u7F16\u8F91\u95E8\u5E97\u73B0\u91D1\u6D41\u6C34":"\u65B0\u589E\u95E8\u5E97\u73B0\u91D1\u6D41\u6C34"),t=_({id:"",store_id:"",cash_price:"",receivable:"",receipts:"",admin_id:"",file:"",remark:"",status:"",store_name:""}),F=_({}),c=async a=>{for(const e in t)a[e]!=null&&a[e]!=null&&(t[e]=a[e])},C=async a=>{const e=await I({id:a.id});c(e)},b=async()=>{var e,n;await((e=d.value)==null?void 0:e.validate());const a={...t};p.value=="edit"?await P(a):await j(a),(n=i.value)==null||n.close(),m("success")},w=(a="add")=>{var e;p.value=a,(e=i.value)==null||e.open()},y=()=>{m("close")};return V({open:w,setFormData:c,getDetail:C}),(a,e)=>{const n=U,r=R,k=S,x=h,B=g;return N(),O("div",T,[l(A,{ref_key:"popupRef",ref:i,title:o(E),async:!0,width:"550px",onConfirm:b,onClose:y},{default:s(()=>[l(B,{ref_key:"formRef",ref:d,model:o(t),"label-width":"90px",rules:o(F)},{default:s(()=>[l(r,{label:"\u95E8\u5E97",prop:"store_name"},{default:s(()=>[l(n,{modelValue:o(t).store_name,"onUpdate:modelValue":e[0]||(e[0]=u=>o(t).store_name=u),readonly:""},null,8,["modelValue"])]),_:1}),l(r,{label:"\u5E94\u6536\u91D1\u989D",prop:"receivable"},{default:s(()=>[l(n,{modelValue:o(t).receivable,"onUpdate:modelValue":e[1]||(e[1]=u=>o(t).receivable=u),readonly:""},null,8,["modelValue"])]),_:1}),l(r,{label:"\u5B9E\u6536\u91D1\u989D",prop:"receipts"},{default:s(()=>[l(n,{modelValue:o(t).receipts,"onUpdate:modelValue":e[2]||(e[2]=u=>o(t).receipts=u)},null,8,["modelValue"])]),_:1}),l(r,{label:"\u5907\u6CE8",prop:"remark"},{default:s(()=>[l(n,{modelValue:o(t).remark,"onUpdate:modelValue":e[3]||(e[3]=u=>o(t).remark=u),readonly:""},null,8,["modelValue"])]),_:1}),l(r,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[l(k,{modelValue:o(t).status,"onUpdate:modelValue":e[4]||(e[4]=u=>o(t).status=u),"active-text":"\u5DF2\u8F6C\u8D26","inactive-text":"\u672A\u8F6C\u8D26","active-value":1,"inactive-value":0,size:"large","inline-prompt":""},null,8,["modelValue"])]),_:1}),l(r,{label:"\u51ED\u8BC1",prop:"file"},{default:s(()=>[l(x,{modelValue:o(t).file,"onUpdate:modelValue":e[5]||(e[5]=u=>o(t).file=u),limit:1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{W as _};
