sf_web_dist/js/prepayment-log.1756380691350BOh4-T75.js

2 lines
3.4 KiB
JavaScript
Raw Normal View History

2025-08-28 19:32:42 +08:00
import{b2 as e,r as a,D as t,ag as o,c as l,e as r,N as p,w as s,g as n,l as i,O as d,m as c,al as m,t as g,an as u,aX as y,aY as _,a7 as h}from"./index.1756380691350B663p32X.js";import{E as f}from"./el-card.1756380691350YTKqIX-N.js";import{_ as w}from"./index.1756380691350DXePY4nx.js";import{E as b}from"./el-text.1756380691350CCIY7iyD.js";import v from"./settlement-log.1756380691350C0m4PvZL.js";import{g as j,a as D}from"./payee-order.1756380691350BPfvLya-.js";/* empty css */import"./el-col.1756380691350CaYqKJkC.js";import"./payee-count.1756380691350BIAmcngl.js";const P=e({__name:"prepayment-log",props:{showPrePaymentLogDialog:{type:Boolean,default:!1},currentRow:{type:Object,default:()=>{}}},emits:["update:showPrePaymentLogDialog"],setup(e,{emit:P}){const F=e;let R=a([]);const x=a(!1);t(()=>F.showPrePaymentLogDialog,e=>{e&&(S(),O())});const L=o({columns:[{label:"ID",prop:"id"},{label:"加减前预付",prop:"before_money"},{label:"加/减",prop:"index",slot:"pay_type_slot",width:"200px"},{label:"加减后预付",prop:"after_money",align:"center"},{label:"添加时间",prop:"create_time",align:"center"},{prop:"flow_amount",label:"来源",align:"center"},{label:"备注",prop:"remark",align:"center"}],searchFields:[{label:"添加时间",prop:"create_time",type:"date",dateType:"datetimerange",value:[]}],per_page:10,page:1,total:0,loading:!1}),k=P,E=()=>{k("update:showPrePaymentLogDialog",!1)},S=async()=>{let e=await D();Object.keys(e).forEach(a=>{R.value.push({label:e[a],value:a})})},U=()=>{L.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),O()};const O=()=>{L.loading=!0;let e={limit:L.per_page,page:L.page,type:4,shop_id:F.currentRow.shop_id,shop_type:2},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(L.searchFields);j(Object.assign(e,a)).then(e=>{L.tableData=e.data,L.total=e.total,L.loading=!1}).catch(()=>{L.loading=!1})},T=()=>{x.value=!0};return(a,t)=>{const o=b,j=u,D=w,P=f,F=y;return r(),l(h,null,[p(F,{"model-value":e.showPrePaymentLogDialog,title:"预付日志",width:"70vw",onClose:E},{default:s(()=>[p(P,null,{header:s(()=>[p(o,{type:"warning",class:"title"},{default:s(()=>[d(g(e.currentRow.supplier_name)+"预付日志",1)]),_:1}),p(j,{type:"primary",onClick:T},{default:s(()=>t[4]||(t[4]=[d("结算日志")])),_:1,__:[4]})]),default:s(()=>[p(D,{type:"export",columns:n(L).columns,searchFields:n(L).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>n(L).searchFields=e),data:n(L).tableData,per_page:n(L).per_page,"onUpdate:per_page":t[1]||(t[1]=e=>n(L).per_page=e),page:n(L).page,"onUpdate:page":t[2]||(t[2]=e=>n(L).page=e),total:n(L).total,onGetTableData:O,onResetForm:U,loading:n(L).loading,showSelection:!1,showRightRefreshSlot:!1},{pay_type_slot:s(({row:e})=>{var a;return[i("div",null,[d(g(null==(a=n(R).find(a=>a.value==e.op_type))?void 0:a.label)+" ",1),e.money>0?(r(),c(o,{key:0,type:"primary"},{default:s(()=>[d("+"+g(e.money),1)]),_:2},1024)):m("",!0),e.money<=0?(r(),c(o,{key:1,type:"danger"},{default:s(()=>[d(g(e.money),1)]),_:2},1024)):m("",!0)])]}),_:1},8,["columns","searchFields","data","per_page","page","total","loading"])]),_:1})]),_:1},8,["model-value"]),p(v,{showSettlementLog:n(x),"onUpdate:showSettlementLog":t[3]||(t[3]=e=>_(x)?x.value=e:null),currentRow:e.currentRow},null,8,["showSettlementLog","currentRow"])],64)}}},[["__scopeId","data-v-48c2bf5d"]]);export{P as default};