|
@@ -34,13 +34,15 @@
|
|
|
|
|
|
<ws-button type="primary" @click="reject">驳回</ws-button>
|
|
|
<ws-button type="primary" @click="adopt">通过</ws-button>
|
|
|
- <ws-button type="primary" @click="invoicingClick" v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">开票</ws-button>
|
|
|
- <!-- <a href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/FP/7313fc0f25ed41879826bba5c737d688.xml" download='112'>立即下载</a> -->
|
|
|
- <ws-button type="primary" @click="exportlist" v-hasPermission="`acquisitionManagement.acquisitionPay.print`">导出</ws-button>
|
|
|
+ <ws-button type="primary" @click="invoicingClick"
|
|
|
+ v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">开票</ws-button>
|
|
|
+ <ws-button type="primary" @click="exportlist" v-hasPermission="`acquisitionManagement.acquisitionPay.print`">导出
|
|
|
+ </ws-button>
|
|
|
<!-- <ws-button type="primary" @click="handlepass" v-if="isShowAdopt">审核</ws-button> -->
|
|
|
<ws-button type="primary" @click="payment" v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">付款
|
|
|
</ws-button>
|
|
|
- <ws-button type="primary" @click="selectPrint(1)" v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">财务批量打印
|
|
|
+ <ws-button type="primary" @click="selectPrint(1)"
|
|
|
+ v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">财务批量打印
|
|
|
</ws-button>
|
|
|
</template>
|
|
|
<template slot="right">
|
|
@@ -70,7 +72,7 @@
|
|
|
<el-table-column class="table_td" prop="paymentNo" width="100" label="编号" sortable></el-table-column>
|
|
|
<el-table-column class="table_td" prop="customerName" label="客户" sortable>
|
|
|
<template slot-scope="scope">
|
|
|
- <div @click.stop="customer(scope.row)"><span :class="{ text_css: scope.row.textcss }">{{scope.row.customerName}}</span></div>
|
|
|
+ <div @click.stop="customer(scope.row)"><span class="text_css">{{scope.row.customerName}}</span></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column class="table_td" prop="carNo" label="车牌号"></el-table-column>
|
|
@@ -171,6 +173,8 @@
|
|
|
:total="deptBudgetTotal"></el-pagination>
|
|
|
<el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint"
|
|
|
:title="printData.compName + '结算凭证'">
|
|
|
+ <!-- selectCustomerList:[],
|
|
|
+ selectPrintList: [], -->
|
|
|
<paymentPrint :printData="printData" :customerInfo="customerList" :showType="ruleForm.type"></paymentPrint>
|
|
|
<div style="text-align: center">
|
|
|
<el-button type="primary" @click="isShowPrint = false">关闭</el-button>
|
|
@@ -180,13 +184,7 @@
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
<!--客户信息-->
|
|
|
- <el-dialog
|
|
|
- width="50%"
|
|
|
- title="客户信息"
|
|
|
- :visible.sync="customerInfo"
|
|
|
- :append-to-body="true"
|
|
|
- :close="customerclose"
|
|
|
- >
|
|
|
+ <el-dialog width="50%" title="客户信息" :visible.sync="customerInfo" :append-to-body="true" :close="customerclose">
|
|
|
<el-form class="customer">
|
|
|
|
|
|
|
|
@@ -245,13 +243,15 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {
|
|
|
+ import {
|
|
|
dayjs,
|
|
|
EventBus
|
|
|
} from 'base-core-lib'
|
|
|
import {
|
|
|
downloadFile
|
|
|
} from '@/utils/batchDown'
|
|
|
+ import JSZip from 'jszip'
|
|
|
+ import FileSaver from 'file-saver'
|
|
|
import {
|
|
|
getpayment,
|
|
|
selectWarehouseSelf,
|
|
@@ -271,6 +271,7 @@ import {
|
|
|
import {
|
|
|
getHp
|
|
|
} from '@/utils/getHasPermission'
|
|
|
+import download from '../../components/WsDownload/download'
|
|
|
export default {
|
|
|
components: {
|
|
|
paymentPrint
|
|
@@ -278,7 +279,7 @@ import {
|
|
|
watch: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- printType:0,
|
|
|
+ printType: 0,
|
|
|
isShowPrintType1: true,
|
|
|
isShowPrintType2: true,
|
|
|
isShowPrintType3: true,
|
|
@@ -305,7 +306,8 @@ import {
|
|
|
bankCard: '',
|
|
|
bankDeposit: ''
|
|
|
},
|
|
|
- selectCustomerList:[],
|
|
|
+ selectCustomerList: [],
|
|
|
+ selectPrintList: [],
|
|
|
identity: [],
|
|
|
//分页
|
|
|
currentPage: 1,
|
|
@@ -322,7 +324,6 @@ import {
|
|
|
warehouseName: '',
|
|
|
isShowPrint: false,
|
|
|
printData: {},
|
|
|
- selectPrintList: [],
|
|
|
warehouse: [],
|
|
|
value1: '', //付款日期
|
|
|
modification: [],
|
|
@@ -349,31 +350,77 @@ import {
|
|
|
// this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
- selectPrint(){
|
|
|
+ selectPrint() {
|
|
|
console.log('批量打印数据', this.modification)
|
|
|
this.printType = 1
|
|
|
- this.isShowPrintType = true
|
|
|
-
|
|
|
+ this.isShowPrintType = true
|
|
|
},
|
|
|
- async exportlist() {
|
|
|
+ async exportlist() {
|
|
|
console.log('导出数据', this.modification)
|
|
|
- let _data = {
|
|
|
+ let _data = {
|
|
|
paymentManagementList: this.modification
|
|
|
}
|
|
|
- const {
|
|
|
- data
|
|
|
- } = await export1(_data, {}, {
|
|
|
- responseType: 'blob'
|
|
|
- }).toPromise()
|
|
|
- downloadFile({
|
|
|
- res: data,
|
|
|
- fileName: `${
|
|
|
+ const {
|
|
|
+ data
|
|
|
+ } = await export1(_data, {}, {
|
|
|
+ responseType: 'blob'
|
|
|
+ }).toPromise()
|
|
|
+ downloadFile({
|
|
|
+ res: data,
|
|
|
+ fileName: `${
|
|
|
this.date.year + (this.date.month ? `-${this.date.month}` : '')
|
|
|
}结算凭证`,
|
|
|
- type: 'xls',
|
|
|
- })
|
|
|
+ type: 'xls',
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
+ /**文件打包
|
|
|
+ * arrImages:文件list:[{fileUrl:文件url,renameFileName:文件名}]
|
|
|
+ * filename 压缩包名
|
|
|
+ * */
|
|
|
+ filesToRar(arrImages, filename) {
|
|
|
+ let _this = this;
|
|
|
+ let zip = new JSZip();
|
|
|
+ let cache = {};
|
|
|
+ let promises = [];
|
|
|
+ _this.title = '正在加载压缩文件';
|
|
|
+ for (let item of arrImages) {
|
|
|
+ const promise= _this.getImgArrayBuffer(item.fileUrl).then(data => {
|
|
|
+ // 下载文件, 并存成ArrayBuffer对象(blob)
|
|
|
+ zip.file(item.renameFileName, data, { binary: true }); // 逐个添加文件
|
|
|
+ cache[item.renameFileName] = data;
|
|
|
+ });
|
|
|
+ promises.push(promise);
|
|
|
+ }
|
|
|
+ Promise.all(promises).then(() => {
|
|
|
+ zip.generateAsync({ type: 'blob' }).then(content => {
|
|
|
+ _this.title = '正在压缩';
|
|
|
+ // 生成二进制流
|
|
|
+ FileSaver.saveAs(content, filename); // 利用file-saver保存文件 自定义文件名
|
|
|
+ _this.title = '压缩完成';
|
|
|
+ });
|
|
|
+ }).catch(res=>{
|
|
|
+ _this.$message.error('文件压缩失败');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //获取文件blob
|
|
|
+ getImgArrayBuffer(url){
|
|
|
+ let _this=this;
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ //通过请求获取文件blob格式
|
|
|
+ let xmlhttp = new XMLHttpRequest();
|
|
|
+ xmlhttp.open('GET', url, true);
|
|
|
+ xmlhttp.responseType = 'blob';
|
|
|
+ xmlhttp.onload = function () {
|
|
|
+ if (this.status == 200) {
|
|
|
+ resolve(this.response);
|
|
|
+ }else{
|
|
|
+ reject(this.status);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ xmlhttp.send();
|
|
|
+ });
|
|
|
+ },
|
|
|
invoicingClick() {
|
|
|
// let data = JSON.stringify({
|
|
|
// paymentManagementList : this.modification
|
|
@@ -385,7 +432,7 @@ import {
|
|
|
// console.log(response)
|
|
|
// })
|
|
|
let data = {
|
|
|
- paymentManagementList:this.modification
|
|
|
+ paymentManagementList: this.modification
|
|
|
}
|
|
|
console.log('开票', data)
|
|
|
//开票
|
|
@@ -394,14 +441,28 @@ import {
|
|
|
.then(response => {
|
|
|
console.log(response)
|
|
|
if (response.length > 0) {
|
|
|
+
|
|
|
+ var arr=[]
|
|
|
for (let i = 0; i < response.length; i++) {
|
|
|
+ arr.push({fileUrl:response[i],renameFileName:'发票'+i})
|
|
|
//创建标签下载文件
|
|
|
- let a = document.createElement('a');
|
|
|
- a.href = '#';
|
|
|
- a.setAttribute('download', response[i]);
|
|
|
- a.click();
|
|
|
- a.remove();
|
|
|
+ // window.open(response[i],)
|
|
|
+ // let a = document.createElement('a');
|
|
|
+ // // a.href = response[i];
|
|
|
+ // a.setAttribute('target', 'blank');
|
|
|
+ // a.setAttribute('download', response[i]);
|
|
|
+ // a.setAttribute('href', response[i]);
|
|
|
+ // a.click();
|
|
|
+ // a.remove();
|
|
|
+ // let b = document.createElement('a');
|
|
|
+ // // b.href = response[i];
|
|
|
+ // b.setAttribute('target', 'blank');
|
|
|
+ // b.setAttribute('download', response[i]);
|
|
|
+ // b.setAttribute('href', response[i]);
|
|
|
+ // b.click();
|
|
|
+ // b.remove();
|
|
|
}
|
|
|
+ this.filesToRar(arr, 'download')
|
|
|
}
|
|
|
//未完成,接口调通后替换假数据
|
|
|
// response = {
|
|
@@ -435,25 +496,16 @@ import {
|
|
|
.catch(() => {})
|
|
|
},
|
|
|
customer(row) {
|
|
|
- for(let i = 0 ; i < this.paymentList.length ; i++){
|
|
|
- if(row.id == this.paymentList[i].id){
|
|
|
- row.textcss = true
|
|
|
- }else{
|
|
|
- this.paymentList[i].textcss = false
|
|
|
- }
|
|
|
- }
|
|
|
- row.textcss = true
|
|
|
this. customerInfo = true
|
|
|
this.customerlist = row.identityAuthenticationInfo
|
|
|
this.customerlist.cardAddressUrl1 = this.customerlist.cardAddressUrl.split(',')[0]
|
|
|
this.customerlist.cardAddressUrl2 = this.customerlist.cardAddressUrl.split(',')[1]
|
|
|
this.customerlist.payeeAddressUrls = this.customerlist.payeeAddressUrl.split(',')
|
|
|
- this.$forceUpdate();
|
|
|
},
|
|
|
- customerclose(e){
|
|
|
+ customerclose(e) {
|
|
|
console.log(e)
|
|
|
- // row.textcss = false
|
|
|
- this. customerInfo = false
|
|
|
+ // row.textcss = false
|
|
|
+ this.customerInfo = false
|
|
|
|
|
|
},
|
|
|
//合计
|
|
@@ -515,68 +567,82 @@ import {
|
|
|
typePrintCannelClick() {
|
|
|
this.isShowPrintType = false
|
|
|
},
|
|
|
- typePrintClick(type) {debugger
|
|
|
+ typePrintClick(type) {
|
|
|
// type 1批量打印 0单个打印
|
|
|
// this.isShowPrint = true
|
|
|
- if(type==1){
|
|
|
- for(let i =0;i<this.modification.length;i++){
|
|
|
- getCustomerLook({
|
|
|
- id: this.modification[i].identityAuthenticationInfo.id,
|
|
|
- authenticationStatusKey: 7
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
- .then(response => {
|
|
|
- this.selectCustomerList.push(response)
|
|
|
- getpaymentexamine({
|
|
|
- id: this.modification[i].id
|
|
|
+ if (type == 1) {
|
|
|
+ let index1 = 0;
|
|
|
+ let index2 = 0;
|
|
|
+ for (let i = 0; i < this.modification.length; i++) {
|
|
|
+ getCustomerLook({
|
|
|
+ id: this.modification[i].identityAuthenticationInfo.id,
|
|
|
+ authenticationStatusKey: 7
|
|
|
})
|
|
|
.toPromise()
|
|
|
.then(response => {
|
|
|
- let date = new Date()
|
|
|
- response.currentTime =
|
|
|
- date.getFullYear() +
|
|
|
- '年' +
|
|
|
- Number(date.getMonth() + 1) +
|
|
|
- '月' +
|
|
|
- date.getDate() +
|
|
|
- '日'
|
|
|
- this.selectPrintList.push(response)
|
|
|
-
|
|
|
+ this.selectCustomerList.push(response)
|
|
|
+ index2++;
|
|
|
+ if (index1 == this.modification.length && index2 == this.modification.length) {
|
|
|
+ this.printData.compName = ''
|
|
|
+ // this.isShowPrint = true
|
|
|
+ this.printBig();
|
|
|
+ }
|
|
|
+ getpaymentexamine({
|
|
|
+ id: this.modification[i].id
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then(response => {
|
|
|
+ index1++;
|
|
|
+ let date = new Date()
|
|
|
+ response.currentTime =
|
|
|
+ date.getFullYear() +
|
|
|
+ '年' +
|
|
|
+ Number(date.getMonth() + 1) +
|
|
|
+ '月' +
|
|
|
+ date.getDate() +
|
|
|
+ '日'
|
|
|
+ this.selectPrintList.push(response)
|
|
|
+ if (index1 == this.modification.length && index2 == this.modification.length) {
|
|
|
+ this.printData.compName = ''
|
|
|
+ // this.isShowPrint = true
|
|
|
+ this.printBig();
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
}
|
|
|
- // console.log('批量打印客户list',this.selectCustomerList)
|
|
|
- // console.log('批量打印凭证list',this.selectPrintList)
|
|
|
- }else{
|
|
|
- getCustomerLook({
|
|
|
- id: this.rowData.identityAuthenticationInfo.id,
|
|
|
- authenticationStatusKey: 7
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
- .then(response => {
|
|
|
- this.customerList = response
|
|
|
- getpaymentexamine({
|
|
|
- id: this.rowData.id
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
- .then(response => {
|
|
|
- this.printData = response
|
|
|
- this.isShowPrint = true
|
|
|
- // if(this.printData.solidGrainPrice){
|
|
|
- // this.printData.solidGrainPrice = (this.printData.tidalGrainPrice * this.printData.netWeight)/this.printData.pureWeight
|
|
|
- // }
|
|
|
- let date = new Date()
|
|
|
- this.printData.currentTime =
|
|
|
- date.getFullYear() +
|
|
|
- '年' +
|
|
|
- Number(date.getMonth() + 1) +
|
|
|
- '月' +
|
|
|
- date.getDate() +
|
|
|
- '日'
|
|
|
- })
|
|
|
- })
|
|
|
+ // console.log('批量打印客户list',this.selectCustomerList)
|
|
|
+ // console.log('批量打印凭证list',this.selectPrintList)
|
|
|
+ } else {
|
|
|
+ getCustomerLook({
|
|
|
+ id: this.rowData.identityAuthenticationInfo.id,
|
|
|
+ authenticationStatusKey: 7
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then(response => {
|
|
|
+ this.customerList = response
|
|
|
+ getpaymentexamine({
|
|
|
+ id: this.rowData.id
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then(response => {
|
|
|
+ this.printData = response
|
|
|
+ this.isShowPrint = true
|
|
|
+ // if(this.printData.solidGrainPrice){
|
|
|
+ // this.printData.solidGrainPrice = (this.printData.tidalGrainPrice * this.printData.netWeight)/this.printData.pureWeight
|
|
|
+ // }
|
|
|
+ let date = new Date()
|
|
|
+ this.printData.currentTime =
|
|
|
+ date.getFullYear() +
|
|
|
+ '年' +
|
|
|
+ Number(date.getMonth() + 1) +
|
|
|
+ '月' +
|
|
|
+ date.getDate() +
|
|
|
+ '日'
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
handleRowClick(row) {
|
|
|
if (row.status != '已驳回') {
|
|
@@ -653,15 +719,24 @@ import {
|
|
|
)
|
|
|
},
|
|
|
printBig() {
|
|
|
- window.open(
|
|
|
- '../../../../../static/payprint.html?type=2&dataList=' +
|
|
|
- JSON.stringify(this.printData) +
|
|
|
- '&customerList=' +
|
|
|
- JSON.stringify(this.customerList) +
|
|
|
- '&printTypeList=' +
|
|
|
- this.ruleForm.type,
|
|
|
- '结算凭证'
|
|
|
- )
|
|
|
+ console.log(this.printType)
|
|
|
+ let _list1 = []
|
|
|
+ let _list2 = []
|
|
|
+ if (this.printType == 1) {
|
|
|
+ sessionStorage.setItem('cwprint', true)
|
|
|
+ // 财务批量打印数据
|
|
|
+ sessionStorage.setItem('selectPrint_selectPrintList', JSON.stringify(this.selectPrintList))
|
|
|
+ sessionStorage.setItem('selectPrint_selectCustomerList', JSON.stringify(this.selectCustomerList))
|
|
|
+ } else if (this.printType == 0) {
|
|
|
+ sessionStorage.setItem('cwprint', true)
|
|
|
+ _list1 = JSON.stringify(this.printData)
|
|
|
+ _list2 = JSON.stringify(this.customerList)
|
|
|
+ } else {
|
|
|
+ _list1 = JSON.stringify(this.printData)
|
|
|
+ _list2 = JSON.stringify(this.customerList)
|
|
|
+ }
|
|
|
+ window.open('../../../../../static/payprint.html?type=2&dataList=' + _list1 + '&customerList=' + _list2 +
|
|
|
+ '&printTypeList=' + this.ruleForm.type, '结算凭证')
|
|
|
},
|
|
|
getList() {
|
|
|
this.payments = {
|
|
@@ -685,9 +760,6 @@ import {
|
|
|
.toPromise()
|
|
|
.then(response => {
|
|
|
this.paymentList = response.records
|
|
|
- for(let i = 0 ; i < this.paymentList.length ; i++){
|
|
|
- this.paymentList.textcss = false
|
|
|
- }
|
|
|
this.deptBudgetTotal = response.total
|
|
|
})
|
|
|
// getJurisdiction({
|
|
@@ -699,8 +771,6 @@ import {
|
|
|
// .then(response => {
|
|
|
// this.isShowAdopt = response
|
|
|
// })
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
del(row) {
|
|
|
this.$confirm(
|
|
@@ -1175,6 +1245,6 @@ import {
|
|
|
}
|
|
|
|
|
|
.text_css {
|
|
|
- color: #2c29e7;
|
|
|
+ color: #5878e8;
|
|
|
}
|
|
|
</style>
|