This commit is contained in:
liushuai
2020-07-08 11:05:43 +08:00
parent 120c7c1601
commit fe5d3b70df
53 changed files with 3596 additions and 1220 deletions

View File

@@ -41,113 +41,234 @@
{{ scope.row.申请时间 ? scope.row.申请时间.split(' ')[0] : '—' }}
</template>
</el-table-column>
<el-table-column label="采购审批" align="center" min-width="80">
<el-table-column label="部长确认" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.审批人1姓名 }}
{{ scope.row.审批1结果 }}
</template>
</el-table-column>
<el-table-column label="审批时间" align="center" width="100">
<!-- <el-table-column label="审批时间" align="center" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.审批1时间 ? scope.row.审批1时间.split(' ')[0] : '—' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="未过原因" align="center" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.审批1未过原因 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="总经理确认" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.审批1时间 ? scope.row.审批1时间.split(' ')[0] : '—' }}
{{ scope.row.审批4结果 }}
</template>
</el-table-column>
<el-table-column label="未过原因" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.审批1未过原因 }}
</template>
</el-table-column>
<el-table-column label="总经理审批" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.审批人4姓名 }}
</template>
</el-table-column>
<el-table-column label="审批时间" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.审批4时间 ? scope.row.审批4时间.split(' ')[0] : '—' }}
</template>
</el-table-column>
<el-table-column label="未过原因" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.审批4未过原因 }}
</template>
</el-table-column>
<el-table-column label="财务审批" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.审批人3姓名 }}
</template>
</el-table-column>
<el-table-column label="审批时间" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.审批3时间 ? scope.row.审批3时间.split(' ')[0] : '—' }}
</template>
</el-table-column>
<el-table-column label="未过原因" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.审批2未过原因 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100" fixed="right">
<!-- <el-table-column label="审批时间" align="center" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.审批4时间 ? scope.row.审批4时间.split(' ')[0] : '—' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="未过原因" align="center" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.审批4未过原因 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="财务审批" align="center" min-width="80">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.审批人3姓名 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="审批时间" align="center" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.审批3时间 ? scope.row.审批3时间.split(' ')[0] : '—' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="未过原因" align="center" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.审批2未过原因 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" width="130">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="cancel(scope.row)">撤回</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- plain-->
<!-- icon="el-icon-search"-->
<!-- @click="viewPicture(scope.row)">查看发票</el-button>-->
<el-button
:disabled="scope.row.文件名称 === '' || scope.row.文件名称 === null"
size="mini"
type="text"
icon="el-icon-search"
@click="viewPicture(scope.row)">查看发票</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-table :data="tableData2" border highlight-current-row style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购物料名称 || scope.row.离线物料名称 || scope.row.采购零件名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购物料型号 || scope.row.离线物料型号 || scope.row.采购零件图号 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购物料规格 || scope.row.离线物料规格 || scope.row.采购零件规格 }}
</template>
</el-table-column>
<!--<el-table-column label="供应商" align="center" min-width="150">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.供应商名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 || scope.row.离线合同编号 }}
</template>
</el-table-column>
<!--<el-table-column label="合同名称" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.采购合同名称 || scope.row.离线合同名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="采购数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.采购数量 }}
</template>
</el-table-column>
<el-table-column label="到票数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.到票数量 }}
</template>
</el-table-column>
<el-table-column label="到票金额" align="center" width="100">
<template slot-scope="scope">
{{ Number(scope.row.金额).toFixed(2) }}
</template>
</el-table-column>
</el-table>
<span style="margin-left: 1000px">到票总额{{ totalMoney.toFixed(2) }}</span>
</el-card>
<el-row>
<el-col style="width: 46%">
<el-card>
<el-table :data="tableData2" :summary-method="getSummaries" border show-summary highlight-current-row style="width: 100%;max-height: 400px;" height="300px" size="mini" @row-click="searchTable3">
<el-table-column label="合同编号" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.采购合同编号 || scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column label="合同金额" align="center" min-width="80" prop="合同总额">
<template slot-scope="scope">
{{ Number(scope.row.合同总额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="到货金额" align="center" min-width="80" prop="到货总额">
<template slot-scope="scope">
{{ Number(scope.row.到货总额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="已付金额" align="center" min-width="80" prop="已付金额">
<template slot-scope="scope">
{{ Number(scope.row.已付金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="到票金额" align="center" min-width="80" prop="到票总额">
<template slot-scope="scope">
{{ Number(scope.row.到票总额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="尚欠金额" align="center" min-width="80" prop="尚欠金额">
<template slot-scope="scope">
{{ Number(scope.row.尚欠金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="欠票金额" align="center" min-width="80" prop="欠票总额">
<template slot-scope="scope">
{{ Number(scope.row.欠票总额).toFixed(2) }}
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
<el-col style="width: 54%">
<el-card>
<el-table :data="tableData3" :summary-method="getSummaries1" border show-summary highlight-current-row style="width: 100%;max-height: 400px;" height="300px" size="mini">
<el-table-column label="名称" align="center" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.采购物料名称 || scope.row.离线物料名称 || scope.row.采购零件名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.采购物料型号 || scope.row.离线物料型号 || scope.row.采购零件图号 }}
</template>
</el-table-column>
<el-table-column label="采购数" align="center" width="70" prop="采购数量">
<template slot-scope="scope">
{{ scope.row.采购数量 }}
</template>
</el-table-column>
<el-table-column label="到货数" align="center" width="70" prop="到货数量">
<template slot-scope="scope">
{{ scope.row.到货数量 }}
</template>
</el-table-column>
<el-table-column label="到票数" align="center" width="70" prop="到票数量">
<template slot-scope="scope">
{{ scope.row.到票数量 }}
</template>
</el-table-column>
<el-table-column label="单价" align="center" width="60">
<template slot-scope="scope">
{{ scope.row.单价.toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="到票金额" align="center" width="80" prop="到票金额">
<template slot-scope="scope">
{{ scope.row.到票金额.toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="到货金额" align="center" width="80" prop="到货金额">
<template slot-scope="scope">
{{ scope.row.到货金额.toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.采购物料规格 || scope.row.离线物料规格 || scope.row.采购零件规格 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
<!-- <el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible4" title="图片" center style="" width="800px">-->
<!-- <viewer>-->
<!-- <img v-for="url in urls" :key="url" :src="url" lazy style="width: 700px;height: 700px">-->
<!-- </viewer>-->
<!-- </el-dialog>-->
<!-- <el-card>-->
<!-- <el-table :data="tableData2" border highlight-current-row style="width: 100%;max-height: 300px;" height="300px" size="mini">-->
<!-- <el-table-column label="名称" align="center" min-width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.采购物料名称 || scope.row.离线物料名称 || scope.row.采购零件名称 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="图号或型号" align="center" min-width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.采购物料型号 || scope.row.离线物料型号 || scope.row.采购零件图号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="规格" align="center" min-width="150">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.采购物料规格 || scope.row.离线物料规格 || scope.row.采购零件规格 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="机床图号" align="center" min-width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.机床图号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- &lt;!&ndash;<el-table-column label="供应商" align="center" min-width="150">&ndash;&gt;-->
<!-- &lt;!&ndash;<template slot-scope="scope">&ndash;&gt;-->
<!-- &lt;!&ndash;{{ scope.row.供应商名称 }}&ndash;&gt;-->
<!-- &lt;!&ndash;</template>&ndash;&gt;-->
<!-- &lt;!&ndash;</el-table-column>&ndash;&gt;-->
<!-- <el-table-column label="合同编号" align="center" min-width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.采购合同编号 || scope.row.离线合同编号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- &lt;!&ndash;<el-table-column label="合同名称" align="center" min-width="100">&ndash;&gt;-->
<!-- &lt;!&ndash;<template slot-scope="scope">&ndash;&gt;-->
<!-- &lt;!&ndash;{{ scope.row.采购合同名称 || scope.row.离线合同名称 }}&ndash;&gt;-->
<!-- &lt;!&ndash;</template>&ndash;&gt;-->
<!-- &lt;!&ndash;</el-table-column>&ndash;&gt;-->
<!-- <el-table-column label="采购数量" align="center" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.采购数量 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="到票数量" align="center" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.到票数量 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="到票金额" align="center" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- {{ Number(scope.row.金额).toFixed(2) }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- <span style="margin-left: 1000px">到票总额{{ totalMoney.toFixed(2) }}</span>-->
<!-- </el-card>-->
</div>
</template>
<script>
import { cancel, searchTable1, searchSupplier, searchTable2 } from '@/api/PurchasingCenter/InvoiceSettlementApproveSearch'
import { cancel, searchTable1, searchSupplier, searchTable2, searchTable3 } from '@/api/PurchasingCenter/InvoiceSettlementApproveSearch'
import { mapGetters } from 'vuex'
// import { readFile } from '@/utils/request'
// import request from '@/utils/request'
@@ -167,6 +288,8 @@ export default {
supplierValues: [],
supplierValue: '',
totalMoney: 0
// dialogFormVisible4: false,
// urls: []
}
},
computed: {
@@ -183,16 +306,119 @@ export default {
this.searchSupplier()
},
methods: {
// viewPicture(row) {
// this.dialogFormVisible4 = true
// this.urls = []
// searchPic(row.发票结算申请单流水号).then(response => {
// for (let i = 0; i < response.data.length; i++) {
// if (response.data[i].文件内容 !== null) {
// this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
// }
// }
// })
// },
viewPicture(row) {
var param = []
param[0] = ['发票结算申请单流水号', row.发票结算申请单流水号]
var Data = this.CreateData('2004', '采购管理_发票附件_导出', param)
this.exportExcel_NPOI(Data)
},
searchTable3(row) {
this.tableData3 = []
searchTable3(row.发票结算申请单流水号, row.采购合同流水号, row.离线合同流水号).then(response => {
this.tableData3 = response.data
})
},
searchTable2(row) {
this.tableData3 = []
this.monetaryTotal = 0
this.applyOrderNum = row.发票结算申请单流水号
this.invoiceNumber = row.发票号
searchTable2(row.发票结算申请单流水号).then(response => {
this.tableData2 = response.data
this.totalMoney = 0
for (let i = 0; i < response.data.length; i++) {
this.totalMoney += parseFloat(response.data[i].金额)
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.monetaryTotal += response.data[i].金额
}
}
})
},
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价'
return
}
const values = data.map(item => Number(item[column.property]))
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
},
getSummaries1(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
} else if (index === 6 || index === 7) {
const values = data.map(item => Number(item[column.property]))
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'
}
} else if (index === 2 || index === 3 || index === 4) {
const values = data.map(item => Number(item[column.property]))
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]
} else {
sums[index] = 'N/A'
}
}
})
return sums
},
// searchTable2(row) {
// this.invoiceNumber = row.发票号
// searchTable2(row.发票结算申请单流水号).then(response => {
// this.tableData2 = response.data
// this.totalMoney = 0
// for (let i = 0; i < response.data.length; i++) {
// this.totalMoney += parseFloat(response.data[i].金额)
// }
// })
// },
cancel(row) {
console.log(row, 'row')
if (Number(this.token) === 18) {