报废及制造采购导出
This commit is contained in:
@@ -13,12 +13,21 @@
|
||||
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!--<span>采购员:</span>-->
|
||||
<el-input v-model="buyerName" placeholder="请双击选择" size="small" clearable @dblclick.native="initBuyer();dialogVisible2=true;submitDisable=true"/>
|
||||
<!--<span>供应商:</span>-->
|
||||
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
|
||||
<el-date-picker
|
||||
v-model="startTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
style="width:250px"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<!--<span>审批情况:</span>-->
|
||||
<el-select v-model="approvalValue" placeholder="审批情况" size="small" clearable>
|
||||
<el-select v-model="approvalValue" placeholder="审批情况" size="small" clearable style="margin-left: 10px">
|
||||
<el-option
|
||||
v-for="item in approval"
|
||||
:key="item.value"
|
||||
@@ -26,10 +35,17 @@
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="success"
|
||||
type="primary"
|
||||
size="small"
|
||||
plain
|
||||
icon="el-icon-search"
|
||||
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@click="searchTable1()">导出合同报表</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
@@ -41,7 +57,7 @@
|
||||
size="mini"
|
||||
border
|
||||
style="width: 100%"
|
||||
height="700px"
|
||||
height="500px"
|
||||
highlight-current-row
|
||||
@row-click="searchTable2">
|
||||
<el-table-column label="采购合同号" align="center">
|
||||
@@ -59,7 +75,7 @@
|
||||
{{ scope.row.规定到货时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center">
|
||||
<el-table-column label="供应商" align="center" width="200px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
@@ -69,16 +85,21 @@
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" align="center">
|
||||
<el-table-column label="总金额(元)" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.含税总金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预付款" align="center">
|
||||
<el-table-column label="预付款(元)" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.预付款 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已付款(元)" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批情况" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.审批情况内容 }}
|
||||
@@ -91,8 +112,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="warning" plain size="mini" @click="exportTable()">打印</el-button>
|
||||
<el-button type="danger" plain size="mini" @click="Disable(scope.row)">打回</el-button>
|
||||
<el-button type="text" plain size="mini" icon="el-icon-printer" @click="exportTable()">打印</el-button>
|
||||
<el-button type="text" plain size="mini" icon="el-icon-back" @click="Disable(scope.row)">打回</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -387,6 +408,7 @@ export default {
|
||||
value: 3,
|
||||
label: '未审批'
|
||||
}],
|
||||
startTime: '',
|
||||
采购合同名称: '',
|
||||
规定到货时间: '',
|
||||
操作日期: '',
|
||||
@@ -463,19 +485,15 @@ export default {
|
||||
searchTable1() {
|
||||
this.textarea = ``
|
||||
this.loading1 = true
|
||||
if (this.startEndDate === '' || this.startEndDate === null || this.startEndDate[0] === '' || this.startEndDate[1] === '') {
|
||||
this.check1 = 0
|
||||
this.startEndDate = ''
|
||||
} else { this.check1 = 1 }
|
||||
this.startTime ? this.check1 = 1 : (this.check1 = 0, this.startTime = '')
|
||||
this.contractNumValue ? this.check2 = 1 : this.check2 = 0
|
||||
this.buyerName ? this.check3 = 1 : this.check3 = 0
|
||||
this.supplierName ? this.check4 = 1 : this.check4 = 0
|
||||
if (this.approvalValue === '' || this.approvalValue === 0) {
|
||||
this.check5 = 0
|
||||
} else {
|
||||
this.check5 = 1
|
||||
}
|
||||
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startEndDate[0], this.startEndDate[1], this.check2, this.contractNumValue, this.check3, this.buyerValue, this.check4, this.supplierName, this.check5, this.approvalValue).then(response => {
|
||||
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startTime[0], this.startTime[1], this.check2, this.contractNumValue, this.check4, this.supplierName, this.check5, this.approvalValue).then(response => {
|
||||
this.loading1 = false
|
||||
console.log(response.data.rows)
|
||||
for (let j = 0; j < response.data.rows.length; j++) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-card style="width: 47%">
|
||||
<span>项目名称:</span>
|
||||
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable>
|
||||
<el-select v-model="projectValue" placeholder="项目名称" size="small" style="width: 180px" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
@@ -10,45 +10,48 @@
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="success"
|
||||
type="primary"
|
||||
size="small"
|
||||
plain
|
||||
icon="el-icon-search"
|
||||
style="margin-left:10px"
|
||||
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
|
||||
@click="searchTable1()">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
style="margin-left:10px"
|
||||
@click="searchTable1()">导出项目采购明细</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-card style="width: 47%">
|
||||
<el-table v-loading="" :data="tableData2" :summary-method="getSummaries1" show-summary border style="width: 100%;max-height: 700px;" height="700px">
|
||||
<el-table-column label="项目名称" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" min-width="100">
|
||||
<el-table-column label="零件名称" align="center" 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">
|
||||
<el-table-column label="图号或型号" align="center" 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">
|
||||
<el-table-column label="材料或规格" align="center" 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">
|
||||
<el-table-column label="数量" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" align="center" min-width="100">
|
||||
<el-table-column label="单价(元)" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.单价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计(元)" align="center" min-width="100" prop="金额">
|
||||
<el-table-column label="小计(元)" align="center" width="100" prop="金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.金额 }}
|
||||
</template>
|
||||
@@ -111,39 +114,11 @@ export default {
|
||||
this.$message.error('请选择项目')
|
||||
}
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 4) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
} else if (index === 5) {
|
||||
const values = data.map(item => Number(item['金额']))
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return Number(prev) + Number(curr)
|
||||
} else {
|
||||
return Number(prev)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ' 元(未税)'
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
} else if (index === 6) {
|
||||
sums[index] = parseInt(parseInt(sums[5]) * 1.16 * 100) / 100 + ' 元(含税)'
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
getSummaries1(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 4) {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
} else if (index === 5) {
|
||||
@@ -157,12 +132,10 @@ export default {
|
||||
return Number(prev)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ' 元(未税)'
|
||||
sums[index] += ' 元(含税)'
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
} else if (index === 6) {
|
||||
sums[index] = parseInt(parseInt(sums[5]) * 1.16 * 100) / 100 + ' 元(含税)'
|
||||
}
|
||||
})
|
||||
return sums
|
||||
|
||||
Reference in New Issue
Block a user