外协付款计划

This commit is contained in:
zhangdingyu
2019-02-14 10:23:32 +08:00
parent 5d18312720
commit 2905d92502
3 changed files with 644 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
import request from '@/utils/request'
// 初始化 外协厂商
export function initOutHelp() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_基础表_外协厂家_查询数据'
}
})
}
// 查询表格数据
export function searchtable(check, num, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_零件工艺计划_序间外协付款查询',
param: '外协厂家流水号_check=' + check + '&外协厂家流水号=' + num,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询发票信息
export function getParts(Number, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_外协发票管理_查询数据',
param: '外协加工任务单流水号=' + Number + '=int',
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 增加
export function edittype(num1, num2, num3, num4, num5, num6, num7, num8) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_外协发票管理_增加数据',
param: '外协加工任务单流水号=' + num1 + '&发票号=' + num2 + '&开户行=' + num3 + '&开票时间=' + num4 + '&开票金额=' + num5 + '&接收人=' + num6 + '&接收时间=' + num7 + '&备注=' + num8
}
})
}
// 编辑
export function handlechange(num, num2, num3, num4, num5, num6, num7, num8) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_外协发票管理_编辑数据',
param: 'id=' + num + '&发票号=' + num2 + '&开户行=' + num3 + '&开票时间=' + num4 + '&开票金额=' + num5 + '&接收人=' + num6 + '&接收时间=' + num7 + '&备注=' + num8
}
})
}
// 删除
export function handledelete(num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_外协发票管理_删除数据',
param: 'id=' + num
}
})
}
// 外协付款
export function outPay(num1, num2, num3, num4) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_外协付款计划_增加数据',
param: '外协厂家流水号=' + num1 + '&付款金额=' + num2 + '&付款日期=' + num3 + '&备注=' + num4
}
})
}

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543302138984" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1877" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M762.503311 141.113925c-14.285355-9.653871-33.714869-5.90243-43.363623 8.393157-9.658987 14.295588-5.907547 33.709753 8.388041 43.367717 106.359376 71.861678 169.863712 191.280488 169.863712 319.443449 0 212.412784-172.811858 385.220548-385.220548 385.220548S126.956484 724.732056 126.956484 512.318248c0-128.168078 63.49922-247.586888 169.858596-319.443449 14.295588-9.658987 18.057261-29.073152 8.398274-43.363623-9.648754-14.295588-29.073152-18.052145-43.363623-8.398274C138.267087 224.602408 64.488757 363.373984 64.488757 512.318248c0 246.854201 200.827935 447.687252 447.682136 447.687252S959.859167 759.173472 959.859167 512.318248C959.859167 363.373984 886.075721 224.607524 762.503311 141.113925z" p-id="1878"></path><path d="M400.698055 64.636113c-17.248849 0-31.233352 13.984503-31.233352 31.233352l0 30.470989c0 17.248849 13.985526 31.233352 31.233352 31.233352 17.248849 0 31.233352-13.985526 31.233352-31.233352L431.931407 95.869465C431.931407 78.621639 417.946904 64.636113 400.698055 64.636113z" p-id="1879"></path><path d="M623.649869 64.636113c-17.248849 0-31.233352 13.984503-31.233352 31.233352l0 30.470989c0 17.248849 13.985526 31.233352 31.233352 31.233352 17.248849 0 31.233352-13.985526 31.233352-31.233352L654.883221 95.869465C654.883221 78.621639 640.897695 64.636113 623.649869 64.636113z" p-id="1880"></path><path d="M425.695379 227.656977c11.209296 18.047028 41.974997 48.588625 86.157265 48.588625 43.958164 0 75.100442-30.3134 86.573751-48.223305 9.302877-14.528901 5.068436-33.846876-9.455349-43.149752-14.544251-9.29776-33.846876-5.063319-43.149752 9.455349-0.121773 0.198521-13.379729 19.449981-33.968649 19.449981-20.008706 0-32.443923-18.127869-33.276894-19.373233-9.165754-14.427594-28.285207-18.799158-42.829458-9.760295C421.089477 193.749726 416.59 213.006302 425.695379 227.656977z" p-id="1881"></path><path d="M356.00311 591.05859c-17.248849 0-31.233352 13.984503-31.233352 31.233352s13.984503 31.233352 31.233352 31.233352L480.93754 653.525294l0 98.250698c0 17.248849 13.984503 31.238468 31.233352 31.238468 17.248849 0 31.233352-13.989619 31.233352-31.238468l0-98.250698 124.93443 0c17.248849 0 31.238468-13.984503 31.238468-31.233352s-13.989619-31.233352-31.238468-31.233352L543.405267 591.05859l0-83.289961 124.93443 0c17.248849 0 31.238468-13.985526 31.238468-31.233352 0-17.248849-13.989619-31.233352-31.238468-31.233352l-80.761372 0 68.041676-68.038606c12.20088-12.20088 12.20088-31.976272 0.005117-44.171012-12.195763-12.20088-31.976272-12.195763-44.171012-0.005117l-99.280144 99.276051-99.280144-99.276051c-12.190647-12.190647-31.971156-12.195763-44.171012 0.005117-12.195763 12.195763-12.195763 31.971156 0.005117 44.171012l68.041676 68.038606-80.766488 0c-17.248849 0-31.233352 13.984503-31.233352 31.233352 0 17.248849 13.984503 31.233352 31.233352 31.233352L480.93754 507.768629l0 83.289961L356.00311 591.05859z" p-id="1882"></path></svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,556 @@
<template>
<div class="app-container">
<el-card>
<span>外协厂家:</span>
<el-select v-model="ManufacturerNameValue" placeholder="选择外协厂家" filterable clearable size="small" style="width:190px;margin:10px;">
<el-option
v-for="item in ManufacturerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" class="el-icon-search" size="small" @click="pageCurrent=1;pageSize=10;total=null;pageCurrent2=1;pageSize2=10;total2=null;searchTable()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border highlight-current-row element-loading-text="拼命加载中" @row-click="getParts">
<el-table-column
label=" "
type="index"
align="center"
width="50"/>
<el-table-column label="外协厂家" align="center" width="280px">
<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" width="300px" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
class="el-icon-check"
@click="editType1(scope.row, 'form');param = 0">到票</el-button>
<el-button
size="mini"
type="success"
class="el-icon-check"
@click="payment(scope.row, 'form2');param2 = 0">付款</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
v-if="!loading"
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card>
<el-table v-loading="loading2" :data="tableData2" :summary-method="getSummaries" height="370" show-summary style="width: 100%;" border element-loading-text="拼命加载中">
<el-table-column label="发票号" align="center" width="230px">
<template slot-scope="scope">
{{ scope.row.发票号 }}
</template>
</el-table-column>
<el-table-column label="接收人" align="center" width="180px">
<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" width="150px" prop="开票金额">
<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">
{{ 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" 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>
<div class="block">
<el-pagination
v-if="!loading2"
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
<el-dialog :title="title1" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="700px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="90px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="发票号" prop="发票号">
<el-input v-model="form.发票号" placeholder="发票号" style="width:200px" clearable size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开票金额" prop="开票金额">
<el-input v-model="form.开票金额" placeholder="开票金额" style="width:200px" clearable size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="开票时间" prop="开票时间">
<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-col>
<el-col :span="12">
<el-form-item label="开户行" prop="开户行">
<el-input v-model="form.开户行" placeholder="开户行" style="width:200px" clearable size="small" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="接收人" prop="接收人">
<el-input v-model="form.接收人" placeholder="接收人" style="width:200px" clearable size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="接收时间" prop="接收时间">
<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-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="备注">
<el-input v-model="form.备注" :rows="2" placeholder="备注" type="textarea" style="width:527px" clearable size="small"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="submit('form')" >确定</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible2" title="付款" center style="min-height: 300px" width="500px">
<el-form ref="form2" :model="form2" :rules="rules" label-position="left" label-width="90px" class="demo-ruleForm">
<el-form-item label="付款金额" prop="付款金额" style="margin-left: 80px">
<el-input v-model="form2.付款金额" placeholder="付款金额" size="small" style="width:200px"/>
</el-form-item>
<el-form-item label="备注" prop="备注" style="margin-left: 80px">
<el-input :autosize="{ minRows: 2, maxRows: 4}" v-model="form2.备注" type="textarea" placeholder="备注" size="small" style="width:200px"/>
</el-form-item>
</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>
</template>
<script>
import { initOutHelp, searchtable, getParts, edittype, handlechange, handledelete, outPay } from '@/api/Outsourcing/OutsourcingPaymentPlanManagement2'
export default {
data() {
return {
factury: '',
fukuanshijian: '',
title1: '',
dialogFormVisible: false,
renwudan: '',
count1: 0,
count2: 0,
count3: 0,
form: {
发票号: '',
开户行: '',
开票时间: '',
开票金额: '',
接收人: '',
接收时间: '',
备注: ''
},
实际付款时间: '',
loading: false,
loading2: false,
zhongjianbianliang: '',
dialogFormVisible2: false,
form2: {
付款金额: '',
备注: ''
},
rules: {
发票号: [{ required: true, message: '请输入发票号', trigger: 'blur' }],
开票金额: [{ required: true, message: '请输入开票金额', trigger: 'blur' }],
扣款说明: [{ required: true, message: '请输入扣款说明', trigger: 'blur' }],
付款金额: [{ required: true, message: '请输入扣款说明', trigger: 'blur' }]
},
date1: '',
date2: '',
date3: '',
date4: '',
FormNumber: '',
ManufacturerNameValue: '',
ManufacturerName: [], // 厂家名称
FormNumber_check: false,
ManufacturerNameValue_check: false,
date1_check: false,
date3_check: false,
tableData: [], // 表格数据
total: null, // 总条数
pageSize: 10, // 每页显示条数
pageCurrent: 1, // 后台获取页
tableData2: [], // 表格数据
total2: null, // 总条数
pageSize2: 10, // 每页显示条数
pageCurrent2: 1 // 后台获取页
}
},
created() {
this.fetchData()
this.searchTable()
},
methods: {
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总金额'
return
}
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ' 元'
} else {
sums[index] = ''
}
})
return sums
},
// 初始化外协厂家
fetchData() {
this.ManufacturerName = []
initOutHelp().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.ManufacturerName.push({
label: response.data[i].外协厂家名称,
value: response.data[i].外协厂家流水号
})
}
})
},
// 查询表格数据
searchTable() {
this.loading = true
if (this.ManufacturerNameValue === '' || this.ManufacturerNameValue === null) {
this.ManufacturerNameValue_check = 0
} else {
this.ManufacturerNameValue_check = 1
}
this.tableData = []
this.tableData2 = []
searchtable(this.ManufacturerNameValue_check, this.ManufacturerNameValue, this.pageCurrent, this.pageSize).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
}).then(() => {
this.loading = false
})
},
payment(row, formName) {
this.count3 = this.count3 + 1
if (this.count3 !== 1) {
this.$refs[formName].resetFields()
}
this.factury = row.外协厂家流水号
var time = new Date()
var month = time.getMonth() + 1
var day = time.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (day >= 1 && day <= 9) {
day = '0' + day
}
this.payDate = time.getFullYear() + '/' + month + '/' + day
this.form2.付款金额 = ''
this.form2.备注 = ''
this.dialogFormVisible2 = true
},
outPay() {
outPay(this.factury, this.form2.付款金额, this.payDate, this.form2.备注).then(response => {
if (response.data[0].result === '1') {
this.$notify({
title: '成功',
message: '信息增加成功',
type: 'success'
})
this.searchTable()
} else {
this.$message.error('信息增加失败')
}
})
},
submit2(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.param2 === 0) {
this.outPay()
this.dialogFormVisible2 = false
} else {
this.handleChange()
}
} else {
return false
}
})
},
// 获取表格2数据
getParts(row) {
this.loading2 = true
this.tableData2 = []
this.zhongjianbianliang = row.外协加工任务单流水号
this.fukuanshijian = row.实际付款时间
getParts(row.外协加工任务单流水号, 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.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.total2 = response.data.total
}).then(() => {
this.loading2 = false
})
},
// 增加发票
editType1(row, formName) {
this.count1 = this.count1 + 1
if (this.count1 !== 1) {
this.$refs[formName].resetFields()
}
this.title1 = '增加'
this.renwudan = row.外协加工任务单流水号
this.form.发票号 = ''
this.form.开户行 = ''
this.form.开票时间 = ''
this.form.开票金额 = ''
this.form.接收人 = ''
this.form.接收时间 = ''
this.form.备注 = ''
this.dialogFormVisible = true
},
// 增加确定
editType() {
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') {
this.$notify({
title: '成功',
message: '信息增加成功',
type: 'success'
})
this.getParts2()
} else {
this.$message.error('信息增加失败')
}
})
this.dialogFormVisible = false
},
// 编辑发票
handleChange1(index, row, formName) {
this.count2 = this.count2 + 1
if (this.count2 !== 1) {
this.$refs[formName].resetFields()
}
this.form.发票号 = row.发票号
this.form.开户行 = row.开户行
this.form.开票时间 = row.开票时间
this.form.开票金额 = row.开票金额
this.form.接收人 = row.接收人
this.form.接收时间 = row.接收时间
this.form.备注 = row.备注
this.dialogFormVisible = true
this.title1 = '编辑'
this.CoManufacturerFlowNumber1 = row.id
},
// 编辑确定
handleChange() {
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') {
this.$notify({
title: '成功',
message: '信息修改成功',
type: 'success'
})
this.getParts2()
} else {
this.$message.error('信息修改失败')
}
})
this.dialogFormVisible = false
},
// 提交添加或者修改
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.param === 0) {
this.editType()
} else {
this.handleChange()
}
} else {
return false
}
})
},
// 重置表单
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 删除
handleDelete(index, row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
handledelete(row.id).then(response => {
if (this.tableData2 && this.tableData2.length === 1 && this.pageCurrent2 > 1) {
this.pageCurrent2--
}
if (response.data[0].result === '1') {
this.$notify({
title: '成功',
message: '信息删除成功',
type: 'success'
})
this.getParts2()
} else {
this.$message.error('信息删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
},
handleSizeChange2(val) {
this.pageCurrent2 = 1
this.pageSize2 = val
this.getParts2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.tableData2 = []
this.getParts2()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 10px;
}
.el-table .fukuan {
background: #AEF199;
}
</style>