123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410 |
- <template>
- <div class="payment-info">
- <InfoCard title="回款概览">
- <div class="payment-info-content">
- <div class="payment-info-item">
- 回款状态:{{ returnStatus || '-' }}
- </div>
- <div class="payment-info-item">
- 已回款金额:{{'¥' + returnAmount(returnRes?.returnMoney) || '-'}}
- </div>
- <div class="payment-info-item">
- 未回款金额:{{ '¥' + returnAmount(returnRes?.remainingMoney) || '-' }}
- </div>
- </div>
- </InfoCard>
- <InfoCard title="回款交易详情" :length="paymentDetailList.length || 0" :is-show-length="true">
- <div class="payment-info-content">
- <TableCard
- class="payment-info-content-table"
- :table-data="paymentDetailList"
- :columns="paymentDetailColumns"
- width="1108px"
- >
- <template v-slot:return_voucher_url="{ row }">
- <span v-if="row.row.return_voucher_url" @click="vouched(row.row.return_voucher_url)" class="column-cell">点击查看</span>
- <span v-else>-</span>
- </template>
- </TableCard>
- </div>
- </InfoCard>
- <InfoCard v-if="orderTransfer.length" title="用户自助下单对公转账">
- <div class="payment-info-content">
- <TableCard
- class="payment-info-content-table"
- :table-data="orderTransfer"
- :columns="transerColumns"
- width="1108px"
- >
- <template v-slot:voucher="{ row }">
- <span @click="vouched(row.row.voucher)" class="column-cell">点击查看</span>
- </template>
- <template v-slot:action="{ row }">
- <span v-if="row.row.state !== 1 && row.row.state !== 2" @click="payShenHe" class="column-cell">审核</span>
- <span v-else>-</span>
- </template>
- </TableCard>
- </div>
- </InfoCard>
- <newDetailModel
- ref="paymentDetailModel"
- :order-detail="orderData"
- @refresh="doRefresh"
- ></newDetailModel>
- </div>
- </template>
- <script>
- import InfoCard from '../../ui/InfoCard.vue';
- import TableCard from '../../ui/TableCard.vue';
- import newDetailModel from '../newDetailModel.vue';
- import { mapState } from 'vuex';
- export default {
- name: 'PaymentInfo',
- components: {
- InfoCard,
- TableCard,
- newDetailModel
- },
- data() {
- const defaultRender = (val) => val || '-';
- return {
- paymentDetailColumns: [
- {
- label: '回款时间',
- prop: 'return_time',
- width: '112',
- render: (row) => {
- return this.isBackstageOrder === 1 ? this.formatDate(row.return_time) : defaultRender(row.pay_time)
- }
- },
- {
- label: '回款金额',
- prop: 'return_money',
- width: '90',
- render: (row) => {
- if(this.isBackstageOrder === 1) {
- return row.return_money ? '¥' + this.returnAmount(row.return_money) : this.returnAmount(0)
- } else {
- return row.pay_money ? '¥' + this.returnAmount(row.pay_money) : this.returnAmount(0)
- }
- }
- },
- {
- label: '支付方式',
- prop: 'return_type',
- width: '90',
- render (row) {
- const payCashStatus = [
- { v: '1', n: '微信支付' },
- { v: '2', n: '支付宝支付' },
- { v: '3', n: '对公转账' },
- { v: '4', n: '第三方平台' }
- ]
- if(row?.return_type) {
- return payCashStatus.find(item => item.v === String(row.return_type))?.n || '-'
- } else {
- return row.pay_way || '-'
- }
- }
- },
- {
- label: '手续费',
- prop: 'procedures_money',
- width: '90',
- render: (row) => {
- return row.procedures_money ? '¥' + this.returnAmount(row.procedures_money) : this.returnAmount(0)
- }
- },
- {
- label: '回款银行',
- prop: 'bank_name',
- width: '120',
- render (row) {
- return defaultRender(row.bank_name)
- }
- },
- {
- label: '支付单号/银行流水号',
- prop: 'return_code',
- width: '112',
- render (row) {
- return row.bank_flow || row.return_code
- }
- },
- {
- label: '支付户名',
- prop: 'pay_account_name',
- width: '90',
- render (row) {
- return defaultRender(row.pay_account_name)
- }
- },
- {
- label: '流水金额',
- prop: 'flow_money',
- width: '90',
- render: (row) => {
- return row.flow_money ? '¥' + this.returnAmount(row.flow_money) : this.returnAmount(0)
- }
- },
- {
- label: '支付凭证',
- prop: 'return_voucher_url',
- width: '90'
- },
- {
- label: '操作时间',
- prop: 'operate_time',
- width: '112',
- render: (row) => {
- return defaultRender(row.operate_time)
- }
- },
- {
- label: '操作人',
- prop: 'operate_person',
- width: '90',
- render: (row) => {
- return defaultRender(row.operate_person)
- }
- },
- {
- label: '回款说明',
- prop: 'return_remark',
- width: '202',
- render (row) {
- return defaultRender(row.return_remark)
- }
- }
- ],
- paymentDetailList_: [
- {
- return_time: '2023-12-31 13:21:32',
- paymoney: '点击查看',
- return_type: '微信支付',
- // commission: '¥100.00',
- bank_name: '广发银行北京顺义支行',
- bank_flow: '094640260820',
- pay_account_name: '张三',
- flow_money: '¥2,000.00',
- operate_time: '2023-12-31 13:21:32',
- operate_person: '张三',
- return_remark: '备注'
- }
- ],
- transerColumns: [
- {
- label: '提交时间',
- prop: 'create_time',
- render (row) {
- return defaultRender(row.create_time)
- }
- },
- {
- label: '支付凭证',
- prop: 'voucher',
- },
- {
- label: '审核状态',
- prop: 'state',
- render (row) {
- if(row.state == 1) {
- return '审核通过'
- } else if(row.state == 2) {
- return '审核失败'
- } else {
- return '待审核'
- }
- }
- },
- {
- label: '审核时间',
- prop: 'update_time',
- render (row) {
- return defaultRender(row.update_time)
- }
- },
- {
- label: '操作人',
- prop: 'audit_person',
- render (row) {
- return defaultRender(row.audit_person)
- }
- },
- {
- label: '操作',
- prop: 'action'
- }
- ],
- orderTransfer_: [
- {
- create_time: '2023-12-31 13:21:32',
- voucher: '点击查看',
- state: '审核通过',
- update_time: '2023-12-31 13:21:32',
- audit_person: '张三',
- action: '审核',
- }
- ],
- }
- },
- computed: {
- ...mapState({
- orderDetail: state => state.order.orderDetail
- }),
- // 是否是管理后台创建的订单 1为是 0不是
- isBackstageOrder () {
- return this.orderData?.is_backstage_order || 0;
- },
- returnStatus() {
- const val = this.orderData?.return_status || 0;
- if (val == 0) {
- return '未回款'
- } else if (val == 1) {
- return '全额回款'
- } else if (val == 2) {
- return '部分回款'
- } else {
- return '未回款'
- }
- },
- returnRes () {
- return this.orderDetail?.returnRes || {};
- },
- orderData() {
- return this.orderDetail?.orderData || {};
- },
- paymentDetailList() {
- const list = this.returnRes?.returnInfo || [];
- const orderData = this.orderData || {};
- const { pay_time, pay_money, order_status, pay_way, procedures_money } = orderData;
- if (!this.isBackstageOrder) {
- // 构建基础支付信息对象
- const baseInfo = {
- pay_time: pay_time ?? '-',
- pay_money: pay_money ?? '-',
- order_status: order_status ?? '-',
- pay_way: pay_way ?? '-',
- procedures_money
- };
- if (list.length) {
- // 返回新对象,避免修改原始 list 中的对象
- return [{
- ...list[0],
- ...baseInfo
- }];
- }
- return [baseInfo];
- }
- return list;
- },
- orderTransfer () {
- return this.orderDetail?.orderTransfer || [];
- }
- },
- methods: {
- returnAmount(val) {
- if (!val) return 0;
- val = Number(val)
- const amount = (val / 100).toFixed(2) || 0;
- return amount;
- },
- formatDate(timeString) {
- if (!timeString) return '-';
- // 只取空格前的日期部分
- return timeString.split(' ')[0];
- },
- setReturnType(val) {
- if (val === 1) {
- return '微信支付'
- } else if(val === 2) {
- return '支付宝支付'
- } else if(val === 3) {
- return '对公转账'
- } else {
- return '未回款'
- }
- },
- payShenHe() {
- this.$refs.paymentDetailModel.sShow = true;
- },
- vouched(val) {
- if (val) {
- const urls = location.origin + val;
- window.open(urls, '_blank')
- }
- },
- doRefresh(type) {
- this.$emit('refresh', type)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .payment-info {
- background: #F2F2F4;
- ::v-deep {
- .info-card {
- margin-bottom: 16px;
- }
- }
- .payment-info-content {
- width: 1108px;
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- }
- .payment-info-item{
- margin-right: 32px;
- min-width: 255px;
- font-size: 14px;
- line-height: 22px;
- color: $gray_10;
- }
- .payment-info-content-table {
- border-radius: 4px;
- ::v-deep {
- .el-table__body-wrapper {
- &::-webkit-scrollbar {
- display: block; /* 强制显示滚动条 */
- height: 8px;
- }
- &::-webkit-scrollbar-thumb {
- background-color: rgba(0, 0, 0, 0.2);
- border-radius: 4px;
- }
- }
- .cell {
- text-align: center;
- font-size: 14px;
- color: $gray_10;
- font-weight: 400;
- }
- .has-gutter {
- th {
- background: #F9FAFB;
- .cell {
- padding: 0;
- color: #686868;
- }
- }
- }
- .column-cell {
- color: $color_main;
- cursor: pointer;
- }
- }
- }
- .num-active {
- color: $color_main;
- }
- }
- </style>
|