| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <template>
- <view id="cloud-job">
- <view class="title">企业账户:可用余额{{titleInfo.availableAmount}}元 待确认金额{{titleInfo.totalWaitConfirm}}元 帐户总金额{{titleInfo.amount}}元 待付款金额{{titleInfo.totalWaitPay}}元 成功支付金额{{titleInfo.totalSuccessPay}}元</view>
- <z-table :data="tableData" :keys="tableProps" :labels="tableHeaders" />
- </view>
- </template>
- <script>
- import tableMixin from '../mixins/table'
- const tableHeaders = [
- "项目名称",
- "付款类型",
- "用户昵称",
- "银行卡号",
- "税前应付",
- "平台服务费",
- "所得税费",
- "开发者净收入",
- "本次应付",
- "实际到账",
- "结算时间",
- "付款流水号",
- "付款时间",
- "操作",
- ]
- const tableProps = [
- "projectName",
- "payTypeShow",
- "nickname",
- "bankCode",
- "prePay",
- "servicePay",
- "getPay",
- "realGet",
- "current_gongmall",
- "amount",
- "create_time",
- "gongmall_order_id",
- "pay_timeShow",
- "state",
- ]
- export default {
- mixins: [tableMixin],
- data() {
- return {
- // 头部信息
- titleInfo: {},
- // 数据总条目
- totalCount: 0,
- // 当前页面
- currentPage: 1,
- // 列表头显示内容
- tableHeaders,
- // 列表头字段
- tableProps,
- // 列表数据
- tableData: [],
- }
- },
- mounted() {
- this.getTableData()
- },
- filters: {
- toDate(val) {
- return new Date(val * 1000).toLocaleDateString()
- },
- projectLink(i) {
- const type = i.entity_type
- let link = 'javascript:void(0);'
- if(type === '1') link = `/rooter/outsourceitem/${i.entity_id}>`
- else if(type === '3') link = `/rooter/wagedetails?job_id=${i.entity_id}`
- return link
- }
- },
- methods: {
- // 重新支付
- async rePay(i) {
- const res = await this.$post('/api/admin/gongmall/confirm_pay', {
- id: i.id,
- amount: i.current_gongmall,
- nickname: i.nickname,
- })
- if(res) {
- this.getTableData()
- }
- },
- // 确认支付
- confirmPay(i) {
- this.rePay(i)
- },
- // 页码变动
- changePagination() {
- this.getTableData()
- },
- // 格式化列表数据
- formatTableData(data, rData) {
- this.titleInfo = {
- availableAmount: rData.accountBalance.availableAmount,
- totalWaitConfirm: rData.totalWaitConfirm ? rData.totalWaitConfirm / 100 : '--',
- amount: rData.accountBalance.amount,
- totalWaitPay: rData.totalWaitPay ? rData.totalWaitPay / 100 : '--',
- totalSuccessPay: rData.totalSuccessPay ? rData.totalSuccessPay / 100 : '--',
- }
- return data.map(i => {
- let projectName = '--'
- let prePay = ''
- let servicePay = ''
- let getPay = ''
- let realGet = ''
- // 3 比较特殊,所以这样写
- if(i.entity_type === '3') {
- projectName = rData.periodList[i.entity_id].pro_name
- prePay = ((rData.periodList[i.entity_id].origin_price || 0) / 100).toFixed(2)
- servicePay = ((rData.periodList[i.entity_id].person_platform_fee || 0) / 100).toFixed(2)
- getPay = rData.periodList[i.entity_id].total_person_tax_fee || 0
- realGet = rData.periodList[i.entity_id].developer_fee || 0
- } else {
- if(i.entity_type === '1') projectName = rData.projectList[i.entity_id].pro_name
- prePay = ((rData.projectList[i.entity_id].origin_price || 0) / 100).toFixed(2)
- servicePay = ((rData.projectList[i.entity_id].person_platform_fee || 0) / 100).toFixed(2)
- getPay = rData.projectList[i.entity_id].total_person_tax_fee || 0
- realGet = rData.projectList[i.entity_id].developer_fee || 0
- }
- return {
- ...i,
- projectName,
- payTypeShow: i.pay_type === '1' ? '首付款' : '解冻款',
- bankCode: rData.bankAccounts[i.uid] || '--',
- prePay,
- servicePay,
- getPay,
- realGet,
- pay_timeShow: i.pay_time > 0 ? new Date(i.pay_time).toLocaleDateString() : '--',
- }
- })
- },
- // 获取列表数据
- async getTableData() {
- this.tableData = []
- const p = this.currentPage
- const res = await this.$post("/api/admin/gongmall/orders", { p })
- // console.log(res)
- const data = res.data
- const list = data.list
- this.tableData = this.formatTableData(list, data)
- this.totalCount = Number(data.total)
- this.totalPage = data.totalPage
- }
- }
- }
- </script>
- <style lang='less' scoped>
- #cloud-job {
- .table {
- height: 100%;
- height: calc(100% - 80px);
- }
- }
- </style>
|