@ -132,8 +132,15 @@
< el -table -column label = "合同税率(预留)" align = "center" prop = "taxRate" v -if = " columns [ 23 ] .visible " / >
< el -table -column label = "合同税率(预留)" align = "center" prop = "taxRate" v -if = " columns [ 23 ] .visible " / >
< el -table -column label = "终版合同" align = "center" width = "100" v-if ="columns[32].visible" >
< el -table -column label = "终版合同" align = "center" width = "100" v-if ="columns[32].visible" >
< template # default = "scope" >
< template # default = "scope" >
< el -button v-if ="scope.row.signatureAppendix" link type="primary" icon="Download" @click="downloadFinalContract(scope.row.signatureAppendix)" > 下 载 < / el -button >
< el -button
< span v -else style = "color: #999;" > 未上传 < / span >
v - if = "scope.row.signatureAppendix"
link
type = "primary"
icon = "Download"
@ click = "downloadFinalContract(scope.row.signatureAppendix)"
> 下载
< / e l - b u t t o n >
< span v -else style = "color: #999" > 未上传 < / span >
< / template >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "备注" align = "center" prop = "remark" v -if = " columns [ 24 ] .visible " / >
< el -table -column label = "备注" align = "center" prop = "remark" v -if = " columns [ 24 ] .visible " / >
@ -159,23 +166,25 @@
< el -tooltip content = "修改" placement = "top" >
< el -tooltip content = "修改" placement = "top" >
< el -button link type = "primary" icon = "Edit" @click ="handleUpdate(scope.row)" v-hasPermi ="['oa/erp:contractInfo:edit']" > < / el -button >
< el -button link type = "primary" icon = "Edit" @click ="handleUpdate(scope.row)" v-hasPermi ="['oa/erp:contractInfo:edit']" > < / el -button >
< / e l - t o o l t i p >
< / e l - t o o l t i p >
<!-- < el -tooltip content = "删除" placement = "top" > -- >
<!-- < el -tooltip content = "删除" placement = "top" > -- >
<!-- < el -button link type = "primary" icon = "Delete" @click ="handleDelete(scope.row)" v-hasPermi ="['oa/erp:contractInfo:remove']" > < / el -button > -- >
<!-- < el -button link type = "primary" icon = "Delete" @click ="handleDelete(scope.row)" v-hasPermi ="['oa/erp:contractInfo:remove']" > < / el -button > -- >
<!-- < / e l - t o o l t i p > - - >
<!-- < / e l - t o o l t i p > - - >
< el -tooltip content = "上传终版合同" placement = "top" v-if ="!scope.row.signatureAppendix" >
< el -button link type = "success" icon = "Upload" @click ="openUploadFinalDialog(scope.row)" v-hasPermi ="['oa/erp:contractInfo:edit']" > < / el -button >
< / e l - t o o l t i p >
< el -tooltip content = "提交审批" placement = "top" v-if ="scope.row.contractStatus === '1'" >
< el -button link type = "warning" icon = "Check" @click ="handleSubmitApproval(scope.row)" v-hasPermi ="['oa/erp:contractInfo:edit']" > < / el -button >
< / e l - t o o l t i p >
< el -tooltip content = "审批记录" placement = "top" v-if ="scope.row.contractStatus === '2' || scope.row.contractStatus === '3'" >
< el -tooltip content = "审批记录" placement = "top" v-if ="scope.row.contractStatus === '2' || scope.row.contractStatus === '3'" >
< el -button link type = "info" icon = "View" @click ="handleApprovalRecord(scope.row)" > < / el -button >
< el -button link type = "info" icon = "View" @click ="handleApprovalRecord(scope.row)" > < / el -button >
< / e l - t o o l t i p >
< / e l - t o o l t i p >
< el -tooltip content = "上传终版合同" placement = "top" v-if ="!scope.row.signatureAppendix" >
< el -button
link
type = "success"
icon = "Upload"
@ click = "openUploadFinalDialog(scope.row)"
v - hasPermi = "['oa/erp:contractInfo:edit']"
> < / e l - b u t t o n >
< / e l - t o o l t i p >
< / template >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< / e l - t a b l e >
< pagination v -show = " total > 0 " :total=" total " v-model:page=" queryParams . pageNum " v-model:limit=" queryParams . pageSize " @pagination=" getList " / >
< pagination v -show = " total > 0 " :total=" total " v-model:page=" queryParams . pageNum " v-model:limit=" queryParams . pageSize " @pagination=" getList " / >
< / e l - c a r d >
< / e l - c a r d >
<!-- 上传终版合同对话框 -- >
<!-- 上传终版合同对话框 -- >
@ -192,11 +201,8 @@
< / div >
< / div >
< / template >
< / template >
< / e l - d i a l o g >
< / e l - d i a l o g >
<!-- 审批记录 -- >
<!-- 审批记录 -- >
< ApprovalRecord ref = "approvalRecordRef" / >
< ApprovalRecord ref = "approvalRecordRef" / >
<!-- 提交审批组件 -- >
< SubmitVerify ref = "submitVerifyRef" :task-variables ="taskVariables" @submit-callback ="submitCallback" / >
< / div >
< / div >
< / template >
< / template >
@ -205,6 +211,7 @@ import { listContractInfo, delContractInfo } from '@/api/oa/erp/contractInfo';
import { ContractInfoVO , ContractInfoQuery } from '@/api/oa/erp/contractInfo/types' ;
import { ContractInfoVO , ContractInfoQuery } from '@/api/oa/erp/contractInfo/types' ;
import { updateContractInfo } from '@/api/oa/erp/contractInfo' ;
import { updateContractInfo } from '@/api/oa/erp/contractInfo' ;
import download from '@/plugins/download' ;
import download from '@/plugins/download' ;
import ApprovalRecord from '@/components/Process/approvalRecord.vue' ;
const { proxy } = getCurrentInstance ( ) as ComponentInternalInstance ;
const { proxy } = getCurrentInstance ( ) as ComponentInternalInstance ;
const route = useRoute ( ) ;
const route = useRoute ( ) ;
@ -213,6 +220,7 @@ const { contract_category, business_direction, active_flag, contract_flag, contr
proxy ? . useDict ( 'contract_category' , 'business_direction' , 'active_flag' , 'contract_flag' , 'contract_type' , 'contract_status' )
proxy ? . useDict ( 'contract_category' , 'business_direction' , 'active_flag' , 'contract_flag' , 'contract_type' , 'contract_status' )
) ;
) ;
const approvalRecordRef = ref < InstanceType < typeof ApprovalRecord > > ( ) ;
const contractInfoList = ref < ContractInfoVO [ ] > ( [ ] ) ;
const contractInfoList = ref < ContractInfoVO [ ] > ( [ ] ) ;
const loading = ref ( true ) ;
const loading = ref ( true ) ;
const showSearch = ref ( true ) ;
const showSearch = ref ( true ) ;
@ -336,7 +344,9 @@ const handleAdd = () => {
proxy . $tab . closePage ( route ) ;
proxy . $tab . closePage ( route ) ;
router . push ( {
router . push ( {
path : '/contract/contractInfo/edit' ,
path : '/contract/contractInfo/edit' ,
query : { }
query : {
type : 'add'
}
} ) ;
} ) ;
} ;
} ;
@ -346,7 +356,8 @@ const handleUpdate = (row?: ContractInfoVO) => {
router . push ( {
router . push ( {
path : '/contract/contractInfo/edit' ,
path : '/contract/contractInfo/edit' ,
query : {
query : {
id : _contractId
id : _contractId ,
type : 'update'
}
}
} ) ;
} ) ;
} ;
} ;
@ -405,71 +416,8 @@ const downloadFinalContract = (ossId: string | number) => {
download . oss ( ossId ) ;
download . oss ( ossId ) ;
} ;
} ;
/ / 提 交 审 批
const handleSubmitApproval = async ( row : ContractInfoVO ) => {
try {
/ / 添 加 确 认 弹 框
await proxy ? . $modal . confirm ( '确认提交该合同进行审批?' ) ;
/ / 启 动 审 批 流 程
const submitFormData : StartProcessBo = {
businessId : row . contractId . toString ( ) ,
flowCode : 'OAC' , / / 使 用 现 有 的 流 程 定 义 , 后 续 可 以 创 建 专 门 的 合 同 审 批 流 程
variables : {
/ / 合 同 相 关 的 流 程 变 量
contractId : row . contractId ,
contractName : row . contractName ,
totalPrice : row . totalPrice
} ,
bizExt : {
businessTitle : '合同审批' ,
businessCode : row . contractId
}
} ;
/ / 设 置 任 务 变 量
taskVariables . value = {
contractId : row . contractId ,
contractName : row . contractName ,
totalPrice : row . totalPrice ,
contractCode : row . contractCode
} ;
/ / 启 动 流 程 并 获 取 任 务 I D
const resp = await startWorkFlow ( submitFormData ) ;
/ / 更 新 合 同 状 态 为 审 批 中
await updateContractInfo ( {
contractId : row . contractId ,
contractStatus : '2' ,
flowStatus : 'waiting'
} as any ) ;
/ / 自 动 打 开 审 批 对 话 框 , 调 用 第 一 个 审 批 节 点
if ( submitVerifyRef . value && resp . data && resp . data . taskId ) {
submitVerifyRef . value . openDialog ( resp . data . taskId ) ;
} else {
proxy ? . $modal . msgSuccess ( '审批流程已启动' ) ;
await getList ( ) ;
}
} catch ( error ) {
/ / 用 户 取 消 操 作 时 不 显 示 错 误
if ( error === 'cancel' ) {
return ;
}
console . error ( '提交审批失败:' , error ) ;
proxy ? . $modal . msgError ( '提交审批失败,请重试' ) ;
}
} ;
/ / 查 看 审 批 记 录
/ / 查 看 审 批 记 录
const handleApprovalRecord = ( row : ContractInfoVO ) => {
const handleApprovalRecord = ( row : ContractInfoVO ) => {
approvalRecordRef . value ? . init ( row . contractId ) ;
approvalRecordRef . value ? . init ( row . contractId ) ;
} ;
} ;
/ / 审 批 提 交 回 调
const submitCallback = async ( ) => {
proxy ? . $modal . msgSuccess ( '审批操作成功' ) ;
await getList ( ) ;
} ;
< / script >
< / script >