Browse Source

Merge branch 'zhangyong/milestone-20250913-现金管理二期' into milestone-20251104-现金二期

zhangrenyuan/feature-20251104133449-现金管理二期
ZhangYong 3 weeks ago
parent
commit
c8ec2f8034
  1. 110
      src/views/moneyManage/receiveDetail/receiveFinance.vue
  2. 2
      src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
  3. 36
      src/views/permissions/rolePermission.vue

110
src/views/moneyManage/receiveDetail/receiveFinance.vue

@ -250,6 +250,30 @@
<el-form-item label="产品名称"> <el-form-item label="产品名称">
<el-select disabled="true" v-model="auditFormData.goodsName" /> <el-select disabled="true" v-model="auditFormData.goodsName" />
</el-form-item> </el-form-item>
<el-form-item v-if="!isGold" label="产品数量">
<div style="display: flex;">
<el-input disabled="true" style="padding-right: 30px; flex: 3;" v-model="auditFormData.goodNum"
placeholder="请输入产品数量" />
<CurrencySelect disabled="true" v-model="auditFormData.numUnit" :items="numUnitList"
style="flex: 1.5;" placeholder="单位" @change="handleCurrencyChange" />
</div>
</el-form-item>
<div v-show="isGold" style="margin-bottom: 15px; display: flex;">
<div style=" display: flex; ">
<span
style="color: #999999; display: flex; white-space: nowrap;align-items: center;">永久金币</span>
<el-input disabled="true"
style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
v-model="auditFormData.permanentGold" />
</div>
<div style="padding-right: 5px; display: flex;">
<span
style="color: #999999; display: flex; white-space: nowrap;align-items: center;">免费金币</span>
<el-input disabled="true"
style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
v-model="auditFormData.freeGold" />
</div>
</div>
<el-form-item label="付款币种"> <el-form-item label="付款币种">
<el-select disabled="true" v-model="auditFormData.paymentCurrency" placeholder="请选择付款币种" <el-select disabled="true" v-model="auditFormData.paymentCurrency" placeholder="请选择付款币种"
@change="handleCurrencyChange" /> @change="handleCurrencyChange" />
@ -333,10 +357,11 @@
</el-form-item> </el-form-item>
<!-- 金币产品特殊显示 --> <!-- 金币产品特殊显示 -->
<el-form-item v-show="!isEditGold" label="产品数量"> <el-form-item v-show="!isEditGold" label="产品数量">
<div style="padding-right: 50px; display: flex;">
<el-input disabled="true" style="padding-right: 10px;" v-model="editFormData.goodNum"
placeholder="产品数量" />
<span style="color: #999999;"></span>
<div style="display: flex;">
<el-input disabled="true" style="padding-right: 30px; flex: 3;"
v-model="editFormData.goodNum" placeholder="请输入产品数量" />
<CurrencySelect disabled="true" v-model="editFormData.numUnit" :items="numUnitList"
style="flex: 1.5;" placeholder="单位" @change="handleCurrencyChange" />
</div> </div>
</el-form-item> </el-form-item>
<div v-show="isEditGold" style="margin-bottom: 15px; display: flex;"> <div v-show="isEditGold" style="margin-bottom: 15px; display: flex;">
@ -403,10 +428,10 @@
<CurrencySelect v-model="editFormData.receivedCurrency" :items="customOptions" <CurrencySelect v-model="editFormData.receivedCurrency" :items="customOptions"
placeholder="请选择到账货币" /> placeholder="请选择到账货币" />
</el-form-item> </el-form-item>
<el-form-item label="到账金额" prop="receivedAmount" required>
<el-form-item label="到账金额" prop="receivedAmount">
<el-input v-model="editFormData.receivedAmount" placeholder="请输入到账金额" type="number" /> <el-input v-model="editFormData.receivedAmount" placeholder="请输入到账金额" type="number" />
</el-form-item> </el-form-item>
<el-form-item label="手续费" prop="handlingCharge" required>
<el-form-item label="手续费" prop="handlingCharge">
<el-input v-model="editFormData.handlingCharge" placeholder="请输入手续费" type="number" /> <el-input v-model="editFormData.handlingCharge" placeholder="请输入手续费" type="number" />
</el-form-item> </el-form-item>
<el-form-item label="到账时间" required> <el-form-item label="到账时间" required>
@ -452,8 +477,10 @@
</div> </div>
<div v-show="!isRefundGold" class="add-item"> <div v-show="!isRefundGold" class="add-item">
<el-text style="width:4vw;">产品数量</el-text> <el-text style="width:4vw;">产品数量</el-text>
<el-input style="padding-right: 10px; width:10.5vw;" v-model="refundFormData.goodNum"
<el-input style="padding-right: 10px; width:6.5vw;" v-model="refundFormData.goodNum"
placeholder="请输入产品数量" disabled /> placeholder="请输入产品数量" disabled />
<CurrencySelect disabled="true" v-model="refundFormData.numUnit" :items="numUnitList"
style=" width: 3.5vw;" placeholder="单位" @change="handleCurrencyChange" />
</div> </div>
<div v-show="isRefundGold" style="display: flex; margin-bottom: 10px;"> <div v-show="isRefundGold" style="display: flex; margin-bottom: 10px;">
<div style=" display: flex; align-items: center;justify-content: center; "> <div style=" display: flex; align-items: center;justify-content: center; ">
@ -462,8 +489,7 @@
v-model="refundFormData.permanentGold" disabled /> v-model="refundFormData.permanentGold" disabled />
</div> </div>
<div style=" display: flex; align-items: center;justify-content: center; "> <div style=" display: flex; align-items: center;justify-content: center; ">
<span
style="color: #999999; white-space: nowrap;">免费金币</span>
<span style="color: #999999; white-space: nowrap;">免费金币</span>
<el-input style="padding-right: 10px; height: 30px; width: 70px;" <el-input style="padding-right: 10px; height: 30px; width: 70px;"
v-model="refundFormData.freeGold" disabled /> v-model="refundFormData.freeGold" disabled />
</div> </div>
@ -513,6 +539,18 @@
<el-radio value="1">部分退款</el-radio> <el-radio value="1">部分退款</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-show="refundFormData.refundModel == '1'" style="display: flex; margin-bottom: 10px;">
<div style=" display: flex; align-items: center;justify-content: center; ">
<span style="color: #999999; white-space: nowrap;">永久金币</span>
<el-input style="padding-right: 10px; height: 30px; width: 70px;"
v-model="refundCoinData.permanentGold" dsabled />
</div>
<div style=" display: flex; align-items: center;justify-content: center; ">
<span style="color: #999999; white-space: nowrap;">免费金币</span>
<el-input style="padding-right: 10px; height: 30px; width: 70px;"
v-model="refundCoinData.freeGold" />
</div>
</div>
<div class="add-item"> <div class="add-item">
<el-text style="width:4vw;">退款理由</el-text> <el-text style="width:4vw;">退款理由</el-text>
<el-input v-model="refundFormData.refundReason" style="width:10vw;" :rows="5" maxlength="150" <el-input v-model="refundFormData.refundReason" style="width:10vw;" :rows="5" maxlength="150"
@ -520,7 +558,7 @@
</div> </div>
<div>ps:请在退款理由表明用户的退款需求</div> <div>ps:请在退款理由表明用户的退款需求</div>
<div style="display:flex;justify-content: center;margin-top: 5vh;"> <div style="display:flex;justify-content: center;margin-top: 5vh;">
<el-button type="default" @click="">重置</el-button>
<el-button type="default" @click="resetRefund">重置</el-button>
<el-button type="primary" @click="throttledsubmitRefund">提交</el-button> <el-button type="primary" @click="throttledsubmitRefund">提交</el-button>
</div> </div>
</div> </div>
@ -612,8 +650,16 @@ const openRefundDialog = () => {
const closeRefundForm = () => { const closeRefundForm = () => {
refundDialog.value = false refundDialog.value = false
refundFormData.value = {} refundFormData.value = {}
refundCoinData.value = {
permanentGold: 0,
freeGold: 0
}
} }
const refundCoinData = ref({
permanentGold: 0,
freeGold: 0
})
const isRefundGold = ref(false) const isRefundGold = ref(false)
const ifRefundGold = () => { const ifRefundGold = () => {
if (refundFormData.value.goodsName === '金币充值') { if (refundFormData.value.goodsName === '金币充值') {
@ -713,11 +759,30 @@ const getlist = async () => {
} }
}; };
//退
const resetRefund = () => {
refundFormData.value.refundModel = ''
refundFormData.value.refundReason = ''
refundCoinData.value = {
permanentGold: 0,
freeGold: 0
}
}
//退 //退
const submitRefund = async () => { const submitRefund = async () => {
try { try {
if (refundFormData.value.goodsName != '金币充值') {
return ElMessage.error('线上数据仅支持金币充值退款');
}
if (!refundFormData.value.refundModel) {
return ElMessage.error('请选择退款方式');
}
if (!refundFormData.value.refundReason) {
return ElMessage.error('请输入退款原因');
}
const result = await request({ const result = await request({
url: '/Money/add',
url: '/Money/addOnline',
data: { data: {
jwcode: refundFormData.value.jwcode, // jwcode: refundFormData.value.jwcode, //
name: refundFormData.value.name, // name: refundFormData.value.name, //
@ -743,8 +808,8 @@ const submitRefund = async () => {
refundModel: refundFormData.value.refundModel, // 退0-1- refundModel: refundFormData.value.refundModel, // 退0-1-
id: refundFormData.value.id, //id id: refundFormData.value.id, //id
orderCode: refundFormData.value.orderCode, orderCode: refundFormData.value.orderCode,
permanentGold: (refundFormData.value.permanentGold) * 100 || 0,
freeGold: (refundFormData.value.freeGold) * 100 || 0
permanentGold: (refundCoinData.value.permanentGold) * 100 || 0,
freeGold: (refundCoinData.value.freeGold) * 100 || 0
} }
}) })
if (result.code == 200) { if (result.code == 200) {
@ -784,6 +849,9 @@ const navigateTo = async (tab) => {
// //
const openAuditForm = (row) => { const openAuditForm = (row) => {
auditFormData.value = { ...row, market: row.marketName }; auditFormData.value = { ...row, market: row.marketName };
ifGold(auditFormData.value)
console.log('isGold', isGold.value);
auditFormisible.value = true; auditFormisible.value = true;
}; };
@ -850,6 +918,17 @@ const handelAuditReject = async () => {
} }
}; };
//
const isGold = ref(false)
const ifGold = (data) => {
console.log('data', data);
if (data.goodsName === '金币充值') {
isGold.value = true
} else {
isGold.value = false
}
}
// //
watch(auditFormisible, (val) => { watch(auditFormisible, (val) => {
if (val) { if (val) {
@ -888,6 +967,7 @@ const openEditForm = (row) => {
const closeEditForm = () => { const closeEditForm = () => {
editFormisible.value = false; editFormisible.value = false;
editFormData.value = {}; editFormData.value = {};
editFormRef.value.resetFields();
}; };
// //
@ -1022,7 +1102,9 @@ const getActivitys = async () => {
// 2.8 // 2.8
const throttledhandelAuditReject = _.throttle(handelAuditReject, 3000, { trailing: false }); const throttledhandelAuditReject = _.throttle(handelAuditReject, 3000, { trailing: false });
const throttledsubmitEditForm = _.throttle(submitEditForm, 3000, { trailing: false }); const throttledsubmitEditForm = _.throttle(submitEditForm, 3000, { trailing: false });
const throttledsubmitRefund = _.throttle(submitRefund, 5000, {
trailing: false
})
// 2.9 // 2.9
onMounted(async () => { onMounted(async () => {
await getAdminData(); await getAdminData();

2
src/views/moneyManage/receiveDetail/utils/recriveFormRules.js

@ -87,6 +87,7 @@ export const addFormRule = {
export const editFormRule = { export const editFormRule = {
// 到账金额:最大6位(整数部分最多4位,小数2位),支持两位小数 // 到账金额:最大6位(整数部分最多4位,小数2位),支持两位小数
receivedAmount: [ receivedAmount: [
{ required: true, message: '请输入到账金额', trigger: 'blur' },
{ {
pattern: /^\d{1,6}(\.\d{1,2})?$/, pattern: /^\d{1,6}(\.\d{1,2})?$/,
message: '请检查到账金额格式', message: '请检查到账金额格式',
@ -95,6 +96,7 @@ export const editFormRule = {
], ],
// 手续费:同到账金额规则 // 手续费:同到账金额规则
handlingCharge: [ handlingCharge: [
{ required: true, message: '请输入手续费', trigger: 'blur' },
{ {
pattern: /^\d{1,6}(\.\d{1,2})?$/, pattern: /^\d{1,6}(\.\d{1,2})?$/,
message: '请检查手续费格式', message: '请检查手续费格式',

36
src/views/permissions/rolePermission.vue

@ -10,7 +10,7 @@ const adminStore = useAdminStore();
const { adminData, menuTree } = storeToRefs(adminStore); const { adminData, menuTree } = storeToRefs(adminStore);
import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js"
import { tr } from 'element-plus/es/locales.mjs' import { tr } from 'element-plus/es/locales.mjs'
// ref // ref
const Ref = ref(null) const Ref = ref(null)
const roleData = ref([]) const roleData = ref([])
@ -36,7 +36,7 @@ const addRole = ref({
market: '' market: ''
}) })
const addRoleMarket = ref([]) const addRoleMarket = ref([])
const channelList = ref(['美股', '港股', 'hc第一频道'])
const channelList = ref(['全部'])
const getRoleList = async function (val) { const getRoleList = async function (val) {
if (!findMenuById(menuTree.value, permissionMapping.view_role_information)) { if (!findMenuById(menuTree.value, permissionMapping.view_role_information)) {
ElMessage.error('无此权限') ElMessage.error('无此权限')
@ -275,6 +275,23 @@ const getLists = async function () {
} }
} }
//
const getChannelList = async () => {
try {
const res = await API({
url: '/role/getChannel',
})
console.log('res', res);
if (res.code == 200) {
channelList.value = [...channelList.value, ...res.data]
} else {
console.log('获取频道列表', res.msg);
}
} catch (err) {
console.log('获取频道列表出错', err);
}
}
// //
const goldenBeanMenuIds = new Set([ const goldenBeanMenuIds = new Set([
permissionMapping.gold_bean_audit, permissionMapping.gold_bean_audit,
@ -411,7 +428,8 @@ const permissionEditRoleObj = ref({
market: '', market: '',
parentId: null, parentId: null,
parentName: '', parentName: '',
checkedKeys: []
checkedKeys: [],
channel:''
}) })
// //
@ -458,6 +476,8 @@ const permissionEditRoleInit = async function (row) {
permissionEditRoleObj.value.parentId = row.fatherId permissionEditRoleObj.value.parentId = row.fatherId
permissionEditRoleObj.value.parentName = row.fatherName permissionEditRoleObj.value.parentName = row.fatherName
permissionEditRoleObj.value.channel = row.channel permissionEditRoleObj.value.channel = row.channel
console.log('permissionEditRoleObj.value',permissionEditRoleObj.value);
if (EditIds.includes(124)) { if (EditIds.includes(124)) {
ifHasChannel.value = true ifHasChannel.value = true
} else { } else {
@ -533,11 +553,8 @@ const permissionEditRole = async function () {
const res = await API({ const res = await API({
url: '/menu/update', url: '/menu/update',
data: { data: {
"id": permissionEditRoleObj.value.id,
"roleName": permissionEditRoleObj.value.roleName,
"menuIds": finalCheckedKeys,
"fatherId": permissionEditRoleObj.value.parentId,
"market": permissionEditRoleObj.value.market
...permissionEditRoleObj.value,
menuIds: finalCheckedKeys
} }
}); });
if (res.code === 200) { if (res.code === 200) {
@ -617,6 +634,7 @@ const canEdit = findMenuById(menuTree.value, permissionMapping.edit_role_informa
onMounted(async function () { onMounted(async function () {
await getRoleList() await getRoleList()
await getRoleArea() await getRoleArea()
await getChannelList()
}) })
</script> </script>
@ -725,7 +743,7 @@ onMounted(async function () {
</div> </div>
</el-form-item> </el-form-item>
<el-form-item v-show="ifHasChannel" prop="channel" label="频道名称:" required> <el-form-item v-show="ifHasChannel" prop="channel" label="频道名称:" required>
<el-select v-model="addRole.channel" placeholder="请选择频道" style="width: 220px" clearable>
<el-select v-model="addRole.channel" placeholder="请选择频道" style="width: 220px" filterable clearable>
<el-option v-for="item in channelList" :key="item" :label="item" :value="item" /> <el-option v-for="item in channelList" :key="item" :label="item" :value="item" />
</el-select> </el-select>
</el-form-item> </el-form-item>

Loading…
Cancel
Save