This commit is contained in:
liushuai
2019-11-28 15:55:03 +08:00
19 changed files with 353 additions and 294 deletions

View File

@@ -2,17 +2,24 @@
<div class="app-container">
<el-card class="searchContract">
<el-row>
<el-select v-model="contractNumValue" placeholder="请购单号/合同编号" size="small" @change="searchData">
<el-select v-model="contractNumValue" placeholder="请购单号/合同编号" size="small" style="width: 160px" @change="searchData">
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="contractName" placeholder="合同名称" size="small"/>
<el-input v-model="supplierName" size="small" placeholder="请双击选择供应商" readonly clearable @dblclick.native="dialogVisible1=true;submitDisable=true" @clear="emptySupplierDetail"/>
<el-input v-model="AdvanceCharge" size="small" placeholder="预付款"/>
<el-select v-model="currencyValue" placeholder="币种" size="small" clearable>
<el-input v-model="contractName" placeholder="合同名称" style="width: 120px" size="small"/>
<!-- <el-input v-model="supplierName" size="small" placeholder="请双击选择供应商" readonly clearable @dblclick.native="dialogVisible1=true;submitDisable=true" @clear="emptySupplierDetail"/>-->
<el-select v-model="supplierValue" placeholder="选择供应商" filterable style="width: 220px" size="small" clearable>
<el-option
v-for="item in supplierValues"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="AdvanceCharge" size="small" style="width: 120px" placeholder="预付款"/>
<el-select v-model="currencyValue" placeholder="币种" style="width: 120px" size="small" clearable>
<el-option
v-for="item in currency"
:key="item.value"
@@ -26,25 +33,25 @@
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="规定到货时间"/>
<el-input v-model="name" placeholder="采购员" size="small" readonly/>
<el-input v-model="taxRate" placeholder="税率" size="small"/>
<el-input v-model="name" placeholder="采购员" style="width: 120px" size="small" readonly/>
<el-input v-model="taxRate" placeholder="税率" style="width: 120px" size="small"/>
<el-button v-show="contractNumType===0" type="success" size="small" @click="linkGroup">成组采购</el-button>
<el-button v-show="contractNumType===1" type="danger" size="small" @click="unLinkGroup">取消成组采购</el-button>
</el-row>
</el-card>
<el-card>
<el-table v-show="contractNumType===1" :data="tableData5" border style="width: 100%" height="100px" size="mini">
<el-table-column label="组件名称" align="center" width="150">
<el-table v-show="contractNumType===1" :data="tableData5" border style="width: 1200px" height="100px" size="mini">
<el-table-column label="组件名称" align="center" width="180">
<template slot-scope="scope">
{{ scope.row.组件名称 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" width="100">
<el-table-column label="组号" align="center" width="70">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" width="120">
<el-table-column label="数量" align="center" width="90">
<template slot-scope="scope">
<el-input v-model="scope.row.数量" size="mini" style="width:100%" @change="update1(scope.row)"/>
</template>
@@ -56,10 +63,10 @@
</el-table-column>
<el-table-column label="金额" align="center" width="150">
<template slot-scope="scope">
{{ parseInt(scope.row.数量) * parseFloat(scope.row.单价) }}
{{ (parseInt(scope.row.数量) * parseFloat(scope.row.单价)).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="交货期" align="center" width="150">
<el-table-column label="交货期" align="center" width="160">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.物料计划到货时间"
@@ -71,7 +78,7 @@
@change="update1(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="250">
<el-table-column label="备注" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.备注" size="mini" style="width:100%" @change="update1(scope.row)"/>
</template>
@@ -79,35 +86,35 @@
</el-table>
</el-card>
<el-card>
<el-table v-show="contractNumType===0" :data="tableData4" border style="width: 100%;max-height: 400px;" height="300px" size="mini">
<el-table-column label="物料名称" align="center" min-width="100">
<el-table v-show="contractNumType===0" :data="tableData4" border style="width: 1200px;max-height: 420px;" height="320px" size="mini">
<el-table-column label="物料名称" align="center" min-width="180">
<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" min-width="140">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column label="材料或规格" align="center" width="200">
<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="100">
<el-table-column label="订货数量" align="center" width="70">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="单价" align="center" width="150">
<el-table-column label="单价" align="center" width="140">
<template slot-scope="scope">
<el-input v-model="scope.row.单价" size="mini" style="width:70px"/>
<el-input v-model="scope.row.单价" size="mini" style="width:100px" @change="calculateContractSum"/>
</template>
</el-table-column>
<el-table-column label="金额" align="center" width="100">
<el-table-column label="金额" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.金额 }}
{{ scope.row.金额.toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="交货期" align="center" width="150">
@@ -122,7 +129,7 @@
@change="update(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="150">
<el-table-column label="备注" align="center" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.备注" size="mini" style="width: 120px" @change="update(scope.row)"/>
</template>
@@ -337,6 +344,7 @@ export default {
contractNumValue: '',
contractNumType: 0,
RequisitionNumber: '',
supplierNames: [],
contract: [{
label: '合同模板1',
value: 1
@@ -356,6 +364,7 @@ export default {
supplierName: '', // 供应商
supplier: [],
supplierValue: '', // 供应商流水号
supplierValues: [],
enterpriseNature: '', // 企业性质
createDate: '', // 创立日期
registeredCapital: '', // 注册资本
@@ -439,6 +448,7 @@ export default {
},
created() {
this.fetchData()
this.searchSupplier()
},
methods: {
linkGroup() {
@@ -482,6 +492,8 @@ export default {
})
},
searchData() {
this.contractSum = 0.00
this.contractSum2 = 0.00
for (let i = 0; i < this.contractNum.length; i++) {
if (this.contractNum[i].value === this.contractNumValue) {
this.contractNumType = this.contractNum[i].id
@@ -496,6 +508,7 @@ export default {
console.log(this.tableData5)
})
searchData2(this.contractNumValue).then(response => {
console.log(response, 2233)
this.tableData4 = response.data
this.machineValue = response.data[0].机床流水号
this.form3.机床 = response.data[0].机床图号
@@ -523,24 +536,44 @@ export default {
})
},
calculateContractSum() { // 计算合同总额
this.contractSum = 0
this.contractSum1 = 0
this.costAccount = 0
this.riseFallPoint = 0
this.tableData4 = []
for (let i = 0; i < this.groupNum2.length; i++) {
this.groupNum2[i].金额 = parseFloat(this.groupNum2[i].单价) * parseFloat(this.groupNum2[i].零件数量)
this.contractSum1 += parseFloat(this.groupNum2[i].金额)
this.tableData4.push(this.groupNum2[i])
}
this.contractSum = (this.contractSum1).toFixed(2)
this.contractSum2 = parseInt(this.contractSum * (1 + parseFloat(this.taxRate)) * 100) / 100
this.costAccount = this.contractSum
if (parseInt(this.costAccount) === 0) {
this.$message.error('成本核算不可为0')
} else {
this.riseFallPoint = (this.contractSum - this.costAccount) / this.costAccount
this.riseFallPoint = this.riseFallPoint.toFixed(2)
if (this.contractNumType === 0) {
this.contractSum = 0
this.contractSum1 = 0
this.costAccount = 0
this.riseFallPoint = 0
this.tableData4 = []
for (let i = 0; i < this.groupNum2.length; i++) {
this.groupNum2[i].金额 = parseFloat(this.groupNum2[i].单价) * parseFloat(this.groupNum2[i].零件数量)
this.contractSum1 += parseFloat(this.groupNum2[i].金额)
this.tableData4.push(this.groupNum2[i])
}
this.contractSum = (this.contractSum1).toFixed(2)
this.contractSum2 = parseInt(this.contractSum * (1 + parseFloat(this.taxRate)) * 100) / 100
this.costAccount = this.contractSum
if (parseInt(this.costAccount) === 0) {
this.$message.error('成本核算不可为0')
} else {
this.riseFallPoint = (this.contractSum - this.costAccount) / this.costAccount
this.riseFallPoint = this.riseFallPoint.toFixed(2)
}
} else if (this.contractNumType === 1) {
this.contractSum = 0
this.contractSum1 = 0
this.costAccount = 0
this.riseFallPoint = 0
for (let i = 0; i < this.groupNum5.length; i++) {
this.contractSum1 += parseFloat((parseInt(this.groupNum5[i].数量) * parseFloat(this.groupNum5[i].单价)).toFixed(2))
}
console.log(this.contractSum1, this.groupNum5, 898989)
this.contractSum = (this.contractSum1).toFixed(2)
this.contractSum2 = parseInt(this.contractSum * (1 + parseFloat(this.taxRate)) * 100) / 100
this.costAccount = this.contractSum
if (parseInt(this.costAccount) === 0) {
this.$message.error('成本核算不可为0')
} else {
this.riseFallPoint = (this.contractSum - this.costAccount) / this.costAccount
this.riseFallPoint = this.riseFallPoint.toFixed(2)
}
}
},
fetchData() {
@@ -581,6 +614,12 @@ export default {
response.data[i].创立日期 = response.data[i].创立日期.split(' ')[0]
}
}
for (let i = 0; i < response.data.length; i++) {
this.supplierValues.push({
label: response.data[i].供应商名称,
value: response.data[i].供应商流水号
})
}
this.tableData01 = response.data
})
},

View File

@@ -27,104 +27,107 @@
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-goods" style="" @click="requestFund">请款</el-button>
@click="pageCurrent1=1;pageSize1=30;total1=0;searchTable1()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-goods" style="" @click="requestFund">新增请款</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" border style="max-height: 500px;" height="500px" size="mini" stripe>
<el-table-column label="供应商" prop="供应商名称" align="center" min-width="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="请款时间" prop="请款时间" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.请款时间 }}
</template>
</el-table-column>
<el-table-column label="请款人" prop="姓名" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="请款金额" align="center" min-width="90" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="请款付款情况" align="center">
<el-table-column label="审批情况内容" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.审批情况流水号)===3" type="primary" size="small">未审批</el-tag>
<el-tag v-if="Number(scope.row.审批情况流水号)===1" type="success" size="small">已通过</el-tag>
<el-tag v-if="Number(scope.row.审批情况流水号)===2" type="danger" size="small">通过</el-tag>
</template>
</el-table-column>
<el-table-column label="未通过审批原因" width="110" align="center">
<template slot-scope="scope">
{{ scope.row.未通过审批原因 === '通过' ? '—' : scope.row.未通过审批原因 }}
</template>
</el-table-column>
<el-table-column label="付款情况" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.付款情况流水号)===3" type="primary" size="small">未操作</el-tag>
<el-tag v-if="Number(scope.row.付款情况流水号)===1" type="success" size="small">已同意</el-tag>
<el-tag v-if="Number(scope.row.付款情况流水号)===2" type="danger" size="small">同意</el-tag>
</template>
</el-table-column>
<el-table-column label="未付款原因" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.未付款原因 === '通过' ? '—' : scope.row.未付款原因 }}
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-popover placement="right" width="500" trigger="click">
<el-table :data="gridData" highlight-current-row size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="采购合同编号">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="已付金额" prop="已付金额">
<template slot-scope="scope">
{{ scope.row.已付金额 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="请款金额" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="primary" size="mini" icon="el-icon-search" plain @click="searchTable02(scope.row)">查看详情</el-button>
</el-popover>
<el-button :disabled="Number(id)!==Number(scope.row.请款人) || (Number(scope.row.审批情况流水号)===1 && Number(scope.row.付款情况流水号)!==2)" type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px" plain @click="cancelRequestFund(scope.row)">取消请款</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
<span v-show="supplierValue">累计合同总额</span>
<el-input v-show="supplierValue" v-model="totalSum" size="mini" style="width: 100px;" readonly/>
<span v-show="supplierValue">累计付款</span>
<el-input v-show="supplierValue" v-model="totalPay" size="mini" style="width: 100px;" readonly/>
<span v-show="supplierValue">累计欠款</span>
<el-input v-show="supplierValue" v-model="totalDebt" size="mini" style="width: 100px;" readonly/>
</div>
</el-card>
<el-row>
<el-col style="width: 1200px">
<el-card>
<el-table v-loading="" :data="tableData1" border style="max-height: 500px;" height="500px" size="mini" stripe @row-click="searchTable02">
<el-table-column label="供应商" prop="供应商名称" align="center" min-width="340">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="请款时间" prop="请款时间" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.请款时间.substr(0,10) }}
</template>
</el-table-column>
<el-table-column label="请款人" prop="姓名" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="请款金额" align="center" width="90" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<!-- <el-table-column label="请款付款情况" align="center">-->
<el-table-column label="审批情况内容" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.审批情况流水号)===3" type="primary" size="small">未审批</el-tag>
<el-tag v-if="Number(scope.row.审批情况流水号)===1" type="success" size="small">通过</el-tag>
<el-tag v-if="Number(scope.row.审批情况流水号)===2" type="danger" size="small">不通过</el-tag>
</template>
</el-table-column>
<el-table-column label="未通过审批原因" width="130" align="center">
<template slot-scope="scope">
{{ scope.row.未通过审批原因 === '通过' ? '—' : scope.row.未通过审批原因 }}
</template>
</el-table-column>
<el-table-column label="付款情况" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.付款情况流水号)===3" type="primary" size="small">未操作</el-tag>
<el-tag v-if="Number(scope.row.付款情况流水号)===1" type="success" size="small">同意</el-tag>
<el-tag v-if="Number(scope.row.付款情况流水号)===2" type="danger" size="small">不同意</el-tag>
</template>
</el-table-column>
<el-table-column label="未付款原因" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.未付款原因 === '通过' ? '—' : scope.row.未付款原因 }}
</template>
</el-table-column>
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button :disabled="Number(id)!==Number(scope.row.请款人) || (Number(scope.row.审批情况流水号)===1 && Number(scope.row.付款情况流水号)!==2)" type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px" plain @click="cancelRequestFund(scope.row)">取消请款</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:40%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
<!-- <span v-show="supplierValue">累计合同总额</span>-->
<!-- <el-input v-show="supplierValue" v-model="totalSum" size="mini" style="width: 100px;" readonly/>-->
<!-- <span v-show="supplierValue">累计付款</span>-->
<!-- <el-input v-show="supplierValue" v-model="totalPay" size="mini" style="width: 100px;" readonly/>-->
<!-- <span v-show="supplierValue">累计欠款</span>-->
<!-- <el-input v-show="supplierValue" v-model="totalDebt" size="mini" style="width: 100px;" readonly/>-->
</div>
</el-card>
</el-col>
<el-col style="width: 500px">
<el-card>
<el-table :data="gridData" highlight-current-row size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="采购合同编号">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="已付金额" prop="已付金额">
<template slot-scope="scope">
{{ scope.row.已付金额 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="请款金额" prop="请款金额">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
</el-table>
</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">
@@ -242,7 +245,7 @@ export default {
tableData1: [],
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
pageSize1: 30,
returns: '',
supplierValue: '',
supplier: [],