1.0.14 合同上传终版合同附件

dev
yinq 2 months ago
parent c81c041582
commit 5b6838da92

@ -130,6 +130,12 @@
<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="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>
</el-table-column>
<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">
<template #default="scope">
@ -148,26 +154,46 @@
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<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">
<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-tooltip>
<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-tooltip content="删除" placement="top">-->
<!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['oa/erp:contractInfo:remove']"></el-button>-->
<!-- </el-tooltip>-->
<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>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 上传终版合同对话框 -->
<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" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" :loading="uploadDialog.loading" @click="confirmUploadFinal"> </el-button>
<el-button @click="uploadDialog.visible = false"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="ContractInfo" lang="ts">
import { listContractInfo, delContractInfo } from '@/api/oa/erp/contractInfo';
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 { 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: 29, 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 }>({
@ -253,6 +280,16 @@ const data = reactive<{ queryParams: ContractInfoQuery }>({
const { queryParams } = toRefs(data);
//
const uploadDialog = reactive({
visible: false,
loading: false,
form: {
contractId: undefined as any,
oss: undefined as any
}
});
/** 查询合同信息列表 */
const getList = async () => {
loading.value = true;
@ -315,4 +352,34 @@ const handleExport = () => {
onMounted(() => {
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 {
// id
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>

Loading…
Cancel
Save