联系单模板
This commit is contained in:
		| @ -5,11 +5,11 @@ VITE_APP_TITLE = 新能源项目管理平台 | ||||
| VITE_APP_ENV = 'development' | ||||
|  | ||||
| # 开发环境 | ||||
| VITE_APP_BASE_API = 'http://192.168.110.119:8899' | ||||
| VITE_APP_BASE_API = 'http://192.168.110.148:8899' | ||||
|  | ||||
| # 无人机接口地址 | ||||
|  | ||||
| VITE_APP_BASE_DRONE_API = 'http://192.168.110.119:9136' | ||||
| VITE_APP_BASE_DRONE_API = 'http://192.168.110.8:9136' | ||||
|  | ||||
| # 应用访问路径 例如使用前缀 /admin/ | ||||
| VITE_APP_CONTEXT_PATH = '/' | ||||
|  | ||||
							
								
								
									
										63
									
								
								src/api/cory/contactformtemplate/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								src/api/cory/contactformtemplate/index.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,63 @@ | ||||
| import request from '@/utils/request'; | ||||
| import { AxiosPromise } from 'axios'; | ||||
| import { ContactformtemplateVO, ContactformtemplateForm, ContactformtemplateQuery } from '@/api/cory/contactformtemplate/types'; | ||||
|  | ||||
| /** | ||||
|  * 查询联系单模板列表 | ||||
|  * @param query | ||||
|  * @returns {*} | ||||
|  */ | ||||
|  | ||||
| export const listContactformtemplate = (query?: ContactformtemplateQuery): AxiosPromise<ContactformtemplateVO[]> => { | ||||
|   return request({ | ||||
|     url: '/cory/contactformtemplate/list', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 查询联系单模板详细 | ||||
|  * @param id | ||||
|  */ | ||||
| export const getContactformtemplate = (id: string | number): AxiosPromise<ContactformtemplateVO> => { | ||||
|   return request({ | ||||
|     url: '/cory/contactformtemplate/' + id, | ||||
|     method: 'get' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 新增联系单模板 | ||||
|  * @param data | ||||
|  */ | ||||
| export const addContactformtemplate = (data: ContactformtemplateForm) => { | ||||
|   return request({ | ||||
|     url: '/cory/contactformtemplate', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 修改联系单模板 | ||||
|  * @param data | ||||
|  */ | ||||
| export const updateContactformtemplate = (data: ContactformtemplateForm) => { | ||||
|   return request({ | ||||
|     url: '/cory/contactformtemplate', | ||||
|     method: 'put', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 删除联系单模板 | ||||
|  * @param id | ||||
|  */ | ||||
| export const delContactformtemplate = (id: string | number | Array<string | number>) => { | ||||
|   return request({ | ||||
|     url: '/cory/contactformtemplate/' + id, | ||||
|     method: 'delete' | ||||
|   }); | ||||
| }; | ||||
							
								
								
									
										79
									
								
								src/api/cory/contactformtemplate/types.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								src/api/cory/contactformtemplate/types.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,79 @@ | ||||
| export interface ContactformtemplateVO { | ||||
|   /** | ||||
|    * 自增ID | ||||
|    */ | ||||
|   id: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 模板名称 | ||||
|    */ | ||||
|   name: string; | ||||
|  | ||||
|   /** | ||||
|    * 模板路径 | ||||
|    */ | ||||
|   path: string; | ||||
|  | ||||
|   /** | ||||
|    * 缩略图 | ||||
|    */ | ||||
|   thumbnail: string; | ||||
|  | ||||
|   /** | ||||
|    * 缩略图Url | ||||
|    */ | ||||
|   thumbnailUrl: string; | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark: string; | ||||
| } | ||||
|  | ||||
| export interface ContactformtemplateForm extends BaseEntity { | ||||
|   /** | ||||
|    * 自增ID | ||||
|    */ | ||||
|   id?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 模板名称 | ||||
|    */ | ||||
|   name?: string; | ||||
|  | ||||
|   /** | ||||
|    * 模板路径 | ||||
|    */ | ||||
|   file?: string; | ||||
|  | ||||
|   /** | ||||
|    * 缩略图 | ||||
|    */ | ||||
|   thumbnail?: string; | ||||
|  | ||||
|   /** | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark?: string; | ||||
| } | ||||
|  | ||||
| export interface ContactformtemplateQuery extends PageQuery { | ||||
|   /** | ||||
|    * 模板名称 | ||||
|    */ | ||||
|   name?: string; | ||||
|  | ||||
|   /** | ||||
|    * 模板路径 | ||||
|    */ | ||||
|   path?: string; | ||||
|  | ||||
|   /** | ||||
|    * 缩略图 | ||||
|    */ | ||||
|   thumbnail?: string; | ||||
|  | ||||
|   /** | ||||
|    * 日期范围参数 | ||||
|    */ | ||||
|   params?: any; | ||||
| } | ||||
| @ -17,6 +17,7 @@ | ||||
|       :accept="accept" | ||||
|       :drag="isDarg" | ||||
|       :data="data" | ||||
|       :auto-upload="autoUpload" | ||||
|     > | ||||
|       <slot> | ||||
|         <div> | ||||
| @ -80,7 +81,6 @@ | ||||
| import { propTypes } from '@/utils/propTypes'; | ||||
| import { delOss, listByIds } from '@/api/system/oss'; | ||||
| import { globalHeaders } from '@/utils/request'; | ||||
|  | ||||
| const props = defineProps({ | ||||
|   modelValue: { | ||||
|     type: [String, Object, Array], | ||||
| @ -102,6 +102,8 @@ const props = defineProps({ | ||||
|   uploadUrl: propTypes.string.def('/resource/oss/upload'), | ||||
|   //可拖拽上传 | ||||
|   isDarg: propTypes.bool.def(false), | ||||
|   // 是否自动上传 | ||||
|   autoUpload: propTypes.bool.def(true), | ||||
|   // 其他参数 | ||||
|   data: propTypes.object.def({}), | ||||
|   onUploadSuccess: { | ||||
| @ -118,7 +120,6 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| const emit = defineEmits(['update:modelValue']); | ||||
| const number = ref(0); | ||||
| const uploadList = ref<any[]>([]); | ||||
|  | ||||
| const baseUrl = import.meta.env.VITE_APP_BASE_API; | ||||
| const uploadFileUrl = ref(baseUrl + props.uploadUrl); // 上传文件服务器地址 | ||||
| const headers = ref(globalHeaders()); | ||||
| @ -216,6 +217,8 @@ interface UploadFileWithOssId extends UploadFile { | ||||
| } | ||||
|  | ||||
| const handleUploadSuccess = (res: any, file: UploadFileWithOssId) => { | ||||
|   console.log(props.data); | ||||
|  | ||||
|   if (res.code === 200) { | ||||
|     if (res.data) { | ||||
|       uploadList.value.push({ | ||||
| @ -239,8 +242,6 @@ const handleUploadSuccess = (res: any, file: UploadFileWithOssId) => { | ||||
|  | ||||
| // 删除文件 | ||||
| const handleDelete = async (index: string | number, type?: string) => { | ||||
|   console.log('🚀 ~ handleDelete ~ index:', index); | ||||
|  | ||||
|   await proxy?.$modal.confirm('是否确认删除此文件?').finally(); | ||||
|   if (type === 'ossId') { | ||||
|     delOss(index); | ||||
| @ -263,7 +264,6 @@ const uploadedSuccessfully = () => { | ||||
|     proxy?.$modal.msgSuccess('导入成功'); | ||||
|     return; | ||||
|   } | ||||
|   console.log(number.value, uploadList.value); | ||||
|  | ||||
|   if (number.value > 0 && uploadList.value.length === number.value) { | ||||
|     fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value); | ||||
| @ -297,6 +297,14 @@ const listToString = (list: any[], separator?: string) => { | ||||
|   }); | ||||
|   return strs != '' ? strs.substring(0, strs.length - 1) : ''; | ||||
| }; | ||||
|  | ||||
| const submitUpload = () => { | ||||
|   fileUploadRef.value!.submit(); | ||||
| }; | ||||
|  | ||||
| defineExpose({ | ||||
|   submitUpload | ||||
| }); | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
|  | ||||
							
								
								
									
										298
									
								
								src/views/cory/contactformtemplate/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										298
									
								
								src/views/cory/contactformtemplate/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,298 @@ | ||||
| <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="name"> | ||||
|               <el-input v-model="queryParams.name" placeholder="请输入模板名称" clearable @keyup.enter="handleQuery" /> | ||||
|             </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" @click="handleAdd" v-hasPermi="['cory:contactformtemplate:add']">新增</el-button> | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['cory:contactformtemplate:edit']" | ||||
|               >修改</el-button | ||||
|             > | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['cory:contactformtemplate:remove']" | ||||
|               >删除</el-button | ||||
|             > | ||||
|           </el-col> | ||||
|           <el-col :span="1.5"> | ||||
|             <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['cory:contactformtemplate:export']">导出</el-button> | ||||
|           </el-col> | ||||
|           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> | ||||
|         </el-row> | ||||
|       </template> | ||||
|  | ||||
|       <el-table v-loading="loading" :data="contactformtemplateList" @selection-change="handleSelectionChange"> | ||||
|         <el-table-column type="selection" width="55" align="center" /> | ||||
|         <el-table-column label="ID" align="center" type="index" /> | ||||
|         <el-table-column label="模板名称" align="center" prop="name" /> | ||||
|         <el-table-column label="缩略图" align="center" prop="thumbnailUrl" width="100"> | ||||
|           <template #default="scope"> | ||||
|             <image-preview :src="scope.row.thumbnail" :width="50" :height="50" /> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="模板路径" align="center" prop="path"> | ||||
|           <template #default="scope"> | ||||
|             <span class="text-blue cursor-pointer" @click="openDoc(scope.row)">{{ scope.row.path }}</span></template | ||||
|           > | ||||
|         </el-table-column> | ||||
|         <el-table-column label="备注" align="center" prop="remark" /> | ||||
|         <el-table-column label="操作" align="center" 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="['cory:contactformtemplate:edit']"></el-button> | ||||
|             </el-tooltip> --> | ||||
|             <el-tooltip content="下载" placement="top"> | ||||
|               <el-button | ||||
|                 link | ||||
|                 type="primary" | ||||
|                 icon="Download" | ||||
|                 @click="handleDownload(scope.row)" | ||||
|                 v-hasPermi="['cory:contactformtemplate:edit']" | ||||
|               ></el-button> | ||||
|             </el-tooltip> | ||||
|             <el-tooltip content="删除" placement="top"> | ||||
|               <el-button | ||||
|                 link | ||||
|                 type="primary" | ||||
|                 icon="Delete" | ||||
|                 @click="handleDelete(scope.row)" | ||||
|                 v-hasPermi="['cory:contactformtemplate:remove']" | ||||
|               ></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 :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> | ||||
|       <el-form ref="contactformtemplateFormRef" :model="form" :rules="rules" label-width="80px"> | ||||
|         <el-form-item label="模板名称" prop="name"> | ||||
|           <el-input v-model="form.name" placeholder="请输入模板名称" /> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="模板路径" prop="file"> | ||||
|           <file-upload | ||||
|             v-model="form.file" | ||||
|             :fileType="['doc', 'docx']" | ||||
|             :autoUpload="false" | ||||
|             ref="fileUploadRef" | ||||
|             :data="{ name: form.name, projectId: currentProject.id }" | ||||
|             uploadUrl="/cory/contactformtemplate" | ||||
|           /> | ||||
|         </el-form-item> | ||||
|         <!-- <el-form-item label="备注" prop="remark"> | ||||
|           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> --> | ||||
|       </el-form> | ||||
|       <template #footer> | ||||
|         <div class="dialog-footer"> | ||||
|           <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | ||||
|           <el-button @click="cancel">取 消</el-button> | ||||
|         </div> | ||||
|       </template> | ||||
|     </el-dialog> | ||||
|     <documentDetailVue ref="documentDetailRef" v-if="showDocumentDetail" @onClose="showDocumentDetail = false"></documentDetailVue> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup name="Contactformtemplate" lang="ts"> | ||||
| import { | ||||
|   listContactformtemplate, | ||||
|   getContactformtemplate, | ||||
|   delContactformtemplate, | ||||
|   addContactformtemplate, | ||||
|   updateContactformtemplate | ||||
| } from '@/api/cory/contactformtemplate'; | ||||
| import { ContactformtemplateVO, ContactformtemplateQuery, ContactformtemplateForm } from '@/api/cory/contactformtemplate/types'; | ||||
| import { useUserStoreHook } from '@/store/modules/user'; | ||||
|  | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| import documentDetailVue from '@/views/safety/knowledgeDocument/component/documentsDeails.vue'; | ||||
| const contactformtemplateList = ref<ContactformtemplateVO[]>([]); | ||||
| const buttonLoading = ref(false); | ||||
| const loading = ref(true); | ||||
| const showSearch = ref(true); | ||||
| const ids = ref<Array<string | number>>([]); | ||||
| const single = ref(true); | ||||
| const multiple = ref(true); | ||||
| const total = ref(0); | ||||
| const fileUploadRef = ref(); | ||||
| const queryFormRef = ref<ElFormInstance>(); | ||||
| const contactformtemplateFormRef = ref<ElFormInstance>(); | ||||
| const showDocumentDetail = ref(false); | ||||
| const documentDetailRef = ref(); | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| // 从 store 中获取项目列表和当前选中的项目 | ||||
| const currentProject = computed(() => userStore.selectedProject); | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '' | ||||
| }); | ||||
| const uploadData = reactive({ | ||||
|   bo: { | ||||
|     name: '12' | ||||
|   } | ||||
| }); | ||||
|  | ||||
| const initFormData: ContactformtemplateForm = { | ||||
|   id: undefined, | ||||
|   name: undefined, | ||||
|   remark: undefined | ||||
| }; | ||||
| const data = reactive<PageData<ContactformtemplateForm, ContactformtemplateQuery>>({ | ||||
|   form: { ...initFormData }, | ||||
|   queryParams: { | ||||
|     pageNum: 1, | ||||
|     pageSize: 10, | ||||
|     name: undefined, | ||||
|     path: undefined, | ||||
|     thumbnail: undefined, | ||||
|     params: {} | ||||
|   }, | ||||
|   rules: { | ||||
|     id: [{ required: true, message: '自增ID不能为空', trigger: 'blur' }], | ||||
|     name: [{ required: true, message: '模板名称不能为空', trigger: 'blur' }] | ||||
|   } | ||||
| }); | ||||
|  | ||||
| const { queryParams, form, rules } = toRefs(data); | ||||
|  | ||||
| /** 查询联系单模板列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true; | ||||
|   const res = await listContactformtemplate(queryParams.value); | ||||
|   contactformtemplateList.value = res.rows; | ||||
|   total.value = res.total; | ||||
|   loading.value = false; | ||||
| }; | ||||
|  | ||||
| /** 取消按钮 */ | ||||
| const cancel = () => { | ||||
|   reset(); | ||||
|   dialog.visible = false; | ||||
| }; | ||||
|  | ||||
| /** 表单重置 */ | ||||
| const reset = () => { | ||||
|   form.value = { ...initFormData }; | ||||
|   contactformtemplateFormRef.value?.resetFields(); | ||||
| }; | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.value.pageNum = 1; | ||||
|   getList(); | ||||
| }; | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value?.resetFields(); | ||||
|   handleQuery(); | ||||
| }; | ||||
|  | ||||
| /** 多选框选中数据 */ | ||||
| const handleSelectionChange = (selection: ContactformtemplateVO[]) => { | ||||
|   ids.value = selection.map((item) => item.id); | ||||
|   single.value = selection.length != 1; | ||||
|   multiple.value = !selection.length; | ||||
| }; | ||||
|  | ||||
| /** 新增按钮操作 */ | ||||
| const handleAdd = () => { | ||||
|   reset(); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '添加联系单模板'; | ||||
| }; | ||||
|  | ||||
| /** 修改按钮操作 */ | ||||
| const handleUpdate = async (row?: ContactformtemplateVO) => { | ||||
|   reset(); | ||||
|   const _id = row?.id || ids.value[0]; | ||||
|   const res = await getContactformtemplate(_id); | ||||
|   Object.assign(form.value, res.data); | ||||
|   dialog.visible = true; | ||||
|   dialog.title = '修改联系单模板'; | ||||
| }; | ||||
|  | ||||
| const handleDownload = async (row) => { | ||||
|   window.open(row.path); | ||||
| }; | ||||
|  | ||||
| const openDoc = (row) => { | ||||
|   showDocumentDetail.value = true; | ||||
|   nextTick(() => { | ||||
|     let data = { | ||||
|       id: row.id, | ||||
|       fileSuffix: 'doc', | ||||
|       fileName: row.name, | ||||
|       fileUrl: row.path | ||||
|     }; | ||||
|     documentDetailRef.value.openDialog(data); | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** 提交按钮 */ | ||||
| const submitForm = () => { | ||||
|   contactformtemplateFormRef.value?.validate(async (valid: boolean) => { | ||||
|     if (valid) { | ||||
|       buttonLoading.value = true; | ||||
|       // if (form.value.id) { | ||||
|       //   await updateContactformtemplate(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       // } else { | ||||
|       //   await addContactformtemplate(form.value).finally(() => (buttonLoading.value = false)); | ||||
|       // } | ||||
|  | ||||
|       uploadData.bo.name = form.value.name; | ||||
|       console.log('🚀 ~ contactformtemplateFormRef.value?.validate ~ uploadData:', uploadData); | ||||
|       await fileUploadRef.value!.submitUpload(); | ||||
|       proxy?.$modal.msgSuccess('操作成功'); | ||||
|       dialog.visible = false; | ||||
|       await getList(); | ||||
|     } | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (row?: ContactformtemplateVO) => { | ||||
|   const _ids = row?.id || ids.value; | ||||
|   await proxy?.$modal.confirm('是否确认删除联系单模板编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false)); | ||||
|   await delContactformtemplate(_ids); | ||||
|   proxy?.$modal.msgSuccess('删除成功'); | ||||
|   await getList(); | ||||
| }; | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = () => { | ||||
|   proxy?.download( | ||||
|     'cory/contactformtemplate/export', | ||||
|     { | ||||
|       ...queryParams.value | ||||
|     }, | ||||
|     `contactformtemplate_${new Date().getTime()}.xlsx` | ||||
|   ); | ||||
| }; | ||||
|  | ||||
| onMounted(() => { | ||||
|   getList(); | ||||
| }); | ||||
| </script> | ||||
| @ -70,7 +70,6 @@ export default defineComponent({ | ||||
|     }; | ||||
|     const init = (obj) => { | ||||
|       let documentKey = obj.id.toString() + new Date().getTime(); | ||||
|       console.log('🚀 ~ init ~ url:', obj.fileUrl); | ||||
|       let type = obj.fileSuffix; | ||||
|       if (obj.fileSuffix.includes('.')) { | ||||
|         type = obj.fileSuffix.substring(1); | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <div class="content-box"> | ||||
|     <el-table :data="[form, { ...form, id: '2' }]" style="width: 100%" @selection-change="handleSelectionChange"> | ||||
|     <el-table :data="[form, { ...form, id: '2' }]" @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="编号" /> | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <div class="content-box"> | ||||
|     <el-table :data="[form]" border style="width: 100%" @selection-change="handleSelectionChange"> | ||||
|     <el-table :data="[form]" 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="提出单位" /> | ||||
| @ -84,8 +84,8 @@ | ||||
|           <el-descriptions-item label-align="center" label="专业" label-class-name="white"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="提出日期" label-class-name="white"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="卷册名称" class-name="zebra"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="附图" class-name="zebra"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="卷册号" :span="2" label-class-name="white"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="卷册号" class-name="zebra"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="附图" :span="2" label-class-name="white"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="变更原因" :span="2" class-name="zebra"> | ||||
|             <el-checkbox-group v-model="form.changeReasons"> | ||||
|               <el-checkbox | ||||
|  | ||||
							
								
								
									
										194
									
								
								src/views/template/components/notice.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										194
									
								
								src/views/template/components/notice.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,194 @@ | ||||
| <template> | ||||
|   <div class="content-box"> | ||||
|     <el-table v-loading="loading" :data="[form]" @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">工程名称:</el-col> | ||||
|           <el-col :span="12" style="text-align: right">编号:123123123132</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"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="检查类型" label-class-name="white"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="违章类型" label-class-name="white"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="检查时间" class-name="zebra"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="检查人" class-name="zebra"></el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="整改人" label-class-name="white"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="要求整改期限" label-class-name="white"> </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"> </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"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="整改日期" label-class-name="white"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2" label-class-name="white"> </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"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="复查日期" label-class-name="white"> </el-descriptions-item> | ||||
|           <el-descriptions-item label-align="center" label="复查情况" :span="2" label-class-name="white"> </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> | ||||
| const emit = defineEmits(['selection-change']); | ||||
|  | ||||
| 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 = (row) => { | ||||
|   detailVisible.value = true; | ||||
| }; | ||||
| 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> | ||||
| @ -53,16 +53,17 @@ | ||||
|         v-if="queryParams.projectType == '1'" | ||||
|         @selection-change="handleSelectionChange" | ||||
|       ></EngineeringChangeApplicationForm> | ||||
|       <Notice v-if="queryParams.projectType == '2'" @selection-change="handleSelectionChange"></Notice> | ||||
|     </el-card> | ||||
|  | ||||
|     <el-dialog title="新增模板" v-model="dialogVisible" width="800"> | ||||
|       <el-form :model="form" :rules="rules" ref="formRef" label-width="110px"> | ||||
|         <!-- <el-form-item label="模板类型" prop="projectType"> | ||||
|           <el-select v-model="form.projectType" value-key="" placeholder="请选择模板类型" clearable filterable @change=""> | ||||
|             <el-option v-for="item in projectTypeOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> | ||||
|           </el-select> | ||||
|         </el-form-item> --> | ||||
|  | ||||
|         <div class="flex"> | ||||
|           <img | ||||
|             src="http://58.17.134.85:9000/xinnengyuan-dev/contactNotice/2025/07/03/2e735c2fda06492bb31342656fde1004.png" | ||||
|             alt="" | ||||
|             style="width: 150px" | ||||
|           /> | ||||
|           <div v-if="queryParams.projectType == '0'"> | ||||
|             <el-form-item label="工程名称" prop="projectName"> | ||||
|               <el-input v-model="form.projectName" placeholder="请输入工程名称" /> | ||||
| @ -105,11 +106,6 @@ | ||||
|               <el-date-picker v-model="form.ownerDate" type="date" placeholder="选择日期" style="width: 100%" /> | ||||
|             </el-form-item> | ||||
|           </div> | ||||
|  | ||||
|         <!-- <el-form-item> | ||||
|         <el-button type="primary" @click="submitForm">提交</el-button> | ||||
|         <el-button @click="resetForm">重置</el-button> | ||||
|       </el-form-item> --> | ||||
|           <div v-if="queryParams.projectType === '1'"> | ||||
|             <el-form-item label="工程名称"> | ||||
|               <el-input v-model="form.projectName" /> | ||||
| @ -198,6 +194,50 @@ | ||||
|               <el-date-picker v-model="form.supervisorDate" type="date" placeholder="选择日期" style="width: 100%" /> | ||||
|             </el-form-item> | ||||
|           </div> | ||||
|           <div v-if="queryParams.projectType === '2'"> | ||||
|             <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="checkTime"> | ||||
|               <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> | ||||
| @ -214,12 +254,18 @@ 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 Notice from './components/notice.vue'; | ||||
|  | ||||
| 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 formRef = ref<FormInstance>(); | ||||
| const dialogVisible = ref<boolean>(false); | ||||
| @ -244,7 +290,7 @@ const projectTypeOptions = [ | ||||
|   }, | ||||
|   { | ||||
|     value: '3', | ||||
|     label: '变更单' | ||||
|     label: '回复单' | ||||
|   }, | ||||
|   { | ||||
|     value: '4', | ||||
| @ -314,6 +360,15 @@ 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 = () => {}; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user