外协付款计划

This commit is contained in:
zhangdingyu
2018-12-22 12:00:05 +08:00
parent e3dd21418f
commit fa1d85c3ef
3 changed files with 134 additions and 68 deletions

View File

@@ -20,7 +20,7 @@
"html2canvas": "^1.0.0-alpha.12", "html2canvas": "^1.0.0-alpha.12",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"jspdf": "^1.4.1", "jspdf": "^1.5.2",
"node-sass": "^4.10.0", "node-sass": "^4.10.0",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",

View File

@@ -74,38 +74,38 @@ export function getParts(Number, pageCurrent, pageSize) {
}) })
} }
// 增加 // 增加
export function edittype(num1, num2, num3, num4, num5, num6, num7) { export function edittype(num1, num2, num3, num4, num5, num6, num7, num8) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '车间生产管理工艺_外协发票管理_增加数据', name: '车间生产管理工艺_外协发票管理_增加数据',
param: '外协加工任务单流水号=' + num1 + '&发票号=' + num2 + '&开户行=' + num3 + '&开票时间=' + num4 + '&开票金额=' + num5 + '&接收人=' + num6 + '&接收时间=' + num7 param: '外协加工任务单流水号=' + num1 + '&发票号=' + num2 + '&开户行=' + num3 + '&开票时间=' + num4 + '&开票金额=' + num5 + '&接收人=' + num6 + '&接收时间=' + num7 + '&备注=' + num8
} }
}) })
} }
// 编辑 // 编辑
export function handlechange(CoManufacturerFlowNumber, ManufacturerNumber, ManufacturerName, ManufacturerAbbreviation, address, roleName, phNumber, Fax, Remarks, category, attention, EquipmentCondition) { export function handlechange(num, num2, num3, num4, num5, num6, num7, num8) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '车间生产管理工艺_基础表_外协厂家_修改数据', name: '车间生产管理工艺_外协发票管理_编辑数据',
param: '外协厂家流水号=' + CoManufacturerFlowNumber + '&号=' + ManufacturerNumber + '&外协厂家名称=' + ManufacturerName + '&外协厂家简称=' + ManufacturerAbbreviation + '&地址=' + address + '&联系人=' + roleName + '&电话=' + phNumber + '&传真=' + Fax + '&备注=' + Remarks + '&类别=' + category + '&关注=' + attention + '&设备情况=' + EquipmentCondition param: 'id=' + num + '&发票号=' + num2 + '&开户行=' + num3 + '&开票时间=' + num4 + '&开票金额=' + num5 + '&接收人=' + num6 + '&接收时间=' + num7 + '&备注=' + num8
} }
}) })
} }
// 删除 // 删除
export function handledelete(CoManufacturerFlowNumber) { export function handledelete(num) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '2', type: '2',
name: '车间生产管理工艺_基础表_外协厂家_删除数据', name: '车间生产管理工艺_外协发票管理_删除数据',
param: '外协厂家流水号=' + CoManufacturerFlowNumber + '=int' param: 'id=' + num
} }
}) })
} }

View File

@@ -170,14 +170,20 @@
{{ scope.row.扣款说明 }} {{ scope.row.扣款说明 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="200px" fixed="right"> <el-table-column label="操作" align="center" width="300px" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
:disabled="scope.row.实际付款时间!==''"
size="mini"
type="primary"
class="el-icon-check"
@click="editType1(scope.row, 'form');param = 0">到票</el-button>
<el-button <el-button
:disabled="scope.row.实际付款时间!==''" :disabled="scope.row.实际付款时间!==''"
size="mini" size="mini"
type="primary" type="primary"
class="el-icon-edit" class="el-icon-edit"
@click="Withdrawing(scope.$index, scope.row, 'form')">扣款</el-button> @click="Withdrawing(scope.$index, scope.row, 'form2')">扣款</el-button>
<el-button <el-button
:disabled="scope.row.实际付款时间!==''||scope.row.单据状态!=='3'" :disabled="scope.row.实际付款时间!==''||scope.row.单据状态!=='3'"
size="mini" size="mini"
@@ -212,12 +218,12 @@
{{ scope.row.发票号 }} {{ scope.row.发票号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开票金额" align="center" width="230px"> <el-table-column label="开票金额" align="center" width="150px">
<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="220px"> <el-table-column label="接收人" align="center" width="180px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.接收人 }} {{ scope.row.接收人 }}
</template> </template>
@@ -227,16 +233,37 @@
{{ scope.row.开户行 }} {{ scope.row.开户行 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开票时间" align="center" width="180px"> <el-table-column label="开票日期" align="center">
<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="180px"> <el-table-column label="接收日期" align="center">
<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">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200px" fixed="right">
<template slot-scope="scope">
<el-button
:disabled="fukuanshijian!==''"
size="mini"
type="primary"
class="el-icon-edit"
@click="handleChange1(scope.$index, scope.row, 'form');param = 1">编辑</el-button>
<el-button
:disabled="fukuanshijian!==''"
size="mini"
type="danger"
class="el-icon-delete"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<div class="block"> <div class="block">
<el-pagination <el-pagination
@@ -276,49 +303,60 @@
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="90px" class="demo-ruleForm"> <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="90px" class="demo-ruleForm">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="厂家名称" prop="ManufacturerName" > <el-form-item label="发票号" prop="发票号" >
<el-input v-model="form.ManufacturerName" placeholder="厂家名称" clearable size="small"/> <el-input v-model="form.发票号" placeholder="发票号" style="width:200px" clearable size="small"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="厂家简称" prop="ManufacturerAbbreviation"> <el-form-item label="开票金额" prop="开票金额">
<el-input v-model="form.ManufacturerAbbreviation" placeholder="厂家简称" clearable size="small" /> <el-input v-model="form.开票金额" placeholder="开票金额" style="width:200px" clearable size="small"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="地址" prop="address"> <el-form-item label="开票时间" prop="开票时间">
<el-input v-model="form.address" placeholder="地址" clearable size="small" /> <el-date-picker
v-model="form.开票时间"
style="width:200px"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
clearable
placeholder="开票时间"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="联系人" prop="roleName"> <el-form-item label="开户行" prop="开户行">
<el-input v-model="form.roleName" placeholder="联系人" clearable size="small"/> <el-input v-model="form.开户行" placeholder="开户行" style="width:200px" clearable size="small" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="电话" prop="phNumber"> <el-form-item label="接收人" prop="接收人">
<el-input v-model="form.phNumber" placeholder="电话" clearable size="small"/> <el-input v-model="form.接收人" placeholder="接收人" style="width:200px" clearable size="small"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="传真" prop="Fax"> <el-form-item label="接收时间" prop="接收时间">
<el-input v-model="form.Fax" placeholder="传真" clearable size="small"/> <el-date-picker
v-model="form.接收时间"
style="width:200px"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
clearable
placeholder="接收时间"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="24">
<el-form-item label="设备情况" prop="EquipmentCondition"> <el-form-item label="备注" prop="备注">
<el-input v-model="form.EquipmentCondition" placeholder="设备情况" clearable size="small"/> <el-input v-model="form.备注" :rows="2" placeholder="备注" type="textarea" style="width:527px" clearable size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="Remarks">
<el-input v-model="form.Remarks" placeholder="备注" clearable size="small" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -336,10 +374,21 @@ import { initOutHelp, searchtable, payTime, WithdrawingEdit, getParts, edittype,
export default { export default {
data() { data() {
return { return {
fukuanshijian: '',
title1: '', title1: '',
dialogFormVisible: false, dialogFormVisible: false,
renwudan: '',
count1: 0, count1: 0,
form: {}, count2: 0,
form: {
发票号: '',
开户行: '',
开票时间: '',
开票金额: '',
接收人: '',
接收时间: '',
备注: ''
},
实际付款时间: '', 实际付款时间: '',
loading: false, loading: false,
loading2: false, loading2: false,
@@ -352,6 +401,8 @@ export default {
扣款说明: '' 扣款说明: ''
}, },
rules: { rules: {
发票号: [{ required: true, message: '请输入发票号', trigger: 'blur' }],
开票金额: [{ required: true, message: '请输入开票金额', trigger: 'blur' }],
扣款说明: [{ required: true, message: '请输入扣款说明', trigger: 'blur' }] 扣款说明: [{ required: true, message: '请输入扣款说明', trigger: 'blur' }]
}, },
date1: '', date1: '',
@@ -501,8 +552,26 @@ export default {
this.loading2 = true this.loading2 = true
this.tableData2 = [] this.tableData2 = []
this.zhongjianbianliang = row.外协加工任务单流水号 this.zhongjianbianliang = row.外协加工任务单流水号
this.fukuanshijian = row.实际付款时间
getParts(row.外协加工任务单流水号, this.pageCurrent2, this.pageSize2).then(response => { getParts(row.外协加工任务单流水号, this.pageCurrent2, this.pageSize2).then(response => {
console.log(response.data) for (let i = 0; i < response.data.rows.length; i++) {
response.data.rows[i].开票时间 = response.data.rows[i].开票时间.substring(0, response.data.rows[i].开票时间.indexOf(' '))
response.data.rows[i].接收时间 = response.data.rows[i].接收时间.substring(0, response.data.rows[i].接收时间.indexOf(' '))
}
this.tableData2 = response.data.rows
this.total2 = response.data.total
}).then(() => {
this.loading2 = false
})
},
getParts2() {
this.loading2 = true
this.tableData2 = []
getParts(this.zhongjianbianliang, this.pageCurrent2, this.pageSize2).then(response => {
for (let i = 0; i < response.data.rows.length; i++) {
response.data.rows[i].开票时间 = response.data.rows[i].开票时间.substring(0, response.data.rows[i].开票时间.indexOf(' '))
response.data.rows[i].接收时间 = response.data.rows[i].接收时间.substring(0, response.data.rows[i].接收时间.indexOf(' '))
}
this.tableData2 = response.data.rows this.tableData2 = response.data.rows
this.total2 = response.data.total this.total2 = response.data.total
}).then(() => { }).then(() => {
@@ -510,27 +579,32 @@ export default {
}) })
}, },
// 点击增加 // 点击增加
editType1(formName) { editType1(row, formName) {
this.count1 = this.count1 + 1 this.count1 = this.count1 + 1
if (this.count1 !== 1) { if (this.count1 !== 1) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
} }
this.title1 = '增加' this.title1 = '增加'
this.form.ManufacturerName = '' this.renwudan = row.外协加工任务单流水号
this.form.发票号 = ''
this.form.开户行 = ''
this.form.开票时间 = ''
this.form.开票金额 = ''
this.form.接收人 = ''
this.form.接收时间 = ''
this.form.备注 = ''
this.dialogFormVisible = true this.dialogFormVisible = true
}, },
// 增加确定 // 增加确定
editType() { editType() {
edittype(this.form.ManufacturerNumber, this.form.ManufacturerName, this.form.ManufacturerAbbreviation, this.form.address, this.form.roleName, this.form.phNumber, this.form.Fax, this.form.Remarks, this.form.category, this.form.attention, this.form.EquipmentCondition).then(response => { edittype(this.renwudan, 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({
title: '成功', title: '成功',
message: '信息增加成功', message: '信息增加成功',
type: 'success' type: 'success'
}) })
this.pageCurrent = 1 this.getParts2()
this.pageSize = 10
this.searchTable()
} else { } else {
this.$message.error('信息增加失败') this.$message.error('信息增加失败')
} }
@@ -543,31 +617,27 @@ export default {
if (this.count2 !== 1) { if (this.count2 !== 1) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
} }
this.form.ManufacturerNumber = row. this.form.发票号 = row.发票
this.form.ManufacturerName = row.外协厂家名称 this.form.开户行 = row.开户行
this.form.address = row.地址 this.form.开票时间 = row.开票时间
this.form.roleName = row.联系人 this.form.开票金额 = row.开票金额
this.form.phNumber = row.电话 this.form.接收人 = row.接收人
this.form.Fax = row.传真 this.form.接收时间 = row.接收时间
this.form.Remarks = row.备注 this.form.备注 = row.备注
this.form.category = row.类别
this.form.EquipmentCondition = row.设备情况
this.form.ManufacturerAbbreviation = row.外协厂家简称
this.form.attention = row.关注
this.dialogFormVisible = true this.dialogFormVisible = true
this.title1 = '编辑' this.title1 = '编辑'
this.CoManufacturerFlowNumber1 = row.外协厂家流水号 this.CoManufacturerFlowNumber1 = row.id
}, },
// 编辑确定 // 编辑确定
handleChange() { handleChange() {
handlechange(this.CoManufacturerFlowNumber1, this.form.ManufacturerNumber, this.form.ManufacturerName, this.form.ManufacturerAbbreviation, this.form.address, this.form.roleName, this.form.phNumber, this.form.Fax, this.form.Remarks, this.form.category, this.form.attention, this.form.EquipmentCondition).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({
title: '成功', title: '成功',
message: '信息修改成功', message: '信息修改成功',
type: 'success' type: 'success'
}) })
this.searchTable() this.getParts2()
} else { } else {
this.$message.error('信息修改失败') this.$message.error('信息修改失败')
} }
@@ -600,14 +670,17 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
handledelete(row.外协厂家流水号).then(response => { handledelete(row.id).then(response => {
if (this.tableData2 && this.tableData2.length === 1 && this.pageCurrent2 > 1) {
this.pageCurrent2--
}
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: '信息删除成功', message: '信息删除成功',
type: 'success' type: 'success'
}) })
this.searchTable() this.getParts2()
} else { } else {
this.$message.error('信息删除失败') this.$message.error('信息删除失败')
} }
@@ -632,19 +705,12 @@ export default {
handleSizeChange2(val) { handleSizeChange2(val) {
this.pageCurrent2 = 1 this.pageCurrent2 = 1
this.pageSize2 = val this.pageSize2 = val
this.tableData2 = [] this.getParts2()
getParts(this.zhongjianbianliang, this.pageCurrent2, this.pageSize2).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
}, },
handleCurrentChange2(val) { handleCurrentChange2(val) {
this.pageCurrent2 = val this.pageCurrent2 = val
this.tableData2 = [] this.tableData2 = []
getParts(this.zhongjianbianliang, this.pageCurrent2, this.pageSize2).then(response => { this.getParts2()
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
} }
} }
} }