Commit b36e82c3 by 前端

版本功能代码提交

1 parent f870418c
...@@ -38,3 +38,39 @@ export function nbcbReceiptPdfUrl(data) { ...@@ -38,3 +38,39 @@ export function nbcbReceiptPdfUrl(data) {
data.method = `${path}nbcb.receipt.pdf.url` data.method = `${path}nbcb.receipt.pdf.url`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 批量打印
export function batchPrinting(data) {
data.method = `${path}nbcb.acc.batch.printing`
return request(data, RequestMethods.POST)
}
// 查询交易明细、回单文件解析任务结果(手动导入关联时使用,无任务id时会新建任务id)
export function getImportTask(data) {
data.method = `${path}nbcb.acc.association.import.task`
return request(data, RequestMethods.POST)
}
// 交易明细、回单关联
export function association(data) {
data.method = `${path}nbcb.acc.association`
return request(data, RequestMethods.POST)
}
// 同步保存交易明细、回单 关联记录
export function saveAssociation(data) {
data.method = `${path}nbcb.acc.association.save`
return request(data, RequestMethods.POST)
}
// 交易明细excel导入
export function detailExcelImport(data) {
data.method = `${path}nbcb.acc.detail.excel.import`
return request(data, "post", ["file"])
}
// 回单文件导入(.pdf|.zip|.rar)
export function receiptImport(data) {
data.method = `${path}nbcb.acc.receipt.import`
return request(data, "post", ["file"])
}
...@@ -1076,6 +1076,12 @@ export const operationResultOpt = [ ...@@ -1076,6 +1076,12 @@ export const operationResultOpt = [
{ confId: "N", confValue: "失败" } { confId: "N", confValue: "失败" }
] ]
// 财资数据 关联状态
export const associationOpt = [
{ confId: 1, confValue: "未关联" },
{ confId: 2, confValue: "已关联" }
]
// 订单管理 会员权益订单 上传协议 // 订单管理 会员权益订单 上传协议
export const zyVoucherStatusOpt = [ export const zyVoucherStatusOpt = [
{ confId: "0", confValue: "无需上传" }, { confId: "0", confValue: "无需上传" },
......
...@@ -57,7 +57,7 @@ export const routerName = { ...@@ -57,7 +57,7 @@ export const routerName = {
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleAccountConfirm" handle: "handleAccountConfirm"
}, }
], ],
component: _import("financeManage/index") component: _import("financeManage/index")
}, },
...@@ -346,8 +346,43 @@ export const routerName = { ...@@ -346,8 +346,43 @@ export const routerName = {
parentId: "90509", parentId: "90509",
label: "回单", label: "回单",
handle: "handleReceipt" handle: "handleReceipt"
},
{
authId: "9050908",
parentId: "90509",
label: "导入明细&回单",
category: "Button",
type: "primary",
handle: "handleImportDetailAndReceipt",
addRoutePath: [
{
authId: "905090801",
name: "导入明细&回单",
parentId: "90509"
}
]
},
{
authId: "9050909",
parentId: "90509",
label: "批量打印",
category: "Button",
type: "primary",
handle: "handleBatchPrint"
} }
], ],
component: _import("financeManage/theAssetData/index") component: _import("financeManage/theAssetData/index")
},
905090801: {
path: "/importDetailControl",
name: "importDetailControl",
meta: {
title: "导入明细&回单",
authId: "905090801",
parentId: "90509",
sideHidden: true,
activePath: "/importDetailControl"
},
component: _import("financeManage/theAssetData/importDetailControl")
} }
} }
<!-- 导入明细&回单 第三步 -->
<template>
<d2-container>
<div class="infoDiv">
<div class="imgCon">
<img src="../image/threeStep.png"
class="imgSize">
</div>
<div class="describe">
<div class="describe-title">
<div><img src="../image/info-circle-fill.png"></div>
<div class="describe-title-text">操作成功</div>
<div class="describe-title-tips">请关注企微机器人通知</div>
</div>
<div class="describe-text">
流水明细状态:{{ resultInfo.detailSuccessCount ? resultInfo.detailSuccessCount : '-' }}条</div>
<div class="describe-text">
导入回单:{{ resultInfo.receiptSuccessCount ? resultInfo.receiptSuccessCount : '-' }}条</div>
</div>
<div class="footer">
<el-button @click="submitForm"
type="primary"
:loading="$store.state.d2admin.loading.value">再导一次</el-button>
<el-button @click="routerBack">返回</el-button>
</div>
</div>
</d2-container>
</template>
<script>
import { mapActions, mapState } from 'vuex'
export default {
name: 'ImportThree',
props: {
resultInfo: {
type: Object,
default: () => { }
}
},
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.getBaseData()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
},
routerBack() {
this.$emit('goBackListPage')
},
submitForm() {
this.$emit('importAgain', obj)
}
}
}
</script>
<style scoped>
.infoDiv {
width: 100%;
/* height: 100%; */
background-color: #fff;
}
.imgCon {
text-align: center;
/* margin-bottom: 50px; */
}
.imgSize {
width: 1200px;
}
.describe {
border-radius: 4px;
opacity: 1;
background: #fafafa;
width: 98%;
height: 110px;
/* margin: 0 auto 20px; */
.describe-title {
display: flex;
justify-content: center; /* 水平居中 */
padding: 17px 0 0 9px;
.describe-title-text {
font-size: 16px;
font-weight: 600;
padding-left: 10px;
}
.describe-title-tips {
font-size: 14px;
color: #999999;
padding-left: 8px;
}
}
.describe-text {
font-size: 14px;
color: #333333;
text-align: center;
padding-top: 5px;
}
}
.footer {
text-align: center;
padding: 20px 0 20px 0;
}
</style>
<!-- 导入明细&回单主页面 -->
<template>
<div class="importDetail">
<div class="header"
slot="header">
<div>
<import-one ref="importOne"
v-if="activeName === 'one'"
@oneStepComplete="oneStepComplete" />
<import-two v-if="activeName === 'two'"
:task-info="taskInfo"
@twoStepComplete="twoStepComplete"
@goBackOneStep="goBackOneStep" />
<import-three v-if="activeName === 'three'"
:result-info="resultInfo"
@importAgain="importAgain"
@goBackListPage="goBackListPage" />
</div>
</div>
</div>
</template>
<script>
import importOne from './components/importOne'
import importTwo from './components/importTwo'
import importThree from './components/importThree'
import { mapActions } from 'vuex'
export default {
name: 'StaffIndex',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
activeName: 'one',
taskInfo: null,
resultInfo: null
}
},
components: {
importOne,
importTwo,
importThree
},
mounted() {
if (this.$route.query.step) {
console.log('step', this.$route.query.step)
this.activeName = this.$route.query.step
this.taskInfo = this.$route.query.taskInfo
}
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
oneStepComplete(data) {
console.log('data', data)
this.activeName = 'two'
},
goBackOneStep(data) {
console.log('data', data)
this.activeName = 'one'
},
twoStepComplete(data) {
this.resultInfo = data
this.activeName = 'three'
},
importAgain(data) {
console.log('data', data)
this.activeName = 'one'
},
goBackListPage(data) {
console.log('data', data)
this.close({ tagName: "/importDetailControl" })
this.$router.push({
name: "theAssetData"
})
}
}
}
</script>
<style lang="scss" scoped>
.importDetail {
padding: 0 20px;
.header {
::v-deep .el-tabs__header {
margin: 0;
padding: 0 20px;
}
}
}
</style>
...@@ -5,6 +5,20 @@ ...@@ -5,6 +5,20 @@
<div class="header" <div class="header"
slot="header" slot="header"
style="padding: 10px 20px;"> style="padding: 10px 20px;">
<div class="importResult-1"
v-if="taskStatus == 0 || taskStatus == 2">
<div class="importResult-1-font"
v-if="taskStatus == 0">当前导入任务进行中,请稍候…</div>
<div class="importResult-1-font"
v-if="taskStatus == 2">当前导入任务失败,请重新导入!</div>
</div>
<div class="importResult-2"
v-if="taskStatus == 1">
<div class="importResult-2-font">当前导入任务已完成,请点击“去关联”按钮,进行下一步操作。<el-button
@click="gotoImportTwo"
size="small"
type="primary">去关联</el-button></div>
</div>
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
...@@ -16,16 +30,6 @@ ...@@ -16,16 +30,6 @@
end-placeholder="最大金额" end-placeholder="最大金额"
:display-value="searchForm.qualityTestScore"></input-range> :display-value="searchForm.qualityTestScore"></input-range>
</div> </div>
<!-- 交易时间 -->
<!-- <div slot="transactionTimeHtml">
<el-date-picker v-model="searchForm.transactionTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOption['rangePickerOptions']">
</el-date-picker>
</div> -->
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button @click="handleSearch" <el-button @click="handleSearch"
...@@ -77,6 +81,35 @@ ...@@ -77,6 +81,35 @@
v-if="detailVisible" v-if="detailVisible"
:params-obj="recordInfo" :params-obj="recordInfo"
@dialogClose="closeDetailDialog" /> @dialogClose="closeDetailDialog" />
<!-- 批量打印 -->
<d2-dialog title="批量打印"
:is-visible="batchPrintVisible"
width="30%"
btn-ok-label="打印"
@closeDialog="handleClosePrint"
@confirmDialog="handlePrintConfirm">
<el-form ref="printFormRef"
:model="printForm"
label-width="200px">
<el-form-item label="纸张类型:">
<el-radio-group v-model="printForm.pageType">
<el-radio v-for="(item, index) in pageTypeList"
:label="item.confId"
:key="index">{{
item.confLabel }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="打印张数:">
<el-select v-model="printForm.usage"
style="width:200px">
<el-option v-for="item in usageList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId" />
</el-select>
</el-form-item>
</el-form>
</d2-dialog>
</div> </div>
</template> </template>
...@@ -85,10 +118,11 @@ import { Util, deepClone } from '@/common/util' ...@@ -85,10 +118,11 @@ import { Util, deepClone } from '@/common/util'
// import { rangePickerOptions } from '@/common/format' // import { rangePickerOptions } from '@/common/format'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { cdSignOpt, jdSyncOpt, receiptStatusOpt } from '@/common/constants.js' import { cdSignOpt, jdSyncOpt, receiptStatusOpt } from '@/common/constants.js'
import { nbcbAccDetailPage, nbcbAccDetailConfig, nbcbAccDetailBatchSync, nbcbReceiptPdfUrl } from '@api/theAssetData' import { nbcbAccDetailPage, nbcbAccDetailConfig, nbcbAccDetailBatchSync, nbcbReceiptPdfUrl, batchPrinting, getImportTask } from '@api/theAssetData'
import inputRange from './components/inputRange' import inputRange from './components/inputRange'
import refetchDialog from './components/refetchDialog' import refetchDialog from './components/refetchDialog'
import detailDialog from './components/detailDialog' import detailDialog from './components/detailDialog'
// import PrintJs from 'print-js'
export default { export default {
name: 'TransferAccountsList', name: 'TransferAccountsList',
components: { components: {
...@@ -118,6 +152,10 @@ export default { ...@@ -118,6 +152,10 @@ export default {
transactionTime: '', transactionTime: '',
receiptStatus: '' receiptStatus: ''
}, },
printForm: {
pageType: 1,
usage: 1
},
searchFormSearch: {}, searchFormSearch: {},
showFormData: [{ showFormData: [{
label: '单位名称', label: '单位名称',
...@@ -322,12 +360,50 @@ export default { ...@@ -322,12 +360,50 @@ export default {
curCodeList: [], curCodeList: [],
cdSignOpt: deepClone(cdSignOpt), cdSignOpt: deepClone(cdSignOpt),
jdSyncOpt: deepClone(jdSyncOpt), jdSyncOpt: deepClone(jdSyncOpt),
receiptStatusOpt: deepClone(receiptStatusOpt), receiptStatusOpt: deepClone(receiptStatusOpt)
}, },
recordInfo: null, recordInfo: null,
refetchVisible: false, refetchVisible: false,
detailVisible: false detailVisible: false,
batchPrintVisible: false,
pageTypeList: [
{
confId: 1,
confLabel: 'A4'
}, {
confId: 2,
confLabel: '凭证纸'
}
],
usageList: [
{
confId: 1,
confLabel: '一页一张'
}, {
confId: 2,
confLabel: '一页两张'
}
],
printIds: [],
// pdfList: [
// {
// url: 'http://qcimg01.glsx.com.cn:7060/group1/M00/0A/90/wKgD3mf4scSAZNUcAAD9t7PxMfg636.pdf',
// type: 'pdf'
// },
// {
// url: 'http://qcimg01.glsx.com.cn:7060/group1/M00/0A/90/wKgD3mf4scSAI2MgAAETp3jIA7Q537.pdf',
// type: 'pdf'
// },
// {
// url: 'http://qcimg01.glsx.com.cn:7060/group1/M00/0A/91/wKgD3mf4scWAJEzSAAGESGIDxm0099.pdf',
// type: 'pdf'
// }
// ]
taskId: null,
taskInfo: null,
taskStatus: null,
intervalId: null // 存储定时器ID
} }
}, },
computed: { computed: {
...@@ -335,9 +411,25 @@ export default { ...@@ -335,9 +411,25 @@ export default {
dowloadList: (state) => state.d2admin.user.dowloadList dowloadList: (state) => state.d2admin.user.dowloadList
}) })
}, },
watch: {
taskStatus: {
handler(newVal) {
console.log('newVal', newVal)
if (newVal == 1 || newVal == 2) {
this.stopPolling()
}
},
deep: true
}
},
mounted() { mounted() {
this.nbcbAccDetailConfig() this.nbcbAccDetailConfig()
this.getBaseData() this.getBaseData()
if (this.$route.query.taskId) {
console.log('taskId', this.$route.query.taskId)
this.taskId = this.$route.query.taskId
this.startPolling()
}
}, },
methods: { methods: {
...@@ -545,14 +637,121 @@ export default { ...@@ -545,14 +637,121 @@ export default {
}) })
} }
}) })
// window.open('http://qcimg01.glsx.com.cn:7060/group1/M00/07/46/wKgD3mdD9oaARUE4AABxS-wgZWk991.pdf') },
handleImportDetailAndReceipt() {
this.close({ tagName: "/theAssetData" })
this.$router.push({
name: "importDetailControl"
})
},
handleBatchPrint() {
var selectedData = []
if (this.$refs.recordTable.mutiSelectArr.transferAccounts) {
selectedData = this.$refs.recordTable.mutiSelectArr.transferAccounts
}
if (!selectedData?.length) {
this.$message({
message: "请选择要打印的明细",
type: "warning",
showClose: true
})
return false
}
this.printIds = selectedData.map((item) => {
return item.id
})
this.batchPrintVisible = true
},
handlePrintConfirm() {
const params = deepClone(this.printForm)
params.detailIds = this.printIds
batchPrinting(params).then(res => {
window.open(res)
})
},
handleClosePrint() {
this.batchPrintVisible = false
},
// //前端处理批量打印
// handleBatchPrint() {
// // let arr = []
// // arr = deepClone(this.pdfList)
// // this.printInvoice(arr)
// },
// printInvoice(arr) {
// console.log('arr', arr)
// if (!arr || arr.length === 0) {
// return
// }
// const self = this
// const list = arr
// const printObj = list.shift()
// console.log('printObj', printObj)
// PrintJs({
// printable: printObj.url, // 打印文件url
// type: printObj.type, // 文件类型
// // 关闭打印窗口回调
// onPrintDialogClose: (res) => {
// if (list && list.length > 0) {
// // 递归调用
// self.printInvoice(list)
// }
// },
// // 失败回调
// onError: err => {
// console.log('err', err)
// }
// })
// }
gotoImportTwo() {
const query = {}
const taskInfo = deepClone(this.taskInfo)
taskInfo.detailResultSuccessCount = taskInfo.detailResult.successList.length
taskInfo.detailResultFailCount = taskInfo.detailResult.failList?.length || 0
taskInfo.detailResultTotalCount = taskInfo.detailResultSuccessCount + taskInfo.detailResultFailCount
taskInfo.detailResultFailUrl = taskInfo.detailResult.failListUrl
taskInfo.receiptResultSuccessCount = taskInfo.receiptResult?.length || 0
delete taskInfo.detailResult
delete taskInfo.receiptResult
query.step = "two"
query.taskInfo = taskInfo
console.log('query.taskInfo', query.taskInfo)
this.close({ tagName: "/theAssetData" })
this.$router.push({
name: "importDetailControl",
query
})
},
getImportTask() {
getImportTask({ taskId: this.taskId }).then(res => {
if (res) {
this.taskInfo = deepClone(res)
this.taskStatus = res.taskStatus
}
})
},
startPolling() {
this.intervalId = setInterval(this.getImportTask, 5000) // 每5秒调用一次
},
stopPolling() {
clearInterval(this.intervalId) // 清除定时器,防止内存泄漏
this.intervalId = null // 重置定时器ID
} }
},
beforeDestroy() {
this.stopPolling() // 组件销毁前清除定时器
} }
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
.count-txt { .count-txt {
font-weight: 700; font-weight: 700;
color: #2a58ad; color: #2a58ad;
...@@ -568,4 +767,28 @@ export default { ...@@ -568,4 +767,28 @@ export default {
.tableHeaderBtn { .tableHeaderBtn {
margin-left: 10px; margin-left: 10px;
} }
.importResult-1 {
width: 100%;
height: 40px;
background: #fff3e8;
color: #ff8d1a;
font-size: 14px;
display: flex;
align-items: center; /* 垂直居中 */
.importResult-1-font {
margin-left: 20px;
}
}
.importResult-2 {
width: 100%;
height: 40px;
background: #d4deef;
color: #2a58ad;
font-size: 14px;
display: flex;
align-items: center; /* 垂直居中 */
.importResult-2-font {
margin-left: 20px;
}
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!