发票
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询审核/审批/付款
|
||||
// 查询审批/付款
|
||||
export function initApproval(pageCurrent, pageSize, state) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '采购管理_请款表_查询数据_审核审批',
|
||||
param: `审核_审批_付款状态=${state}`,
|
||||
name: '采购管理_请款表_查询数据_审批付款',
|
||||
param: `审批_付款状态=${state}`,
|
||||
Pagination: pageCurrent + '&' + pageSize
|
||||
}
|
||||
})
|
||||
}
|
||||
// 执行审核/审批/付款
|
||||
// 执行审批/付款
|
||||
export function execApproval(num1, num2, reason, person, state) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '采购管理_请款表_修改数据_审核审批',
|
||||
param: `采购科请款流水号=${num1}&审核_审批_付款情况流水号=${num2}&未通过原因=${reason}&操作员编号=${person}&审核_审批_付款状态=${state}`
|
||||
name: '采购管理_请款表_修改数据_审批付款',
|
||||
param: `采购请款流水号=${num1}&审批_付款情况流水号=${num2}&未通过原因=${reason}&操作员编号=${person}&审批_付款状态=${state}`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
98
src/api/PurchasingCenter/PurchaseInvoiceDelivery.js
Normal file
98
src/api/PurchasingCenter/PurchaseInvoiceDelivery.js
Normal file
@@ -0,0 +1,98 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 初始化项目
|
||||
export function initProject() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: 'PDM_项目名称_采购部采购_查询数据'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 初始化合同号
|
||||
export function initContract() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '采购管理_付款情况_查询数据'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 发票查询
|
||||
export function searchInvoice(...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 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({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '采购管理_采购发票_增加数据',
|
||||
param: `采购合同流水号=${params[0]}&开票金额=${params[1]}&传送人流水号=${params[2]}`
|
||||
}
|
||||
})
|
||||
}
|
||||
// 发票编辑
|
||||
export function editInvoice(num1, num2, num3, time1, money, send, receive, remark) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '采购管理_发票_修改数据',
|
||||
param: '发票流水号=' + num1 + '&采购合同流水号=' + num2 + '&发票号=' + num3 + '&开票时间=' + time1 + '&开票金额=' + money + '&传送人=' + send + '&接收人=' + receive + '&备注=' + remark
|
||||
}
|
||||
})
|
||||
}
|
||||
// 发票删除
|
||||
export function deleteInvoice(num1) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '采购管理_发票_删除数据',
|
||||
param: '发票流水号=' + num1
|
||||
}
|
||||
})
|
||||
}
|
||||
// 传送人初始化 采购科改16
|
||||
export function initSender() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
|
||||
param: '考核部门编号=16'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -2,7 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
|
||||
<el-table-column label="采购合同编号" align="center" min-width="150">
|
||||
<el-table-column label="采购合同编号" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同编号 }}
|
||||
</template>
|
||||
@@ -12,39 +12,19 @@
|
||||
{{ scope.row.采购合同名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规定到货时间" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规定到货时间.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" min-width="250">
|
||||
<el-table-column label="供应商" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" align="center" min-width="100">
|
||||
<el-table-column label="请款人" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款方式内容 }}
|
||||
{{ scope.row.请款人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购员" align="center" min-width="70">
|
||||
<el-table-column label="合同总额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="欠款金额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.欠款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已付金额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.已付金额 }}
|
||||
{{ scope.row.合同总额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款金额" align="center" min-width="70">
|
||||
@@ -168,7 +148,8 @@ export default {
|
||||
this.searchTable2()
|
||||
},
|
||||
searchTable1() {
|
||||
initApproval(this.pageCurrent1, this.pageSize1, 2).then(response => {
|
||||
initApproval(this.pageCurrent1, this.pageSize1, 1).then(response => {
|
||||
console.log(response.data)
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
@@ -209,7 +190,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
execApproval(row.采购科请款流水号, 1, '通过', this.id, 2).then(response => {
|
||||
execApproval(row.采购请款流水号, 1, '通过', this.id, 1).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable1()
|
||||
@@ -227,7 +208,7 @@ export default {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消'
|
||||
}).then(({ value }) => {
|
||||
execApproval(row.采购科请款流水号, 2, value, this.id, 2).then(response => {
|
||||
execApproval(row.采购请款流水号, 2, value, this.id, 1).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable1()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
|
||||
<el-table-column label="采购合同编号" align="center" min-width="150">
|
||||
<el-table-column label="采购合同编号" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同编号 }}
|
||||
</template>
|
||||
@@ -12,39 +12,19 @@
|
||||
{{ scope.row.采购合同名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规定到货时间" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规定到货时间.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" min-width="250">
|
||||
<el-table-column label="供应商" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" align="center" min-width="100">
|
||||
<el-table-column label="请款人" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款方式内容 }}
|
||||
{{ scope.row.请款人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购员" align="center" min-width="70">
|
||||
<el-table-column label="合同总额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="欠款金额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.欠款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已付金额" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.已付金额 }}
|
||||
{{ scope.row.合同总额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款金额" align="center" min-width="70">
|
||||
@@ -94,7 +74,7 @@
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核" align="center" width="320">
|
||||
<el-table-column label="付款" align="center" width="320">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="400" trigger="click">
|
||||
<el-table :data="gridData" stripe size="mini" show-summary>
|
||||
@@ -168,7 +148,7 @@ export default {
|
||||
this.searchTable2()
|
||||
},
|
||||
searchTable1() {
|
||||
initApproval(this.pageCurrent1, this.pageSize1, 3).then(response => {
|
||||
initApproval(this.pageCurrent1, this.pageSize1, 2).then(response => {
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
@@ -209,7 +189,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
execApproval(row.采购科请款流水号, 1, '通过', this.id, 3).then(response => {
|
||||
execApproval(row.采购请款流水号, 1, '通过', this.id, 2).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
// 记录付款金额及时间
|
||||
@@ -228,7 +208,7 @@ export default {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消'
|
||||
}).then(({ value }) => {
|
||||
execApproval(row.采购科请款流水号, 2, value, this.id, 3).then(response => {
|
||||
execApproval(row.采购请款流水号, 2, value, this.id, 2).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable1()
|
||||
|
||||
@@ -24,57 +24,67 @@
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" stripe border style="width: 100%;max-height: 500px;" height="500px" size="mini">
|
||||
<el-table-column label="采购合同编号" align="center" min-width="100">
|
||||
<el-table-column label="采购合同号" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购合同名称" align="center" min-width="120">
|
||||
<el-table-column label="采购合同名称" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规定到货时间" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规定到货时间.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" min-width="250">
|
||||
<el-table-column label="供应商" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款方式内容 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购员" align="center" min-width="70">
|
||||
<el-table-column label="采购员" align="center" min-width="60">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" align="center" min-width="70">
|
||||
<el-table-column label="交货日期" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ Number(scope.row.总金额).toFixed(2) }}
|
||||
{{ scope.row.交货日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="欠款金额" align="center" min-width="70">
|
||||
<el-table-column label="支付日期" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ Number(scope.row.欠款金额).toFixed(2) }}
|
||||
{{ scope.row.支付日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已付金额" align="center" min-width="70">
|
||||
<el-table-column label="支付方式" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ Number(scope.row.总金额 - scope.row.欠款金额).toFixed(2) }}
|
||||
{{ scope.row.支付方式 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款情况" align="center" min-width="150">
|
||||
<el-table-column label="其他说明" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.其他说明 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同总额" align="center" min-width="70" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合同总额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="欠款金额" align="center" min-width="70" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
{{ (Number(scope.row.合同总额)-Number(scope.row.已付金额)).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已付金额" align="center" min-width="70" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
{{ Number(scope.row.已付金额).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款进度" align="center" min-width="150" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:stroke-width="18"
|
||||
:percentage="parseFloat((100*(scope.row.总金额 - scope.row.欠款金额)/scope.row.总金额).toFixed(2))"
|
||||
:percentage="100*(Number(scope.row.已付金额))/scope.row.合同总额"
|
||||
status="success"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -124,6 +134,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
this.searchTable1()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
@@ -142,6 +153,7 @@ export default {
|
||||
this.supplierName ? this.check2 = 1 : this.check2 = 0
|
||||
searchPayState(this.pageCurrent1, this.pageSize1, this.check1, this.contractNumValue, this.check2, this.supplierName).then(response => {
|
||||
this.tableData1 = response.data.rows
|
||||
console.log(response.data.rows)
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
|
||||
@@ -153,6 +153,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
this.searchTable1()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
|
||||
441
src/views/PurchasingCenter/PurchaseInvoiceDelivery/index.vue
Normal file
441
src/views/PurchasingCenter/PurchaseInvoiceDelivery/index.vue
Normal file
@@ -0,0 +1,441 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>项目名称:</span>
|
||||
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in project"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>采购合同号:</span>
|
||||
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
|
||||
<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-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left: 10px"
|
||||
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
style="margin-left: 10px"
|
||||
@click="handleAdd()">增加</el-button>
|
||||
</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-column align="center" label="采购合同编号" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="采购合同名称" min-width="150px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="供应商" min-width="150px">
|
||||
<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-column align="center" label="传送人" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.传送人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="传送时间" min-width="135px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.传送时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="交接状态" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.接收人" type="success" size="small">已接收</el-tag>
|
||||
<el-tag v-else type="warning" size="small">未接收</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="接收人" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.接收人 ? scope.row.接收人 : '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="接收时间" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.接收时间 ? scope.row.接收时间 : '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" fixed="right" width="200px">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin: 10px 0;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@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>
|
||||
|
||||
<el-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 300px" width="460px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="90px">
|
||||
<el-row>
|
||||
<el-form-item label="合同编号" prop="contractNumValue">
|
||||
<el-select v-model="form1.contractNumValue" placeholder="合同编号" size="small" filterable clearable>
|
||||
<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-form-item label="开票金额" prop="money">
|
||||
<el-input v-model="form1.money" size="small" placeholder="开票金额"/>
|
||||
</el-form-item>
|
||||
<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-form-item label="发票扫描件">
|
||||
<el-upload
|
||||
id="invoiceScan"
|
||||
ref="upload"
|
||||
:auto-upload="false"
|
||||
:on-success="uploadSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:on-exceed="warningExceed"
|
||||
:limit="limit"
|
||||
:action="upload+'?contractNumValue='+form1.contractNumValue+'&money='+form1.money+'&sendPersonValue='+form1.sendPersonValue"
|
||||
list-type="picture-card">
|
||||
<i class="el-icon-plus"/>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</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>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchInvoice, editInvoice, deleteInvoice, initSender, initProject, initContract } from '@/api/PurchasingCenter/PurchaseInvoiceDelivery'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { upload } from '@/utils/request'
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
name: '', // 采购发票交接
|
||||
data() {
|
||||
return {
|
||||
scanSrc: '',
|
||||
upload: `http://localhost:8411/submit/uploadInvoiceScan.ashx`,
|
||||
limit: 1,
|
||||
sender: [],
|
||||
contractNumValue: '',
|
||||
contractNum: [],
|
||||
projectValue: '',
|
||||
project: [],
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: 0,
|
||||
tableData1: [],
|
||||
tableData2: [],
|
||||
dialogVisible1: false,
|
||||
title1: '',
|
||||
form1: {
|
||||
contractNumValue: '',
|
||||
money: '',
|
||||
sendPersonValue: ''
|
||||
},
|
||||
rules1: {
|
||||
contractNumValue: [
|
||||
{ required: true, message: '请选择合同号' }
|
||||
],
|
||||
money: [
|
||||
{ required: true, message: '请填写金额' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id' // 人员编号
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
this.searchTable1()
|
||||
},
|
||||
methods: {
|
||||
fetchData() { // 初始化数据
|
||||
console.log(upload)
|
||||
initContract().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.contractNum.push({
|
||||
label: response.data[i].采购合同编号,
|
||||
name: response.data[i].采购合同名称,
|
||||
value: response.data[i].采购合同流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
initProject().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.project.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
initSender().then(response => { // 传送人
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.sender.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() { // 查询表1
|
||||
this.projectValue ? this.check1 = 1 : this.check1 = 0
|
||||
this.contractNumValue ? this.check2 = 1 : this.check2 = 0
|
||||
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.projectValue, this.check2, this.contractNumValue).then(response => {
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
this.scanSrc = ''
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
handleAdd() { // 执行新增
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.title1 = '增加'
|
||||
this.form1.projectValue = ''
|
||||
this.form1.contractNumValue = ''
|
||||
this.form1.money = ''
|
||||
this.form1.sendPersonValue = Number(this.id)
|
||||
this.form1.remark = ''
|
||||
this.dialogVisible1 = true
|
||||
},
|
||||
warningExceed() {
|
||||
this.$message.error('仅可上传一张发票')
|
||||
},
|
||||
submitAdd(formName) { // 提交新增
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.upload.submit() // 上传图片
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
beforeUpload(file) {
|
||||
const isJPG = /^image\/.*/.test(file.type)
|
||||
const isLt4M = file.size / 1024 / 1024 < 4
|
||||
if (!isJPG) {
|
||||
this.$message.error('只能上传图片。。')
|
||||
}
|
||||
if (!isLt4M) {
|
||||
this.$message.error('上传头像图片大小不能超过 4MB!')
|
||||
}
|
||||
return isJPG && isLt4M
|
||||
},
|
||||
uploadSuccess(res) { // 上传成功回调
|
||||
if (res[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.dialogVisible1 = false
|
||||
this.searchTable1()
|
||||
} else {
|
||||
this.$message.error('增加失败')
|
||||
}
|
||||
},
|
||||
handleEdit(row) {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.title1 = '编辑'
|
||||
this.dialogVisible1 = true
|
||||
this.form1.contractNum = parseInt(row.采购合同流水号)
|
||||
this.form1.invoiceNum = row.发票号
|
||||
this.form1.invoiceNumValue = 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 = ''
|
||||
}
|
||||
},
|
||||
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
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
console.log(row)
|
||||
this.$confirm('确认删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteInvoice(row.发票流水号).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.dialogVisible1 = false
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('删除失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
async searchPic(row) {
|
||||
const { data } = await request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '3',
|
||||
name: `select * from 采购管理_采购发票_附件 where 是否启用 = 1 and 发票交接流水号 = ${row.发票交接流水号}`
|
||||
}
|
||||
})
|
||||
this.scanSrc = 'http://localhost:8411/webpage/file/' + data[0].文件标识 + '.' + data[0].文件后缀
|
||||
console.log(this.scanSrc)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-tag{
|
||||
margin: 0
|
||||
}
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:150px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.searchForm .el-form-item{
|
||||
margin-top: 1px;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user