20200212lljV1

This commit is contained in:
liulujia@meswork.com
2020-02-12 08:39:29 +08:00
parent c6852ed7c1
commit 347babb73b
7 changed files with 151 additions and 62 deletions

View File

@@ -2,25 +2,23 @@
<div class="app-container">
<el-card>
<el-row>
<span>发票号:</span>
<el-input v-model="invoiceNum" placeholder="发票号" size="small" style="margin: 3px 0;width: 180px" clearable/>
<span>供应商:</span>
<el-input v-show="false" v-model="supplierName0" placeholder="供应商" size="small" style="width:130px" clearable @focus="fetchData"/>
<el-select v-model="gongyingshangValue" placeholder="供应商" style="width: 180px" size="small" filterable clearable @change="searchTable1">
<el-input v-model="invoiceNum" placeholder="发票号" size="small" style="margin: 3px 0;width: 140px" clearable/>
<el-input v-show="false" v-model="supplierName0" placeholder="供应商" size="small" style="width:140px;margin-left: 10px" clearable @focus="fetchData"/>
<el-select v-model="gongyingshangValue" placeholder="供应商" style="width: 180px;margin-left: 10px" size="small" filterable clearable @change="searchTable1">
<el-option
v-for="item in gongyingshang"
:key="item.value"
:label="item.label"
:value="item.value"/>
:value="item.value"
size="mini"/>
</el-select>
<span v-show="true" class="demonstration">时间段:</span>
<span v-show="false" class="demonstration">时间段:</span>
<el-date-picker
v-model="dateRange"
:picker-options="pickerOptions"
size="small"
type="daterange"
align="center"
style="width: 300px;margin: 3px 0"
style="width: 240px;margin: 3px 10px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
@@ -46,12 +44,13 @@
<el-tooltip :open-delay="1200" effect="dark" content="查询外购备料发票信息" placement="top">
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="total1=0;pageCurrent1=1;pageSize1=30;searchTable1()">查询</el-button>
</el-tooltip>
<el-button class="button111" size="small" icon="el-icon-circle-plus-outline" style="margin-left: 10px" @click="addTable1()">新增到票</el-button>
<el-button class="button111" size="small" icon="el-icon-circle-plus-outline" style="margin-left: 10px" @click="addTable1()">到票</el-button>
</el-row>
</el-card>
<el-card style="width: 58%;float: left">
<el-card style="float: left">
<el-table
:data="tableData1"
:header-cell-style="{fontFamily:'MicrosoftYaHeiUI',fontSize:'14px',fontWeight:200}"
size="mini"
style="margin-top: 3px"
height="750px"
@@ -59,50 +58,51 @@
border
highlight-current-row
@row-click="searchTable02">
<el-table-column align="center" label="发票状态" width="80px">
<el-table-column align="center" label="进程" width="70px">
<template slot-scope="scope">
<span v-if="Number(scope.row.是否请款) === 0" type="warning" size="mini">未请款</span>
<span v-else-if="Number(scope.row.是否请款) === 1" type="primary" size="mini">已请款</span>
</template>
</el-table-column>
<el-table-column align="center" label="发票号" width="120px">
<el-table-column align="center" label="发票号" width="110px">
<template slot-scope="scope">
{{ scope.row.发票号 }}
</template>
</el-table-column>
<el-table-column align="center" label="开票时间" prop="开票时间" width="100px">
<template slot-scope="scope">
{{ scope.row.开票时间 }}
{{ scope.row.开票时间 | formatTime }}
</template>
</el-table-column>
<el-table-column align="center" label="开票金额" width="80px">
<el-table-column align="center" label="开票金额(元)" width="100px">
<template slot-scope="scope">
{{ scope.row.开票金额 }}
{{ scope.row.开票金额.toFixed(2) }}
</template>
</el-table-column>
<el-table-column align="center" label="供应商" prop="供应商名称" min-width="200px" show-overflow-tooltip>
<el-table-column align="center" label="供应商" prop="供应商名称" min-width="190px" width="190px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" >
<el-table-column align="center" label="备注" width="100px" >
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="300px">
<el-table-column align="center" label="操作" width="210px">
<template slot-scope="scope">
<el-tooltip :open-delay="1200" effect="dark" content="关联到货单" placement="top">
<div style="display: inline-block">
<el-tooltip :open-delay="1200" effect="dark" content="到货单" placement="top" style="margin-left: 0">
<div style="display: inline-block;margin-left: 0px">
<el-button
:disabled="Number(scope.row.是否请款)===1"
type="text"
size="mini"
icon="el-icon-share"
@click="aboutArrival(scope.row)">关联到货单</el-button>
style="margin-left: -15px"
@click="aboutArrival(scope.row)">到货单</el-button>
</div>
</el-tooltip>
<el-button type="text" size="mini" icon="el-icon-download" style="margin-left:10px" @click="downloadExcel(scope.row)">导出</el-button>
<el-button type="text" size="mini" icon="el-icon-download" style="margin-left:8px" @click="downloadExcel(scope.row)">导出</el-button>
<el-tooltip :open-delay="1200" effect="dark" content="编辑" placement="top">
<div style="display: inline-block">
<el-button
@@ -110,7 +110,7 @@
type="text"
size="mini"
icon="el-icon-edit-outline"
style="margin-left: 20px"
style="margin-left: 10px"
@click="editTable1(scope.row)"/>
</div>
</el-tooltip>
@@ -121,14 +121,14 @@
type="text"
size="mini"
icon="el-icon-delete"
style="margin-left: 20px"
style="margin-left: 10px"
@click="deleteTable1(scope.row)"/>
</div>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<div class="block" style="margin-top: 0px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
@@ -140,10 +140,10 @@
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card style="float: left;width: 41.3%;margin-left: 5px">
<el-table :data="gridData" class="subTableHeader" show-summary border size="mini" style="width: 100%">
<el-card style="float: left;margin-left: 5px">
<el-table :data="gridData" :header-cell-style="{fontFamily:'MicrosoftYaHeiUI',fontSize:'14px',fontWeight:200}" :summary-method="getSummaries" class="subTableHeader" show-summary border size="mini" style="width: 100%">
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column label="到货单编号" align="center">
<el-table-column label="到货单编号" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.到货单编号 }}
</template>
@@ -153,12 +153,12 @@
{{ scope.row.日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="金额" align="center" width="80" prop="到货金额">
<el-table-column label="金额(元)" align="center" width="120" prop="到货金额">
<template slot-scope="scope">
{{ scope.row.到货金额.toFixed(2) }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="操作">
<el-table-column min-width="100" width="60" align="center" label="操作">
<template slot-scope="scope">
<el-tooltip effect="dark" content="取消关联" placement="top">
<div style="display: inline-block">
@@ -257,7 +257,6 @@
<script>
import { searchInvoice, addInvoice, editInvoice, deleteInvoice, searchSupplier, searchInvoiceDetail, searchArriveOrder, addMateriel, deleteInvoiceMX, getGongyingshang } from '@/api/WorkshopProcurement/OutsourcingMaterialsInvoice'
import { mapGetters } from 'vuex'
import { ExcelDownLoad } from '@/utils/request'
export default {
name: '', // 发票交接单
@@ -347,6 +346,31 @@ export default {
this.searchTable1()
},
methods: {
getSummaries(param) { // 合计
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
} else if (index === 3) {
const values = data.map(item => Number(parseFloat(item['到货金额'])))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(2) + ' 元'
} else {
sums[index] = 'N/A'
}
}
})
return sums
},
fetchData() {
searchSupplier(0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '').then(response => {
for (let i = 0; i < response.data.length; i++) {
@@ -557,8 +581,13 @@ export default {
})
},
downloadExcel(row) {
const _ExcelDownLoad = ExcelDownLoad
this.download(`${_ExcelDownLoad}?Fapiao=${row.发票流水号}&name=${row.供应商名称}`)
var param = []
param[0] = ['发票流水号', row.发票流水号]
param[1] = ['供应商', row.供应商名称]
var Data = this.CreateData('12', '报表_备料管理_发票明细_查询数据', param)
this.exportExcel_NPOI(Data)
// const _ExcelDownLoad = ExcelDownLoad
// this.download(`${_ExcelDownLoad}?Fapiao=${row.发票流水号}&name=${row.供应商名称}`)
},
/**
* 下载
@@ -631,16 +660,17 @@ function saveAs(blob, filename = '下载文件.xls') {
<style lang="scss">
.subTableHeader {
th {
background: #8ff4ea !important;
color: black;
background: #7eaced !important;
color: #FFFFFF;
}
tr.el-table__row td {
background-color: #d8e5f6 !important;
background-color: #ffffff !important;
}
tr.el-table__row.el-table__row--striped td {
background: #e9f0f9 !important;
background-color: #e9f0f9;
}
}
</style>