This commit is contained in:
liushuai
2019-10-09 19:08:24 +08:00
parent 86989987e2
commit 61413afd91
13 changed files with 443 additions and 345 deletions

View File

@@ -30,7 +30,19 @@
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" border stripe highlight-current-row style="margin-top: 3px;" height="600px" size="mini" show-summary @expand-change="searchTable02">
<el-table
v-loading=""
:data="tableData1"
:row-key="getRowKeys"
:expand-row-keys="expands"
border
stripe
highlight-current-row
style="margin-top: 3px;"
height="600px"
size="mini"
show-summary
@expand-change="searchTable02">
<el-table-column type="expand" label="详情">
<template slot-scope="scope">
<el-table :data="gridData" class="subTableHeader" stripe size="mini" show-summary style="width: 40%">
@@ -45,7 +57,7 @@
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column min-width="150" align="center" label="开票金额">
<el-table-column min-width="150" align="center" label="开票金额" prop="开票金额">
<template slot-scope="scope">
{{ scope.row.开票金额 }}
</template>
@@ -122,23 +134,17 @@
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible2" title="采购计划请款" center style="min-height: 300px" width="1200px">
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible2" title="采购计划请款" center style="min-height: 300px" width="800px">
<span>供应商:</span>
<el-select v-model="supplierValue" placeholder="供应商" filterable size="small">
<el-select v-model="supplierValue" placeholder="供应商" filterable size="small" clearable @change="pageCurrent1=1;pageSize1=10;total1=0;searchTable01()">
<el-option
v-for="item in supplier"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin: 0 10px 10px 10px"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable01()">查询</el-button>
<el-table v-loading="" :data="tableData01" border stripe highlight-current-row style="max-height: 300px;" height="300px" size="mini" @selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" type="selection" align="center" width="50"/>
<el-table-column type="selection" align="center" width="50"/>
<el-table-column label="发票号" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.发票号 }}
@@ -156,12 +162,12 @@
</el-table-column>
</el-table>
<span>合计:<el-input v-model="SUM" size="mini" style="width: 80px; margin: 10px 10px 0 10px"/>元</span>
<el-button type="primary" size="small" style="float:right;margin: 10px 10px 0 10px" icon="el-icon-check" @click="submitRequestFund">确定请款</el-button>
<el-button type="primary" size="small" style="float:right;margin: 10px 10px 0 10px" icon="el-icon-check" @click="submitRequestFund">提交请款审批</el-button>
</el-dialog>
</div>
</template>
<script>import { searchRequestFund, searchOfflineContract, submitRequestFund, searchRequsetFundDetail, cancelRequestFund } from '@/api/WorkshopProcurement/RequestOutsourcingMaterials'
<script>import { searchRequestFund, searchOfflineContract, searchOfflineContract1, submitRequestFund, searchRequsetFundDetail, cancelRequestFund } from '@/api/WorkshopProcurement/RequestOutsourcingMaterials'
import { mapGetters } from 'vuex'
export default {
@@ -171,6 +177,7 @@ export default {
check1: 0,
check2: 0,
dateRange: '',
expands: [],
pickerOptions: {
shortcuts: [{
text: '上季度',
@@ -260,25 +267,18 @@ export default {
this.searchTable1()
},
requestFund() { // 请款
this.searchTable01()
this.dialogVisible2 = true
this.supplierValue = ''
this.fetchData() // 重新获取供应商
this.tableData01 = []
},
searchTable01() { // 查询待请款
if (this.supplierValue) {
this.contractGroup = []
searchOfflineContract(this.supplierValue).then(response => {
this.tableData01 = response.data
this.tableData01.map(v => {
this.$set(v, '请款金额', 0)
v.请款金额 = v.总价 - v.已付金额
return v
})
})
} else {
this.$message.error('请选择供应商')
}
this.contractGroup = []
this.supplierValue ? this.check = 1 : this.check = 0
searchOfflineContract1(this.check, this.supplierValue).then(response => {
this.tableData01 = response.data
})
},
handleSelectionChange(val) {
this.SUM = 0
@@ -290,9 +290,6 @@ export default {
this.sumGroup.push(val[i].开票金额)
}
},
selectable(row, index) { // 控制某行是否可选
return parseInt(row.已请款) !== 1 // 已经请款
},
submitRequestFund() { // 确认请款
if (this.supplierValue && this.contractGroup.length !== 0) {
submitRequestFund(this.contractGroup, this.sumGroup, this.supplierValue, this.SUM, this.id).then(response => {
@@ -307,10 +304,28 @@ export default {
}
},
searchTable02(row) { // 查看详情(请款信息包含的合同)
if (this.a === 1) {
this.expands.push(row.采购计划请款流水号)
this.b = row.采购计划请款流水号
this.a = 0
} else {
if (this.b === row.采购计划请款流水号) {
this.expands = []
this.a = 1
} else {
this.expands = []
this.expands.push(row.采购计划请款流水号)
this.a = 0
this.b = row.采购计划请款流水号
}
}
searchRequsetFundDetail(row.采购计划请款流水号).then(response => {
this.gridData = response.data
})
},
getRowKeys(row) {
return row.采购计划请款流水号
},
cancelRequestFund(row) { // 取消请款
this.$confirm('确定取消请款?', '提示', {
confirmButtonText: '确定',