sf_web_dist/js/supplier-settlement.1760610250010Bq0dCXo_.js
2025-10-16 18:25:16 +08:00

2 lines
4.9 KiB
JavaScript

import{_ as e}from"./index.1760610250010CyNivo-T.js";import{b3 as a,bu as t,r as l,ag as o,de as r,b5 as n,c as s,e as p,N as d,w as u,bO as m,bM as i,l as c,t as _,g,an as y,O as b}from"./index.1760610250010Dq9RNfpE.js";import{E as f}from"./el-card.1760610250010D9fOb9vz.js";import{g as v}from"./payee-count.1760610250010BrMT2V-u.js";import{p as h}from"./common.1760610250010CCwWzMi9.js";/* empty css */import"./el-col.1760610250010p35WrljF.js";const Y=a({__name:"supplier-settlement",setup(a){t({legacy:!0});const Y=l("create_time"),D=l("DESC"),w=o({columns:[{prop:"supplier_id",label:"供应商编号",align:"center"},{prop:"supplier_name",label:"供应商名称",align:"center"},{prop:"flow_money",label:"流水金额",align:"center",sortable:"custom",formatter:h,needCount:!0},{prop:"sum_money",label:"跑量金额",align:"center",sortable:"custom",formatter:h,needCount:!0},{prop:"sum_three_money",label:"实际入金额",align:"center",sortable:"custom",formatter:h,needCount:!0},{prop:"sum_three_fee",label:"成本",align:"center",sortable:"custom",formatter:h,needCount:!0},{prop:"account_money",label:"应下发金额",align:"center",slot:"count_money_slot",needCount:!0},{prop:"account_sum_money",label:"总预付金额",align:"center",slot:"sum_money_slot",needCount:!0},{prop:"account_prepay_money",label:"剩余预付",align:"center",slot:"prepay_money_slot",needCount:!0},{prop:"succ_num",label:"成功订单笔数",align:"center",sortable:"custom",needCount:!0}],tableData:[],searchFields:[{prop:"supplier_query",label:"供应商编号/名称",type:"input",value:""},{prop:"create_time",label:"时间范围",type:"date",dateType:"datetimerange",value:[r().startOf("day").format("YYYY-MM-DD HH:mm:ss"),r().endOf("day").format("YYYY-MM-DD HH:mm:ss")]}],total:0,page:1,per_page:50,loading:!1,sum_data:[]}),C=l([]),F=()=>{w.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),x()};function M(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}n(()=>{x()});const x=()=>{w.searchFields.forEach(e=>{"datetimerange"!=e.dateType||e.value||(e.value=[r().startOf("day").format("YYYY-MM-DD HH:mm:ss"),r().endOf("day").format("YYYY-MM-DD HH:mm:ss")])}),w.loading=!0;let e={limit:w.per_page,page:w.page,orderBy:Y.value,orderType:D.value,type:"1"},a=M(w.searchFields);v(Object.assign(e,a)).then(e=>{w.tableData=e.data,w.total=e.total,w.loading=!1,w.sum_data=e.sum}).catch(()=>{w.loading=!1})},H=()=>{w.searchFields.forEach(e=>{"datetimerange"!=e.dateType||e.value||(e.value=[r().startOf("day").format("YYYY-MM-DD HH:mm:ss"),r().endOf("day").format("YYYY-MM-DD HH:mm:ss")])}),w.loading=!0;let e={limit:w.per_page,page:w.page,orderBy:Y.value,orderType:D.value,type:"1",export:"1",saiType:"all"},a=M(w.searchFields);v(Object.assign(e,a)).then(e=>{w.tableData=e.data,w.total=e.total,w.loading=!1,w.sum_data=e.sum}).catch(()=>{w.loading=!1})},O=e=>{Y.value=e.prop,D.value="descending"==e.order?"DESC":"ASC",x()},j=async e=>{C.value=[];let a={supplier_id:e.supplier_id,limit:"1000",page:1,type:"3",create_time:w.searchFields[1].value},t=await v(a);e.tableData=t.data};return(a,t)=>{const l=y,o=i,r=m,n=f,v=e;return p(),s("div",null,[d(v,{type:"export",columns:g(w).columns,searchFields:g(w).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>g(w).searchFields=e),data:g(w).tableData,per_page:g(w).per_page,"onUpdate:per_page":t[1]||(t[1]=e=>g(w).per_page=e),page:g(w).page,"onUpdate:page":t[2]||(t[2]=e=>g(w).page=e),total:g(w).total,onGetTableData:x,onResetForm:F,loading:g(w).loading,showSelection:!1,showRightRefreshSlot:!1,showExpand:!0,expandWidth:120,expandLabel:"供应商渠道跑量",onSortChange:O,onExpandChange:j,showSummary:!0,sum_data:g(w).sum_data},{"search-btns":u(()=>[d(l,{type:"danger",onClick:H},{default:u(()=>t[3]||(t[3]=[b("导出数据")])),_:1,__:[3]})]),prepay_money_slot:u(({row:e})=>{var a;return[c("div",null,_(g(h)(null==(a=null==e?void 0:e.account)?void 0:a.prepay_money)),1)]}),count_money_slot:u(({row:e})=>{var a;return[c("div",null,_(g(h)(null==(a=null==e?void 0:e.account)?void 0:a.money)),1)]}),sum_money_slot:u(({row:e})=>{var a;return[c("div",null,_(g(h)(null==(a=null==e?void 0:e.account)?void 0:a.sum_money)),1)]}),expand:u(({row:e})=>[d(n,{style:{margin:"20px"}},{header:u(()=>t[4]||(t[4]=[c("div",{class:"card-title"},"供应商渠道跑量",-1)])),default:u(()=>[d(r,{data:e.tableData,border:""},{default:u(()=>[d(o,{prop:"api_name",label:"渠道"}),d(o,{prop:"flow_money",label:"流水"},{default:u(({row:e})=>[c("div",null,_(g(h)(e.flow_money)),1)]),_:2},1024),d(o,{prop:"sum_money",label:"跑量"},{default:u(({row:e})=>[c("div",null,_(g(h)(e.sum_money)),1)]),_:2},1024),d(o,{prop:"sum_three_money",label:"入账"},{default:u(({row:e})=>[c("div",null,_(g(h)(e.sum_three_money)),1)]),_:2},1024),d(o,{prop:"succ_num",label:"成功笔数"})]),_:2},1032,["data"])]),_:2},1024)]),_:1},8,["columns","searchFields","data","per_page","page","total","loading","sum_data"])])}}},[["__scopeId","data-v-5d99c888"]]);export{Y as default};