feat:定制化开发

release
zhaoxingchang.sd 11 months ago
parent 6fb4a7c010
commit 8c0b1c5cfa
  1. 2
      config/index.js
  2. 4
      package.json
  3. 34
      src/api/invoice.js
  4. 24
      src/api/url.js
  5. 151
      src/components/attachmentUpload/filePreviewer.vue
  6. 683
      src/components/attachmentUpload/index.vue
  7. 712
      src/components/attachmentUploadManage.vue
  8. 271
      src/components/invoiceManagement/InvoiceManagement.vue
  9. 83
      src/components/riliInvoice/PurseSuccess.vue
  10. 192
      src/components/riliInvoice/riliPurse.vue
  11. 8
      src/pcViewIn.vue
  12. 16
      src/router/pcRouters.js
  13. 9258
      yarn.lock

@ -30,7 +30,7 @@ module.exports = {
proxyTable: {
'/api': {
// target: 'https://wx.5ifapiao.com/bxsdk3thMgt',
target: 'http://10.1.30.203:18081/bxsdk', //王汝伟
target: 'http://121.36.69.92:10000/bxsdk', //王汝伟
// target: 'http://10.1.1.34:80/bxsdk',
// target: 'http://10.1.5.252:18081/bxsdk',
changeOrigin: true,

@ -13,6 +13,9 @@
"analyz": "NODE_ENV=production npm_config_report=true npm run build"
},
"dependencies": {
"@vue-office/docx": "^1.6.2",
"@vue-office/excel": "^1.6.2",
"@vue-office/pdf": "^1.6.2",
"axios": "^0.16.2",
"dxhy-excelpreview": "^1.0.2",
"element-ui": "^2.7.0",
@ -35,6 +38,7 @@
"vue": "^2.7.16",
"vue-awesome-swiper": "^3.1.2",
"vue-cropper": "^0.2.9",
"vue-demi": "^0.14.10",
"vue-mobile-calendar": "^3.0.6",
"vue-photo-preview": "^1.1.3",
"vue-resource": "^1.5.1",

@ -296,4 +296,38 @@ export default {
queryRuleBy2022(param, headers){
return fetch(url.queryRuleBy2022, param, headers)
},
fileManagelistApi(param, headers){
return fetch(url.fileManagelistApi, param, headers)
},
fileTypeListApi(param, headers){
return fetch(url.fileTypeListApi, param, headers)
},
fileManagegetImageApi(param, headers){
return fetch(url.fileManagegetImageApi, param, headers)
},
fileManageuploadApi(param, headers){
return fetch(url.fileManageuploadApi, param, headers)
},
filedeleteFileApi(param, headers){
return fetch(url.filedeleteFileApi, param, headers)
},
insertFileTypeApi(param, headers){
return fetch(url.insertFileTypeApi, param, headers)
},
exportMyFileApi(param, headers){
return fetch(url.exportMyFileApi, param, headers)
},
deleteFileTypeApi(param, headers){
return fetch(url.deleteFileTypeApi, param, headers)
},
updateFileTypeApi(param, headers){
return fetch(url.updateFileTypeApi, param, headers)
},
exportInvoiceItemListApi(param, headers){
return fetch(url.exportInvoiceItemListApi, param, headers)
},
}

@ -6,11 +6,12 @@ if (process.env.NODE_ENV == 'produce') {
// base = '/bxsdk-api' // 公司生产环境
} else {
// 开发、测试环境
base = process.env.NODE_ENV === 'development' ? "/api" : '/bxsdk'
// base = process.env.NODE_ENV === 'development' ? "/api" : '/bxsdk'
// base = process.env.NODE_ENV === 'development' ? "/api" : 'https://wx.5ifapiao.com/bxsdk3thMgt'; // 公司测试环境
// base = process.env.NODE_ENV === 'development' ? "/api" : '/bx'
base = '/api'
}
console.log('base = ', base)
export default {
/**
* 基础路径
@ -298,4 +299,23 @@ export default {
// 删除附件
deleteInvoiceFiles: '/app/common/invoice/deleteInvoiceFiles',
fileManagelistApi: '/fileManage/list',
fileTypeListApi: '/fileManage/fileTypeList',
fileManagegetImageApi:'/fileManage/getImage',
fileManageuploadApi:'/fileManage/upload',
filedeleteFileApi:'/fileManage/deleteFile',
insertFileTypeApi:'/fileManage/insertFileType',
exportMyFileApi:'/fileManage/exportMyFile',
deleteFileTypeApi:'/fileManage/deleteFileType',
updateFileTypeApi:'/fileManage/updateFileType',
exportInvoiceItemListApi:'/fileManage/exportInvoiceItemList',
}

@ -0,0 +1,151 @@
<template>
<div>
<el-dialog title="预览文件" :visible.sync="popShow" @close="clearPreview">
<vue-office-docx :src="docxUrl" v-if="isWord"/>
<vue-office-excel style="min-height: 500px;width: 100%" :src="excelUrl" v-if="isExcel" />
<vue-office-pdf style="height: 100%;" :src="pdfUrl" v-if="isPDF" />
<el-image alt="双击放大图片" v-if="isImage" style="height: 100%; width: 100%" :initial-view-opener="true" :preview-src-list="[imageUrl]" :src="imageUrl" />
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="popShow = false && clearPreview()"> </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
//
import '@vue-office/docx/lib/index.css'
import '@vue-office/excel/lib/index.css'
//VueOffice
import VueOfficeExcel from '@vue-office/excel'
import VueOfficePdf from '@vue-office/pdf'
import VueOfficeDocx from '@vue-office/docx';
import axios from 'axios';
export default {
name: 'FilePreviewer',
components: {
VueOfficeDocx,
VueOfficeExcel,
VueOfficePdf
},
props: {
byUuid: {
type: String,
required: true
}
},
data() {
return {
docxUrl:null,
excelUrl:null,
imageUrl: null,
pdfUrl:null,
isPDF: false,
isImage: false,
isWord: false,
isExcel: false,
wordContent: '',
excelContent: '',
popShow: false,
loading: false
};
},
mounted() {
this.$nextTick(() => {
this.$refs.pdfContainer = document.getElementById('pdfContainer');
});
},
methods: {
async previewFile() {
if (!this.byUuid) {
this.$message.error('文件不存在');
return;
}
this.loading = true;
this.clearPreview();
try {
const response = await axios.post('/fileManage/getImage', { uuid: this.byUuid }, {
responseType: 'blob'
});
const blob = response.data;
const mimeType = response.headers['content-type'];
switch (mimeType) {
case 'application/pdf':
this.isPDF = true;
this.pdfUrl = URL.createObjectURL(blob);
;
break;
case 'image/png':
case 'image/jpeg':
case 'image/gif':
case 'image/bmp':
case 'image/tiff':
this.isImage = true;
this.imageUrl = URL.createObjectURL(blob);
break;
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
case 'application/vnd.ms-word.document.macroEnabled.12': // docx
case 'application/msword': // .doc
this.isWord = true;
this.docxUrl = URL.createObjectURL(blob);
;
break;
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
this.isExcel = true;
this.excelUrl = URL.createObjectURL(blob);
break;
default:
this.isErr = true;
console.log('Unsupported file type:', mimeType);
this.loading = false;
return;
}
this.popShow = true;
this.loading = false;
} catch (error) {
console.error('Error fetching file:', error);
this.loading = false;
}
},
clearPreview() {
this.isPDF = false;
this.isImage = false;
this.isWord = false;
this.isExcel = false;
this.wordContent = '';
this.excelContent = '';
this.imageUrl = '';
if (this.$refs.pdfContainer) {
this.$refs.pdfContainer.innerHTML = '';
}
}
}
};
</script>
<style>
#pdfContainer {
width: 100%;
height: 100%;
border: 1px solid #ccc;
}
.loading {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
font-size: 18px;
color: #333;
}
</style>

@ -0,0 +1,683 @@
<template>
<div id="blackList">
<div class="rules_form">
<el-form :inline="true" :model="formInline" class="serchWrap">
<el-form-item label="关键字:">
<el-input v-model="formInline.keyWord" placeholder="请输入" clearable></el-input>
</el-form-item>
<el-form-item label="附件类型:">
<el-select clearable filterable multiple v-model="formInline.fileType" placeholder="请选择">
<el-option v-for="item in insertFileTypeList" :key="item.id" :label="item.fileName" :value="item.fileName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="添加时间:">
<el-date-picker
class="elpicker"
:clearable="false"
v-model="formInline.time"
:default-value="getDefaultDateRange()"
value-format="yyyy-MM-dd"
size="small"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" size="medium" icon="el-icon-search" @click="findAll(1)">查询</el-button>
<el-button type="primary" size="medium" @click="resetBtn">重置</el-button>
</el-form-item>
</el-form>
</div>
<div
class="btnBox"
style="width: 100%; height: 53px; border-top: 1.2px dashed #d9d9d9"
>
<div
style="
float: left;
height: 35px;
width: auto;
margin-top: 16px;
vertical-align: middle;
text-align: justify;
box-sizing: border-box;
"
>
<span
style="
width: 3px;
height: 40%;
background-color: #229fff;
display: inline-block;
border-box: box-sizing;
vertical-align: middle;
"
></span>
<span
style="
font-size: 14px;
color: #333333;
margin-left: 5px;
vertical-align: middle;
"
>附件上传</span
>
</div>
<div style="float: right; margin: 10px 0px 5px 10px">
<el-button type="primary" size="medium" @click="upFileBtn">附件上传</el-button>
</div>
</div>
<div class="rules_table tableSection">
<el-table
stripe
v-loading="loading"
:data="tableData"
:height="maxHeight"
row-class-name="rowDisabledClass"
@selection-change="handleSelectionChange"
border
style="width: 100%"
>
<!-- <el-table-column :selectable="selectable" type="selection" width="55"></el-table-column>-->
<el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
<el-table-column prop="fileType" label="附件类型"></el-table-column>
<el-table-column prop="fileNum" label="附件编号"></el-table-column>
<el-table-column prop="fileName" label="附件名称"></el-table-column>
<el-table-column prop="addTime" label="添加时间"></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="170"
>
<template slot-scope="scope">
<button
class="cellBtn"
@click="previewBtn(scope.row)"
>
预览
</button>
<button
class="cellBtn"
@click="dowBtn(scope.row)"
>
下载
</button>
<button
class="cellBtn"
@click="deleteBtn(scope.row)"
>
删除
</button>
</template>
</el-table-column>
</el-table>
</div>
<div class="rules_footer">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageRow"
layout="total, prev, pager, next, sizes, jumper"
:total="total"
>
</el-pagination>
</div>
<el-dialog
title="附件上传"
class="parseWinStyle scanDialogClass"
width="500px"
:visible.sync="showModal"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form
class="importFileForm"
ref="importFile"
:model="importFile"
:rules="importFileRules"
label-width="90px"
>
<el-form-item label="附件类型:">
<el-select clearable v-model="importFile.fileType" placeholder="请选择">
<el-option v-for="item in insertFileTypeList" :key="item.id" :label="item.fileName" :value="item.fileName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="附件上传" prop="fileList">
<el-upload
action=""
ref="uploadFile"
:auto-upload="false"
:on-change="fileChange"
:on-remove="fileRemove"
:file-list="importFile.fileList"
:limit="1"
:on-exceed="handleExceed"
>
<el-button class="btn-cancel importBtn"
><i class="el-icon-upload2" style="font-size: 16px;"></i>
上传文件</el-button
>
<span v-if="importFile.fileList.length === 0">未选取文件</span>
</el-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="medium" class="btn-cancel" @click="cancelSave" :loading="tipModaSureBtnloading"
>取消</el-button
>
<el-button
size="medium" type="primary"
class="btn-confirm"
:disabled="disabledImport"
:loading="tipModaSureBtnloading"
@click="importFileConfirm"
><i class="el-icon-loading" v-if="disabledImport"></i>确认</el-button
>
</span>
</el-dialog>
<filePreviewer :byUuid="RowUuid" ref="filePreviewerRef"></filePreviewer>
</div>
</template>
<script>
import api from '@/api/invoice';
import filePreviewer from './filePreviewer.vue';
import axios from "axios";
export default {
name: 'blackList',
components: {filePreviewer},
data() {
return {
showModal:false,
tipModaSureBtnloading:false,
disabledImport: false, //
disabledDownload:false,
showTipModal:false,
importFile: {
fileType:'',
fileList: [] //
},
errorTip:false,
importFileRules: {
fileList: [
{ required: true, message: "请选择导入文件", trigger: "change" }
]
},
RowUuid:'',
formInline: {
keyWord:'',
time: this.getDefaultDateRange(),
fileType: [],
},
xmmcList:[],
scopeList:[],
insertFileTypeList:[],
/*表格*/
tableData: [],
maxHeight: 700,
loading: true,
/*新增框*/
addWin: false,
addTitle: '新增',
addForm: {
id:'',
goodsId:'',
goodsName:'',
gjz:''
},
multipleSelection:[],
/*分页*/
currentPage: 1,
pageRow: 10,
total: 0,
/*其他*/
token: ',',
printData:[],
userdata:{
user:{}
},
numMap:{
totalJshj:'',
totalSe:'',
totalJe:''
}
}
},
created() {
if (this.$route.query.data) {
localStorage.setItem("bx_token", this.$route.query.data);
}
this.token = localStorage.getItem("bx_token");
this.getfindEum()
},
watch: {},
mounted() {
this.findAll(1)
this.maxTableHeight();
},
computed: {
},
methods: {
getDefaultDateRange() {
const today = new Date();
const threeMonthsAgo = new Date(today.getTime() - 3 * 30 * 24 * 60 * 60 * 1000); // 90
const formattedStart = this.formatDate(threeMonthsAgo);
const formattedEnd = this.formatDate(today);
return [formattedStart, formattedEnd];
},
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
resetBtn(){
Object.keys(this.formInline).forEach(key => {
this.formInline[key] = '';
});
this.formInline.time = this.getDefaultDateRange();
this.findAll(1)
},
findAll(page) {
this.currentPage = page;
let userId = '';
if (this.userdata.user && this.userdata.user.userId) {
userId = this.userdata.user.userId;
}
const params = {
keyWord: this.formInline.keyWord,
fileType: this.formInline.fileType.length > 0 ? this.formInline.fileType : [],
addTimeEnd: this.formInline.time.length > 0 ? this.formInline.time[1] + ' ' + '23:59:59' : '',
addTimeStart: this.formInline.time.length > 0 ? this.formInline.time[0] + ' ' + '00:00:00' : '',
pageSize: this.pageRow,
pageNum:page
};
this.loading = true;
const header = {
headers: {
'Content-Type': 'application/json',
'token': this.token
}
};
api.fileManagelistApi(params, header).then(res => {
if (res.status === 200) {
this.tableData = res.data.dataObj.list;
this.total = res.data.dataObj.total
}
}).finally(()=>{
this.loading = false;
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
resetForm(form) {
console.log(form)
// this.$refs[form].resetFields()
},
deleteBtn(row){
this.$confirm('删除后将不可恢复,确认删除?', '提示', {
type: 'warning',
center: true
}).then(()=>{
let data = {
uuid: row.uuid,
filePath:row.filePath
}
api.filedeleteFileApi(data).then(res=>{
if(res.data.code === '0000'){
this.$message.success('删除成功')
this.findAll(1)
}else{
this.$message.error(res.data.message)
}
})
})
},
dowBtn(row) {
try {
axios.post('/fileManage/getImage', { uuid: row.uuid }, {
responseType: 'blob'
}).then(response => {
const blob = new Blob([response.data], { type: 'application/octet-stream' });
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = row.fileName; //
a.click();
this.$notify({
title: '成功',
message: '文件下载成功',
type: 'success',
duration:2000
});
window.URL.revokeObjectURL(url); //
}).catch(error => {
console.error(error);
this.$message.error('文件下载失败')
});
} catch (error) {
console.error(error);
}
},
previewBtn(row){
this.RowUuid = row.uuid
setTimeout(()=>{
this.$refs.filePreviewerRef.previewFile()
},10)
},
maxTableHeight() {
this.$nextTick(() => {
let self = this;
// let height = window.isMainPage ? 330 : 280;
let height = parseInt(document.querySelector('.serchWrap').offsetHeight) + parseInt(document.querySelector('.btnBox').offsetHeight) + (window.isMainPage ? 155 : 100);
self.maxHeight = document.documentElement.clientHeight - height;
self.maxHeight = self.maxHeight < 300 ? 300 : self.maxHeight;
window.onresize = function () {
height = parseInt(document.querySelector('.serchWrap').offsetHeight) + parseInt(document.querySelector('.btnBox').offsetHeight) + (window.isMainPage ? 155 : 100);
self.maxHeight = document.documentElement.clientHeight - height;
self.maxHeight = self.maxHeight < 300 ? 300 : self.maxHeight;
}
})
},
upFileBtn(){
this.showModal=true;
},
getfindEum(){
const header = {
headers: {
'Content-Type': 'application/json',
'token': this.token
}
};
api.fileTypeListApi({}, header).then((res)=>{
if(res.data.code == '0000'){
this.insertFileTypeList = res.data.data;
}
})
},
//
selectable(row,rowIndex) {
// if (row.bxstatus == "4") {
// return true; //
// }else {
// return false; //
// }
},
/*分页*/
handleSizeChange(val) {
console.log(`每页 ${val}`);
this.pageRow = val;
this.findAll(1)
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.findAll(val)
},
//-
fileChange(file, fileList) {
this.importFile.fileList = fileList;
this.$refs.importFile.clearValidate();
},
//-
fileRemove(file, fileList) {
this.importFile.fileList = [];
},
//-
handleExceed() {
this.$message.warning("一次只可导入一个文件");
},
//--
importFileVerify() {
const file = this.importFile.fileList[0];
const fileFormat = file.name.substring(file.name.lastIndexOf(".") + 1);
const allowedExtensions = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx'];
const extension = allowedExtensions.includes(fileFormat);
if (!extension) {
throw new Error("上传文件只能是图片(.jpg, .jpeg, .png)、PDF、Word 或 Excel 格式!");
}
},
//-
importFileConfirm() {
this.$refs["importFile"].validate(valid => {
if (valid) {
try {
this.importFileVerify();
this.importFileRequest();
} catch (e) {
this.$message.warning(e.message);
}
}
});
},
//--
importFileRequest() {
this.disabledDownload = true;
const file = this.importFile.fileList[0].raw;
console.log(this.importFile.fileList)
let formData = new FormData();
formData.append("file", file);
formData.append("fileType", this.importFile.fileType);
api.fileManageuploadApi(formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(r => {
console.log(r)
if(r.data.code == '0000'){
this.tipModaSureBtnloading = false
this.$message.success(r.data.message);
this.findAll(1)
this.showModal = false
}else {
this.$message.error(r.data.message);
}
})
},
cancelSave() {
this.$confirm('是否放弃操作?', '提示', {
type: 'warning',
center: true
}).then(() => {
this.showModal = false;
}).catch(() => {
});
},
tipModaSureBtn(){
this.showTipModal = false
this.showModal = false
}
}
};
</script>
<style scoped lang="scss">
.rulesView {
padding: 20px;
}
.fakeCircle {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
vertical-align: middle;
margin-right: 5px;
}
.rules_footer {
// position: fixed;
// bottom: 40px;
// right: 20px;
margin-top: 20px;
text-align: right;
}
/deep/ .el-input--suffix .el-input__inner {
padding-right: 30px;
height: auto;
}
.tableSection {
/*position: absolute;*/
width: 100%;
margin: 0 auto;
// height: 750px;
/*top: 80px;*/
/*bottom: 100px;*/
}
.addLabel {
line-height: 40px;
font-size: 18px;
font-weight: 400;
display: inline-block;
width: 5.5em;
float: left;
}
.rules_form /deep/ .el-input .el-input__inner {
width: 200px;
height: 36px;
}
.fakeLine {
width: 100%;
border-top: 1px solid #dedede;
}
/deep/ .el-dialog__body {
padding: 0;
}
/deep/ .el-table__empty-block {
min-height: 60px;
text-align: center;
width: 100%;
height: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex !important;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.uploadFile {
position: relative;
font-size: 14px;
margin: 0px 10px;
width: 144px !important;
height: 36px;
text-align: center;
line-height: 36px;
overflow: hidden;
padding: 0 !important;
box-sizing: border-box;
.imgUpload {
width: 15px;
height: 15px;
margin: 10px -5px 0px 15px;
float: left
}
}
.addFile {
height: 0;
width: 0;
position: absolute;
top: 0;
left: 0;
border: 1px solid #1169ee;
opacity: 0;
cursor: pointer;
-moz-user-select: none; /*火狐*/
-webkit-user-select: none; /*webkit浏览器*/
-ms-user-select: none; /*IE10*/
-khtml-user-select: none; /*早期浏览器*/
user-select: none;
display: none;
}
table {
width: 190mm; /* 表格宽度 */
height: 277mm; /* 表格高度 */
font-size: 12px; /* 字体大小 */
line-height: 1.5; /* 行高 */
border-collapse: collapse;
page-break-inside: avoid; /* 避免表格内部分页 */
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #ddd;
}
//@page{
// size: auto A4 landscape;
// margin: 5m;
//}
</style>
<style lang="scss">
#blackList {
padding: 20px;
.el-button--medium {
padding: 10px;
}
}
.rules_add{
//position: relative;
display: flex;
justify-content: space-between;
//justify-content: flex-end;
.rules_add-txt{
line-height: 40px;
//position: absolute;
//top: 20px;
}
.rules_add-btn{
margin: 10px 0;
display: flex;
justify-content: flex-end;
//left: 0;
}
}
.importFileForm{
margin-left: 30px;
margin-top: 20px;
}
</style>

@ -0,0 +1,712 @@
<template>
<div id="blackList">
<div class="rules_form">
<el-form :inline="true" :model="formInline" class="serchWrap">
<el-form-item label="关键字:">
<el-input v-model="formInline.keyWord" placeholder="请输入" clearable></el-input>
</el-form-item>
<el-form-item label="附件类型:">
<el-select clearable filterable multiple v-model="formInline.fileType" placeholder="请选择">
<el-option v-for="item in insertFileTypeList" :key="item.id" :label="item.fileName" :value="item.fileName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="添加时间:">
<el-date-picker
class="elpicker"
:clearable="false"
v-model="formInline.time"
:default-value="getDefaultDateRange()"
value-format="yyyy-MM-dd"
size="small"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="占用流水号:">
<el-input v-model="formInline.ddlsh" placeholder="请输入" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" size="medium" icon="el-icon-search" @click="findAll(1)">查询</el-button>
<el-button type="primary" size="medium" @click="resetBtn">重置</el-button>
</el-form-item>
</el-form>
</div>
<div
class="btnBox"
style="width: 100%; height: 53px; border-top: 1.2px dashed #d9d9d9"
>
<div
style="
float: left;
height: 35px;
width: auto;
margin-top: 16px;
vertical-align: middle;
text-align: justify;
box-sizing: border-box;
"
>
<span
style="
width: 3px;
height: 40%;
background-color: #229fff;
display: inline-block;
border-box: box-sizing;
vertical-align: middle;
"
></span>
<span
style="
font-size: 14px;
color: #333333;
margin-left: 5px;
vertical-align: middle;
"
>附件管理</span
>
</div>
<div style="float: right; margin: 10px 0px 5px 10px">
<el-button type="primary" size="medium" @click="fileConfigBtn">附件类型配置</el-button>
<el-button type="primary" size="medium" @click="fileDeriveBtn">导出</el-button>
</div>
</div>
<div class="rules_table tableSection">
<el-table
stripe
v-loading="loading"
:data="tableData"
:height="maxHeight"
row-class-name="rowDisabledClass"
@selection-change="handleSelectionChange"
border
style="width: 100%"
>
<!-- <el-table-column :selectable="selectable" type="selection" width="55"></el-table-column>-->
<el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
<el-table-column prop="fileType" label="附件类型"></el-table-column>
<el-table-column prop="fileNum" label="附件编号"></el-table-column>
<el-table-column prop="fileName" label="附件名称"></el-table-column>
<el-table-column prop="addTime" label="添加时间"></el-table-column>
<el-table-column prop="ddlsh" label="占用流水号"></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="170"
>
<template slot-scope="scope">
<button
class="cellBtn"
@click="previewBtn(scope.row)"
>
预览
</button>
<button
class="cellBtn"
@click="dowBtn(scope.row)"
>
下载
</button>
</template>
</el-table-column>
</el-table>
</div>
<div class="rules_footer">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageRow"
layout="total, prev, pager, next, sizes, jumper"
:total="total"
>
</el-pagination>
</div>
<el-dialog title="新增" :visible.sync="showModal" width="500px" >
<el-form style="margin: 20px 50px 0px 20px" :model="importFile" :rules="fileRules" ref="fileTypeRef" label-width="120px" class="demo-ruleForm">
<el-form-item label="附件类型名称:" prop="fileTypeName">
<el-input v-model="importFile.fileTypeName" placeholder="请输入" clearable></el-input>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="showModal = false"> </el-button>
<el-button type="primary" @click="verifyBtn()"> </el-button>
</span>
</template>
</el-dialog>
<el-dialog title="附件类型配置" :visible.sync="pzshowModal" width="500px" >
<el-table
stripe
:data="insertFileTypeList"
row-class-name="rowDisabledClass"
border
style="width: 450px;height:90%;margin-left: 25px;"
>
<el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
<el-table-column prop="fileName" label="附件类型">
<template slot-scope="scope">
<el-input v-if="scope.row.inpuShow" v-model="scope.row.fileName" placeholder="请输入" clearable></el-input>
<div v-else >{{scope.row.fileName}}</div>
</template>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="170"
>
<template slot-scope="scope">
<button
v-if="!scope.row.inpuShow"
class="cellBtn"
@click="lxBtn(scope.row,scope.$index)"
>
编辑
</button>
<button v-if="scope.row.inpuShow"
class="cellBtn"
@click="lxSaveBtn(scope.row,scope.$index)"
>
保存
</button>
<button v-if="scope.row.inpuShow"
class="cellBtn"
@click="getfindEum()"
>
取消
</button>
<button
v-if="!scope.row.inpuShow"
class="cellBtn"
@click="lxdowBtn(scope.row)"
>
删除
</button>
</template>
</el-table-column>
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="addFileTypeBtn()"> </el-button>
<el-button @click="pzshowModal = false">退 </el-button>
</span>
</template>
</el-dialog>
<filePreviewer :byUuid="RowUuid" ref="filePreviewerRef"></filePreviewer>
</div>
</template>
<script>
import api from '@/api/invoice';
import filePreviewer from './attachmentUpload/filePreviewer.vue';
import axios from "axios";
export default {
name: 'blackList',
components: {filePreviewer},
data() {
return {
pzshowModal:false,
showModal:false,
tipModaSureBtnloading:false,
disabledImport: false, //
disabledDownload:false,
showTipModal:false,
importFile: {
fileTypeName:void 0,
},
errorTip:false,
fileRules: {
fileTypeName: [
{ required: true, message: "请输入名称", trigger: "change" }
]
},
RowUuid:'',
formInline: {
keyWord:'',
time: this.getDefaultDateRange(),
fileType: [],
ddlsh:''
},
xmmcList:[],
scopeList:[],
insertFileTypeList:[],
/*表格*/
tableData: [],
maxHeight: 700,
loading: true,
/*新增框*/
addWin: false,
addTitle: '新增',
addForm: {
id:'',
goodsId:'',
goodsName:'',
gjz:''
},
multipleSelection:[],
/*分页*/
currentPage: 1,
pageRow: 10,
total: 0,
/*其他*/
token: ',',
printData:[],
userdata:{
user:{}
},
numMap:{
totalJshj:'',
totalSe:'',
totalJe:''
}
}
},
created() {
if (this.$route.query.data) {
localStorage.setItem("bx_token", this.$route.query.data);
}
this.token = localStorage.getItem("bx_token");
this.getfindEum()
},
watch: {},
mounted() {
this.findAll(1)
this.maxTableHeight();
},
computed: {
},
methods: {
getDefaultDateRange() {
const today = new Date();
const threeMonthsAgo = new Date(today.getTime() - 3 * 30 * 24 * 60 * 60 * 1000); // 90
const formattedStart = this.formatDate(threeMonthsAgo);
const formattedEnd = this.formatDate(today);
return [formattedStart, formattedEnd];
},
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
resetBtn(){
Object.keys(this.formInline).forEach(key => {
this.formInline[key] = '';
});
this.formInline.time = this.getDefaultDateRange();
this.findAll(1)
},
findAll(page) {
this.currentPage = page;
let userId = '';
if (this.userdata.user && this.userdata.user.userId) {
userId = this.userdata.user.userId;
}
const params = {
keyWord: this.formInline.keyWord,
ddlsh:this.formInline.ddlsh,
fileType: this.formInline.fileType.length > 0 ? this.formInline.fileType : [],
addTimeEnd: this.formInline.time.length > 0 ? this.formInline.time[1] + ' ' + '23:59:59' : '',
addTimeStart: this.formInline.time.length > 0 ? this.formInline.time[0] + ' ' + '00:00:00' : '',
pageSize: this.pageRow,
pageNum:page
};
this.loading = true;
const header = {
headers: {
'Content-Type': 'application/json',
'token': this.token
}
};
api.fileManagelistApi(params, header).then(res => {
if (res.status === 200) {
this.tableData = res.data.dataObj.list;
this.total = res.data.dataObj.total
}
}).finally(()=>{
this.loading = false;
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
dowBtn(row) {
try {
axios.post('/fileManage/getImage', { uuid: row.uuid }, {
responseType: 'blob'
}).then(response => {
const blob = new Blob([response.data], { type: 'application/octet-stream' });
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = row.fileName; //
a.click();
window.URL.revokeObjectURL(url); //
}).catch(error => {
console.error(error);
});
} catch (error) {
console.error(error);
}
},
previewBtn(row){
this.RowUuid = row.uuid
setTimeout(()=>{
this.$refs.filePreviewerRef.previewFile()
},10)
},
maxTableHeight() {
this.$nextTick(() => {
let self = this;
// let height = window.isMainPage ? 330 : 280;
let height = parseInt(document.querySelector('.serchWrap').offsetHeight) + parseInt(document.querySelector('.btnBox').offsetHeight) + (window.isMainPage ? 155 : 100);
self.maxHeight = document.documentElement.clientHeight - height;
self.maxHeight = self.maxHeight < 300 ? 300 : self.maxHeight;
window.onresize = function () {
height = parseInt(document.querySelector('.serchWrap').offsetHeight) + parseInt(document.querySelector('.btnBox').offsetHeight) + (window.isMainPage ? 155 : 100);
self.maxHeight = document.documentElement.clientHeight - height;
self.maxHeight = self.maxHeight < 300 ? 300 : self.maxHeight;
}
})
},
getfindEum(){
const header = {
headers: {
'Content-Type': 'application/json',
'token': this.token
}
};
api.fileTypeListApi({}, header).then((res)=>{
if(res.data.code == '0000'){
if(res.data.data.length > 0){
res.data.data.map((item)=>{
item.inpuShow = false
})
}
this.insertFileTypeList = res.data.data ;
}
})
},
getCurrentDate() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0'); // 01
const day = String(now.getDate()).padStart(2, '0'); //
return `${year}${month}${day}`
},
fileDeriveBtn(){
try {
this.loading = true;
const params = {
keyWord: this.formInline.keyWord,
ddlsh:this.formInline.ddlsh,
fileType: this.formInline.fileType.length > 0 ? this.formInline.fileType : [],
addTimeEnd: this.formInline.time.length > 0 ? this.formInline.time[1] + ' ' + '23:59:59' : '',
addTimeStart: this.formInline.time.length > 0 ? this.formInline.time[0] + ' ' + '00:00:00' : '',
pageSize: this.pageRow,
pageNum:this.currentPage
};
axios.post('/fileManage/exportMyFile', params, {
responseType: 'blob'
}).then(response => {
const blob = new Blob([response.data], { type: 'application/octet-stream' });
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
let fileName = this.getCurrentDate() + '附件列表.xlsx';
a.download = fileName; //
a.click();
this.$notify({
title: '成功',
message: '文件导出成功',
type: 'success',
duration:2000
});
window.URL.revokeObjectURL(url); //
}).catch(error => {
console.error(error);
this.$message.error('文件导出失败')
}).finally(()=>{
this.loading = false;
})
} catch (error) {
console.error(error);
}
},
lxdowBtn(row){
this.$confirm('删除后将不可恢复,确认删除?', '提示', {
type: 'warning',
center: true
}).then(()=>{
let data = {
id: row.id,
}
api.deleteFileTypeApi(data).then(res=>{
if(res.data.code === '0000'){
this.$message.success('删除成功')
this.getfindEum()
}else{
this.$message.error(res.data.message)
}
})
})
},
lxBtn(row,index){
this.$nextTick((item)=>{
this.insertFileTypeList[index].inpuShow = true;
})
},
lxSaveBtn(row,index){
if(!row.fileName){
this.$message.error('请输入文件类型名称')
return
}
let data = {
id: row.id,
fileTypeName: row.fileName
}
api.updateFileTypeApi(data).then(res=>{
if(res.data.code === '0000'){
this.$message.success('修改成功')
this.getfindEum()
}else{
this.$message.error(res.data.message)
}
})
},
fileConfigBtn(){
this.pzshowModal = true;
},
addFileTypeBtn(){
this.showModal = true
this.importFile.fileTypeName = void 0;
this.$refs.fileTypeRef.resetFields();
},
verifyBtn(){
this.$refs.fileTypeRef.validate((valid) => {
if (valid) {
api.insertFileTypeApi({fileTypeName: this.importFile.fileTypeName}).then((res)=>{
if(res.data.code == '0000'){
this.$message.success('添加成功')
this.showModal = false
this.getfindEum()
this.findAll(1)
}else{
this.$message.error(res.data.message)
}
})
} else {
console.log('error submit!!');
return false;
}
});
},
/*分页*/
handleSizeChange(val) {
console.log(`每页 ${val}`);
this.pageRow = val;
this.findAll(1)
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.findAll(val)
},
}
};
</script>
<style scoped lang="scss">
.rulesView {
padding: 20px;
}
.fakeCircle {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
vertical-align: middle;
margin-right: 5px;
}
.rules_footer {
// position: fixed;
// bottom: 40px;
// right: 20px;
margin-top: 20px;
text-align: right;
}
/deep/ .el-input--suffix .el-input__inner {
padding-right: 30px;
height: auto;
}
.tableSection {
/*position: absolute;*/
width: 100%;
margin: 0 auto;
// height: 750px;
/*top: 80px;*/
/*bottom: 100px;*/
}
.addLabel {
line-height: 40px;
font-size: 18px;
font-weight: 400;
display: inline-block;
width: 5.5em;
float: left;
}
.rules_form /deep/ .el-input .el-input__inner {
width: 200px;
height: 36px;
}
.fakeLine {
width: 100%;
border-top: 1px solid #dedede;
}
/deep/ .el-dialog__body {
padding: 0;
}
/deep/ .el-table__empty-block {
min-height: 60px;
text-align: center;
width: 100%;
height: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex !important;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.uploadFile {
position: relative;
font-size: 14px;
margin: 0px 10px;
width: 144px !important;
height: 36px;
text-align: center;
line-height: 36px;
overflow: hidden;
padding: 0 !important;
box-sizing: border-box;
.imgUpload {
width: 15px;
height: 15px;
margin: 10px -5px 0px 15px;
float: left
}
}
.addFile {
height: 0;
width: 0;
position: absolute;
top: 0;
left: 0;
border: 1px solid #1169ee;
opacity: 0;
cursor: pointer;
-moz-user-select: none; /*火狐*/
-webkit-user-select: none; /*webkit浏览器*/
-ms-user-select: none; /*IE10*/
-khtml-user-select: none; /*早期浏览器*/
user-select: none;
display: none;
}
table {
width: 190mm; /* 表格宽度 */
height: 277mm; /* 表格高度 */
font-size: 12px; /* 字体大小 */
line-height: 1.5; /* 行高 */
border-collapse: collapse;
page-break-inside: avoid; /* 避免表格内部分页 */
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #ddd;
}
//@page{
// size: auto A4 landscape;
// margin: 5m;
//}
</style>
<style lang="scss">
#blackList {
padding: 20px;
.el-button--medium {
padding: 10px;
}
}
.rules_add{
//position: relative;
display: flex;
justify-content: space-between;
//justify-content: flex-end;
.rules_add-txt{
line-height: 40px;
//position: absolute;
//top: 20px;
}
.rules_add-btn{
margin: 10px 0;
display: flex;
justify-content: flex-end;
//left: 0;
}
}
.importFileForm{
margin-left: 30px;
margin-top: 20px;
}
.fileTypeSavecss{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
margin-top: 10px;
margin-right: 25px;
}
</style>

@ -307,6 +307,14 @@
>
</el-date-picker>
</el-form-item>
<el-form-item label="凭证号:">
<el-input
v-model="vbeln"
placeholder="请输入凭证号"
class=""
clearable
></el-input>
</el-form-item>
<el-form-item label="归属用户:">
<el-input
v-model="dimParamThree"
@ -404,6 +412,51 @@
导出
</span>
</div>
<div style="float: right; margin: 10px 10px">
<span
class="button"
style="
margin-left: 20px;
font-size: 14px;
width: 115px;
line-height: 29px;
"
@click="ExportAllDetail"
>
<img src="@/img/download.svg" class="exportImg" />
明细导出
</span>
</div>
<div style="float: right; margin: 10px 10px">
<span
class="button"
style="
margin-left: 20px;
font-size: 14px;
width: 115px;
line-height: 29px;
"
@click="xyExportBtn"
>
<img src="@/img/download.svg" class="exportImg" />
影像下载
</span>
</div>
<div style="float: right; margin: 10px 10px">
<span
class="button"
style="
margin-left: 20px;
font-size: 14px;
width: 115px;
line-height: 29px;
"
@click="xmlExportBtn"
>
<img src="@/img/download.svg" class="exportImg" />
XML导出
</span>
</div>
</div>
<!-- 表格区域 -->
<div class="list">
@ -590,6 +643,21 @@
}}</span>
</template>
</el-table-column>
<el-table-column
prop="vbeln"
label="凭证号"
align="center"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="scope">
<span>{{
scope.row.vbeln
? scope.row.vbeln
: "-- --"
}}</span>
</template>
</el-table-column>
<el-table-column
prop="checkState"
label="报销状态"
@ -666,6 +734,24 @@
</div>
</div>
</div>
<el-dialog title="XML文件获取异常" :visible.sync="xmlshowModal" width="500px" >
<div style="padding: 0 10px 10px 0 ;color: red">
以下数电票未能成功从税务局获取XML文件请稍后再试
</div>
<div >
<div style="margin: 10px 0 7px 0" >
发票号码
</div>
<div v-for="(item,index) in fphmList">
<div style="padding-bottom: 5px">{{index + 1}} {{item}}</div>
</div>
</div>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="xmlshowModal = false"> </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
@ -678,6 +764,7 @@ import { Page } from 'iview'
// import Loding from '@/components/Common1/Loading'
import DeleteDialog from '@/components/Common1/DeleteDialog'
import PurseSuccess from '@/components/riliInvoice/PurseSuccess'
import axios from "axios";
const clickoutside = {
//
@ -721,6 +808,8 @@ export default {
},
data() {
return {
xmlshowModal:false,
fphmList: [],
currentUuid: null,
currentInvoiceTypeCode: null,
detailInvoiceFlag: false,
@ -773,6 +862,7 @@ export default {
dimParamTwo: '', //
detailList: '',//
dimParamThree: '', //
vbeln:'',
multipleSelection: '',
downloadUrl: '',
test: [],
@ -917,6 +1007,7 @@ export default {
this.ExportInvoiceTypeCode = billType;
this.ExportDimParamTwo = this.dimParamTwo;
this.ExportDimParamThree = this.dimParamThree;
const param = {
rows: this.pageSize,
page: this.page,
@ -930,7 +1021,8 @@ export default {
endTime: this.getDate(this.time, 1),
invoiceTypeCode: billType,
dimParamTwo: this.dimParamTwo,
dimParamThree: this.dimParamThree
dimParamThree: this.dimParamThree,
vbeln: this.vbeln
};
console.log(this.billTime)
const headers = {
@ -1034,6 +1126,180 @@ export default {
})
}
},
ExportAllDetail(){
try {
var billType = '';
billType = this.invoiceTypeCode.toString();
var reimburseState = '';
if (this.reimburseState == '1') {
reimburseState = '';
} else {
reimburseState = this.reimburseState
}
const param = {
rows: this.pageSize,
page: this.page,
dimParam: this.dimParam,
billStartTime: this.getDate(this.billTime, 0),
billEndTime: this.getDate(this.billTime, 1),
reimburseSerialNo: this.reimburseSerialNo,
haveSourceFile: this.elFile,
reimburseState: reimburseState,
startTime: this.getDate(this.time, 0),
endTime: this.getDate(this.time, 1),
invoiceTypeCode: billType,
dimParamTwo: this.dimParamTwo,
dimParamThree: this.dimParamThree,
vbeln: this.vbeln
};
axios.post('/web/common/invoice/exportInvoiceItemList', param, {
responseType: 'blob'
}).then(response => {
const blob = new Blob([response.data], { type: 'application/octet-stream' });
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
let fileName = this.getCurrentDate() + '_' + '发票明细.xlsx';
a.download = fileName; //
a.click();
this.$notify({
title: '成功',
message: '发票明细文件下载成功',
type: 'success',
duration:2000
});
window.URL.revokeObjectURL(url); //
}).catch(error => {
console.error(error);
});
} catch (error) {
console.error(error);
}
},
xmlExportBtn(){
try {
var billType = '';
billType = this.invoiceTypeCode.toString();
var reimburseState = '';
if (this.reimburseState == '1') {
reimburseState = '';
} else {
reimburseState = this.reimburseState
}
const param = {
rows: this.pageSize,
page: this.page,
dimParam: this.dimParam,
billStartTime: this.getDate(this.billTime, 0),
billEndTime: this.getDate(this.billTime, 1),
reimburseSerialNo: this.reimburseSerialNo,
haveSourceFile: this.elFile,
reimburseState: reimburseState,
startTime: this.getDate(this.time, 0),
endTime: this.getDate(this.time, 1),
invoiceTypeCode: billType,
dimParamTwo: this.dimParamTwo,
dimParamThree: this.dimParamThree,
vbeln: this.vbeln
};
axios.post('/web/common/invoice/invoiceMoreDown', param, {
responseType: 'json' // JSON
}).then(response => {
if(response.data.file.length === 0){
this.$message.warning('暂无可下载文件');
return;
}
if(response.data.fphmList.length > 0){
this.xmlshowModal = true;
this.fphmList = response.data.fphmList;
}
const base64Data = response.data.file[0];
const byteCharacters = atob(base64Data);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob([byteArray], { type: 'application/zip' });
console.log('blob', blob)
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
let currentDate = this.getCurrentDate();
let fileName = `${currentDate}发票XML文件.zip`;
a.download = fileName;
//
a.click();
//
this.$notify({
title: '成功',
message: '发票XML文件下载成功',
type: 'success',
duration: 2000
});
// URL
window.URL.revokeObjectURL(url);
}).catch(error => {
console.error(error);
});
} catch (error) {
console.error(error);
}
},
xyExportBtn(){
try {
var billType = '';
billType = this.invoiceTypeCode.toString();
var reimburseState = '';
if (this.reimburseState == '1') {
reimburseState = '';
} else {
reimburseState = this.reimburseState
}
const param = {
rows: this.pageSize,
page: this.page,
dimParam: this.dimParam,
billStartTime: this.getDate(this.billTime, 0),
billEndTime: this.getDate(this.billTime, 1),
reimburseSerialNo: this.reimburseSerialNo,
haveSourceFile: this.elFile,
reimburseState: reimburseState,
startTime: this.getDate(this.time, 0),
endTime: this.getDate(this.time, 1),
invoiceTypeCode: billType,
dimParamTwo: this.dimParamTwo,
dimParamThree: this.dimParamThree,
vbeln: this.vbeln
};
axios.post('/web/common/invoice/imageDown', param, {
responseType: 'blob'
}).then(response => {
const blob = new Blob([response.data], { type: 'application/zip' });
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
let fileName = this.getCurrentDate() + '发票影像.zip';
a.download = fileName; //
a.click();
window.URL.revokeObjectURL(url); //
}).catch(error => {
console.error(error);
});
} catch (error) {
console.error(error);
}
},
getCurrentDate() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0'); // 01
const day = String(now.getDate()).padStart(2, '0'); //
return `${year}${month}${day}`
},
exportInvoiceListFn() {
const _this = this;
var uuid = [];
@ -1053,7 +1319,8 @@ export default {
invoiceTypeCode: this.ExportInvoiceTypeCode,
haveSourceFile: this.elFile,
dimParamTwo: this.ExportDimParamTwo,
dimParamThree: this.ExportDimParamThree
dimParamThree: this.ExportDimParamThree,
vbeln: this.vbeln
};
const headers = {
headers: {

@ -1098,6 +1098,7 @@ export default {
uuid: {},
testCode: {},
buttonFlag: {},
fileSourceFlag: {
type: Boolean,
default: false
@ -1572,7 +1573,19 @@ export default {
}
};
let isEnableStatus2022 = localStorage.getItem("isEnableStatus2022");
let InvoiceNo = JSON.parse(window.sessionStorage.getItem('collectInvoice-invoice'))
let paramsObj = {
ocrInvoiceNo:InvoiceNo[0].ocrInvoiceNo,
ocrInvoiceDate:InvoiceNo[0].ocrInvoiceDate,
ocrInvoiceAmount:InvoiceNo[0].ocrInvoiceAmount,
}
// console.log(paramsObj,'1111111111111111111111111111')
let params = Object.assign({}, this.detailList);
if(this.fileList.length > 0){
params.fileStatus = '1'
}else {
params.fileStatus = ''
}
/* 网约车校验需要👇👇👇 */
let invoiceDate = params.invoiceDate,
detailArr = params.detailList,
@ -1632,10 +1645,6 @@ export default {
return;
}
}
params.isOcrResult = 'Y';
if (['01', '03', '04', '15', '185', '186'].indexOf(this.testCode) > -1) {
params.invoiceSheet = this.detailList.invoiceSheet;
@ -1706,6 +1715,7 @@ export default {
confirmButtonText: '保存',
showCancelButton: true
}).then(() => {
if (_this.uploadFileList.length >= 1) {
_this.uploadFile().then(response => {
if (_this.parseFlag) {
@ -1753,71 +1763,6 @@ export default {
loading.close();
_this.addDialogZ_index();
});
// if (1) {
// let msgArr = r.data.message.split('|');
// let res = new Promise((resolve, reject) => {
// let show = (msg => {
// msgArr.shift();
// _this.$alert('', msg, {
// showClose: false
// }).then(r => {
// _this.addDialogZ_index();
// if (msgArr.length < 1) {
// resolve(true)
// } else {
// show(msgArr[0])
// }
// });
// });
// show(msgArr[0])
// }).then(r => {
// console.log(r);
// // this.uploadFile()
// if (_this.uploadFileList.length >= 1) {
// _this.uploadFile().then(response=>{
// if (_this.parseFlag) {
// eventBusPc.$emit("parseTableDataChange", params);
// loading.close();
// } else {
// Invoice.update(params, headers).then((res) => {
// if (res.data.status) {
// if (_this.checkSuccessFlag) {
// eventBusPc.$emit("parseTableDataDelete", params);
// }
// _this.$emit("ClosepurseCheck");
// _this.$emit("ClosepurseSuccess");
// _this.$toast.show("")
// } else {
// _this.$toast.show(res.data.message)
// }
// loading.close();
// })
// }
// })
// }else{
// if (_this.parseFlag) {
// eventBusPc.$emit("parseTableDataChange", params);
// loading.close();
// } else {
// Invoice.update(params, headers).then((res) => {
// loading.close();
// if (res.data.status) {
// if (_this.checkSuccessFlag) {
// eventBusPc.$emit("parseTableDataDelete", params);
// }
// _this.$emit("ClosepurseCheck");
// _this.$emit("ClosepurseSuccess");
// _this.$toast.show("")
// } else {
// _this.$toast.show(res.data.message)
// }
// })
// }
// this.removeFilesReally()
// }
// });
// }
} else {
// this.uploadFile()
if (_this.uploadFileList.length >= 1) {

@ -627,15 +627,15 @@
/>
</div>
</el-dropdown-item>
<el-dropdown-item>
<div
class="button uploadFile"
style="width: 120px"
@click="uploadInvoice('1')"
>
海关缴款书上传
</div>
</el-dropdown-item>
<!-- <el-dropdown-item>-->
<!-- <div-->
<!-- class="button uploadFile"-->
<!-- style="width: 120px"-->
<!-- @click="uploadInvoice('1')"-->
<!-- >-->
<!-- 海关缴款书上传-->
<!-- </div>-->
<!-- </el-dropdown-item>-->
</el-dropdown-menu>
</el-dropdown>
<div v-else class="button uploadFile" @click="uploadInvoice">
@ -671,34 +671,34 @@
<div class="button uploadFile" @click="batchDeletion">
<span>批量删除</span>
</div>
<el-dropdown v-if="isBtnState2" class="button uploadFile">
<div>
开启扫描仪<img src="@/img/drop-down.svg" class="dropDown" />
</div>
<el-dropdown-menu slot="dropdown" class="tool-dropdownMenu">
<el-dropdown-item>
<div
class="button uploadFile"
style="width: 120px"
@click="scanABegin('0')"
>
票据扫描
</div>
</el-dropdown-item>
<el-dropdown-item>
<div
class="button uploadFile"
style="width: 120px"
@click="scanABegin('1')"
>
海关缴款书扫描
</div>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<div v-else class="button uploadFile" @click="scanABegin('0')">
<span>开启扫描仪</span>
</div>
<!-- <el-dropdown v-if="isBtnState2" class="button uploadFile">-->
<!-- <div>-->
<!-- 开启扫描仪<img src="@/img/drop-down.svg" class="dropDown" />-->
<!-- </div>-->
<!-- <el-dropdown-menu slot="dropdown" class="tool-dropdownMenu">-->
<!-- <el-dropdown-item>-->
<!-- <div-->
<!-- class="button uploadFile"-->
<!-- style="width: 120px"-->
<!-- @click="scanABegin('0')"-->
<!-- >-->
<!-- 票据扫描-->
<!-- </div>-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item>-->
<!-- <div-->
<!-- class="button uploadFile"-->
<!-- style="width: 120px"-->
<!-- @click="scanABegin('1')"-->
<!-- >-->
<!-- 海关缴款书扫描-->
<!-- </div>-->
<!-- </el-dropdown-item>-->
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
<!-- <div v-else class="button uploadFile" @click="scanABegin('0')">-->
<!-- <span>开启扫描仪</span>-->
<!-- </div>-->
</div>
</div>
</div>
@ -1000,6 +1000,7 @@
:isShowField="isShowField"
:isdel="isdel"
:createOredit="createOredit"
>
</PurseSuccess>
<PurseDetail
@ -1605,6 +1606,7 @@ export default {
},
data() {
return {
bycollectInvoiceData:void 0,
queryRuleIsUseShow: false,
account: 'bxsdk', //
requestNo: "",
@ -1797,7 +1799,6 @@ export default {
// this.time = null;
if (this.$route.query.data) {
localStorage.setItem("bx_token", this.$route.query.data);
console.log(8976, this.CommonUse.handleToken(this.$route.query.data));
// let userInfo = new Base64().decode(this.$route.query.data);
// console.log(userInfo);
// try {
@ -1872,7 +1873,6 @@ export default {
// },
checkValue: {
handler: function (val, oldVal) {
console.log(val);
if (val.length === this.invoiceList.length && this.invoiceList.length !== 0) {
this.isAllCheck = true
} else {
@ -1890,7 +1890,6 @@ export default {
},
parseTableData: {
handler: function (val, oldVal) {
console.log(val)
},
deep: true,
immediate: true
@ -1953,7 +1952,6 @@ export default {
});
eventBusPc.$off('parseTableDataDelete');
eventBusPc.$on('parseTableDataDelete', (row) => {
console.log(row);
let delIndex = null;
this.parseTableData.map((arr, index) => {
if (arr.uuid === row.uuid) {
@ -1969,7 +1967,6 @@ export default {
});
eventBusPc.$on('changeButtonFlag', row => {
this.buttonFlag = row;
console.log('this.buttonFlag:', this.buttonFlag)
});
eventBusPc.$on('closeSuccessDialog', () => {
this.purseSucessedFlag = false;
@ -2024,7 +2021,7 @@ export default {
};
/* 后期需优化按钮展示后端来控制 */
Invoice.queryRuleBy2022({}, headers).then(res => {
console.log("是否开启报销说明,附件校验的规则=", res);
localStorage.setItem("isEnableStatus2022", res.data.dataObj.enableStatus);
})
},
@ -2038,7 +2035,6 @@ export default {
};
/* 后期需优化按钮展示后端来控制 */
Invoice.querySysMenuList({}, headers).then(res => {
console.log("归集按钮状态=", res);
let dataObj = res.data.dataObj;
for (let k in dataObj) {
if (this.$route.path.indexOf(k) > -1) {
@ -2066,7 +2062,7 @@ export default {
}
};
Invoice.createQrcode(param, headers).then(r => {
console.log(r);
if (r.data.status) {
// this.QRSrc="data:image/jpeg;base64," + r.data.data
this.QRSrc = r.data.data;
@ -2077,7 +2073,6 @@ export default {
})
},
openShareWin() {
console.log(this.multipleSelection);
if (this.multipleSelection.length < 1) {
this.$toast.show("您还未选择发票!");
} else if (this.multipleSelection.length > 30) {
@ -2209,11 +2204,11 @@ export default {
'token': this.token
}
};
console.log(param)
Invoice.select(param, headers).then(response => {
this.invoiceList = response.data.data;
this.total = response.data.total;
console.log("total" + this.total)
})
},
//
@ -2268,7 +2263,7 @@ export default {
background: 'rgba(0, 0, 0, 0.7)'
});
this.deleteFlag = false
console.log(this.invoiceList.length);
Invoice.delete(param, headers).then((res) => {
loading.close()
if (res.data.status) {
@ -2297,7 +2292,7 @@ export default {
},
collectByAttachment() {
let annexFile = this.$refs["annexFile"].files[0];
console.log(annexFile);
let size = annexFile.size;
this.annexName = annexFile.name;
this.annexImgType = annexFile.type;
@ -2315,7 +2310,7 @@ export default {
collectByOFD() {
let me = this;
let ofdFile = Array.from(this.$refs["ofdFile"].files);
// console.log(ofdFile instanceof Object);
let size = 0;
ofdFile.map(item => {
size = item.size + size
@ -2381,7 +2376,7 @@ export default {
let _this = this;
_this.loadingFlag = true;
let formData = new FormData();
console.log("fileName:" + file.name)
//formData.append("file", file, file.name);
formData.append("file", file); //
formData.append("filetype", file.type); //
@ -2439,85 +2434,6 @@ export default {
_this.$refs.filePdf.value = '';
})
},
// ocr-
collectByInvoice2() {
let InvoiceFile = this.$refs["fileInvoice"].files;
let sizeAll = 0;
let len = InvoiceFile.length;
let formData = new FormData();
for (let i = 0; i < len; i++) {
let file = InvoiceFile[i];
let size = file.size;
console.log('压缩前:', file.name, size);
sizeAll += size;
if (size <= 100 * 1024 * 1024) {
if (size === 0) {
this.$toast.show("文件已损坏,无法上传");
return
}
} else {
this.$toast.show("单个文件大小不超过100M");
return
}
formData.append("files", this.$refs["fileInvoice"].files[i]);
}
if (sizeAll > 100 * 1024 * 1024) {
this.$toast.show("文件总大小不超过100M");
return
}
let loading = this.$loading({
lock: true,
customClass: "bigLoading",
text: '文件解析中,请稍后...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let param = formData;
let headers = {
headers: {
'Content-Type': 'multipart/form-data',
'token': this.token
},
timeout: 0,
};
Invoice.collectInvoice(param, headers).then(res => {
console.log(res);
if (res.data.status) {
this.$refs.fileInvoice.value = '';
loading.close()
if (res.data.data.invoice.length > 1) {
this.mixCollect = true;
this.parseWin = true;
this.$nextTick(e => {
this.parseTableData = res.data.data.invoice;
this.parseWinTotal = this.parseTableData.length
})
} else {
this.mixCollect = false;
let data = res.data.data.invoice[0];
this.uuid = data.uuid;
this.tableList = data;
this.showPhotoFlag = true;
this.testCode = data.invoiceTypeCode;
this.createOredit = true;
if (data.checkState === '0') {
this.purseFailedFlag = true;
// this.PhotoOCR(false, 1);//
} else {
this.purseSucessedFlag = true
// this.PhotoOCR(true, 1);//
}
}
} else {
this.$toast.show(res.data.message);
loading.close();
this.$refs.fileInvoice.value = '';
}
loading.close()
})
},
// ocr-
collectByInvoice() {
let InvoiceFile = this.$refs["fileInvoice"].files;
@ -2577,7 +2493,6 @@ export default {
formData.append("collectType", "1")
}
}
console.log('arr:', arr);
if (sizeAll > 100 * 1024 * 1024) {
loading.close();
this.$refs.fileInvoice.value = "";
@ -2620,7 +2535,6 @@ export default {
});
});
if (temp) {
// console.log('img.width:', img.width, ', img.height:', img.height)
if (img.width > img.height) {
if (img.height < 1200) {
canvas.height = img.height;
@ -2684,7 +2598,6 @@ export default {
break;
}
// let base64CodeSplit0 = base64Code.split(';base64,')[0];
// console.log(base64Code.split(';base64')[0].substring(5,))
imgBase64 = canvas.toDataURL("image/jpeg", quality);
// imgBase64 = canvas.toDataURL(base64CodeSplit0.substring(5,), quality);
temp = false;
@ -2692,7 +2605,6 @@ export default {
// let photoUrl = imgBase64.split(`${base64CodeSplit0};base64,`)[1];
let fileData = _this.CommonUse.base64ToFile(imgBase64, fileName);
// _this.collectByInvoice(fileData,false)
console.log('压缩后:', fileData.name, fileData.size, fileData);
// return fileData;
resolve({ fileData });
// _this.getcollectData({picture: photoUrl}, photoUrl);
@ -2809,11 +2721,17 @@ export default {
// ocr
ocrReqFn(param, headers, loading) {
Invoice.collectInvoice(param, headers).then(res => {
console.log(res);
loading.close();
this.$refs.fileInvoice.value = "";
this.collectType = "";
if (res.data.status) {
// let paramsObj = {
// ocrInvoiceNo:res.data.data.invoice.ocrInvoiceNo,
// ocrInvoiceDate:res.data.data.invoice.ocrInvoiceDate,
// ocrInvoiceAmount:res.data.data.invoice.ocrInvoiceAmount,
// }
window.sessionStorage.setItem('collectInvoice-invoice', JSON.stringify(res.data.data.invoice))
if (res.data.data.returnInfo.returnCode == '9999' && !this.CommonUse.CheckIsNull(res.data.data.returnInfo.sdpXmlTips)) {
this.$toast.show(res.data.data.returnInfo.sdpXmlTips);
return;
@ -2823,6 +2741,7 @@ export default {
return;
}
if (res.data.data.invoice.length > 1) {
this.mixCollect = true;
this.parseWin = true;
this.$nextTick(e => {
@ -2841,6 +2760,7 @@ export default {
// this.$toast.show(res.data.data.invoice[0].returnMessage);
// return;
// }
this.mixCollect = false;
let data = res.data.data.invoice[0];
this.uuid = data.uuid;

@ -275,6 +275,14 @@ export default {
url: "/batch",
name: "发票批量处理",
isHidden: "false",
},{
url: "/attachmentUpload",
name: "附件上传",
isHidden: "false",
},{
url: "/attachmentUploadManage",
name: "附件管理",
isHidden: "false",
}]
},
// {

@ -87,4 +87,20 @@ export default [
title: '页面超时,请重新进入。'
}
},
{
path: '/attachmentUpload',
name: 'attachmentUpload',
component: () => import('@/components/attachmentUpload'),
meta: {
title: '附件上传'
}
}, {
path: '/attachmentUploadManage',
name: 'attachmentUploadManage',
component: () => import('@/components/attachmentUploadManage'),
meta: {
title: '附件管理'
}
},
]

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save