采购审核

This commit is contained in:
chenjianan
2019-05-22 19:28:13 +08:00
parent 1fd639a348
commit e6eca27508
6 changed files with 425 additions and 23 deletions

View File

@@ -0,0 +1,73 @@
import request from '@/utils/request'
// 初始化合同号
export function initContract() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_合同审核_查询数据'
}
})
}
// 初始化采购员
export function initBuyer() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '人事档案管理_人员与角色_查询数据_采购员'
}
})
}
// 查询供应商
export function searchSupplier(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5, check6, value6, check7, value7, check8, value8, check9, value9, check10, value10, check11, value11, check12, value12) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_供应商_查询数据_根据条件',
param: '供应商名称_check=' + check1 + '&供应商名称=' + value1 + '&企业性质_check=' + check2 + '&企业性质=' + value2 + '&创立日期_check=' + check3 + '&创立日期=' + value3 + '&注册资本_check=' + check4 + '&注册资本=' + value4 + '&税号_check=' + check5 + '&税号=' + value5 + '&电子信箱_check=' + check6 + '&电子信箱=' + value6 + '&地址_check=' + check7 + '&地址=' + value7 + '&帐号_check=' + check8 + '&帐号=' + value8 + '&开户行_check=' + check9 + '&开户行=' + value9 + '&电话号码_check=' + check10 + '&电话号码=' + value10 + '&传真_check=' + check11 + '&传真=' + value11 + '&货期_check=' + check12 + '&货期=' + value12
}
})
}
// 采购合同查询
export function searchTable1(pageCurrent, pageSize, check1, start, end, check2, contract, check3, name, check4, supplier) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_合同审核_查询数据',
param: '时间段_check=' + check1 + '&开始时间=' + start + '=datetime&结束时间=' + end + '=datetime&采购合同流水号_check=' + check2 + '&采购合同流水号=' + contract + '&人员编号_check=' + check3 + '&人员编号=' + name + '&供应商名称_check=' + check4 + '&供应商名称=' + supplier,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 采购合同明细查询
export function searchTable2(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_采购合同内容_查询数据',
param: '采购合同流水号=' + num
}
})
}
// 执行审核
export function submitApproval(num, num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_合同审核_采购部_修改数据',
param: '采购合同流水号=' + num + '&审核情况流水号=' + num1 + '&未通过审核原因=' + num2
}
})
}

View File

@@ -0,0 +1 @@
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><defs><style/></defs><path d="M451.1 624.2l240.3-240.3c9-9 23.7-9 32.7 0s9 23.7 0 32.7L468.6 672c-4.8 4.8-11.2 7.1-17.5 6.7-6.3.3-12.7-1.9-17.5-6.7L281 519.4c-9-9-9-23.7 0-32.7s23.7-9 32.7 0l137.4 137.5zM881.8 117H766.2c-12.8 0-23.1-10.3-23.1-23.1s10.3-23.1 23.1-23.1h138.6c12.8 0 23.1 10.3 23.1 23.1v831.9c0 12.8-10.3 23.1-23.1 23.1H119.2c-12.8 0-23.1-10.3-23.1-23.1v-832c0-12.8 10.3-23.1 23.1-23.1h138.6c12.8 0 23.1 10.3 23.1 23.1s-10.3 23.2-23 23.2H142.3v785.7h739.5V117zM396.5 70.7h231.1c12.8 0 23.1 10.3 23.1 23.1S640.4 117 627.6 117H396.5c-12.8 0-23.1-10.3-23.1-23.1s10.4-23.2 23.1-23.2z"/></svg>

After

Width:  |  Height:  |  Size: 704 B

View File

@@ -0,0 +1,306 @@
<template>
<div class="app-container">
<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-select v-model="personValue" placeholder="采购员" clearable size="small" style="width: 100px">
<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
v-loading="loading1"
:data="tableData1"
size="mini"
border
style="width: 100%;max-height: 300px;"
height="300px"
highlight-current-row
@row-click="searchTable2">
<el-table-column type="expand">
<template slot-scope="scope">
<el-form id="table" label-position="left" inline class="demo-table-expand">
<el-row>
<el-form-item label="交货日期">
{{ scope.row.交货日期 }}
</el-form-item>
</el-row>
<el-row>
<el-form-item label="支付日期">
{{ scope.row.支付日期 }}
</el-form-item>
</el-row>
<el-row>
<el-form-item label="支付方式">
{{ scope.row.支付方式 }}
</el-form-item>
</el-row>
<el-row>
<el-form-item label="开票信息">
{{ scope.row.开票信息 }}
</el-form-item>
</el-row>
<el-row>
<el-form-item label="其他说明">
{{ scope.row.其他说明 }}
</el-form-item>
</el-row>
</el-form>
</template>
</el-table-column>
<el-table-column label="采购合同号" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="130">
<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="60">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="总金额" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.合同总额 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100" fixed="right">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-edit-outline" @click="Open(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>
<div style="min-height:500px;margin: 0px auto;width:800px;border:1px solid black" v-html="returns"/>
<el-dialog :visible.sync="dialogVisible3" title="审核" center style="min-height: 300px;" width="370px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="审核是否通过" prop="审核是否通过" center>
<el-select v-model="form2.审核是否通过" size="small">
<el-option
v-for="item in approval"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="未通过审核原因" prop="未通过审核原因">
<el-input v-model="form2.未通过审核原因" :disabled="form2.审核是否通过!==2" size="small"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible3=false">取消</el-button>
<el-button type="primary" size="small" @click="submitApproval('form2')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initContract, initBuyer, searchTable1, searchTable2, submitApproval } from '@/api/PurchasingCenter/PurchaseContractReview'
export default {
data() {
return {
person: [],
personValue: '',
RMB: '',
TotalAmount: '',
check1: 0,
check2: 0,
check3: 0,
check4: 0,
startEndDate: '',
contract: '',
freight: '',
contractNumValue: '',
contractNum: [],
ProcurementContractNum: '',
supplier: '',
supplierName: '',
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
tableData1: [],
loading1: false,
dialogVisible3: false,
returns: '',
tableData01: [],
submitDisable: true,
approval: [
{
value: 1,
label: '是'
},
{
value: 2,
label: '否'
}
],
form2: {
审核是否通过: 1,
未通过审核原因: ''
},
rules2: {},
tableData2: [],
textarea: ``,
contractValue: '' // 显示表2和变更合同用的变量
}
},
created() {
this.fetchData()
this.searchTable1()
},
methods: {
fetchData() {
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].人员编号
})
}
})
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].采购合同流水号
})
}
})
},
searchTable1() {
this.tableData2 = []
this.textarea = ``
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
})
},
Open(row) {
this.dialogVisible3 = true
this.ProcurementContractNum = row.采购合同流水号
},
submitApproval(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
submitApproval(this.ProcurementContractNum, this.form2.审核是否通过, this.form2.未通过审核原因).then(response => {
if (response.data[0].result === '1') {
this.$message.success('审核成功')
this.dialogVisible3 = false
this.fetchData() // 重新初始化
this.contractNumValue = ''
this.personValue = ''
this.supplierName = ''
this.searchTable1()
this.returns = ''
} else { this.$message.error('审核失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2(row) {
this.contractValue = parseInt(row.采购合同流水号)
searchTable2(this.contractValue).then(response => {
this.returns = response.data[0].合同内容
})
}
}
}
</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>
<style>
#table .el-form-item {
margin: 0;
}
</style>

View File

@@ -99,6 +99,23 @@
</el-form>
</template>
</el-table-column>
<el-table-column label="审核情况" align="center" min-width="80">
<template slot-scope="scope">
<el-tag v-if="scope.row.审核情况内容==='未审核'" type="primary" size="small">未审核</el-tag>
<el-tag v-if="scope.row.审核情况内容==='通过审核'" type="success" size="small">已通过</el-tag>
<el-tag v-if="scope.row.审核情况内容==='未通过审核'" type="danger" size="small">未通过</el-tag>
</template>
</el-table-column>
<el-table-column label="未通过审核原因" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.未通过审核原因 ? scope.row.未通过审核原因 : '—' }}
</template>
</el-table-column>
<el-table-column label="审核时间" align="center" min-width="140">
<template slot-scope="scope">
{{ scope.row.审核时间 ? scope.row.审核时间 : '—' }}
</template>
</el-table-column>
<el-table-column label="审批情况" align="center" min-width="80">
<template slot-scope="scope">
<el-tag v-if="scope.row.审批情况内容==='未审批'" type="primary" size="small">未审批</el-tag>
@@ -106,9 +123,14 @@
<el-tag v-if="scope.row.审批情况内容==='不通过审批'" type="danger" size="small">未通过</el-tag>
</template>
</el-table-column>
<el-table-column label="未通过审批原因" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.未通过原因 ? scope.row.未通过原因 : '—' }}
</template>
</el-table-column>
<el-table-column label="审批时间" align="center" min-width="140">
<template slot-scope="scope">
{{ scope.row.审批时间 }}
{{ scope.row.审批时间 ? scope.row.审核时间 : '—' }}
</template>
</el-table-column>
<el-table-column label="采购合同号" align="center" min-width="160">
@@ -136,11 +158,6 @@
{{ 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">
<el-button :disabled="true" type="danger" size="mini" icon="el-icon-delete" @click="deleteContract(scope.row)">删除</el-button>
@@ -322,6 +339,7 @@ export default {
for (let i = 0; i < response.data.rows.length; i++) {
response.data.rows[i].审批情况内容 === '未审批' ? this.disable.push(false) : this.disable.push(true) // 删除按钮禁用
}
console.log(response.data.rows)
this.tableData1 = response.data.rows
this.total1 = response.data.total
this.loading1 = false

View File

@@ -28,10 +28,11 @@
<el-table :data="tableData1" size="mini" style="max-height: 600px" height="600px" border stripe>
<el-table-column align="center" label="采购情况" 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>
<el-tag v-if="scope.row.是否未通过" type="info" size="small">已作废</el-tag>
<el-tag v-else-if="!scope.row.人员编号" type="primary" size="small">分配</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="机床图号" width="100px">
@@ -106,10 +107,11 @@
<el-table :data="tableData2" size="mini" style="max-height: 600px" height="600px" border stripe>
<el-table-column align="center" label="采购情况" 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>
<el-tag v-if="scope.row.是否未通过" type="info" size="small">已作废</el-tag>
<el-tag v-else-if="!scope.row.人员编号" type="primary" size="small">分配</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="机床图号" width="100px">

View File

@@ -105,10 +105,11 @@
<el-table-column :selectable="selectable" align="center" type="selection"/>
<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>
<el-tag v-if="scope.row.是否未通过" type="info" size="small">已作废</el-tag>
<el-tag v-else-if="scope.row.人员编号===''" type="primary" size="small">分配</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" min-width="150px">
@@ -281,10 +282,11 @@
<el-table-column :selectable="selectable" align="center" type="selection"/>
<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>
<el-tag v-if="scope.row.是否未通过" type="info" size="small">已作废</el-tag>
<el-tag v-else-if="scope.row.人员编号===''" type="primary" size="small">分配</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" min-width="150px">
@@ -324,7 +326,7 @@
</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="100px">