Browse Source

2024.06.17
- 提现申请页增加是否惠市宝结算字段显示;
- 对接查询惠市宝分账信息和惠市宝确认收货接口;

zweiqin 9 months ago
parent
commit
c6897a75c8

+ 19 - 2
src/api/withdrawal.js

@@ -19,6 +19,24 @@ export function withdrawalGetById(data) {
   })
 }
 
+// 查询惠市宝订单的分账信息
+export function getWithdrawalHsbOrderDistribution(params) {
+  return request({
+    url: '/withdrawal/getHsbOrderDistribution',
+    method: 'get',
+    params
+  })
+}
+
+// 针对惠市宝订单的结算尝试确认收货
+export function updateWithdrawalTryConfirmSn(params) {
+  return request({
+    url: '/withdrawal/tryConfirmHsbOrderBySettlementSn',
+    method: 'get',
+    params
+  })
+}
+
 // 提现申请处理
 export function withdrawalHandle(data) {
   return request({
@@ -28,7 +46,6 @@ export function withdrawalHandle(data) {
   })
 }
 
-
 // 支付流水号查询
 export function getPaymentNumber(data) {
   return request({
@@ -36,4 +53,4 @@ export function getPaymentNumber(data) {
     method: 'post',
     data
   })
-}
+}

+ 5 - 2
src/views/active/combinationActivities/components/EditModal.vue

@@ -143,8 +143,8 @@ export default {
     handleOpen(params = {}) {
       this.modalOptions.title = params.composeId ? '编辑组合活动' : '添加组合活动'
       this.formData = Object.assign(this.$options.data().formData, params, {
-        dateTime1: params.signStartTime || params.signEndTime ? [params.signStartTime, params.signEndTime] : '',
-        dateTime2: params.startTime || params.endTime ? [params.startTime, params.endTime] : ''
+        dateTime1: params.signTime ? params.signTime.split('~') : '',
+        dateTime2: params.time ? params.time.split('~') : ''
       })
       this.visible = true
       this.initList()
@@ -174,6 +174,9 @@ export default {
           bondMoney: res.data.bondMoney || '',
           shops: res.data.shops || null,
           products: res.data.products || null
+        }, {
+          dateTime1: res.data.signStartTime || res.data.signEndTime ? [res.data.signStartTime, res.data.signEndTime] : '',
+          dateTime2: res.data.startTime || res.data.endTime ? [res.data.startTime, res.data.endTime] : ''
         })
         this.$nextTick(() => {
           this.$refs.formData && this.$refs.formData.validate()

+ 4 - 4
src/views/active/combinationActivities/index.vue

@@ -42,15 +42,15 @@
         v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
         v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
       >
-        <el-table-column prop="composeName" label="活动名称" width="220" />
+        <el-table-column prop="composeName" label="活动名称" width="120" show-overflow-tooltip />
         <el-table-column prop="content" label="活动内容" align="center" />
         <el-table-column prop="shops" label="参与商家数" align="center" />
         <el-table-column prop="products" label="商品数量" align="center" />
-        <el-table-column label="报名时间" align="center" prop="signTime">
+        <el-table-column label="报名时间" align="center" width="140" prop="signTime">
         </el-table-column>
-        <el-table-column label="活动起止时间" align="center" prop="time">
+        <el-table-column label="活动起止时间" align="center" width="140" prop="time">
         </el-table-column>
-        <el-table-column label="活动状态" align="center">
+        <el-table-column label="活动状态" align="center" width="120">
           <template slot-scope="scope">
             <span v-if="scope.row.state == 0">报名未开始</span>
             <span v-if="scope.row.state == 1">报名进行中</span>

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

@@ -45,11 +45,29 @@
             <el-table-column align="center" width="150" prop="sn" label="结算编号" show-overflow-tooltip />
             <el-table-column align="center" label="结算状态" prop="state">
               <template slot-scope="{ row }">
-                <el-tag v-if="row.state === 0" effect="plain" type="info">未清算</el-tag>
-                <el-tag v-else-if="row.state === 1" effect="plain" type="success">已清算</el-tag>
+                <el-tag v-if="row.state === '0'" effect="plain" type="info">未清算</el-tag>
+                <el-tag v-else-if="row.state === '1'" effect="plain" type="success">已清算</el-tag>
                 <span v-else>--</span>
               </template>
             </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>
+                    <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>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column align="center" width="100" prop="totalPrice" label="总金额" />
             <el-table-column align="center" width="100" prop="withdrawaledAmount" label="已提现金额" show-overflow-tooltip />
             <el-table-column align="center" width="100" prop="withdrawalingAmount" label="提现中的金额" show-overflow-tooltip />
@@ -66,6 +84,8 @@
           </el-table>
           <!-- 关联订单 -->
           <RelatedOrders ref="RelatedOrders" />
+          <!-- 订单的分账状态信息 -->
+          <LedgerInformation ref="LedgerInformation" @success="getInfo(formData.withdrawalId)" />
         </div>
         <div v-else style="font-size: 16px;font-weight: bold;">无结算数据</div>
       </el-tab-pane>
@@ -75,12 +95,14 @@
 
 <script>
 import RelatedOrders from './RelatedOrders'
+import LedgerInformation from './LedgerInformation'
 import { withdrawalGetById } from '@/api/withdrawal'
 
 export default {
   name: 'DetailModal',
   components: {
-    RelatedOrders
+    RelatedOrders,
+    LedgerInformation
   },
   data() {
     return {
@@ -91,6 +113,7 @@ export default {
       },
       visible: false,
       formData: {
+        withdrawalId: '',
         shopName: '',
         shopCode: '',
         bankName: '',
@@ -124,6 +147,7 @@ export default {
       try {
         const res = await withdrawalGetById({ withdrawalId: id })
         this.formData = Object.assign(this.$options.data().formData, res.data, {
+          withdrawalId: res.data.withdrawalId || '',
           shopName: res.data.shopName || '',
           shopCode: res.data.shopCode || '',
           bankName: res.data.bankName || '',

+ 171 - 0
src/views/finance/withdrawal/components/LedgerInformation.vue

@@ -0,0 +1,171 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <div>
+      <div style="display: flex;justify-content: flex-end;padding: 0 0 10px;">
+        <el-button
+          v-if="formData.relatedOrders[orderSn] && formData.relatedOrders[orderSn].some(i => i.cerePayLog.Sub_Acc_Stcd === '01')"
+          type="danger" size="medium"
+          @click="handleConfirmSn()"
+        >
+          三方订单确认
+        </el-button>
+      </div>
+      <div>
+        <el-table
+          v-loading="!formData.relatedOrders[orderSn]" height="60vh" element-loading-text="暂无关联订单数据"
+          :data="formData.relatedOrders[orderSn]"
+          v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+        >
+          <el-table-column align="center" min-width="80" prop="orderId" label="订单ID" />
+          <el-table-column align="center" min-width="100" prop="cerePayLog.transactionId" label="三方交易流水号" show-overflow-tooltip />
+          <el-table-column align="center" min-width="120" label="分账处理状态" prop="cerePayLog.Sub_Acc_Stcd">
+            <template slot-scope="{ row }">
+              <span v-if="row.cerePayLog.Sub_Acc_Stcd === '00'">成功</span>
+              <span v-else-if="row.cerePayLog.Sub_Acc_Stcd === '01'">失败</span>
+              <span v-else>--</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" min-width="100" prop="cerePayLog.Err_Inf" label="错误信息" show-overflow-tooltip />
+        </el-table>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getWithdrawalHsbOrderDistribution, updateWithdrawalTryConfirmSn } from '@/api/withdrawal'
+
+export default {
+  name: 'LedgerInformation',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '1100px',
+        title: '查看惠市宝订单的分账信息'
+      },
+      visible: false,
+      formData: {
+        withdrawalId: '',
+        relatedSettlement: [],
+        relatedOrders: {},
+        relatedPresenterVoucherLogs: {},
+        relatedCommissionLogs: {},
+        relatedBuyerUsers: []
+      },
+      orderSn: '' // 结算编号
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    async initList() {
+      this.formData.relatedOrders[this.orderSn] = this.formData.relatedOrders[this.orderSn].map((item) => {
+        item.cerePayLog = Object.assign({
+          id: '',
+          shopId: '',
+          orderFormid: '',
+          outTradeNo: '',
+          transactionId: '', // 支付订单三方编号。三方交易流水号
+          outRefundNo: '',
+          totalFee: '',
+          refundFee: '',
+          userId: '',
+          state: '',
+          remark: '',
+          paymentMode: '',
+          after: '',
+          createTime: '',
+          extInfo: '',
+          hsbSplitState: '',
+          hsbHandlingFee: ''
+        }, item.cerePayLog || {}, {
+          Sign_Inf: '',
+          Rsp_Inf: '',
+          Svc_Rsp_Cd: '',
+          Svc_Rsp_St: '',
+          Py_Trn_No: '',
+          Sub_Acc_Stcd: '', // 该笔订单的分账处理状态 00-分账处理成功(分账处理成功,会有部分商家因收款账号异常导致分账失败) 01-分账处理失败
+          Ittparty_Tms: '',
+          Ittparty_Jrnl_No: '',
+          Err_Inf: '' // 错误信息。分账处理状态为01时有值
+        })
+        return item
+      })
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        for (let index = 0; index < this.formData.relatedOrders[this.orderSn].length; index++) {
+          await getWithdrawalHsbOrderDistribution({
+            transactionId: this.formData.relatedOrders[this.orderSn][index].cerePayLog.transactionId
+          }).then((res) => {
+            this.formData.relatedOrders[this.orderSn][index].cerePayLog.Sign_Inf = res.data.Sign_Inf
+            this.formData.relatedOrders[this.orderSn][index].cerePayLog.Rsp_Inf = res.data.Rsp_Inf
+            this.formData.relatedOrders[this.orderSn][index].cerePayLog.Svc_Rsp_Cd = res.data.Svc_Rsp_Cd
+            this.formData.relatedOrders[this.orderSn][index].cerePayLog.Svc_Rsp_St = res.data.Svc_Rsp_St
+            this.formData.relatedOrders[this.orderSn][index].cerePayLog.Py_Trn_No = res.data.Py_Trn_No
+            this.formData.relatedOrders[this.orderSn][index].cerePayLog.Sub_Acc_Stcd = res.data.Sub_Acc_Stcd
+            this.formData.relatedOrders[this.orderSn][index].cerePayLog.Ittparty_Tms = res.data.Ittparty_Tms
+            this.formData.relatedOrders[this.orderSn][index].cerePayLog.Ittparty_Jrnl_No = res.data.Ittparty_Jrnl_No
+            this.formData.relatedOrders[this.orderSn][index].cerePayLog.Err_Inf = res.data.Err_Inf
+          })
+        }
+        console.log(this.formData.relatedOrders[this.orderSn])
+      } finally {
+        loading.close()
+      }
+    },
+    handleOpen(params = {}, orderSn) {
+      this.formData = Object.assign(this.$options.data().formData, JSON.parse(JSON.stringify(params)))
+      this.orderSn = orderSn
+      this.initList()
+      if (params.withdrawalId) {
+        // this.getInfo(params.withdrawalId)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await xxx({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          withdrawalId: res.data.withdrawalId || ''
+        })
+      } finally {
+        loading.close()
+      }
+    },
+
+    handleConfirmSn() {
+      this.$confirm('确定尝试三方订单确认?', '确认收货')
+        .then(async () => {
+          await updateWithdrawalTryConfirmSn({ sn: this.orderSn })
+          this.$message({ message: '操作成功!', type: 'success' })
+          this.$emit('success')
+          this.visible = false
+        })
+        .catch(() => { })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.small-padding {
+	.cell {
+		padding-left: 5px;
+		padding-right: 5px;
+	}
+}
+
+.fixed-width {
+	.el-button--mini {
+		padding: 7px 10px;
+	}
+}
+</style>
+

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

@@ -90,7 +90,7 @@
 
 import WithdrawalProcessing from './components/WithdrawalProcessing'
 import DetailModal from './components/DetailModal'
-import { withdrawalGetAll, withdrawalGetById, withdrawalHandle } from '@/api/withdrawal'
+import { withdrawalGetAll } from '@/api/withdrawal'
 export default {
   name: 'Withdrawal',
   components: {