sf_web_dist/js/modify_deposit_log.1757321857068CJM7A3C5.js
2025-09-08 16:58:45 +08:00

2 lines
3.4 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 n,l as i,O as d,m as u,al as c,t as m,an as g,aX as y,aY as _,a7 as h}from"./index.1757321857068XkZ-Dra-.js";import{E as f}from"./el-card.1757321857068ByJL9gci.js";import{_ as w}from"./index.1757321857068CbDnNO6O.js";import{E as v}from"./el-text.1757321857068B8Y_SPuq.js";import b from"./settlement_log.1757321857068wCkLb4cg.js";import{g as j,a as D}from"./payee-order.175732185706892AI9eum.js";/* empty css */import"./el-col.1757321857068DVd8A-hE.js";import"./payee-count.1757321857068BHYLWot7.js";const F=e({__name:"modify_deposit_log",props:{showModifyDepositLog:{type:Boolean,default:!1},currentRow:{type:Object,default:()=>{}}},emits:["update:showModifyDepositLog"],setup(e,{emit:F}){const R=e;let x=a([]);const L=a(!1);t(()=>R.showModifyDepositLog,e=>{e&&(S(),U())});const E=o({columns:[{label:"ID",prop:"id"},{label:"加减前预付",prop:"before_money"},{label:"加/减",prop:"index",slot:"pay_type_slot",width:"200px"},{label:"加减后预付",prop:"after_money"},{prop:"flow_amount",label:"来源",align:"center"},{label:"添加时间",prop:"create_time"}],searchFields:[{label:"类型",type:"select",prop:"op_type",value:"",options:x.value},{label:"添加时间",prop:"create_time",type:"date",dateType:"datetimerange",value:[]}],per_page:10,page:1,total:0,loading:!1}),k=F,M=()=>{k("update:showModifyDepositLog",!1)},S=async()=>{let e=await D();Object.keys(e).forEach(a=>{x.value.push({label:e[a],value:a})}),E.searchFields.forEach(e=>{"op_type"==e.prop&&(e.options=x.value)})},O=()=>{E.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),U()};const U=()=>{E.loading=!0;let e={limit:E.per_page,page:E.page,type:4,shop_id:R.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})},T=()=>{L.value=!0};return(a,t)=>{const o=v,j=g,D=w,F=f,R=y;return p(),l(h,null,[s(R,{"model-value":e.showModifyDepositLog,title:"预付日志",width:"70vw",onClose:M},{default:r(()=>[s(F,null,{header:r(()=>[s(o,{type:"warning",class:"title"},{default:r(()=>[d(m(e.currentRow.username)+"预付日志",1)]),_:1}),s(j,{type:"primary",onClick:T},{default:r(()=>t[4]||(t[4]=[d("结算日志")])),_:1,__:[4]})]),default:r(()=>[s(D,{type:"export",columns:n(E).columns,searchFields:n(E).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>n(E).searchFields=e),data:n(E).tableData,per_page:n(E).per_page,"onUpdate:per_page":t[1]||(t[1]=e=>n(E).per_page=e),page:n(E).page,"onUpdate:page":t[2]||(t[2]=e=>n(E).page=e),total:n(E).total,onGetTableData:U,onResetForm:O,loading:n(E).loading,showSelection:!1,showRightRefreshSlot:!1},{pay_type_slot:r(({row:e})=>{var a;return[i("div",null,[d(m(null==(a=n(x).find(a=>a.value==e.op_type))?void 0:a.label)+" ",1),e.money>0?(p(),u(o,{key:0,type:"primary"},{default:r(()=>[d("+"+m(e.money),1)]),_:2},1024)):c("",!0),e.money<=0?(p(),u(o,{key:1,type:"danger"},{default:r(()=>[d(m(e.money),1)]),_:2},1024)):c("",!0)])]}),_:1},8,["columns","searchFields","data","per_page","page","total","loading"])]),_:1})]),_:1},8,["model-value"]),s(b,{showSettlementLog:n(L),"onUpdate:showSettlementLog":t[3]||(t[3]=e=>_(L)?L.value=e:null),currentRow:e.currentRow},null,8,["showSettlementLog","currentRow"])],64)}}},[["__scopeId","data-v-477aa6f5"]]);export{F as default};