Browse Source

2024.10.29 - 添加代金券提现详情的出入账列表

GuYun-D 5 months ago
parent
commit
cd96a4d6fc

+ 10 - 0
src/api/withdrawal.js

@@ -19,6 +19,16 @@ export function withdrawalGetById(data) {
   })
 }
 
+// 代金券提现查看
+export function withdrawalGetById2(data) {
+  return request({
+    url: '/withdrawal/getById2',
+    method: 'post',
+    data
+  })
+}
+
+
 // 查询惠市宝订单的分账信息
 export function getWithdrawalHsbOrderDistribution(params) {
   return request({

+ 47 - 27
src/views/finance/withdrawal/components/DetailModal.vue

@@ -63,11 +63,14 @@
       </el-descriptions>
     </div>
 
-    <el-tabs value="relatedSettlement">
-      <el-tab-pane label="结算列表" name="relatedSettlement">
-        <div v-if="formData.relatedSettlement && formData.relatedSettlement.length" style="margin-top: 32px;">
+    <el-tabs :value="tabsValue">
+      <el-tab-pane label="结算列表" name="relatedSettlement" v-if="![3, 4].includes(formData.withdrawalType)">
+        <div v-if="formData.relatedSettlement && formData.relatedSettlement.length" style="margin-top: 32px">
           <el-table
-            v-loading="!formData.relatedSettlement.length" height="60vh" element-loading-text="暂无结算数据" :data="formData.relatedSettlement"
+            v-loading="!formData.relatedSettlement.length"
+            height="60vh"
+            element-loading-text="暂无结算数据"
+            :data="formData.relatedSettlement"
             v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
           >
             <el-table-column align="center" min-width="80" prop="id" label="ID" show-overflow-tooltip />
@@ -86,17 +89,13 @@
             </el-table-column>
             <el-table-column align="center" min-width="140" label="是否惠市宝订单结算" prop="isHsb">
               <template slot-scope="{ row }">
-                <div style="display: flex;justify-content: center;align-items: center;">
+                <div style="display: flex; justify-content: center; align-items: center">
                   <div>
                     <el-tag v-if="row.isHsb === '0'" effect="plain" type="info">否</el-tag>
                     <el-tag v-else-if="row.isHsb === '1'" effect="plain" type="success">是</el-tag>
                     <span v-else>--</span>
                   </div>
-                  <el-button
-                    v-if="row.isHsb === '1'"
-                    style="margin-left: 6px;" type="warning" size="mini"
-                    @click="$refs.LedgerInformation && $refs.LedgerInformation.handleOpen(formData, row.sn)"
-                  >
+                  <el-button v-if="row.isHsb === '1'" style="margin-left: 6px" type="warning" size="mini" @click="$refs.LedgerInformation && $refs.LedgerInformation.handleOpen(formData, row.sn)">
                     分账状态
                   </el-button>
                 </div>
@@ -107,12 +106,7 @@
             <el-table-column align="center" width="100" prop="withdrawalingAmount" label="提现中的金额" show-overflow-tooltip />
             <el-table-column align="center" label="操作" width="120" fixed="right" class-name="small-padding fixed-width">
               <template slot-scope="{ row }">
-                <el-button
-                  v-if="formData.relatedOrders[row.sn]" type="success" size="mini"
-                  @click="$refs.RelatedOrders && $refs.RelatedOrders.handleOpen(formData, row.sn)"
-                >
-                  关联订单
-                </el-button>
+                <el-button v-if="formData.relatedOrders[row.sn]" type="success" size="mini" @click="$refs.RelatedOrders && $refs.RelatedOrders.handleOpen(formData, row.sn)">关联订单</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -121,7 +115,20 @@
           <!-- 订单的分账状态信息 -->
           <LedgerInformation ref="LedgerInformation" @success="getInfo(formData.withdrawalId)" />
         </div>
-        <div v-else style="font-size: 16px;font-weight: bold;">无结算数据</div>
+        <div v-else style="font-size: 16px; font-weight: bold">无结算数据</div>
+      </el-tab-pane>
+
+      <el-tab-pane v-if="[3, 4].includes(formData.withdrawalType)" label="入账列表" name="entry">
+        <el-table :data="formData.withdrawalType === 3 ? formData.shopVoucherEntryRecordList : formData.shopVoucherExchangeEntryRecordList" border stripe>
+          <el-table-column align="center" prop="orderFormId" label="来源订单号"></el-table-column>
+          <el-table-column align="center" prop="number" label="代金券数量"></el-table-column>
+        </el-table>
+      </el-tab-pane>
+      <el-tab-pane v-if="[3, 4].includes(formData.withdrawalType)" label="出账列表" name="disbursement">
+        <el-table :data="formData.withdrawalType === 3 ? formData.shopVoucherOutgoinRecordList : formData.shopVoucherExchangeOutgoinRecordList" border stripe>
+          <el-table-column align="center" prop="orderFormId" label="来源订单号"></el-table-column>
+          <el-table-column align="center" prop="number" label="代金券数量"></el-table-column>
+        </el-table>
       </el-tab-pane>
     </el-tabs>
   </el-dialog>
@@ -130,7 +137,7 @@
 <script>
 import RelatedOrders from './RelatedOrders'
 import LedgerInformation from './LedgerInformation'
-import { withdrawalGetById } from '@/api/withdrawal'
+import { withdrawalGetById, withdrawalGetById2 } from '@/api/withdrawal'
 
 export default {
   name: 'DetailModal',
@@ -146,6 +153,7 @@ export default {
         title: '查看提现详情'
       },
       visible: false,
+      tabsValue: 'relatedSettlement',
       formData: {
         withdrawalId: '',
         shopName: '',
@@ -185,7 +193,16 @@ export default {
     async getInfo(id) {
       const loading = this.$loading({ text: '加载中' })
       try {
-        const res = await withdrawalGetById({ withdrawalId: id })
+        let api = null
+        if (![3, 4].includes(this.formData.withdrawalType)) {
+          api = withdrawalGetById
+          this.tabsValue = 'relatedSettlement'
+        } else {
+          api = withdrawalGetById2
+          this.tabsValue = 'entry'
+        }
+
+        const res = await api({ withdrawalId: id })
         this.formData = Object.assign(this.$options.data().formData, res.data, {
           withdrawalId: res.data.withdrawalId || '',
           shopName: res.data.shopName || '',
@@ -207,8 +224,11 @@ export default {
           summaryHsbSplitState: res.data.summaryHsbSplitState,
           summaryHsbSplitedAmount: res.data.summaryHsbSplitedAmount,
           summaryHsbSplitRemainAmount: res.data.summaryHsbSplitRemainAmount,
-          summaryNotHsbAmount: res.data.summaryNotHsbAmount
+          summaryNotHsbAmount: res.data.summaryNotHsbAmount,
+          withdrawalType: this.formData.withdrawalType
         })
+
+        console.log('caole1', this.formData.shopVoucherEntryRecordList)
       } finally {
         loading.close()
       }
@@ -229,15 +249,15 @@ export default {
 // 	}
 // }
 .small-padding {
-	.cell {
-		padding-left: 5px;
-		padding-right: 5px;
-	}
+  .cell {
+    padding-left: 5px;
+    padding-right: 5px;
+  }
 }
 
 .fixed-width {
-	.el-button--mini {
-		padding: 7px 10px;
-	}
+  .el-button--mini {
+    padding: 7px 10px;
+  }
 }
 </style>

+ 1 - 1
src/views/finance/withdrawal/index.vue

@@ -26,7 +26,7 @@
           <template slot-scope="{ row }">
             <el-tag v-if="row.withdrawalType === 1" effect="plain" type="info">普通订单</el-tag>
             <el-tag v-else-if="row.withdrawalType === 2" effect="plain" type="success">交易金</el-tag>
-            <el-tag v-else-if="row.withdrawalType === 3" effect="plain" type="warning">充值代金券提现</el-tag>
+            <el-tag v-else-if="row.withdrawalType === 3" effect="plain" type="warning">充值代金券</el-tag>
             <el-tag v-else-if="row.withdrawalType === 4" effect="plain" type="danger">兑换代金券</el-tag>
           </template>
         </el-table-column>