Browse Source

金币产品与软件产品不能互切

milestone-20260304-钱包体系
ZhangYong 4 weeks ago
parent
commit
7194ddd3df
  1. 16
      src/components/MoneyManage/ProductSelect.vue
  2. 38
      src/views/moneyManage/receiveDetail/receiveService.vue

16
src/components/MoneyManage/ProductSelect.vue

@ -12,7 +12,7 @@
</div>
<div class="menu" v-show="isOpen">
<div class="coinselect" @click="coinhandelMenu" :class="{ 'active': coinisOpen }">
<div class="coinselect" @click="coinhandelMenu" :class="{ 'active': coinisOpen, 'disabled-menu': restrictType === 'software' }">
<div class="cointxt">
{{ t('cash.goldProduct') }}
</div>
@ -26,7 +26,7 @@
<el-radio v-model="selectedValue" :label="t('cash.coinRecharge')" size="large" />
</div>
<div class="product">
<div class="coinselect" @click="producthandelMenu" :class="{ 'active': productisOpen }">
<div class="coinselect" @click="producthandelMenu" :class="{ 'active': productisOpen, 'disabled-menu': restrictType === 'gold' }">
<div class="cointxt">
{{ t('cash.softwareProduct') }}
</div>
@ -154,9 +154,11 @@ const handelMenu = () => {
ifselectAndOpen()
}
const coinhandelMenu = () => {
if (props.restrictType === 'software') return;
coinisOpen.value = !coinisOpen.value
}
const producthandelMenu = () => {
if (props.restrictType === 'gold') return;
productisOpen.value = !productisOpen.value
}
@ -165,6 +167,10 @@ const props = defineProps({
modelValue: {
type: String,
default: ''
},
restrictType: {
type: String,
default: 'all' // 'all', 'gold', 'software'
}
})
@ -513,6 +519,12 @@ defineExpose({ resetSelect });
display: flex;
border-radius: 5px;
&.disabled-menu {
cursor: not-allowed;
opacity: 0.5;
background-color: #f5f7fa;
}
.cointxt {
width: 100px;
height: 100%;

38
src/views/moneyManage/receiveDetail/receiveService.vue

@ -80,9 +80,9 @@
</div>
<div class="table">
<el-table ref="tableRef" :data="tableData" style="width: 80vw;height:64vh;" @sort-change="handleSortChange"
:row-style="{ height: '60px' }" :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<el-table ref="tableRef" :data="tableData" style="width: 80vw;height:64vh;"
@sort-change="handleSortChange" :row-style="{ height: '60px' }"
:header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<el-table-column type="index" :label="t('common_list.id')" width="100px" fixed="left">
<template #default="scope">
<span>{{ scope.$index + 1 + (pageInfo.pageNum - 1) * pageInfo.pageSize }}</span>
@ -219,7 +219,8 @@
</el-select>
</el-form-item>
<el-form-item :label="t('common_add.productName')" required prop="goodsName">
<ProductSelect ref="productSelectRef" v-model="addFormData.goodsName" @change="handleProductChange(addFormData.goodsName)"></ProductSelect>
<ProductSelect ref="productSelectRef" v-model="addFormData.goodsName" :restrictType="productRestrictType"
@change="handleProductChange(addFormData.goodsName)"></ProductSelect>
</el-form-item>
<el-form-item v-show="!isGold" :label="t('common_add.productNum')" required>
<div style="display: flex;">
@ -259,15 +260,13 @@
</el-form-item>
<el-form-item :label="t('common_add.receiveArea')" prop="receivedMarket">
<CurrencySelect v-model="addFormData.receivedMarket" :items="MoneyAddressOptions"
:placeholder="t('common_add.receiveAreaPlaceholder')"
:disabled="isGroup"
:placeholder="t('common_add.receiveAreaPlaceholder')" :disabled="isGroup"
@change="showWallet(addFormData.receivedMarket)">
</CurrencySelect>
</el-form-item>
<el-form-item :label="t('common_add.receiveWallet')" required prop="receivedWallet" v-show="isGold">
<CurrencySelect v-model="addFormData.receivedWallet" :items="MoneyWalletOptions"
:placeholder="t('common_add.receiveWalletPlaceholder')"
:disabled=" !selectWallet || isGroup "
:placeholder="t('common_add.receiveWalletPlaceholder')" :disabled="!selectWallet || isGroup"
</CurrencySelect>
</el-form-item>
@ -426,8 +425,8 @@
</el-dialog>
<!-- 查看驳回理由 -->
<el-dialog class="reject-dialog" :title="t('common_add.rejectReason')" v-model="rejectReasonVisible" width="50%" top="30vh"
style="min-width: 200px; max-width: 500px;" :before-close="closeRejectForm">
<el-dialog class="reject-dialog" :title="t('common_add.rejectReason')" v-model="rejectReasonVisible" width="50%"
top="30vh" style="min-width: 200px; max-width: 500px;" :before-close="closeRejectForm">
<div class="reject-reason-box">
{{ rejectReason }}
</div>
@ -810,6 +809,7 @@ const jwcodeSeachMarket = async () => {
}
}
const LastGoodsName = ref('')
// /
const openAddForm = (row) => {
productSelectRef.value?.resetSelect();
@ -820,6 +820,9 @@ const openAddForm = (row) => {
...row,
receivedWallet: walletList.value.find(item => item.id == row.walletId)?.walletName || ''
}
if (row?.goodsName) {
LastGoodsName.value = row?.goodsName
}
console.log('这是编辑数据:', addFormData.value);
showWallet(addFormData.value.receivedMarket)
jwcodeSeachMarket()
@ -1052,7 +1055,20 @@ const handleCurrencyChange = (option) => {
};
//
const productRestrictType = computed(() => {
if (addOrEdit.value == 2) {
if (LastGoodsName.value == t('cash.coinRecharge')) {
return 'gold'
} else if (LastGoodsName.value) {
return 'software'
}
}
return 'all'
})
const handleProductChange = (productName) => {
console.log('LastGoodsName:', LastGoodsName.value);
LastGoodsName.value = productName
console.log('选中的产品名称:', productName);
if (productName && productName == t('cash.coinRecharge')) {
showWallet(addFormData.value.receivedMarket)
@ -1593,6 +1609,7 @@ onMounted(async () => {
:deep(.refundDialog) {
background: #F3FAFE !important;
.left {
width: 50%;
height: 70vh;
@ -1655,6 +1672,7 @@ onMounted(async () => {
:deep(.reject-dialog) {
background-color: #F3FAFE !important;
}
.reject-reason-box {
width: 80%;
padding: 20px;

Loading…
Cancel
Save