add:售后合同审批页面及功能

This commit is contained in:
zhangzq
2026-01-28 14:23:40 +08:00
parent 639b4ee0da
commit d75da90e63
8 changed files with 808 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
package com.boge.modules.contract.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.boge.common.publisher.EventPublisher;
import com.boge.common.publisher.EventType;
@@ -118,5 +119,17 @@ public class ContractController {
return R.ok();
}
/**
* 审核
*/
@RequestMapping("/approval")
//@RequiresPermissions("flow:contract:delete")
public R approval(Integer contractId,String status,String approval){
contractService.update(new LambdaUpdateWrapper<ContractEntity>()
.set(ContractEntity::getStatus,status)
.set(ContractEntity::getApproval,approval)
.eq(ContractEntity::getContractId,contractId));
return R.ok();
}
}

View File

@@ -129,9 +129,10 @@ public class ContractEntity implements Serializable {
*/
private String annex;
/**
* 审核状态1待审核2审核完毕3.审核驳回'
* 审核状态0草稿1待审核2审核完毕3.审核驳回'
*/
private String status;
private String approval;
/**
* 备注'
*/

View File

@@ -2,6 +2,8 @@ package com.boge.modules.price.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.boge.common.publisher.EventPublisher;
import com.boge.common.publisher.EventType;
import com.boge.common.utils.CodeUtil;
@@ -113,4 +115,17 @@ public class PriceController {
return R.ok();
}
/**
* 审核
*/
@RequestMapping("/approval")
//@RequiresPermissions("flow:contract:delete")
public R approval(Integer priceId,String status,String approval){
priceService.update(new LambdaUpdateWrapper<PriceEntity>()
.set(PriceEntity::getStatus,status)
.set(PriceEntity::getApproval,approval)
.eq(PriceEntity::getPriceId,priceId));
return R.ok();
}
}

View File

@@ -79,7 +79,14 @@ public class PriceEntity implements Serializable {
* 备注
*/
private String remarks;
/**
* 审核状态
*/
private String status;
/**
* 审核说明
*/
private String approval;
/**
* 附件ids
*/
@@ -106,4 +113,6 @@ public class PriceEntity implements Serializable {
*/
private String pay;
}

View File

@@ -0,0 +1,590 @@
<template>
<el-dialog
append-to-body
title="合同审批"
:visible.sync="dialogVisible"
fullscreen
@close="close"
@open="open"
>
<div class="nl-theme page-container">
<div class="page-header">
<div class="logo">NOBLELIFT</div>
<div class="muted">诺力物流机器人</div>
<div class="subtitle">产品购销合同</div>
</div>
<el-row :gutter="16" style="margin-top:8px;">
<!-- 左侧主要内容 -->
<el-col :span="18" class="vertical-line">
<!-- 需方供方信息 -->
<el-row :gutter="16">
<el-col :span="12">
<el-card shadow="never">
<el-form :model="client" label-width="100px" size="small">
<el-form-item label="合同编号"><el-input disabled v-model="dataForm.contractCode" /></el-form-item>
<el-form-item label="需方">
<el-select
v-model="dataForm.clientId"
disabled
clearable>
<el-option v-for="item in dictData[1]" :key="item.key" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="供方"><el-input disabled v-model="dataForm.finc" /></el-form-item>
</el-form>
</el-card>
</el-col>
<el-col :span="12">
<el-card shadow="never">
<el-form :model="dataForm" label-width="100px" size="small">
<el-form-item label="生效日期"><el-date-picker disabled v-model="dataForm.effectiveTime" type="date" value-format="yyyy-MM-dd" /></el-form-item>
<el-form-item label="合同类型"><el-input disabled v-model="dataForm.contractType" /></el-form-item>
<el-form-item label="项目类型"><el-input disabled v-model="dataForm.projectType" /></el-form-item>
</el-form>
</el-card>
</el-col>
</el-row>
<!-- 物料明细表格 -->
<div class="clause-item" style="margin-top:12px;">
<strong> 产品明细</strong>
</div>
<el-card shadow="never">
<el-table :data="materData" border style="width:100%" size="small" show-summary :summary-method="summaryMethod" header-cell-class-name="nl-table-header" cell-class-name="nl-table-cell">
<el-table-column label="序号" type="index" width="60" />
<el-table-column label="物料名称" prop="materialName" width="150" />
<el-table-column label="物料型号" prop="materialName" width="150" />
<el-table-column label="数量" prop="qty" width="100" />
<el-table-column label="单位" prop="unitName" width="60" />
<el-table-column label="未税收费价" prop="salePrice" width="120" />
<el-table-column label="税率%" prop="tax" width="120" />
<el-table-column label="总价" prop="amount" width="120" :formatter='tamount'/>
<el-table-column label="备注" prop="remark" width="120" />
</el-table>
</el-card>
<div style="margin:24px 0; text-align:right;"/>
<!-- 条款 -->
<div class="clauses-section">
<div class="clause-item">
<strong> 质量要求技术标准供方对质量负责的条件和期限:</strong>
<span>{{ dataForm.qc }}</span>
</div>
<div class="clause-item">
<strong> 售后服务:</strong>
<span>{{ dataForm.afterSales }}</span>
</div>
<div class="clause-item">
<strong> 交货时间地点:</strong>
货期: <span>{{ dataForm.delivery }}</span>
交货地: <span>{{ dataForm.place }}</span>
</div>
<div class="clause-item">
<strong> 运输方式及到达站和费用负担:</strong>
<span>{{ dataForm.transport }}</span>
</div>
<div class="clause-item">
<strong> 包装标准:</strong>
<span>{{ dataForm.packaging }}</span>
</div>
<div class="clause-item">
<strong> 结算方式:</strong>
<span>{{ dataForm.pay }}</span>
付款方式: <span>{{ dataForm.payment }}</span>
</div>
<div class="clause-item">
<strong> 违约责任:</strong>
<span>{{ dataForm.breach }}</span>
</div>
<div class="clause-item">
<strong> 解决合同纠纷的方式:</strong>
<span>{{ dataForm.solveDispute }}</span>
</div>
<div class="clause-item">
<strong> 其它约定事项:</strong>
<span>{{ dataForm.supplement }}</span>
</div>
</div>
<!-- 底部签字盖章 -->
<div style="margin:24px 0; text-align:right;"/>
<el-row :gutter="16">
<el-col :span="12">
<el-card shadow="never">
<el-form :model="client" label-width="100px" size="small">
<strong>需方</strong>
<el-form-item label="单位名称:">
<span size="mini">{{client.name}}</span>盖章
</el-form-item>
<el-form-item label="地址:">
<span size="mini">{{client.address}}</span>
</el-form-item>
<el-form-item label="委托代理人:">
<span size="mini">{{client.juridical_person}}</span>
</el-form-item>
<el-form-item label="电话:">
<span size="mini">{{client.tel}}</span>
</el-form-item>
<el-form-item label="传真:">
<span size="mini">{{client.fax}}</span>
</el-form-item>
<el-form-item label="开户银行:">
<span size="mini">{{client.bank}}</span>
</el-form-item>
<el-form-item label="银行卡号:">
<span size="mini">{{client.card}}</span>
</el-form-item>
</el-form>
</el-card>
</el-col>
<el-col :span="12">
<el-card shadow="never">
<el-form :model="supply" label-width="100px" size="small">
<strong>供方</strong>
<el-form-item label="单位名称:">
<span size="mini">{{supply.name}}</span>盖章
</el-form-item>
<el-form-item label="地址:">
<span size="mini">{{supply.address}}</span>
</el-form-item>
<el-form-item label="委托代理人:">
<span size="mini">{{supply.juridical_person}}</span>
</el-form-item>
<el-form-item label="电话:">
<span size="mini">{{supply.tel}}</span>
</el-form-item>
<el-form-item label="传真:">
<span size="mini">{{supply.fax}}</span>
</el-form-item>
<el-form-item label="开户银行:">
<span size="mini">{{supply.bank}}</span>
</el-form-item>
<el-form-item label="银行卡号:">
<span size="mini">{{supply.card}}</span>
</el-form-item>
</el-form>
</el-card>
</el-col>
</el-row>
<!-- 备注与附件 -->
<el-card shadow="never" style="margin-top:12px;">
<template #header>
<span class="panel-title">其他注意事项</span>
</template>
<div>{{ dataForm.remarks }}</div>
<template #header>
<span class="panel-title">附件</span>
</template>
<el-table :data="fileList" border size="small" style="margin-top:8px;">
<el-table-column label="文件名" prop="name" />
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleLoad(scope.row)">下载</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
<!-- 右侧审批栏 -->
<el-col :span="6">
<div class="approval-sidebar">
<div class="sidebar-content">
<div class="sidebar-header">审批</div>
<!-- 处理意见输入 -->
<div class="opinion-input">
<el-input
type="textarea"
v-model="approvalForm.remark"
placeholder="请输入处理意见"
rows="6"
>
</el-input>
<el-radio-group v-model="approvalForm.result" style="margin-top:12px;">
<el-radio label="同意" border size="small">同意</el-radio>
<el-radio label="驳回" border size="small">驳回</el-radio>
</el-radio-group>
<div class="approval-actions">
<el-button type="primary" size="small" @click="submitApproval">提交</el-button>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
</div>
</el-dialog>
</template>
<script>
import { apiUtils } from '@/utils/dict'
export default {
name: 'ApprovalDialog',
data () {
return {
approvalForm: {
remark: '',
result: ''
},
dataForm: {
contractId: '',
contractType: '',
projectType: '',
contractCode: '',
clientId: '',
finc: '上海诺力智能科技有限公司',
effectiveTime: null,
qc: '',
afterSales: '',
delivery: '',
place: '',
transport: '',
packaging: '',
pay: '',
payment: '',
breach: '',
solveDispute: '',
supplement: '',
remarks: '',
annex: '',
materialJson: []
},
client: {
name: '',
address: '',
juridical_person: '',
tel: '',
fax: '',
bank: '',
card: ''
},
supply: {
name: '上海诺力智能科技有限公司',
address: '上海市青浦区高光路215弄99号4号楼302室',
juridical_person: '委托代理人',
tel: '021-39888170',
fax: '',
bank: '招商银行上海虹桥支行',
card: '121917025010901'
},
fileList: [],
materData: [],
dialogVisible: false
}
},
props: {
dialogShow: {
type: Boolean,
default: false
},
dictData: Array
},
mixins: [apiUtils],
watch: {
dialogShow: {
handler (newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
init (id) {
this.dataForm.contractId = id
this.dialogVisible = true
this.$nextTick(() => {
this.materData = []
if (this.dataForm.contractId) {
this.$http({
url: this.$http.adornUrl(`/flow/contract/info/${this.dataForm.contractId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 200) {
this.dataForm.contractId = data.contract.contractId
this.dataForm.contractType = data.contract.contractType
this.dataForm.projectType = data.contract.projectType
this.dataForm.contractCode = data.contract.contractCode
this.dataForm.totalPrice = data.contract.totalPrice
this.dataForm.clientId = data.contract.clientId
this.dataForm.materialJson = data.contract.materialJson
this.dataForm.effectiveTime = data.contract.effectiveTime
this.dataForm.qc = data.contract.qc
this.dataForm.afterSales = data.contract.afterSales
this.dataForm.delivery = data.contract.delivery
this.dataForm.place = data.contract.place
this.dataForm.transport = data.contract.transport
this.dataForm.pay = data.contract.pay
this.dataForm.payment = data.contract.payment
this.dataForm.breach = data.contract.breach
this.dataForm.solveDispute = data.contract.solveDispute
this.dataForm.supplement = data.contract.supplement
this.dataForm.packaging = data.contract.packaging
this.dataForm.annex = data.contract.annex
this.dataForm.remarks = data.contract.remarks
this.materData = JSON.parse(data.contract.materialJson)
this.client = data.contract.client
this.getFileUrl(data.contract.annex)
}
})
}
})
},
getFileUrl (annex) {
if (!annex) return
this.$http({
url: this.$http.adornUrl('/api/localStorage'),
method: 'get',
params: this.$http.adornParams({'annex': annex})
}).then(({data}) => {
this.fileList = [...data]
})
},
handleLoad (file) {
if (file.storageId == undefined) {
const url = URL.createObjectURL(file.raw)
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
const fileName = file.name
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} else {
this.$http({
url: this.$http.adornUrl('/api/localStorage/download'),
responseType: 'blob',
params: this.$http.adornParams({'storageId': file.storageId})
}).then(({data}) => {
const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
const fileName = file.name
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
}
},
open () {
this.dialogVisible = true
},
close () {
this.dialogVisible = false
this.dataForm = {
contractId: '',
contractType: '',
projectType: '',
contractCode: '',
clientId: '',
finc: '上海诺力智能科技有限公司',
effectiveTime: null,
qc: '',
afterSales: '',
delivery: '',
place: '',
transport: '',
packaging: '',
pay: '',
payment: '',
breach: '',
solveDispute: '',
supplement: '',
remarks: '',
annex: '',
materialJson: []
}
this.approvalForm = {
remark: '',
result: ''
}
this.fileList = []
this.materData = []
},
tamount (row, index) {
const amount = (row.qty * row.salePrice * (1 + row.tax / 100)).toFixed(2)
return amount
},
summaryMethod (params) {
const { columns, data } = params
const sums = []
let totalAmount = 0
data.forEach(row => {
totalAmount += Number((row.qty * row.salePrice * (1 + row.tax / 100)).toFixed(2)) || 0
})
columns.forEach((col, idx) => {
if (idx === 6) sums[idx] = '合计'
else if (col.property === 'amount') sums[idx] = totalAmount.toFixed(2)
else sums[idx] = ''
})
return sums
},
// 提交审批
submitApproval () {
// 验证是否选择了审批结果
if (!this.approvalForm.result) {
this.$message.error('请选择审批结果')
return
}
// 验证是否填写了处理意见
if (!this.approvalForm.remark) {
this.$message.error('请输入处理意见')
return
}
// 根据审批结果设置status值同意为2驳回为3
const status = this.approvalForm.result === '同意' ? '2' : '3'
// 调用后端接口
this.$http({
url: this.$http.adornUrl('/flow/contract/approval'),
method: 'get',
params: this.$http.adornParams({
'contractId': this.dataForm.contractId,
'status': status,
'approval': this.approvalForm.remark
})
}).then(({data}) => {
if (data && data.code === 200) {
this.$message({
message: '审批提交成功',
type: 'success',
duration: 1500
})
// 清空审批表单
this.approvalForm.remark = ''
this.approvalForm.result = ''
// 关闭对话框
this.close()
// 通知父组件刷新列表
this.$emit('refreshDataList')
} else {
this.$message.error(data.msg || '审批提交失败')
}
}).catch(() => {
this.$message.error('审批提交失败,请稍后重试')
})
}
}
}
</script>
<style scoped>
:root { --header-bg: #f6f8fb; --border: #f1efef; --primary:#1E90FF; }
body { background:#f3f5f7; color:#222; }
.page-container { max-width: 1400px; margin: 24px auto; }
.page-header { border-radius:12px; padding:12px 16px; display:flex; align-items:center; gap:16px; }
.logo { font-weight:800; font-size:26px; color:#ff5a36; letter-spacing:1px; }
.muted { color:#666; font-size:13px; }
.subtitle {position: absolute;
left: 40%; color:#333; font-weight:800; font-size:24px; }
.panel-title { font-weight:700; font-size:14px; color:#334; }
.vertical-line {
position: relative;
}
.clause-item {
margin-bottom: 20px;
}
.vertical-line::after {
content: '';
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
height: 120%;
width: 1px;
background-color: #e0e0e0;
}
/* 主题覆盖使Element Plus风格更贴近原始样式 */
.nl-theme {
--el-color-primary: var(--primary);
--el-border-color: var(--border);
--el-border-radius-small: 6px;
--el-border-radius-base: 8px;
--el-box-shadow-light: none;
}
.nl-theme .el-card { border:1px solid var(--border); box-shadow:none; }
.nl-theme .el-card__header { background:#f6f8fb; padding:10px 14px; font-weight:700; }
.nl-theme .el-form-item { margin-bottom:8px; }
.nl-theme .el-form-item__label { color:#333; font-size:13px; font-weight:600; }
.nl-theme .el-input--small .el-input__wrapper,
.nl-theme .el-select--small .el-select__wrapper { min-height:28px; }
.nl-theme .el-input__wrapper, .nl-theme .el-select__wrapper { box-shadow:none; border:1px solid var(--border); }
.nl-theme .el-button--primary { background: var(--primary); border-color: var(--primary); }
.nl-theme .el-button--primary.is-plain { color: var(--primary); background:#fff; }
/* 表格细节对齐 */
.nl-theme .el-table { font-size:13px; }
.nl-theme .el-table thead { background:#f7f9fc; }
.nl-theme .el-table__header-wrapper th { background:#f7f9fc; font-weight:600; color:#334; }
.nl-theme .el-table__row { height:36px; }
.nl-theme .nl-table-header { background:#f7f9fc; }
.nl-theme .nl-table-cell { padding:8px 10px; }
/* 右侧审批栏:与左侧高度完全一致,优化内容分布 */
.approval-sidebar {
width: 100%;
background-color: #fff;
padding: 20px 24px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border: 1px solid #eee;
align-self: stretch;
}
/* 审批栏内部容器用flex分布内容底部按钮固定 */
.sidebar-content {
display: flex;
flex-direction: column;
height: 100%;
gap: 6px;
}
.sidebar-header {
font-size: 16px;
font-weight: bold;
padding: 10px 0;
border-bottom: 1px solid #e5e5e5;
color: #333;
margin-bottom: 4px;
}
/* 意见输入框:占满中间空间 */
.opinion-input {
flex: 1;
min-height: 120px;
margin-top: 4px;
}
/* 底部操作按钮:固定在审批栏底部 */
.approval-actions {
display: flex;
gap: 10px;
justify-content: flex-end;
padding-top: 12px;
border-top: 1px solid #eee;
margin-top: 12px;
}
/* 响应式适配 */
@media (max-width: 992px) {
.approval-sidebar {
width: 100%;
margin-top: 20px;
}
}
@media (max-width: 576px) {
.approval-sidebar {
padding: 15px;
}
}
.clauses-section {
margin: 20px 0;
}
</style>

View File

@@ -107,12 +107,32 @@
fixed="right"
header-align="center"
align="center"
width="150"
width="200"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.contractId)">修改</el-button>
<el-button type="text" size="small" @click="addTempHandle(scope.row.contractId)">模板</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.contractId)">删除</el-button>
<!-- status为0时显示修改模版删除提交按钮 -->
<template v-if="scope.row.status == 0">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.contractId)">修改</el-button>
<el-button type="text" size="small" @click="addTempHandle(scope.row.contractId)">模版</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.contractId)">删除</el-button>
<el-button type="text" size="small" @click="submitHandle(scope.row.contractId)">提交</el-button>
</template>
<!-- status为1未审核时显示修改模版审核按钮 -->
<template v-else-if="scope.row.status == 1">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.contractId)">修改</el-button>
<el-button type="text" size="small" @click="addTempHandle(scope.row.contractId)">模版</el-button>
<el-button type="text" size="small" @click="approvalHandle(scope.row.contractId)">审核</el-button>
</template>
<!-- status为2审核通过时显示模版按钮 -->
<template v-else-if="scope.row.status == 2">
<el-button type="text" size="small" @click="addTempHandle(scope.row.contractId)">模版</el-button>
</template>
<!-- status为3审核拒绝时显示修改模版提交按钮 -->
<template v-else-if="scope.row.status == 3">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.contractId)">修改</el-button>
<el-button type="text" size="small" @click="addTempHandle(scope.row.contractId)">模版</el-button>
<el-button type="text" size="small" @click="submitHandle(scope.row.contractId)">提交</el-button>
</template>
</template>
</el-table-column>
</el-table>
@@ -127,6 +147,7 @@
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :dictData="dictData" @refreshDataList="getDataList"></add-or-update>
<approval-visable v-if="approvalHandleVisible" ref="approvalVisable" :dictData="dictData" @refreshDataList="getDataList"></approval-visable>
<temp-add-or-update v-if="tempVisible" ref="tempAdd" :dictData="dictData"></temp-add-or-update>
</div>
</template>
@@ -134,6 +155,7 @@
<script>
import AddOrUpdate from './contract-add-or-update'
import TempAddOrUpdate from './temp-add-or-update'
import ApprovalVisable from './approval'
import { apiUtils } from '@/utils/dict'
export default {
data () {
@@ -150,11 +172,13 @@
addOrUpdateVisible: false,
tempVisible: false,
dictConfigs: [{type: 'dict', code: 'contract_type'}, {url: '/client/client/list', type: 'list', value: 'clientId', label: 'clientName'}],
statusOpt: [{value: '1', label: '未审核'}, {value: '2', label: '审核通过'}, {value: '3', label: '审核驳回'}]
statusOpt: [{value: '0', label: '草稿'}, {value: '1', label: '未审核'}, {value: '2', label: '审核通过'}, {value: '3', label: '审核驳回'}],
approvalHandleVisible: false
}
},
mixins: [apiUtils],
components: {
ApprovalVisable,
AddOrUpdate,
TempAddOrUpdate
},
@@ -242,6 +266,45 @@
this.$nextTick(() => {
this.$refs.tempAdd.init(id)
})
},
// 审核
approvalHandle (id) {
this.approvalHandleVisible = true
this.$nextTick(() => {
this.$refs.approvalVisable.init(id)
})
},
// 提交审核
submitHandle (id) {
this.$confirm('确定要提交该合同进行审核吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/flow/contract/approval'),
method: 'get',
params: this.$http.adornParams({
'contractId': id,
'status': '1'
})
}).then(({data}) => {
if (data && data.code === 200) {
this.$message({
message: '提交成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg || '提交失败')
}
}).catch(() => {
this.$message.error('提交失败,请稍后重试')
})
}).catch(() => {})
}
}
}

View File

@@ -643,6 +643,53 @@ export default {
})
this.dataForm.totalPrice = totalAmount
return sums
},
// 提交审批
submitApproval () {
// 验证是否选择了审批结果
if (!this.approvalForm.result) {
this.$message.error('请选择审批结果')
return
}
// 验证是否填写了处理意见
if (!this.approvalForm.remark) {
this.$message.error('请输入处理意见')
return
}
// 根据审批结果设置status值同意为2驳回为3
const status = this.approvalForm.result === '同意' ? '2' : '3'
// 调用后端接口
this.$http({
url: this.$http.adornUrl('/flow/price/approval'),
method: 'get',
params: this.$http.adornParams({
'priceId': this.dataForm.priceId,
'status': status,
'approval': this.approvalForm.remark
})
}).then(({data}) => {
if (data && data.code === 200) {
this.$message({
message: '审批提交成功',
type: 'success',
duration: 1500
})
// 清空审批表单
this.approvalForm.remark = ''
this.approvalForm.result = ''
// 关闭对话框
this.close()
// 通知父组件刷新列表
this.$emit('refreshDataList')
} else {
this.$message.error(data.msg || '审批提交失败')
}
}).catch(() => {
this.$message.error('审批提交失败,请稍后重试')
})
}
}
}

View File

@@ -104,17 +104,43 @@
{{ statusOpt | findByValue(scope.row.status) }}
</template>
</el-table-column>
<el-table-column
prop="approval"
header-align="center"
align="center"
show-overflow-tooltip="true"
label="审核说明">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
width="200"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.priceId)">修改</el-button>
<el-button type="text" size="small" @click="addTempHandle(scope.row.priceId)">模板</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.priceId)">删除</el-button>
<el-button type="text" size="small" @click="approvalHandle(scope.row.priceId)">审批</el-button>
<!-- status为0时显示修改模版删除提交按钮 -->
<template v-if="scope.row.status == 0">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.priceId)">修改</el-button>
<el-button type="text" size="small" @click="addTempHandle(scope.row.priceId)">模版</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.priceId)">删除</el-button>
<el-button type="text" size="small" @click="submitHandle(scope.row.priceId)">提交</el-button>
</template>
<!-- status为1未审核时显示修改模版审核按钮 -->
<template v-else-if="scope.row.status == 1">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.priceId)">修改</el-button>
<el-button type="text" size="small" @click="addTempHandle(scope.row.priceId)">模版</el-button>
<el-button type="text" size="small" @click="approvalHandle(scope.row.priceId)">审核</el-button>
</template>
<!-- status为2审核通过时显示模版按钮 -->
<template v-else-if="scope.row.status == 2">
<el-button type="text" size="small" @click="addTempHandle(scope.row.priceId)">模版</el-button>
</template>
<!-- status为3审核拒绝时显示修改模版提交按钮 -->
<template v-else-if="scope.row.status == 3">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.priceId)">修改</el-button>
<el-button type="text" size="small" @click="addTempHandle(scope.row.priceId)">模版</el-button>
<el-button type="text" size="small" @click="submitHandle(scope.row.priceId)">提交</el-button>
</template>
</template>
</el-table-column>
</el-table>
@@ -155,7 +181,7 @@
approvalHandleVisible: false,
tempVisible: false,
dictConfigs: [{type: 'dict', code: 'contract_type'}, {url: '/client/client/list', type: 'list', value: 'clientId', label: 'clientName'}, {url: '/sys/user/list', type: 'list', value: 'userId', label: 'username'}],
statusOpt: [{value: '1', label: '未审核'}, {value: '2', label: '审核通过'}, {value: '3', label: '审核驳回'}]
statusOpt: [{value: '0', label: '草稿'}, {value: '1', label: '未审核'}, {value: '2', label: '审核通过'}, {value: '3', label: '审核驳回'}]
}
},
mixins: [apiUtils],
@@ -255,6 +281,38 @@
this.$nextTick(() => {
this.$refs.tempAdd.init(id)
})
},
// 提交审核
submitHandle (id) {
this.$confirm('确定要提交该报价单进行审核吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/flow/price/approval'),
method: 'get',
params: this.$http.adornParams({
'priceId': id,
'status': '1'
})
}).then(({data}) => {
if (data && data.code === 200) {
this.$message({
message: '提交成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg || '提交失败')
}
}).catch(() => {
this.$message.error('提交失败,请稍后重试')
})
}).catch(() => {})
}
}
}