This commit is contained in:
liushuai
2020-04-13 18:28:15 +08:00
parent 37d1a82b07
commit 4e0826cfd5
16 changed files with 1188 additions and 401 deletions

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<el-card>
<!--<h3 style="margin-top: 0">采购合同</h3>-->
<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 v-loading="" :data="tableData1" border stripe style="width: 100%;height: 150px;" height="200px" size="mini" highlight-current-row @row-click="searchTable01">
<el-table-column label="供应商" align="center" min-width="170">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
@@ -45,77 +45,86 @@
<!--<h3 style="">合同明细</h3>-->
<el-row>
<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-column min-width="150" align="center" label="合同编号">
<template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.采购合同编号 : scope.row.离线合同编号 }}
</template>
</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="已付金额">
<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">
{{ parseFloat(scope.row.请款金额).toFixed(2) }}
</template>
</el-table-column>
</el-table>
<el-card>
<el-table :data="gridData1" :summary-method="getSummaries2" border stripe highlight-current-row size="mini" show-summary @row-click="searchContactDetail">
<el-table-column width="120" align="center" label="合同编号">
<template slot-scope="scope">
{{ scope.row.采购合同编号 ? scope.row.采购合同编号 : scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column width="110" align="center" label="合同总额(元)" prop="到货金额">
<template slot-scope="scope">
{{ parseFloat(scope.row.合同总金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column width="110" align="center" label="到货金额(元)" prop="到货金额">
<template slot-scope="scope">
{{ parseFloat(scope.row.到货金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column width="105" align="center" label="已付金额(元)" prop="已付金额">
<template slot-scope="scope">
{{ parseFloat(scope.row.已付金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column width="105" align="center" label="请款金额(元)" prop="请款金额">
<template slot-scope="scope">
{{ parseFloat(scope.row.请款金额).toFixed(2) }}
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
<el-col :span="14">
<el-table :data="contractDetail2" :summary-method="getSummaries" border height="500px" size="mini" stripe show-summary>
<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="260">
<template slot-scope="scope">
{{ scope.row.物料规格 ? scope.row.物料规格 : scope.row.规格 }}
</template>
</el-table-column>
<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" width="80">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="到货数量" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.合同类型 === 1 ? scope.row.已到货数量 : scope.row.到货数量 }}
</template>
</el-table-column>
<el-table-column label="小计(元)" align="center" min-width="100" prop="合计">
<template slot-scope="scope">
{{ (parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0)).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="单价" align="center" min-width="100" prop="单价">
<template slot-scope="scope">
{{ parseFloat(scope.row.单价||0).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="交货期要求" align="center" min-width="100" prop="交货期要求">
<template slot-scope="scope">
{{ scope.row.合同类型 === 1 ? scope.row.交货期.split(' ')[0] === '1900-01-01' ? '-' : scope.row.交货期.split(' ')[0] : scope.row.交货期要求 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="150" prop="备注">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
</el-table>
<el-card>
<el-table :data="contractDetail2" :summary-method="getSummaries" border height="500px" size="mini" stripe show-summary>
<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="260">
<template slot-scope="scope">
{{ scope.row.物料规格 ? scope.row.物料规格 : scope.row.规格 }}
</template>
</el-table-column>
<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" width="80">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="到货数量" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.合同类型 === 1 ? scope.row.已到货数量 : scope.row.到货数量 }}
</template>
</el-table-column>
<el-table-column label="合计(元)" align="center" min-width="100" prop="合计">
<template slot-scope="scope">
{{ (parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0)).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="单价" align="center" min-width="100" prop="单价">
<template slot-scope="scope">
{{ parseFloat(scope.row.单价||0).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="交货期要求" align="center" min-width="100" prop="交货期要求">
<template slot-scope="scope">
{{ scope.row.合同类型 === 1 ? scope.row.交货期.split(' ')[0] === '1900-01-01' ? '-' : scope.row.交货期.split(' ')[0] : scope.row.交货期要求 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="150" prop="备注">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
@@ -239,7 +248,7 @@ export default {
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价'
sums[index] = '合计'
} else if (index === 3) {
const values = data.map(item => Number(parseFloat(item['数量'])))
if (!values.every(value => isNaN(value))) {
@@ -278,6 +287,21 @@ export default {
} else {
sums[index] = '0'
}
} else if (index === 5) {
const values = data.map(item => Number(parseFloat(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] + ' 元'
} else {
sums[index] = '0'
}
}
})
return sums
@@ -412,7 +436,7 @@ export default {
<style scoped>
.el-card{
margin-bottom: 15px;
/*margin-bottom: 15px;*/
}
.el-select{
width:200px

View File

@@ -1,73 +1,73 @@
<template>
<div class="app-container">
<el-card>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" clearable size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable style="width:180px"/>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left:10px" @click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<!-- <el-card>-->
<!-- <span>合同号:</span>-->
<!-- <el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>-->
<!-- <el-option-->
<!-- v-for="item in contractNum"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- <div style="float: left">{{ item.label }}</div>-->
<!-- <div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- <span>采购员:</span>-->
<!-- <el-select v-model="personValue" placeholder="采购员" clearable size="small" style="width: 100px">-->
<!-- <el-option-->
<!-- v-for="item in person"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<!-- <span>供应商:</span>-->
<!-- <el-input v-model="supplierName" placeholder="供应商" size="small" clearable style="width:180px"/>-->
<!-- <el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left:10px" @click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>-->
<!-- </el-card>-->
<el-card>
<el-table v-loading="loading1" :data="tableData1" size="mini" stripe border style="width: 100%;max-height: 450px;" height="450px" highlight-current-row @row-click="searchTable2">
<el-table-column label="展开" align="center" type="expand">
<template slot-scope="scope">
<el-form id="table" label-position="left" inline class="demo-table-expand">
<el-row>
<el-form-item label="交货日期">
{{ scope.row.交货日期 }}
</el-form-item>
</el-row>
<el-row>
<el-form-item label="支付日期">
{{ scope.row.支付日期 }}
</el-form-item>
</el-row>
<el-row>
<el-form-item label="支付方式">
{{ scope.row.支付方式 }}
</el-form-item>
</el-row>
<el-row>
<el-form-item label="开票信息">
{{ scope.row.开票信息 }}
</el-form-item>
</el-row>
<el-row>
<el-form-item label="其他说明">
{{ scope.row.其他说明 }}
</el-form-item>
</el-row>
</el-form>
</template>
</el-table-column>
<el-table v-loading="loading1" :data="tableData1" size="mini" stripe border style="width: 60%" height="210px" highlight-current-row @row-click="searchTable2">
<!-- <el-table-column label="展开" align="center" type="expand">-->
<!-- <template slot-scope="scope">-->
<!-- <el-form id="table" label-position="left" inline class="demo-table-expand">-->
<!-- <el-row>-->
<!-- <el-form-item label="交货日期">-->
<!-- {{ scope.row.交货日期 }}-->
<!-- </el-form-item>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-form-item label="支付日期">-->
<!-- {{ scope.row.支付日期 }}-->
<!-- </el-form-item>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-form-item label="支付方式">-->
<!-- {{ scope.row.支付方式 }}-->
<!-- </el-form-item>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-form-item label="开票信息">-->
<!-- {{ scope.row.开票信息 }}-->
<!-- </el-form-item>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-form-item label="其他说明">-->
<!-- {{ scope.row.其他说明 }}-->
<!-- </el-form-item>-->
<!-- </el-row>-->
<!-- </el-form>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="采购合同号" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<!-- <el-table-column label="采购合同名称" align="center" min-width="130">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.采购合同名称 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="供应商" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
@@ -83,6 +83,11 @@
{{ scope.row.合同总额 }}
</template>
</el-table-column>
<el-table-column label="提交时间" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.操作时间 ? scope.row.操作时间.split(' ')[0] : '-' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-edit-outline" @click="Open(scope.row)">审批</el-button>
@@ -115,7 +120,7 @@
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item v-show="form2.审批是否通过!==2" label="未通过原因" prop="未通过原因">
<el-form-item v-show="form2.审批是否通过===2" label="未通过原因" prop="未通过原因">
<el-input v-model="form2.未通过原因" :disabled="form2.审批是否通过!==2" size="small"/>
</el-form-item>
</el-form>