@ -130,6 +130,12 @@
< el -table -column label = "付款方式" align = "center" prop = "paymentMethod" v -if = " columns [ 21 ] .visible " / >
< el -table -column label = "付款方式" align = "center" prop = "paymentMethod" v -if = " columns [ 21 ] .visible " / >
< el -table -column label = "签字合同附件" align = "center" prop = "signatureAppendix" v -if = " columns [ 22 ] .visible " / >
< el -table -column label = "签字合同附件" align = "center" prop = "signatureAppendix" v -if = " columns [ 22 ] .visible " / >
< 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" >
< template # default = "scope" >
< el -button v-if ="scope.row.signatureAppendix" link type="primary" icon="Download" @click="downloadFinalContract(scope.row.signatureAppendix)" > 下 载 < / el -button >
< span v -else style = "color: #999;" > 未上传 < / span >
< / template >
< / 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 " / >
< el -table -column label = "激活标识" align = "center" prop = "activeFlag" v-if ="columns[25].visible" >
< el -table -column label = "激活标识" align = "center" prop = "activeFlag" v-if ="columns[25].visible" >
< template # default = "scope" >
< template # default = "scope" >
@ -148,26 +154,46 @@
< span > { { parseTime ( scope . row . updateTime , '{y}-{m}-{d} {h}:{i}:{s}' ) } } < / span >
< span > { { parseTime ( scope . row . updateTime , '{y}-{m}-{d} {h}:{i}:{s}' ) } } < / 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" fixed= "right" class -name = " small -padding fixed -width " >
< el -table -column label = "操作" align = "center" width= "100" fixed= "right" class -name = " small -padding fixed -width " >
< template # default = "scope" >
< template # default = "scope" >
< 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 > - - >
< 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 >
< / 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 >
<!-- 上传终版合同对话框 -- >
< el -dialog v -model = " uploadDialog.visible " title = "上传终版合同" width = "520px" append -to -body >
< el -form :model ="uploadDialog.form" label -width = " 100px " >
< el -form -item label = "签字合同附件" >
< fileUpload v -model = " uploadDialog.form.oss " :limit ="1" / >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< template # footer >
< div class = "dialog-footer" >
< el -button type = "primary" :loading ="uploadDialog.loading" @click ="confirmUploadFinal" > 确 定 < / el -button >
< el -button @ click = "uploadDialog.visible = false" > 取 消 < / e l - b u t t o n >
< / div >
< / template >
< / e l - d i a l o g >
< / div >
< / div >
< / template >
< / template >
< script setup name = "ContractInfo" lang = "ts" >
< script setup name = "ContractInfo" lang = "ts" >
import { listContractInfo , delContractInfo } from '@/api/oa/erp/contractInfo' ;
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 download from '@/plugins/download' ;
const { proxy } = getCurrentInstance ( ) as ComponentInternalInstance ;
const { proxy } = getCurrentInstance ( ) as ComponentInternalInstance ;
const { contract _category , business _direction , active _flag , contract _flag , contract _type , contract _status } = toRefs < any > (
const { contract _category , business _direction , active _flag , contract _flag , contract _type , contract _status } = toRefs < any > (
@ -217,7 +243,8 @@ const columns = ref<FieldOption[]>([
{ key : 28 , label : ` 创建人 ` , visible : false } ,
{ key : 28 , label : ` 创建人 ` , visible : false } ,
{ key : 29 , label : ` 创建时间 ` , visible : false } ,
{ key : 29 , label : ` 创建时间 ` , visible : false } ,
{ key : 30 , label : ` 更新人 ` , visible : false } ,
{ key : 30 , label : ` 更新人 ` , visible : false } ,
{ key : 31 , label : ` 更新时间 ` , visible : false }
{ key : 31 , label : ` 更新时间 ` , visible : false } ,
{ key : 32 , label : ` 终版合同 ` , visible : true }
] ) ;
] ) ;
const data = reactive < { queryParams : ContractInfoQuery } > ( {
const data = reactive < { queryParams : ContractInfoQuery } > ( {
@ -253,6 +280,16 @@ const data = reactive<{ queryParams: ContractInfoQuery }>({
const { queryParams } = toRefs ( data ) ;
const { queryParams } = toRefs ( data ) ;
/ / 终 版 合 同 上 传 对 话 框 状 态
const uploadDialog = reactive ( {
visible : false ,
loading : false ,
form : {
contractId : undefined as any ,
oss : undefined as any
}
} ) ;
/** 查询合同信息列表 */
/** 查询合同信息列表 */
const getList = async ( ) => {
const getList = async ( ) => {
loading . value = true ;
loading . value = true ;
@ -315,4 +352,34 @@ const handleExport = () => {
onMounted ( ( ) => {
onMounted ( ( ) => {
getList ( ) ;
getList ( ) ;
} ) ;
} ) ;
/ / 打 开 上 传 终 版 合 同 对 话 框
const openUploadFinalDialog = ( row ? : ContractInfoVO ) => {
const contractId = row ? . contractId || ids . value [ 0 ] ;
if ( ! contractId ) return ;
uploadDialog . form . contractId = contractId ;
uploadDialog . form . oss = undefined as any ;
uploadDialog . visible = true ;
} ;
/ / 确 认 上 传 , 保 存 签 字 合 同 附 件
const confirmUploadFinal = async ( ) => {
uploadDialog . loading = true ;
try {
/ / 仅 取 单 个 附 件 i d
const ossStr = uploadDialog . form . oss as unknown as string ;
const firstOssId = ossStr ? Number ( String ( ossStr ) . split ( ',' ) [ 0 ] ) : undefined ;
await updateContractInfo ( { contractId : uploadDialog . form . contractId , signatureAppendix : ossStr } as any ) ;
proxy ? . $modal . msgSuccess ( '终版合同已上传' ) ;
uploadDialog . visible = false ;
await getList ( ) ;
} finally {
uploadDialog . loading = false ;
}
} ;
/ / 下 载 终 版 合 同
const downloadFinalContract = ( ossId : string | number ) => {
download . oss ( ossId ) ;
} ;
< / script >
< / script >