payDetail.vue 9.55 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
<template>
  <el-dialog
    v-model="dialogVisible"
    class="payment-dialog"
    destroy-on-close
    title="付款详情"
    width="600"
  >
    <el-card class="info-card" shadow="never">
      <div class="card-header">
        <span class="card-title">缴费单位</span>
      </div>
      <div>{{ user.name }}</div>
      <div> {{ deptInfo.aname }}</div>
    
    </el-card>
    
    <!-- 统计卡片区域 -->
    <div class="stats-grid">
      <div class="stat-card">
        <div class="stat-label">缴费总人数</div>
        <div class="stat-value">{{ formData.all ?? 0 }}</div>
      </div>
      <div class="stat-card">
        <div class="stat-label">新会员合计</div>
        <div class="stat-value ">{{ formData.new ?? 0 }}</div>
      </div>
      <div class="stat-card">
        <div class="stat-label">续费会员合计</div>
        <div class="stat-value ">{{ formData.old ?? 0 }}</div>
      </div>
      <div class="stat-card">
        <div class="stat-label">费用合计</div>
        <div class="stat-value">{{ formData.price ?? 0 }}</div>
      </div>
    </div>
    
    <!-- 总计金额 -->
    <div class="total-amount">
      <span class="total-label">支付费用合计</span>
      <span class="total-price">{{ formData.price ?? 0 }}</span>
    </div>
    <!--    -->
    <!--    &lt;!&ndash; 支付方式 &ndash;&gt;-->
    <!--    <div class="pay-method-section">-->
    <!--      <div class="section-title">请选择支付方式</div>-->
    <!--      <el-radio-group v-model="form.type" class="pay-radio-group" @change="changeType">-->
    <!--        <el-radio label="1" class="pay-radio">-->
    <!--          <div class="pay-option">-->
    <!--            <img alt="" src="@/assets/pay/min.png" class="pay-icon">-->
    <!--            <span>民生付</span>-->
    <!--          </div>-->
    <!--        </el-radio>-->
    <!--        <el-radio label="3" class="pay-radio">-->
    <!--          <div class="pay-option">-->
    <!--            <img alt="" src="@/assets/pay/min.png" class="pay-icon">-->
    <!--            <span>对公转账</span>-->
    <!--          </div>-->
    <!--        </el-radio>-->
    <!--      </el-radio-group>-->
    <!--    </div>-->
    
    
    <div class="pay-card">
      <div class="card-header">
        <span class="card-title">请选择支付方式</span>
      </div>
      <div class="pay-methods">
        <el-radio-group v-model="form.type" class="pay-radio-group" @change="changeType">
          <el-radio class="pay-item" label="1">
            <div class="pay-method-content">
              <img alt="" class="pay-icon" src="@/assets/pay/min.png">
              <span class="pay-name">民生付</span>
            </div>
          </el-radio>
          <el-radio class="pay-item" label="3">
            <div class="pay-method-content">
              <img alt="" class="pay-icon" src="@/assets/pay/min.png">
              <span class="pay-name">对公转账</span>
            </div>
          </el-radio>
        </el-radio-group>
      </div>
    </div>
    
    <el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
      <el-form-item v-if="form.type==='3'" label="联系人" prop="contactPerson">
        <el-input v-model.trim="form.contactPerson" />
      </el-form-item>
      <el-form-item v-if="form.type==='3'" label="联系方式" prop="contactTel">
        <el-input v-model.trim="form.contactTel" />
      </el-form-item>
    </el-form>
    <!-- 付款按钮 -->
    <div class="action-area">
      <el-button class="pay-btn" round size="large" type="primary" @click="handelPay">
        去付款
      </el-button>
    </div>
  </el-dialog>
</template>

<script setup>
import { computed, getCurrentInstance, ref } from 'vue'
import useUserStore from '/@/store/modules/user'

const user = computed(() => useUserStore().memberInfo)
const deptInfo = computed(() => useUserStore().deptInfo)
const formData = ref({})
const emit = defineEmits(['handelGoPay'])
const { proxy } = getCurrentInstance()
const dialogVisible = ref(false)
const type = ref(1)
const form = ref({
  type: '0'
})
const rules = ref({
  renewYear: [
    { required: true, message: '请选择缴费年限', trigger: 'change' }
  ],
  type: [{ required: true, message: '请选择支付方式', trigger: 'change' }],
  contactPerson: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
  contactTel: [
    { required: true, message: '请输入联系电话', trigger: 'blur' },
    { pattern: /^1[23456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
  ]
})
function open(row, val) {
  if (row.id) form.value.id = row.id
  formData.value = row
  form.value.type = '1'
  type.value = val
  dialogVisible.value = true
}

function changeType() {
  form.value.contactTel = ''
  form.value.contactPerson = ''
}

async function handelPay() {
  if (!form.value.type) {
    proxy.$modal.msgError('请选择支付方式')
    return
  }
  await proxy.$refs['formRef'].validate()
  emit('handelGoPay', form.value, type.value)
  dialogVisible.value = false
}

function close() {
  dialogVisible.value = false
}

defineExpose({
  open,
  close
})
</script>

<style lang="scss" scoped>
.payment-dialog {
  :deep(.el-dialog__header) {
    padding: 24px 24px 0;
    margin-right: 0;
    border-bottom: none;
  }
  
  :deep(.el-dialog__title) {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
  }
  
  :deep(.el-dialog__body) {
    padding: 20px 24px 32px;
  }
  
  :deep(.el-dialog__close) {
    font-size: 20px;
    color: #8c8c8c;
    transition: color 0.2s;
    
    &:hover {
      color: #1a1a1a;
    }
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #f8f9fc;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
  
  &:hover {
    background: #f0f2f6;
  }
  
  .stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
  }
  
  .stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
    
    &.highlight {
      color: #f97316;
    }
  }
}

.total-amount {
  background: #fef7e6;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  
  .total-label {
    font-size: 15px;
    color: #b45309;
    font-weight: 500;
  }
  
  .total-price {
    font-size: 24px;
    font-weight: 700;
    color: #ea580c;
    letter-spacing: 0.5px;
  }
}


.action-area {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.pay-btn {
  min-width: 200px;
  height: 44px;
  font-size: 16px;
  font-weight: 500;
  //border-radius: 8px;
  background: #1e3a8a;
  border: none;
  transition: all 0.2s;
  
  &:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
  }
  
  &:active {
    transform: translateY(0);
  }
}


.info-card {
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid #ebeef5;
  
  :deep(.el-card__body) {
    padding: 16px 20px;
  }
  
  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
    
    .card-title {
      font-size: 16px;
      font-weight: 600;
      color: #303133;
      position: relative;
      
      &::before {
        content: '';
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 14px;
        background: #409eff;
        border-radius: 2px;
      }
    }
  }
}

:deep(.el-form-item__label) {
  text-align: justify;
  text-align-last: justify;
  display: inline-block;
  width: 100%;
  font-weight: bold;
}

.pay-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  //box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
  overflow: hidden;
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
    
    .card-title {
      font-size: 16px;
      font-weight: 600;
      color: #303133;
      position: relative;
      
      &::before {
        content: '';
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 14px;
        background: #409eff;
        border-radius: 2px;
      }
    }
  }
  &:hover {
    //box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.08);
  }
  
  .title-text {
    padding: 5px 20px 10px 30px;
    font-size: 16px;
    color: #000;
  }
  
  .pay-methods {
    padding:10px 0;
    
    .pay-radio-group {
      width: 100%;
      display: flex;
      gap: 20px;
    }
    
    .pay-item {
      width: auto;
      min-width: 140px;
      height: auto;
      margin: 0;
      padding: 12px 20px;
      border: 1px solid #e9ecef;
      border-radius: 12px;
      transition: all 0.2s ease;
      
      &:hover {
        border-color: #667eea;
        background: #f8f9ff;
      }
      
      :deep(.el-radio__input) {
        align-self: center;
      }
      
      :deep(.el-radio__label) {
        padding-left: 12px;
        width: 100%;
      }
    }
    
    .pay-method-content {
      display: flex;
      align-items: center;
      gap: 12px;
      
      .pay-icon {
        width: 32px;
        height: 32px;
        object-fit: contain;
      }
      
      .pay-name {
        font-size: 15px;
        font-weight: 500;
        color: #2c3e50;
      }
    }
  }
}
</style>