付款计划

This commit is contained in:
chenjianan
2018-12-13 19:39:13 +08:00
parent b2e1b0a17c
commit c23decc507
5 changed files with 505 additions and 2 deletions

View File

@@ -1,4 +1,16 @@
import request from '@/utils/request'
// 查询付款计划
export function searchTable0(check, date1, date2) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款计划_查询数据',
param: `时间段_check=${check}&开始时间=${date1}&结束时间=${date2}`
}
})
}
// 初始化合同
export function initContract() {
return request({

View File

@@ -0,0 +1,74 @@
import request from '@/utils/request'
// 初始化合同
export function initContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购请款表_查询数据'
}
})
}
// 查询表1
export function searchTable1(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购请款表_查询数据',
param: '采购合同流水号_check=' + params[2] + '&采购合同流水号=' + params[3] + '&供应商名称_check=' + params[4] + '&供应商名称=' + params[5],
Pagination: params[0] + '&' + params[1]
}
})
}
// 查询表01付款计划
export function searchTable01(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_付款计划_查询数据',
param: '采购合同流水号_check=1&采购合同流水号=' + params[0]
}
})
}
// 增加表01付款计划
export function addTable01(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_付款计划_增加数据',
param: `采购合同流水号=${params[0]}&计划付款日期=${params[1]}&计划付款金额=${params[2]}&计划付款备注=${params[3]}`
}
})
}
// 删除表01付款计划
export function deleteTable01(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_付款计划_删除数据',
param: `付款计划流水号=${params[0]}`
}
})
}
// 采购合同内容查询
export function searchTable2(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购合同内容_查询数据',
param: '采购合同流水号=' + num
}
})
}

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -1,5 +1,68 @@
<template>
<div class="app-container">
<el-card>
<span>时间段:</span>
<el-date-picker
v-model="dateRange"
:picker-options="pickerOptions"
size="small"
type="daterange"
align="center"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
style="width:300px"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="searchTable0()">查询</el-button>
</el-card>
<el-card>
<el-table :data="tableData0" size="mini" border style="max-height: 250px;" height="250px" highlight-current-row @row-click="searchContract">
<el-table-column label="计划状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="timeToStamp(scope.row.计划付款日期) <= getDate" type="danger" size="small">已拖期</el-tag>
<el-tag v-if="timeToStamp(scope.row.计划付款日期) > getDate" type="success" size="small">未拖期</el-tag>
</template>
</el-table-column>
<el-table-column label="计划付款日期" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="计划付款金额" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款金额 }}
</template>
</el-table-column>
<el-table-column label="计划付款备注" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款备注 }}
</template>
</el-table-column>
<el-table-column label="采购合同编号" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="供应商" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
@@ -124,12 +187,60 @@
</template>
<script>
import { initContract, searchTable1, searchCondition, requestFund, cancelRequestFund, searchContract } from '@/api/PurchasingCenter/PurchaseContractRequestFund'
import { searchTable0, initContract, searchTable1, searchCondition, requestFund, cancelRequestFund, searchContract } from '@/api/PurchasingCenter/PurchaseContractRequestFund'
import { mapGetters } from 'vuex'
import { getNowTime, timeToStamp } from '@/utils/tool'
export default {
data() {
return {
getDate: null,
tableData0: [],
check: 0,
pickerOptions: {
shortcuts: [{
text: '未来一周',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
}
}, {
text: '未来一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
}
}, {
text: '未来两个月',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30 * 2)
picker.$emit('pick', [start, end])
}
}, {
text: '未来三个月',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30 * 3)
picker.$emit('pick', [start, end])
}
}, {
text: '未来半年',
onClick(picker) {
const end = new Date()
const start = new Date()
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30 * 6)
picker.$emit('pick', [start, end])
}
}]
},
dateRange: '',
tableData11: [],
total1: 0,
pageCurrent1: 1,
@@ -154,8 +265,18 @@ export default {
created() {
this.fetchData()
this.searchTable1()
this.searchTable0()
},
methods: {
timeToStamp(param) { // 转时间戳
return timeToStamp(param)
},
searchTable0() { // 查询付款计划
this.dateRange ? this.check = 1 : (this.check = 0, this.dateRange = '')
searchTable0(this.check, this.dateRange[0], this.dateRange[1]).then(response => {
this.tableData0 = response.data
})
},
fetchData() {
initContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
@@ -167,6 +288,7 @@ export default {
})
},
searchTable1() { // 查询
this.getDate = timeToStamp(getNowTime()) // 获取当前时间
this.tableData1 = []
this.returns = ''
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
@@ -245,11 +367,14 @@ export default {
</script>
<style scoped>
.el-tag{
margin: 0
}
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px!important;
width:150px;
}
.el-select{
width:200px

View File

@@ -0,0 +1,292 @@
<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-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
<el-button
type="success"
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=""
id="expandTable"
:data="tableData1"
:row-key="getRowKeys"
:expand-row-keys="expands"
border
style="width: 100%;max-height: 250px;"
height="250px"
size="mini"
@row-click="searchContract"
@expand-change="searchPlan">
<el-table-column type="expand">
<template slot-scope="props">
<el-table v-loading="" v-show="tableData01.length!==0" :data="tableData01" border size="mini">
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="计划付款日期" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="计划付款金额" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款金额 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
<template slot-scope="scope">
{{ scope.row.计划付款备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="danger" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column label="采购合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="设置计划" align="center" min-width="100" fixed="right">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" @click="handleSetPayPlan(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"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<div style="min-height:500px;margin: 0px auto;width:800px;border:1px solid black" v-html="returns"/>
<el-dialog :visible.sync="dialogVisible1" title="增加付款计划" center style="min-height: 300px" width="400px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="110px">
<el-form-item label="计划付款日期" prop="计划付款日期">
<el-date-picker v-model="form1.计划付款日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="date" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="计划付款金额" prop="计划付款金额">
<el-input v-model="form1.计划付款金额" placeholder="填写金额" size="small" clearable/>
</el-form-item>
<el-form-item label="计划付款备注">
<el-input v-model="form1.计划付款备注" placeholder="填写备注" size="small" clearable/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible1=false">取消</el-button>
<el-button type="primary" size="small" @click="submitSetPayPlan">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initContract, searchTable1, searchTable01, addTable01, deleteTable01, searchTable2 } from '@/api/PurchasingCenter/SetPayPlan'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购预算查询
data() {
return {
expands: [],
contractNumValue: '',
contractNum: [],
supplierName: '',
tableData1: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
returns: '',
tableData01: [],
dialogVisible1: false,
form1: {
采购合同流水号: '',
计划付款日期: '',
计划付款金额: '',
计划付款备注: ''
},
rules1: {
计划付款日期: [{ required: true, message: '请选择计划付款日期' }],
计划付款金额: [{ required: true, message: '请输入计划付款金额' }]
}
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
this.searchTable1()
},
methods: {
getRowKeys(row) {
return row.采购合同流水号
},
fetchData() {
initContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
},
searchTable1() { // 查询合同
this.tableData1 = []
this.returns = ''
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
this.supplierName ? this.check2 = 1 : this.check2 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.contractNumValue, this.check2, this.supplierName).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchPlan(row) {
this.form1.采购合同流水号 = row.采购合同流水号
searchTable01(row.采购合同流水号).then(response => {
this.tableData01 = response.data
this.expands.indexOf(row.采购合同流水号) === -1 ? this.expands.push(row.采购合同流水号) : this.expands = []
})
},
handleSetPayPlan(row) { // 设置付款计划
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
searchTable01(row.采购合同流水号).then(response => {
this.tableData01 = response.data
}).then(() => {
this.expands.indexOf(row.采购合同流水号) === -1 ? this.expands.push(row.采购合同流水号) : true
})
this.form1.采购合同流水号 = row.采购合同流水号
this.form1.计划付款日期 = ''
this.form1.计划付款金额 = ''
this.form1.计划付款备注 = ''
this.dialogVisible1 = true
},
submitSetPayPlan() { // 提交设置
this.$refs['form1'].validate((valid) => {
if (valid) {
addTable01(this.form1.采购合同流水号, this.form1.计划付款日期, this.form1.计划付款金额, this.form1.计划付款备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('设置成功')
searchTable01(this.form1.采购合同流水号).then(response => {
this.tableData01 = response.data
this.expands.indexOf(this.form1.采购合同流水号) === -1 ? this.expands.push(this.form1.采购合同流水号) : true
})
this.dialogVisible1 = false
} else {
this.$message.error('设置失败')
}
})
}
})
},
handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteTable01(row.付款计划流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
searchTable01(this.form1.采购合同流水号).then(response => {
this.tableData01 = response.data
this.expands.indexOf(this.form1.采购合同流水号) === -1 ? this.expands.push(this.form1.采购合同流水号) : true
})
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchContract(row) {
searchTable2(row.采购合同流水号).then(response => {
this.returns = response.data[0].合同内容
})
}
}
}
</script>
<style>
#expandTable .el-table__expanded-cell{
padding: 5px 50px;
}
</style>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>