This commit is contained in:
chenjianan
2018-12-13 10:01:51 +08:00
parent 8448e3056c
commit b89bc814c5
2 changed files with 94 additions and 66 deletions

View File

@@ -35,19 +35,6 @@ export function searchInvoice(...params) {
}
})
}
// 发票详情查询
export function searchInvoiceDetail(...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]
}
})
}
// 发票增加(后台调用)
export function addInvoice(...params) {
return request({
@@ -79,8 +66,8 @@ export function deleteInvoice(num1) {
method: 'post',
data: {
type: '2',
name: '采购管理_发票_删除数据',
param: '发票流水号=' + num1
name: '采购管理_采购发票_删除数据',
param: '发票交接流水号=' + num1
}
})
}

View File

@@ -27,6 +27,7 @@
style="margin-left: 10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
<el-button
:disabled="office"
type="primary"
size="small"
icon="el-icon-circle-plus-outline"
@@ -35,7 +36,7 @@
</el-card>
<el-card>
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 400px" height="400px" stripe border @row-click="searchPic">
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 400px" height="400px" stripe border highlight-current-row @row-click="searchPic">
<el-table-column align="center" label="采购合同编号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
@@ -87,14 +88,36 @@
{{ scope.row.接收时间 ? scope.row.接收时间 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="发票号" min-width="120px">
<template slot-scope="scope">
{{ scope.row.发票号 ? scope.row.发票号 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="开户行" min-width="120px">
<template slot-scope="scope">
{{ scope.row.开户行 ? scope.row.开户行 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="开票时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.开票时间 ? scope.row.开票时间 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="合同总额" min-width="100px">
<template slot-scope="scope">
{{ scope.row.合同总额 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="200px">
<template slot-scope="scope">
<el-button
:disabled="!office"
type="primary"
size="mini"
icon="el-icon-edit"
@click="handleEdit(scope.row)">编辑</el-button>
<el-button
:disabled="scope.row.接收人"
type="danger"
size="mini"
icon="el-icon-delete"
@@ -113,28 +136,6 @@
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-table v-loading="" :data="tableData2" size="mini" stripe border>
<el-table-column align="center" label="发票号" min-width="120px">
<template slot-scope="scope">
{{ scope.row.发票号 }}
</template>
</el-table-column>
<el-table-column align="center" label="开户行" min-width="120px">
<template slot-scope="scope">
{{ scope.row.开户行 }}
</template>
</el-table-column>
<el-table-column align="center" label="开票时间" min-width="100px">
<template slot-scope="scope">
{{ scope.row.开票时间 ? scope.row.开票时间 : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="合同总额" min-width="100px">
<template slot-scope="scope">
{{ scope.row.合同总额 }}
</template>
</el-table-column>
</el-table>
<img :src="scanSrc" alt="发票扫描件" width="100%">
</el-card>
@@ -183,8 +184,64 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible1 = false">取消</el-button>
<el-button v-show="title1==='增加'" size="small" type="primary" @click="submitAdd('form1')">确定</el-button>
<el-button v-show="title1==='编辑'" size="small" type="primary" @click="submitEdit('form1')">确定</el-button>
<el-button size="small" type="primary" @click="submitAdd('form1')">确定</el-button>
</div>
</el-dialog>
<el-dialog :title="title1" :visible.sync="dialogVisible2" center style="min-height: 300px" width="1200px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="70px">
<el-row>
<el-col :span="6">
<el-form-item label="合同编号">
<el-select v-model="form1.contractNumValue" placeholder="合同编号" size="small" disabled>
<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>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="开票金额">
<el-input v-model="form1.money" size="small" disabled placeholder="开票金额"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="传送人">
<el-select v-model="form1.sendPersonValue" placeholder="传送人" size="small" disabled>
<el-option
v-for="item in sender"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="接收人">
<el-select v-model="form1.receivePersonValue" placeholder="接收人" size="small" disabled>
<el-option
v-for="item in sender"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="扫描件">
<img :src="scanSrc" alt="发票扫描件" width="1000px">
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible2 = false">取消</el-button>
<el-button size="small" type="primary" @click="submitEdit('form1')">确定</el-button>
</div>
</el-dialog>
</div>
@@ -200,6 +257,7 @@ export default {
name: '', // 采购发票交接
data() {
return {
office: true,
scanSrc: '',
upload: `http://localhost:8411/submit/uploadInvoiceScan.ashx`,
limit: 1,
@@ -212,13 +270,14 @@ export default {
pageSize1: 10,
total1: 0,
tableData1: [],
tableData2: [],
dialogVisible1: false,
dialogVisible2: false, // 办公室
title1: '',
form1: {
contractNumValue: '',
money: '',
sendPersonValue: ''
sendPersonValue: '',
receivePersonValue: ''
},
rules1: {
contractNumValue: [
@@ -314,7 +373,7 @@ export default {
}
})
},
beforeUpload(file) {
beforeUpload(file) { // 上船前检测
const isJPG = /^image\/.*/.test(file.type)
const isLt4M = file.size / 1024 / 1024 < 4
if (!isJPG) {
@@ -339,32 +398,17 @@ export default {
this.$refs['form1'].resetFields()
}
this.title1 = '编辑'
this.dialogVisible1 = true
this.form1.contractNum = parseInt(row.采购合同流水号)
this.form1.invoiceNum = row.发票号
this.form1.invoiceNumValue = row.发票流水号
this.dialogVisible2 = true
this.form1.contractNumValue = parseInt(row.采购合同流水号)
this.form1.invoiceTime = row.开票时间
this.form1.money = row.开票金额
this.form1.sendPersonValue = parseInt(row.传送人)
this.form1.receivePersonValue = parseInt(row.接收人)
this.form1.remark = row.备注
console.log(row.开票时间)
if (row.开票时间 === '1900/1/1') {
this.form1.invoiceTime = null
}
if (parseInt(row.传送人) === 0) {
this.form1.sendPersonValue = ''
}
if (parseInt(row.接收人) === 0) {
this.form1.receivePersonValue = ''
}
this.form1.sendPersonValue = parseInt(row.传送人流水号)
this.form1.receivePersonValue = Number(this.id)
},
submitEdit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
editInvoice(this.form1.invoiceNumValue, this.form1.contractNum, this.form1.invoiceNum, this.form1.invoiceTime, this.form1.money, this.form1.sendPersonValue, this.form1.receivePersonValue, this.form1.remark).then(response => {
console.log(this.form1.invoiceNumValue, this.form1.contractNum, this.form1.invoiceNum, this.form1.invoiceTime, this.form1.money, this.form1.sendPersonValue, this.form1.receivePersonValue, this.form1.remark)
console.log(response.data)
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogVisible1 = false
@@ -378,14 +422,12 @@ export default {
})
},
handleDelete(row) {
console.log(row)
this.$confirm('确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteInvoice(row.发票流水号).then(response => {
console.log(response.data)
deleteInvoice(row.发票交接流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.dialogVisible1 = false
@@ -409,7 +451,6 @@ export default {
}
})
this.scanSrc = 'http://localhost:8411/webpage/file/' + data[0].文件标识 + '.' + data[0].文件后缀
console.log(this.scanSrc)
}
}
}