|
|
|
@ -66,7 +66,6 @@ |
|
|
|
<div class="div-card2"> |
|
|
|
<el-card class="card2"> |
|
|
|
<div class="btns"> |
|
|
|
<!-- 删除财务专属的标签页切换 --> |
|
|
|
<div class="btnAdd"> |
|
|
|
<el-button @click="openAddForm" type="success">添加收款</el-button> |
|
|
|
</div> |
|
|
|
@ -201,7 +200,7 @@ |
|
|
|
<el-form-item label="产品名称" required @change="ifGold" prop="goodsName"> |
|
|
|
<ProductSelect ref="productSelectRef" v-model="addFormData.goodsName"></ProductSelect> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-show="!isGold" label="产品数量" required prop="goodNum"> |
|
|
|
<el-form-item v-show="!isGold" label="产品数量" required> |
|
|
|
<div style="display: flex;"> |
|
|
|
<el-input style="padding-right: 30px; flex: 3;" v-model="addFormData.goodNum" |
|
|
|
placeholder="请输入产品数量" /> |
|
|
|
@ -213,13 +212,15 @@ |
|
|
|
<div style=" display: flex; "> |
|
|
|
<span |
|
|
|
style="color: #999999; display: flex; white-space: nowrap;align-items: center;">永久金币:</span> |
|
|
|
<el-input style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;" |
|
|
|
<el-input placeholder="0" |
|
|
|
style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;" |
|
|
|
v-model="addFormData.permanentGold" /> |
|
|
|
</div> |
|
|
|
<div style="padding-right: 5px; display: flex;"> |
|
|
|
<span |
|
|
|
style="color: #999999; display: flex; white-space: nowrap;align-items: center;">免费金币:</span> |
|
|
|
<el-input style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;" |
|
|
|
<el-input placeholder="0" |
|
|
|
style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;" |
|
|
|
v-model="addFormData.freeGold" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -266,9 +267,9 @@ |
|
|
|
<span class="dialog-footer"> |
|
|
|
<el-button style="background-color: #7E91FF;" @click="closeAddForm">取消</el-button> |
|
|
|
<el-button v-if="addOrEdit == 1" style="background-color: #2741DE; margin-left: 2.5vw;" |
|
|
|
type="primary" @click="throttledhandleAddForm">确定</el-button> |
|
|
|
type="primary" @click="throttledhandleAddForm" :disabled="ifAddDone">确定</el-button> |
|
|
|
<el-button v-else-if="addOrEdit == 2" style="background-color: #2741DE; margin-left: 2.5vw;" |
|
|
|
type="primary" @click="throttledhandleEditForm">编辑</el-button> |
|
|
|
type="primary" @click="throttledhandleEditForm" :disabled="ifReAddDone">编辑</el-button> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
@ -387,6 +388,17 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 查看驳回理由 --> |
|
|
|
<el-dialog title="驳回理由" v-model="rejectReasonVisible" width="50%" top="30vh" |
|
|
|
style="min-width: 200px; max-width: 500px;" :before-close="closeRejectForm"> |
|
|
|
<div class="reject-reason-box"> |
|
|
|
{{ rejectReason }} |
|
|
|
</div> |
|
|
|
<div class="rejectBtn"> |
|
|
|
<el-button type="primary" @click="closeRejectForm">确定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -405,7 +417,7 @@ import { hasMenuPermission } from '@/utils/menuTreePermission.js' |
|
|
|
import _ from 'lodash' |
|
|
|
// 导入客服相关规则和静态数据 |
|
|
|
import { addFormRule } from './utils/recriveFormRules.js' |
|
|
|
import { productList, MarketNameForId, CurrencyForId, marketList, statusList, numUnitList } from './utils/staticData.js' |
|
|
|
import { productList, MarketNameForId, CurrencyForId, marketList, statusList } from './utils/staticData.js' |
|
|
|
|
|
|
|
// ===================== 基础状态管理(仅保留客服相关) ===================== |
|
|
|
const adminStore = useAdminStore(); |
|
|
|
@ -414,6 +426,11 @@ const adminData = ref({}) // 管理员信息 |
|
|
|
const tableData = ref([]) // 表格数据 |
|
|
|
const total = ref(0) // 总条数 |
|
|
|
const pageInfo = ref({ pageSize: 10, pageNum: 1 }) // 分页信息 |
|
|
|
const numUnitList = ref(['年', '月']) |
|
|
|
|
|
|
|
//防止重复点击状态管理 |
|
|
|
const ifAddDone = ref(false) |
|
|
|
const ifReAddDone = ref(false) |
|
|
|
|
|
|
|
// 角色标识:固定为客服(删除财务、总部财务、超级管理员标识) |
|
|
|
const kefu = ref(true) |
|
|
|
@ -441,6 +458,16 @@ const reset = () => { |
|
|
|
getlist() |
|
|
|
} |
|
|
|
|
|
|
|
const rejectReasonVisible = ref(false) |
|
|
|
const rejectReason = ref('') |
|
|
|
const closeRejectForm = () => { |
|
|
|
rejectReasonVisible.value = false |
|
|
|
} |
|
|
|
const openRejectReason = (reason) => { |
|
|
|
rejectReason.value = reason |
|
|
|
rejectReasonVisible.value = true |
|
|
|
} |
|
|
|
|
|
|
|
// 时间选择器变更(原代码声明未实现,保留空函数避免报错) |
|
|
|
const handleDatePickerChange = () => { } |
|
|
|
// 日期禁用(原代码声明未实现,保留空函数避免报错) |
|
|
|
@ -529,13 +556,17 @@ const ifGold = () => { |
|
|
|
addFormData.value.goodNum = 0 |
|
|
|
} else { |
|
|
|
isGold.value = false |
|
|
|
const selectItems = ["AI机构追踪", "AI机构出击", "AI机构资金", "AI机构活跃度", "超级机构透视", "超级机构伏击", "超级机构猎杀", "超级机构脉搏", "超级机构罗盘", 'HC信息费'] |
|
|
|
numUnitList.value = ['个', '年', '月'] |
|
|
|
const selectItems = ["AI机构追踪", "AI机构出击", "AI机构资金", "AI机构活跃度", "超级机构透视", "超级机构伏击", "超级机构猎杀", "超级机构脉搏", "超级机构罗盘", 'HC信息费', 'HC信息费', 'AI机构探测神器', '超级机构探测神器'] |
|
|
|
if (selectItems.includes(addFormData.value.goodsName)) { |
|
|
|
addFormData.value.numUnit = '' |
|
|
|
numUnitList.value = ['年', '月'] |
|
|
|
} else if (addFormData.value.goodsName == '静态信息费') { |
|
|
|
addFormData.value.numUnit = '年' |
|
|
|
numUnitList.value = ['年'] |
|
|
|
} else { |
|
|
|
addFormData.value.numUnit = '个' |
|
|
|
numUnitList.value = ['个'] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -549,6 +580,12 @@ const ifGroup = () => { |
|
|
|
} else if (addFormData.value.payType === 'Ipay88-链接收款') { |
|
|
|
isGroup.value = true |
|
|
|
addFormData.value.receivedMarket = '马来西亚' |
|
|
|
} else if (addFormData.value.payType === 'E-Transfer') { |
|
|
|
isGroup.value = true |
|
|
|
addFormData.value.receivedMarket = '加拿大' |
|
|
|
} else if (addFormData.value.payType === 'Grabpay' || addFormData.value.payType === 'Nets' || addFormData.value.payType === 'Paypal') { |
|
|
|
isGroup.value = true |
|
|
|
addFormData.value.receivedMarket = '新加坡' |
|
|
|
} else { |
|
|
|
isGroup.value = false |
|
|
|
} |
|
|
|
@ -561,12 +598,12 @@ const jwcodeSeachMarket = async () => { |
|
|
|
url: '/cashCollection/getNameAndMarket', |
|
|
|
data: addFormData.value.jwcode |
|
|
|
}) |
|
|
|
if(result.code == 200){ |
|
|
|
if (result.code == 200) { |
|
|
|
ElMessage.success('客户信息查询成功') |
|
|
|
addFormData.value.market = result.data.market |
|
|
|
addFormData.value.marketName = result.data.marketName |
|
|
|
addFormData.value.name = result.data.name |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
ElMessage.error('客户不存在') |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
@ -580,7 +617,9 @@ const openAddForm = (row) => { |
|
|
|
if (row?.jwcode) { |
|
|
|
// 编辑模式 |
|
|
|
addOrEdit.value = 2 |
|
|
|
addFormData.value = { ...row } |
|
|
|
addFormData.value = { |
|
|
|
...row, |
|
|
|
} |
|
|
|
jwcodeSeachMarket() |
|
|
|
ifGold() |
|
|
|
} else { |
|
|
|
@ -599,15 +638,56 @@ const closeAddForm = () => { |
|
|
|
isGold.value = false |
|
|
|
addFormRef.value?.resetFields(); |
|
|
|
} |
|
|
|
|
|
|
|
const testGold = () => { |
|
|
|
// 转换为数字(处理字符串类型的数字) |
|
|
|
if (addFormData.value.goodsName == '金币充值') { |
|
|
|
if (addFormData.value.permanentGold == null) { |
|
|
|
addFormData.value.permanentGold = 0 |
|
|
|
} |
|
|
|
if (addFormData.value.freeGold == null) { |
|
|
|
addFormData.value.freeGold = 0 |
|
|
|
} |
|
|
|
const permanentGold = Number(addFormData.value.permanentGold); |
|
|
|
const freeNum = Number(addFormData.value.freeGold); |
|
|
|
// 正则:仅允许0-999999的正整数(包括0) |
|
|
|
const reg = /^[0-9]{1,6}$/; |
|
|
|
if (!reg.test(permanentGold) || permanentGold < 0) { |
|
|
|
return { valid: false, message: '请检查永久金币格式' }; |
|
|
|
} |
|
|
|
if (!reg.test(freeNum) || freeNum < 0) { |
|
|
|
return { valid: false, message: '请检查免费金币格式' }; |
|
|
|
} |
|
|
|
if (permanentGold == 0 && freeNum == 0) { |
|
|
|
return { valid: false, message: '永久金币或免费金币不能同为0' }; |
|
|
|
} |
|
|
|
} |
|
|
|
return { valid: true }; |
|
|
|
} |
|
|
|
// 客服新增收款 |
|
|
|
const handleAddForm = async () => { |
|
|
|
try { |
|
|
|
await addFormRef.value.validate(); |
|
|
|
if (!testGold().valid) { |
|
|
|
ElMessage.error(testGold().message); |
|
|
|
return; |
|
|
|
} |
|
|
|
//单独校验产品数量 |
|
|
|
if (!isGold.value) { |
|
|
|
if (!addFormData.value.goodNum) { |
|
|
|
ElMessage.error('请输入产品数量'); |
|
|
|
return; |
|
|
|
} |
|
|
|
const positiveIntReg = /^[1-9]\d*$/; |
|
|
|
if (!positiveIntReg.test(addFormData.value.goodNum)) { |
|
|
|
ElMessage.error('产品数量必须为正整数'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
// 处理时间格式 |
|
|
|
if (addFormData.value.payTime) { |
|
|
|
addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') |
|
|
|
} |
|
|
|
ifAddDone.value = true |
|
|
|
const result = await request({ |
|
|
|
url: '/cashCollection/add', |
|
|
|
data: { |
|
|
|
@ -627,19 +707,39 @@ const handleAddForm = async () => { |
|
|
|
getlist() |
|
|
|
closeAddForm() |
|
|
|
} |
|
|
|
ifAddDone.value = false |
|
|
|
} catch (error) { |
|
|
|
console.log('新增报错:', error); |
|
|
|
ElMessage.error('请完善表单信息后提交'); |
|
|
|
ifAddDone.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 客服编辑收款(撤回后重新提交) |
|
|
|
const handleEditForm = async () => { |
|
|
|
try { |
|
|
|
await addFormRef.value.validate(); |
|
|
|
if (!testGold().valid) { |
|
|
|
ElMessage.error(testGold().message); |
|
|
|
return; |
|
|
|
} |
|
|
|
//单独校验产品数量 |
|
|
|
if (!isGold.value) { |
|
|
|
if (!addFormData.value.goodNum) { |
|
|
|
ElMessage.error('请输入产品数量'); |
|
|
|
return; |
|
|
|
} |
|
|
|
const positiveIntReg = /^[1-9]\d*$/; |
|
|
|
if (!positiveIntReg.test(addFormData.value.goodNum)) { |
|
|
|
ElMessage.error('产品数量必须为正整数'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
// 处理时间格式 |
|
|
|
if (addFormData.value.payTime) { |
|
|
|
addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') |
|
|
|
} |
|
|
|
ifReAddDone.value = true |
|
|
|
const result = await request({ |
|
|
|
url: '/cashCollection/reSubmit', |
|
|
|
data: { |
|
|
|
@ -650,7 +750,8 @@ const handleEditForm = async () => { |
|
|
|
goodNum: addFormData.value.goodNum || 0, |
|
|
|
paymentCurrency: CurrencyForId(addFormData.value.paymentCurrency) || '', |
|
|
|
receivedMarket: MarketNameForId(addFormData.value.receivedMarket) || '', |
|
|
|
paymentAmount: (addFormData.value.paymentAmount) * 100 |
|
|
|
paymentAmount: (addFormData.value.paymentAmount) * 100, |
|
|
|
activity: addFormData.value.activityId, |
|
|
|
} |
|
|
|
}) |
|
|
|
if (result.code == 200) { |
|
|
|
@ -658,14 +759,16 @@ const handleEditForm = async () => { |
|
|
|
getlist() |
|
|
|
closeAddForm() |
|
|
|
} |
|
|
|
ifReAddDone.value = false |
|
|
|
} catch (error) { |
|
|
|
console.log(error); |
|
|
|
ifReAddDone.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 付款币种和支付方式选项(客服专用) |
|
|
|
const customOptions = ref(['美元(USD)', '港币(HKD)', '新币(SGD)', '马币(MYR)', '泰铢(THB)', '加币(CAD)', '越南盾(VDN)', '韩元(KRW)']) |
|
|
|
const paytypeOptions = ref(["Stripe-链接收款", "PaymentAsia-链接收款", "Ipay88-链接收款", "银行转账", "刷卡", "现金", "支票", "Grabpay", "Nets", "E-Transfer", "Paypal"]) |
|
|
|
const paytypeOptions = ref(["Stripe-链接收款", "PaymentAsia-链接收款", "Ipay88-链接收款", "Grabpay", "Nets", "E-Transfer", "Paypal", "银行转账", "刷卡", "现金", "支票"]) |
|
|
|
const MoneyAddressOptions = ref(['马来西亚', '香港', '新加坡', '泰国', '越南HCM', '加拿大']) |
|
|
|
const handleCurrencyChange = (option) => { |
|
|
|
console.log('选中的币种:', option); |
|
|
|
@ -828,7 +931,12 @@ const submitRefund = async () => { |
|
|
|
try { |
|
|
|
if (refundFormData.value.refundModel == 0) { |
|
|
|
refundFormData.value.partRefundGold = refundFormData.value.permanentGold, |
|
|
|
refundFormData.value.partRefundFree = refundFormData.value.freeGold |
|
|
|
refundFormData.value.partRefundFree = refundFormData.value.freeGold |
|
|
|
} else if (refundFormData.value.refundModel == 1) { |
|
|
|
if (refundFormData.value.partRefundGold > refundFormData.value.permanentGold || refundFormData.value.partRefundFree > refundFormData.value.freeGold) { |
|
|
|
ElMessage.error('退款金额不能大于订单金额') |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
const result = await request({ |
|
|
|
url: '/Money/add', |
|
|
|
@ -841,7 +949,7 @@ const submitRefund = async () => { |
|
|
|
remark: refundFormData.value.remark, |
|
|
|
refundReason: refundFormData.value.refundReason, |
|
|
|
refundModel: refundFormData.value.refundModel, |
|
|
|
id: refundFormData.value.id, |
|
|
|
originalOrderId: refundFormData.value.id, |
|
|
|
orderCode: refundFormData.value.orderCode, |
|
|
|
permanentGold: (refundFormData.value.permanentGold) * 100 || 0, |
|
|
|
freeGold: (refundFormData.value.freeGold) * 100 || 0, |
|
|
|
@ -861,13 +969,6 @@ const submitRefund = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 查看驳回理由 |
|
|
|
const openRejectReason = (reason) => { |
|
|
|
ElMessageBox.alert(reason, '驳回理由', { |
|
|
|
confirmButtonText: '确认', |
|
|
|
customClass: 'reject-reason-box', |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// ===================== 初始化与节流 ===================== |
|
|
|
// 节流处理(防止重复提交) |
|
|
|
@ -1174,14 +1275,14 @@ onMounted(async () => { |
|
|
|
background-color: #E5EBFE !important; |
|
|
|
} |
|
|
|
|
|
|
|
// 驳回理由弹窗样式 |
|
|
|
.reject-reason-box { |
|
|
|
--el-message-box-height: 500px; |
|
|
|
width: 80%; |
|
|
|
padding: 20px; |
|
|
|
} |
|
|
|
|
|
|
|
.reject-reason-box .el-message-box__content { |
|
|
|
max-height: 350px; |
|
|
|
overflow-y: auto; |
|
|
|
white-space: pre-wrap; |
|
|
|
.rejectBtn { |
|
|
|
margin-top: 20px; |
|
|
|
display: flex; |
|
|
|
justify-content: flex-end; |
|
|
|
} |
|
|
|
</style> |