Browse Source

微信退款优化

lighter 1 year ago
parent
commit
28bf59ae63
1 changed files with 13 additions and 5 deletions
  1. 13 5
      src/views/clinic/WxPayRefund.vue

+ 13 - 5
src/views/clinic/WxPayRefund.vue

@@ -12,7 +12,7 @@
       ></el-date-picker>
       <el-input v-model="patientId" clearable style="width: 100px" placeholder="门诊ID号"></el-input>
       <el-input v-model="patientName" clearable style="width: 100px" placeholder="姓名"></el-input>
-      <el-input v-model="tradeNo" clearable style="width: 130px" placeholder="订单号"></el-input>
+      <el-input v-model="tradeNo" clearable style="width: 260px" placeholder="订单号"></el-input>
       <span>&nbsp;订单类型:</span>
       <el-select v-model="orderType" style="width: 100px">
         <el-option v-for="item in orderTypes" :key="item.code" :value="item.code" :label="item.label"></el-option>
@@ -45,9 +45,13 @@
         </el-table-column>
         <el-table-column label="操作">
           <template v-slot="scope">
-            <el-button type="danger" icon="Money" @click="doRefund(scope.row)"
+            <el-button type="danger" icon="Money" @click="doRefund(scope.row, 'FULL')"
                        :disabled="scope.row.tradeState === 'REFUND'">
-              退款
+              全额退款
+            </el-button>
+            <el-button type="danger" icon="Money" @click="doRefund(scope.row, 'MEDINS')"
+                       :disabled="scope.row.tradeState === 'REFUND'">
+              补录退款
             </el-button>
           </template>
         </el-table-column>
@@ -75,6 +79,7 @@ import {formatDate, getDatetime} from '@/utils/date'
 import {downloadExcel} from '@/utils/excel'
 import PageLayer from "@/layout/PageLayer";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
+import {useUserStore} from "@/pinia/user-store";
 
 const tableHeight = window.innerHeight - 85
 const dateRange = ref(null)
@@ -156,15 +161,18 @@ const exportExcel = () => {
   }, 100)
 }
 
-const doRefund = (row) => {
+const userStore = useUserStore()
+const doRefund = (row, flag) => {
+  let refundAmt = flag === 'FULL' ? row.cashpayAmt : (row.fundpayAmt + row.acctpayAmt)
   ElMessageBox.prompt('请输入退款原因:', '提示', {
     confirmButtonText: '确定退款',
     cancelButtonText: '取消',
+    inputValue: flag === 'MEDINS' ? '补录退款' : null
   }).then(({value}) => {
     const param = {
       id: row.id,
       totalFee: row.totalFee,
-      cashpayAmt: row.cashpayAmt,
+      refundAmt: refundAmt,
       tradeNo: row.tradeNo,
       refundReason: value,
       refundOpDatetime: getDatetime(),