外协付款

This commit is contained in:
Vergil
2020-02-11 16:49:39 +08:00
parent 8cc1acc245
commit 21010d5403
3 changed files with 142 additions and 48 deletions

View File

@@ -4,7 +4,6 @@ import router from '@/router'
// 查询表格数据 // 查询表格数据
export function searchtable(check1, ManufacturerAbbreviation, check2, starttime, endTime, pageCurrent, pageSize) { export function searchtable(check1, ManufacturerAbbreviation, check2, starttime, endTime, pageCurrent, pageSize) {
console.log(router.currentRoute.path)
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
@@ -60,6 +59,19 @@ export function AddType1(num1, num2, num3, num4) {
} }
}) })
} }
export function AddType2(num1, num2, num3) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '2',
name: '车间生产管理工艺_外协付款_新增付款',
param: '外协厂家流水号=' + num1 + '&付款金额=' + num2 + '&付款日期=' + num3
}
})
}
// 编辑 // 编辑
export function handlechange(num, num2, num3, num4, num5, num6, num7, num8) { export function handlechange(num, num2, num3, num4, num5, num6, num7, num8) {
return request({ return request({

View File

@@ -23,12 +23,12 @@
{{ scope.row.开票金额 }} {{ scope.row.开票金额 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="付款金额(元)" align="center"> <el-table-column label="付款金额(元)" align="center" width="130px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.备注 }} {{ scope.row.备注 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="未付金额(元)" align="center"> <el-table-column label="未付金额(元)" align="center" width="130px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.备注 }} {{ scope.row.备注 }}
</template> </template>
@@ -52,21 +52,21 @@
<el-button class="button111" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd1()">新增</el-button> <el-button class="button111" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd1()">新增</el-button>
</el-row> </el-row>
<el-table v-loading="loading2" :data="tableData2" size="mini" stripe height="500" style="width: 100%" border element-loading-text="拼命加载中"> <el-table v-loading="loading2" :data="tableData2" size="mini" stripe height="500" style="width: 100%" border element-loading-text="拼命加载中">
<el-table-column label="发票号" prop="外协厂家名称" align="center" width="230px"> <el-table-column label="发票号" prop="发票号" align="center" width="230px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.外协厂家名称 }} {{ scope.row.发票号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开票金额" prop="总价" align="center" width="200px"> <el-table-column label="开票金额" prop="开票金额" align="center" width="200px">
<template slot-scope="scope">
{{ scope.row.总价 }}
</template>
</el-table-column>
<el-table-column label="开票时间" align="center" width="130px" prop="开票金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.开票金额 }} {{ scope.row.开票金额 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开票时间" align="center" width="130px" prop="开票日期">
<template slot-scope="scope">
{{ scope.row.开票时间 }}
</template>
</el-table-column>
</el-table> </el-table>
<div class="block"> <div class="block">
<el-pagination <el-pagination
@@ -86,14 +86,14 @@
<el-button class="button111" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd2()">新增</el-button> <el-button class="button111" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd2()">新增</el-button>
</el-row> </el-row>
<el-table v-loading="loading3" :data="tableData3" size="mini" stripe height="500" style="width: 100%" border element-loading-text="拼命加载中"> <el-table v-loading="loading3" :data="tableData3" size="mini" stripe height="500" style="width: 100%" border element-loading-text="拼命加载中">
<el-table-column label="付款金额" prop="外协厂家名称" align="center" width="230px"> <el-table-column label="付款金额" prop="付款金额" align="center" width="230px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.外协厂家名称 }} {{ scope.row.付款金额 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="付款时间" prop="总价" align="center" width="200px"> <el-table-column label="付款日期" prop="总价" align="center" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.总价 }} {{ scope.row.付款日期 }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -142,16 +142,44 @@
<el-button type="primary" @click="submit1('form1')" >确定</el-button> <el-button type="primary" @click="submit1('form1')" >确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" title="新增付款" center style="min-height: 300px" width="400px">
<el-form ref="form2" :model="form2" :rules="rules" label-position="left" label-width="100px" class="demo-ruleForm">
<el-row>
<el-form-item label="付款金额" prop="付款金额">
<el-input v-model="form2.付款金额" placeholder="开票金额" style="width:200px" clearable size="small"/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="付款时间" prop="付款时间">
<el-date-picker
v-model="form2.付款时间"
style="width:200px"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
clearable
placeholder="付款时间"/>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff2('form2')">取消</el-button>
<el-button type="primary" @click="submit2('form2')" >确定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { searchtable, getInvoice, getPayment, AddType1, handlechange, handledelete } from '@/api/Outsourcing/OutsourcingPaymentPlanManagement' import { searchtable, getInvoice, getPayment, AddType1, AddType2, handlechange, handledelete } from '@/api/Outsourcing/OutsourcingPaymentPlanManagement'
export default { export default {
data() { data() {
return { return {
ManufacturerName: '', // 外协厂家 ManufacturerName: '', // 外协厂家
外协厂家流水号: '', 外协厂家流水号: '',
外协厂家流水号_Select: '',
loading: false, loading: false,
tableData: [], // 表格数据 tableData: [], // 表格数据
total: null, // 总条数 total: null, // 总条数
@@ -167,13 +195,26 @@ export default {
total3: null, // 总条数 total3: null, // 总条数
pageSize3: 50, // 每页显示条数 pageSize3: 50, // 每页显示条数
pageCurrent3: 1, // 后台获取页 pageCurrent3: 1, // 后台获取页
param1: 0,
dialogFormVisible1: false, dialogFormVisible1: false,
form1: { form1: {
发票号: '', 发票号: '',
开票时间: '', 开票时间: '',
开票金额: '' 开票金额: ''
}, },
rules: {} param2: 0,
dialogFormVisible2: false,
form2: {
付款金额: '',
付款时间: ''
},
rules: {
发票号: [{ required: true, message: '请输入发票号', trigger: 'blur' }],
开票时间: [{ required: true, message: '请选择开票时间', trigger: 'change' }],
开票金额: [{ required: true, message: '请输入开票金额', trigger: 'blur' }],
付款时间: [{ required: true, message: '请选择开票时间', trigger: 'change' }],
付款金额: [{ required: true, message: '请输入开票金额', trigger: 'blur' }]
}
} }
}, },
created() { created() {
@@ -182,13 +223,13 @@ export default {
methods: { methods: {
// 获取表格1数据 // 获取表格1数据
getParts() { getParts() {
this.外协厂家流水号 = ''
this.loading = true this.loading = true
this.tableData = [] this.tableData = []
var check var check
var check2 = 0 var check2 = 0
this.ManufacturerName ? check = 1 : check = 0 this.ManufacturerName ? check = 1 : check = 0
searchtable(check, this.ManufacturerName, check2, '', '', this.pageCurrent, this.pageSize).then(response => { searchtable(check, this.ManufacturerName, check2, '', '', this.pageCurrent, this.pageSize).then(response => {
console.log(response.data)
this.loading = false this.loading = false
if (response.data.rows.length !== 0) { if (response.data.rows.length !== 0) {
this.tableData = response.data.rows this.tableData = response.data.rows
@@ -198,20 +239,19 @@ export default {
}, },
rowClick(row) { rowClick(row) {
this.外协厂家流水号 = row.外协厂家流水号 this.外协厂家流水号 = row.外协厂家流水号
this.外协厂家流水号_Select = row.外协厂家流水号
this.loading2 = true this.loading2 = true
this.tableData2 = [] this.tableData2 = []
this.loading3 = true this.loading3 = true
this.tableData3 = [] this.tableData3 = []
getInvoice(row.外协厂家流水号, this.pageCurrent2, this.pageSize2).then(response => { getInvoice(row.外协厂家流水号, this.pageCurrent2, this.pageSize2).then(response => {
console.log(response.data, 2)
this.loading2 = false this.loading2 = false
if (response.data.rows.length !== 0) { if (response.data.rows.length !== 0) {
this.tableData2 = response.data.rows this.tableData2 = response.data.rows
this.total2 = response.data.total this.total2 = response.data.total
} }
}) })
getPayment(this.外协厂家流水号, this.pageCurrent2, this.pageSize2).then(response => { getPayment(row.外协厂家流水号, this.pageCurrent2, this.pageSize2).then(response => {
console.log(response.data, 3)
this.loading3 = false this.loading3 = false
if (response.data.rows.length !== 0) { if (response.data.rows.length !== 0) {
this.tableData3 = response.data.rows this.tableData3 = response.data.rows
@@ -220,11 +260,10 @@ export default {
}) })
}, },
// 发票 // 发票
getInvoice(row) { getInvoice() {
this.loading2 = true this.loading2 = true
this.tableData2 = [] this.tableData2 = []
getInvoice(this.外协厂家流水号, this.pageCurrent2, this.pageSize2).then(response => { getInvoice(this.外协厂家流水号_Select, this.pageCurrent2, this.pageSize2).then(response => {
console.log(response.data, 2)
this.loading2 = false this.loading2 = false
if (response.data.rows.length !== 0) { if (response.data.rows.length !== 0) {
this.tableData2 = response.data.rows this.tableData2 = response.data.rows
@@ -233,11 +272,10 @@ export default {
}) })
}, },
// 付款 // 付款
getPayment(row) { getPayment() {
this.loading3 = true this.loading3 = true
this.tableData3 = [] this.tableData3 = []
getPayment(this.外协厂家流水号, this.pageCurrent2, this.pageSize2).then(response => { getPayment(this.外协厂家流水号_Select, this.pageCurrent2, this.pageSize2).then(response => {
console.log(response.data, 3)
this.loading3 = false this.loading3 = false
if (response.data.rows.length !== 0) { if (response.data.rows.length !== 0) {
this.tableData3 = response.data.rows this.tableData3 = response.data.rows
@@ -247,22 +285,25 @@ export default {
}, },
// 点击增加 // 点击增加
handleAdd1(formName) { handleAdd1(formName) {
this.form1.发票号 = '' if (this.外协厂家流水号) {
this.form1.开票时间 = '' this.param1 = 1
this.form1.开票金额 = '' this.form1.发票号 = ''
this.form1.外协厂家 = '' this.form1.开票时间 = ''
this.dialogFormVisible1 = true this.form1.开票金额 = ''
this.form1.外协厂家 = ''
this.dialogFormVisible1 = true
} else {
this.$message.error('请先选择外协厂家')
}
}, },
// 增加确定 // 增加确定
AddType1() { AddType1() {
AddType1(this.外协厂家流水号, this.form.发票号, this.form.开票时间, this.form.开票金额, this.form.外协厂家).then(response => { AddType1(this.外协厂家流水号, this.form1.发票号, this.form1.开票时间, this.form1.开票金额).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$notify({ this.$message.success('信息增加成功')
title: '成功',
message: '信息增加成功',
type: 'success'
})
this.getParts() this.getParts()
this.getInvoice()
this.getPayment()
} else { } else {
this.$message.error('信息增加失败') this.$message.error('信息增加失败')
} }
@@ -270,7 +311,8 @@ export default {
this.dialogFormVisible1 = false this.dialogFormVisible1 = false
}, },
// 编辑打开 // 编辑打开
handleChange1(index, row, formName) { ChangeOpen1(index, row, formName) {
this.param1 = 0
this.form1.外协厂家 = row.外协厂家流水号 this.form1.外协厂家 = row.外协厂家流水号
this.form1.发票号 = row.发票号 this.form1.发票号 = row.发票号
this.form1.开户行 = row.开户行 this.form1.开户行 = row.开户行
@@ -282,7 +324,7 @@ export default {
this.dialogFormVisible1 = true this.dialogFormVisible1 = true
}, },
// 编辑确定 // 编辑确定
handleChange() { handleChange1() {
handlechange(this.CoManufacturerFlowNumber1, this.form.发票号, this.form.开户行, this.form.开票时间, this.form.开票金额, this.form.接收人, this.form.接收时间, this.form.备注).then(response => { handlechange(this.CoManufacturerFlowNumber1, this.form.发票号, this.form.开户行, this.form.开票时间, this.form.开票金额, this.form.接收人, this.form.接收时间, this.form.备注).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$notify({ this.$notify({
@@ -298,13 +340,13 @@ export default {
this.dialogFormVisible1 = false this.dialogFormVisible1 = false
}, },
// 提交添加或者修改 // 提交添加或者修改
submit(formName) { submit1(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
if (this.param === 0) { if (this.param1 === 0) {
this.editType() this.handleChange1()
} else { } else {
this.handleChange() this.AddType1()
} }
} else { } else {
return false return false
@@ -312,7 +354,7 @@ export default {
}) })
}, },
// 重置表单 // 重置表单
callOff(formName) { callOff1(formName) {
this.dialogFormVisible1 = false this.dialogFormVisible1 = false
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
}, },
@@ -345,6 +387,46 @@ export default {
}) })
}) })
}, },
handleAdd2(formName) {
if (this.外协厂家流水号) {
this.param2 = 1
this.form2.付款时间 = ''
this.form2.付款金额 = ''
this.dialogFormVisible2 = true
} else {
this.$message.error('请先选择外协厂家')
}
},
AddType2() {
AddType2(this.外协厂家流水号, this.form2.付款金额, this.form2.付款时间).then(response => {
if (response.data[0].result === '1') {
this.$message.success('信息增加成功')
this.getParts()
this.getInvoice()
this.getPayment()
} else {
this.$message.error('信息增加失败')
}
})
this.dialogFormVisible2 = false
},
submit2(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.param2 === 0) {
this.handleChange2()
} else {
this.AddType2()
}
} else {
return false
}
})
},
callOff2(formName) {
this.dialogFormVisible2 = false
this.$refs[formName].resetFields()
},
// 分页 // 分页
handleSizeChange(val) { handleSizeChange(val) {
this.pageCurrent = 1 this.pageCurrent = 1

View File

@@ -39,7 +39,7 @@
</el-table-column> </el-table-column>
<el-table-column label="数量" align="center" width="60px"> <el-table-column label="数量" align="center" width="60px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.批次数量 }} {{ scope.row.投产数量 }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -84,7 +84,7 @@
{{ scope.row.计划日期 }} {{ scope.row.计划日期 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工序工时" align="center" width="85px"> <el-table-column label="计划工时" align="center" width="85px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.工序工时 }} {{ scope.row.工序工时 }}
</template> </template>
@@ -327,7 +327,7 @@ export default {
background: #9bd7fc !important; background: #9bd7fc !important;
} }
.XJWXywc{ .XJWXywc{
background: #AEF199 !important; background: rgb(103,194,58) !important;
} }
</style> </style>