|
@@ -140,6 +140,13 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
+ <el-form-item v-if="showHideItem" label="下载状态" prop="downloadStatusFilter">
|
|
|
|
|
+ <el-select v-model="searchForm.downloadStatusFilter" placeholder="请选择下载状态" clearable style="width: 100%;">
|
|
|
|
|
+ <el-option label="未下载" value="0"></el-option>
|
|
|
|
|
+ <el-option label="已下载" value="1"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button type="default" @click="showHide" :icon="showHideIcon">{{ showHideName }}</el-button>
|
|
<el-button type="default" @click="showHide" :icon="showHideIcon">{{ showHideName }}</el-button>
|
|
|
<el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
|
|
<el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
|
|
@@ -163,6 +170,9 @@
|
|
|
<el-button v-if="hasPermission('cw_finance:invoice:importInvoiceBatch')" type="primary"
|
|
<el-button v-if="hasPermission('cw_finance:invoice:importInvoiceBatch')" type="primary"
|
|
|
@click="projectImport()" plain>批量收款导入</el-button>
|
|
@click="projectImport()" plain>批量收款导入</el-button>
|
|
|
|
|
|
|
|
|
|
+ <el-button type="danger" @click="batchDownloadInvoice()" plain
|
|
|
|
|
+ :disabled="$refs.invoiceTable && $refs.invoiceTable.getCheckboxRecords().length === 0">批量下载数电票</el-button>
|
|
|
|
|
+
|
|
|
<el-switch v-if="hasPermission('cw_finance:invoice:dd_notice')" v-model="dingNoticeEnabled"
|
|
<el-switch v-if="hasPermission('cw_finance:invoice:dd_notice')" v-model="dingNoticeEnabled"
|
|
|
inline-prompt
|
|
inline-prompt
|
|
|
style="margin-left: 10px;--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
style="margin-left: 10px;--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
@@ -249,9 +259,19 @@
|
|
|
$dictUtils.getDictLabel("invoice_status", scope.row.status, '') }} </el-button>
|
|
$dictUtils.getDictLabel("invoice_status", scope.row.status, '') }} </el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
|
|
+ <vxe-column min-width="80" title="下载状态" fixed="right" align="center">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <span v-if="scope.row.omsAttachmentUrl">
|
|
|
|
|
+ <span v-if="scope.row.downloadStatus === '1'" style="color:green;font-weight:bold;">已下载</span>
|
|
|
|
|
+ <span v-else style="color:#999;">未下载</span>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </vxe-column>
|
|
|
<vxe-column min-width="200" title="操作" fixed="right" align="center">
|
|
<vxe-column min-width="200" title="操作" fixed="right" align="center">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div v-if="isAdmin">
|
|
<div v-if="isAdmin">
|
|
|
|
|
+ <el-button v-if="scope.row.omsAttachmentUrl" text type="primary"
|
|
|
|
|
+ @click="handleDownloadAllInvoice(scope.row)">{{ scope.row.downloadStatus === '1' ? '再次下载' : '下载所有格式发票' }}</el-button>
|
|
|
<el-button v-if="(scope.row.status === '5')" text type="primary"
|
|
<el-button v-if="(scope.row.status === '5')" text type="primary"
|
|
|
@click="editForm(scope.row.id)">修改</el-button>
|
|
@click="editForm(scope.row.id)">修改</el-button>
|
|
|
<el-button v-if="(scope.row.status === '5')" text type="primary"
|
|
<el-button v-if="(scope.row.status === '5')" text type="primary"
|
|
@@ -261,7 +281,7 @@
|
|
|
<div v-else>
|
|
<div v-else>
|
|
|
|
|
|
|
|
<el-button v-if="scope.row.omsAttachmentUrl" text type="primary"
|
|
<el-button v-if="scope.row.omsAttachmentUrl" text type="primary"
|
|
|
- @click="handleDownloadAllInvoice(scope.row)">下载所有格式发票</el-button>
|
|
|
|
|
|
|
+ @click="handleDownloadAllInvoice(scope.row)">{{ scope.row.downloadStatus === '1' ? '再次下载' : '下载所有格式发票' }}</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="hasPermission('cw_finance:invoice:add') && scope.row.status === '5' && scope.row.account > 0"
|
|
v-if="hasPermission('cw_finance:invoice:add') && scope.row.status === '5' && scope.row.account > 0"
|
|
|
text type="primary" @click="handleRedInvoice(scope.row)">红冲</el-button>
|
|
text type="primary" @click="handleRedInvoice(scope.row)">红冲</el-button>
|
|
@@ -401,7 +421,8 @@ export default {
|
|
|
loginName: this.$store.state.user.name,
|
|
loginName: this.$store.state.user.name,
|
|
|
reportType: '',
|
|
reportType: '',
|
|
|
status: '',
|
|
status: '',
|
|
|
- name: ''
|
|
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ downloadStatusFilter: ''
|
|
|
},
|
|
},
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
tablePage: {
|
|
tablePage: {
|
|
@@ -665,6 +686,7 @@ export default {
|
|
|
operator: '',
|
|
operator: '',
|
|
|
operatorOffice: '',
|
|
operatorOffice: '',
|
|
|
reportType: '',
|
|
reportType: '',
|
|
|
|
|
+ downloadStatusFilter: '',
|
|
|
}
|
|
}
|
|
|
this.$refs.searchForm.resetFields()
|
|
this.$refs.searchForm.resetFields()
|
|
|
this.refreshList()
|
|
this.refreshList()
|
|
@@ -1221,11 +1243,14 @@ export default {
|
|
|
omsAttachmentUrl = omsAttachmentUrl.substring(0, omsAttachmentUrl.lastIndexOf('/') + 1)
|
|
omsAttachmentUrl = omsAttachmentUrl.substring(0, omsAttachmentUrl.lastIndexOf('/') + 1)
|
|
|
financeInvoiceService.downLoadOMSInvoiceAttachzip({
|
|
financeInvoiceService.downLoadOMSInvoiceAttachzip({
|
|
|
fileUrl: omsAttachmentUrl,
|
|
fileUrl: omsAttachmentUrl,
|
|
|
- invoiceNo: row.no
|
|
|
|
|
|
|
+ invoiceNo: row.no,
|
|
|
|
|
+ invoiceId: row.id
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
// 将二进制流文件写入excel表,以下为重要步骤
|
|
// 将二进制流文件写入excel表,以下为重要步骤
|
|
|
this.$utils.downloadZip(res, '发票-' + row.no + '.zip')
|
|
this.$utils.downloadZip(res, '发票-' + row.no + '.zip')
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
|
|
+ // 刷新列表以更新下载状态
|
|
|
|
|
+ this.refreshList()
|
|
|
}).catch(function (err) {
|
|
}).catch(function (err) {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
if (err.response) {
|
|
if (err.response) {
|
|
@@ -1234,6 +1259,51 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 批量下载数电票
|
|
|
|
|
+ batchDownloadInvoice() {
|
|
|
|
|
+ let selectedRows = this.$refs.invoiceTable.getCheckboxRecords()
|
|
|
|
|
+ // 过滤出有OMS附件的行
|
|
|
|
|
+ selectedRows = selectedRows.filter(row => row.omsAttachmentUrl)
|
|
|
|
|
+ if (selectedRows.length === 0) {
|
|
|
|
|
+ this.$message.error('所选数据中不存在可下载的数电票发票,请重新选择')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (selectedRows.length > 25) {
|
|
|
|
|
+ this.$message.error('单次批量下载不能超过25条,请重新选择')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ let invoiceIds = selectedRows.map(row => row.id)
|
|
|
|
|
+ this.$confirm(`确定批量下载选中的 ${selectedRows.length} 条数电票吗?`, '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ financeInvoiceService.batchDownloadInvoice({ invoiceIds: invoiceIds }).then((res) => {
|
|
|
|
|
+ this.$utils.downloadZip(res, '批量数电票_' + this.moment(new Date()).format('YYYY-MM-DD') + '.zip')
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ // 刷新列表以更新下载状态
|
|
|
|
|
+ this.refreshList()
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ if (err.response && err.response.status === 400) {
|
|
|
|
|
+ // 读取后端返回的错误信息
|
|
|
|
|
+ let reader = new FileReader()
|
|
|
|
|
+ reader.onload = () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ let msg = JSON.parse(reader.result)
|
|
|
|
|
+ this.$message.error(msg.message || '批量下载失败')
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ this.$message.error('批量下载失败,请重试')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ reader.readAsText(err.response.data)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('批量下载失败,请重试')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch(() => {})
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
beforeChangeDingNotice() {
|
|
beforeChangeDingNotice() {
|
|
|
let message = this.dingNoticeEnabled == '1' ? '确定要关闭钉钉通知吗?' : '确定要开启钉钉通知吗?'
|
|
let message = this.dingNoticeEnabled == '1' ? '确定要关闭钉钉通知吗?' : '确定要开启钉钉通知吗?'
|