回复单和整改单
This commit is contained in:
@ -87,7 +87,7 @@
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改联系单模板对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body destroy-on-close>
|
||||
<el-form ref="contactformtemplateFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="模板名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入模板名称" />
|
||||
@ -100,7 +100,9 @@
|
||||
ref="fileUploadRef"
|
||||
:data="{ name: form.name, projectId: currentProject.id }"
|
||||
uploadUrl="/cory/contactformtemplate"
|
||||
:limit="1"
|
||||
:onUploadSuccess="handleUploadSuccess"
|
||||
showFileList
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="备注" prop="remark">
|
||||
@ -161,6 +163,7 @@ const uploadData = reactive({
|
||||
const initFormData: ContactformtemplateForm = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
file: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<ContactformtemplateForm, ContactformtemplateQuery>>({
|
||||
@ -275,6 +278,7 @@ const submitForm = () => {
|
||||
const handleUploadSuccess = () => {
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
buttonLoading.value = false;
|
||||
getList();
|
||||
};
|
||||
|
||||
|
||||
264
src/views/cory/template/components/contactform.vue
Normal file
264
src/views/cory/template/components/contactform.vue
Normal file
@ -0,0 +1,264 @@
|
||||
<template>
|
||||
<div class="content-box">
|
||||
<el-table :data="data" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column align="center" prop="projectName" label="工程名称" />
|
||||
<el-table-column align="center" prop="serialNumber" label="编号" />
|
||||
<el-table-column align="center" prop="to" label="致" />
|
||||
<el-table-column align="center" prop="subject" label="主题" />
|
||||
<el-table-column align="center" prop="content" label="内容">
|
||||
<template #default="{ row }">
|
||||
<div style="white-space: pre-line">{{ row.content }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" label="附件">
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" :underline="false" @click="openFile(row.attachments)" target="_blank">查看附件</el-link>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<!-- 分段标题:施工项目部 -->
|
||||
<el-table-column label="施工项目部" align="center">
|
||||
<el-table-column align="center" prop="contractorLeader" label="项目负责人" />
|
||||
<el-table-column align="center" prop="contractorDate" label="日期">
|
||||
<template #default="{ row }">
|
||||
{{ dayjs(row.contractorDate).format('YYYY-MM-DD') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 分段标题:项目监理机构 -->
|
||||
<el-table-column label="项目监理机构" align="center">
|
||||
<el-table-column align="center" prop="supervisorLeader" label="总监理工程师" />
|
||||
<el-table-column align="center" prop="supervisorDate" label="日期">
|
||||
<template #default="{ row }">
|
||||
{{ dayjs(row.supervisorDate).format('YYYY-MM-DD') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 分段标题:建设单位 -->
|
||||
<el-table-column label="建设单位" align="center">
|
||||
<el-table-column align="center" prop="ownerRep" label="业主代表" />
|
||||
<el-table-column align="center" prop="ownerDate" label="日期">
|
||||
<template #default="{ row }">
|
||||
{{ dayjs(row.ownerDate).format('YYYY-MM-DD') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" prop="content" label="操作" width="160">
|
||||
<template #default="scope">
|
||||
<el-button link type="success" icon="View" @click="handleDetail(scope.row)" class="ml-3"> 详情 </el-button>
|
||||
<!-- <el-button link type="primary" icon="Download" @click="handleDownload()"> 下载 </el-button> -->
|
||||
<!-- <el-button link type="warning" icon="Edit" @click="handleDelete(scope.row)"> 修改 </el-button> -->
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 详情 -->
|
||||
<el-dialog title="外部联系单详情" v-model="detailVisible" width="1000">
|
||||
<div class="w[850px] ma word-export-wrapper" ref="exportRef">
|
||||
<div class="w80% ma">
|
||||
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">外部联系单</h2>
|
||||
<el-row>
|
||||
<el-col :span="12" style="text-align: left">工程名称:{{ tableDetail.projectName }}</el-col>
|
||||
<el-col :span="12" style="text-align: right">编号:{{ tableDetail.serialNumber }}</el-col>
|
||||
</el-row>
|
||||
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="致:" :span="2" class-name="zebra"> {{ tableDetail.to }}</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="主题" :span="2" label-class-name="white">
|
||||
{{ tableDetail.subject }}</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item label-align="center" label="内容" :span="2" class-name="zebra">
|
||||
{{ tableDetail.content }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="附件" :span="2" label-class-name="white">
|
||||
<el-link type="primary" :underline="false" :href="tableDetail.url" target="_blank">{{ tableDetail.originalName }}</el-link>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="施工项目部" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="项目负责人" label-class-name="white">
|
||||
{{ tableDetail.contractorLeader }}</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item label-align="center" label="日期" label-class-name="white">
|
||||
{{ dayjs(tableDetail.contractorDate).format('YYYY-MM-DD') }}</el-descriptions-item
|
||||
>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="项目监理机构" class-name="none"> </el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="项目负责人" label-class-name="white">
|
||||
{{ tableDetail.supervisorLeader }}</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item label-align="center" label="日期" label-class-name="white">
|
||||
{{ dayjs(tableDetail.supervisorDate).format('YYYY-MM-DD') }}</el-descriptions-item
|
||||
>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="建设单位" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="项目负责人" label-class-name="white"> {{ tableDetail.ownerRep }}</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="日期" label-class-name="white">
|
||||
{{ dayjs(tableDetail.ownerDate).format('YYYY-MM-DD') }}</el-descriptions-item
|
||||
>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<div class="btn-item" @click="handleDownload">
|
||||
<img src="@/assets/icons/svg/derived.png" />
|
||||
<span>下载</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { listByIds } from '@/api/system/oss';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { dayjs } from 'element-plus';
|
||||
const exportRef = ref<HTMLElement>();
|
||||
|
||||
const emit = defineEmits(['selection-change', 'delete']);
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
});
|
||||
const form = reactive({
|
||||
id: '1',
|
||||
projectName: '',
|
||||
serialNumber: '',
|
||||
to: '',
|
||||
subject: '',
|
||||
content: '',
|
||||
attachments: '', // 或 URL
|
||||
contractorLeader: '',
|
||||
contractorDate: '',
|
||||
supervisorLeader: '',
|
||||
supervisorDate: '',
|
||||
ownerRep: '',
|
||||
ownerDate: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
|
||||
const tableDetail = ref<any>({});
|
||||
|
||||
const total = ref(0);
|
||||
|
||||
const detailVisible = ref(false);
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: any) => {
|
||||
emit('selection-change', selection);
|
||||
};
|
||||
|
||||
const handleDetail = async (row) => {
|
||||
const res = await listByIds(row.attachments);
|
||||
tableDetail.value = {
|
||||
...row,
|
||||
...res.data[0]
|
||||
};
|
||||
console.log('🚀 ~ handleDetail ~ tableDetail.value:', tableDetail.value);
|
||||
detailVisible.value = true;
|
||||
};
|
||||
|
||||
const handleDownload = () => {
|
||||
const style = `
|
||||
<style>
|
||||
.white { background: #fff !important; }
|
||||
.none { display: none !important; }
|
||||
.zebra { background: #f5f7fa !important; }
|
||||
.el-descriptions__table { table-layout: fixed !important; }
|
||||
table { border-collapse: collapse; width: 100%; }
|
||||
th, td { border: 1px solid #333; padding: 6px; font-size: 14px; }
|
||||
</style>
|
||||
`;
|
||||
|
||||
const el = exportRef.value;
|
||||
if (!el) return;
|
||||
|
||||
// 拷贝 DOM,避免修改原内容
|
||||
const clone = el.cloneNode(true) as HTMLElement;
|
||||
|
||||
applyInlineTableStyles(clone);
|
||||
|
||||
// 包裹 HTML 内容
|
||||
const html = `
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
${style}
|
||||
</head>
|
||||
<body>
|
||||
${clone.innerHTML}
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
const blob = (window as any).htmlDocx.asBlob(html);
|
||||
saveAs(blob, '外部联系单.docx');
|
||||
};
|
||||
const applyInlineTableStyles = (rootEl: HTMLElement) => {
|
||||
rootEl.querySelectorAll('table').forEach((table) => {
|
||||
table.setAttribute('style', 'width:100%; border-collapse:collapse; table-layout:fixed; border:1px solid #333;');
|
||||
});
|
||||
|
||||
rootEl.querySelectorAll('th, td').forEach((cell) => {
|
||||
cell.setAttribute('style', 'border:1px solid #333; padding:6px; font-size:14px; word-break:break-all;');
|
||||
});
|
||||
};
|
||||
|
||||
const handleDelete = (row) => {
|
||||
emit('delete', row.id);
|
||||
};
|
||||
|
||||
const openFile = async (url: string) => {
|
||||
const res = await listByIds(url);
|
||||
window.open(res.data[0].url);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.white) {
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.none) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
:deep(.zebra) {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
.dialog-footer {
|
||||
height: 100px;
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
position: absolute;
|
||||
top: 14%;
|
||||
right: 6%;
|
||||
background: #fff;
|
||||
box-shadow: 0 0 10px #ddd;
|
||||
text-align: center;
|
||||
padding: 20px 10px;
|
||||
|
||||
.btn-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,368 @@
|
||||
<template>
|
||||
<div class="content-box">
|
||||
<el-table :data="data" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column align="center" prop="projectName" label="工程名称" />
|
||||
<el-table-column align="center" prop="unitName" label="提出单位" />
|
||||
<el-table-column align="center" prop="profession" label="专业" />
|
||||
<el-table-column align="center" prop="applyDate" label="提出日期">
|
||||
<template #default="{ row }">
|
||||
{{ formatDate(row.applyDate) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="bookName" label="卷册名称" />
|
||||
<el-table-column align="center" prop="bookNo" label="卷册号" />
|
||||
<!-- <el-table-column align="center" label="附图">
|
||||
<template #default="{ row }">
|
||||
<ImagePreview :src="row.hasAttachment" disabled :width="80" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column align="center" prop="changeReasons" label="变更原因" width="100">
|
||||
<template #default="{ row }">
|
||||
{{ row.changeReasons?.join(', ') }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column align="center" prop="changeContent" label="变更内容" />
|
||||
<el-table-column align="center" prop="costEstimate" label="变更费用估算" />
|
||||
|
||||
<!-- <el-table-column label="施工承包单位" align="center">
|
||||
<el-table-column align="center" prop="contractorManager" label="项目经理" width="100" />
|
||||
<el-table-column align="center" prop="contractorDate" label="日期" width="130">
|
||||
<template #default="{ row }">{{ formatDate(row.contractorDate) }}</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="总承包单位" align="center">
|
||||
<el-table-column align="center" prop="generalTechLeader" label="项目技术负责人" width="150" />
|
||||
<el-table-column align="center" prop="generalDate" label="日期" width="130">
|
||||
<template #default="{ row }">{{ formatDate(row.generalDate) }}</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="设计单位" align="center">
|
||||
<el-table-column align="center" prop="designer" label="设计代表" width="100" />
|
||||
<el-table-column align="center" prop="designerDate" label="日期" width="130">
|
||||
<template #default="{ row }">{{ formatDate(row.designerDate) }}</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="项目监理单位" align="center">
|
||||
<el-table-column align="center" prop="supervisorEngineer" label="监理工程师" width="100" />
|
||||
<el-table-column align="center" prop="chiefSupervisor" label="总监理工程师" width="110" />
|
||||
<el-table-column align="center" prop="supervisorDate" label="日期" width="130">
|
||||
<template #default="{ row }">{{ formatDate(row.supervisorDate) }}</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="建设单位" align="center">
|
||||
<el-table-column align="center" prop="ownerLeader" label="负责人" />
|
||||
<el-table-column align="center" prop="ownerDate" label="日期" width="130">
|
||||
<template #default="{ row }">{{ formatDate(row.ownerDate) }}</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column align="center" prop="content" label="操作" width="160">
|
||||
<template #default="scope">
|
||||
<el-button link type="success" icon="View" @click="handleDetail(scope.row)" class="ml-3"> 详情 </el-button>
|
||||
<!-- <el-button link type="primary" icon="Download" @click="handleDownload()"> 下载 </el-button> -->
|
||||
<!-- <el-button link type="warning" icon="Edit" @click="handleDelete(scope.row)"> 修改 </el-button> -->
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 详情 -->
|
||||
<el-dialog title="变更单详情" v-model="detailVisible" width="1000">
|
||||
<div class="w[850px] ma word-export-wrapper" ref="exportRef">
|
||||
<div class="w80% ma">
|
||||
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">变更单</h2>
|
||||
<el-row>
|
||||
<el-col :span="12">编号:{{ tableDetail.id }}</el-col>
|
||||
</el-row>
|
||||
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="工程名称" class-name="zebra"> {{ tableDetail.projectName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="提出单位" class-name="zebra"> {{ tableDetail.unitName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="专业" label-class-name="white"> {{ tableDetail.profession }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="提出日期" label-class-name="white">
|
||||
{{ dayjs(tableDetail.applyDate).format('YYYY-MM-DD') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="卷册名称" class-name="zebra"> {{ tableDetail.bookName }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="卷册号" class-name="zebra"> {{ tableDetail.bookNo }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="附图" :span="2" label-class-name="white">
|
||||
<image-preview :src="item.url" v-for="item in tableDetail.hasAttachmentList" width="200px" class="mr" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="变更原因" :span="2" class-name="zebra">
|
||||
<el-checkbox-group v-model="tableDetail.changeReasons">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in radioList"
|
||||
:class="index % 2 == 0 ? 'w45%' : ''"
|
||||
:label="item.label"
|
||||
:value="item.label"
|
||||
disabled
|
||||
/>
|
||||
</el-checkbox-group>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white">
|
||||
{{ tableDetail.changeContent }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="变更费用估算" :span="2" class-name="zebra">
|
||||
{{ tableDetail.costEstimate }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="施工承包单位" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="项目经理 " label-class-name="white">
|
||||
{{ tableDetail.asupervisorLeader }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="日期" label-class-name="white">
|
||||
{{ dayjs(tableDetail.asupervisorDate).format('YYYY-MM-DD') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="总承包单位" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="项目技术负责人" label-class-name="white">{{
|
||||
tableDetail.bsupervisorLeader
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="日期" label-class-name="white">
|
||||
{{ dayjs(tableDetail.bsupervisorDate).format('YYYY-MM-DD') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="设计单位" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="设计代表" label-class-name="white">{{
|
||||
tableDetail.csupervisorLeader
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="日期" label-class-name="white">
|
||||
{{ dayjs(tableDetail.csupervisorDate).format('YYYY-MM-DD') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="项目监理单位" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 单独插入整行占用的内容 -->
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label="总监理工程师" :span="2" label-align="center" label-class-name="white">
|
||||
{{ tableDetail.dasupervisorLeader }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<!-- 一组完整两列 -->
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label="监理工程师" label-align="center" label-class-name="white">
|
||||
{{ tableDetail.dsupervisorLeader }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="日期" label-align="center" label-class-name="white">
|
||||
{{ dayjs(tableDetail.dsupervisorDate).format('YYYY-MM-DD') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="建设单位" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<!-- <el-descriptions-item label-align="center" label="会签" :span="2" label-class-name="white"> {{ tableDetail.esupervisorLeader }} </el-descriptions-item> -->
|
||||
<el-descriptions-item label-align="center" label="负责人" label-class-name="white">
|
||||
{{ tableDetail.esupervisorLeader }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="日期" label-class-name="white">
|
||||
{{ dayjs(tableDetail.esupervisorDate).format('YYYY-MM-DD') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<div class="btn-item" @click="handleDownload">
|
||||
<img src="@/assets/icons/svg/derived.png" />
|
||||
<span>下载</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { listByIds } from '@/api/system/oss';
|
||||
import { dayjs } from 'element-plus';
|
||||
import { saveAs } from 'file-saver';
|
||||
const form = reactive({
|
||||
projectName: '',
|
||||
unitName: '',
|
||||
profession: '',
|
||||
applyDate: '2025-6-23 13:03:56',
|
||||
bookName: '',
|
||||
bookNo: '',
|
||||
hasAttachment:
|
||||
'http://58.17.134.85:9000/xinnengyuan-dev/doc/safety/knowledge/1897160897167638529/知识库/指导手册/2025-06-27_2f56bca1c4bc46c6b226858a18713c48.jpg', // 附图链接或图片地址
|
||||
changeReasons: [0, 3, 5],
|
||||
changeContent: '',
|
||||
costEstimate: '',
|
||||
|
||||
contractorManager: '',
|
||||
contractorDate: '',
|
||||
generalTechLeader: '',
|
||||
generalDate: '',
|
||||
designer: '',
|
||||
designerDate: '',
|
||||
supervisorEngineer: '',
|
||||
chiefSupervisor: '',
|
||||
supervisorDate: '',
|
||||
ownerLeader: '',
|
||||
ownerDate: ''
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
});
|
||||
const tableDetail = ref<any>({});
|
||||
const exportRef = ref<HTMLElement>();
|
||||
const radioList = ref([
|
||||
{ value: 0, label: '设计漏项' },
|
||||
{ value: 1, label: '设计改进' },
|
||||
{ value: 2, label: '设计差错' },
|
||||
{ value: 3, label: '接口差错' },
|
||||
{ value: 4, label: '业主要求' },
|
||||
{ value: 5, label: '施工承包商要求' },
|
||||
{ value: 6, label: '外部资料不符' },
|
||||
{ value: 7, label: '材料代用或其他' }
|
||||
]);
|
||||
const detailVisible = ref(false);
|
||||
const formatDate = (val: string | Date) => (val ? dayjs(val).format('YYYY-MM-DD') : '');
|
||||
|
||||
const handleDetail = async (row) => {
|
||||
const res = await listByIds(row.hasAttachment);
|
||||
tableDetail.value = {
|
||||
...row,
|
||||
hasAttachmentList: res.data
|
||||
};
|
||||
console.log(tableDetail.value);
|
||||
|
||||
detailVisible.value = true;
|
||||
};
|
||||
/** 多选框选中数据 */
|
||||
const emit = defineEmits(['selection-change', 'delete']);
|
||||
const handleSelectionChange = (selection: any) => {
|
||||
emit('selection-change', selection);
|
||||
};
|
||||
const handleDelete = (row) => {
|
||||
emit('delete', row.id);
|
||||
};
|
||||
|
||||
const handleDownload = () => {
|
||||
const style = `
|
||||
<style>
|
||||
.white { background: #fff !important; }
|
||||
.none { display: none !important; }
|
||||
.zebra { background: #f5f7fa !important; }
|
||||
.el-descriptions__table { table-layout: fixed !important; }
|
||||
table { border-collapse: collapse; width: 100%; }
|
||||
th, td { border: 1px solid #333; padding: 6px; font-size: 14px; }
|
||||
</style>
|
||||
`;
|
||||
|
||||
const el = exportRef.value;
|
||||
if (!el) return;
|
||||
|
||||
// 拷贝 DOM,避免修改原内容
|
||||
const clone = el.cloneNode(true) as HTMLElement;
|
||||
|
||||
applyInlineTableStyles(clone);
|
||||
|
||||
// 包裹 HTML 内容
|
||||
const html = `
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
${style}
|
||||
</head>
|
||||
<body>
|
||||
${clone.innerHTML}
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
const blob = (window as any).htmlDocx.asBlob(html);
|
||||
saveAs(blob, '变更单.docx');
|
||||
};
|
||||
const applyInlineTableStyles = (rootEl: HTMLElement) => {
|
||||
rootEl.querySelectorAll('table').forEach((table) => {
|
||||
table.setAttribute('style', 'width:100%; border-collapse:collapse; table-layout:fixed; border:1px solid #333;');
|
||||
});
|
||||
|
||||
rootEl.querySelectorAll('th, td').forEach((cell) => {
|
||||
cell.setAttribute('style', 'border:1px solid #333; padding:6px; font-size:14px; word-break:break-all;');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.white) {
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.none) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
:deep(.zebra) {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
:deep(.el-descriptions__table) {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
.word-export-wrapper {
|
||||
table {
|
||||
width: 100% !important;
|
||||
border-collapse: collapse;
|
||||
table-layout: fixed;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid #333;
|
||||
padding: 8px;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* 确保不超出 Word 页边距 */
|
||||
margin: 0 auto;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-descriptions__label {
|
||||
font-weight: bold;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.dialog-footer {
|
||||
height: 100px;
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
position: absolute;
|
||||
top: 14%;
|
||||
right: 6%;
|
||||
background: #fff;
|
||||
box-shadow: 0 0 10px #ddd;
|
||||
text-align: center;
|
||||
padding: 20px 10px;
|
||||
|
||||
.btn-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
402
src/views/cory/template/index.vue
Normal file
402
src/views/cory/template/index.vue
Normal file
@ -0,0 +1,402 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="模板类型" prop="projectType">
|
||||
<el-select v-model="queryParams.projectType" placeholder="请选择模板类型" clearable filterable @change="selectType">
|
||||
<el-option v-for="item in projectTypeOptions" :key="item.name" :label="item.name" :value="item.name"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" :disabled="addSingle" @click="handleAdd" v-hasPermi="['quality:qualityInspection:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['quality:qualityInspection:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['quality:qualityInspection:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['quality:qualityInspection:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
<!-- card body -->
|
||||
<Contactform
|
||||
v-if="queryParams.projectType == '外部联系单'"
|
||||
@selection-change="handleSelectionChange"
|
||||
:data="tableData"
|
||||
@delete="handleDelete"
|
||||
></Contactform>
|
||||
<EngineeringChangeApplicationForm
|
||||
v-if="queryParams.projectType == '变更单'"
|
||||
@selection-change="handleSelectionChange"
|
||||
:data="tableData"
|
||||
@delete="handleDelete"
|
||||
></EngineeringChangeApplicationForm>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="新增模板" v-model="dialogVisible" width="800">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="110px">
|
||||
<div class="flex">
|
||||
<!-- <img :src="thumbnailUrl" alt="" style="width: 150px;" /> -->
|
||||
<div><image-preview :src="thumbnailUrl" width="150px"></image-preview></div>
|
||||
|
||||
<div v-if="queryParams.projectType == '外部联系单'">
|
||||
<el-form-item label="工程名称" prop="projectName">
|
||||
<el-input v-model="form.projectName" placeholder="请输入工程名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="编号" prop="serialNumber">
|
||||
<el-input v-model="form.serialNumber" placeholder="请输入编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="致" prop="to">
|
||||
<el-input v-model="form.to" placeholder="致:" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主题" prop="subject">
|
||||
<el-input v-model="form.subject" placeholder="请输入主题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input v-model="form.content" type="textarea" :rows="6" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="attachments">
|
||||
<file-upload v-model="form.attachments" :limit="1" :file-type="['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp']"></file-upload>
|
||||
</el-form-item>
|
||||
<el-divider class="mb-10! mt-10!">施工项目部</el-divider>
|
||||
<el-form-item label="项目负责人" prop="contractorLeader">
|
||||
<el-input v-model="form.contractorLeader" placeholder="请输入负责人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" prop="contractorDate">
|
||||
<el-date-picker v-model="form.contractorDate" type="date" placeholder="选择日期" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-divider class="mb-10! mt-10!">项目监理机构</el-divider>
|
||||
|
||||
<el-form-item label="总监理工程师" prop="supervisorLeader">
|
||||
<el-input v-model="form.supervisorLeader" placeholder="请输入总监理工程师姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" prop="supervisorDate">
|
||||
<el-date-picker v-model="form.supervisorDate" type="date" placeholder="选择日期" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-divider class="mb-10! mt-10!">建设单位</el-divider>
|
||||
<el-form-item label="业主代表" prop="ownerRep">
|
||||
<el-input v-model="form.ownerRep" placeholder="请输入业主代表" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" prop="ownerDate">
|
||||
<el-date-picker v-model="form.ownerDate" type="date" placeholder="选择日期" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="queryParams.projectType === '变更单'">
|
||||
<el-form-item label="工程名称">
|
||||
<el-input v-model="form.projectName" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="提出单位">
|
||||
<el-input v-model="form.unitName" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="专业">
|
||||
<el-input v-model="form.profession" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="提出日期">
|
||||
<el-date-picker v-model="form.applyDate" type="date" placeholder="选择日期" style="width: 100%" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="卷册名称">
|
||||
<el-input v-model="form.bookName" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="卷册号">
|
||||
<el-input v-model="form.bookNo" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="附图">
|
||||
<image-upload v-model="form.hasAttachment"></image-upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="变更原因">
|
||||
<el-checkbox-group v-model="form.changeReasons">
|
||||
<el-checkbox label="设计漏项" class="w45%" />
|
||||
<el-checkbox label="设计改进" />
|
||||
<el-checkbox label="设计差错" class="w45%" />
|
||||
<el-checkbox label="接口差错" />
|
||||
<el-checkbox label="业主要求" class="w45%" />
|
||||
<el-checkbox label="施工承包商要求" />
|
||||
<el-checkbox label="外部资料不符" class="w45%" />
|
||||
<el-checkbox label="材料代用或其他" />
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="变更内容">
|
||||
<el-input v-model="form.changeContent" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="变更费用估算">
|
||||
<el-input v-model="form.costEstimate" />
|
||||
</el-form-item>
|
||||
<el-divider class="mb-10! mt-10!">施工承包单位</el-divider>
|
||||
<el-form-item label="项目经理" prop="asupervisorLeader">
|
||||
<el-input v-model="form.asupervisorLeader" placeholder="请输入项目经理姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" prop="asupervisorDate">
|
||||
<el-date-picker v-model="form.asupervisorDate" type="date" placeholder="选择日期" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-divider class="mb-10! mt-10!">总承包单位</el-divider>
|
||||
<el-form-item label="项目技术负责人" prop="bsupervisorLeader">
|
||||
<el-input v-model="form.bsupervisorLeader" placeholder="请输入项目技术负责人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" prop="bsupervisorDate">
|
||||
<el-date-picker v-model="form.bsupervisorDate" type="date" placeholder="选择日期" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-divider class="mb-10! mt-10!">设计单位</el-divider>
|
||||
<el-form-item label="设计代表" prop="csupervisorLeader">
|
||||
<el-input v-model="form.csupervisorLeader" placeholder="请输入设计代表姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" prop="csupervisorDate">
|
||||
<el-date-picker v-model="form.csupervisorDate" type="date" placeholder="选择日期" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-divider class="mb-10! mt-10!">项目监理单位</el-divider>
|
||||
<el-form-item label="监理工程师" prop="dsupervisorLeader">
|
||||
<el-input v-model="form.dsupervisorLeader" placeholder="请输入监理工程师姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总监理工程师" prop="dasupervisorLeader">
|
||||
<el-input v-model="form.dasupervisorLeader" placeholder="请输入总监理工程师姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" prop="dsupervisorDate">
|
||||
<el-date-picker v-model="form.dsupervisorDate" type="date" placeholder="选择日期" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-divider class="mb-10! mt-10!">建设单位</el-divider>
|
||||
<el-form-item label="负责人" prop="esupervisorLeader">
|
||||
<el-input v-model="form.esupervisorLeader" placeholder="请输入负责人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" prop="esupervisorDate">
|
||||
<el-date-picker v-model="form.esupervisorDate" type="date" placeholder="选择日期" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
import Contactform from './components/contactform.vue';
|
||||
import EngineeringChangeApplicationForm from './components/engineeringChangeApplicationForm.vue';
|
||||
import { listContactTypeformtemplate } from '@/api/cory/contactformtemplate';
|
||||
import { addContactnotice, delContactnotice, listContactnotice } from '@/api/cory/contactnotice';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const { safety_inspection_violation_type, safety_inspection_check_type } = toRefs<any>(
|
||||
proxy?.useDict('safety_inspection_violation_type', 'safety_inspection_check_type')
|
||||
);
|
||||
const teamOpt = ref([]);
|
||||
const foremanOpt = ref([]);
|
||||
const thumbnailUrl = ref('');
|
||||
const tableData = ref([]);
|
||||
const total = ref(0);
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const dialogVisible = ref<boolean>(false);
|
||||
const showSearch = ref(true);
|
||||
const multiple = ref<boolean>(true);
|
||||
const addSingle = ref<boolean>(false);
|
||||
const single = ref<boolean>(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
|
||||
const projectTypeOptions = ref<any>([
|
||||
{
|
||||
value: '0',
|
||||
label: '外部联系单'
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: '变更单'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '通知单'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '回复单'
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '签证单'
|
||||
}
|
||||
]);
|
||||
|
||||
const initFormData = {
|
||||
projectType: '',
|
||||
projectName: '',
|
||||
serialNumber: '',
|
||||
to: '',
|
||||
subject: '',
|
||||
content: '',
|
||||
attachments: '',
|
||||
contractorLeader: '',
|
||||
contractorDate: '',
|
||||
supervisorLeader: '',
|
||||
supervisorDate: '',
|
||||
ownerRep: '',
|
||||
ownerDate: '',
|
||||
unitName: '',
|
||||
profession: '',
|
||||
applyDate: '',
|
||||
bookName: '',
|
||||
bookNo: '',
|
||||
hasAttachment: '',
|
||||
changeReasons: [],
|
||||
changeContent: '',
|
||||
costEstimate: ''
|
||||
};
|
||||
const data = reactive<PageData<any, any>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
inspectionType: undefined,
|
||||
inspectionStatus: undefined,
|
||||
teamId: undefined,
|
||||
type: undefined,
|
||||
params: {},
|
||||
ids: ['1942107830848872449', '1942107931415699457'],
|
||||
projectType: undefined
|
||||
},
|
||||
rules: {
|
||||
projectName: [{ required: true, message: '请输入工程名称', trigger: 'blur' }],
|
||||
projectType: [{ required: true, message: '请选择模板类型', trigger: 'blur' }],
|
||||
serialNumber: [{ required: true, message: '请输入编号', trigger: 'blur' }],
|
||||
to: [{ required: true, message: '请输入接收方', trigger: 'blur' }],
|
||||
subject: [{ required: true, message: '请输入主题', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '请输入内容', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid) => {
|
||||
if (valid) {
|
||||
let data = {
|
||||
type: queryParams.value.type,
|
||||
projectId: currentProject.value?.id,
|
||||
detail: JSON.stringify(form.value)
|
||||
};
|
||||
console.log('提交表单:', form);
|
||||
const res = await addContactnotice(data);
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('添加成功');
|
||||
dialogVisible.value = false;
|
||||
formRef.value.resetFields();
|
||||
getList();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleAdd = () => {
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
|
||||
const changeForeman = (value: string | number) => {
|
||||
// const team = teamList.value.filter((team) => team.id === value)[0];
|
||||
// foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({
|
||||
// label: foreman.foremanName,
|
||||
// value: foreman.foremanId
|
||||
// }));
|
||||
// form.value.correctorId = '';
|
||||
};
|
||||
|
||||
const handleQuery = () => {};
|
||||
const resetQuery = () => {};
|
||||
const getList = async () => {
|
||||
if (!queryParams.value.projectType) {
|
||||
const res = await listContactTypeformtemplate(queryParams.value);
|
||||
projectTypeOptions.value = res.data;
|
||||
queryParams.value.projectType = res.data[0].name;
|
||||
thumbnailUrl.value = res.data[0].thumbnail;
|
||||
queryParams.value.type = res.data[0].id as string;
|
||||
}
|
||||
const res = await listContactnotice(queryParams.value);
|
||||
res.rows = res.rows.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
...JSON.parse(item.detail)
|
||||
};
|
||||
});
|
||||
tableData.value = res.rows;
|
||||
total.value = res.total || 0;
|
||||
};
|
||||
const handleDelete = async (id?: string) => {
|
||||
const _ids = id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除识别记录编号为"' + _ids + '"的数据项?').finally();
|
||||
const res = await delContactnotice(_ids);
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
getList();
|
||||
}
|
||||
};
|
||||
const handleUpdate = () => {};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: any) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
const selectType = (value: string) => {
|
||||
queryParams.value.projectType = value;
|
||||
thumbnailUrl.value = projectTypeOptions.value.filter((item) => item.name == value)[0].thumbnail;
|
||||
queryParams.value.type = projectTypeOptions.value.filter((item) => item.name == value)[0].id;
|
||||
getList();
|
||||
};
|
||||
|
||||
const resetForm = () => {
|
||||
formRef.value?.resetFields();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
255
src/views/cory/workMessage/components/notice.vue
Normal file
255
src/views/cory/workMessage/components/notice.vue
Normal file
@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<div class="content-box">
|
||||
<el-table v-loading="loading" :data="data" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="处理状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="safety_inspection_type" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查人" align="center" prop="correctorName" />
|
||||
<el-table-column label="检查时间" align="center" prop="rectificationDeadline" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.rectificationDeadline, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检查类型" align="center" prop="checkType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="safety_inspection_check_type" :value="scope.row.checkType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="违章类型" align="center" prop="violationType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="safety_inspection_violation_type" :value="scope.row.violationType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="巡检结果" align="center" prop="inspectionResult">
|
||||
<template #default="scope">
|
||||
<el-tooltip placement="top" effect="dark">
|
||||
<template #content>
|
||||
<div class="max-w-670px">{{ scope.row.inspectionResult }}</div>
|
||||
</template>
|
||||
<el-text truncated>
|
||||
{{ scope.row.inspectionResult }}
|
||||
</el-text>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="整改人" align="center" prop="correctorName" />
|
||||
<el-table-column label="复查状态" align="center" prop="reviewType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="review_type" :value="scope.row.reviewType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
|
||||
<template #default="scope">
|
||||
<el-space>
|
||||
<el-button link type="primary" icon="View" @click="handleDetail(scope.row)" v-hasPermi="['safety:safetyInspection:query']">
|
||||
详情
|
||||
</el-button>
|
||||
<!-- <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyInspection:edit']">修改 </el-button> -->
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyInspection:remove']">
|
||||
删除
|
||||
</el-button>
|
||||
</el-space>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="form.pageNum" v-model:limit="form.pageSize" @pagination="getList" />
|
||||
<!-- 详情 -->
|
||||
<el-dialog title="联系单详情" v-model="detailVisible" width="60vw">
|
||||
<div class="w80% ma">
|
||||
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">通知单</h2>
|
||||
<el-row>
|
||||
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.creatorName }}</el-col>
|
||||
<el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createTime }}</el-col>
|
||||
</el-row>
|
||||
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{ currentProject?.name }} </el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查类型" label-class-name="white">
|
||||
<dict-tag :options="safety_inspection_check_type" :value="safetyInspectionDetail?.checkType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="违章类型" label-class-name="white">
|
||||
<dict-tag :options="safety_inspection_violation_type" :value="safetyInspectionDetail?.violationType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查时间" class-name="zebra"
|
||||
>{{ safetyInspectionDetail?.checkTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查人" class-name="zebra"
|
||||
>{{ safetyInspectionDetail?.creatorName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改人" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.correctorName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="要求整改期限" label-class-name="white">
|
||||
{{ dayjs(safetyInspectionDetail?.rectificationDeadline).format('YYYY 年 MM 月 DD 日') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="巡检结果" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.hiddenDanger }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
<div v-for="item in checkFileList" :key="item.ossId">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||
<image-preview :src="item.url" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-link :href="`${item.url}`" type="primary" :underline="false" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</span>
|
||||
</div>
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white">
|
||||
<el-steps style="max-width: 200px" :active="Number(safetyInspectionDetail?.status)" finish-status="finish">
|
||||
<el-step v-for="item in safety_inspection_type" :key="item.value" :title="item.label" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="整改情况" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="班组" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.teamName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改日期" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.rectificationTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2" label-class-name="white">
|
||||
{{ safetyInspectionDetail?.measure }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
<div v-for="item in rectificationFileList" :key="item.ossId">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||
<image-preview :src="item.url" width="200px" />
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-link :href="`${item.url}`" :underline="false" target="_blank">
|
||||
<span> {{ item.originalName }} </span>
|
||||
</el-link>
|
||||
</span>
|
||||
</div>
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="复查结果" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="复查人" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.creatorName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查日期" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.reviewTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="复查情况" :span="2" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.review }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<template #footer>
|
||||
<!-- <span>
|
||||
<el-button @click="detailVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="">OK</el-button>
|
||||
</span> -->
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { SafetyInspectionVO } from '@/api/safety/safetyInspection/types';
|
||||
import { listByIds } from '@/api/system/oss';
|
||||
import { OssVO } from '@/api/system/oss/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { useDict } from '@/utils/dict';
|
||||
import { dayjs } from 'element-plus';
|
||||
const rectificationFileList = ref<OssVO[]>();
|
||||
const checkFileList = ref<OssVO[]>();
|
||||
|
||||
const emit = defineEmits(['selection-change']);
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
});
|
||||
console.log(props.data);
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
|
||||
const { safety_inspection_violation_type, safety_inspection_check_type, review_type, safety_inspection_type } = toRefs<any>(
|
||||
useDict('safety_inspection_violation_type', 'safety_inspection_check_type', 'review_type', 'safety_inspection_type')
|
||||
);
|
||||
const safetyInspectionDetail = ref<SafetyInspectionVO>();
|
||||
|
||||
const form = reactive({
|
||||
id: '1',
|
||||
projectName: '',
|
||||
serialNumber: '',
|
||||
to: '',
|
||||
subject: '',
|
||||
content: '',
|
||||
attachments: '', // 或 URL
|
||||
contractorLeader: '',
|
||||
contractorDate: '',
|
||||
supervisorLeader: '',
|
||||
supervisorDate: '',
|
||||
ownerRep: '',
|
||||
ownerDate: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
const total = ref(0);
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
const detailVisible = ref(false);
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: any) => {
|
||||
emit('selection-change', selection);
|
||||
};
|
||||
|
||||
const handleDetail = async (row) => {
|
||||
detailVisible.value = true;
|
||||
safetyInspectionDetail.value = row;
|
||||
if (row.checkFile) {
|
||||
const checkFileRes = await listByIds(row.checkFile.split(','));
|
||||
checkFileList.value = checkFileRes.data;
|
||||
}
|
||||
if (row.rectificationFile) {
|
||||
const rectificationFileRes = await listByIds(row.rectificationFile.split(','));
|
||||
rectificationFileList.value = rectificationFileRes.data;
|
||||
}
|
||||
};
|
||||
const getList = (row) => {};
|
||||
const handleDelete = (row) => {};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.white) {
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.none) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
:deep(.zebra) {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
</style>
|
||||
313
src/views/cory/workMessage/index.vue
Normal file
313
src/views/cory/workMessage/index.vue
Normal file
@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="模板类型" prop="projectType">
|
||||
<el-select v-model="queryParams.projectType" placeholder="请选择模板类型" clearable filterable @change="selectType">
|
||||
<el-option v-for="item in projectTypeOptions" :key="item.name" :label="item.name" :value="item.name"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" :disabled="addSingle" @click="handleAdd" v-hasPermi="['quality:qualityInspection:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['quality:qualityInspection:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['quality:qualityInspection:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['quality:qualityInspection:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
<!-- card body -->
|
||||
<Notice @selection-change="handleSelectionChange" :data="tableData"></Notice>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="新增模板" v-model="dialogVisible" width="800">
|
||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="110px">
|
||||
<div class="flex">
|
||||
<!-- <img :src="thumbnailUrl" alt="" style="width: 150px;" /> -->
|
||||
<div><image-preview :src="thumbnailUrl" width="150px"></image-preview></div>
|
||||
<div>
|
||||
<el-form-item label="检查类型" prop="checkType">
|
||||
<el-select v-model="form.checkType" placeholder="请选择检查类型">
|
||||
<el-option v-for="dict in safety_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="违章类型" prop="violationType">
|
||||
<el-select v-model="form.violationType" placeholder="请选择违章类型">
|
||||
<el-option v-for="dict in safety_inspection_violation_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检结果" prop="inspectionResult">
|
||||
<el-input v-model="form.inspectionResult" placeholder="请输入巡检结果" />
|
||||
</el-form-item>
|
||||
<el-form-item label="整改班组" prop="teamId">
|
||||
<el-select v-model="form.teamId" placeholder="请选择整改班组">
|
||||
<el-option v-for="item in teamOpt" :key="item.value" :label="item.label" :value="item.value" @click="changeForeman(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="整改人" prop="correctorId">
|
||||
<el-select v-model="form.correctorId" placeholder="请选择整改人" :disabled="!form.teamId">
|
||||
<el-option v-for="item in foremanOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题隐患" prop="hiddenDanger">
|
||||
<el-input v-model="form.hiddenDanger" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="整改措施" prop="measure">
|
||||
<el-input v-model="form.measure" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="要求整改期限" prop="rectificationDeadline">
|
||||
<el-date-picker clearable v-model="form.rectificationDeadline" type="date" value-format="YYYY-MM-DD" placeholder="选择要求整改期限" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检查附件" prop="checkFile">
|
||||
<file-upload v-model="form.checkFile" :file-size="20" :file-type="['doc', 'docx', 'pdf', 'png', 'jpg', 'jpeg']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="整改附件" prop="rectificationFile">
|
||||
<file-upload v-model="form.rectificationFile" :file-size="20" :file-type="['doc', 'docx', 'pdf', 'png', 'jpg', 'jpeg']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
import Notice from './components/notice.vue';
|
||||
import { listContactTypeformtemplate } from '@/api/cory/contactformtemplate';
|
||||
import { addContactnotice, delContactnotice, listContactnotice } from '@/api/cory/contactnotice';
|
||||
import { listProjectTeamForeman } from '@/api/project/projectTeam';
|
||||
import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const { safety_inspection_violation_type, safety_inspection_check_type } = toRefs<any>(
|
||||
proxy?.useDict('safety_inspection_violation_type', 'safety_inspection_check_type')
|
||||
);
|
||||
|
||||
const teamOpt = ref([]);
|
||||
const foremanOpt = ref([]);
|
||||
const teamList = ref<ProjectTeamForemanResp[]>();
|
||||
const thumbnailUrl = ref('');
|
||||
const tableData = ref([]);
|
||||
const total = ref(0);
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const dialogVisible = ref<boolean>(false);
|
||||
const showSearch = ref(true);
|
||||
const multiple = ref<boolean>(true);
|
||||
const addSingle = ref<boolean>(false);
|
||||
const single = ref<boolean>(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
|
||||
const projectTypeOptions = ref<any>([
|
||||
{
|
||||
value: '0',
|
||||
label: '外部联系单'
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: '变更单'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '通知单'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '回复单'
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '签证单'
|
||||
}
|
||||
]);
|
||||
|
||||
const initFormData = {
|
||||
projectType: '',
|
||||
projectName: '',
|
||||
serialNumber: '',
|
||||
to: '',
|
||||
subject: '',
|
||||
content: '',
|
||||
attachments: '',
|
||||
contractorLeader: '',
|
||||
contractorDate: '',
|
||||
supervisorLeader: '',
|
||||
supervisorDate: '',
|
||||
ownerRep: '',
|
||||
ownerDate: '',
|
||||
unitName: '',
|
||||
profession: '',
|
||||
applyDate: '',
|
||||
bookName: '',
|
||||
bookNo: '',
|
||||
hasAttachment: '',
|
||||
changeReasons: [],
|
||||
changeContent: '',
|
||||
costEstimate: ''
|
||||
};
|
||||
const data = reactive<PageData<any, any>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
inspectionType: undefined,
|
||||
inspectionStatus: undefined,
|
||||
teamId: undefined,
|
||||
type: undefined,
|
||||
params: {},
|
||||
ids: ['1942115670472814593', '1942115720766713857'],
|
||||
projectType: undefined
|
||||
},
|
||||
rules: {
|
||||
projectName: [{ required: true, message: '请输入工程名称', trigger: 'blur' }],
|
||||
projectType: [{ required: true, message: '请选择模板类型', trigger: 'blur' }],
|
||||
serialNumber: [{ required: true, message: '请输入编号', trigger: 'blur' }],
|
||||
to: [{ required: true, message: '请输入接收方', trigger: 'blur' }],
|
||||
subject: [{ required: true, message: '请输入主题', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '请输入内容', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid) => {
|
||||
if (valid) {
|
||||
let data = {
|
||||
type: queryParams.value.type,
|
||||
projectId: currentProject.value?.id,
|
||||
detail: JSON.stringify(form.value)
|
||||
};
|
||||
console.log('提交表单:', form);
|
||||
const res = await addContactnotice(data);
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('添加成功');
|
||||
dialogVisible.value = false;
|
||||
formRef.value.resetFields();
|
||||
getList();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleAdd = () => {
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
|
||||
const changeForeman = (value: string | number) => {
|
||||
const team = teamList.value.filter((team) => team.id === value)[0];
|
||||
foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({
|
||||
label: foreman.foremanName,
|
||||
value: foreman.foremanId
|
||||
}));
|
||||
form.value.correctorId = '';
|
||||
};
|
||||
|
||||
const handleQuery = () => {};
|
||||
const resetQuery = () => {};
|
||||
const getList = async () => {
|
||||
if (!queryParams.value.projectType) {
|
||||
const res = await listContactTypeformtemplate(queryParams.value);
|
||||
projectTypeOptions.value = res.data;
|
||||
queryParams.value.projectType = res.data[0].name;
|
||||
thumbnailUrl.value = res.data[0].thumbnail;
|
||||
queryParams.value.type = res.data[0].id as string;
|
||||
}
|
||||
const res = await listContactnotice(queryParams.value);
|
||||
res.rows = res.rows.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
...JSON.parse(item.detail)
|
||||
};
|
||||
});
|
||||
tableData.value = res.rows;
|
||||
total.value = res.total || 0;
|
||||
// 获取项目班组信息
|
||||
const teamRes = await listProjectTeamForeman(currentProject.value.id);
|
||||
teamList.value = teamRes.data;
|
||||
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
|
||||
label: team.teamName,
|
||||
value: team.id
|
||||
}));
|
||||
};
|
||||
const handleDelete = async (id?: string) => {
|
||||
const _ids = id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除识别记录编号为"' + _ids + '"的数据项?').finally();
|
||||
const res = await delContactnotice(_ids);
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
getList();
|
||||
}
|
||||
};
|
||||
const handleUpdate = () => {};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: any) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
const selectType = (value: string) => {
|
||||
queryParams.value.projectType = value;
|
||||
thumbnailUrl.value = projectTypeOptions.value.filter((item) => item.name == value)[0].thumbnail;
|
||||
queryParams.value.type = projectTypeOptions.value.filter((item) => item.name == value)[0].id;
|
||||
getList();
|
||||
};
|
||||
|
||||
const resetForm = () => {
|
||||
formRef.value?.resetFields();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user