diff --git a/src/api/safety/violationRecord/index.ts b/src/api/safety/violationRecord/index.ts new file mode 100644 index 0000000..050bec4 --- /dev/null +++ b/src/api/safety/violationRecord/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ViolationRecordVO, ViolationRecordForm, ViolationRecordQuery } from '@/api/safety/violationRecord/types'; + +/** + * 查询违规记录列表 + * @param query + * @returns {*} + */ + +export const listViolationRecord = (query?: ViolationRecordQuery): AxiosPromise => { + return request({ + url: '/safety/violationRecord/list', + method: 'get', + params: query + }); +}; + +/** + * 查询违规记录详细 + * @param id + */ +export const getViolationRecord = (id: string | number): AxiosPromise => { + return request({ + url: '/safety/violationRecord/' + id, + method: 'get' + }); +}; + +/** + * 新增违规处理人 + * @param data + */ +export const addViolationRecord = (data: any) => { + return request({ + url: '/safety/violationRecord/handler', + method: 'post', + data: data + }); +}; + +/** + * 修改违规记录 + * @param data + */ +export const updateViolationRecord = (data: ViolationRecordForm) => { + return request({ + url: '/safety/violationRecord', + method: 'put', + data: data + }); +}; + +/** + * 删除违规记录 + * @param id + */ +export const delViolationRecord = (id: string | number | Array) => { + return request({ + url: '/safety/violationRecord/' + id, + method: 'delete' + }); +}; diff --git a/src/api/safety/violationRecord/types.ts b/src/api/safety/violationRecord/types.ts new file mode 100644 index 0000000..030b6db --- /dev/null +++ b/src/api/safety/violationRecord/types.ts @@ -0,0 +1,241 @@ +export interface ViolationRecordVO { + /** + * 主键id + */ + id: string | number; + + /** + * 项目id + */ + projectId: string | number; + + /** + * 违章等级id + */ + levelId: string | number; + + /** + * 违章类型 + */ + violationType: string; + + /** + * 违章时间 + */ + violationTime: string; + + /** + * 违章处理人id + */ + handlerId: string | number; + + /** + * 整改措施 + */ + measure: string; + + /** + * 整改时间 + */ + rectificationTime: string; + + /** + * 复查情况 + */ + review: string; + + /** + * 复查状态(1通过 2未通过) + */ + reviewType: string; + + /** + * 复查时间 + */ + reviewTime: string; + + /** + * 处理流程类型(0仅通知 1通知整改复查) + */ + processType: string; + + /** + * 工单状态(1通知 2整改 3复查) + */ + status: string; + + /** + * 备注 + */ + remark: string; + +} + +export interface ViolationRecordForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 项目id + */ + projectId?: string | number; + + /** + * 违章等级id + */ + levelId?: string | number; + + /** + * 识别记录id + */ + recognizeId?: string | number; + + /** + * 违章类型 + */ + violationType?: string; + + /** + * 违章时间 + */ + violationTime?: string; + + /** + * 违章处理人id + */ + handlerId?: string | number; + + /** + * 处理期限 + */ + disposeDeadline?: string; + + /** + * 处理时间 + */ + disposeTime?: string; + + /** + * 整改措施 + */ + measure?: string; + + /** + * 整改时间 + */ + rectificationTime?: string; + + /** + * 复查情况 + */ + review?: string; + + /** + * 复查状态(1通过 2未通过) + */ + reviewType?: string; + + /** + * 复查时间 + */ + reviewTime?: string; + + /** + * 处理流程类型(0仅通知 1通知整改复查) + */ + processType?: string; + + /** + * 工单状态(1通知 2整改 3复查) + */ + status?: string; + + /** + * 备注 + */ + remark?: string; + +} + +export interface ViolationRecordQuery extends PageQuery { + + /** + * 主键id + */ + id?: string | number; + + /** + * 项目id + */ + projectId?: string | number; + + /** + * 违章类型 + */ + violationType?: string; + + /** + * 违章时间 + */ + violationTime?: string; + + /** + * 违章处理人id + */ + handlerId?: string | number; + + /** + * 处理期限 + */ + disposeDeadline?: string; + + /** + * 处理时间 + */ + disposeTime?: string; + + /** + * 整改措施 + */ + measure?: string; + + /** + * 整改时间 + */ + rectificationTime?: string; + + /** + * 复查情况 + */ + review?: string; + + /** + * 复查状态(1通过 2未通过) + */ + reviewType?: string; + + /** + * 复查时间 + */ + reviewTime?: string; + + /** + * 处理流程类型(0仅通知 1通知整改复查) + */ + processType?: string; + + /** + * 工单状态(1通知 2整改 3复查) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index 6ca7b40..a910be8 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -11,6 +11,14 @@ export function listPost(query: { pageNum: number; pageSize: number }): AxiosPro }); } +// 查询岗位列表 +export function listTreeByProject(projectId: string): AxiosPromise { + return request({ + url: '/system/dept/list/treeByProjectId/' + projectId, + method: 'get' + }); +} + // 查询岗位详细 export function getPost(postId: string | number): AxiosPromise { return request({ diff --git a/src/utils/request.ts b/src/utils/request.ts index befc210..28fc5b7 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -25,7 +25,7 @@ export const globalHeaders = () => { axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'; axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID; -// axios.defaults.headers['projectId'] = cache.local.getJSON('selectedProject')?.id || ''; +axios.defaults.headers['isEncrypt'] = true; // 创建 axios 实例 const service = axios.create({ @@ -85,6 +85,8 @@ service.interceptors.request.use( // 生成一个 AES 密钥 const aesKey = generateAesKey(); config.headers[encryptHeader] = encrypt(encryptBase64(aesKey)); + console.log(encrypt(encryptBase64(aesKey))); + config.data = typeof config.data === 'object' ? encryptWithAes(JSON.stringify(config.data), aesKey) : encryptWithAes(config.data, aesKey); } } diff --git a/src/views/project/constructionUser/index.vue b/src/views/project/constructionUser/index.vue index 98b674e..9c6ff63 100644 --- a/src/views/project/constructionUser/index.vue +++ b/src/views/project/constructionUser/index.vue @@ -40,7 +40,7 @@ - -
- -
+ +
+ +
@@ -159,7 +159,7 @@ const currentProject = computed(() => userStore.selectedProject); const contractorMaterialList = ref([]); const buttonLoading = ref(false); const loading = ref(true); -const contractorMaterialRecordRef=ref(null) +const contractorMaterialRecordRef = ref(null); const showSearch = ref(true); const ids = ref>([]); const single = ref(true); @@ -218,6 +218,7 @@ const getSubList = async () => { projectId: currentProject.value.id }); contractorList.value = res.rows; + handleQuery(); }; /** 查询分包方物料列表 */ @@ -244,6 +245,7 @@ const reset = () => { /** 搜索按钮操作 */ const handleQuery = () => { queryParams.value.pageNum = 1; + if (contractorList.value.length == 1) queryParams.value.contractorId = contractorList.value[0].id; getList(); }; @@ -310,7 +312,6 @@ const listeningProject = watch( queryParams.value.projectId = nid; form.value.projectId = nid; getSubList(); - getList(); } ); onUnmounted(() => { @@ -318,13 +319,12 @@ onUnmounted(() => { }); const handleView = async (row: ContractorToolVO) => { // 打开弹框 - dialogRecord.visible=true; - dialogRecord.title=row.materialName+"-物料出入库"; + dialogRecord.visible = true; + dialogRecord.title = row.materialName + '-物料出入库'; await nextTick(); contractorMaterialRecordRef.value.getAll(row); }; onMounted(() => { getSubList(); - getList(); }); diff --git a/src/views/project/contractorTool/index.vue b/src/views/project/contractorTool/index.vue index 630b41c..7cf7c80 100644 --- a/src/views/project/contractorTool/index.vue +++ b/src/views/project/contractorTool/index.vue @@ -13,8 +13,8 @@ - - + + @@ -35,13 +35,23 @@ @@ -127,7 +138,7 @@ diff --git a/src/views/project/projectUser/index.vue b/src/views/project/projectUser/index.vue index 1cdb46f..398ef6d 100644 --- a/src/views/project/projectUser/index.vue +++ b/src/views/project/projectUser/index.vue @@ -40,7 +40,7 @@