Browse Source

新增发票页面的对接

master
ltlzx 4 years ago
parent
commit
31c4839146
  1. 16
      src/api/index.js
  2. 9
      src/components/dateSelect/order.vue
  3. 14
      src/components/orderDetails/index.vue
  4. 2
      src/components/page/admission/index.vue
  5. 110
      src/components/page/afterService/invoice.vue
  6. 2
      src/main.js
  7. 31
      src/utils/download.js

16
src/api/index.js

@ -248,3 +248,19 @@ export const getUserData = query => {
params: query
});
};
//服务发票列表
export const InvoiceManagementList = query => {
return request({
url: '/admin/order.InvoiceManagement/list',
method: 'post',
data: query
});
};
//下载发票
export const downloadInvoice = query => {
return request({
url: '/admin/order.InvoiceManagement/downloadInvoice',
method: 'get',
params: query
});
};

9
src/components/dateSelect/order.vue

@ -71,7 +71,7 @@
<div class="content_table">
<a-table :columns="columns1" :data-source="item.gather_arr" bordered :pagination="false">
<template slot="operation" slot-scope="item1" >
<span @click="selectDetails(item1.identifier)" class="details_span">详情</span>
<span @click="selectDetails(item1.identifier,item.goods.batchcode,item.goods.goods_islicode)" class="details_span">详情</span>
</template>
</a-table>
</div>
@ -155,7 +155,7 @@
</div>
<div class="content_table">
<a-table :columns="columns" :data-source="item.source" bordered :pagination="false">
<template slot-scope="download_status">
<template slot-scope="download_status" slot="download_status">
<span>{{download_status==1?'无资源下载':download_status==2?'获取下载地址失败':download_status==3?'获取解密资源地址失败'
:download_status==4?'获取解密资源地址成功':download_status==5?'没有解密资源地址':
download_status==6?'获取资源下载状态失败':download_status==7?'资源下载成功':download_status==8?'资源下载失败':'获取资源下载状态异常'}}</span>
@ -251,6 +251,7 @@
},
{
title: '下载状态',
dataIndex: 'download_status',
scopedSlots: { customRender: 'download_status' },
width:'90px',
},
@ -359,8 +360,8 @@
}
})
},
selectDetails(val){
let data={isli:val}
selectDetails(val,batchcode,islicode){
let data={isli:val,batchcode:batchcode,islicode:islicode}
sourceDetail(data).then(res=>{
console.info(res)
if(res.code==200){

14
src/components/orderDetails/index.vue

@ -76,12 +76,14 @@
<p class="oreder_content_title">资金结算表</p>
<a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template slot="close_status" slot-scope="close_status">
<span v-if="close_status==0">已支付</span>
<span v-if="close_status==2">已支付</span>
<span v-else-if="close_status==1">未支付</span>
<!-- <span v-if="close_status==1">无结算信息</span>
<span v-else-if="close_status==2">结算中</span>
<span v-else-if="close_status==3">用户名和收款人不一致</span>
<span v-else-if="close_status==4">收款信息错误</span> -->
<span v-else-if="close_status==5">已结算</span>
<span v-else-if="close_status==3">已结算</span>
<span v-else-if="close_status==4">未结算</span>
</template>
</a-table>
</div>
@ -174,15 +176,9 @@
width:'120px',
// align:'center'
},
// {
// title: '',
// dataIndex: 'tax_rate',
// width:'120px',
// // align:'center'
// },
{
title: '税额(含税)',
dataIndex: 'tax_rate_money',
dataIndex: 'tax_rate',
width:'120px',
// align:'center'
},

2
src/components/page/admission/index.vue

@ -158,7 +158,7 @@ export default {
{
title: '上线时间',
dataIndex: 'createtime',
width:'90px',
// width:'90px',
// align:'center'
},
{

110
src/components/page/afterService/invoice.vue

@ -11,19 +11,19 @@
<a-row justify="space-between" >
<a-col :lg="8" :xl="8" :xxl="6" class="query_item">
<span>发票编号</span>
<a-input/>
<a-input v-model="query.invoice_number"/>
</a-col>
<a-col :lg="8" :xl="8" :xxl="6" class="query_item">
<span>销方纳税人</span>
<a-input placeholder="名称/纳税人识别号"/>
<a-input placeholder="名称/纳税人识别号" v-model="query.seller"/>
</a-col>
<a-col :lg="8" :xl="8" :xxl="6" class="query_item">
<span>购方纳税人</span>
<a-input placeholder="名称/纳税人识别号"/>
<a-input placeholder="名称/纳税人识别号" v-model="query.buy"/>
</a-col>
<a-col :lg="8" :xl="8" :xxl="6" class="query_item">
<span>订单编号</span>
<a-input/>
<a-input v-model="query.batchcode"/>
</a-col>
<!-- <a-col :lg="8" :xl="8" :xxl="6" class="query_item" >
@ -37,15 +37,16 @@
<a-col :lg="8" :xl="8" :xxl="6" class="query_item">
<span>订单状态</span>
<a-select default-value="全部">
<a-select-option value="全部">
全部
</a-select-option>
<a-select v-model="query.status">
<a-select-option value="">全部</a-select-option>
<a-select-option value="2">待交付订单</a-select-option>
<a-select-option value="3">待结算订单</a-select-option>
<a-select-option value="4">已终止订单</a-select-option>
</a-select>
</a-col>
<a-col :lg="8" :xl="8" :xxl="6" class="query_item query_item2">
<span>创建时间</span>
<a-range-picker valueFormat="YYYY-MM-DD"/>
<a-range-picker valueFormat="YYYY-MM-DD" v-model="query.createtime"/>
</a-col>
<a-col :lg="24" :xl="24" :xxl="12" class="query_item query_item1">
<a-space :size="21">
@ -61,10 +62,15 @@
<!-- <a-button type="primary" class="query_button"> </a-button> -->
</div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template slot="operation">
<template slot="status" slot-scope="status">
<span>{{status==2?'待交付订单':status==3?'待结算订单':'已终止订单'}}</span>
</template>
<template slot="operation" slot-scope="item">
<a-space :size="24">
<span class="table_operation">发票详情</span>
<span class="table_operation">下载发票</span>
<!-- <span class="table_operation">发票详情</span> -->
<a :href="item.pdfUrl" class="table_operation" target="_blank" rel="nofollow">发票详情</a>
<!-- <a :href="item.pdfUrl" class="table_operation" download="pdfUrl" @click="downloadPdfUrl(item.pdfUrl)">下载发票</a> -->
<span class="table_operation" @click="downloadPdfUrl(item.id)">下载发票</span>
</a-space>
</template>
</a-table>
@ -89,10 +95,18 @@
</template>
<script>
import Operation from '../../Operation.vue'
import {} from '../../../api/index'
import {InvoiceManagementList,downloadInvoice} from '../../../api/index'
export default {
data() {
return{
query:{
invoice_number:'',
seller:'',
buy:'',
batchcode:'',
status:'',
createtime:[],
},
pageSizeOptions: ['10', '20', '30', '40', '50'],
//
total:500,
@ -111,34 +125,34 @@ export default {
// },
{
title: '生成时间',
dataIndex: 'money',
align:'center'
dataIndex: 'tickettime',
// align:'center'
},
{
title: '发票编号',
dataIndex: 'name',
align:'center'
dataIndex: 'ticketid',
// align:'center'
},
{
title: '销方纳税人名称',
dataIndex: '',
align:'center'
dataIndex: 'seller_name',
// align:'center',
},
{
title: '订单编号',
dataIndex: '',
align:'center'
dataIndex: 'batchcode',
// align:'center'
},
{
title: '纳税人识别号',
dataIndex: '',
align:'center'
dataIndex: 'uscc',
// align:'center'
},
{
title: '购方纳税人名称',
dataIndex: '',
align:'center'
dataIndex: 'name',
// align:'center'
},
// {
// title: '',
@ -147,20 +161,24 @@ export default {
// },
{
title: '发票金额',
dataIndex: '',
align:'center'
dataIndex: 'ticketmoney',
width:'90px'
// align:'center'
},
{
title: '交易状态',
dataIndex: '',
align:'center'
dataIndex: 'status',
scopedSlots: { customRender: 'status' },
width:'90px'
// align:'center'
},
{
title: '操作',
scopedSlots: { customRender: 'operation' },
align:'center'
align:'center',
width:'170px'
},
]
],
}
},
components:{
@ -170,6 +188,9 @@ export default {
this.getAllDate()
},
methods:{
downloadPdfUrl(id){
location.href=this.host+'/admin/order.InvoiceManagement/downloadInvoice?id='+id
},
// query
resetQurey(){
Object.assign(this.query, this.$options.data().query)
@ -184,17 +205,17 @@ export default {
}else{
data.page=this.page
}
// getAllDate(data).then(res=>{
// // console.info(res)
// if(res.code==200){
// this.data=res.data.data
// this.startTotal=res.data.start
// this.endTotal=res.data.end
// this.total=res.data.total
// }else{
// this.$message.error(res.msg);
// }
// })
InvoiceManagementList(data).then(res=>{
// console.info(res)
if(res.code==200){
this.data=res.data.data
this.startTotal=res.data.start
this.endTotal=res.data.end
this.total=res.data.total
}else{
this.$message.error(res.msg);
}
})
},
//
onShowSizeChange(current, pageSize){
@ -210,5 +231,8 @@ export default {
}
</script>
<style scoped>
a:hover{
/* border-bottom: 1px solid #1890FF; */
text-decoration: underline;
}
</style>

2
src/main.js

@ -14,7 +14,7 @@ import 'ant-design-vue/dist/antd.css';
Vue.use(Antd);
Vue.config.productionTip = false
Vue.prototype.$host = 'http://58.30.231.138:8899'
/* eslint-disable no-new */
new Vue({
el: '#app',

31
src/utils/download.js

@ -0,0 +1,31 @@
import axios from 'axios'
/**
* 下载文件
* @param url 文件url
* @param fileName
*/
export function downloadByURL(id,fileName) {
axios.get(' http://58.30.231.138:8899/admin/order.InvoiceManagement/downloadInvoice?id='+id, {responseType: 'blob'})
.then((response) => {
downloadByFile(response.data,fileName)
});
}
/**
* 下载文件
* @param data 二进制文件流数据
* @param filename
*/
export const downloadByFile= function (data, filename) {
if (!data) return
let url = window.URL.createObjectURL(new Blob([data]))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', filename)
document.body.appendChild(link)
link.click()
document.body.removeChild(link);
}
Loading…
Cancel
Save