This commit is contained in:
liushuai
2020-03-25 17:59:26 +08:00
22 changed files with 228 additions and 331 deletions

View File

@@ -16,15 +16,7 @@
</el-row>
</el-card>
<el-card>
<el-table
v-loading="loading"
:data="tableData"
size="small"
highlight-current-row
min-height="540px"
height="540px"
stripe
border>
<el-table v-loading="loading" :data="tableData" :summary-method="getSummaries" size="small" highlight-current-row show-summary min-height="540px" height="540px" stripe border>
<el-table-column align="center" label="采购合同编号" width="150px">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
@@ -45,7 +37,7 @@
{{ scope.row.物料名称 ? scope.row.物料名称 : scope.row.组件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" width="70px">
<el-table-column align="center" label="数量" width="70px" prop="数量">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
@@ -55,9 +47,9 @@
<el-input v-model="scope.row.单价" size="mini" width="80px" align="center" @blur="filterNuber(scope.row.单价, scope.$index, '单价', scope.row)"/>
</template>
</el-table-column>
<el-table-column align="center" label="总额(元)" width="90px">
<el-table-column align="center" label="总额(元)" width="90px" prop="金额">
<template slot-scope="scope">
{{ Number(scope.row.金额).toFixed(2) }}
{{ scope.row.金额 }}
</template>
</el-table-column>
</el-table>
@@ -75,7 +67,8 @@
</div>
</template>
<script>import { initPayState, searchParts, Preservation } from '@/api/WorkshopProcurement/AccountingPrice'
<script>
import { initPayState, searchParts, Preservation } from '@/api/WorkshopProcurement/AccountingPrice'
import { mapGetters } from 'vuex'
export default {
data() {
@@ -128,7 +121,6 @@ export default {
if (value.indexOf('.') < 0 && value !== '') {
value = parseFloat(value).toFixed(2)
}
console.log(value)
this.tableData[index][date] = value
this.tableData[index]['金额'] = value * row.数量
this.update(row)
@@ -140,7 +132,6 @@ export default {
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
searchParts(this.pageCurrent, this.pageSize, this.check1, this.contractNumValue).then(response => {
this.loading = false
console.log(response.data.rows)
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].物料型号 === null || response.data.rows[i].物料型号 === '') {
response.data.rows[i].物料型号 = response.data.rows[i].零件图号
@@ -156,27 +147,59 @@ export default {
物料名称: response.data.rows[i].物料名称,
数量: response.data.rows[i].数量,
单价: Number(response.data.rows[i].单价).toFixed(2),
金额: response.data.rows[i].金额
金额: Number(response.data.rows[i].金额).toFixed(2)
})
}
}
console.log(response, 90)
this.total = response.data.total
})
} else {
this.tableData = []
}
},
update(row) {
console.log(row, 12)
Preservation(row.采购合同明细流水号, row.单价).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
// this.searchTable()
} else {
this.$message.error('编辑失败')
// 合计
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价'
} else if (index === 4) {
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) + Number(curr))
}
}, 0)
sums[index] += ''
} else {
sums[index] = 'N/A'
}
} else if (index === 6) {
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 (parseInt((Number(prev) + Number(curr)) * 100) / 100).toFixed(2)
} else {
return (parseInt(Number(prev) * 100) / 100).toFixed(2)
}
}, 0)
sums[index] += ' 元'
} else {
sums[index] = 'N/A'
}
}
})
return sums
},
update(row) {
Preservation(row.采购合同明细流水号, row.单价)
},
handleSizeChange(val) {
this.pageSize = val

View File

@@ -14,18 +14,23 @@
</el-card>
<el-card>
<el-table v-loading="" :data="tableData" stripe border style="width: 100%;max-height: 600px;margin-top: 10px" height="600px" size="mini">
<el-table v-loading="" :data="tableData" stripe border style="width: 740px;margin-top: 10px" height="600px" size="mini">
<el-table-column label="采购合同编号" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.物料名称 ? scope.row.物料名称 : scope.row.组件名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" width="130">
<el-table-column label="图号或型号" align="center" width="160">
<template slot-scope="scope">
{{ scope.row.物料型号 ? scope.row.物料型号 : scope.row.组号 }}
</template>
@@ -40,7 +45,7 @@
{{ scope.row.数量 }}
</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.已到货数量 }}
</template>
@@ -91,6 +96,7 @@ export default {
},
searchTable() {
searchArrivalState(this.contractNumValue).then(response => {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].物料型号 === '' || response.data[i].物料型号 === null) {
response.data[i].物料型号 = response.data[i].零件图号

View File

@@ -1,47 +1,14 @@
<template>
<div class="app-container">
<el-card>
<!-- <span>发票号:</span>-->
<el-input v-model="invoiceNum" placeholder="到票号\供应商" size="small" clearable/>
<el-input v-model="invoiceNum" placeholder="发票号\供应商" size="small" clearable/>
<el-button type="primary" size="small" plain icon="el-icon-search" style="margin-left:10px" @click="tableData2=[];total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
<el-button type="distribution" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="createOrder()">到票</el-button>
</el-card>
<el-card>
<h4 style="margin: 5px">到票结算申请单</h4>
<h5 style="margin: 5px">到票结算申请单</h5>
<el-table id="expandTable" :data="tableData1" border stripe highlight-current-row style="width: 100%;" height="350px" size="mini" @row-click="searchTable2">
<!-- <el-table-column label="详情" type="expand">-->
<!-- <template slot-scope="scope">-->
<!-- <el-form label-position="left" inline class="demo-table-expand">-->
<!-- <el-row>-->
<!-- <el-col :span="6">-->
<!-- <viewer>-->
<!-- <img :src="scope.row.scanSrc" alt="发票扫描件" height="120px">-->
<!-- </viewer>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item label="已付款项">-->
<!-- <span>{{ scope.row.已付款项 }}</span>-->
<!-- </el-form-item><br>-->
<!-- <el-form-item label="尚欠金额">-->
<!-- <span>{{ scope.row.尚欠金额 }}</span>-->
<!-- </el-form-item><br>-->
<!-- <el-form-item label="备注">-->
<!-- <span>{{ scope.row.备注 }}</span>-->
<!-- </el-form-item><br>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item label="是否费用类发票">-->
<!-- <span>{{ scope.row.是否费用类 }}</span>-->
<!-- </el-form-item><br>-->
<!-- <el-form-item label="税额">-->
<!-- <span>{{ scope.row.税额 }}</span>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="供应商" prop="供应商名称" align="center" width="170" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
@@ -152,11 +119,6 @@
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="150" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="合同编号" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.采购合同编号 || scope.row.离线合同编号 }}

View File

@@ -84,7 +84,7 @@
<span v-if="Number(scope.row.采购计划状态)===4" type="info" size="mini">已结算</span>
</template>
</el-table-column>
<el-table-column label="离线备料计划编号" align="center" width="140">
<el-table-column label="离线备料号" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.离线采购计划编号 }}
</template>

View File

@@ -39,7 +39,7 @@
size="small"
plain
icon="el-icon-search"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
@click="total1=0;pageCurrent1=1;pageSize1=20;searchTable1()">查询</el-button>
<el-button
type="primary"
size="small"
@@ -120,7 +120,7 @@
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-sizes="[20, 30, 40, 50]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
@@ -436,7 +436,7 @@ export default {
supplierValue: '',
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
pageSize1: 20,
tableData1: [],
loading1: false,
dialogVisible1: false,

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-card style="width: 44%">
<span>项目名称:</span>
<el-card style="width: 800px">
<!--<span>项目名称:</span>-->
<el-select v-model="projectValue" placeholder="项目名称" size="small" style="width: 180px" filterable clearable>
<el-option
v-for="item in project"
@@ -22,16 +22,16 @@
plain
icon="el-icon-download"
style="margin-left:10px"
@click="exportExcel()">导出项目采购明细</el-button>
@click="exportExcel()">导出</el-button>
</el-card>
<el-card style="width: 54%">
<el-card style="width: 800px">
<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" width="150">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" width="150">
<el-table-column label="图号或型号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>

View File

@@ -133,6 +133,7 @@
</el-card>
</el-col>
</el-row>
<el-dialog :visible.sync="dialogVisible2" title="采购合同请款" center style="min-height: 300px" width="1200px">
<span>供应商</span>
<el-select v-model="supplierValue" placeholder="供应商" filterable clearable size="small" @change="searchTable01()">
@@ -166,17 +167,17 @@
</el-table-column>
<el-table-column label="合同总额(元)" align="center" width="110" prop="合同总额">
<template slot-scope="scope">
{{ scope.row.含税总金额 }}
{{ parseFloat(scope.row.含税总金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="已付金额(元)" align="center" min-width="100" prop="已付金额">
<template slot-scope="scope">
{{ scope.row.已付金额 }}
{{ parseFloat(scope.row.已付金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="申请中金额(元)" align="center" min-width="100" prop="申请中金额">
<template slot-scope="scope">
{{ scope.row.申请中金额 }}
{{ parseFloat(scope.row.申请中金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="请款金额(元)" align="center" min-width="130" prop="请款金额">
@@ -359,6 +360,7 @@ export default {
this.contractGroup.push(val[i].采购合同流水号)
this.sumGroup.push(val[i].请款金额)
}
this.SUM = parseFloat(this.SUM).toFixed(2)
},
submitRequestFund() { // 确认请款
if (this.supplierValue && this.contractGroup.length !== 0) {