Browse Source

导出,收款新增用户地区限制

lihui/feature-20251104165712-现金二期
ZhangYong 2 weeks ago
parent
commit
4d2619b928
  1. 53
      src/views/moneyManage/receiveDetail/receiveFinance.vue
  2. 206
      src/views/moneyManage/receiveDetail/receiveHead.vue
  3. 202
      src/views/moneyManage/receiveDetail/receiveManage.vue
  4. 5
      src/views/moneyManage/receiveDetail/receiveService.vue

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

@ -2,7 +2,7 @@
<div class="content">
<div class="div-card1">
<el-card class="card1" style="margin-bottom: 0.5vh; min-height: 110px;">
<div class="row">
<div class="row1">
<div class="rowItem">
<el-text style="width: 4vw;">精网号</el-text>
<el-input v-model="searchData.jwcode" placeholder="请输入精网号" style="width:10vw;"
@ -34,10 +34,12 @@
</el-select>
</div>
</div>
<div class="row" style="margin-top: 10px;">
<div class="row2" style="margin-top: 10px;">
<div class="left">
<div class="rowItem">
<el-text style="width: 4vw;">活动名称</el-text>
<el-select v-model="searchData.activity" placeholder="请选择活动方式" style="width: 10vw;" clearable>
<el-select v-model="searchData.activity" placeholder="请选择活动方式" style="width: 10vw;"
clearable>
<el-option v-for="item in activityList" :key="item.id" :label="item.activityName"
:value="item.id" />
</el-select>
@ -47,20 +49,20 @@
<el-cascader v-model="searchData.goodsName" :options="productList" style="width: 10vw;"
clearable />
</div>
<div class="rowItem" style="width: 30vw">
<div class="rowItem" style="width: 25vw">
<el-text style="width: 4vw; margin-left: 0.5vw;">付款时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间" end-placeholder="结束时间" style="width: 22vw; "
@change="handleDatePickerChange" :default-time="defaultTime"
:disabled-date="disabledDate" />
</div>
<!-- 地区财务查询/重置按钮删除客服相关按钮 -->
<div class="buttons">
<el-button type="primary" @click="search">查询</el-button>
<el-button type="success" @click="reset">重置</el-button>
<el-button type="warning" @click="exportExcel()">导出excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
<el-button style="width: 3vw;" type="primary" @click="search">查询</el-button>
<el-button style="width: 3vw;" type="success" @click="reset">重置</el-button>
<el-button v-if="activeTab == 'done'" style="width: 5vw;" type="warning"
@click="exportExcel()">导出excel</el-button>
<el-button v-if="activeTab == 'done'" style="width: 6vw;" type="primary"
@click="openExportList">查看导出列表</el-button>
</div>
</el-card>
</div>
@ -1283,12 +1285,6 @@ const handlePagination = (type, val) => {
width: 100%;
background: #F3FAFE;
.row {
height: 4vh;
width: 80vw;
display: flex;
min-height: 40px;
.rowItem {
display: flex;
width: 15vw;
@ -1297,11 +1293,30 @@ const handlePagination = (type, val) => {
margin-right: 0.5vw;
}
.buttons {
el-button {
margin-left: 10px;
}
.row1 {
height: 4vh;
width: 80vw;
display: flex;
min-height: 40px;
}
.row2 {
height: 4vh;
width: 80vw;
display: flex;
justify-content: center;
align-items: center;
margin-left: 10px;
min-height: 40px;
.left {
height: 4vh;
width: 58vw;
display: flex;
min-height: 40px;
}
}
}

206
src/views/moneyManage/receiveDetail/receiveHead.vue

@ -2,7 +2,7 @@
<div class="content">
<div class="div-card1">
<el-card class="card1" style="margin-bottom: 0.5vh; min-height: 110px;">
<div class="row">
<div class="row1">
<div class="rowItem">
<el-text style="width: 4vw;">精网号</el-text>
<el-input v-model="searchData.jwcode" placeholder="请输入精网号" style="width:10vw;"
@ -19,7 +19,7 @@
<el-option v-for="item in marketList" :key="item" :label="item" :value="item" />
</el-select>
</div>
<!-- 总部财务固定显示付款币种删除客服的订单状态 -->
<!-- 地区财务固定显示付款币种删除客服的订单状态 -->
<div class="rowItem">
<el-text style="width: 4vw;">付款币种</el-text>
<el-select v-model="searchData.paymentCurrency" placeholder="请选择付款币种" style="width: 10vw;"
@ -34,10 +34,12 @@
</el-select>
</div>
</div>
<div class="row" style="margin-top: 10px;">
<div class="row2" style="margin-top: 10px;">
<div class="left">
<div class="rowItem">
<el-text style="width: 4vw;">活动名称</el-text>
<el-select v-model="searchData.activity" placeholder="请选择活动方式" style="width: 10vw;" clearable>
<el-select v-model="searchData.activity" placeholder="请选择活动方式" style="width: 10vw;"
clearable>
<el-option v-for="item in activityList" :key="item.id" :label="item.activityName"
:value="item.id" />
</el-select>
@ -47,18 +49,20 @@
<el-cascader v-model="searchData.goodsName" :options="productList" style="width: 10vw;"
clearable />
</div>
<div class="rowItem" style="width: 30vw">
<div class="rowItem" style="width: 25vw">
<el-text style="width: 4vw; margin-left: 0.5vw;">付款时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间" end-placeholder="结束时间" style="width: 22vw; "
@change="handleDatePickerChange" :default-time="defaultTime"
:disabled-date="disabledDate" />
</div>
<!-- 总部财务查询/重置按钮删除客服相关按钮 -->
<div class="buttons">
<el-button type="primary" @click="search">查询</el-button>
<el-button type="success" @click="reset">重置</el-button>
</div>
<el-button style="width: 3vw;" type="primary" @click="search">查询</el-button>
<el-button style="width: 3vw;" type="success" @click="reset">重置</el-button>
<el-button v-if="activeTab == 'done'" style="width: 5vw;" type="warning"
@click="exportExcel()">导出excel</el-button>
<el-button v-if="activeTab == 'done'" style="width: 6vw;" type="primary"
@click="openExportList">查看导出列表</el-button>
</div>
</el-card>
</div>
@ -450,6 +454,39 @@
</div>
</div>
</el-dialog>
<!-- 导出列表 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="60vw">
<el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
{{ getTagText(scope.row.state) }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间">
<template #default="scope">
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
</el-table-column>
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button text @click="exportListVisible = false">关闭</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
@ -539,6 +576,126 @@ const ifRefundGold = () => {
}
//
const exportListVisible = ref(false)
const exportList = ref([])
const exportListLoading = ref(false)
const exportExcel = async function () {
let payCurrencySelect = '';
let goodsName = '';
//
if (getTime.value && getTime.value.length === 2) {
searchData.value.startTime = moment(getTime.value[0]).format('YYYY-MM-DD HH:mm:ss');
searchData.value.endTime = moment(getTime.value[1]).format('YYYY-MM-DD HH:mm:ss');
} else {
searchData.value.startTime = '';
searchData.value.endTime = '';
}
//
if (searchData.value.goodsName) {
goodsName = searchData.value.goodsName[searchData.value.goodsName.length - 1];
}
// ID
if (searchData.value.paymentCurrency) {
payCurrencySelect = CurrencyForId(searchData.value.paymentCurrency);
}
const cashRoleId = '2';
const submitterMarket = adminData.value.markets;
searchData.value.status = 46;
const params = {
...pageInfo.value,
cashCollection: {
...searchData.value,
submitterId: adminData.value.id,
receivedMarket: MarketNameForId(submitterMarket),
cashRoleId: cashRoleId,
paymentCurrency: payCurrencySelect,
submitterMarket: submitterMarket,
goodsName: goodsName,
market: MarketNameForId(searchData.value.market)
}
}
const res = await API({ url: '/export/exportCash', data: params })
if (res.code === 200) {
ElMessage.success('导出成功')
} else {
ElMessage.error(res.msg || '导出失败')
}
}
const openExportList = () => {
getExportList()
console.log('daoshiu');
exportListVisible.value = true
}
//
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({ url: '/export/export' })
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 13
})
exportList.value = filteredData
} else {
ElMessage.error(result.msg || '获取导出列表失败')
}
} catch (error) {
console.error('获取导出列表出错:', error)
ElMessage.error('获取导出列表失败,请稍后重试')
} finally {
exportListLoading.value = false
}
}
const downloadExportFile = (item) => {
if (item.state === 2) {
const link = document.createElement('a')
link.href = item.url
link.download = item.fileName
link.click()
} else {
ElMessage.warning('文件还在导出中,请稍后再试')
}
}
//
const getTagType = (state) => {
switch (state) {
case 0:
return 'info';
case 1:
return 'primary';
case 2:
return 'success';
case 3:
return 'danger';
default:
return 'info';
}
}
//
const getTagText = (state) => {
switch (state) {
case 0:
return '待执行';
case 1:
return '执行中';
case 2:
return '执行完成';
case 3:
return '执行出错';
default:
return '未知状态';
}
}
//
const adminData = ref({});
@ -931,12 +1088,6 @@ const handlePagination = (type, val) => {
width: 100%;
background: #F3FAFE;
.row {
height: 4vh;
width: 80vw;
display: flex;
min-height: 40px;
.rowItem {
display: flex;
width: 15vw;
@ -945,11 +1096,30 @@ const handlePagination = (type, val) => {
margin-right: 0.5vw;
}
.buttons {
el-button {
margin-left: 10px;
}
.row1 {
height: 4vh;
width: 80vw;
display: flex;
min-height: 40px;
}
.row2 {
height: 4vh;
width: 80vw;
display: flex;
justify-content: center;
align-items: center;
margin-left: 10px;
min-height: 40px;
.left {
height: 4vh;
width: 58vw;
display: flex;
min-height: 40px;
}
}
}

202
src/views/moneyManage/receiveDetail/receiveManage.vue

@ -2,7 +2,7 @@
<div class="content">
<div class="div-card1">
<el-card class="card1" style="margin-bottom: 0.5vh; min-height: 110px;">
<div class="row">
<div class="row1">
<div class="rowItem">
<el-text style="width: 4vw;">精网号</el-text>
<el-input v-model="searchData.jwcode" placeholder="请输入精网号" style="width:10vw;"
@ -34,10 +34,12 @@
</el-select>
</div>
</div>
<div class="row" style="margin-top: 10px;">
<div class="row2" style="margin-top: 10px;">
<div class="left">
<div class="rowItem">
<el-text style="width: 4vw;">活动名称</el-text>
<el-select v-model="searchData.activity" placeholder="请选择活动方式" style="width: 10vw;" clearable>
<el-select v-model="searchData.activity" placeholder="请选择活动方式" style="width: 10vw;"
clearable>
<el-option v-for="item in activityList" :key="item.id" :label="item.activityName"
:value="item.id" />
</el-select>
@ -47,18 +49,20 @@
<el-cascader v-model="searchData.goodsName" :options="productList" style="width: 10vw;"
clearable />
</div>
<div class="rowItem" style="width: 30vw">
<div class="rowItem" style="width: 25vw">
<el-text style="width: 4vw; margin-left: 0.5vw;">付款时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间" end-placeholder="结束时间" style="width: 22vw; "
@change="handleDatePickerChange" :default-time="defaultTime"
:disabled-date="disabledDate" />
</div>
<!-- 地区财务查询/重置按钮删除客服相关按钮 -->
<div class="buttons">
<el-button type="primary" @click="search">查询</el-button>
<el-button type="success" @click="reset">重置</el-button>
</div>
<el-button style="width: 3vw;" type="primary" @click="search">查询</el-button>
<el-button style="width: 3vw;" type="success" @click="reset">重置</el-button>
<el-button v-if="activeTab == 'done'" style="width: 5vw;" type="warning"
@click="exportExcel()">导出excel</el-button>
<el-button v-if="activeTab == 'done'" style="width: 6vw;" type="primary"
@click="openExportList">查看导出列表</el-button>
</div>
</el-card>
</div>
@ -231,6 +235,38 @@
</div>
</div>
<!-- 导出列表 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="60vw">
<el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
{{ getTagText(scope.row.state) }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间">
<template #default="scope">
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
</el-table-column>
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button text @click="exportListVisible = false">关闭</el-button>
</div>
</template>
</el-dialog>
<!-- 仅保留地区财务相关弹窗审核弹窗编辑手续费弹窗 -->
<!-- 审核弹窗 -->
<el-dialog class="adddialog" v-model="auditFormisible" width="20vw" :before-close="closeAuditForm">
@ -688,6 +724,123 @@ const closeConfirmRefund = () => {
textContent.value = ''
}
//
const exportListVisible = ref(false)
const exportList = ref([])
const exportListLoading = ref(false)
const exportExcel = async function () {
let payCurrencySelect = '';
let goodsName = '';
//
if (getTime.value && getTime.value.length === 2) {
searchData.value.startTime = moment(getTime.value[0]).format('YYYY-MM-DD HH:mm:ss');
searchData.value.endTime = moment(getTime.value[1]).format('YYYY-MM-DD HH:mm:ss');
} else {
searchData.value.startTime = '';
searchData.value.endTime = '';
}
//
if (searchData.value.goodsName) {
goodsName = searchData.value.goodsName[searchData.value.goodsName.length - 1];
}
// ID
if (searchData.value.paymentCurrency) {
payCurrencySelect = CurrencyForId(searchData.value.paymentCurrency);
}
const cashRoleId = '1';
const submitterMarket = adminData.value.markets;
searchData.value.status = 46;
const params = {
...pageInfo.value,
cashCollection: {
...searchData.value,
submitterId: adminData.value.id,
receivedMarket: MarketNameForId(submitterMarket),
cashRoleId: cashRoleId,
paymentCurrency: payCurrencySelect,
submitterMarket: submitterMarket,
goodsName: goodsName,
market: MarketNameForId(searchData.value.market)
}
}
const res = await API({ url: '/export/exportCash', data: params })
if (res.code === 200) {
ElMessage.success('导出成功')
} else {
ElMessage.error(res.msg || '导出失败')
}
}
const openExportList = () => {
getExportList()
exportListVisible.value = true
}
//
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({ url: '/export/export' })
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 13
})
exportList.value = filteredData
} else {
ElMessage.error(result.msg || '获取导出列表失败')
}
} catch (error) {
console.error('获取导出列表出错:', error)
ElMessage.error('获取导出列表失败,请稍后重试')
} finally {
exportListLoading.value = false
}
}
const downloadExportFile = (item) => {
if (item.state === 2) {
const link = document.createElement('a')
link.href = item.url
link.download = item.fileName
link.click()
} else {
ElMessage.warning('文件还在导出中,请稍后再试')
}
}
//
const getTagType = (state) => {
switch (state) {
case 0:
return 'info';
case 1:
return 'primary';
case 2:
return 'success';
case 3:
return 'danger';
default:
return 'info';
}
}
//
const getTagText = (state) => {
switch (state) {
case 0:
return '待执行';
case 1:
return '执行中';
case 2:
return '执行完成';
case 3:
return '执行出错';
default:
return '未知状态';
}
}
// 2.1
const getlist = async () => {
@ -1093,7 +1246,7 @@ onMounted(async () => {
await getlist();
//
if (!hasMenuPermission(menuTree.value, 79)) {
if (!hasMenuPermission(menuTree.value, 67)) {
ElMessageBox.alert(
'您暂无该页面操作权限,请联系管理员',
'权限提示',
@ -1132,12 +1285,6 @@ const handlePagination = (type, val) => {
width: 100%;
background: #F3FAFE;
.row {
height: 4vh;
width: 80vw;
display: flex;
min-height: 40px;
.rowItem {
display: flex;
width: 15vw;
@ -1146,11 +1293,30 @@ const handlePagination = (type, val) => {
margin-right: 0.5vw;
}
.buttons {
el-button {
margin-left: 10px;
}
.row1 {
height: 4vh;
width: 80vw;
display: flex;
min-height: 40px;
}
.row2 {
height: 4vh;
width: 80vw;
display: flex;
justify-content: center;
align-items: center;
margin-left: 10px;
min-height: 40px;
.left {
height: 4vh;
width: 58vw;
display: flex;
min-height: 40px;
}
}
}

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

@ -561,9 +561,14 @@ const jwcodeSeachMarket = async () => {
url: '/cashCollection/getNameAndMarket',
data: addFormData.value.jwcode
})
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{
ElMessage.error('客户不存在')
}
} catch (error) {
console.log(error);
}

Loading…
Cancel
Save