合同情况

This commit is contained in:
Vergil
2020-03-10 14:46:31 +08:00
parent a111028427
commit 584b25e4bd
5 changed files with 90 additions and 42 deletions

View File

@@ -1,8 +1,8 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<h3 style="margin-top: 0">采购合同</h3> <!--<h3 style="margin-top: 0">采购合同</h3>-->
<el-table v-loading="" :data="tableData1" border stripe style="width: 100%;max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable01"> <el-table v-loading="" :data="tableData1" border stripe style="width: 100%;height: 150px;" height="300px" size="mini" highlight-current-row @row-click="searchTable01">
<el-table-column label="供应商" align="center" min-width="170"> <el-table-column label="供应商" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.供应商名称 }} {{ scope.row.供应商名称 }}
@@ -18,7 +18,7 @@
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款金额" align="center" min-width="100" prop="请款金额"> <el-table-column label="请款金额(元)" align="center" min-width="100" prop="请款金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.请款金额 }} {{ scope.row.请款金额 }}
</template> </template>
@@ -42,28 +42,33 @@
@current-change="handleCurrentChange1"/> @current-change="handleCurrentChange1"/>
</div> </div>
</el-card> </el-card>
<h3 style="">合同明细</h3> <!--<h3 style="">合同明细</h3>-->
<el-row> <el-row>
<el-col :span="8"> <el-col :span="10">
<el-table :data="gridData1" :summary-method="getSummaries2" border stripe highlight-current-row size="mini" show-summary @row-click="searchContactDetail"> <el-table :data="gridData1" :summary-method="getSummaries2" border stripe highlight-current-row size="mini" show-summary @row-click="searchContactDetail">
<el-table-column min-width="150" align="center" label="合同编号"> <el-table-column min-width="150" align="center" label="合同编号">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.采购合同编号 : scope.row.离线合同编号 }} {{ scope.row.采购合同编号 ? scope.row.采购合同编号 : scope.row.离线合同编号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="120" align="center" label="已付金额" prop="已付金额"> <el-table-column width="120" align="center" label="到货金额(元)" prop="到货金额">
<template slot-scope="scope">
{{ parseFloat(scope.row.到货金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column width="120" align="center" label="已付金额(元)" prop="已付金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ parseFloat(scope.row.已付金额).toFixed(2) }} {{ parseFloat(scope.row.已付金额).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="120" align="center" label="请款金额" prop="请款金额"> <el-table-column width="120" align="center" label="请款金额(元)" prop="请款金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ parseFloat(scope.row.请款金额).toFixed(2) }} {{ parseFloat(scope.row.请款金额).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="14">
<el-table :data="contractDetail2" :summary-method="getSummaries" border height="500px" size="mini" stripe show-summary> <el-table :data="contractDetail2" :summary-method="getSummaries" border height="500px" size="mini" stripe show-summary>
<el-table-column label="物料名称" align="center" min-width="150"> <el-table-column label="物料名称" align="center" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -80,17 +85,17 @@
{{ scope.row.物料型号 ? scope.row.物料型号 : scope.row.零件图号 }} {{ scope.row.物料型号 ? scope.row.物料型号 : scope.row.零件图号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" align="center" width="70"> <el-table-column label="采购数量" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.数量 }} {{ scope.row.数量 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="到货数量" align="center" width="70"> <el-table-column label="到货数量" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.合同类型 === 1 ? scope.row.已到货数量 : scope.row.到货数量 }} {{ scope.row.合同类型 === 1 ? scope.row.已到货数量 : scope.row.到货数量 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="合计" align="center" min-width="100" prop="合计"> <el-table-column label="小计(元)" align="center" min-width="100" prop="合计">
<template slot-scope="scope"> <template slot-scope="scope">
{{ (parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0)).toFixed(2) }} {{ (parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0)).toFixed(2) }}
</template> </template>
@@ -235,8 +240,8 @@ export default {
columns.forEach((column, index) => { columns.forEach((column, index) => {
if (index === 0) { if (index === 0) {
sums[index] = '总价' sums[index] = '总价'
} else if (index === 6) { } else if (index === 3) {
const values = data.map(item => Number(parseFloat(item['单价']) * parseInt(item['数量']))) const values = data.map(item => Number(parseFloat(item['数量'])))
if (!values.every(value => isNaN(value))) { if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
@@ -246,9 +251,32 @@ export default {
return prev return prev
} }
}, 0) }, 0)
sums[index] = sums[index].toFixed(2) + ' ' sums[index] = sums[index] + ' '
} else { } else {
sums[index] = 'N/A' sums[index] = '0'
}
} else if (index === 4) {
for (let i = 0; i < data.length; i++) {
if (!data[i].到货数量) {
data[i].到货数量 = 0
}
if (!data[i].已到货数量) {
data[i].已到货数量 = 0
}
}
const values = data.map(item => Number(parseInt(item['到货数量'])) + Number(parseInt(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] + ' 件'
} else {
sums[index] = '0'
} }
} }
}) })

View File

@@ -3,7 +3,7 @@
<el-card> <el-card>
<div slot="header"> <div slot="header">
<!--<span>供应商</span>--> <!--<span>供应商</span>-->
<el-select v-model="supplierValue" placeholder="供应商" filterable size="small" clearable @change="totalSum=0;totalPay=0;totalDebt=0;"> <el-select v-model="supplierValue" placeholder="供应商" filterable size="small" style="margin-left: 5px" clearable @change="totalSum=0;totalPay=0;totalDebt=0;">
<el-option <el-option
v-for="item in supplier" v-for="item in supplier"
:key="item.value" :key="item.value"
@@ -115,6 +115,11 @@
{{ scope.row.合同总额 ? parseFloat(scope.row.合同总额).toFixed(2) : 0 }} {{ scope.row.合同总额 ? parseFloat(scope.row.合同总额).toFixed(2) : 0 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="120" align="center" label="到货金额(元)" prop="到货金额">
<template slot-scope="scope">
{{ parseFloat(scope.row.到货金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column width="120" align="center" label="已付金额(元)" prop="已付金额"> <el-table-column width="120" align="center" label="已付金额(元)" prop="已付金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ parseFloat(scope.row.已付金额).toFixed(2) }} {{ parseFloat(scope.row.已付金额).toFixed(2) }}
@@ -144,12 +149,12 @@
{{ scope.row.物料型号 ? scope.row.物料型号 : scope.row.零件图号 }} {{ scope.row.物料型号 ? scope.row.物料型号 : scope.row.零件图号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" align="center" width="70"> <el-table-column label="采购数量" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.数量 }} {{ scope.row.数量 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="到货数量" align="center" width="70"> <el-table-column label="到货数量" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.合同类型 === 1 ? scope.row.已到货数量 : scope.row.到货数量 }} {{ scope.row.合同类型 === 1 ? scope.row.已到货数量 : scope.row.到货数量 }}
</template> </template>
@@ -359,8 +364,8 @@ export default {
columns.forEach((column, index) => { columns.forEach((column, index) => {
if (index === 0) { if (index === 0) {
sums[index] = '合计' sums[index] = '合计'
} else if (index === 5) { } else if (index === 3) {
const values = data.map(item => Number(parseFloat(item['单价']) * parseInt(item['数量']))) const values = data.map(item => Number(parseFloat(item['数量'])))
if (!values.every(value => isNaN(value))) { if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
@@ -370,9 +375,32 @@ export default {
return prev return prev
} }
}, 0) }, 0)
sums[index] = sums[index].toFixed(2) + ' ' sums[index] = sums[index] + ' '
} else { } else {
sums[index] = 'N/A' sums[index] = '0'
}
} else if (index === 4) {
for (let i = 0; i < data.length; i++) {
if (!data[i].到货数量) {
data[i].到货数量 = 0
}
if (!data[i].已到货数量) {
data[i].已到货数量 = 0
}
}
const values = data.map(item => Number(parseInt(item['到货数量'])) + Number(parseInt(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] + ' 件'
} else {
sums[index] = '0'
} }
} }
}) })

View File

@@ -45,6 +45,7 @@
border border
stripe stripe
style="width: 60%; max-height: 500px" style="width: 60%; max-height: 500px"
height="150px"
highlight-current-row highlight-current-row
@row-click="searchTable2"> @row-click="searchTable2">
<el-table-column type="expand" label="详情"> <el-table-column type="expand" label="详情">
@@ -98,7 +99,7 @@
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="总金额" align="center" min-width="60"> <el-table-column label="总金额(元)" align="center" min-width="60">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.合同总额 }} {{ scope.row.合同总额 }}
</template> </template>

View File

@@ -1,16 +1,16 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<h3>采购合同</h3> <!--<h3>采购合同</h3>-->
<el-table v-loading="" :data="tableData" border stripe style="width: 100%;max-height: 500px;" height="300px" size="mini"> <el-table v-loading="" :data="tableData" border stripe style="width: 100%;max-height: 500px;" height="300px" size="mini">
<el-table-column label="供应商" align="center" min-width="170"> <el-table-column label="供应商" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.供应商名称 }} {{ scope.row.供应商名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款时间" align="center" min-width="150"> <el-table-column label="请款金额" align="right" min-width="100" prop="请款金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.请款时间 }} {{ scope.row.请款金额 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款人" align="center" min-width="100"> <el-table-column label="请款人" align="center" min-width="100">
@@ -18,9 +18,9 @@
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请款金额" align="center" min-width="100" prop="请款金额"> <el-table-column label="请款时间" align="center" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.请款金额 }} {{ scope.row.请款时间 ? scope.row.请款时间.split(' ')[0] : '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="审核" align="center" width="320"> <el-table-column label="审核" align="center" width="320">
@@ -39,10 +39,10 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" style="margin-right: 10px" plain @click="searchTable01(scope.row)">查看详情</el-button> <el-button slot="reference" type="text" size="mini" icon="el-icon-search" style="margin-right: 10px" plain @click="searchTable01(scope.row)">查看详情</el-button>
</el-popover> </el-popover>
<el-button type="primary" size="mini" icon="el-icon-check" plain @click="yesApproval(scope.row)">通过</el-button> <el-button type="text" size="mini" icon="el-icon-check" plain @click="yesApproval(scope.row)">通过</el-button>
<el-button type="danger" size="mini" icon="el-icon-close" plain @click="noApproval(scope.row)">不通过</el-button> <el-button type="text" size="mini" icon="el-icon-close" plain @click="noApproval(scope.row)">不通过</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -117,7 +117,7 @@
<!--</div>--> <!--</div>-->
<!--</el-card>--> <!--</el-card>-->
<el-card> <el-card>
<h3>备料合同</h3> <!--<h3>备料合同</h3>-->
<el-table v-loading="" :data="tableData3" border style="width: 100%;max-height: 300px;" height="300px" size="mini"> <el-table v-loading="" :data="tableData3" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
<el-table-column label="供应商" align="center" min-width="170"> <el-table-column label="供应商" align="center" min-width="170">
<template slot-scope="scope"> <template slot-scope="scope">

View File

@@ -26,16 +26,7 @@
</el-card> </el-card>
<el-card> <el-card>
<el-table <el-table v-loading="loading1" :data="tableData1" size="mini" border stripe style="width: 100%;max-height: 300px;" height="150px" highlight-current-row @row-click="searchTable2">
v-loading="loading1"
:data="tableData1"
size="mini"
border
stripe
style="width: 100%;max-height: 300px;"
height="450px"
highlight-current-row
@row-click="searchTable2">
<el-table-column label="采购合同号" align="center"> <el-table-column label="采购合同号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.采购合同编号 }} {{ scope.row.采购合同编号 }}