sf_web_dist/js/modify_deposit_log.1758872782626DfAHgBsY.js
2025-09-26 15:47:37 +08:00

2 lines
3.7 KiB
JavaScript

import{b2 as e,r as a,D as t,ag as o,c as l,e as p,N as s,w as r,g as i,l as n,O as d,m as c,al as m,t as u,an as g,aX as y,aY as h,a7 as _}from"./index.1758872782626PcEgr9Pb.js";import{E as f}from"./el-card.1758872782626kgjo9rVZ.js";import{_ as w}from"./index.1758872782626BaHu4okv.js";import{E as b}from"./el-text.1758872782626kVO24y9m.js";import v from"./settlement_log.1758872782626B8yW5B3O.js";import{g as j,a as D}from"./payee-order.1758872782626BUOACWiH.js";import{p as F}from"./common.1758872782626CCwWzMi9.js";import"./lodash.1758872782626DjG_XPT7.js";/* empty css */import"./el-col.1758872782626DEcn2Gm6.js";import"./payee-count.1758872782626BDpENi7V.js";const R=e({__name:"modify_deposit_log",props:{showModifyDepositLog:{type:Boolean,default:!1},currentRow:{type:Object,default:()=>{}}},emits:["update:showModifyDepositLog"],setup(e,{emit:R}){const x=e;let L=a([]);const k=a(!1);t(()=>x.showModifyDepositLog,async e=>{e&&(await O(),T())});const E=o({columns:[{label:"ID",prop:"id",width:"80px"},{label:"加减前预付",prop:"before_money",formatter:F,width:"120"},{label:"加/减",prop:"index",slot:"pay_type_slot",width:"240"},{label:"加减后预付",prop:"after_money",formatter:F,width:"120"},{label:"备注",prop:"remark",width:"320"},{prop:"source",label:"来源",align:"center",formatter:e=>1==e?"管理员":"机器人",width:"100"},{label:"添加时间",prop:"create_time"}],searchFields:[{label:"类型",type:"select",prop:"op_type",value:"",options:L.value},{label:"添加时间",prop:"create_time",type:"date",dateType:"datetimerange",value:[]}],per_page:10,page:1,total:0,loading:!1}),M=R,S=()=>{M("update:showModifyDepositLog",!1)},O=async()=>{let e=await D({type:"prepay"});Object.keys(e).forEach(a=>{L.value.push({label:e[a],value:a})}),E.searchFields.forEach(e=>{"op_type"==e.prop&&(e.options=L.value)})},U=()=>{E.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),T()};const T=()=>{E.loading=!0;let e={limit:E.per_page,page:E.page,type:4,shop_id:x.currentRow.shop_id},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(E.searchFields);j(Object.assign(e,a)).then(e=>{E.tableData=e.data,E.total=e.total,E.loading=!1}).catch(()=>{E.loading=!1})},C=()=>{k.value=!0};return(a,t)=>{const o=b,j=g,D=w,R=f,x=y;return p(),l(_,null,[s(x,{"model-value":e.showModifyDepositLog,title:"预付日志",width:"70vw",onClose:S},{default:r(()=>[s(R,null,{header:r(()=>[s(o,{type:"warning",class:"title"},{default:r(()=>[d(u(e.currentRow.username)+"预付日志",1)]),_:1}),s(j,{type:"primary",onClick:C},{default:r(()=>t[4]||(t[4]=[d("结算日志")])),_:1,__:[4]})]),default:r(()=>[s(D,{type:"export",columns:i(E).columns,searchFields:i(E).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>i(E).searchFields=e),data:i(E).tableData,per_page:i(E).per_page,"onUpdate:per_page":t[1]||(t[1]=e=>i(E).per_page=e),page:i(E).page,"onUpdate:page":t[2]||(t[2]=e=>i(E).page=e),total:i(E).total,onGetTableData:T,onResetForm:U,loading:i(E).loading,showSelection:!1,showRightRefreshSlot:!1},{pay_type_slot:r(({row:e})=>{var a;return[n("div",null,[d(u(null==(a=i(L).find(a=>a.value==e.op_type))?void 0:a.label)+" ",1),e.money>0?(p(),c(o,{key:0,type:"primary"},{default:r(()=>[d("+"+u(i(F)(e.money)),1)]),_:2},1024)):m("",!0),e.money<=0?(p(),c(o,{key:1,type:"danger"},{default:r(()=>[d(u(i(F)(e.money)),1)]),_:2},1024)):m("",!0)])]}),_:1},8,["columns","searchFields","data","per_page","page","total","loading"])]),_:1})]),_:1},8,["model-value"]),s(v,{showSettlementLog:i(k),"onUpdate:showSettlementLog":t[3]||(t[3]=e=>h(k)?k.value=e:null),currentRow:e.currentRow},null,8,["showSettlementLog","currentRow"])],64)}}},[["__scopeId","data-v-88135bef"]]);export{R as default};