Jelajahi Sumber

在线购物的订单限制不支持部分退款

licc 1 bulan lalu
induk
melakukan
4da3e38272
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      src/views/orders/list.vue

+ 6 - 1
src/views/orders/list.vue

@@ -216,7 +216,7 @@
             @close="refundDialogVisible = false"
         >
             <div class="refund-dialog-content">
-                <el-input v-model="refundAmount" placeholder="请输入退款金额" type="number">
+                <el-input v-model="refundAmount" placeholder="请输入退款金额" type="number" :disabled="refundAmountDisabled">
                     <template #prepend><icon :size="25" name="el-icon-money" /></template>
                     <template #append>元</template>
                 </el-input>
@@ -319,6 +319,7 @@ const handleExpandChange = (row: any, expandedRows: any) => {
 const refundDialogVisible = ref(false)
 const refundAmount = ref('')
 const payMethod = ref('')
+const refundAmountDisabled = ref(true)
 let refundOrder: {
     refundTime: string
     refundAmount: number
@@ -333,7 +334,11 @@ const refundLoading = ref(false)
 const refund = async (row: any) => {
     refundOrder = row
     payMethod.value = row.payMethod
+    refundAmountDisabled.value = row.type === 2
     refundAmount.value = ''
+    if (row.type === 2) {
+      refundAmount.value = row.payAmount
+    }
     refundDialogVisible.value = true
 }