Browse Source

add:同步支付

ct 3 days ago
parent
commit
f2c587a854

+ 8 - 0
src/api/hisStore/storePayment.js

@@ -85,3 +85,11 @@ export function oneClickShipping(data) {
     data: data
   })
 }
+
+//同步支付状态
+export function getStatus(paymentId) {
+  return request({
+    url: '/store/store/storePayment/getStatus/' + paymentId,
+    method: 'get'
+  })
+}

+ 25 - 0
src/views/hisStore/storePayment/index.vue

@@ -212,6 +212,12 @@
       <el-table-column label="备注" align="center" prop="remark" />
       <el-table-column label="操作" fixed="right" align="center" width="120px" class-name="small-padding fixed-width">
         <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handledetails(scope.row)"
+          >详情
+          </el-button>
           <el-button
             size="mini"
             type="text"
@@ -292,6 +298,12 @@
         <el-button @click="cancelRefund">取 消</el-button>
       </div>
     </el-dialog>
+    <el-drawer
+      :with-header="false"
+      size="75%"
+      :title="show.title" :visible.sync="show.open">
+      <payDetails  ref="payDetails" />
+    </el-drawer>
   </div>
 </template>
 
@@ -301,10 +313,16 @@ import { getCompanyList } from "@/api/company/company";
 import { listLiveOrderPayments,getLivePayment,updateLivePayment,exportLiveOrderPayments } from "@/api/live/liveOrderPayment";
 
 import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
+import payDetails from '@/views/hisStore/storePayment/payDetails.vue';
 export default {
   name: "HisStorePayment",
+  components: { payDetails },
   data() {
     return {
+      show:{
+        open:false,
+        title:"支付详情"
+      },
       appMallOptions:[],
       payModeOptions:[
         { dictLabel: "微信支付", dictValue: "wx" },
@@ -399,6 +417,13 @@ export default {
     this.getAppMallOptions();
   },
   methods: {
+    handledetails(row){
+      this.show.open=true;
+      setTimeout(() => {
+        this.$refs.payDetails.getDetails(row.paymentId);
+      }, 1);
+    },
+
     // 获取小程序选项列表
     getAppMallOptions() {
       getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {

+ 166 - 0
src/views/hisStore/storePayment/payDetails.vue

@@ -0,0 +1,166 @@
+<template>
+<div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
+    <div style="padding: 20px; background-color: #fff;">
+      支付详情
+    </div>
+<div class="contentx" v-if="item!=null">
+      <div class="desct">
+        支付信息
+      </div>
+
+        <div class="" v-if="item.status==0" style="float: right;margin: 5px;">
+           <el-button size="mini" @click="getPayStatus()" >同步支付状态</el-button>
+        </div>
+        <div class="" v-if="item.status>=0" style="float: right; margin: 5px;" v-hasPermi="['his:storePayment:refund']" >
+           <el-button size="mini" @click="payRefund()" >退款</el-button>
+        </div>
+        <el-descriptions title="" :column="3" border>
+            <el-descriptions-item label="支付订单号" >
+                <span v-if="item!=null">{{item.payCode}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="支付类型" >
+                <span v-if="item!=null">{{item.payTypeCode}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="支付金额" >
+                <span v-if="item!=null">{{item.payMoney}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="外部订单号" >
+                <span v-if="item!=null">{{item.tradeNo}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="用户昵称" >
+                <span v-if="item!=null">{{item.nickName}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="OPENID" >
+                <span v-if="item!=null">{{item.openId}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="用户电话" >
+                <span v-if="item!=null">{{item.phone}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="店铺名称" >
+                <span v-if="item!=null">{{item.storeName}}</span>
+            </el-descriptions-item>
+
+            <el-descriptions-item label="交易单号" >
+                <span v-if="item!=null">{{item.bankTransactionId}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="银行流水号" >
+                <span v-if="item!=null">{{item.bankSerialNo}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="退款金额" >
+                <span v-if="item!=null">{{item.refundMoney}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="退款时间" >
+                <span v-if="item!=null">{{item.refundTime}}</span>
+            </el-descriptions-item>
+
+            <el-descriptions-item label="业务类型" >
+             <span v-if="item!=null">
+                   <dict-tag :options="busineOptions" :value="item.businessType"/>
+             </span>
+            </el-descriptions-item>
+            <el-descriptions-item label="状态" >
+             <span v-if="item!=null">
+                   <dict-tag :options="statusOptions" :value="item.status"/>
+             </span>
+            </el-descriptions-item>
+            <el-descriptions-item label="创建时间" >
+                <span v-if="item!=null">{{item.createTime}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="支付时间" >
+                <span v-if="item!=null">{{item.payTime}}</span>
+            </el-descriptions-item>
+        </el-descriptions>
+    </div>
+    </div>
+</template>
+
+<script>
+import { refund,listStorePayment,getStatus, getStorePayment, delStorePayment, addStorePayment, updateStorePayment, exportStorePayment } from "@/api/hisStore/storePayment";
+  export default {
+    name: "payDetails",
+    props:["data"],
+    data() {
+      return {
+        statusOptions: [],
+        busineOptions: [],
+        item:null,
+
+      }
+    },
+    created() {
+     this.getDicts("sys_store_payment_status").then(response => {
+       this.statusOptions = response.data;
+     });
+  this.getDicts("sys_store_payment_business_type").then(response => {
+    this.busineOptions = response.data;
+  });
+
+
+    },
+    methods: {
+      getDetails(orderId) {
+        this.item=null;
+        getStorePayment(orderId).then(response => {
+              this.item = response.data;
+        });
+      },
+      getPayStatus(){
+          var that=this;
+          this.$confirm('是否确认同步支付状态?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+            return getStatus(that.item.paymentId);
+          }).then(() => {
+            getStorePayment(that.item.paymentId).then(response => {
+                  that.item = response.data;
+            });
+             this.msgSuccess("操作成功");
+          }).catch(function() {});
+      },
+
+
+      payRefund(){
+          var that=this;
+          this.$confirm('是否确认退款?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+            return refund(that.item.paymentId);
+          }).then(() => {
+            getStorePayment(that.item.paymentId).then(response => {
+                  that.item = response.data;
+            });
+             this.msgSuccess("操作成功");
+          }).catch(function() {});
+      },
+    }
+  }
+</script>
+<style>
+
+  .contentx{
+      height: 100%;
+      background-color: #fff;
+      padding: 0px 20px 20px;
+
+
+      margin: 20px;
+  }
+  .el-descriptions-item__label.is-bordered-label{
+    font-weight: normal;
+  }
+  .el-descriptions-item__content {
+    max-width: 150px;
+    min-width: 100px;
+  }
+  .desct{
+      padding-top: 20px;
+      padding-bottom: 20px;
+      color: #524b4a;
+      font-weight: bold;
+    }
+
+</style>