This commit is contained in:
chenjianan
2018-12-22 15:31:31 +08:00
2 changed files with 133 additions and 67 deletions

View File

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