采购删除不必要文件
This commit is contained in:
@@ -1,431 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>开始时间:</span>
|
||||
<el-date-picker
|
||||
v-model="startDate"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<span>结束时间:</span>
|
||||
<el-date-picker
|
||||
v-model="endDate"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="选择日期"/>
|
||||
<span>合同号:</span>
|
||||
<el-input v-model="contractNum" placeholder="合同号" size="small" style="width:180px" clearable/>
|
||||
<span>采购员:</span>
|
||||
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px" clearable>
|
||||
<el-option
|
||||
v-for="item in person"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>供应商:</span>
|
||||
<el-input
|
||||
v-model="supplierName"
|
||||
placeholder="供应商"
|
||||
size="small"
|
||||
clearable
|
||||
style="width:180px"/>
|
||||
<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-card>
|
||||
|
||||
<el-card>
|
||||
<el-table :data="tableData1" size="mini" border style="width: 100%">
|
||||
<el-table-column label="请款" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon=""
|
||||
@click="requestFund(scope.row)">请款</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购合同编号" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购合同名称" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规定到货时间" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规定到货时间.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款方式内容 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="欠款金额" min-width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.欠款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购员" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="本次请款金额" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.本次应请款" size="mini" style="width:70px"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款付款情况" width="900" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-table :id="scope.$index" :data="tableData11[scope.$index]" size="mini" border style="width: 100%;">
|
||||
<el-table-column label="取消请款" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="scope.row.审核情况流水号!==3"
|
||||
type="danger"
|
||||
size="mini"
|
||||
@click="cancelRequestFund(scope.row)">取消请款</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="次数" min-width="60" align="center" type="index"/>
|
||||
<el-table-column label="请款金额" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款时间" width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款时间 ? scope.row.请款时间.split(' ')[0] : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核情况" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.审核情况内容 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="未通过审核原因" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.未通过审核原因 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批情况" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.审批情况内容 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="未通过审批原因" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.未通过审批原因 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款情况" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款情况内容 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="未付款原因" width="110" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.未付款原因 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<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-card>
|
||||
|
||||
<el-card>
|
||||
<span>请款时间区间:</span>
|
||||
<el-date-picker
|
||||
v-model="startRequestDate"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="开始日期"/>
|
||||
~
|
||||
<el-date-picker
|
||||
v-model="endRequestDate"
|
||||
size="small"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
placeholder="结束日期"/>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left:10px"
|
||||
@click="searchRequestTable">查询</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
size="small"
|
||||
icon="el-icon-download"
|
||||
style="margin-left:10px"
|
||||
>导出Excel</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading2" :data="tableData2" size="mini" border style="width: 100%;min-height:300px" height="300px">
|
||||
<el-table-column label="采购合同编号" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购合同名称" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规定到货时间" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规定到货时间.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" min-width="250" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款方式内容 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="欠款金额" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.欠款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购员" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款金额" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请款时间" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款时间.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchTable1, requestFund, searchCondition, cancelRequestFund, searchRequestTable, initBuyer } from '@/api/PurchasingCenter/BuyerRequestFund'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
personValue: '',
|
||||
person: [],
|
||||
loading2: false,
|
||||
tableData2: [],
|
||||
tableData11: [],
|
||||
total1: 0,
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
contractNum: '',
|
||||
submitDisable: true,
|
||||
form1: {},
|
||||
supplierName: '',
|
||||
tableData01: [],
|
||||
tableData1: [],
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
check3: 0,
|
||||
check4: 0,
|
||||
startRequestDate: '',
|
||||
endRequestDate: '',
|
||||
checkRequest: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.initBuyer()
|
||||
},
|
||||
methods: {
|
||||
initBuyer() { // 初始化采购人员
|
||||
initBuyer().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.person.push({
|
||||
text: response.data[i].姓名,
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
this.tableData1 = []
|
||||
this.startDate && this.endDate ? this.check1 = 1 : this.check1 = 0
|
||||
this.contractNum ? this.check2 = 1 : this.check2 = 0
|
||||
this.personValue ? this.check3 = 1 : this.check3 = 0
|
||||
this.supplierName ? this.check4 = 1 : this.check4 = 0
|
||||
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startDate, this.endDate, this.check2, this.contractNum, this.check3, this.personValue, this.check4, this.supplierName).then(response => {
|
||||
for (let j = 0; j < response.data.rows.length; j++) {
|
||||
this.tableData11[j] = []
|
||||
searchCondition(response.data.rows[j].采购合同流水号).then(response0 => {
|
||||
if (response0.data.length === 0) {
|
||||
this.tableData11[j].push(response0.data)
|
||||
document.getElementById(j).setAttribute('style', 'display:none')
|
||||
} else {
|
||||
for (let i = 0; i < response0.data.length; i++) {
|
||||
this.tableData11[j].push(response0.data[i])
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
requestFund(row) { // 请款
|
||||
const day1 = new Date()
|
||||
const day2 = day1.getFullYear() + '-' + (day1.getMonth() + 1) + '-' + day1.getDate()
|
||||
requestFund(row.采购合同流水号, row.本次应请款, day2, this.id).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('请款成功')
|
||||
this.searchTable1()
|
||||
this.startRequestDate = ''
|
||||
this.endRequestDate = ''
|
||||
this.tableData2 = []
|
||||
} else { this.$message.error('请款失败') }
|
||||
})
|
||||
},
|
||||
cancelRequestFund(row) { // 取消请款
|
||||
console.log(row)
|
||||
this.$confirm('确认取消请款吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (parseInt(row.采购科请款流水号) !== 1) {
|
||||
cancelRequestFund(row.采购科请款流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('操作成功')
|
||||
this.searchTable1()
|
||||
this.startRequestDate = ''
|
||||
this.endRequestDate = ''
|
||||
this.tableData2 = []
|
||||
} else { this.$message.error('操作失败') }
|
||||
})
|
||||
} else {
|
||||
this.$message.error('财务已经付款')
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
searchRequestTable() { // 查询请款表
|
||||
this.loading2 = true
|
||||
if ((this.startRequestDate === '' || this.startRequestDate === null) && (this.endRequestDate === '' || this.endRequestDate === null)) {
|
||||
this.checkRequest = 0
|
||||
} else if (this.startRequestDate !== '' && this.startRequestDate !== null && this.endRequestDate !== '' && this.endRequestDate !== null) {
|
||||
this.checkRequest = 1
|
||||
} else {
|
||||
this.$message.error('请款时间区间有误')
|
||||
this.loading2 = false
|
||||
return
|
||||
}
|
||||
searchRequestTable(this.checkRequest, this.startRequestDate, this.endRequestDate).then(response => {
|
||||
for (let j = 0; j < response.data.length; j++) {
|
||||
if (response.data[j].请款时间 !== null) {
|
||||
response.data[j].请款时间 = response.data[j].请款时间.substring(0, response.data[j].请款时间.indexOf(' '))
|
||||
}
|
||||
}
|
||||
this.tableData2 = response.data
|
||||
this.loading2 = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:150px!important;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.searchForm .el-form-item{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,647 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>时间段:</span>
|
||||
<el-date-picker
|
||||
v-model="startEndDate"
|
||||
style="width:250px"
|
||||
size="small"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<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>
|
||||
<span>采购员:</span>
|
||||
<el-select v-model="personValue" placeholder="采购员" size="small" clearable style="width: 100px">
|
||||
<el-option
|
||||
v-for="item in person"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<span>供应商:</span>
|
||||
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable style="width:180px"/>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left:10px"
|
||||
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询新合同</el-button>
|
||||
<span>变更原因:</span>
|
||||
<el-input v-model="changeReason" placeholder="变更原因" size="small" clearable style="width:200px"/>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-edit-outline"
|
||||
style="margin-left:10px"
|
||||
@click="contractChange">合同变更</el-button>
|
||||
</el-row>
|
||||
<el-table
|
||||
v-loading="loading1"
|
||||
:data="tableData1"
|
||||
size="mini"
|
||||
border
|
||||
style="width: 100%;max-height: 250px;"
|
||||
height="250px"
|
||||
highlight-current-row
|
||||
@row-click="searchTable2">
|
||||
<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="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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.规定到货时间.split(' ')[0] }}
|
||||
</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="80">
|
||||
<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="100" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="deleteContract(scope.row)">作废</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin: 10px 0 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-card>
|
||||
<table id="01" cellspacing="0px" align="center" border width="100%" style="">
|
||||
<tr style="height: 40px">
|
||||
<td colspan="1" align="center" style="font-weight: bold">GAOJING</td>
|
||||
<td colspan="3" align="center" style="font-weight: bold">产品销售合同</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="1" align="center">需方</td>
|
||||
<td colspan="1" align="center">江苏高精机电装备有限公司</td>
|
||||
<td colspan="1" align="center">合同编号</td>
|
||||
<td colspan="1" align="center">{{ contract01 }}</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="1" align="center">供方</td>
|
||||
<td colspan="1" align="center">{{ supplier01 }}</td>
|
||||
<td colspan="1" align="center">签订地点</td>
|
||||
<td colspan="1" align="center">江苏盐城</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div>一、 产品名称、型号、数量、单价、品牌:</div>
|
||||
<table id="02" cellspacing="0px" align="center" border width="100%" style="">
|
||||
<tbody id="04">
|
||||
<tr id="tableHead01" style="height: 40px">
|
||||
<td colspan="1" align="center">物料名称</td>
|
||||
<td colspan="1" align="center">物料规格</td>
|
||||
<td colspan="1" align="center">物料型号</td>
|
||||
<td colspan="1" align="center">发货天数</td>
|
||||
<td colspan="1" align="center">数量</td>
|
||||
<td colspan="1" align="center">单价</td>
|
||||
<td colspan="1" align="center">总价</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="6">运费:</td>
|
||||
<td colspan="1" align="center">{{ freight01 }}</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="6">总价: (人民币){{ RMB01 }}(含0.17增值税) </td>
|
||||
<td colspan="1" align="center">{{ TotalAmount01 }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div id="textarea01"/>
|
||||
</el-card>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>时间段:</span>
|
||||
<el-date-picker
|
||||
v-model="startEndDate3"
|
||||
style="width:250px"
|
||||
size="small"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<span>合同号:</span>
|
||||
<el-select v-model="contractNumValue3" placeholder="合同号" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in contractNum3"
|
||||
: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>
|
||||
<span>采购员:</span>
|
||||
<el-select v-model="personValue3" placeholder="采购员" size="small" clearable style="width: 100px">
|
||||
<el-option
|
||||
v-for="item in person"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<span>供应商:</span>
|
||||
<el-input v-model="supplierName3" placeholder="供应商" size="small" clearable style="width:180px"/>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left:10px"
|
||||
@click="total3=0;pageCurrent3=1;pageSize3=10;searchTable3()">查询旧合同</el-button>
|
||||
</el-row>
|
||||
<el-table
|
||||
v-loading="loading3"
|
||||
:data="tableData3"
|
||||
size="mini"
|
||||
border
|
||||
style="width: 100%;max-height: 250px;"
|
||||
height="250px"
|
||||
highlight-current-row
|
||||
@row-click="searchTable4">
|
||||
<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="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购合同名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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="100">
|
||||
<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="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合同变更原因 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin: 10px 0 10px 0;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent3"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize3"
|
||||
:total="total3"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange3"
|
||||
@current-change="handleCurrentChange3"/>
|
||||
</div>
|
||||
<el-card>
|
||||
<table id="11" cellspacing="0px" align="center" border width="100%" style="">
|
||||
<tr style="height: 40px">
|
||||
<td colspan="1" align="center" style="font-weight: bold">GAOJING</td>
|
||||
<td colspan="3" align="center" style="font-weight: bold">产品销售合同</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="1" align="center">需方</td>
|
||||
<td colspan="1" align="center">江苏高精机电装备有限公司</td>
|
||||
<td colspan="1" align="center">合同编号</td>
|
||||
<td colspan="1" align="center">{{ contract02 }}</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="1" align="center">供方</td>
|
||||
<td colspan="1" align="center">{{ supplier02 }}</td>
|
||||
<td colspan="1" align="center">签订地点</td>
|
||||
<td colspan="1" align="center">江苏盐城</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div>一、 产品名称、型号、数量、单价、品牌:</div>
|
||||
<table id="12" cellspacing="0px" align="center" border width="100%" style="">
|
||||
<tbody id="14">
|
||||
<tr id="tableHead02" style="height: 40px">
|
||||
<td colspan="1" align="center">物料名称</td>
|
||||
<td colspan="1" align="center">物料规格</td>
|
||||
<td colspan="1" align="center">物料型号</td>
|
||||
<td colspan="1" align="center">发货天数</td>
|
||||
<td colspan="1" align="center">数量</td>
|
||||
<td colspan="1" align="center">单价</td>
|
||||
<td colspan="1" align="center">总价</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="6">运费:</td>
|
||||
<td colspan="1" align="center">{{ freight02 }}</td>
|
||||
</tr>
|
||||
<tr style="height: 40px">
|
||||
<td colspan="6">总价: (人民币){{ RMB02 }}(含0.17增值税) </td>
|
||||
<td colspan="1" align="center">{{ TotalAmount02 }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div id="textarea02"/>
|
||||
</el-card>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initContract, initBuyer, searchTable1, searchTable2, contractChange,
|
||||
searchChangeContract, initChangeContract, searchTable4, initPayMethod, deleteContract } from '@/api/PurchasingCenter/ContractChange'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
returns01: [],
|
||||
contract01: '',
|
||||
supplier01: '',
|
||||
freight01: '',
|
||||
RMB01: '',
|
||||
TotalAmount01: '',
|
||||
textarea01: '',
|
||||
returns02: [],
|
||||
contract02: '',
|
||||
supplier02: '',
|
||||
freight02: '',
|
||||
RMB02: '',
|
||||
TotalAmount02: '',
|
||||
textarea02: '',
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
check3: 0,
|
||||
check4: 0,
|
||||
startEndDate: '',
|
||||
contractNumValue: '',
|
||||
contractNum: [],
|
||||
personValue: '',
|
||||
person: [],
|
||||
supplierName: '',
|
||||
supplierValue: '',
|
||||
total1: 0,
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
tableData1: [],
|
||||
loading1: false,
|
||||
tableData01: [],
|
||||
tableData02: [],
|
||||
submitDisable: true,
|
||||
dialogVisible2: false,
|
||||
changeReason: '',
|
||||
contractValue: '', // 显示表2和变更合同用的变量
|
||||
tableData3: [],
|
||||
loading3: false,
|
||||
total3: 0,
|
||||
pageCurrent3: 1,
|
||||
pageSize3: 10,
|
||||
check31: 0,
|
||||
check32: 0,
|
||||
check33: 0,
|
||||
check34: 0,
|
||||
check35: 0,
|
||||
check36: 0,
|
||||
startEndDate3: '',
|
||||
contractNumValue3: '',
|
||||
supplierName3: '',
|
||||
project3: '',
|
||||
personValue3: '',
|
||||
contractNum3: [],
|
||||
payMethod: [],
|
||||
payMethodValue: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.contractNum = []
|
||||
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].采购合同流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
this.contractNum3 = []
|
||||
initChangeContract().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.contractNum3.push({
|
||||
label: response.data[i].采购合同编号,
|
||||
name: response.data[i].采购合同名称,
|
||||
value: response.data[i].采购合同流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
this.payMethod = []
|
||||
initPayMethod().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.payMethod.push({
|
||||
label: response.data[i].付款方式内容,
|
||||
value: response.data[i].付款方式流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
this.person = []
|
||||
initBuyer().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.person.push({
|
||||
text: response.data[i].姓名,
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
this.textarea01 = ''
|
||||
this.loading1 = true
|
||||
if (this.startEndDate === '' || this.startEndDate === null || this.startEndDate[0] === '' || this.startEndDate[1] === '') {
|
||||
this.check1 = 0
|
||||
this.startEndDate = ''
|
||||
} else { this.check1 = 1 }
|
||||
this.contractNumValue ? this.check2 = 1 : this.check2 = 0
|
||||
this.personValue ? this.check3 = 1 : this.check3 = 0
|
||||
this.supplierName ? this.check4 = 1 : this.check4 = 0
|
||||
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startEndDate[0], this.startEndDate[1], this.check2, this.contractNumValue, this.check3, this.personValue, this.check4, this.supplierName).then(response => {
|
||||
this.loading1 = false
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
searchTable2(row) {
|
||||
this.supplier01 = row.供应商名称
|
||||
this.contract01 = row.采购合同编号
|
||||
this.freight01 = parseFloat(row.总金额) - parseFloat(row.总金额_小计)
|
||||
this.RMB01 = row.总金额_文本
|
||||
this.TotalAmount01 = row.总金额
|
||||
this.textarea01 = row.合同文本
|
||||
document.getElementById('textarea01').innerText = this.textarea01
|
||||
this.contractValue = parseInt(row.采购合同流水号)
|
||||
searchTable2(this.contractValue).then(response => {
|
||||
this.returns01 = response.data
|
||||
const children = document.getElementsByClassName('tableData01')
|
||||
const parent = document.getElementById('04')
|
||||
if (children.length !== 0) {
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
parent.removeChild(children[i])
|
||||
}
|
||||
}
|
||||
const tr = []
|
||||
for (let i = 0; i < this.returns01.length; i++) {
|
||||
tr[i] = document.createElement('tr')
|
||||
tr[i].setAttribute('class', 'tableData01')
|
||||
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
|
||||
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
|
||||
document.getElementById('tableHead01').after(tr[i])
|
||||
}
|
||||
for (let j = 0; j < this.returns01.length; j++) {
|
||||
document.getElementsByClassName('tableData01')[j].children[0].innerHTML = response.data[j].物料名称
|
||||
document.getElementsByClassName('tableData01')[j].children[1].innerHTML = response.data[j].物料规格
|
||||
document.getElementsByClassName('tableData01')[j].children[2].innerHTML = response.data[j].物料型号
|
||||
document.getElementsByClassName('tableData01')[j].children[3].innerHTML = response.data[j].发货天数
|
||||
document.getElementsByClassName('tableData01')[j].children[4].innerHTML = response.data[j].数量
|
||||
document.getElementsByClassName('tableData01')[j].children[5].innerHTML = response.data[j].单价
|
||||
document.getElementsByClassName('tableData01')[j].children[6].innerHTML = response.data[j].金额
|
||||
}
|
||||
})
|
||||
},
|
||||
contractChange() {
|
||||
if (this.contractValue) {
|
||||
this.$confirm('确定更改该合同?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
contractChange(this.contractValue, this.changeReason).then(response => {
|
||||
this.contractValue = ''
|
||||
this.changeReason = ''
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('变更成功')
|
||||
this.searchTable1()
|
||||
this.contractNumValue = ''
|
||||
this.contractNumValue3 = ''
|
||||
this.fetchData()
|
||||
} else { this.$message.error('变更失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$message.error('请先选择合同')
|
||||
}
|
||||
},
|
||||
searchTable3() {
|
||||
this.textarea02 = ''
|
||||
this.loading3 = true
|
||||
if (this.startEndDate3 === '' || this.startEndDate3 === null || this.startEndDate3[0] === '' || this.startEndDate3[1] === '') {
|
||||
this.check31 = 0
|
||||
this.startEndDate3 = ''
|
||||
} else { this.check31 = 1 }
|
||||
this.contractNumValue3 ? this.check32 = 1 : this.check32 = 0
|
||||
this.personValue3 ? this.check33 = 1 : this.check33 = 0
|
||||
this.supplierName3 ? this.check34 = 1 : this.check34 = 0
|
||||
this.project3 ? this.check35 = 1 : this.check35 = 0
|
||||
this.payMethodValue ? this.check36 = 1 : this.check36 = 0
|
||||
searchChangeContract(this.pageCurrent3, this.pageSize3, this.check31, this.startEndDate3[0], this.startEndDate3[1], this.check32, this.contractNumValue3, this.check33, this.personValue3, this.check34, this.supplierName3, this.check35, this.project3, this.check36, this.payMethodValue).then(response => {
|
||||
this.loading3 = false
|
||||
console.log(response.data)
|
||||
for (let j = 0; j < response.data.rows.length; j++) {
|
||||
if (response.data.rows[j].预到货时间 !== null) {
|
||||
response.data.rows[j].预到货时间 = response.data.rows[j].预到货时间.substring(0, response.data.rows[j].预到货时间.indexOf(' '))
|
||||
}
|
||||
if (response.data.rows[j].规定到货时间 !== null) {
|
||||
response.data.rows[j].规定到货时间 = response.data.rows[j].规定到货时间.substring(0, response.data.rows[j].规定到货时间.indexOf(' '))
|
||||
}
|
||||
if (response.data.rows[j].实际到货时间 !== null) {
|
||||
response.data.rows[j].实际到货时间 = response.data.rows[j].实际到货时间.substring(0, response.data.rows[j].实际到货时间.indexOf(' '))
|
||||
}
|
||||
}
|
||||
this.tableData3 = response.data.rows
|
||||
this.total3 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange3(val) {
|
||||
this.pageCurrent3 = 1
|
||||
this.pageSize3 = val
|
||||
this.searchTable3()
|
||||
},
|
||||
handleCurrentChange3(val) {
|
||||
this.pageCurrent3 = val
|
||||
this.searchTable3()
|
||||
},
|
||||
searchTable4(row) {
|
||||
this.supplier02 = row.供应商名称
|
||||
this.contract02 = row.采购合同编号
|
||||
this.freight02 = parseFloat(row.运费)
|
||||
this.RMB02 = row.总金额_文本
|
||||
this.TotalAmount02 = row.总金额
|
||||
this.textarea02 = row.合同文本
|
||||
document.getElementById('textarea02').innerText = this.textarea02
|
||||
this.contractValue = parseInt(row.采购合同变更流水号)
|
||||
searchTable4(this.contractValue).then(response => {
|
||||
this.returns02 = response.data
|
||||
const children = document.getElementsByClassName('tableData02')
|
||||
const parent = document.getElementById('14')
|
||||
if (children.length !== 0) {
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
parent.removeChild(children[i])
|
||||
}
|
||||
}
|
||||
const tr = []
|
||||
for (let i = 0; i < this.returns02.length; i++) {
|
||||
tr[i] = document.createElement('tr')
|
||||
tr[i].setAttribute('class', 'tableData02')
|
||||
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
|
||||
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
|
||||
document.getElementById('tableHead02').after(tr[i])
|
||||
}
|
||||
for (let j = 0; j < this.returns02.length; j++) {
|
||||
document.getElementsByClassName('tableData02')[j].children[0].innerHTML = response.data[j].物料名称
|
||||
document.getElementsByClassName('tableData02')[j].children[1].innerHTML = response.data[j].物料规格
|
||||
document.getElementsByClassName('tableData02')[j].children[2].innerHTML = response.data[j].物料型号
|
||||
document.getElementsByClassName('tableData02')[j].children[3].innerHTML = response.data[j].发货天数
|
||||
document.getElementsByClassName('tableData02')[j].children[4].innerHTML = response.data[j].数量
|
||||
document.getElementsByClassName('tableData02')[j].children[5].innerHTML = response.data[j].单价
|
||||
document.getElementsByClassName('tableData02')[j].children[6].innerHTML = response.data[j].金额
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteContract(row) { // 合同作废
|
||||
this.$confirm('确定作废该合同?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteContract(row.采购合同流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('作废成功')
|
||||
this.searchTable1()
|
||||
this.contractNumValue = ''
|
||||
this.contractNumValue3 = ''
|
||||
this.fetchData()
|
||||
} else { this.$message.error('作废失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:200px
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.searchForm .el-form-item{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.el-row{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,221 +0,0 @@
|
||||
<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-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
|
||||
<span>采购员:</span>
|
||||
<el-select v-model="personValue" placeholder="采购员" size="small" clearable style="width: 100px">
|
||||
<el-option
|
||||
v-for="item in person"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>采购情况:</span>
|
||||
<el-select v-model="purchaseStateValue" placeholder="采购情况" size="small" style="width: 100px">
|
||||
<el-option
|
||||
v-for="item in purchaseState"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left: 10px"
|
||||
@click="pageCurrent1=1;pageSize1=20;total1=0;searchTable1()">查询</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 600px" height="600px" border stripe>
|
||||
<el-table-column align="center" label="采购情况" min-width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.人员编号===''" type="primary" size="small">未分配</el-tag>
|
||||
<el-tag v-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">未询价</el-tag>
|
||||
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
|
||||
<el-tag v-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
|
||||
</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="150px">
|
||||
<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="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.物料计划到货时间.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :filters="person" :filter-method="filterHandler" align="center" label="采购员" min-width="100px" prop="buyer">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<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-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, initBuyer, searchTable1 } from '@/api/PurchasingCenter/ContractStateSearch'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: '', // 采购任务分配
|
||||
data() {
|
||||
return {
|
||||
projectValue: '',
|
||||
project: [],
|
||||
materialName: '',
|
||||
personValue: '',
|
||||
person: [],
|
||||
purchaseStateValue: 0,
|
||||
purchaseState: [
|
||||
{
|
||||
value: 0,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '未分配'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '未询价'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '已询价'
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '已采购'
|
||||
}
|
||||
],
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
check3: 0,
|
||||
tableData1: [],
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 20,
|
||||
total1: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() { // 初始化
|
||||
initProject().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.project.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
initBuyer().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.person.push({
|
||||
text: response.data[i].姓名,
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() { // 查询
|
||||
this.projectValue ? this.check1 = 1 : this.check1 = 0
|
||||
this.materialName ? this.check2 = 1 : this.check2 = 0
|
||||
this.personValue ? this.check3 = 1 : this.check3 = 0
|
||||
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.projectValue, this.check2, this.materialName, this.check3, this.personValue, this.purchaseStateValue).then(response => {
|
||||
console.log(response.data)
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
filterHandler(value, row) {
|
||||
console.log(row, value)
|
||||
return parseInt(row['人员编号']) === parseInt(value)
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageSize1 = val
|
||||
this.pageCurrent1 = 1
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.searchForm .el-form-item{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.el-tag{
|
||||
margin: 0
|
||||
}
|
||||
</style>
|
||||
@@ -1,597 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-form ref="form1" :model="form1" label-position="right" label-width="110px" class="searchForm">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="合同号">
|
||||
<el-select v-model="contractNumValue" placeholder="合同号" filterable clearable size="small" @change="stipulateArrivalTime='';searchTable1()">
|
||||
<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.supplierName }}</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="合同名称">
|
||||
<el-input v-model="contractName" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="规定到货时间">
|
||||
<el-date-picker
|
||||
v-model="stipulateArrivalTime"
|
||||
:picker-options="endDateOpt"
|
||||
:disabled="Boolean(!contractNumValue)"
|
||||
size="small"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期"
|
||||
@change="searchDemo();calcDay()"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="付款方式">
|
||||
<el-select v-model="payMethodValue" placeholder="付款方式" size="small" @change="searchDemo();payMethodChange()">
|
||||
<el-option
|
||||
v-for="item in payMethod"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="第1次付款时间">
|
||||
<el-select v-model="payTime1Value" placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in payTime"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="第2次付款时间">
|
||||
<el-select v-model="payTime2Value" :disabled="disable2" placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in payTime"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="第3次付款时间">
|
||||
<el-select v-model="payTime3Value" :disabled="disable3" placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in payTime"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="第4次付款时间">
|
||||
<el-select v-model="payTime4Value" :disabled="disable4" placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in payTime"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="第5次付款时间">
|
||||
<el-select v-model="payTime5Value" :disabled="disable5" placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in payTime"
|
||||
: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-input v-model="freight" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="税率">
|
||||
<el-input v-model="taxRate" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="币种">
|
||||
<el-select v-model="currencyValue" placeholder="币种" size="small">
|
||||
<el-option
|
||||
v-for="item in currency"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<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" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.参考价格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.最低单价" size="mini" style="width:70px"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货天数" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="deliveryDay[scope.$index]" size="mini" style="width:70px"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料计划到货时间" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料计划到货时间.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料名称" align="center" min-width="200">
|
||||
<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" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订货数量" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订货数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon=""
|
||||
style="margin-top:10px"
|
||||
@click="calculateContractSum">计算合同总额</el-button>
|
||||
<span>合同总额:</span>
|
||||
<el-input v-model="contractSum" size="small" readonly/>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
:data="tableData2"
|
||||
:show-header="false"
|
||||
highlight-current-row
|
||||
border
|
||||
height="280px"
|
||||
style="width: 250px;display:inline-block;max-height: 280px;"
|
||||
size="mini"
|
||||
@row-click="searchDemo">
|
||||
<el-table-column align="center" label="合同模板名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合同模板名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-input :rows="20" v-model="textArea" type="textarea" style="width:calc(99% - 250px);float:right;margin-bottom: 20px" resize="none"/>
|
||||
<!--将新一般处理页添加至通讯服务器-->
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:before-upload="beforeUpload"
|
||||
:file-list="fileList"
|
||||
:auto-upload="false"
|
||||
style="display: inline-block;width:250px"
|
||||
class="upload-demo"
|
||||
action="http://localhost:8022/submit/uploadFile0.ashx"
|
||||
list-type="picture">
|
||||
<el-button slot="trigger" size="small" type="primary" style="margin:10px 10px 0 10px">添加图纸附件</el-button>
|
||||
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">生成采购合同</el-button>
|
||||
</el-upload>
|
||||
</el-card>
|
||||
<!--<el-button style="margin-left: 10px;" size="small" type="success" @click="test">test</el-button>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchInquirySheet, searchSheetContract, initPayMethod, initPayTimeNode, searchContractDemo, doneContract, insertFile } from '@/api/PurchasingCenter/CreateContract'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
inject: ['reload'],
|
||||
data() {
|
||||
return {
|
||||
fileName: '',
|
||||
hasFile: 0,
|
||||
searchView: '',
|
||||
fileList: [],
|
||||
minDate: null,
|
||||
endDateOpt: { // 禁用大于规定到货日期和小于当前日期
|
||||
disabledDate: (time) => {
|
||||
if (this.minDate) {
|
||||
return time.getTime() > this.minDate || time.getTime() < new Date()
|
||||
}
|
||||
}
|
||||
},
|
||||
form1: {},
|
||||
contractNumValue: '', // 合同流水号
|
||||
contractNum: [],
|
||||
contractNameNum: '', // 合同编号/询价单号
|
||||
contractName: '产品购销合同', // 合同名称
|
||||
supplierName: '', // 供应商名称
|
||||
stipulateArrivalTime: '', // 规定到货时间
|
||||
payMethodValue: 1, // 付款方式流水号
|
||||
payMethodName: '', // 付款方式名称
|
||||
payMethod: [],
|
||||
payTime: [],
|
||||
payTime1Value: 1, // 付款时间
|
||||
payTime2Value: 1, // 付款时间
|
||||
payTime3Value: 1, // 付款时间
|
||||
payTime4Value: 1, // 付款时间
|
||||
payTime5Value: 1, // 付款时间
|
||||
payTime6Value: 1, // 付款时间
|
||||
freight: 0, // 运费
|
||||
taxRate: '0.17', // 税率
|
||||
currencyValue: 1, // 币种
|
||||
currency: [
|
||||
{
|
||||
label: '人民币',
|
||||
value: 1
|
||||
}, {
|
||||
label: '美元',
|
||||
value: 2
|
||||
}, {
|
||||
label: '英镑',
|
||||
value: 3
|
||||
}, {
|
||||
label: '欧元',
|
||||
value: 4
|
||||
}
|
||||
], // 币种
|
||||
calculateWayValue: [], // 计算方式(不要了)
|
||||
calculateWay: [
|
||||
{
|
||||
label: '个数',
|
||||
value: 1
|
||||
}, {
|
||||
label: '重量',
|
||||
value: 2
|
||||
}
|
||||
],
|
||||
weight: [], // 重量(不要了)
|
||||
disable2: true,
|
||||
disable3: true,
|
||||
disable4: true,
|
||||
disable5: true,
|
||||
disable6: true,
|
||||
tableData1: [], // 物料表
|
||||
contractSum: '', // 合同总额
|
||||
deliveryDay: [], // 发货天数
|
||||
tableData2: [], // 合同模板表
|
||||
textArea: '',
|
||||
paramRow: '', // 参数row
|
||||
materialGroup: '', // 物料流水号组
|
||||
numberGroup: '', // 数量组
|
||||
priceGroup: '', // 单价组
|
||||
dayGroup: '', // 发货天数组
|
||||
payGroup: '', // 付款方式组
|
||||
planGroup: '', // 计划付款时间组
|
||||
taxGroup: '', // 税率组
|
||||
currencyGroup: '', // 币种组
|
||||
groupPartGroup: '', // 组件零件流水号组
|
||||
calculateWayGroup: '', // 计算方式组(不要了)
|
||||
weightGroup: '', // 重量组(不要了)
|
||||
supplierValue: '',
|
||||
groupNum1: [] // 防止渲染不出来的中间变量
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
test() {
|
||||
this.$refs.upload.submit() // 图片传本地
|
||||
},
|
||||
beforeUpload(file) { // 传成功前
|
||||
this.fileName = file.name
|
||||
},
|
||||
submitUpload() { // 生成采购合同+传图片附件
|
||||
for (let i = 0; i < this.contractNum.length; i++) { // 在生成合同处也有
|
||||
if (this.contractNum[i].value === this.contractNumValue) {
|
||||
this.contractNameNum = this.contractNum[i].label // 获取询价单号
|
||||
this.supplierValue = this.contractNum[i].supplierValue // 获取供应商流水号
|
||||
}
|
||||
}
|
||||
this.$refs.upload.submit() // 图片传本地
|
||||
if (this.fileName !== '') { // 有附件,先向数据库中插入一条记录(记录合同编号及文件名)
|
||||
insertFile(this.fileName, this.contractNameNum).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.doneContract()
|
||||
} else {
|
||||
this.$message.error('附件名插入数据库失败')
|
||||
}
|
||||
})
|
||||
} else { // 无附件,直接执行生成合同
|
||||
this.doneContract()
|
||||
}
|
||||
this.contractNameNum = ''
|
||||
this.fileName = ''
|
||||
},
|
||||
fetchData() {
|
||||
searchInquirySheet(0, 0, 0, 0, 1, this.id).then(response => { // 初始化询价单号
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.contractNum.push({
|
||||
value: response.data[i].询价单流水号,
|
||||
label: response.data[i].询价单编号,
|
||||
supplierName: response.data[i].供应商名称,
|
||||
supplierValue: response.data[i].供应商流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
searchContractDemo().then(response => { // 初始化合同模板
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
initPayMethod().then(response => { // 初始化付款方式
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.payMethod.push({
|
||||
label: response.data[i].付款方式内容,
|
||||
value: response.data[i].付款方式流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
initPayTimeNode().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
if (parseInt(response.data[i].付款时间节点流水号) !== 0) {
|
||||
this.payTime.push({
|
||||
label: response.data[i].付款时间节点名称,
|
||||
value: response.data[i].付款时间节点流水号
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
payMethodChange() { // 付款方式改变
|
||||
for (let i = 0; i < this.payMethod.length; i++) {
|
||||
if (this.payMethod[i].value === this.payMethodValue) {
|
||||
this.payMethodName = this.payMethod[i].label
|
||||
}
|
||||
}
|
||||
const payTimeNum = this.payMethodName.split(':')
|
||||
switch (payTimeNum.length) {
|
||||
case 1:
|
||||
this.disable2 = true
|
||||
this.disable3 = true
|
||||
this.disable4 = true
|
||||
this.disable5 = true
|
||||
this.disable6 = true
|
||||
break
|
||||
case 2:
|
||||
this.disable2 = false
|
||||
this.disable3 = true
|
||||
this.disable4 = true
|
||||
this.disable5 = true
|
||||
this.disable6 = true
|
||||
break
|
||||
case 3:
|
||||
this.disable2 = false
|
||||
this.disable3 = false
|
||||
this.disable4 = true
|
||||
this.disable5 = true
|
||||
this.disable6 = true
|
||||
break
|
||||
case 4:
|
||||
this.disable2 = false
|
||||
this.disable3 = false
|
||||
this.disable4 = false
|
||||
this.disable5 = true
|
||||
this.disable6 = true
|
||||
break
|
||||
case 5:
|
||||
this.disable2 = false
|
||||
this.disable3 = false
|
||||
this.disable4 = false
|
||||
this.disable5 = false
|
||||
this.disable6 = true
|
||||
break
|
||||
case 6:
|
||||
this.disable2 = false
|
||||
this.disable3 = false
|
||||
this.disable4 = false
|
||||
this.disable5 = false
|
||||
this.disable6 = false
|
||||
break
|
||||
}
|
||||
},
|
||||
searchTable1() {
|
||||
const numGroup = [] // 空数组,放物料的计划到货时间
|
||||
searchSheetContract(this.contractNumValue).then(response => {
|
||||
this.tableData1 = response.data
|
||||
this.calcDay() // 先给表置0
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.tableData1[i].金额 = parseFloat(this.tableData1[i].最低单价) * parseFloat(this.tableData1[i].订货数量)
|
||||
numGroup.push(Date.parse(this.tableData1[i].物料计划到货时间))
|
||||
}
|
||||
this.minDate = new Date(Math.min(...numGroup))
|
||||
}).then(() => {
|
||||
this.groupNum1 = this.tableData1 // 给中间变量,需要时重新push
|
||||
})
|
||||
this.calcDay() // 先给表置0
|
||||
},
|
||||
searchDemo(row = this.paramRow) {
|
||||
for (let i = 0; i < this.payMethod.length; i++) {
|
||||
if (this.payMethod[i].value === this.payMethodValue) {
|
||||
this.payMethodName = this.payMethod[i].label
|
||||
}
|
||||
}
|
||||
this.paramRow = row
|
||||
searchContractDemo(this.paramRow.合同模板流水号).then(response => {
|
||||
this.textArea = response.data[0].合同模板内容.replace('stipulateArrivalTime', this.stipulateArrivalTime).replace('payMethodName', this.payMethodName)
|
||||
})
|
||||
},
|
||||
calcDay() { // 计算发货天数
|
||||
this.deliveryDay = []
|
||||
for (let i = 0; i < this.tableData1.length; i++) {
|
||||
this.stipulateArrivalTime
|
||||
? (this.deliveryDay[i] = parseInt((Date.parse(this.stipulateArrivalTime) - new Date()) / (1000 * 60 * 60 * 24)))
|
||||
: (this.deliveryDay[i] = 0)
|
||||
}
|
||||
},
|
||||
calculateContractSum() {
|
||||
this.contractSum = 0
|
||||
this.tableData1 = []
|
||||
for (let i = 0; i < this.groupNum1.length; i++) {
|
||||
this.groupNum1[i].金额 = parseFloat(this.groupNum1[i].最低单价) * parseFloat(this.groupNum1[i].订货数量)
|
||||
this.contractSum += parseFloat(this.groupNum1[i].金额)
|
||||
this.tableData1.push(this.groupNum1[i])
|
||||
}
|
||||
},
|
||||
doneContract() { // 生成采购合同
|
||||
for (let i = 0; i < this.contractNum.length; i++) {
|
||||
if (this.contractNum[i].value === this.contractNumValue) {
|
||||
this.contractNameNum = this.contractNum[i].label // 获取询价单号
|
||||
this.supplierValue = this.contractNum[i].supplierValue // 获取供应商流水号
|
||||
}
|
||||
}
|
||||
if (this.contractNum === '' || this.contractNum === null) {
|
||||
this.$message.error('请选择生成合同的询价单')
|
||||
} else if (this.stipulateArrivalTime === '' || this.stipulateArrivalTime === null) {
|
||||
this.$message.error('请选择规定到货时间!')
|
||||
} else {
|
||||
for (let i = 0; i < this.deliveryDay.length; i++) {
|
||||
if (parseInt(this.deliveryDay[i]) < 0) {
|
||||
this.$message.error('规定到货日期不可小于当前日期')
|
||||
return
|
||||
}
|
||||
}
|
||||
this.materialGroup = ''
|
||||
this.numberGroup = ''
|
||||
this.priceGroup = ''
|
||||
this.dayGroup = ''
|
||||
this.payGroup = ''
|
||||
this.planGroup = ''
|
||||
this.taxGroup = ''
|
||||
this.currencyGroup = ''
|
||||
this.groupPartGroup = ''
|
||||
for (let i = 0; i < this.tableData1.length; i++) {
|
||||
this.materialGroup += this.tableData1[i].物料流水号 + ','
|
||||
this.numberGroup += this.tableData1[i].订货数量 + ','
|
||||
this.priceGroup += this.tableData1[i].最低单价 + ','
|
||||
this.dayGroup += this.deliveryDay[i] + ','
|
||||
this.taxGroup += this.taxRate + ','
|
||||
this.currencyGroup += this.currencyValue + ','
|
||||
this.groupPartGroup += this.tableData1[i].组件零件流水号 + ',' // fucking
|
||||
}
|
||||
for (let i = 0; i < this.payMethod.length; i++) {
|
||||
if (this.payMethod[i].value === this.payMethodValue) {
|
||||
this.payMethodName = this.payMethod[i].label
|
||||
}
|
||||
}
|
||||
const payTimeNum = this.payMethodName.split(':')
|
||||
if (payTimeNum.length > 1) {
|
||||
for (let i = 0; i < payTimeNum.length; i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
this.planGroup += this.payTime1Value + ','
|
||||
break
|
||||
case 1:
|
||||
this.planGroup += this.payTime2Value + ','
|
||||
break
|
||||
case 2:
|
||||
this.planGroup += this.payTime3Value + ','
|
||||
break
|
||||
case 3:
|
||||
this.planGroup += this.payTime4Value + ','
|
||||
break
|
||||
case 4:
|
||||
this.planGroup += this.payTime5Value + ','
|
||||
break
|
||||
case 5:
|
||||
this.planGroup += this.payTime6Value + ','
|
||||
break
|
||||
}
|
||||
this.payGroup += payTimeNum[i] + ',' // 付款比例 付款方式 付款计划
|
||||
}
|
||||
} else {
|
||||
this.payGroup = '10,' // 付款比例 付款方式 付款计划
|
||||
this.planGroup = this.payTime1Value + ',' // 付款时间
|
||||
}
|
||||
this.materialGroup = this.materialGroup.substr(0, this.materialGroup.length - 1)
|
||||
this.numberGroup = this.numberGroup.substr(0, this.numberGroup.length - 1)
|
||||
this.priceGroup = this.priceGroup.substr(0, this.priceGroup.length - 1)
|
||||
this.dayGroup = this.dayGroup.substr(0, this.dayGroup.length - 1)
|
||||
this.payGroup = this.payGroup.substr(0, this.payGroup.length - 1)
|
||||
this.planGroup = this.planGroup.substr(0, this.planGroup.length - 1)
|
||||
this.taxGroup = this.taxGroup.substr(0, this.taxGroup.length - 1)
|
||||
this.currencyGroup = this.currencyGroup.substr(0, this.currencyGroup.length - 1)
|
||||
this.groupPartGroup = this.groupPartGroup.substr(0, this.groupPartGroup.length - 1)
|
||||
doneContract(this.contractNameNum, this.contractName, this.stipulateArrivalTime, this.stipulateArrivalTime, this.payMethodName, this.supplierValue, this.textArea, this.freight, this.materialGroup, this.numberGroup, this.priceGroup, this.dayGroup, this.payGroup, this.planGroup, this.taxGroup, this.currencyGroup, this.calculateWayGroup, this.weightGroup, this.id, this.groupPartGroup).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('生成合同成功')
|
||||
this.reload()
|
||||
} else { this.$message.error('生成合同失败') }
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-date-editor{
|
||||
width:200px
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.searchForm .el-form-item{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,304 +0,0 @@
|
||||
<template>
|
||||
<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">
|
||||
<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="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.规定到货时间.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" min-width="250">
|
||||
<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">
|
||||
<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.已付金额 }}
|
||||
</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="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesApproval(scope.row)">通过</el-button>
|
||||
<el-button type="danger" size="mini" icon="el-icon-close" @click="noApproval(scope.row)">不通过</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<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-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData2" border style="width: 100%;max-height: 300px;" height="300px" size="mini">
|
||||
<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="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="150" prop="请款金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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>
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="离线合同编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.离线合同编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="合同总额" prop="请款金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button slot="reference" type="success" size="mini" icon="el-icon-search" style="margin-right: 10px" @click="searchTable02(scope.row)">查看详情</el-button>
|
||||
</el-popover>
|
||||
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesApprovalOffline(scope.row)">通过</el-button>
|
||||
<el-button type="danger" size="mini" icon="el-icon-close" @click="noApprovalOffline(scope.row)">不通过</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize2"
|
||||
:total="total2"
|
||||
style="display:inline-block;width:50%"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initApproval, execApproval, initApprovalOffline, searchRequsetFundDetail, execApprovalOffline } from '@/api/PurchasingCenter/FundApproval'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: '', // 财务审核
|
||||
data() {
|
||||
return {
|
||||
tableData1: [],
|
||||
pageSize1: 10,
|
||||
pageCurrent1: 1,
|
||||
total1: 0,
|
||||
tableData2: [],
|
||||
pageSize2: 10,
|
||||
pageCurrent2: 1,
|
||||
total2: 0,
|
||||
gridData: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id' // 人员编号
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.searchTable1()
|
||||
this.searchTable2()
|
||||
},
|
||||
searchTable1() {
|
||||
initApproval(this.pageCurrent1, this.pageSize1, 1).then(response => {
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageSize1 = val
|
||||
this.pageCurrent1 = 1
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
searchTable2() {
|
||||
initApprovalOffline(this.pageCurrent2, this.pageSize2, 1).then(response => {
|
||||
console.log(response.data.rows)
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange2(val) {
|
||||
this.pageSize2 = val
|
||||
this.pageCurrent2 = 1
|
||||
this.searchTable2()
|
||||
},
|
||||
handleCurrentChange2(val) {
|
||||
this.pageCurrent2 = val
|
||||
this.searchTable2()
|
||||
},
|
||||
searchTable02(row) { // 查看详情(请款信息包含的合同)
|
||||
searchRequsetFundDetail(row.离线合同请款流水号).then(response => {
|
||||
this.gridData = response.data
|
||||
})
|
||||
},
|
||||
yesApproval(row) { // 通过审核
|
||||
this.$confirm('确定审核通过?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
execApproval(row.采购科请款流水号, 1, '通过', this.id, 1).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('执行失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
noApproval(row) { // 不通过审核
|
||||
this.$prompt('请输入不通过原因', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消'
|
||||
}).then(({ value }) => {
|
||||
execApproval(row.采购科请款流水号, 2, value, this.id, 1).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('执行失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
yesApprovalOffline(row) { // 通过审核
|
||||
this.$confirm('确定审核通过?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
execApprovalOffline(row.离线合同请款流水号, 1, '通过', this.id, 1).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable2()
|
||||
} else { this.$message.error('执行失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
},
|
||||
noApprovalOffline(row) { // 不通过审核
|
||||
this.$prompt('请输入不通过原因', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消'
|
||||
}).then(({ value }) => {
|
||||
execApprovalOffline(row.离线合同请款流水号, 2, value, this.id, 1).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('执行成功')
|
||||
this.searchTable2()
|
||||
} else { this.$message.error('执行失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消操作'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.searchForm .el-form-item{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.el-tag{
|
||||
margin: 0
|
||||
}
|
||||
</style>
|
||||
@@ -1,224 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>采购合同号:</span>
|
||||
<el-select v-model="contractNum" placeholder="合同号" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in contractNums"
|
||||
: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>
|
||||
<span>供应商:</span>
|
||||
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
|
||||
<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-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 300px" height="300px" stripe border @row-click="searchTable2">
|
||||
<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="200px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="合同总金额" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ Number(scope.row.合同总金额).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到票总金额" min-width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ Number(scope.row.到票总金额).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到票情况" min-width="200px">
|
||||
<template slot-scope="scope">
|
||||
<el-progress :status="Number(scope.row.到票总金额)>Number(scope.row.合同总金额)?'exception':'success'" :text-inside="true" :stroke-width="18" :percentage="Number(scope.row.到票总金额)>Number(scope.row.合同总金额)?100:parseFloat((100*(scope.row.到票总金额/scope.row.合同总金额)).toFixed(2))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<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" style="max-height: 200px;margin-top: 10px" height="200px" 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="100px">
|
||||
<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.开票金额 }}
|
||||
</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="80px">
|
||||
<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="200px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchContractInvoice, searchInvoice, initPerson, initContract } from '@/api/PurchasingCenter/InvoiceStateSearch'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: '', // 到票情况查询
|
||||
data() {
|
||||
return {
|
||||
contractNumValue: '',
|
||||
contractNums: [],
|
||||
supplierName: '',
|
||||
invoiceNum: '',
|
||||
invoiceTime: '',
|
||||
transmitValue: '',
|
||||
selectPerson: [], // 传送人接收人
|
||||
recipientValue: '',
|
||||
contractNum: '',
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: 0,
|
||||
tableData1: [],
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
check3: 0,
|
||||
check4: 0,
|
||||
check5: 0,
|
||||
tableData2: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id' // 人员编号
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
initContract().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.contractNums.push({
|
||||
label: response.data[i].采购合同编号,
|
||||
name: response.data[i].采购合同名称,
|
||||
value: response.data[i].采购合同流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
initPerson().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.selectPerson.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
this.contractNum ? this.check1 = 1 : this.check1 = 0
|
||||
this.supplierName ? this.check2 = 1 : this.check2 = 0
|
||||
searchContractInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.contractNum, this.check2, this.supplierName).then(response => {
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
searchTable2(row) {
|
||||
searchInvoice(row.采购合同流水号).then(response => {
|
||||
for (let j = 0; j < response.data.length; j++) {
|
||||
if (response.data[j].开票时间 !== null) {
|
||||
response.data[j].开票时间 = response.data[j].开票时间.substring(0, response.data[j].开票时间.indexOf(' '))
|
||||
}
|
||||
if (response.data[j].开票时间 === '1900/1/1') {
|
||||
response.data[j].开票时间 = ''
|
||||
}
|
||||
}
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.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>
|
||||
@@ -1,397 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>时间段:</span>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
:picker-options="pickerOptions"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin-left: 10px"
|
||||
@click="searchTable3()">查询</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading=""
|
||||
:data="tableData3"
|
||||
:summary-method="getSummaries"
|
||||
border
|
||||
show-summary
|
||||
style="width: 100%;max-height: 250px;margin-top: 10px"
|
||||
height="250px"
|
||||
size="mini">
|
||||
<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.付款时间节点名称 }}
|
||||
</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="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款比例.toFixed(1) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款预算(元)" align="center" min-width="100" prop="预付金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.预付金额.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<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>
|
||||
<span>供应商:</span>
|
||||
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
|
||||
<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-card>
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading=""
|
||||
:data="tableData1"
|
||||
border
|
||||
style="width: 100%;max-height: 250px;"
|
||||
height="250px"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
@row-click="searchTable2">
|
||||
<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.采购合同名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" min-width="200">
|
||||
<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="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.审批时间.split(' ')[0] }}
|
||||
</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="110">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目预验收日期.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目终验收日期" align="center" min-width="110">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目终验收日期.split(' ')[0] }}
|
||||
</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="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.货到用户现场日期.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户现场开通日期" align="center" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.用户现场开通日期.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="日期设置" align="center" width="100" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" icon="el-icon-edit" @click="editDate(scope.row)">设置</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize1"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
<el-table v-loading="" :data="tableData2" border style="width: 100%;max-height: 180px;margin-top: 10px" size="mini">
|
||||
<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.付款时间节点名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款时间" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.预付时间 ? scope.row.预付时间.split(' ')[0] : '参考时间节点未设置' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款比例" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款比例.toFixed(1) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款预算" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.预付金额.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogVisible1" title="设置日期" center style="min-height: 300px" width="500px">
|
||||
<el-form ref="form1" :model="form1" label-position="left" label-width="130px">
|
||||
<el-form-item label="项目预验收日期">
|
||||
<el-date-picker v-model="form1.项目预验收日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目终验收日期">
|
||||
<el-date-picker v-model="form1.项目终验收日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发货日期">
|
||||
<el-date-picker v-model="form1.发货日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货到用户现场日期">
|
||||
<el-date-picker v-model="form1.货到用户现场日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户现场开通日期">
|
||||
<el-date-picker v-model="form1.用户现场开通日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitEdit">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initContract, searchPayTimeNode, searchPayTimeNodeMoney, editPayTimeNodeOther, searchPurchaseBudget } from '@/api/PurchasingCenter/PurchaseBudgetSearch'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: '', // 采购预算查询
|
||||
data() {
|
||||
return {
|
||||
check: 0,
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
contractNumValue: '',
|
||||
contractNum: [],
|
||||
supplierName: '',
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '未来一周',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(start.getTime() + 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '未来一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
},
|
||||
dateRange: '',
|
||||
tableData1: [],
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: 0,
|
||||
tableData2: [],
|
||||
dialogVisible1: false,
|
||||
form1: {
|
||||
采购合同流水号: '',
|
||||
项目预验收日期: '',
|
||||
项目终验收日期: '',
|
||||
发货日期: '',
|
||||
货到用户现场日期: '',
|
||||
用户现场开通日期: ''
|
||||
},
|
||||
tableData3: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id' // 人员编号
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
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].采购合同流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
|
||||
this.supplierName ? this.check2 = 1 : this.check2 = 0
|
||||
searchPayTimeNode(this.pageCurrent1, this.pageSize1, this.check1, this.contractNumValue, this.check2, this.supplierName).then(response => {
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
searchTable2(row) {
|
||||
searchPayTimeNodeMoney(row.采购合同流水号).then(response => {
|
||||
this.tableData2 = response.data
|
||||
})
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageSize1 = val
|
||||
this.pageCurrent1 = 1
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
editDate(row) {
|
||||
this.form1.采购合同流水号 = row.采购合同流水号
|
||||
this.form1.项目预验收日期 = row.项目预验收日期
|
||||
this.form1.项目终验收日期 = row.项目终验收日期
|
||||
this.form1.发货日期 = row.发货日期
|
||||
this.form1.货到用户现场日期 = row.货到用户现场日期
|
||||
this.form1.用户现场开通日期 = row.用户现场开通日期
|
||||
this.dialogVisible1 = true
|
||||
},
|
||||
submitEdit() {
|
||||
editPayTimeNodeOther(this.form1.采购合同流水号, this.form1.项目预验收日期, this.form1.项目终验收日期, this.form1.发货日期, this.form1.货到用户现场日期, this.form1.用户现场开通日期).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('设置成功')
|
||||
this.dialogVisible1 = false
|
||||
this.searchTable1()
|
||||
this.tableData2 = []
|
||||
} else { this.$message.error('设置失败') }
|
||||
})
|
||||
},
|
||||
searchTable3() {
|
||||
this.dateRange ? this.check = 1 : (this.check = 0, this.dateRange = '')
|
||||
searchPurchaseBudget(this.check, this.dateRange[0], this.dateRange[1]).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
},
|
||||
getSummaries(param) { // 合计
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总价'
|
||||
} else if (index === 4) {
|
||||
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)
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
}
|
||||
})
|
||||
if (!isNaN(sums[4])) {
|
||||
sums[4] = sums[4].toFixed(2)
|
||||
}
|
||||
return sums
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
span{
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
.searchForm .el-form-item{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.el-tag{
|
||||
margin: 0
|
||||
}
|
||||
.el-date-editor{
|
||||
width:300px
|
||||
}
|
||||
</style>
|
||||
@@ -1,429 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>发票号:</span>
|
||||
<el-input v-model="invoiceNum" size="small" clearable/>
|
||||
<!--<span>开票时间:</span>-->
|
||||
<!--<el-date-picker v-model="invoiceTime" size="small" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>-->
|
||||
<span>采购合同号:</span>
|
||||
<el-select v-model="contractNum" placeholder="合同号" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in contractNums"
|
||||
: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>
|
||||
<span>传送人:</span>
|
||||
<el-select v-model="transmitValue" placeholder="传送人" size="small" filterable clearable style="width:100px">
|
||||
<el-option
|
||||
v-for="item in sender"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>接收人:</span>
|
||||
<el-select v-model="recipientValue" placeholder="接收人" size="small" filterable clearable style="width:100px">
|
||||
<el-option
|
||||
v-for="item in receiver"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</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="addTable1()">增加</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
size="small"
|
||||
icon="el-icon-download"
|
||||
style="margin-left: 10px"
|
||||
>导出</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 400px" height="400px" 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="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="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="200px">
|
||||
<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.总金额 }}
|
||||
</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="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.接收人姓名==='请选择' ? '—' : scope.row.接收人姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注" min-width="200px">
|
||||
<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="editTable1(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="deleteTable1(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<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-card>
|
||||
|
||||
<el-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 300px" width="25%">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left" label-width="110px">
|
||||
<el-form-item label="采购合同号" prop="contractNum">
|
||||
<el-select v-model="form1.contractNum" placeholder="合同号" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in contractNums"
|
||||
: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="invoiceNum">
|
||||
<el-input v-model="form1.invoiceNum" size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票时间" prop="invoiceTime">
|
||||
<el-date-picker v-model="form1.invoiceTime" size="small" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"/>
|
||||
</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="传送人" prop="sendPerson">
|
||||
<el-select v-model="form1.sendPersonValue" placeholder="传送人" size="small" disabled filterable clearable style="width:100px">
|
||||
<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="接收人" prop="receivePerson">
|
||||
<el-select v-model="form1.receivePersonValue" placeholder="接收人" size="small" filterable clearable style="width:100px">
|
||||
<el-option
|
||||
v-for="item in receiver"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form1.remark" size="small"/>
|
||||
</el-form-item>
|
||||
</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="submitAdd1('form1')">确定</el-button>
|
||||
<el-button v-show="title1==='编辑'" size="small" type="primary" @click="submitEdit1('form1')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchInvoice, addInvoice, editInvoice, deleteInvoice, initSender, initReceiver, initContract } from '@/api/PurchasingCenter/ReceiptConnectionSheet'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: '', // 发票交接单
|
||||
data() {
|
||||
return {
|
||||
contractNumValue: '',
|
||||
contractNums: [],
|
||||
invoiceNum: '',
|
||||
invoiceTime: '',
|
||||
transmitValue: '',
|
||||
sender: [], // 传送人
|
||||
receiver: [], // 接收人
|
||||
recipientValue: '',
|
||||
contractNum: '',
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: 0,
|
||||
tableData1: [],
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
check3: 0,
|
||||
check4: 0,
|
||||
check5: 0,
|
||||
dialogVisible1: false,
|
||||
title1: '',
|
||||
form1: {
|
||||
contractNum: '',
|
||||
invoiceNum: '',
|
||||
invoiceNumValue: '',
|
||||
invoiceTime: '',
|
||||
money: '',
|
||||
sendPersonValue: '',
|
||||
receivePersonValue: '',
|
||||
remark: ''
|
||||
},
|
||||
rules1: {
|
||||
contractNum: [
|
||||
{ required: true, message: '请选择合同号', trigger: 'change' }
|
||||
],
|
||||
invoiceNum: [
|
||||
{ required: true, message: '请输入发票号', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'avatar',
|
||||
'name',
|
||||
'id' // 人员编号
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
initContract().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.contractNums.push({
|
||||
label: response.data[i].采购合同编号,
|
||||
name: 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].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
initReceiver().then(response => { // 接收人
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.receiver.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable1() {
|
||||
this.invoiceNum ? this.check1 = 1 : this.check1 = 0
|
||||
this.invoiceTime ? this.check2 = 1 : this.check2 = 0
|
||||
this.transmitValue ? this.check3 = 1 : this.check3 = 0
|
||||
this.recipientValue ? this.check4 = 1 : this.check4 = 0
|
||||
this.contractNum ? this.check5 = 1 : this.check5 = 0
|
||||
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.invoiceNum, this.check2, this.invoiceTime, this.check3, this.transmitValue, this.check4, this.recipientValue, this.check5, this.contractNum).then(response => {
|
||||
for (let j = 0; j < response.data.rows.length; j++) {
|
||||
if (response.data.rows[j].开票时间 !== null) {
|
||||
response.data.rows[j].开票时间 = response.data.rows[j].开票时间.substring(0, response.data.rows[j].开票时间.indexOf(' '))
|
||||
}
|
||||
if (response.data.rows[j].开票时间 === '1900/1/1') {
|
||||
response.data.rows[j].开票时间 = ''
|
||||
}
|
||||
}
|
||||
this.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable1()
|
||||
},
|
||||
addTable1() {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.title1 = '增加'
|
||||
this.dialogVisible1 = true
|
||||
this.form1.contractNum = ''
|
||||
this.form1.invoiceNum = ''
|
||||
this.form1.invoiceTime = ''
|
||||
this.form1.money = ''
|
||||
this.form1.sendPersonValue = Number(this.id)
|
||||
this.form1.receivePersonValue = ''
|
||||
this.form1.remark = ''
|
||||
},
|
||||
submitAdd1(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
const myDate = new Date()
|
||||
const year = myDate.getFullYear()
|
||||
const month = myDate.getMonth() + 1
|
||||
const date = myDate.getDate()
|
||||
const nowDate = year + '-' + month + '-' + date
|
||||
addInvoice(this.form1.contractNum, this.form1.invoiceNum, this.form1.invoiceTime, this.form1.money, this.form1.sendPersonValue, this.form1.receivePersonValue, this.form1.remark, nowDate).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data.result[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.dialogVisible1 = false
|
||||
this.searchTable1()
|
||||
} else { this.$message.error('增加失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
editTable1(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 = ''
|
||||
}
|
||||
},
|
||||
submitEdit1(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
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteTable1(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: '已取消操作'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.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