Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
# .env.development
# .env.production
# .env.staging
# index.html
# package.json
# src/layout/components/Sidebar/Logo.vue
# src/main.js
# src/views/login.vue
# vite.config.js
| | |
| | | # 页颿 é¢
|
| | | VITE_APP_TITLE = ä¸å°ä¼ä¸æ°åå转åäºçº§å¥é¤å
|
| | | VITE_APP_TITLE = æµè¯è¿éå管çç³»ç»
|
| | |
|
| | | # å¼åç¯å¢é
ç½®
|
| | | VITE_APP_ENV = 'development'
|
| | |
|
| | | # ä¸å°ä¼ä¸æ°åå转åäºçº§å¥é¤å
/å¼åç¯å¢
|
| | | # æµè¯è¿éå管çç³»ç»/å¼åç¯å¢
|
| | | VITE_APP_BASE_API = '/dev-api'
|
| | |
| | | # 页颿 é¢
|
| | | VITE_APP_TITLE = ä¸å°ä¼ä¸æ°åå转åäºçº§å¥é¤å
|
| | | VITE_APP_TITLE = æµè¯è¿éå管çç³»ç»
|
| | |
|
| | | # ç产ç¯å¢é
ç½®
|
| | | VITE_APP_ENV = 'production'
|
| | |
|
| | | # ä¸å°ä¼ä¸æ°åå转åäºçº§å¥é¤å
/ç产ç¯å¢
|
| | | # æµè¯è¿éå管çç³»ç»/ç产ç¯å¢
|
| | | VITE_APP_BASE_API = '/prod-api'
|
| | |
|
| | | # æ¯å¦å¨æå
æ¶å¼å¯åç¼©ï¼æ¯æ gzip å brotli
|
| | |
| | | # 页颿 é¢
|
| | | VITE_APP_TITLE = ä¸å°ä¼ä¸æ°åå转åäºçº§å¥é¤å
|
| | | VITE_APP_TITLE = æµè¯è¿éå管çç³»ç»
|
| | |
|
| | | # ç产ç¯å¢é
ç½®
|
| | | VITE_APP_ENV = 'staging'
|
| | |
|
| | | # ä¸å°ä¼ä¸æ°åå转åäºçº§å¥é¤å
/ç产ç¯å¢
|
| | | # æµè¯è¿éå管çç³»ç»/ç产ç¯å¢
|
| | | VITE_APP_BASE_API = '/stage-api'
|
| | |
|
| | | # æ¯å¦å¨æå
æ¶å¼å¯åç¼©ï¼æ¯æ gzip å brotli
|
| | |
| | | name="viewport"
|
| | | content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
|
| | | />
|
| | | <link rel="icon" href="/favicon.ico" />
|
| | | <title>ä¸å°ä¼ä¸æ°åå转åäºçº§å¥é¤å
</title>
|
| | | <link rel="icon" href="/ZQHXico.ico" />
|
| | | <title>æµè¯è¿éå管çç³»ç»</title>
|
| | | <!--[if lt IE 11
|
| | | ]><script>
|
| | | window.location.href = "/html/ie.html";
|
| | |
| | | { |
| | | "name": "ruoyi", |
| | | "version": "3.8.9", |
| | | "description": "ä¸å°ä¼ä¸æ°åå转åäºçº§å¥é¤å
", |
| | | "description": "æµè¯è¿éå管çç³»ç»", |
| | | "author": "è¥ä¾", |
| | | "license": "MIT", |
| | | "type": "module", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢åæè®¾ç½®å表 |
| | | export function listHolidaySettings(query) { |
| | | return request({ |
| | | url: "/holidaySettings/getList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //æ¥è¯¢å¹´åè§åå表 |
| | | export function listAnnualLeaveSettingList(query) { |
| | | return request({ |
| | | url: "/holidaySettings/getAnnualLeaveSettingList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //æ¥è¯¢å çè§åå表 |
| | | export function listOvertimeSettingList(query) { |
| | | return request({ |
| | | url: "/holidaySettings/getOvertimeSettingList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //æ¥è¯¢å·¥ä½æ¶é´è§åå表 |
| | | export function listWorkingHoursSettingList(query) { |
| | | return request({ |
| | | url: "/holidaySettings/getWorkingHoursSettingList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢åæè®¾ç½® |
| | | export function addHolidaySettings(data) { |
| | | return request({ |
| | | url: "/holidaySettings/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | //æ°å¢å¹´åè§å |
| | | export function addAnnualLeaveSetting(data) { |
| | | return request({ |
| | | url: "/holidaySettings/addAnnualLeaveSetting", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | //æ°å¢å çè§å |
| | | export function addOvertimeSetting(data) { |
| | | return request({ |
| | | url: "/holidaySettings/addOvertimeSetting", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | //æ°å¢å·¥ä½æ¶é´è§å |
| | | export function addWorkingHoursSetting(data) { |
| | | return request({ |
| | | url: "/holidaySettings/addWorkingHoursSetting", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | |
| | | // ä¿®æ¹åæè®¾ç½® |
| | | export function updateHolidaySettings(data) { |
| | | return request({ |
| | | url: "/holidaySettings/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // ä¿®æ¹å¹´åè§å |
| | | export function updateAnnualLeaveSetting(data) { |
| | | return request({ |
| | | url: "/holidaySettings/updateAnnualLeaveSetting", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // ä¿®æ¹å çè§å |
| | | export function updateOvertimeSetting(data) { |
| | | return request({ |
| | | url: "/holidaySettings/updateOvertimeSetting", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // ä¿®æ¹å·¥ä½æ¶é´è§å |
| | | export function updateWorkingHoursSetting(data) { |
| | | return request({ |
| | | url: "/holidaySettings/updateWorkingHoursSetting", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æ¹éå é¤åæè®¾ç½® |
| | | export function delHolidaySettings(query) { |
| | | return request({ |
| | | url: "/holidaySettings/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | // æ¹éå é¤å¹´åè§å |
| | | export function delAnnualLeaveSetting(query) { |
| | | return request({ |
| | | url: "/holidaySettings/deleteAnnualLeaveSetting", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | // æ¹éå é¤å çè§å |
| | | export function delOvertimeSetting(query) { |
| | | return request({ |
| | | url: "/holidaySettings/deleteOvertimeSetting", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | // æ¹éå é¤å·¥ä½æ¶é´è§å |
| | | export function delWorkingHoursSetting(query) { |
| | | return request({ |
| | | url: "/holidaySettings/deleteWorkingHoursSetting", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢ç¥è¯åºå表 |
| | | export function listKnowledgeBase(query) { |
| | | return request({ |
| | | url: "/knowledgeBase/getList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ¥è¯¢ç¥è¯åºè¯¦ç» |
| | | // export function getKnowledgeBase(knowledgeBaseId) { |
| | | // return request({ |
| | | // url: "/collaborativeApproval/knowledgeBase/" + knowledgeBaseId, |
| | | // method: "get", |
| | | // }); |
| | | // } |
| | | |
| | | // æ°å¢ç¥è¯åº |
| | | export function addKnowledgeBase(data) { |
| | | return request({ |
| | | url: "/knowledgeBase/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ç¥è¯åº |
| | | export function updateKnowledgeBase(data) { |
| | | return request({ |
| | | url: "/knowledgeBase/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤ç¥è¯åº |
| | | export function delKnowledgeBase(query) { |
| | | return request({ |
| | | url: "/knowledgeBase/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | |
| | | // æ¹éå é¤ç¥è¯åº |
| | | export function delKnowledgeBaseBatch(knowledgeBaseIds) { |
| | | return request({ |
| | | url: "/knowledgeBase/batch", |
| | | method: "delete", |
| | | data: knowledgeBaseIds, |
| | | }); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢éç¥å表 |
| | | export function listNotification(query) { |
| | | return request({ |
| | | url: "/notificationManagement/getList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢éç¥ |
| | | export function addNotification(data) { |
| | | return request({ |
| | | url: "/notificationManagement/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | //æ°å¢ä¼è®® |
| | | export function addOnlineMeeting(data) { |
| | | return request({ |
| | | url: "/notificationManagement/addOnlineMeeting", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | //æ°å¢æä»¶å
񄧮 |
| | | export function addFileSharing(data) { |
| | | return request({ |
| | | url: "/notificationManagement/addFileSharing", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹éç¥ |
| | | export function updateNotification(data) { |
| | | return request({ |
| | | url: "/notificationManagement/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æ¹éå é¤éç¥ |
| | | export function delNotification(query) { |
| | | return request({ |
| | | url: "/notificationManagement/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | |
| | | // // æ¹éå é¤ç¥è¯åº |
| | | // export function delKnowledgeBaseBatch(knowledgeBaseIds) { |
| | | // return request({ |
| | | // url: "/knowledgeBase/batch", |
| | | // method: "delete", |
| | | // data: knowledgeBaseIds, |
| | | // }); |
| | | // } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢è®¡åå表 |
| | | export function listDutyPlan(query) { |
| | | return request({ |
| | | url: "/dutyPlan/getList", |
| | | method: "get", |
| | | params: query |
| | | }); |
| | | } |
| | | //æ°æ® |
| | | export function NumDutyPlan(query) { |
| | | return request({ |
| | | url: "/dutyPlan/getNum", |
| | | method: "get", |
| | | params: query |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è®¡å |
| | | export function addDutyPlan(data) { |
| | | return request({ |
| | | url: "/dutyPlan/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | |
| | | // ä¿®æ¹è®¡å |
| | | export function updateDutyPlan(data) { |
| | | return request({ |
| | | url: "/dutyPlan/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤è®¡å |
| | | export function delDutyPlan(query) { |
| | | return request({ |
| | | url: "/dutyPlan/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | // 导åºè®¡å |
| | | export function exportDutyPlan(query) { |
| | | return request({ |
| | | url: "/dutyPlan/export", |
| | | method: "post", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // // æ¹éå é¤è®¡å |
| | | // export function delDutyPlanBatch(dutyPlanIds) { |
| | | // return request({ |
| | | // url: "/dutyPlan/batch", |
| | | // method: "delete", |
| | | // data: dutyPlanIds, |
| | | // }); |
| | | // } |
| | | |
| | |
| | | // æ¥è¯¢RPAå表 |
| | | export function listRpa(query) { |
| | | return request({ |
| | | url: "/collaborativeApproval/rpa/list", |
| | | url: "/rpaProcessAutomation/getList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | |
| | | // æ°å¢RPA |
| | | export function addRpa(data) { |
| | | return request({ |
| | | url: "/collaborativeApproval/rpa", |
| | | url: "/rpaProcessAutomation/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | |
| | | // ä¿®æ¹RPA |
| | | export function updateRpa(data) { |
| | | return request({ |
| | | url: "/collaborativeApproval/rpa", |
| | | method: "put", |
| | | url: "/rpaProcessAutomation/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤RPA |
| | | export function delRpa(rpaId) { |
| | | export function delRpa(query) { |
| | | return request({ |
| | | url: "/collaborativeApproval/rpa/" + rpaId, |
| | | url: "/rpaProcessAutomation/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢å°ç« ç³è¯·å表 |
| | | export function listSealApplication(page,query) { |
| | | return request({ |
| | | url: "/sealApplicationManagement/getList", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query}, |
| | | }); |
| | | } |
| | | // æ¥è¯¢è§ç« å¶åº¦å表 |
| | | export function listRuleManagement(page,query) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/getList", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query}, |
| | | }); |
| | | } |
| | | // æ¥è¯¢é
è¯»ç¶æå表 |
| | | export function getReadingStatusList(page,query) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/getReadingStatusList", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query}, |
| | | }); |
| | | } |
| | | // æ ¹æ®è§åidæ¥è¯¢é
è¯»ç¶æå表 |
| | | export function getReadingStatusByRuleId(id) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/getReadingStatusByRuleId/"+id, |
| | | method: "get" |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢å°ç« ç³è¯· |
| | | export function addSealApplication(data) { |
| | | return request({ |
| | | url: "/sealApplicationManagement/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // æ°å¢è§ç« å¶åº¦ |
| | | export function addRuleManagement(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // æ°å¢é
è¯»ç¶æ |
| | | export function addReadingStatus(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/addReadingStatus", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹å°ç« ç³è¯· |
| | | export function updateSealApplication(data) { |
| | | return request({ |
| | | url: "/sealApplicationManagement/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // ä¿®æ¹è§ç« å¶åº¦ |
| | | export function updateRuleManagement(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // ä¿®æ¹é
è¯»ç¶æ |
| | | export function updateReadingStatus(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/updateReadingStatus", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤å°ç« ç³è¯· |
| | | export function delSealApplication(query) { |
| | | return request({ |
| | | url: "/sealApplicationManagement/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | // å é¤è§ç« å¶åº¦ |
| | | export function delRuleManagement(query) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | |
| | | // æ¹éå é¤ç¥è¯åº |
| | | export function delKnowledgeBaseBatch(knowledgeBaseIds) { |
| | | return request({ |
| | | url: "/knowledgeBase/batch", |
| | | method: "delete", |
| | | data: knowledgeBaseIds, |
| | | }); |
| | | } |
| | | |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢å¨æ°ç½é¢è¦å表 |
| | | export const getStockWarningPage = (params) => { |
| | | export const getStockWarningPage = (page, params) => { |
| | | return request({ |
| | | url: "/gasTankWarning/listPage", |
| | | method: "get", |
| | | params, |
| | | params: { |
| | | ...page, |
| | | ...params |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | |
| | | return request({ |
| | | url: "/gasTankWarning/add", |
| | | method: "post", |
| | | data, |
| | | data: data, |
| | | }); |
| | | }; |
| | | |
| | |
| | | export const updateStockWarning = (data) => { |
| | | return request({ |
| | | url: "/gasTankWarning/update", |
| | | method: "put", |
| | | data, |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | }; |
| | | |
| | |
| | | return request({ |
| | | url: "/gasTankWarning/delete", |
| | | method: "delete", |
| | | data: { ids }, |
| | | data: ids, |
| | | }); |
| | | }; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // æç管ç |
| | | import request from "@/utils/request"; |
| | | |
| | | export function save(data) { |
| | | return request({ |
| | | url: "/staff/staffScheduling/save", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | export function del(id) { |
| | | return request({ |
| | | url: "/staff/staffScheduling/del/"+id, |
| | | method: "delete", |
| | | }); |
| | | } |
| | | |
| | | export function delByIds(data) { |
| | | return request({ |
| | | url: "/staff/staffScheduling/save", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | export function listPage(data){ |
| | | return request({ |
| | | url: "/staff/staffScheduling/listPage", |
| | | method: "post", |
| | | data: data |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // èªé
¬ç®¡ç |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢èå¤å表 |
| | | export function personalAttendanceRecordsListPage(query) { |
| | | return request({ |
| | | url: "/staff/personalAttendanceRecords/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ¥è¯¢åæç³è¯·å表 |
| | | export function holidayApplicationListPage(query) { |
| | | return request({ |
| | | url: "/staff/holidayApplication/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ°å¢ |
| | | export function personalAttendanceRecordsAdd(query) { |
| | | return request({ |
| | | url: "/staff/personalAttendanceRecords/add", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // æ°å¢åæç³è¯· |
| | | export function holidayApplicationAdd(query) { |
| | | return request({ |
| | | url: "/staff/holidayApplication/add", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // ä¿®æ¹ |
| | | export function personalAttendanceRecordsUpdate(query) { |
| | | return request({ |
| | | url: "/staff/personalAttendanceRecords/update", |
| | | method: "put", |
| | | data: query, |
| | | }); |
| | | } |
| | | // ä¿®æ¹åæç³è¯· |
| | | export function holidayApplicationUpdate(query) { |
| | | return request({ |
| | | url: "/staff/holidayApplication/update", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // å é¤ |
| | | export function personalAttendanceRecordsDelete(id) { |
| | | return request({ |
| | | url: "/staff/personalAttendanceRecords/delete/"+id, |
| | | method: "delete", |
| | | }); |
| | | } |
| | | // å é¤åæç³è¯· |
| | | export function holidayApplicationDelete(id) { |
| | | return request({ |
| | | url: "/staff/holidayApplication/delete/"+id, |
| | | method: "delete", |
| | | }); |
| | | } |
| | | // export function del(id) { |
| | | // return request({ |
| | | // url: "/staff/staffScheduling/del/"+id, |
| | | // method: "delete", |
| | | // }); |
| | | // } |
| | |
| | | <script setup>
|
| | | import { ref, computed, onMounted, watch } from 'vue'
|
| | | import useUserStore from '@/store/modules/user'
|
| | | import defaultLogo from '@/assets/indexViews/LCLogo.png' // 导å
¥é»è®¤logo
|
| | | import defaultLogo from '@/assets/indexViews/ZQHXLogo.png' // 导å
¥é»è®¤logo
|
| | |
|
| | | defineProps({
|
| | | collapse: {
|
| | |
| | | </el-table-column> |
| | | <el-table-column label="æä½" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" link @click="openDialog('holiday', 'edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button type="danger" link @click="deleteItem('holiday', scope.row)">å é¤</el-button> |
| | | <el-button type="primary" size="small" @click="openDialog('holiday', 'edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button type="danger" size="small" @click="deleteItem('holiday', scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-button type="primary" @click="openDialog('annual', 'add')">æ°å¢å¹´åè§å</el-button> |
| | | |
| | | <el-table :data="annualData" border style="width: 100%; margin-top: 20px;"> |
| | | <el-table-column prop="employeeType" label="å工类å"/> |
| | | <el-table-column prop="employeeType" label="å工类å"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getTagType(scope.row.employeeType)">{{ getTypeLabel(scope.row.employeeType) }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="workYears" label="å·¥ä½å¹´é" /> |
| | | <el-table-column prop="annualDays" label="å¹´å天æ°" align="center" /> |
| | | <el-table-column prop="maxCarryOver" label="æå¤§ç»è½¬å¤©æ°" align="center" /> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æä½" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" link @click="openDialog('annual', 'edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button type="danger" link @click="deleteItem('annual', scope.row)">å é¤</el-button> |
| | | <el-button type="primary" size="small" @click="openDialog('annual', 'edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button type="danger" size="small" @click="deleteItem('annual', scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æä½" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" link @click="openDialog('overtime', 'edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button type="danger" link @click="deleteItem('overtime', scope.row)">å é¤</el-button> |
| | | <el-button type="primary" size="small" @click="openDialog('overtime', 'edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button type="danger" size="small" @click="deleteItem('overtime', scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-table-column prop="endTime" label="ä¸çæ¶é´" /> |
| | | <el-table-column prop="flexibleStart" label="å¼¹æ§ä¸ç"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.flexibleStart ? 'success' : 'info'"> |
| | | {{ scope.row.flexibleStart ? 'æ¯' : 'å¦' }} |
| | | <el-tag :type="scope.row.flexibleStart === 'true' ? 'success' : 'info'"> |
| | | {{ scope.row.flexibleStart === 'true' ? 'æ¯' : 'å¦' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æä½" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" link @click="openDialog('worktime', 'edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button type="danger" link @click="deleteItem('worktime', scope.row)">å é¤</el-button> |
| | | <el-button type="primary" size="small" @click="openDialog('worktime', 'edit', scope.row)">ç¼è¾</el-button> |
| | | <el-button type="danger" size="small" @click="deleteItem('worktime', scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | |
| | | <el-form-item label="å工类å" prop="employeeType" v-if="currentType === 'annual'"> |
| | | <el-select v-model="form.employeeType" placeholder="è¯·éæ©å工类å" style="width: 100%"> |
| | | <el-option label="æ£å¼åå·¥" value="regular" /> |
| | | <!-- <el-option label="æ£å¼åå·¥" value="regular" /> |
| | | <el-option label="è¯ç¨æåå·¥" value="probation" /> |
| | | <el-option label="å®ä¹ ç" value="intern" /> |
| | | <el-option label="å®ä¹ ç" value="intern" /> --> |
| | | <el-option |
| | | v-for="option in getTypeOptions()" |
| | | :key="option.value" |
| | | :label="option.label" |
| | | :value="option.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | |
| | | <script setup> |
| | | import { ref, reactive, onMounted, onUnmounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { listHolidaySettings, addHolidaySettings, updateHolidaySettings, delHolidaySettings, listAnnualLeaveSettingList, addAnnualLeaveSetting, updateAnnualLeaveSetting, delAnnualLeaveSetting, listOvertimeSettingList, addOvertimeSetting, updateOvertimeSetting, delOvertimeSetting, listWorkingHoursSettingList, addWorkingHoursSetting, updateWorkingHoursSetting, delWorkingHoursSetting } from '@/api/collaborativeApproval/attendanceManagement.js' |
| | | |
| | | // å½åæ¿æ´»çæ ç¾é¡µ |
| | | const activeTab = ref('holiday') |
| | |
| | | const currentAction = ref('') |
| | | const currentEditId = ref('') |
| | | const formRef = ref() |
| | | const page = { |
| | | current: 1, |
| | | size: 20, |
| | | total: 0, |
| | | } |
| | | const holidayData = ref([]) |
| | | const annualData = ref([]) |
| | | const overtimeData = ref([]) |
| | | const worktimeData = ref([]) |
| | | |
| | | // è¡¨åæ°æ® |
| | | const form = reactive({ |
| | | name: '', |
| | | type: '', |
| | | dateRange: [], |
| | | startDate: '', |
| | | endDate: '', |
| | | days: 0, |
| | | employeeType: '', |
| | | workYears: '', |
| | |
| | | }], |
| | | rate: [{ required: true, message: '请è¾å
¥åç', trigger: 'blur' }] |
| | | } |
| | | |
| | | // æ¨¡ææ°æ® |
| | | const holidayData = ref([ |
| | | { id: '1', name: 'æ¥è', type: 'legal', startDate: '2025-02-10', endDate: '2025-02-17', days: 8, status: 'active' }, |
| | | { id: '2', name: 'æ¸
æè', type: 'legal', startDate: '2025-04-05', endDate: '2025-04-05', days: 1, status: 'active' }, |
| | | { id: '3', name: 'å³å¨è', type: 'legal', startDate: '2025-05-01', endDate: '2025-05-05', days: 5, status: 'active' } |
| | | ]) |
| | | |
| | | const annualData = ref([ |
| | | { id: '1', employeeType: 'regular', workYears: '1-3å¹´', annualDays: 5, maxCarryOver: 2, status: 'active' }, |
| | | { id: '2', employeeType: 'regular', workYears: '3-5å¹´', annualDays: 10, maxCarryOver: 5, status: 'active' }, |
| | | { id: '3', employeeType: 'regular', workYears: '5年以ä¸', annualDays: 15, maxCarryOver: 10, status: 'active' } |
| | | ]) |
| | | |
| | | const overtimeData = ref([ |
| | | { id: '1', name: '工使¥å ç', type: 'weekday', startTime: '18:00', endTime: '22:00', rate: 1.5, status: 'active' }, |
| | | { id: '2', name: '卿«å ç', type: 'weekend', startTime: '09:00', endTime: '18:00', rate: 2.0, status: 'active' }, |
| | | { id: '3', name: 'æ·±å¤å ç', type: 'night', startTime: '22:00', endTime: '06:00', rate: 2.5, status: 'active' } |
| | | ]) |
| | | |
| | | const worktimeData = ref([ |
| | | { id: '1', name: 'æ å工使¶é´', startTime: '09:00', endTime: '18:00', flexibleStart: true, flexibleMinutes: 30, status: 'active' }, |
| | | { id: '2', name: 'æ©çæ¶é´', startTime: '08:00', endTime: '17:00', flexibleStart: false, flexibleMinutes: 0, status: 'active' }, |
| | | { id: '3', name: 'æçæ¶é´', startTime: '14:00', endTime: '23:00', flexibleStart: false, flexibleMinutes: 0, status: 'active' } |
| | | ]) |
| | | |
| | | // å·¥å
·å½æ° |
| | | const getTagType = (type) => { |
| | | const tagMap = { |
| | | legal: 'success', adjustment: 'warning', special: 'info', company: 'primary', |
| | | weekday: 'primary', weekend: 'warning', holiday: 'danger', night: 'info' |
| | | weekday: 'primary', weekend: 'warning', holiday: 'danger', night: 'info', |
| | | regular: 'success', probation: 'info', intern: 'danger' |
| | | } |
| | | return tagMap[type] || 'info' |
| | | } |
| | |
| | | const getTypeLabel = (type) => { |
| | | const labelMap = { |
| | | legal: 'æ³å®è忥', adjustment: 'è°ä¼æ¥', special: 'ç¹æ®åæ', company: 'å
¬å¸åæ', |
| | | weekday: '工使¥å ç', weekend: '卿«å ç', holiday: 'è忥å ç', night: 'æ·±å¤å ç' |
| | | weekday: '工使¥å ç', weekend: '卿«å ç', holiday: 'è忥å ç', night: 'æ·±å¤å ç', |
| | | regular: 'æ£å¼åå·¥', probation: 'è¯ç¨æåå·¥', intern: 'å®ä¹ ç' |
| | | } |
| | | return labelMap[type] || type |
| | | } |
| | |
| | | { label: 'è忥å ç', value: 'holiday' }, |
| | | { label: 'æ·±å¤å ç', value: 'night' } |
| | | ] |
| | | } else if (currentType.value === 'annual') { |
| | | return [ |
| | | { label: 'æ£å¼åå·¥', value: 'regular' }, |
| | | { label: 'è¯ç¨æåå·¥', value: 'probation' }, |
| | | { label: 'å®ä¹ ç', value: 'intern' } |
| | | ] |
| | | } |
| | | return [] |
| | | } |
| | |
| | | if (form.dateRange && form.dateRange.length === 2 && form.dateRange[0] && form.dateRange[1]) { |
| | | const start = new Date(form.dateRange[0]) |
| | | const end = new Date(form.dateRange[1]) |
| | | form.startDate = start.toISOString().split('T')[0] |
| | | form.endDate = end.toISOString().split('T')[0] |
| | | |
| | | if (isNaN(start.getTime()) || isNaN(end.getTime())) { |
| | | console.warn('æ æçæ¥ææ ¼å¼') |
| | |
| | | } |
| | | |
| | | // éªè¯æ¶é´æ ¼å¼ |
| | | const validateTime = (time) => { |
| | | if (!time) return '' |
| | | if (typeof time === 'string') return time |
| | | if (time instanceof Date) { |
| | | return time.toTimeString().slice(0, 5) |
| | | } |
| | | return '' |
| | | } |
| | | // const validateTime = (time) => { |
| | | // if (!time) return '' |
| | | // if (typeof time === 'string') return time |
| | | // if (time instanceof Date) { |
| | | // return time.toTimeString().slice(0, 5) |
| | | // } |
| | | // return '' |
| | | // } |
| | | |
| | | // éªè¯æ¶é´å段 |
| | | const validateTimeField = (fieldName) => { |
| | |
| | | name: '', |
| | | type: '', |
| | | dateRange: [], |
| | | startDate: '', |
| | | endDate: '', |
| | | days: 0, |
| | | employeeType: '', |
| | | workYears: '', |
| | |
| | | name: row.name, |
| | | type: row.type, |
| | | dateRange: [new Date(row.startDate), new Date(row.endDate)], |
| | | startDate: row.startDate, |
| | | endDate: row.endDate, |
| | | days: row.days, |
| | | status: row.status |
| | | }) |
| | |
| | | } |
| | | |
| | | const addItem = () => { |
| | | const newItem = { ...form, id: Date.now().toString() } |
| | | |
| | | if (currentType.value === 'holiday') { |
| | | newItem.startDate = form.dateRange[0].toISOString().split('T')[0] |
| | | newItem.endDate = form.dateRange[1].toISOString().split('T')[0] |
| | | holidayData.value.push(newItem) |
| | | const params = { |
| | | name: form.name, |
| | | type: form.type, |
| | | startDate: form.startDate, |
| | | endDate: form.endDate, |
| | | days: form.days, |
| | | status: form.status |
| | | } |
| | | addHolidaySettings(params).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | // dialogVisible.value = false; |
| | | getHolidaySettingsList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } else if (currentType.value === 'annual') { |
| | | annualData.value.push(newItem) |
| | | // annualData.value.push(newItem) |
| | | const params = { |
| | | employeeType: form.employeeType, |
| | | workYears: form.workYears, |
| | | annualDays: form.annualDays, |
| | | maxCarryOver: form.maxCarryOver, |
| | | status: form.status |
| | | } |
| | | addAnnualLeaveSetting(params).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | // dialogVisible.value = false; |
| | | getAnnualLeaveSettingList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } else if (currentType.value === 'overtime') { |
| | | newItem.startTime = form.startTime || '' |
| | | newItem.endTime = form.endTime || '' |
| | | overtimeData.value.push(newItem) |
| | | const params = { |
| | | name: form.name, |
| | | type: form.type, |
| | | startTime: form.startTime || '', |
| | | endTime: form.endTime || '', |
| | | rate: form.rate, |
| | | status: form.status |
| | | } |
| | | addOvertimeSetting(params).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | // dialogVisible.value = false; |
| | | getOvertimeSettingList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | // newItem.startTime = form.startTime || '' |
| | | // newItem.endTime = form.endTime || '' |
| | | // overtimeData.value.push(newItem) |
| | | } else if (currentType.value === 'worktime') { |
| | | newItem.startTime = form.workStartTime || '' |
| | | newItem.endTime = form.workEndTime || '' |
| | | worktimeData.value.push(newItem) |
| | | const params = { |
| | | name: form.name, |
| | | startTime: form.workStartTime || '', |
| | | endTime: form.workEndTime || '', |
| | | flexibleStart: form.flexibleStart, |
| | | flexibleMinutes: form.flexibleMinutes, |
| | | status: form.status |
| | | } |
| | | addWorkingHoursSetting(params).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | getWorkingHoursSettingList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | // newItem.startTime = form.workStartTime || '' |
| | | // newItem.endTime = form.workEndTime || '' |
| | | // worktimeData.value.push(newItem) |
| | | } |
| | | } |
| | | |
| | |
| | | let index |
| | | |
| | | if (currentType.value === 'holiday') { |
| | | dataArray = holidayData.value |
| | | index = dataArray.findIndex(item => item.id === currentEditId.value) |
| | | if (index > -1) { |
| | | dataArray[index] = { |
| | | ...dataArray[index], |
| | | const params = { |
| | | id: currentEditId.value, |
| | | name: form.name, |
| | | type: form.type, |
| | | startDate: form.dateRange[0].toISOString().split('T')[0], |
| | |
| | | days: form.days, |
| | | status: form.status |
| | | } |
| | | updateHolidaySettings(params).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ´æ°æå"); |
| | | // dialogVisible.value = false; |
| | | getHolidaySettingsList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } else if (currentType.value === 'annual') { |
| | | dataArray = annualData.value |
| | | index = dataArray.findIndex(item => item.id === currentEditId.value) |
| | | if (index > -1) { |
| | | dataArray[index] = { |
| | | ...dataArray[index], |
| | | const params = { |
| | | id: currentEditId.value, |
| | | employeeType: form.employeeType, |
| | | workYears: form.workYears, |
| | | annualDays: form.annualDays, |
| | | maxCarryOver: form.maxCarryOver, |
| | | status: form.status |
| | | } |
| | | updateAnnualLeaveSetting(params).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ´æ°æå"); |
| | | getAnnualLeaveSettingList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } else if (currentType.value === 'overtime') { |
| | | dataArray = overtimeData.value |
| | | index = dataArray.findIndex(item => item.id === currentEditId.value) |
| | | if (index > -1) { |
| | | dataArray[index] = { |
| | | ...dataArray[index], |
| | | const params = { |
| | | id: currentEditId.value, |
| | | name: form.name, |
| | | type: form.type, |
| | | startTime: form.startTime || '', |
| | |
| | | rate: form.rate, |
| | | status: form.status |
| | | } |
| | | updateOvertimeSetting(params).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ´æ°æå"); |
| | | getOvertimeSettingList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | |
| | | // dataArray = overtimeData.value |
| | | // index = dataArray.findIndex(item => item.id === currentEditId.value) |
| | | // if (index > -1) { |
| | | // dataArray[index] = { |
| | | // ...dataArray[index], |
| | | // name: form.name, |
| | | // type: form.type, |
| | | // startTime: form.startTime || '', |
| | | // endTime: form.endTime || '', |
| | | // rate: form.rate, |
| | | // status: form.status |
| | | // } |
| | | // } |
| | | } else if (currentType.value === 'worktime') { |
| | | dataArray = worktimeData.value |
| | | index = dataArray.findIndex(item => item.id === currentEditId.value) |
| | | if (index > -1) { |
| | | dataArray[index] = { |
| | | ...dataArray[index], |
| | | const params = { |
| | | id: currentEditId.value, |
| | | name: form.name, |
| | | startTime: form.workStartTime || '', |
| | | endTime: form.workEndTime || '', |
| | |
| | | flexibleMinutes: form.flexibleMinutes, |
| | | status: form.status |
| | | } |
| | | updateWorkingHoursSetting(params).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ´æ°æå"); |
| | | getWorkingHoursSettingList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | // dataArray = worktimeData.value |
| | | // index = dataArray.findIndex(item => item.id === currentEditId.value) |
| | | // if (index > -1) { |
| | | // dataArray[index] = { |
| | | // ...dataArray[index], |
| | | // name: form.name, |
| | | // startTime: form.workStartTime || '', |
| | | // endTime: form.workEndTime || '', |
| | | // flexibleStart: form.flexibleStart, |
| | | // flexibleMinutes: form.flexibleMinutes, |
| | | // status: form.status |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | |
| | |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | let ids = []; |
| | | let dataArray |
| | | if (type === 'holiday') dataArray = holidayData.value |
| | | else if (type === 'annual') dataArray = annualData.value |
| | | else if (type === 'overtime') dataArray = overtimeData.value |
| | | else if (type === 'worktime') dataArray = worktimeData.value |
| | | |
| | | const index = dataArray.findIndex(item => item.id === row.id) |
| | | if (index > -1) { |
| | | dataArray.splice(index, 1) |
| | | ElMessage.success('å 餿å') |
| | | if (type === 'holiday') { |
| | | ids.push(row.id) |
| | | delHolidaySettings(ids).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("å 餿å"); |
| | | ids = [] |
| | | getHolidaySettingsList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } |
| | | else if (type === 'annual') { |
| | | ids.push(row.id) |
| | | delAnnualLeaveSetting(ids).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("å 餿å"); |
| | | ids = [] |
| | | getAnnualLeaveSettingList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } |
| | | else if (type === 'overtime') { |
| | | ids.push(row.id) |
| | | delOvertimeSetting(ids).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("å 餿å"); |
| | | ids = [] |
| | | getOvertimeSettingList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } |
| | | else if (type === 'worktime') { |
| | | ids.push(row.id) |
| | | delWorkingHoursSetting(ids).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("å 餿å"); |
| | | ids = [] |
| | | getWorkingHoursSettingList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } |
| | | |
| | | // const index = dataArray.findIndex(item => item.id === row.id) |
| | | // if (index > -1) { |
| | | // dataArray.splice(index, 1) |
| | | // ElMessage.success('å 餿å') |
| | | // } |
| | | }) |
| | | } |
| | | // è·ååæè®¾ç½®å表 |
| | | const getHolidaySettingsList = () => { |
| | | // tableLoading.value = true; |
| | | listHolidaySettings({...page.value}) |
| | | .then(res => { |
| | | // tableLoading.value = false; |
| | | holidayData.value = res.data.records |
| | | page.total = res.data.total; |
| | | }).catch(err => { |
| | | // tableLoading.value = false; |
| | | }) |
| | | }; |
| | | // è·åå¹´åè§åå表 |
| | | const getAnnualLeaveSettingList = () => { |
| | | |
| | | listAnnualLeaveSettingList({...page.value}) |
| | | .then(res => { |
| | | // console.log(res.data) |
| | | annualData.value = res.data.records |
| | | page.total = res.data.total; |
| | | }).catch(err => { |
| | | }) |
| | | }; |
| | | // è·åå çè§åå表 |
| | | const getOvertimeSettingList = () => { |
| | | |
| | | listOvertimeSettingList({...page.value}) |
| | | .then(res => { |
| | | // console.log(res.data) |
| | | overtimeData.value = res.data.records |
| | | page.total = res.data.total; |
| | | }).catch(err => { |
| | | }) |
| | | }; |
| | | // è·å工使¶é´è§åå表 |
| | | const getWorkingHoursSettingList = () => { |
| | | |
| | | listWorkingHoursSettingList({...page.value}) |
| | | .then(res => { |
| | | // console.log(res.data) |
| | | worktimeData.value = res.data.records |
| | | page.total = res.data.total; |
| | | }).catch(err => { |
| | | }) |
| | | }; |
| | | onMounted(() => { |
| | | getHolidaySettingsList() |
| | | getAnnualLeaveSettingList() |
| | | getOvertimeSettingList() |
| | | getWorkingHoursSettingList() |
| | | console.log('èå¤ç®¡ç页é¢å è½½å®æ') |
| | | }) |
| | | |
| | |
| | | <span class="dialog-footer"> |
| | | <el-button @click="viewDialogVisible = false">å
³é</el-button> |
| | | <el-button type="primary" @click="copyKnowledge">å¤å¶ç¥è¯</el-button> |
| | | <el-button type="success" @click="markAsFavorite">æ¶è</el-button> |
| | | <!-- <el-button type="success" @click="markAsFavorite">æ¶è@</el-button> --> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | import { onMounted, ref, reactive, toRefs } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { listKnowledgeBase, delKnowledgeBaseBatch,addKnowledgeBase,updateKnowledgeBase } from "@/api/collaborativeApproval/knowledgeBase.js"; |
| | | |
| | | // 表åéªè¯è§å |
| | | const rules = { |
| | |
| | | tableLoading: false, |
| | | page: { |
| | | current: 1, |
| | | size: 100, |
| | | size: 20, |
| | | total: 0, |
| | | }, |
| | | tableData: [], |
| | |
| | | title: "", |
| | | type: "", |
| | | scenario: "", |
| | | efficiency: "medium", |
| | | efficiency: "", |
| | | problem: "", |
| | | solution: "", |
| | | keyPoints: "", |
| | |
| | | ]); |
| | | |
| | | // æ¨¡ææ°æ® |
| | | let mockData = [ |
| | | { |
| | | id: "1", |
| | | title: "ç¹æ®ååå®¡æ¹æµç¨ä¼åæ¹æ¡", |
| | | type: "contract", |
| | | scenario: "大é¢ååå¿«é审æ¹", |
| | | efficiency: "high", |
| | | problem: "大é¢ååå®¡æ¹æµç¨å¤æï¼å®¡æ¹æ¶é´é¿ï¼å½±åä¸å¡è¿å±", |
| | | solution: "建ç«ç»¿è²ééï¼å¯¹ç¬¦åæ¡ä»¶çååéç¨ç®åå®¡æ¹æµç¨ï¼ç±é¨é¨è´è´£äººç´æ¥å®¡æ¹ï¼å¹³åå®¡æ¹æ¶é´ä»3天缩çè³1天", |
| | | keyPoints: "绿è²é鿡件,ç®åæµç¨,å®¡æ¹æé,æ¶é´æ§å¶", |
| | | creator: "éå¿å¼º", |
| | | usageCount: 15, |
| | | createTime: "2025-01-15 10:30:00" |
| | | }, |
| | | { |
| | | id: "2", |
| | | title: "è·¨é¨é¨åä½å®¡æ¹ç»éªæ»ç»", |
| | | type: "experience", |
| | | scenario: "å¤é¨é¨åä½é¡¹ç®", |
| | | efficiency: "medium", |
| | | problem: "è·¨é¨é¨é¡¹ç®å®¡æ¹æ¶ï¼åé¨é¨æè§ä¸ç»ä¸ï¼å®¡æ¹è¿åº¦ç¼æ
¢", |
| | | solution: "建ç«é¡¹ç®åè°æºå¶ï¼æå®é¡¹ç®è´è´£äººï¼å®æå¬å¼åè°ä¼è®®ï¼ç»ä¸åæ¹æè§ååè¿è¡å®¡æ¹", |
| | | keyPoints: "项ç®åè°,宿ä¼è®®,ç»ä¸æè§,è´è´£äººå¶åº¦", |
| | | creator: "æä¸»ç®¡", |
| | | usageCount: 8, |
| | | createTime: "2025-01-14 15:20:00" |
| | | }, |
| | | { |
| | | id: "3", |
| | | title: "ç´§æ¥éè´å®¡æ¹æä½æå", |
| | | type: "guide", |
| | | scenario: "ç´§æ¥éè´éæ±", |
| | | efficiency: "high", |
| | | problem: "ç´§æ¥éè´æ¶å®¡æ¹æµç¨å¤æï¼æ æ³æ»¡è¶³ç´§æ¥éæ±", |
| | | solution: "å¶å®ç´§æ¥éè´å®¡æ¹æ åï¼æç¡®ç´§æ¥ç¨åº¦å级ï¼ä¸å级å«éç¨ä¸åå®¡æ¹æµç¨ï¼ç¡®ä¿ç´§æ¥éæ±å¾å°åæ¶å¤ç", |
| | | keyPoints: "ç´§æ¥å级,æ åå¶å®,æµç¨ç®å,åæ¶å¤ç", |
| | | creator: "çä¸å", |
| | | usageCount: 12, |
| | | createTime: "2025-01-13 09:15:00" |
| | | } |
| | | ]; |
| | | // let mockData = [ |
| | | // { |
| | | // id: "1", |
| | | // title: "ç¹æ®ååå®¡æ¹æµç¨ä¼åæ¹æ¡", |
| | | // type: "contract", |
| | | // scenario: "大é¢ååå¿«é审æ¹", |
| | | // efficiency: "high", |
| | | // problem: "大é¢ååå®¡æ¹æµç¨å¤æï¼å®¡æ¹æ¶é´é¿ï¼å½±åä¸å¡è¿å±", |
| | | // solution: "建ç«ç»¿è²ééï¼å¯¹ç¬¦åæ¡ä»¶çååéç¨ç®åå®¡æ¹æµç¨ï¼ç±é¨é¨è´è´£äººç´æ¥å®¡æ¹ï¼å¹³åå®¡æ¹æ¶é´ä»3天缩çè³1天", |
| | | // keyPoints: "绿è²é鿡件,ç®åæµç¨,å®¡æ¹æé,æ¶é´æ§å¶", |
| | | // creator: "å¼ ç»ç", |
| | | // usageCount: 15, |
| | | // createTime: "2024-01-15 10:30:00" |
| | | // }, |
| | | // { |
| | | // id: "2", |
| | | // title: "è·¨é¨é¨åä½å®¡æ¹ç»éªæ»ç»", |
| | | // type: "experience", |
| | | // scenario: "å¤é¨é¨åä½é¡¹ç®", |
| | | // efficiency: "medium", |
| | | // problem: "è·¨é¨é¨é¡¹ç®å®¡æ¹æ¶ï¼åé¨é¨æè§ä¸ç»ä¸ï¼å®¡æ¹è¿åº¦ç¼æ
¢", |
| | | // solution: "建ç«é¡¹ç®åè°æºå¶ï¼æå®é¡¹ç®è´è´£äººï¼å®æå¬å¼åè°ä¼è®®ï¼ç»ä¸åæ¹æè§ååè¿è¡å®¡æ¹", |
| | | // keyPoints: "项ç®åè°,宿ä¼è®®,ç»ä¸æè§,è´è´£äººå¶åº¦", |
| | | // creator: "æä¸»ç®¡", |
| | | // usageCount: 8, |
| | | // createTime: "2024-01-14 15:20:00" |
| | | // }, |
| | | // { |
| | | // id: "3", |
| | | // title: "ç´§æ¥éè´å®¡æ¹æä½æå", |
| | | // type: "guide", |
| | | // scenario: "ç´§æ¥éè´éæ±", |
| | | // efficiency: "high", |
| | | // problem: "ç´§æ¥éè´æ¶å®¡æ¹æµç¨å¤æï¼æ æ³æ»¡è¶³ç´§æ¥éæ±", |
| | | // solution: "å¶å®ç´§æ¥éè´å®¡æ¹æ åï¼æç¡®ç´§æ¥ç¨åº¦å级ï¼ä¸å级å«éç¨ä¸åå®¡æ¹æµç¨ï¼ç¡®ä¿ç´§æ¥éæ±å¾å°åæ¶å¤ç", |
| | | // keyPoints: "ç´§æ¥å级,æ åå¶å®,æµç¨ç®å,åæ¶å¤ç", |
| | | // creator: "çä¸å", |
| | | // usageCount: 12, |
| | | // createTime: "2024-01-13 09:15:00" |
| | | // } |
| | | // ]; |
| | | |
| | | // ç¥è¯æ 颿¨¡æ¿ |
| | | const titleTemplates = [ |
| | |
| | | problem: `å¨${randomScenario}è¿ç¨ä¸éå°çé®é¢æè¿°...`, |
| | | solution: `é对${randomScenario}çè§£å³æ¹æ¡åæä½æ¥éª¤...`, |
| | | keyPoints: "å
³é®è¦ç¹1,å
³é®è¦ç¹2,å
³é®è¦ç¹3,å
³é®è¦ç¹4", |
| | | creator: ["éå¿å¼º", "åé
å©·", "ç建å½", "赵丽å"][Math.floor(Math.random() * 4)], |
| | | creator: ["å¼ ç»ç", "æä¸»ç®¡", "çä¸å", "åæ»ç"][Math.floor(Math.random() * 4)], |
| | | usageCount: Math.floor(Math.random() * 20) + 1, |
| | | createTime: now.toLocaleString() |
| | | }; |
| | |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | |
| | | setTimeout(() => { |
| | | let filteredData = [...mockData]; |
| | | |
| | | if (searchForm.value.title) { |
| | | filteredData = filteredData.filter(item => |
| | | item.title.toLowerCase().includes(searchForm.value.title.toLowerCase()) |
| | | ); |
| | | } |
| | | |
| | | if (searchForm.value.type) { |
| | | filteredData = filteredData.filter(item => item.type === searchForm.value.type); |
| | | } |
| | | |
| | | tableData.value = filteredData; |
| | | page.value.total = filteredData.length; |
| | | listKnowledgeBase({...page.value, ...searchForm.value}) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | }, 500); |
| | | tableData.value = res.data.records |
| | | page.total = res.data.total; |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | }; |
| | | |
| | | // å页å¤ç |
| | |
| | | title: "", |
| | | type: "", |
| | | scenario: "", |
| | | efficiency: "medium", |
| | | efficiency: "", |
| | | problem: "", |
| | | solution: "", |
| | | keyPoints: "", |
| | |
| | | } else if (type === "edit" && row) { |
| | | dialogTitle.value = "ç¼è¾ç¥è¯"; |
| | | Object.assign(form.value, { |
| | | id: row.id, |
| | | title: row.title, |
| | | type: row.type, |
| | | scenario: row.scenario, |
| | |
| | | const submitForm = async () => { |
| | | try { |
| | | await formRef.value.validate(); |
| | | |
| | | if (dialogType.value === "add") { |
| | | // æ°å¢ç¥è¯ |
| | | const newKnowledge = { |
| | | id: (mockData.length + 1).toString(), |
| | | title: form.value.title, |
| | | type: form.value.type, |
| | | scenario: form.value.scenario, |
| | | efficiency: form.value.efficiency, |
| | | problem: form.value.problem, |
| | | solution: form.value.solution, |
| | | keyPoints: form.value.keyPoints, |
| | | creator: form.value.creator, |
| | | usageCount: form.value.usageCount, |
| | | createTime: new Date().toLocaleString() |
| | | }; |
| | | |
| | | mockData.unshift(newKnowledge); |
| | | ElMessage.success("ç¥è¯å建æå"); |
| | | } else { |
| | | // ç¼è¾ç¥è¯ |
| | | const index = mockData.findIndex(item => item.id === selectedIds.value[0]); |
| | | if (index !== -1) { |
| | | Object.assign(mockData[index], { |
| | | title: form.value.title, |
| | | type: form.value.type, |
| | | scenario: form.value.scenario, |
| | | efficiency: form.value.efficiency, |
| | | problem: form.value.problem, |
| | | solution: form.value.solution, |
| | | keyPoints: form.value.keyPoints, |
| | | creator: form.value.creator, |
| | | usageCount: form.value.usageCount |
| | | }); |
| | | ElMessage.success("ç¥è¯æ´æ°æå"); |
| | | } |
| | | } |
| | | |
| | | addKnowledgeBase({...form.value}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | dialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } else { |
| | | updateKnowledgeBase({...form.value}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ´æ°æå"); |
| | | dialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.error("表åéªè¯å¤±è´¥:", error); |
| | | } |
| | |
| | | v-model="form.expireDate" |
| | | type="date" |
| | | placeholder="è¯·éæ©æææ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | |
| | | <el-date-picker |
| | | v-model="meetingForm.startTime" |
| | | type="datetime" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | placeholder="è¯·éæ©å¼å§æ¶é´" |
| | | style="width: 100%" |
| | | /> |
| | |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import { staffOnJobListPage } from "@/api/personnelManagement/employeeRecord.js"; |
| | | import { listNotification, addNotification, updateNotification, delNotification,addOnlineMeeting,addFileSharing } from "@/api/collaborativeApproval/notificationManagement.js"; |
| | | import { id } from "element-plus/es/locales.mjs"; |
| | | |
| | | // 表åéªè¯è§å |
| | | const rules = { |
| | |
| | | tableLoading: false, |
| | | page: { |
| | | current: 1, |
| | | size: 100, |
| | | size: 20, |
| | | total: 0, |
| | | }, |
| | | tableData: [], |
| | |
| | | form: { |
| | | title: "", |
| | | type: "", |
| | | priority: "medium", |
| | | priority: "", |
| | | content: "", |
| | | departments: [], |
| | | expireDate: "", |
| | |
| | | ] |
| | | } |
| | | ]); |
| | | |
| | | // æ¨¡ææ°æ® |
| | | let mockData = [ |
| | | { |
| | | id: "1", |
| | | title: "2024å¹´æ¥èæ¾åéç¥", |
| | | type: "holiday", |
| | | priority: "high", |
| | | status: "published", |
| | | content: "æ ¹æ®å½å®¶è§å®ï¼ç»åå
¬å¸å®é
æ
åµï¼ç°å°2024å¹´æ¥èæ¾å宿éç¥å¦ä¸...", |
| | | departments: ["ææ¯é¨", "éå®é¨", "人äºé¨", "è´¢å¡é¨", "è¿è¥é¨", "å¸åºé¨", "客æé¨"], |
| | | expireDate: "2025-02-15", |
| | | syncMethods: ["wechat", "dingtalk", "email"], |
| | | createTime: "2025-01-15 10:30:00" |
| | | }, |
| | | { |
| | | id: "2", |
| | | title: "ææ¯é¨å¨ä¾ä¼éç¥", |
| | | type: "meeting", |
| | | priority: "medium", |
| | | status: "published", |
| | | content: "ææ¯é¨å®äºæ¯å¨äºä¸å2ç¹å¬å¼å¨ä¾ä¼ï¼è¯·åä½åäºåæ¶åå ...", |
| | | departments: ["ææ¯é¨"], |
| | | expireDate: "2025-01-20", |
| | | syncMethods: ["wechat", "dingtalk"], |
| | | createTime: "2025-01-14 15:20:00" |
| | | }, |
| | | { |
| | | id: "3", |
| | | title: "åå·¥è¡ä¸ºè§èå¤ç½éç¥", |
| | | type: "penalty", |
| | | priority: "high", |
| | | status: "draft", |
| | | content: "为维æ¤å
¬å¸æ£å¸¸ç§©åºï¼è§èåå·¥è¡ä¸ºï¼ç°å¯¹è¿åå
¬å¸è§å®çè¡ä¸ºè¿è¡å¤ç½...", |
| | | departments: ["人äºé¨", "ææ¯é¨", "éå®é¨"], |
| | | expireDate: "2025-02-13", |
| | | syncMethods: ["wechat", "email"], |
| | | createTime: "2025-01-13 09:15:00" |
| | | } |
| | | ]; |
| | | |
| | | // éç¥æ 颿¨¡æ¿ |
| | | const titleTemplates = [ |
| | | "å
³äº{year}å¹´{holiday}æ¾å宿çéç¥", |
| | |
| | | console.error('è·ååå·¥å表失败:', error); |
| | | // 妿æ¥å£é½å¤±è´¥ï¼ä½¿ç¨é»è®¤æ°æ® |
| | | employees.value = [ |
| | | { label: "éå¿å¼º", value: "001", dept: "ææ¯é¨", phone: "13800138001", email: "chenzhiqiang@company.com", status: "0" }, |
| | | { label: "åé
å©·", value: "002", dept: "éå®é¨", phone: "13800138002", email: "liuyating@company.com", status: "0" }, |
| | | { label: "ç建å½", value: "003", dept: "人äºé¨", phone: "13800138003", email: "wangjianguo@company.com", status: "0" } |
| | | { label: "å¼ ä¸", value: "001", dept: "ææ¯é¨", phone: "13800138001", email: "zhangsan@company.com", status: "0" }, |
| | | { label: "æå", value: "002", dept: "éå®é¨", phone: "13800138002", email: "lisi@company.com", status: "0" }, |
| | | { label: "çäº", value: "003", dept: "人äºé¨", phone: "13800138003", email: "wangwu@company.com", status: "0" } |
| | | ]; |
| | | } finally { |
| | | employeesLoading.value = false; |
| | |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | |
| | | setTimeout(() => { |
| | | let filteredData = [...mockData]; |
| | | |
| | | if (searchForm.value.title) { |
| | | filteredData = filteredData.filter(item => |
| | | item.title.toLowerCase().includes(searchForm.value.title.toLowerCase()) |
| | | ); |
| | | } |
| | | |
| | | if (searchForm.value.type) { |
| | | filteredData = filteredData.filter(item => item.type === searchForm.value.type); |
| | | } |
| | | |
| | | tableData.value = filteredData; |
| | | page.value.total = filteredData.length; |
| | | listNotification({...page.value, ...searchForm.value}) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | }, 500); |
| | | tableData.value = res.data.records |
| | | page.value.total = res.data.total; |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | }; |
| | | |
| | | // å页å¤ç |
| | |
| | | dialogTitle.value = "æ°å¢éç¥"; |
| | | // é置表å |
| | | Object.assign(form.value, { |
| | | id: "", |
| | | title: "", |
| | | type: "", |
| | | priority: "medium", |
| | | priority: "", |
| | | content: "", |
| | | departments: [], |
| | | expireDate: "", |
| | | status: "draft", |
| | | syncMethods: [] |
| | | }); |
| | | } else if (type === "edit" && row) { |
| | | dialogTitle.value = "ç¼è¾éç¥"; |
| | | Object.assign(form.value, { |
| | | id: row.id, |
| | | title: row.title, |
| | | type: row.type, |
| | | priority: row.priority, |
| | | content: row.content || "", |
| | | departments: row.departments || [], |
| | | expireDate: row.expireDate || "", |
| | | status: row.status, |
| | | syncMethods: row.syncMethods || [] |
| | | }); |
| | | } |
| | |
| | | |
| | | if (dialogType.value === "add") { |
| | | // æ°å¢éç¥ |
| | | const newNotification = { |
| | | id: (mockData.length + 1).toString(), |
| | | title: form.value.title, |
| | | type: form.value.type, |
| | | priority: form.value.priority, |
| | | status: "draft", |
| | | content: form.value.content, |
| | | departments: form.value.departments, |
| | | expireDate: form.value.expireDate, |
| | | syncMethods: form.value.syncMethods, |
| | | createTime: new Date().toLocaleString() |
| | | }; |
| | | |
| | | mockData.unshift(newNotification); |
| | | ElMessage.success("éç¥å建æå"); |
| | | } else { |
| | | // ç¼è¾éç¥ |
| | | const index = mockData.findIndex(item => item.id === selectedIds.value[0]); |
| | | if (index !== -1) { |
| | | Object.assign(mockData[index], { |
| | | title: form.value.title, |
| | | type: form.value.type, |
| | | priority: form.value.priority, |
| | | content: form.value.content, |
| | | departments: form.value.departments, |
| | | expireDate: form.value.expireDate, |
| | | syncMethods: form.value.syncMethods |
| | | }); |
| | | ElMessage.success("éç¥æ´æ°æå"); |
| | | } |
| | | } |
| | | |
| | | addNotification({...form.value}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | dialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } else { |
| | | // ç¼è¾éç¥ |
| | | updateNotification({...form.value}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ´æ°æå"); |
| | | dialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.error("表åéªè¯å¤±è´¥:", error); |
| | | } |
| | |
| | | duration: meetingForm.value.duration, |
| | | participants: meetingForm.value.participants, |
| | | description: meetingForm.value.description, |
| | | platform: meetingForm.value.platform, |
| | | meetingId: `MTG${Date.now()}` |
| | | platform: meetingForm.value.platform |
| | | }; |
| | | |
| | | // 模æåéå°ä¼ä¸å¾®ä¿¡/éé |
| | | const platformName = meetingPlatforms.find(p => p.value === meetingForm.value.platform)?.label || "æªç¥å¹³å°"; |
| | | |
| | | ElMessage.success(`ä¼è®®å建æåï¼ä¼è®®ID: ${meetingInfo.meetingId}ï¼å°éè¿${platformName}åééç¥`); |
| | | // æ°å¢ä¼è®® |
| | | addOnlineMeeting({...meetingInfo}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("ä¼è®®æ·»å æå"); |
| | | meetingDialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | // 模æåéå°ä¼ä¸å¾®ä¿¡/éé |
| | | // const platformName = meetingPlatforms.find(p => p.value === meetingForm.value.platform)?.label || "æªç¥å¹³å°"; |
| | | // ElMessage.success(`ä¼è®®å建æåï¼ä¼è®®ID: ${meetingInfo.meetingId}ï¼å°éè¿${platformName}åééç¥`); |
| | | |
| | | // è·ååä¼äººåä¿¡æ¯ |
| | | const participantNames = meetingForm.value.participants.map(participantId => { |
| | |
| | | |
| | | // å°ä¼è®®ä¿¡æ¯æ·»å å°éç¥å表 |
| | | const meetingNotification = { |
| | | id: (mockData.length + 1).toString(), |
| | | title: `[ä¼è®®éç¥] ${meetingInfo.title}`, |
| | | type: "meeting", |
| | | priority: "high", |
| | |
| | | content: `ä¼è®®æ¶é´: ${meetingInfo.startTime}ï¼æ¶é¿: ${meetingInfo.duration}åéï¼å¹³å°: ${meetingPlatforms.find(p => p.value === meetingForm.value.platform)?.label || "æªç¥å¹³å°"}ï¼åä¼äººå: ${participantNames}ï¼å
±${participantDetails.length}人`, |
| | | departments: [], |
| | | expireDate: "", |
| | | syncMethods: [meetingForm.value.platform], |
| | | createTime: new Date().toLocaleString() |
| | | syncMethods: [meetingForm.value.platform] |
| | | }; |
| | | |
| | | mockData.unshift(meetingNotification); |
| | | addNotification({...meetingNotification}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | // dialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | // mockData.unshift(meetingNotification); |
| | | // getList(); |
| | | } catch (error) { |
| | | console.error("ä¼è®®è¡¨åéªè¯å¤±è´¥:", error); |
| | | } |
| | |
| | | }; |
| | | |
| | | fileList.value.push(fileInfo); |
| | | fileShareForm.value.files.push(fileInfo); |
| | | fileShareForm.value.files.push(fileInfo.name); |
| | | return false; // 黿¢èªå¨ä¸ä¼ |
| | | }; |
| | | |
| | |
| | | description: fileShareForm.value.description, |
| | | departments: fileShareForm.value.departments, |
| | | files: fileShareForm.value.files, |
| | | shareId: `FILE${Date.now()}` |
| | | }; |
| | | |
| | | ElMessage.success(`æä»¶å
±äº«æåï¼å
±äº«ID: ${shareInfo.shareId}ï¼å·²éç¥ç¸å
³é¨é¨`); |
| | | addFileSharing({...shareInfo}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æä»¶å
±äº«æå"); |
| | | fileShareDialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | |
| | | // ElMessage.success(`æä»¶å
±äº«æåï¼å
±äº«ID: ${shareInfo.shareId}ï¼å·²éç¥ç¸å
³é¨é¨`); |
| | | |
| | | |
| | | // å°æä»¶å
±äº«ä¿¡æ¯æ·»å å°éç¥å表 |
| | | const fileShareNotification = { |
| | | id: (mockData.length + 1).toString(), |
| | | title: `[æä»¶å
񄧮] ${shareInfo.title}`, |
| | | type: "temporary", |
| | | priority: "medium", |
| | |
| | | departments: shareInfo.departments, |
| | | expireDate: "", |
| | | syncMethods: ["wechat", "dingtalk"], |
| | | createTime: new Date().toLocaleString() |
| | | }; |
| | | |
| | | mockData.unshift(fileShareNotification); |
| | | addNotification({...fileShareNotification}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | // dialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | |
| | | // mockData.unshift(fileShareNotification); |
| | | // getList(); |
| | | } catch (error) { |
| | | console.error("æä»¶å
±äº«è¡¨åéªè¯å¤±è´¥:", error); |
| | | } |
| | |
| | | |
| | | // åå¸éç¥ |
| | | const publishNotification = (row) => { |
| | | row.status = "published"; |
| | | Object.assign(form.value, { |
| | | id: row.id, |
| | | title: row.title, |
| | | type: row.type, |
| | | priority: row.priority, |
| | | content: row.content || "", |
| | | departments: row.departments || [], |
| | | expireDate: row.expireDate || "", |
| | | status: row.status, |
| | | syncMethods: row.syncMethods || [] |
| | | }); |
| | | form.value.status = "published"; |
| | | updateNotification({...form.value}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("éç¥å叿å"); |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | }; |
| | | |
| | | // æ¤åéç¥ |
| | | const revokeNotification = (row) => { |
| | | row.status = "draft"; |
| | | Object.assign(form.value, { |
| | | id: row.id, |
| | | title: row.title, |
| | | type: row.type, |
| | | priority: row.priority, |
| | | content: row.content || "", |
| | | departments: row.departments || [], |
| | | expireDate: row.expireDate || "", |
| | | status: row.status, |
| | | syncMethods: row.syncMethods || [] |
| | | }); |
| | | form.value.status = "draft"; |
| | | updateNotification({...form.value}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("éç¥å·²æ¤å"); |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | }; |
| | | |
| | | // å é¤éç¥ |
| | | const handleDelete = () => { |
| | | if (selectedIds.value.length === 0) { |
| | | let ids = []; |
| | | if (selectedIds.value.length > 0) { |
| | | ids = selectedIds.value; |
| | | }else{ |
| | | ElMessage.warning("è¯·éæ©è¦å é¤çéç¥"); |
| | | return; |
| | | } |
| | | |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "å é¤", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(() => { |
| | | delNotification(ids).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("å 餿å"); |
| | | selectedIds.value = []; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | }).catch(() => { |
| | | // ç¨æ·åæ¶ |
| | | }); |
| | |
| | | v-model="currentDate" |
| | | :type="datePickerType" |
| | | placeholder="éæ©æ¥æ" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | style="width: 180px; margin-left: 10px" |
| | | @change="handleDateChange" |
| | | /> |
| | |
| | | <div class="right-actions"> |
| | | <el-button type="primary" @click="handleAddPlan">æ°å¢è®¡å</el-button> |
| | | <el-button @click="handleExport">导åºè®¡å</el-button> |
| | | <el-button @click="handleShare">å
±äº«è®¡å</el-button> |
| | | <!-- <el-button @click="handleShare">å
±äº«è®¡å@</el-button> --> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <span>{{ getCurrentLevelText() }} - {{ getCurrentPeriodText() }}</span> |
| | | <div> |
| | | <el-button size="small" @click="handleRefresh">å·æ°</el-button> |
| | | <el-button size="small" @click="handleFilter">çé</el-button> |
| | | <!-- <el-button size="small" @click="handleFilter">çé@</el-button> --> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | <div class="plan-actions"> |
| | | <el-button size="small" @click="handleEditPlan(plan)">ç¼è¾</el-button> |
| | | <el-button size="small" @click="handleViewDetail(plan)">详æ
</el-button> |
| | | <el-dropdown @command="handleMoreAction"> |
| | | <el-dropdown @command="(command) => handleMoreAction(plan, command)"> |
| | | <el-button size="small"> |
| | | æ´å¤<el-icon class="el-icon--right"><ArrowDown /></el-icon> |
| | | </el-button> |
| | | <template #dropdown> |
| | | <el-dropdown-menu> |
| | | <el-dropdown-item command="share">å
񄧮</el-dropdown-item> |
| | | <!-- <el-dropdown-item command="share">å
񄧮@</el-dropdown-item> --> |
| | | <el-dropdown-item command="copy">å¤å¶</el-dropdown-item> |
| | | <el-dropdown-item command="delete" divided>å é¤</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | |
| | | <!-- æ°å¢/ç¼è¾è®¡åå¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | v-model="planDialogVisible" |
| | | :title="dialogTitle" |
| | | :title="operationType === 'add' ? 'åå¸è®¡å' : 'ç¼è¾è®¡å'" |
| | | width="600px" |
| | | @close="handleDialogClose" |
| | | > |
| | |
| | | <el-date-picker |
| | | v-model="planForm.startDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | placeholder="éæ©å¼å§æ¶é´" |
| | | style="width: 100%" |
| | | /> |
| | |
| | | <el-date-picker |
| | | v-model="planForm.endDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | placeholder="éæ©ç»ææ¶é´" |
| | | style="width: 100%" |
| | | /> |
| | |
| | | <el-option label="ä½" value="low" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ ç¾"> |
| | | <!-- <el-form-item label="æ ç¾"> |
| | | <el-input v-model="planForm.tags" placeholder="请è¾å
¥æ ç¾ï¼ç¨éå·åé" /> |
| | | </el-form-item> --> |
| | | <el-form-item label="æ ç¾" prop="tags"> |
| | | <!-- <el-checkbox-group v-model="planForm.tags"> |
| | | <el-checkbox label="all"></el-checkbox> |
| | | <el-checkbox label="manager">管çå±</el-checkbox> |
| | | <el-checkbox label="hr">人äºé¨é¨</el-checkbox> |
| | | <el-checkbox label="finance">è´¢å¡é¨é¨</el-checkbox> |
| | | <el-checkbox label="tech">ææ¯é¨é¨</el-checkbox> |
| | | </el-checkbox-group> --> |
| | | <el-select |
| | | v-model="planForm.tags" |
| | | multiple |
| | | placeholder="è¯·éæ©æ ç¾" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dept in departments" |
| | | :key="dept" |
| | | :label="dept" |
| | | :value="dept" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select v-model="planForm.status" placeholder="éæ©ç¶æ" style="width: 100%"> |
| | | <el-option label="æªå¼å§" value="not_started" /> |
| | | <el-option label="è¿è¡ä¸" value="in_progress" /> |
| | | <el-option label="已宿" value="completed" /> |
| | | <el-option label="å·²æå" value="paused" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è¿åº¦" prop="progress"> |
| | | <el-input-number |
| | | v-model="planForm.progress" |
| | | min="0" |
| | | max="100" |
| | | step="1" |
| | | placeholder="请è¾å
¥è¿åº¦" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 计å详æ
å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="showPlanDetailDialog" title="计å详æ
" width="700px"> |
| | | <div v-if="currentPlanDetail" class="mb10"> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="è®¡åæ é¢">{{ currentPlanDetail.title }}</el-descriptions-item> |
| | | <el-descriptions-item label="计åæè¿°">{{ currentPlanDetail.description }}</el-descriptions-item> |
| | | <el-descriptions-item label="计å级å«">{{ getCurrentLevelText(currentPlanDetail.level) }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ¶é´å¨æ">{{ getCurrentPeriodText(currentPlanDetail.period) }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¼å§æ¶é´">{{ currentPlanDetail.startDate }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç»ææ¶é´">{{ currentPlanDetail.endDate }}</el-descriptions-item> |
| | | <el-descriptions-item label="è´è´£äºº">{{ currentPlanDetail.assignee }}</el-descriptions-item> |
| | | <el-descriptions-item label="ä¼å
级">{{ getPriorityText(currentPlanDetail.priority) }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ ç¾">{{ currentPlanDetail.tags.join(', ') }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç¶æ">{{ getStatusText(currentPlanDetail.status) }}</el-descriptions-item> |
| | | <el-descriptions-item label="è¿åº¦">{{ currentPlanDetail.progress }}%</el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, computed, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | const { proxy } = getCurrentInstance(); |
| | | import { |
| | | User, |
| | | UserFilled, |
| | |
| | | Flag, |
| | | ArrowDown |
| | | } from '@element-plus/icons-vue' |
| | | import { listDutyPlan, addDutyPlan, updateDutyPlan, delDutyPlan,NumDutyPlan,exportDutyPlan } from '@/api/collaborativeApproval/planTemplate.js' |
| | | |
| | | // ååºå¼æ°æ® |
| | | const operationType = ref('add') |
| | | const currentLevel = ref('personal') |
| | | const currentPeriod = ref('week') |
| | | const currentDate = ref(new Date()) |
| | | const planDialogVisible = ref(false) |
| | | const dialogTitle = ref('æ°å¢è®¡å') |
| | | const planFormRef = ref() |
| | | const showPlanDetailDialog = ref(false) |
| | | const currentPlanDetail = ref(null) |
| | | |
| | | // è¡¨åæ°æ® |
| | | const planForm = reactive({ |
| | | id: '', |
| | | title: '', |
| | | description: '', |
| | | level: 'personal', |
| | |
| | | endDate: '', |
| | | assignee: '', |
| | | priority: 'medium', |
| | | tags: '' |
| | | tags: [], |
| | | status: '', |
| | | progress: 0 |
| | | }) |
| | | |
| | | // 表åéªè¯è§å |
| | |
| | | assignee: [{ required: true, message: '请è¾å
¥è´è´£äºº', trigger: 'blur' }], |
| | | priority: [{ required: true, message: 'è¯·éæ©ä¼å
级', trigger: 'change' }] |
| | | } |
| | | |
| | | const departments = ["产å", "åæ", "è°ç ",'ææ¯', 'æ¶æ', '设计','å¸åº', 'æ¨å¹¿', 'è¥é']; |
| | | // æ¦è§æ°æ® |
| | | const overviewData = reactive({ |
| | | personal: { total: 12, completion: 75 }, |
| | | group: { total: 8, completion: 60 }, |
| | | department: { total: 15, completion: 45 }, |
| | | company: { total: 6, completion: 30 } |
| | | personal: { total: 0, completion: 0 }, |
| | | group: { total: 0, completion: 0 }, |
| | | department: { total: 0, completion: 0 }, |
| | | company: { total: 0, completion: 0 } |
| | | }) |
| | | |
| | | // 计ååè¡¨æ°æ® |
| | | const planList = ref([ |
| | | { |
| | | id: 1, |
| | | title: '产åéæ±åæ', |
| | | description: '对æ°äº§åè¿è¡è¯¦ç»çéæ±åæåå¸åºè°ç ï¼å¶å®äº§åè§åæ¹æ¡', |
| | | level: 'personal', |
| | | period: 'week', |
| | | startDate: '2025-01-15', |
| | | endDate: '2025-01-21', |
| | | assignee: 'éå¿å¼º', |
| | | priority: 'high', |
| | | status: 'in_progress', |
| | | progress: 80, |
| | | tags: ['产å', 'åæ', 'è°ç '] |
| | | }, |
| | | { |
| | | id: 2, |
| | | title: 'ææ¯æ¶æè®¾è®¡', |
| | | description: 'è®¾è®¡ç³»ç»ææ¯æ¶æï¼å
æ¬æ°æ®åºè®¾è®¡ãæ¥å£è®¾è®¡ç', |
| | | level: 'group', |
| | | period: 'month', |
| | | startDate: '2025-01-01', |
| | | endDate: '2025-01-31', |
| | | assignee: 'åé
å©·', |
| | | priority: 'high', |
| | | status: 'completed', |
| | | progress: 100, |
| | | tags: ['ææ¯', 'æ¶æ', '设计'] |
| | | }, |
| | | { |
| | | id: 3, |
| | | title: 'å¸åºæ¨å¹¿è®¡å', |
| | | description: 'å¶å®å¹´åº¦å¸åºæ¨å¹¿çç¥åè¥é计å', |
| | | level: 'department', |
| | | period: 'year', |
| | | startDate: '2025-01-01', |
| | | endDate: '2025-12-31', |
| | | assignee: 'ç建å½', |
| | | priority: 'medium', |
| | | status: 'not_started', |
| | | progress: 0, |
| | | tags: ['å¸åº', 'æ¨å¹¿', 'è¥é'] |
| | | }, |
| | | { |
| | | id: 4, |
| | | title: 'å¢é建设活å¨', |
| | | description: 'ç»ç»å¢é建设活å¨ï¼æåå¢éåèååå使ç', |
| | | level: 'company', |
| | | period: 'month', |
| | | startDate: '2025-01-15', |
| | | endDate: '2025-02-15', |
| | | assignee: '赵丽å', |
| | | priority: 'low', |
| | | status: 'in_progress', |
| | | progress: 30, |
| | | tags: ['å¢é', '建设', 'æ´»å¨'] |
| | | } |
| | | ]) |
| | | const planList = ref([]) |
| | | |
| | | // 计ç®å±æ§ |
| | | const datePickerType = computed(() => { |
| | |
| | | // æ¹æ³ |
| | | const handleLevelChange = (value) => { |
| | | console.log('计å级å«åæ´:', value) |
| | | getPlanList() |
| | | // è¿éå¯ä»¥æ ¹æ®çº§å«çéæ°æ® |
| | | } |
| | | |
| | | const handlePeriodChange = (value) => { |
| | | console.log('æ¶é´å¨æåæ´:', value) |
| | | getPlanList() |
| | | // è¿éå¯ä»¥æ ¹æ®å¨æçéæ°æ® |
| | | } |
| | | |
| | | const handleDateChange = (value) => { |
| | | console.log('æ¥æåæ´:', value) |
| | | getPlanList() |
| | | // è¿éå¯ä»¥æ ¹æ®æ¥æçéæ°æ® |
| | | } |
| | | |
| | | const handleAddPlan = () => { |
| | | operationType.value = 'add' |
| | | dialogTitle.value = 'æ°å¢è®¡å' |
| | | planDialogVisible.value = true |
| | | // é置表å |
| | |
| | | planForm.level = 'personal' |
| | | planForm.period = 'week' |
| | | planForm.priority = 'medium' |
| | | planForm.status = 'not_started' |
| | | planForm.progress = 0 |
| | | } |
| | | |
| | | const handleEditPlan = (plan) => { |
| | | operationType.value = 'edit' |
| | | dialogTitle.value = 'ç¼è¾è®¡å' |
| | | planDialogVisible.value = true |
| | | // å¡«å
è¡¨åæ°æ® |
| | | Object.keys(planForm).forEach(key => { |
| | | if (key === 'tags') { |
| | | planForm[key] = plan[key].join(', ') |
| | | } else { |
| | | planForm[key] = plan[key] |
| | | } |
| | | }) |
| | | Object.assign(planForm, plan) |
| | | // // å¡«å
è¡¨åæ°æ® |
| | | // Object.keys(planForm).forEach(key => { |
| | | // if (key === 'tags') { |
| | | // planForm[key] = plan[key].join(', ') |
| | | // } else { |
| | | // planForm[key] = plan[key] |
| | | // } |
| | | // }) |
| | | } |
| | | |
| | | const handleViewDetail = (plan) => { |
| | | ElMessage.info(`æ¥ç计å详æ
: ${plan.title}`) |
| | | currentPlanDetail.value = plan |
| | | showPlanDetailDialog.value = true |
| | | // ElMessage.info(`æ¥ç计å详æ
: ${plan.title}`) |
| | | } |
| | | |
| | | const handleMoreAction = (command) => { |
| | | const handleMoreAction = async(plan,command) => { |
| | | let ids = []; |
| | | ids.push(plan.id); |
| | | console.log("ids",ids) |
| | | switch (command) { |
| | | case 'share': |
| | | ElMessage.success('计åå·²å
񄧮') |
| | | break |
| | | case 'copy': |
| | | ElMessage.success('计åå·²å¤å¶') |
| | | const knowledgeText = ` |
| | | è®¡åæ é¢ï¼${plan.title} |
| | | 计åæè¿°ï¼${plan.description} |
| | | 计å级å«ï¼${getCurrentLevelText(plan.level)} |
| | | æ¶é´å¨æï¼${getCurrentPeriodText(plan.period)} |
| | | å¼å§æ¶é´ï¼${plan.startDate} |
| | | ç»ææ¶é´ï¼${plan.endDate} |
| | | è´è´£äººï¼${plan.assignee} |
| | | ä¼å
级ï¼${getPriorityText(plan.priority)} |
| | | æ ç¾ï¼${plan.tags.join(', ')} |
| | | ç¶æï¼${getStatusText(plan.status)} |
| | | è¿åº¦ï¼${plan.progress}% |
| | | `.trim(); |
| | | |
| | | // å¤å¶å°åªè´´æ¿ |
| | | navigator.clipboard.writeText(knowledgeText).then(() => { |
| | | ElMessage.success("ç¥è¯å
容已å¤å¶å°åªè´´æ¿"); |
| | | }).catch(() => { |
| | | ElMessage.error("å¤å¶å¤±è´¥ï¼è¯·æå¨å¤å¶"); |
| | | }); |
| | | // ElMessage.success('计åå·²å¤å¶') |
| | | break |
| | | case 'delete': |
| | | ElMessageBox.confirm('ç¡®å®è¦å é¤è¿ä¸ªè®¡ååï¼', 'æç¤º', { |
| | |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | |
| | | delDutyPlan(ids).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('计åå·²å é¤') |
| | | ids.value = []; |
| | | getPlanList() |
| | | } |
| | | }) |
| | | }) |
| | | break |
| | | } |
| | | } |
| | | |
| | | // |
| | | const handleSavePlan = async () => { |
| | | try { |
| | | await planFormRef.value.validate() |
| | | if (operationType.value === 'add') { |
| | | addDutyPlan(planForm).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('计åä¿åæå') |
| | | planDialogVisible.value = false |
| | | } |
| | | getPlanList() |
| | | }) |
| | | } else { |
| | | |
| | | updateDutyPlan(planForm).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('计åä¿åæå') |
| | | planDialogVisible.value = false |
| | | } |
| | | getPlanList() |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.log('表åéªè¯å¤±è´¥:', error) |
| | | } |
| | |
| | | } |
| | | |
| | | const handleRefresh = () => { |
| | | ElMessage.success('æ°æ®å·²å·æ°') |
| | | getPlanList() |
| | | // ElMessage.success('æ°æ®å·²å·æ°') |
| | | } |
| | | |
| | | const handleFilter = () => { |
| | |
| | | } |
| | | |
| | | const handleExport = () => { |
| | | ElMessage.success('计å已导åº') |
| | | } |
| | | ElMessageBox.confirm("æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // exportDutyPlan().then(res => { |
| | | |
| | | // }) |
| | | proxy.download("/dutyPlan/export", {}, "计å管ç.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | const handleShare = () => { |
| | | ElMessage.success('计åå·²å
񄧮') |
| | | } |
| | |
| | | if (progress >= 50) return '#E6A23C' |
| | | return '#F56C6C' |
| | | } |
| | | //è·åæ°æ®å表 |
| | | const getPlanList = async () => { |
| | | const params = { |
| | | level: currentLevel.value, |
| | | period: currentPeriod.value, |
| | | queryDate:currentDate.value |
| | | } |
| | | listDutyPlan(params).then(res => { |
| | | if (res.code === 200) { |
| | | planList.value = res.data.records |
| | | } |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | | } |
| | | //è·åæ°æ® |
| | | const getPlanNum = async () => { |
| | | NumDutyPlan().then(res => { |
| | | if (res.code === 200) { |
| | | // console.log(res.data) |
| | | //è®²ç»æéé¢çæ°æ®æ ¹æ®level èµå¼ç»overviewData |
| | | res.data.forEach(item => { |
| | | overviewData[item.level].total = item.num |
| | | overviewData[item.level].completion = item.completion |
| | | }) |
| | | |
| | | } |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getPlanList() |
| | | getPlanNum() |
| | | console.log('å¤çº§è®¡å模æ¿é¡µé¢å·²å è½½') |
| | | }) |
| | | </script> |
| | |
| | | import { onMounted, ref, reactive, toRefs } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | |
| | | import {listRpa, addRpa, updateRpa, delRpa, delRpaBatch} from "@/api/collaborativeApproval/rpaManagement.js"; |
| | | // ååºå¼æ°æ® |
| | | const data = reactive({ |
| | | searchForm: { |
| | |
| | | status: "", |
| | | }, |
| | | form: { |
| | | id: "", |
| | | programName: "", |
| | | status: "stopped", |
| | | description: "", |
| | | createTime: "", |
| | | status: "", |
| | | description: "" |
| | | }, |
| | | dialogVisible: false, |
| | | dialogTitle: "", |
| | | dialogType: "add", |
| | | selectedIds: [], |
| | | tableLoading: false, |
| | | page: { |
| | | current: 1, |
| | | size: 100, |
| | | size: 20, |
| | | total: 0, |
| | | }, |
| | | tableData: [], |
| | |
| | | |
| | | // 表åå¼ç¨ |
| | | const formRef = ref(); |
| | | // éæ©çè¡æ°æ® |
| | | const selectedRows = ref([]); |
| | | |
| | | // 表åéªè¯è§å |
| | | const rules = { |
| | |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 230, |
| | | width: 150, |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | |
| | | openForm("edit", row); |
| | | } |
| | | }, |
| | | { |
| | | name: "å¼å§", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | handleStart(row); |
| | | }, |
| | | disabled: (row) => row.status !== 'stopped' |
| | | }, |
| | | { |
| | | name: "忢", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | handleStop(row); |
| | | }, |
| | | disabled: (row) => row.status === 'stopped' |
| | | } |
| | | // { |
| | | // name: "å¼å§", |
| | | // type: "text", |
| | | // clickFun: (row) => { |
| | | // handleStart(row); |
| | | // }, |
| | | // disabled: (row) => row.status !== 'stopped' |
| | | // }, |
| | | // { |
| | | // name: "忢", |
| | | // type: "text", |
| | | // clickFun: (row) => { |
| | | // handleStop(row); |
| | | // }, |
| | | // disabled: (row) => row.status === 'stopped' |
| | | // } |
| | | ] |
| | | } |
| | | ]); |
| | | |
| | | // æ¨¡ææ°æ® |
| | | const mockData = [ |
| | | { |
| | | id: "1", |
| | | programName: "订åå¤çRPA", |
| | | status: "running", |
| | | description: "èªå¨å¤ç客æ·è®¢åï¼å
æ¬éªè¯ãåé
å确认", |
| | | createTime: "2025-01-15 10:30:00" |
| | | }, |
| | | { |
| | | id: "2", |
| | | programName: "åºå忥RPA", |
| | | status: "stopped", |
| | | description: "忥å¤ä¸ªä»åºçåºåæ°æ®ï¼ç¡®ä¿æ°æ®ä¸è´æ§", |
| | | createTime: "2025-01-14 15:20:00" |
| | | }, |
| | | { |
| | | id: "3", |
| | | programName: "æ¥è¡¨çæRPA", |
| | | status: "error", |
| | | description: "èªå¨çææ¯æ¥é宿¥è¡¨ååºåæ¥è¡¨", |
| | | createTime: "2025-01-13 09:15:00" |
| | | } |
| | | ]; |
| | | |
| | | // çå½å¨æ |
| | | onMounted(() => { |
| | |
| | | |
| | | // æ¥è¯¢æ°æ® |
| | | const handleQuery = () => { |
| | | page.value.current = 1; |
| | | // page.value.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | |
| | | // 模æAPIè°ç¨å»¶è¿ |
| | | setTimeout(() => { |
| | | let filteredData = [...mockData]; |
| | | |
| | | // æ ¹æ®æç´¢æ¡ä»¶è¿æ»¤æ°æ® |
| | | if (searchForm.value.programName) { |
| | | filteredData = filteredData.filter(item => |
| | | item.programName.toLowerCase().includes(searchForm.value.programName.toLowerCase()) |
| | | ); |
| | | } |
| | | |
| | | if (searchForm.value.status) { |
| | | filteredData = filteredData.filter(item => item.status === searchForm.value.status); |
| | | } |
| | | |
| | | tableData.value = filteredData; |
| | | page.value.total = filteredData.length; |
| | | listRpa({...page.value, ...searchForm.value}) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | }, 500); |
| | | tableData.value = res.data.records |
| | | page.total = res.data.total; |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | }; |
| | | |
| | | // å页å¤ç |
| | |
| | | |
| | | // éæ©ååå¤ç |
| | | const handleSelectionChange = (selection) => { |
| | | selectedIds.value = selection.map(item => item.id); |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | // æå¼è¡¨å |
| | |
| | | |
| | | if (type === "add") { |
| | | dialogTitle.value = "æ·»å RPA"; |
| | | form.value = { |
| | | id: "", |
| | | programName: "", |
| | | status: "stopped", |
| | | description: "", |
| | | createTime: "", |
| | | }; |
| | | } else { |
| | | dialogTitle.value = "ç¼è¾RPA"; |
| | | form.value = { ...row }; |
| | |
| | | |
| | | if (dialogType.value === "add") { |
| | | // æ·»å æ°RPA |
| | | const newRPA = { |
| | | id: Date.now().toString(), |
| | | programName: form.value.programName, |
| | | status: form.value.status, |
| | | description: form.value.description, |
| | | createTime: new Date().toLocaleString(), |
| | | }; |
| | | |
| | | mockData.unshift(newRPA); |
| | | ElMessage.success("RPAæ·»å æå"); |
| | | } else { |
| | | // ç¼è¾RPA |
| | | const index = mockData.findIndex(item => item.id === form.value.id); |
| | | if (index !== -1) { |
| | | mockData[index] = { ...form.value }; |
| | | ElMessage.success("RPAæ´æ°æå"); |
| | | } |
| | | } |
| | | |
| | | addRpa({...form.value}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | form.value = { |
| | | programName: "", |
| | | status: "", |
| | | description: "" |
| | | }, |
| | | dialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } else { |
| | | // ç¼è¾RPA |
| | | updateRpa({...form.value}).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ´æ°æå"); |
| | | dialogVisible.value = false; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.error("表åéªè¯å¤±è´¥:", error); |
| | | } |
| | |
| | | // å é¤RPA |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedIds.value.length > 0) { |
| | | ids = selectedIds.value.map((item) => item.id); |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | ElMessage.warning("è¯·éæ©è¦å é¤çRPA"); |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "å é¤", { |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "å é¤æç¤º", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(() => { |
| | | // 仿¨¡ææ°æ®ä¸å é¤éä¸ç项 |
| | | ids.forEach(id => { |
| | | const index = mockData.findIndex(item => item.id === id); |
| | | if (index !== -1) { |
| | | mockData.splice(index, 1); |
| | | } |
| | | }); |
| | | |
| | | }) |
| | | .then(() => { |
| | | delRpa(ids).then((res) => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("å 餿å"); |
| | | selectedIds.value = []; |
| | | getList(); |
| | | }).catch(() => { |
| | | // ç¨æ·åæ¶ |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | </script> |
| | |
| | | <div class="tab-content"> |
| | | <el-row :gutter="20" class="mb-20"> |
| | | <el-col :span="6"> |
| | | <el-input v-model="sealSearchForm.keyword" placeholder="请è¾å
¥ç³è¯·æ 颿ç³è¯·äºº" clearable /> |
| | | <el-input v-model="sealSearchForm.title" placeholder="请è¾å
¥ç³è¯·æ é¢" clearable /> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-select v-model="sealSearchForm.status" placeholder="审æ¹ç¶æ" clearable> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-table :data="sealApplications" style="width: 100%"> |
| | | <el-table-column prop="id" label="ç³è¯·ç¼å·" width="120" /> |
| | | <el-table :data="sealApplications" border v-loading="tableLoading" style="width: 100%"> |
| | | <el-table-column prop="applicationNum" label="ç³è¯·ç¼å·" width="120" /> |
| | | <el-table-column prop="title" label="ç³è¯·æ é¢" min-width="200" /> |
| | | <el-table-column prop="applicant" label="ç³è¯·äºº" width="120" /> |
| | | <el-table-column prop="createUserName" label="ç³è¯·äºº" width="120" /> |
| | | <el-table-column prop="department" label="æå±é¨é¨" width="150" /> |
| | | <el-table-column prop="sealType" label="ç¨å°ç±»å" width="120" /> |
| | | <el-table-column prop="applyTime" label="ç³è¯·æ¶é´" width="180" /> |
| | | <el-table-column prop="sealType" label="ç¨å°ç±»å" width="120"> |
| | | <template #default="scope"> |
| | | {{ getSealTypeText(scope.row.sealType) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" label="ç³è¯·æ¶é´" width="180" /> |
| | | <el-table-column prop="status" label="ç¶æ" width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusType(scope.row.status)"> |
| | |
| | | <div class="tab-content"> |
| | | <el-row :gutter="20" class="mb-20"> |
| | | <el-col :span="6"> |
| | | <el-input v-model="regulationSearchForm.keyword" placeholder="请è¾å
¥å¶åº¦æ 颿åå¸äºº" clearable /> |
| | | <el-input v-model="regulationSearchForm.title" placeholder="请è¾å
¥å¶åº¦æ é¢" clearable /> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-select v-model="regulationSearchForm.category" placeholder="å¶åº¦åç±»" clearable> |
| | |
| | | <el-col :span="8"> |
| | | <el-button type="primary" @click="searchRegulations">æç´¢</el-button> |
| | | <el-button @click="resetRegulationSearch">éç½®</el-button> |
| | | <el-button type="success" @click="showRegulationDialog = true"> |
| | | <el-button type="success" @click="handleAdd"> |
| | | åå¸å¶åº¦ |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-table :data="regulations" style="width: 100%"> |
| | | <el-table-column prop="id" label="å¶åº¦ç¼å·" width="120" /> |
| | | <el-table :data="regulations" border v-loading="tableLoading" style="width: 100%"> |
| | | <el-table-column prop="regulationNum" label="å¶åº¦ç¼å·" width="120" /> |
| | | <el-table-column prop="title" label="å¶åº¦æ é¢" min-width="200" /> |
| | | <el-table-column prop="category" label="åç±»" width="120"> |
| | | <template #default="scope"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="version" label="çæ¬" width="80" /> |
| | | <el-table-column prop="publisher" label="åå¸äºº" width="120" /> |
| | | <el-table-column prop="publishTime" label="å叿¶é´" width="180" /> |
| | | <el-table-column prop="createUserName" label="åå¸äºº" width="120" /> |
| | | <el-table-column prop="createTime" label="å叿¶é´" width="180" /> |
| | | <el-table-column prop="status" label="ç¶æ" width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.status === 'active' ? 'success' : 'info'"> |
| | |
| | | <el-table-column label="æä½" width="250" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button link @click="viewRegulation(scope.row)">æ¥ç</el-button> |
| | | <el-button link type="primary" @click="editRegulation(scope.row)">ç¼è¾</el-button> |
| | | <el-button link type="primary" @click="handleEdit(scope.row)">ç¼è¾</el-button> |
| | | <el-button link type="danger" @click="repealEdit(scope.row)">åºå¼</el-button> |
| | | <el-button link type="success" @click="viewVersionHistory(scope.row)">çæ¬åå²</el-button> |
| | | <el-button link type="warning" @click="viewReadStatus(scope.row)">é
è¯»ç¶æ</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- å页 |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationChange" |
| | | /> --> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | |
| | | <!-- ç¨å°ç³è¯·å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="showSealApplyDialog" title="ç³è¯·ç¨å°" width="600px"> |
| | | <el-form :model="sealForm" :rules="sealRules" ref="sealFormRef" label-width="100px"> |
| | | <el-form-item label="ç³è¯·ç¼å·" prop="applicationNum"> |
| | | <el-input v-model="sealForm.applicationNum" placeholder="请è¾å
¥ç³è¯·ç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç³è¯·æ é¢" prop="title"> |
| | | <el-input v-model="sealForm.title" placeholder="请è¾å
¥ç³è¯·æ é¢" /> |
| | | </el-form-item> |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- è§ç« å¶åº¦åå¸å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="showRegulationDialog" title="åå¸è§ç« å¶åº¦" width="800px"> |
| | | <el-dialog v-model="showRegulationDialog" :title="operationType === 'add' ? 'åå¸å¶åº¦' : 'ç¼è¾å¶åº¦'" width="800px"> |
| | | <el-form :model="regulationForm" :rules="regulationRules" ref="regulationFormRef" label-width="100px"> |
| | | <el-form-item label="å¶åº¦ç¼å·" prop="regulationNum"> |
| | | <el-input v-model="regulationForm.regulationNum" placeholder="请è¾å
¥å¶åº¦ç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¶åº¦æ é¢" prop="title"> |
| | | <el-input v-model="regulationForm.title" placeholder="请è¾å
¥å¶åº¦æ é¢" /> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="å¶åº¦å
容" prop="content"> |
| | | <el-input v-model="regulationForm.content" type="textarea" :rows="10" placeholder="请è¾å
¥å¶åº¦è¯¦ç»å
容" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¶åº¦çæ¬" prop="version"> |
| | | <el-input v-model="regulationForm.version" placeholder="请è¾å
¥å¶åº¦çæ¬" /> |
| | | </el-form-item> |
| | | <el-form-item label="çææ¶é´" prop="effectiveTime"> |
| | | <el-date-picker v-model="regulationForm.effectiveTime" type="datetime" placeholder="éæ©çææ¶é´" style="width: 100%" /> |
| | | <el-date-picker v-model="regulationForm.effectiveTime" type="datetime" format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" placeholder="éæ©çææ¶é´" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="éç¨èå´" prop="scope"> |
| | | <el-checkbox-group v-model="regulationForm.scope"> |
| | |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="ç³è¯·ç¼å·">{{ currentSealDetail.id }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·æ é¢">{{ currentSealDetail.title }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·äºº">{{ currentSealDetail.applicant }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·äºº">{{ currentSealDetail.createUserName }}</el-descriptions-item> |
| | | <el-descriptions-item label="æå±é¨é¨">{{ currentSealDetail.department }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç¨å°ç±»å">{{ currentSealDetail.sealType }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·æ¶é´">{{ currentSealDetail.applyTime }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç¨å°ç±»å">{{ getSealTypeText(currentSealDetail.sealType) }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·æ¶é´">{{ currentSealDetail.createTime }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç¶æ"> |
| | | <el-tag :type="getStatusType(currentSealDetail.status)"> |
| | | {{ getStatusText(currentSealDetail.status) }} |
| | |
| | | <el-descriptions-item label="å¶åº¦æ é¢">{{ currentRegulationDetail.title }}</el-descriptions-item> |
| | | <el-descriptions-item label="åç±»">{{ getCategoryText(currentRegulationDetail.category) }}</el-descriptions-item> |
| | | <el-descriptions-item label="çæ¬">{{ currentRegulationDetail.version }}</el-descriptions-item> |
| | | <el-descriptions-item label="åå¸äºº">{{ currentRegulationDetail.publisher }}</el-descriptions-item> |
| | | <el-descriptions-item label="å叿¶é´">{{ currentRegulationDetail.publishTime }}</el-descriptions-item> |
| | | <el-descriptions-item label="åå¸äºº">{{ currentRegulationDetail.createUserName }}</el-descriptions-item> |
| | | <el-descriptions-item label="å叿¶é´">{{ currentRegulationDetail.createTime }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | <div class="mt-20"> |
| | | <h4>å¶åº¦å
容</h4> |
| | | <div class="regulation-content">{{ currentRegulationDetail.content }}</div> |
| | | </div> |
| | | <!-- 妿tableData>0 æ¾ç¤º --> |
| | | <div style="margin: 10px 0;" v-if="tableData && tableData.length > 0" > |
| | | <el-button type="success" @click="resetForm(currentRegulationDetail)">确认æ¥ç</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | <el-table :data="versionHistory" style="width: 100%;margin-bottom: 10px"> |
| | | <el-table-column prop="version" label="çæ¬å·" width="100" /> |
| | | <el-table-column prop="updateTime" label="æ´æ°æ¶é´" width="180" /> |
| | | <el-table-column prop="updater" label="æ´æ°äºº" width="120" /> |
| | | <el-table-column prop="changeLog" label="åæ´è¯´æ" /> |
| | | <el-table-column prop="createUserName" label="æ´æ°äºº" width="120" /> |
| | | <el-table-column prop="changeLog" label="åæ´è¯´æ"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.status === 'active' ? 'success' : 'info'"> |
| | | {{ scope.row.status === 'active' ? 'çæä¸' : 'å·²åºæ¢' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | |
| | | <el-table :data="readStatusList" style="width: 100%;margin-bottom: 10px"> |
| | | <el-table-column prop="employee" label="åå·¥å§å" width="120" /> |
| | | <el-table-column prop="department" label="æå±é¨é¨" width="150" /> |
| | | <el-table-column prop="readTime" label="é
读æ¶é´" width="180" /> |
| | | <el-table-column prop="createTime" label="é
读æ¶é´" width="180" /> |
| | | <el-table-column prop="confirmTime" label="确认æ¶é´" width="180" /> |
| | | <el-table-column prop="status" label="ç¶æ" width="100"> |
| | | <template #default="scope"> |
| | |
| | | import { ref, reactive, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import { listSealApplication, addSealApplication, updateSealApplication,listRuleManagement,addRuleManagement,updateRuleManagement,delRuleManagement,getReadingStatusByRuleId,getReadingStatusList,addReadingStatus,updateReadingStatus } from '@/api/collaborativeApproval/sealManagement.js' |
| | | import { el } from 'element-plus/es/locales.mjs' |
| | | import { getUserProfile } from '@/api/system/user.js' |
| | | import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; |
| | | |
| | | // ååºå¼æ°æ® |
| | | const currentUser = ref(null) |
| | | const activeTab = ref('seal') |
| | | |
| | | const operationType = ref('add') |
| | | const tableData = ref([]) |
| | | // ç¨å°ç³è¯·ç¸å
³ |
| | | const showSealApplyDialog = ref(false) |
| | | const tableLoading = ref(false) |
| | | const showSealDetailDialog = ref(false) |
| | | const currentSealDetail = ref(null) |
| | | const sealFormRef = ref() |
| | | const sealForm = reactive({ |
| | | applicationNum: '', |
| | | title: '', |
| | | sealType: '', |
| | | reason: '', |
| | | urgency: 'normal' |
| | | urgency: 'normal', |
| | | status: 'pending' |
| | | }) |
| | | |
| | | const sealRules = { |
| | | applicationNum: [{ required: true, message: '请è¾å
¥ç³è¯·ç¼å·', trigger: 'blur' }], |
| | | title: [{ required: true, message: '请è¾å
¥ç³è¯·æ é¢', trigger: 'blur' }], |
| | | sealType: [{ required: true, message: 'è¯·éæ©ç¨å°ç±»å', trigger: 'change' }], |
| | | reason: [{ required: true, message: '请è¾å
¥ç³è¯·åå ', trigger: 'blur' }] |
| | | } |
| | | |
| | | const sealSearchForm = reactive({ |
| | | keyword: '', |
| | | title: '', |
| | | status: '' |
| | | }) |
| | | |
| | | // å页忰 |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0 |
| | | }) |
| | | // è§ç« å¶åº¦ç¸å
³ |
| | | const showRegulationDialog = ref(false) |
| | | const showRegulationDetailDialog = ref(false) |
| | |
| | | const currentRegulationDetail = ref(null) |
| | | const regulationFormRef = ref() |
| | | const regulationForm = reactive({ |
| | | id: '', |
| | | regulationNum: '', |
| | | title: '', |
| | | category: '', |
| | | content: '', |
| | | version: '', |
| | | status: 'active', |
| | | readCount: 0, |
| | | effectiveTime: '', |
| | | scope: [], |
| | | requireConfirm: true |
| | | requireConfirm: false |
| | | }) |
| | | |
| | | const readStatus = ref({ |
| | | id: '', |
| | | ruleId: '', |
| | | employee: '', |
| | | department: '', |
| | | createTime: '', |
| | | confirmTime: '', |
| | | status: 'unconfirmed' |
| | | }) |
| | | |
| | | const regulationRules = { |
| | |
| | | } |
| | | |
| | | const regulationSearchForm = reactive({ |
| | | keyword: '', |
| | | title: '', |
| | | category: '' |
| | | }) |
| | | |
| | | // åæ°æ® |
| | | const sealApplications = ref([ |
| | | { |
| | | id: 'SEAL001', |
| | | title: 'ååç¨å°ç³è¯·', |
| | | applicant: 'éå¿å¼º', |
| | | department: 'éå®é¨', |
| | | sealType: 'ååä¸ç¨ç« ', |
| | | applyTime: '2025-01-15 10:30:00', |
| | | status: 'pending', |
| | | reason: '客æ·ååéè¦çç« ' |
| | | }, |
| | | { |
| | | id: 'SEAL002', |
| | | title: 'è´¢å¡æ¥åç¨å°', |
| | | applicant: 'ç建å½', |
| | | department: 'è´¢å¡é¨', |
| | | sealType: 'è´¢å¡ä¸ç¨ç« ', |
| | | applyTime: '2025-01-14 14:20:00', |
| | | status: 'approved', |
| | | reason: 'å£åº¦è´¢å¡æ¥åéè¦çç« ' |
| | | }, |
| | | { |
| | | id: 'SEAL003', |
| | | title: 'å
¬å¸ç« ç¨ç¨å°', |
| | | applicant: 'åæå', |
| | | department: 'æ³å¡é¨', |
| | | sealType: 'å
¬ç« ', |
| | | applyTime: '2025-01-13 09:15:00', |
| | | status: 'rejected', |
| | | reason: 'å
¬å¸ç« ç¨ä¿®æ¹éè¦çç« ' |
| | | } |
| | | ]) |
| | | const sealApplications = ref([]) |
| | | |
| | | const regulations = ref([ |
| | | { |
| | | id: 'REG001', |
| | | title: 'åå·¥èå¤ç®¡çå¶åº¦', |
| | | category: 'hr', |
| | | version: 'v2.1', |
| | | publisher: '人äºé¨', |
| | | publishTime: '2025-01-10 09:00:00', |
| | | status: 'active', |
| | | readCount: 45, |
| | | content: '为è§èåå·¥èå¤ç®¡çï¼æé«å·¥ä½æçï¼ç¹å¶å®æ¬å¶åº¦...' |
| | | }, |
| | | { |
| | | id: 'REG002', |
| | | title: 'è´¢å¡æ¥éå¶åº¦', |
| | | category: 'finance', |
| | | version: 'v1.5', |
| | | publisher: 'è´¢å¡é¨', |
| | | publishTime: '2025-01-08 14:30:00', |
| | | status: 'active', |
| | | readCount: 38, |
| | | content: '为è§èè´¢å¡æ¥éæµç¨ï¼å 强财å¡ç®¡çï¼ç¹å¶å®æ¬å¶åº¦...' |
| | | }, |
| | | { |
| | | id: 'REG003', |
| | | title: 'å®å
¨ç产管çå¶åº¦', |
| | | category: 'safety', |
| | | version: 'v3.0', |
| | | publisher: 'å®å
¨é¨', |
| | | publishTime: '2025-01-05 16:00:00', |
| | | status: 'active', |
| | | readCount: 52, |
| | | content: '为确ä¿å工人身å®å
¨ï¼é¢é²å®å
¨äºæ
åçï¼ç¹å¶å®æ¬å¶åº¦...' |
| | | } |
| | | ]) |
| | | const regulations = ref([]) |
| | | |
| | | const versionHistory = ref([ |
| | | { version: 'v2.1', updateTime: '2025-01-10 09:00:00', updater: '人äºé¨', changeLog: 'æ´æ°è夿¶é´è§å®' }, |
| | | { version: 'v2.0', updateTime: '2023-12-15 10:30:00', updater: '人äºé¨', changeLog: 'æ°å¢å ç管çè§å®' }, |
| | | { version: 'v1.0', updateTime: '2023-11-01 14:00:00', updater: '人äºé¨', changeLog: '馿¬¡åå¸' } |
| | | ]) |
| | | const versionHistory = ref([]) |
| | | |
| | | const readStatusList = ref([ |
| | | { employee: 'éå¿å¼º', department: 'éå®é¨', readTime: '2025-01-11 10:30:00', confirmTime: '2025-01-11 10:35:00', status: 'confirmed' }, |
| | | { employee: 'åé
å©·', department: 'ææ¯é¨', readTime: '2025-01-11 14:20:00', confirmTime: '', status: 'unconfirmed' }, |
| | | { employee: 'ç建å½', department: 'è´¢å¡é¨', readTime: '2025-01-12 09:15:00', confirmTime: '2025-01-12 09:20:00', status: 'confirmed' } |
| | | ]) |
| | | const readStatusList = ref([]) |
| | | // { employee: 'éå¿å¼º', department: 'éå®é¨', readTime: '2025-01-11 10:30:00', confirmTime: '2025-01-11 10:35:00', status: 'confirmed' }, |
| | | // { employee: 'åé
å©·', department: 'ææ¯é¨', readTime: '2025-01-11 14:20:00', confirmTime: '', status: 'unconfirmed' }, |
| | | // { employee: 'ç建å½', department: 'è´¢å¡é¨', readTime: '2025-01-12 09:15:00', confirmTime: '2025-01-12 09:20:00', status: 'confirmed' } |
| | | |
| | | // æ¹æ³ |
| | | // ç¨å°ç³è¯·ç¶æ |
| | | const getStatusType = (status) => { |
| | | const statusMap = { |
| | | pending: 'warning', |
| | |
| | | } |
| | | return statusMap[status] || 'info' |
| | | } |
| | | |
| | | // å¶åº¦ç¶æ |
| | | const getStatusText = (status) => { |
| | | const statusMap = { |
| | | pending: 'å¾
审æ¹', |
| | |
| | | } |
| | | return statusMap[status] || 'æªç¥' |
| | | } |
| | | |
| | | // ç¨å°ç±»å |
| | | const getSealTypeText = (sealType) => { |
| | | const sealTypeMap = { |
| | | official: 'å
¬ç« ', |
| | | contract: 'ååä¸ç¨ç« ', |
| | | finance: 'è´¢å¡ä¸ç¨ç« ', |
| | | tegal: 'ææ¯ä¸ç¨ç« ' |
| | | } |
| | | return sealTypeMap[sealType] || 'æªç¥' |
| | | } |
| | | // å¶åº¦åç±» |
| | | const getCategoryText = (category) => { |
| | | const categoryMap = { |
| | | hr: '人äºå¶åº¦', |
| | |
| | | } |
| | | return categoryMap[category] || 'æªç¥' |
| | | } |
| | | |
| | | // æç´¢å°ç« ç³è¯· |
| | | const searchSealApplications = () => { |
| | | ElMessage.success('æç´¢å®æ') |
| | | } |
| | | page.current=1 |
| | | getSealApplicationList() |
| | | |
| | | // ElMessage.success('æç´¢å®æ') |
| | | } |
| | | // éç½®å°ç« ç³è¯·æç´¢ |
| | | const resetSealSearch = () => { |
| | | sealSearchForm.keyword = '' |
| | | sealSearchForm.title = '' |
| | | sealSearchForm.status = '' |
| | | searchSealApplications() |
| | | } |
| | | |
| | | // æç´¢å¶åº¦ |
| | | const searchRegulations = () => { |
| | | ElMessage.success('æç´¢å®æ') |
| | | page.current=1 |
| | | getRegulationList() |
| | | } |
| | | |
| | | // éç½®å¶åº¦æç´¢ |
| | | const resetRegulationSearch = () => { |
| | | regulationSearchForm.keyword = '' |
| | | regulationSearchForm.title = '' |
| | | regulationSearchForm.category = '' |
| | | searchRegulations() |
| | | } |
| | | |
| | | // æäº¤ç¨å°ç³è¯· |
| | | const submitSealApplication = async () => { |
| | | try { |
| | | await sealFormRef.value.validate() |
| | | addSealApplication(sealForm).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success('ç³è¯·æäº¤æå') |
| | | showSealApplyDialog.value = false |
| | | getSealApplicationList() |
| | | Object.assign(sealForm, { |
| | | applicationNum: '', |
| | | title: '', |
| | | sealType: '', |
| | | reason: '', |
| | | urgency: 'normal' |
| | | urgency: 'normal', |
| | | status: 'pending' |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg) |
| | | }) |
| | | |
| | | } catch (error) { |
| | | ElMessage.error('请å®åç³è¯·ä¿¡æ¯') |
| | | } |
| | | } |
| | | // æ°å¢ |
| | | const handleAdd = () => { |
| | | operationType.value = 'add' |
| | | resetRegulationForm() |
| | | showRegulationDialog.value = true |
| | | } |
| | | |
| | | // ç¼è¾ |
| | | const handleEdit = (row) => { |
| | | operationType.value = 'edit' |
| | | Object.assign(regulationForm, row) |
| | | showRegulationDialog.value = true |
| | | } |
| | | // åºå¼ |
| | | const repealEdit = (row) => { |
| | | operationType.value = 'edit' |
| | | Object.assign(regulationForm, row) |
| | | regulationForm.status = 'repealed' |
| | | ElMessageBox.confirm('确认åºå¼è¯¥å¶åº¦ï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | updateRuleManagement(regulationForm).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success('å¶åº¦åºå¼æå') |
| | | // showRegulationDialog.value = false |
| | | getRegulationList() |
| | | resetRegulationForm() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '已忶åºå¼' |
| | | }) |
| | | }) |
| | | } |
| | | // åå¸å¶åº¦ |
| | | const submitRegulation = async () => { |
| | | try { |
| | | await regulationFormRef.value.validate() |
| | | if(operationType.value == 'add'){ |
| | | addRuleManagement(regulationForm).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success('å¶åº¦å叿å') |
| | | showRegulationDialog.value = false |
| | | getRegulationList() |
| | | resetRegulationForm() |
| | | } |
| | | }) |
| | | }else{ |
| | | updateRuleManagement(regulationForm).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success('å¶åº¦ç¼è¾æå') |
| | | showRegulationDialog.value = false |
| | | resetRegulationForm() |
| | | getRegulationList() |
| | | }})} |
| | | }catch(err){ |
| | | ElMessage.error(err.msg) |
| | | } |
| | | } |
| | | //éç½®å¶åº¦è¡¨å |
| | | const resetRegulationForm = () => { |
| | | Object.assign(regulationForm, { |
| | | id: '', |
| | | regulationNum: '', |
| | | title: '', |
| | | category: '', |
| | | content: '', |
| | | version: '', |
| | | status: 'active', |
| | | readCount: 0, |
| | | effectiveTime: '', |
| | | scope: [], |
| | | requireConfirm: true |
| | | requireConfirm: false |
| | | }) |
| | | } catch (error) { |
| | | ElMessage.error('请å®åå¶åº¦ä¿¡æ¯') |
| | | } |
| | | } |
| | | |
| | | |
| | | // æ¥çç¨å°ç³è¯·è¯¦æ
|
| | | const viewSealDetail = (row) => { |
| | | currentSealDetail.value = row |
| | | showSealDetailDialog.value = true |
| | | } |
| | | |
| | | // 审æ¹ç¨å°ç³è¯· |
| | | const approveSeal = (row) => { |
| | | console.log(row) |
| | | ElMessageBox.confirm('确认éè¿è¯¥ç¨å°ç³è¯·ï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | row.status = 'approved' |
| | | updateSealApplication(row).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success('审æ¹éè¿') |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | // æç»ç¨å°ç³è¯· |
| | | const rejectSeal = (row) => { |
| | | ElMessageBox.prompt('请è¾å
¥æç»åå ', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | |
| | | inputErrorMessage: 'æç»åå ä¸è½ä¸ºç©º' |
| | | }).then(({ value }) => { |
| | | row.status = 'rejected' |
| | | updateSealApplication(row).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success('å®¡æ¹æç»') |
| | | } |
| | | }) |
| | | ElMessage.success('å·²æç»ç³è¯·') |
| | | }) |
| | | } |
| | | |
| | | const viewRegulation = (row) => { |
| | | currentRegulationDetail.value = row |
| | | showRegulationDetailDialog.value = true |
| | | // è·åå¨èåå·¥å表 |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | //è·åå½åç»å½ç¨æ·ä¿¡æ¯ |
| | | getUserProfile().then(res => { |
| | | if(res.code == 200){ |
| | | console.log(res.data.userName) |
| | | currentUser.value = res.data.userName |
| | | } |
| | | }) |
| | | staffJoinListPage({staffState: 1}).then(res => { |
| | | tableLoading.value = false; |
| | | // tableData.value = res.data.records |
| | | // //çéåºåcurrentUserååç人å |
| | | tableData.value = res.data.records.filter(item => item.staffName === currentUser.value) |
| | | console.log("tableData",tableData.value) |
| | | page.total = res.data.total; |
| | | |
| | | const editRegulation = (row) => { |
| | | ElMessage.info('ç¼è¾åè½å¼åä¸...') |
| | | if(tableData.value.length == 0){ |
| | | ElMessage.error('å½åç¨æ·æªå å
¥ä»»ä½é¨é¨') |
| | | } |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | |
| | | |
| | | }; |
| | | |
| | | // æ¥çå¶åº¦çæ¬åå² |
| | | const viewVersionHistory = (row) => { |
| | | showVersionHistoryDialog.value = true |
| | | } |
| | | const params = { |
| | | |
| | | category: row.category |
| | | } |
| | | listRuleManagement(page,params).then(res => { |
| | | if(res.code == 200){ |
| | | versionHistory.value = res.data.records |
| | | } |
| | | }) |
| | | } |
| | | // æ¥çå¶åº¦è¯¦æ
|
| | | const viewRegulation = (row) => { |
| | | getList() |
| | | currentRegulationDetail.value = row |
| | | showRegulationDetailDialog.value = true |
| | | getReadingStatusByRuleId(row.id).then(res => { |
| | | if(res.code == 200){ |
| | | readStatusList.value = res.data |
| | | if(readStatusList.value.length==0 && tableData.value.length>0){ |
| | | const params = { |
| | | ruleId: row.id, |
| | | employee: tableData.value[0].staffName, |
| | | department: tableData.value[0].postJob, |
| | | status: 'unconfirmed' |
| | | } |
| | | addReadingStatus(params).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success('å¶åº¦é
读æå') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | } |
| | | // æ¥çå¶åº¦é
è¯»ç¶æ |
| | | const viewReadStatus = (row) => { |
| | | showReadStatusDialog.value = true |
| | | //æ¥çé
è¯»ç¶æå表 |
| | | getReadingStatusByRuleId(row.id).then(res => { |
| | | if(res.code == 200){ |
| | | readStatusList.value = res.data |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //确认æ¥ç |
| | | const resetForm = (row) => { |
| | | console.log("row",row) |
| | | row.readCount = row.readCount + 1 |
| | | |
| | | updateRuleManagement(row).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success('æ¥çæ°éä¿®æ¹æå') |
| | | //ä¿®æ¹é
è¯»ç¶æ |
| | | //æ ¹æ®å¶åº¦idåå½åç»å½çåå·¥å¾å°é
è¯»ç¶æ |
| | | // let item = readStatusList.value.filter(item => item.employee == tableData.value[0].staffName ) |
| | | // if(item.length>0){ |
| | | // item[0].status = 'confirmed', |
| | | // item[0].confirmTime = new Date().toISOString().replace('T', ' ').split('.')[0]; |
| | | // } |
| | | // çéå½åå工对åºè¯¥å¶åº¦çé
è¯»ç¶æè®°å½ |
| | | let statusItem = readStatusList.value.find(item => item.employee === tableData.value[0].staffName && item.ruleId === row.id); |
| | | |
| | | if (statusItem) { |
| | | // 妿æ¾å°è®°å½ï¼æ´æ°ç¶æå确认æ¶é´ |
| | | statusItem.status = 'confirmed'; |
| | | // æ ¼å¼åæ¶é´ä¸º"YYYY-MM-DD HH:mm:ss"æ ¼å¼ |
| | | const now = new Date(); |
| | | statusItem.confirmTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`; |
| | | // statusItem.confirmTime = new Date().toISOString().replace('T', ' ').split('.')[0]; |
| | | |
| | | updateReadingStatus(statusItem).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success('å¶åº¦é
è¯»ç¶æä¿®æ¹æå') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | // è·åå°ç« ç³è¯·åè¡¨æ°æ® |
| | | const getSealApplicationList = async () => { |
| | | tableLoading.value = true |
| | | listSealApplication(page,sealSearchForm) |
| | | .then(res => { |
| | | |
| | | sealApplications.value = res.data.records |
| | | page.value.total = res.data.total; |
| | | tableLoading.value = false; |
| | | |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | } |
| | | // è·åè§ç« å¶åº¦åè¡¨æ°æ® |
| | | const getRegulationList = async () => { |
| | | tableLoading.value = true |
| | | listRuleManagement(page,regulationSearchForm) |
| | | .then(res => { |
| | | |
| | | regulations.value = res.data.records |
| | | // è¿æ»¤æå·²åºå¼çå¶åº¦ |
| | | // regulations.value = res.data.records.filter(item => item.status !== 'repealed') |
| | | page.value.total = res.data.total; |
| | | tableLoading.value = false; |
| | | |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | // åå§å |
| | | getSealApplicationList() |
| | | getRegulationList() |
| | | }) |
| | | </script> |
| | | |
| | |
| | | border-radius: 4px; |
| | | line-height: 1.6; |
| | | white-space: pre-wrap; |
| | | height: 200px; |
| | | } |
| | | |
| | | .dialog-footer { |
| | |
| | | <!-- æä½æé® --> |
| | | <div class="table-operations"> |
| | | <el-button type="primary" @click="handleAdd">æ°å¢é¢è¦è§å</el-button> |
| | | <el-button type="success" @click="handleBatchProcess">æ¹éå¤ç</el-button> |
| | | <!-- <el-button type="success" @click="handleBatchProcess">æ¹éå¤ç@</el-button> --> |
| | | <el-button @click="handleExport">导åº</el-button> |
| | | </div> |
| | | <el-table |
| | |
| | | <el-table-column fixed="right" label="æä½" width="200" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="handleEdit(scope.row)">ç¼è¾</el-button> |
| | | <el-button link type="success" size="small" @click="handleProcess(scope.row)">å¤ç</el-button> |
| | | <el-button link type="success" size="small" @click="handleProcess(scope.row)">å¤ç@</el-button> |
| | | <el-button link type="danger" size="small" @click="handleDelete(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import { WarningFilled } from '@element-plus/icons-vue' |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | // 注éæAPI导å
¥ï¼ä½¿ç¨åæ°æ® |
| | | // import { |
| | | // getStockWarningPage, |
| | | // addStockWarning, |
| | | // updateStockWarning, |
| | | // deleteStockWarning, |
| | | // batchProcessStockWarning, |
| | | // exportStockWarning, |
| | | // toggleStockWarningStatus |
| | | // } from '@/api/inventoryManagement/stockWarning.js' |
| | | import { |
| | | getStockWarningPage, |
| | | addStockWarning, |
| | | updateStockWarning, |
| | | deleteStockWarning, |
| | | batchProcessStockWarning, |
| | | exportStockWarning, |
| | | toggleStockWarningStatus |
| | | } from '@/api/inventoryManagement/stockWarning.js' |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | |
| | | // å页忰 |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10 |
| | | size: 10, |
| | | total: 0 |
| | | }) |
| | | |
| | | // æç´¢è¡¨å |
| | |
| | | // è¿éå¯ä»¥è°ç¨å¤çAPI |
| | | } |
| | | |
| | | |
| | | |
| | | // çæåæ°æ® |
| | | const generateMockData = () => { |
| | | const mockData = [ |
| | | { |
| | | id: 1, |
| | | tankCode: 'TANK001', |
| | | tankName: 'æ¶²åæ°å¨ç½A', |
| | | tankType: 'æ¶²åæ°å¨ç½', |
| | | specificationModel: 'LPG-5000L', |
| | | volume: 5000, |
| | | currentGasLevel: 15, |
| | | safetyGasLevel: 30, |
| | | minGasLevel: 10, |
| | | maxGasLevel: 95, |
| | | currentPressure: 2.5, |
| | | warningType: 'æ°ä½ä¸è¶³', |
| | | warningLevel: 'ç´§æ¥', |
| | | warningThreshold: 20, |
| | | isEnabled: true, |
| | | warningTime: '2025-01-15 08:30:00', |
| | | warningDuration: 3, |
| | | lastUpdateTime: '2025-01-15 10:00:00', |
| | | expectedRefillTime: '2025-01-16 14:00:00', |
| | | expectedShortageTime: '2025-01-15 18:30:00', // ä»å¤©ä¸å6:30ç¼ºæ° |
| | | warningRule: '彿°ä½éä½äº20%æ¶è§¦åé¢è¦' |
| | | }, |
| | | { |
| | | id: 2, |
| | | tankCode: 'TANK002', |
| | | tankName: 'å缩æ°å¨ç½B', |
| | | tankType: 'å缩æ°å¨ç½', |
| | | specificationModel: 'COMP-3000L', |
| | | volume: 3000, |
| | | currentGasLevel: 45, |
| | | safetyGasLevel: 25, |
| | | minGasLevel: 15, |
| | | maxGasLevel: 90, |
| | | currentPressure: 8.2, |
| | | warningType: 'ååå¼å¸¸', |
| | | warningLevel: 'éè¦', |
| | | warningThreshold: 10, |
| | | isEnabled: true, |
| | | warningTime: '2025-01-14 16:20:00', |
| | | warningDuration: 2, |
| | | lastUpdateTime: '2025-01-15 09:15:00', |
| | | expectedRefillTime: '2025-01-17 09:00:00', |
| | | expectedShortageTime: '2025-01-18 12:00:00', // 3天åç¼ºæ° |
| | | warningRule: 'å½ååè¶
è¿8MPaæ¶è§¦åé¢è¦' |
| | | }, |
| | | { |
| | | id: 3, |
| | | tankCode: 'TANK003', |
| | | tankName: 'å¤©ç¶æ°å¨ç½C', |
| | | tankType: 'å¤©ç¶æ°å¨ç½', |
| | | specificationModel: 'NG-8000L', |
| | | volume: 8000, |
| | | currentGasLevel: 75, |
| | | safetyGasLevel: 20, |
| | | minGasLevel: 10, |
| | | maxGasLevel: 95, |
| | | currentPressure: 4.8, |
| | | warningType: '温度å¼å¸¸', |
| | | warningLevel: 'ä¸è¬', |
| | | warningThreshold: 5, |
| | | isEnabled: true, |
| | | warningTime: '2025-01-13 11:45:00', |
| | | warningDuration: 1, |
| | | lastUpdateTime: '2025-01-15 08:45:00', |
| | | expectedRefillTime: '2025-01-20 10:00:00', |
| | | expectedShortageTime: '2025-01-22 15:30:00', // 7天åç¼ºæ° |
| | | warningRule: '彿¸©åº¦è¶
è¿60°Cæ¶è§¦åé¢è¦' |
| | | }, |
| | | { |
| | | id: 4, |
| | | tankCode: 'TANK004', |
| | | tankName: 'æ°§æ°å¨ç½D', |
| | | tankType: 'æ°§æ°å¨ç½', |
| | | specificationModel: 'O2-2000L', |
| | | volume: 2000, |
| | | currentGasLevel: 8, |
| | | safetyGasLevel: 25, |
| | | minGasLevel: 5, |
| | | maxGasLevel: 90, |
| | | currentPressure: 6.5, |
| | | warningType: 'æ³æ¼é¢è¦', |
| | | warningLevel: 'ç´§æ¥', |
| | | warningThreshold: 15, |
| | | isEnabled: true, |
| | | warningTime: '2025-01-15 07:15:00', |
| | | warningDuration: 4, |
| | | lastUpdateTime: '2025-01-15 11:30:00', |
| | | expectedRefillTime: '2025-01-15 16:00:00', |
| | | expectedShortageTime: '2025-01-15 14:00:00', // ä»å¤©ä¸å2ç¹ç¼ºæ° |
| | | warningRule: '彿£æµå°æ°ä½æ³æ¼æ¶è§¦åé¢è¦' |
| | | }, |
| | | { |
| | | id: 5, |
| | | tankCode: 'TANK005', |
| | | tankName: 'æ¶²åæ°å¨ç½E', |
| | | tankType: 'æ¶²åæ°å¨ç½', |
| | | specificationModel: 'LPG-6000L', |
| | | volume: 6000, |
| | | currentGasLevel: 35, |
| | | safetyGasLevel: 30, |
| | | minGasLevel: 15, |
| | | maxGasLevel: 95, |
| | | currentPressure: 3.2, |
| | | warningType: 'æ°ä½ä¸è¶³', |
| | | warningLevel: 'éè¦', |
| | | warningThreshold: 20, |
| | | isEnabled: false, |
| | | warningTime: '2025-01-14 14:30:00', |
| | | warningDuration: 2, |
| | | lastUpdateTime: '2025-01-15 09:00:00', |
| | | expectedRefillTime: '2025-01-19 08:00:00', |
| | | expectedShortageTime: '2025-01-21 10:00:00', // 6天åç¼ºæ° |
| | | warningRule: '彿°ä½éä½äº20%æ¶è§¦åé¢è¦' |
| | | }, |
| | | { |
| | | id: 6, |
| | | tankCode: 'TANK006', |
| | | tankName: 'å缩æ°å¨ç½F', |
| | | tankType: 'å缩æ°å¨ç½', |
| | | specificationModel: 'COMP-4000L', |
| | | volume: 4000, |
| | | currentGasLevel: 85, |
| | | safetyGasLevel: 20, |
| | | minGasLevel: 10, |
| | | maxGasLevel: 90, |
| | | currentPressure: 7.8, |
| | | warningType: 'ååå¼å¸¸', |
| | | warningLevel: 'ä¸è¬', |
| | | warningThreshold: 8, |
| | | isEnabled: true, |
| | | warningTime: '2025-01-12 09:20:00', |
| | | warningDuration: 1, |
| | | lastUpdateTime: '2025-01-15 08:30:00', |
| | | expectedRefillTime: '2025-01-25 14:00:00', |
| | | expectedShortageTime: '2025-01-28 16:00:00', // 13天åç¼ºæ° |
| | | warningRule: 'å½ååè¶
è¿8MPaæ¶è§¦åé¢è¦' |
| | | }, |
| | | { |
| | | id: 7, |
| | | tankCode: 'TANK007', |
| | | tankName: 'å¤©ç¶æ°å¨ç½G', |
| | | tankType: 'å¤©ç¶æ°å¨ç½', |
| | | specificationModel: 'NG-10000L', |
| | | volume: 10000, |
| | | currentGasLevel: 92, |
| | | safetyGasLevel: 15, |
| | | minGasLevel: 8, |
| | | maxGasLevel: 95, |
| | | currentPressure: 5.2, |
| | | warningType: '温度å¼å¸¸', |
| | | warningLevel: 'éè¦', |
| | | warningThreshold: 6, |
| | | isEnabled: true, |
| | | warningTime: '2025-01-11 16:45:00', |
| | | warningDuration: 1, |
| | | lastUpdateTime: '2025-01-15 07:45:00', |
| | | expectedRefillTime: '2025-01-30 09:00:00', |
| | | expectedShortageTime: '2025-02-05 12:00:00', // 21天åç¼ºæ° |
| | | warningRule: '彿¸©åº¦è¶
è¿60°Cæ¶è§¦åé¢è¦' |
| | | }, |
| | | { |
| | | id: 8, |
| | | tankCode: 'TANK008', |
| | | tankName: 'æ°§æ°å¨ç½H', |
| | | tankType: 'æ°§æ°å¨ç½', |
| | | specificationModel: 'O2-1500L', |
| | | volume: 1500, |
| | | currentGasLevel: 12, |
| | | safetyGasLevel: 30, |
| | | minGasLevel: 8, |
| | | maxGasLevel: 90, |
| | | currentPressure: 4.5, |
| | | warningType: 'æ³æ¼é¢è¦', |
| | | warningLevel: 'ç´§æ¥', |
| | | warningThreshold: 12, |
| | | isEnabled: true, |
| | | warningTime: '2025-01-15 06:30:00', |
| | | warningDuration: 5, |
| | | lastUpdateTime: '2025-01-15 12:15:00', |
| | | expectedRefillTime: '2025-01-15 20:00:00', |
| | | expectedShortageTime: '2025-01-15 17:30:00', // ä»å¤©ä¸å5:30ç¼ºæ° |
| | | warningRule: '彿£æµå°æ°ä½æ³æ¼æ¶è§¦åé¢è¦' |
| | | } |
| | | ] |
| | | |
| | | // æ ¹æ®æç´¢æ¡ä»¶è¿æ»¤æ°æ® |
| | | let filteredData = mockData.filter(item => { |
| | | if (searchForm.tankName && !item.tankName.includes(searchForm.tankName)) return false |
| | | if (searchForm.tankType && item.tankType !== searchForm.tankType) return false |
| | | if (searchForm.warningType && item.warningType !== searchForm.warningType) return false |
| | | if (searchForm.warningLevel && item.warningLevel !== searchForm.warningLevel) return false |
| | | return true |
| | | }) |
| | | |
| | | // å页å¤ç |
| | | const start = (page.current - 1) * page.size |
| | | const end = start + page.size |
| | | const paginatedData = filteredData.slice(start, end) |
| | | |
| | | return { |
| | | records: paginatedData, |
| | | total: filteredData.length |
| | | } |
| | | } |
| | | |
| | | // è·ååè¡¨æ°æ® |
| | | const getList = async () => { |
| | | tableLoading.value = true |
| | | try { |
| | | // 模æç½ç»å»¶è¿ |
| | | await new Promise(resolve => setTimeout(resolve, 500)) |
| | | getStockWarningPage(page, searchForm) |
| | | .then(res => { |
| | | |
| | | const result = generateMockData() |
| | | tableData.value = result.records |
| | | total.value = result.total |
| | | |
| | | tableData.value = res.data.records |
| | | page.value.total = res.data.total; |
| | | tableLoading.value = false; |
| | | // æ£æ¥ç¼ºæ°é¢è¦ |
| | | checkShortageWarnings() |
| | | } catch (error) { |
| | | console.error('è·åå表失败:', error) |
| | | ElMessage.error('è·åå表失败') |
| | | } finally { |
| | | tableLoading.value = false |
| | | } |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | } |
| | | |
| | | // æç´¢ |
| | |
| | | // æ°å¢ |
| | | const handleAdd = () => { |
| | | operationType.value = 'add' |
| | | resetForm() |
| | | // resetForm() |
| | | dialogFormVisible.value = true |
| | | } |
| | | |
| | |
| | | // 模æAPIè°ç¨å»¶è¿ |
| | | await new Promise(resolve => setTimeout(resolve, 300)) |
| | | ElMessage.success(`æ£å¨å¤çé¢è¦ï¼${row.tankName}`) |
| | | getList() |
| | | // getList() |
| | | } catch (error) { |
| | | ElMessage.error('å¤çé¢è¦å¤±è´¥') |
| | | } |
| | |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }) |
| | | |
| | | // 模æAPIè°ç¨å»¶è¿ |
| | | await new Promise(resolve => setTimeout(resolve, 300)) |
| | | ElMessage.success('å 餿å') |
| | | getList() |
| | | let ids = []; |
| | | ids.push(row.id); |
| | | deleteStockWarning(ids).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("å 餿å"); |
| | | ids.value = []; |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | // // 模æAPIè°ç¨å»¶è¿ |
| | | // await new Promise(resolve => setTimeout(resolve, 300)) |
| | | // ElMessage.success('å 餿å') |
| | | // getList() |
| | | } catch (error) { |
| | | if (error !== 'cancel') { |
| | | ElMessage.error('å é¤å¤±è´¥') |
| | |
| | | |
| | | // å¯¼åº |
| | | const handleExport = async () => { |
| | | try { |
| | | // 模æAPIè°ç¨å»¶è¿ |
| | | await new Promise(resolve => setTimeout(resolve, 800)) |
| | | // if (selectedRows.value.length === 0) { |
| | | // exportStockWarning().then(res => { |
| | | // // // å建ä¸è½½é¾æ¥ |
| | | // // const blob = new Blob([res.data], { type: 'text/csv;charset=utf-8;' }) |
| | | // // const url = window.URL.createObjectURL(blob) |
| | | // // const link = document.createElement('a') |
| | | // // link.href = url |
| | | // // link.download = `卿°ç½é¢è¦æ°æ®_${new Date().getTime()}.csv` |
| | | // // link.click() |
| | | // // window.URL.revokeObjectURL(url) |
| | | // }).catch(err => { |
| | | // ElMessage.error(err.msg); |
| | | // }) |
| | | // }else{ |
| | | // let ids = []; |
| | | // selectedRows.value.forEach(item => { |
| | | // ids.push(item.id); |
| | | // }) |
| | | // exportStockWarning(ids).then(res => { |
| | | // // // å建ä¸è½½é¾æ¥ |
| | | // // const blob = new Blob([res.data], { type: 'text/csv;charset=utf-8;' }) |
| | | // // const url = window.URL.createObjectURL(blob) |
| | | // // const link = document.createElement('a') |
| | | // // link.href = url |
| | | // // link.download = `卿°ç½é¢è¦æ°æ®_${new Date().getTime()}.csv` |
| | | // // link.click() |
| | | // // window.URL.revokeObjectURL(url) |
| | | // }).catch(err => { |
| | | // ElMessage.error(err.msg); |
| | | // }) |
| | | // } |
| | | |
| | | // çæå¯¼åºæ°æ® |
| | | const exportData = generateMockData().records |
| | | const csvContent = generateCSV(exportData) |
| | | |
| | | // å建ä¸è½½é¾æ¥ |
| | | const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' }) |
| | | const url = window.URL.createObjectURL(blob) |
| | | const link = document.createElement('a') |
| | | link.href = url |
| | | link.download = `卿°ç½é¢è¦æ°æ®_${new Date().getTime()}.csv` |
| | | link.click() |
| | | window.URL.revokeObjectURL(url) |
| | | |
| | | ElMessage.success('å¯¼åºæå') |
| | | } catch (error) { |
| | | ElMessage.error('导åºå¤±è´¥') |
| | | } |
| | | } |
| | | |
| | | // çæCSVå
容 |
| | | const generateCSV = (data) => { |
| | | const headers = [ |
| | | '卿°ç½ç¼ç ', '卿°ç½åç§°', '卿°ç½ç±»å', 'è§æ ¼åå·', '容积(m³)', |
| | | 'å½åæ°ä½é(%)', 'å®å
¨æ°ä½é(%)', 'æä½æ°ä½é(%)', 'æé«æ°ä½é(%)', |
| | | 'å½ååå(MPa)', 'é¢è¦ç±»å', 'é¢è¦çº§å«', 'é¢è¦éå¼', 'æ¯å¦å¯ç¨', |
| | | 'é¢è¦æ¶é´', 'é¢è¦æç»å¤©æ°', 'æåæ´æ°æ¶é´', 'é¢è®¡å
è£
æ¶é´', 'é¢è®¡ç¼ºæ°æ¶é´', 'é¢è¦è§åæè¿°' |
| | | ] |
| | | |
| | | const csvRows = [headers.join(',')] |
| | | |
| | | data.forEach(item => { |
| | | const row = [ |
| | | item.tankCode, |
| | | item.tankName, |
| | | item.tankType, |
| | | item.specificationModel, |
| | | item.volume, |
| | | item.currentGasLevel, |
| | | item.safetyGasLevel, |
| | | item.minGasLevel, |
| | | item.maxGasLevel, |
| | | item.currentPressure, |
| | | item.warningType, |
| | | item.warningLevel, |
| | | item.warningThreshold, |
| | | item.isEnabled ? 'æ¯' : 'å¦', |
| | | item.warningTime, |
| | | item.warningDuration, |
| | | item.lastUpdateTime, |
| | | item.expectedRefillTime, |
| | | item.expectedShortageTime, |
| | | item.warningRule |
| | | ] |
| | | csvRows.push(row.join(',')) |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | |
| | | return csvRows.join('\n') |
| | | .then(() => { |
| | | proxy.download("/gasTankWarning/export", {ids: selectedRows.value.map(item => item.id)}, "卿°ç½é¢è¦.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | } |
| | | |
| | | // å¯ç¨ç¶æåå |
| | | |
| | | |
| | | // // å¯ç¨ç¶æåå |
| | | const handleEnableChange = async (row) => { |
| | | |
| | | try { |
| | | // 模æAPIè°ç¨å»¶è¿ |
| | | await new Promise(resolve => setTimeout(resolve, 200)) |
| | | ElMessage.success(`${row.tankName} çå¯ç¨ç¶æå·²æ´æ°`) |
| | | updateStockWarning(row).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success(`${row.tankName} çå¯ç¨ç¶æå·²æ´æ°`); |
| | | getList(); |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | } catch (error) { |
| | | ElMessage.error('ç¶ææ´æ°å¤±è´¥') |
| | | // æ¢å¤åç¶æ |
| | |
| | | await proxy.$refs.formRef.validate() |
| | | |
| | | // 模æAPIè°ç¨å»¶è¿ |
| | | await new Promise(resolve => setTimeout(resolve, 500)) |
| | | // await new Promise(resolve => setTimeout(resolve, 500)) |
| | | |
| | | if (operationType.value === 'add') { |
| | | ElMessage.success('æ°å¢æå') |
| | | addStockWarning(form).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ·»å æå"); |
| | | dialogFormVisible.value = false |
| | | getList() |
| | | resetForm() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | |
| | | // ElMessage.success('æ°å¢æå') |
| | | } else { |
| | | ElMessage.success('ç¼è¾æå') |
| | | updateStockWarning(form).then(res => { |
| | | if(res.code == 200){ |
| | | ElMessage.success("æ´æ°æå"); |
| | | dialogFormVisible.value = false |
| | | getList() |
| | | resetForm() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg); |
| | | }) |
| | | // ElMessage.success('ç¼è¾æå') |
| | | } |
| | | |
| | | closeDialog() |
| | | getList() |
| | | // closeDialog() |
| | | // getList() |
| | | } catch (error) { |
| | | if (!error.errors) { |
| | | ElMessage.error(operationType.value === 'add' ? 'æ°å¢å¤±è´¥' : 'ç¼è¾å¤±è´¥') |
| | |
| | | // å
³éå¼¹çª |
| | | const closeDialog = () => { |
| | | dialogFormVisible.value = false |
| | | resetForm() |
| | | // resetForm() |
| | | } |
| | | |
| | | // é置表å |
| | |
| | | <style lang='scss' scoped>
|
| | | .login {
|
| | | height: 100%;
|
| | | background-image: url("../assets/indexViews/XYHBView.png");
|
| | | background-image: url("../assets/indexViews/JZYJView.png");
|
| | | background-size: cover;
|
| | | position: relative;
|
| | | }
|
| | |
| | | <el-form :inline="true" :model="filterForm" class="filter-form"> |
| | | <el-form-item label="åå·¥å§åï¼"> |
| | | <el-input |
| | | v-model="filterForm.employeeName" |
| | | v-model="filterForm.staffName" |
| | | placeholder="请è¾å
¥åå·¥å§å" |
| | | clearable |
| | | style="width: 150px" |
| | |
| | | </el-form-item> |
| | | <el-form-item label="çæ¬¡ç±»åï¼"> |
| | | <el-select v-model="filterForm.shiftType" placeholder="è¯·éæ©çæ¬¡" clearable style="width: 120px"> |
| | | <el-option label="æ©ç" value="æ©ç" /> |
| | | <el-option label="ä¸ç" value="ä¸ç" /> |
| | | <el-option label="æç" value="æç" /> |
| | | <el-option label="å¤ç" value="å¤ç" /> |
| | | <el-option v-for="item in shift_type" :label="item.label" :value="item.value" :key="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¥æèå´ï¼"> |
| | |
| | | <!-- æçè¡¨æ ¼ --> |
| | | <div class="table-section"> |
| | | <el-table |
| | | :data="filteredScheduleList" |
| | | :data="scheduleList" |
| | | border |
| | | :loading="tableLoading" |
| | | stripe |
| | | style="width: 100%" |
| | | height="calc(100vh - 18.5em)" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column prop="employeeName" label="åå·¥å§å" width="120" /> |
| | | <el-table-column prop="employeeId" label="å工工å·" width="100" /> |
| | | <el-table-column prop="department" label="é¨é¨" width="120" /> |
| | | <el-table-column prop="staffName" label="åå·¥å§å" width="120"/> |
| | | <el-table-column prop="staffNo" label="å工工å·" width="100"/> |
| | | <el-table-column prop="department" label="é¨é¨" width="120"> |
| | | <template #default="scope"> |
| | | {{ (department_type.find(i => i.value === String(scope.row.department)) || {}).label }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="shiftType" label="çæ¬¡ç±»å" width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getShiftTagType(scope.row.shiftType)"> |
| | | {{ scope.row.shiftType }} |
| | | {{ (shift_type.find(i => i.value === String(scope.row.shiftType)) || {}).label }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-table-column prop="status" label="ç¶æ" width="100"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTagType(scope.row.status)"> |
| | | {{ scope.row.status }} |
| | | {{ (schedule_status.find(i => i.value === String(scope.row.status)) || {}).label }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-if="tableCount > 0" |
| | | :total="tableCount" |
| | | :page="filterForm.current" |
| | | :limit="filterForm.size" |
| | | @pagination="paginationChange" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- æ¹éæä½ --> |
| | |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åå·¥å§åï¼" prop="employeeName"> |
| | | <el-input v-model="scheduleForm.employeeName" placeholder="请è¾å
¥åå·¥å§å" /> |
| | | <el-form-item label="åå·¥å§åï¼" prop="staffId"> |
| | | <el-select v-model="scheduleForm.staffId" placeholder="请è¾å
¥åå·¥å§å" style="width: 100%" |
| | | @change="handleSelectStaff"> |
| | | <el-option v-for="item in personList" :label="item.staffName" :value="item.id" :key="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å工工å·ï¼" prop="employeeId"> |
| | | <el-input v-model="scheduleForm.employeeId" placeholder="请è¾å
¥å工工å·" /> |
| | | <el-form-item label="å工工å·ï¼" prop="staffNo"> |
| | | <el-input :disabled="true" v-model="scheduleForm.staffNo" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="é¨é¨ï¼" prop="department"> |
| | | <el-select v-model="scheduleForm.department" placeholder="è¯·éæ©é¨é¨" style="width: 100%"> |
| | | <el-option label="ææ¯é¨" value="ææ¯é¨" /> |
| | | <el-option label="éå®é¨" value="éå®é¨" /> |
| | | <el-option label="人äºé¨" value="人äºé¨" /> |
| | | <el-option label="è´¢å¡é¨" value="è´¢å¡é¨" /> |
| | | <el-option label="ç产é¨" value="ç产é¨" /> |
| | | <el-option v-for="item in department_type" :label="item.label" :value="item.value" :key="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="çæ¬¡ç±»åï¼" prop="shiftType"> |
| | | <el-select v-model="scheduleForm.shiftType" placeholder="è¯·éæ©çæ¬¡" style="width: 100%"> |
| | | <el-option label="æ©ç" value="æ©ç" /> |
| | | <el-option label="ä¸ç" value="ä¸ç" /> |
| | | <el-option label="æç" value="æç" /> |
| | | <el-option label="å¤ç" value="å¤ç" /> |
| | | <el-option v-for="item in shift_type" :label="item.label" :value="item.value" :key="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¶æï¼" prop="status"> |
| | | <el-select v-model="scheduleForm.status" placeholder="è¯·éæ©ç¶æ" style="width: 100%"> |
| | | <el-option label="已宿" value="已宿" /> |
| | | <el-option label="已确认" value="已确认" /> |
| | | <el-option label="已宿" value="已宿" /> |
| | | <el-option label="已忶" value="已忶" /> |
| | | <el-option v-for="item in schedule_status" :label="item.label" :value="item.value" :key="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <script setup> |
| | | import { ref, reactive, computed, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import {useDict} from "@/utils/dict.js" |
| | | import { Plus, Download, Search, Refresh } from '@element-plus/icons-vue' |
| | | import {save, del, delByIds, listPage} from "@/api/personnelManagement/scheduling.js" |
| | | import {getStaffOnJob} from "@/api/personnelManagement/onboarding.js"; |
| | | import dayjs from "dayjs"; |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | |
| | | const tableCount = ref(0) |
| | | // ååºå¼æ°æ® |
| | | const scheduleDialog = ref(false) |
| | | const dialogType = ref('add') |
| | |
| | | |
| | | // çé表å |
| | | const filterForm = reactive({ |
| | | employeeName: '', |
| | | staffName: '', |
| | | shiftType: '', |
| | | dateRange: [] |
| | | dateRange: [], |
| | | current:1, |
| | | size: 10 |
| | | }) |
| | | |
| | | // æç表å |
| | | const scheduleForm = reactive({ |
| | | id: '', |
| | | employeeName: '', |
| | | employeeId: '', |
| | | staffId: '', |
| | | staffNo: '', |
| | | department: '', |
| | | shiftType: '', |
| | | workDate: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | workStartTime: '', |
| | | workEndTime: '', |
| | | workHours: 0, |
| | | status: '已宿', |
| | | status: '', |
| | | remark: '' |
| | | }) |
| | | |
| | | // 表åéªè¯è§å |
| | | const scheduleRules = reactive({ |
| | | employeeName: [{ required: true, message: '请è¾å
¥åå·¥å§å', trigger: 'blur' }], |
| | | employeeId: [{ required: true, message: '请è¾å
¥å工工å·', trigger: 'blur' }], |
| | | staffId: [{required: true, message: 'è¯·éæ©åå·¥', trigger: 'change'}], |
| | | department: [{ required: true, message: 'è¯·éæ©é¨é¨', trigger: 'change' }], |
| | | shiftType: [{ required: true, message: 'è¯·éæ©çæ¬¡ç±»å', trigger: 'change' }], |
| | | workDate: [{ required: true, message: 'è¯·éæ©å·¥ä½æ¥æ', trigger: 'change' }], |
| | |
| | | endTime: [{ required: true, message: 'è¯·éæ©ç»ææ¶é´', trigger: 'change' }], |
| | | status: [{ required: true, message: 'è¯·éæ©ç¶æ', trigger: 'change' }] |
| | | }) |
| | | const tableLoading = ref(false) |
| | | |
| | | //åå
¸ |
| | | const {department_type, schedule_status, shift_type} = useDict("department_type", "schedule_status", "shift_type") |
| | | // 人åå表 |
| | | const personList = ref([]); |
| | | |
| | | // 模ææçæ°æ® |
| | | const scheduleList = ref([ |
| | | { |
| | | id: 1, |
| | | employeeName: 'å¼ æµ·æ´', |
| | | employeeId: 'EMP001', |
| | | department: 'ææ¯é¨', |
| | | shiftType: 'æ©ç', |
| | | workDate: '2024-01-15', |
| | | startTime: '08:00', |
| | | endTime: '17:00', |
| | | workHours: 9, |
| | | status: '已宿', |
| | | remark: 'æ£å¸¸æç' |
| | | }, |
| | | { |
| | | id: 2, |
| | | employeeName: 'æè¶
', |
| | | employeeId: 'EMP002', |
| | | department: 'éå®é¨', |
| | | shiftType: 'ä¸ç', |
| | | workDate: '2024-01-15', |
| | | startTime: '14:00', |
| | | endTime: '22:00', |
| | | workHours: 8, |
| | | status: '已确认', |
| | | remark: '客æ·ä¼è®®' |
| | | }, |
| | | { |
| | | id: 3, |
| | | employeeName: 'çæ°', |
| | | employeeId: 'EMP003', |
| | | department: 'ç产é¨', |
| | | shiftType: 'æç', |
| | | workDate: '2024-01-15', |
| | | startTime: '22:00', |
| | | endTime: '06:00', |
| | | workHours: 8, |
| | | status: '已宿', |
| | | remark: 'å¤çç产' |
| | | } |
| | | ]) |
| | | const scheduleList = ref([]) |
| | | |
| | | // 计ç®å±æ§ï¼çéåçæçå表 |
| | | const filteredScheduleList = computed(() => { |
| | | let result = scheduleList.value |
| | | |
| | | if (filterForm.employeeName) { |
| | | result = result.filter(item => |
| | | item.employeeName.includes(filterForm.employeeName) |
| | | ) |
| | | } |
| | | |
| | | if (filterForm.shiftType) { |
| | | result = result.filter(item => item.shiftType === filterForm.shiftType) |
| | | } |
| | | |
| | | if (filterForm.dateRange && filterForm.dateRange.length === 2) { |
| | | result = result.filter(item => { |
| | | const workDate = new Date(item.workDate) |
| | | const startDate = new Date(filterForm.dateRange[0]) |
| | | const endDate = new Date(filterForm.dateRange[1]) |
| | | return workDate >= startDate && workDate <= endDate |
| | | /** |
| | | * è·åå½åå¨è人åå表 |
| | | */ |
| | | const getPersonList = () => { |
| | | getStaffOnJob().then(res => { |
| | | personList.value = res.data |
| | | }) |
| | | } |
| | | }; |
| | | const paginationChange = (obj) => { |
| | | filterForm.current = obj.page; |
| | | filterForm.size = obj.limit; |
| | | handleFilter(); |
| | | }; |
| | | |
| | | return result |
| | | }) |
| | | const handleSelectStaff = (val) => { |
| | | let obj = personList.value.find(item => item.id === val) |
| | | scheduleForm.staffNo = obj.staffNo |
| | | |
| | | } |
| | | |
| | | // è·åçæ¬¡æ ç¾ç±»å |
| | | const getShiftTagType = (shiftType) => { |
| | | const typeMap = { |
| | | 'æ©ç': 'success', |
| | | 'ä¸ç': 'warning', |
| | | 'æç': 'info', |
| | | 'å¤ç': 'danger' |
| | | } |
| | | const typeMap = Object.fromEntries(shift_type.value.map(i => [i.value, i.elTagType])) |
| | | return typeMap[shiftType] || 'info' |
| | | } |
| | | |
| | | // è·åç¶ææ ç¾ç±»å |
| | | const getStatusTagType = (status) => { |
| | | const typeMap = { |
| | | '已宿': 'info', |
| | | '已确认': 'warning', |
| | | '已宿': 'success', |
| | | '已忶': 'danger' |
| | | } |
| | | const typeMap = Object.fromEntries(schedule_status.value.map(i => [i.value, i.elTagType])) |
| | | return typeMap[status] || 'info' |
| | | } |
| | | |
| | | // çé |
| | | const handleFilter = () => { |
| | | // çéé»è¾å·²å¨è®¡ç®å±æ§ä¸å®ç° |
| | | const handleFilter = async () => { |
| | | tableLoading.value = true |
| | | let searchForm = { |
| | | ...filterForm, |
| | | ...(filterForm.dateRange.length > 0 && { |
| | | startDate: filterForm.dateRange[0], |
| | | endDate: filterForm.dateRange[1], |
| | | }) |
| | | } |
| | | let resp = await listPage(searchForm) |
| | | tableCount.value = resp.data.total |
| | | scheduleList.value = resp.data.records.map(it => { |
| | | return { |
| | | ...it, |
| | | 'startTime': dayjs(it.workStartTime).format('HH:mm'), |
| | | 'endTime': dayjs(it.workEndTime).format('HH:mm'), |
| | | } |
| | | }) |
| | | tableLoading.value = false |
| | | |
| | | } |
| | | |
| | | // éç½®çé |
| | | const resetFilter = () => { |
| | | filterForm.employeeName = '' |
| | | filterForm.staffName = '' |
| | | filterForm.shiftType = '' |
| | | filterForm.dateRange = [] |
| | | } |
| | |
| | | const openScheduleDialog = (type, data) => { |
| | | dialogType.value = type |
| | | scheduleDialog.value = true |
| | | |
| | | getPersonList() |
| | | if (type === 'edit' && data) { |
| | | // ç¼è¾æ¨¡å¼ï¼å¤å¶æ°æ® |
| | | Object.assign(scheduleForm, { ...data }) |
| | |
| | | Object.keys(scheduleForm).forEach(key => { |
| | | scheduleForm[key] = '' |
| | | }) |
| | | scheduleForm.status = '已宿' |
| | | // scheduleForm.status = '已宿' |
| | | scheduleForm.workDate = new Date().toISOString().split('T')[0] |
| | | } |
| | | } |
| | |
| | | |
| | | // 计ç®å·¥ä½æ¶é¿ |
| | | const calculateWorkHours = () => { |
| | | if (scheduleForm.startTime && scheduleForm.endTime) { |
| | | const start = new Date(`2000-01-01 ${scheduleForm.startTime}`) |
| | | const end = new Date(`2000-01-01 ${scheduleForm.endTime}`) |
| | | if (scheduleForm.workDate && scheduleForm.startTime && scheduleForm.endTime) { |
| | | // ä½¿ç¨ workDate ä¸ startTime å endTime ç»å |
| | | const startDateTime = new Date(`${scheduleForm.workDate} ${scheduleForm.startTime}`) |
| | | const endDateTime = new Date(`${scheduleForm.workDate} ${scheduleForm.endTime}`) |
| | | |
| | | if (end < start) { |
| | | // 跨天çæ
åµ |
| | | end.setDate(end.getDate() + 1) |
| | | // å¤ç跨天æ
åµï¼ç»ææ¶é´æ©äºå¼å§æ¶é´ï¼ |
| | | if (endDateTime < startDateTime) { |
| | | // 跨天ï¼å°ç»ææ¥æå ä¸å¤© |
| | | endDateTime.setDate(endDateTime.getDate() + 1) |
| | | } |
| | | |
| | | const diffMs = end - start |
| | | // 计ç®å·¥ä½æ¶é¿ï¼å°æ¶ï¼ |
| | | const diffMs = endDateTime - startDateTime |
| | | const diffHours = diffMs / (1000 * 60 * 60) |
| | | scheduleForm.workHours = Math.round(diffHours * 100) / 100 |
| | | scheduleForm.workStartTime = dayjs(startDateTime).format("YYYY-MM-DD HH:mm:ss") |
| | | scheduleForm.workEndTime = dayjs(endDateTime).format("YYYY-MM-DD HH:mm:ss") |
| | | |
| | | } |
| | | } |
| | | |
| | | // æäº¤æç表å |
| | | const submitScheduleForm = () => { |
| | | scheduleFormRef.value.validate((valid) => { |
| | | if (valid) { |
| | | // 计ç®å·¥ä½æ¶é¿ |
| | | const submitScheduleForm = async () => { |
| | | const valid = await scheduleFormRef.value.validate() |
| | | if (!valid) return |
| | | |
| | | calculateWorkHours() |
| | | const newSchedule = {...scheduleForm} |
| | | |
| | | if (dialogType.value === 'add') { |
| | | // æ°å¢ |
| | | const newSchedule = { |
| | | ...scheduleForm, |
| | | id: Date.now() // ä½¿ç¨æ¶é´æ³ä½ä¸ºä¸´æ¶ID |
| | | } |
| | | scheduleList.value.push(newSchedule) |
| | | ElMessage.success('æ°å¢æçæå') |
| | | } else { |
| | | // ç¼è¾ |
| | | const index = scheduleList.value.findIndex(item => item.id === scheduleForm.id) |
| | | if (index !== -1) { |
| | | scheduleList.value[index] = { ...scheduleForm } |
| | | ElMessage.success('ç¼è¾æçæå') |
| | | } |
| | | } |
| | | try { |
| | | await save(newSchedule) |
| | | ElMessage.success('ä¿åæçæå') |
| | | |
| | | handleFilter() |
| | | closeScheduleDialog() |
| | | } catch (err) { |
| | | ElMessage.error('ä¿å失败') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // å 餿ç |
| | | const handleDelete = (row) => { |
| | | ElMessageBox.confirm( |
| | | `ç¡®å®è¦å é¤ ${row.employeeName} çæçè®°å½åï¼`, |
| | | `ç¡®å®è¦å é¤ ${row.staffName} çæçè®°å½åï¼`, |
| | | 'å é¤æç¤º', |
| | | { |
| | | confirmButtonText: '确认', |
| | |
| | | type: 'warning' |
| | | } |
| | | ).then(() => { |
| | | const index = scheduleList.value.findIndex(item => item.id === row.id) |
| | | if (index !== -1) { |
| | | scheduleList.value.splice(index, 1) |
| | | del(row.id) |
| | | ElMessage.success('å 餿å') |
| | | } |
| | | handleFilter() |
| | | }).catch(() => { |
| | | ElMessage.info('已忶å é¤') |
| | | }) |
| | |
| | | type: 'warning' |
| | | } |
| | | ).then(() => { |
| | | const selectedIds = selectedRows.value.map(row => row.id) |
| | | scheduleList.value = scheduleList.value.filter(item => !selectedIds.includes(item.id)) |
| | | selectedRows.value = [] |
| | | delByIds(selectedRows.value.map(item => item.id)) |
| | | handleFilter() |
| | | ElMessage.success('æ¹éå 餿å') |
| | | }).catch(() => { |
| | | ElMessage.info('已忶å é¤') |
| | |
| | | selectedRows.value = selection |
| | | } |
| | | |
| | | // ç嬿¶é´ååï¼èªå¨è®¡ç®å·¥ä½æ¶é¿ |
| | | const watchTimeChange = () => { |
| | | if (scheduleForm.startTime && scheduleForm.endTime) { |
| | | calculateWorkHours() |
| | | } |
| | | } |
| | | |
| | | // çå½å¨æ |
| | | onMounted(() => { |
| | | // 页é¢åå§å |
| | | handleFilter() |
| | | }) |
| | | </script> |
| | | |
| | |
| | | <el-button type="primary" @click="addAttendanceRecord">æ°å¢è®°å½</el-button> |
| | | </div> |
| | | </template> |
| | | <el-table :data="attendanceData" style="width: 100%"> |
| | | <el-table :data="attendanceData" style="width: 100%" :loading="tableLoading"> |
| | | <el-table-column prop="date" label="æ¥æ" /> |
| | | <el-table-column prop="checkIn" label="ç¾å°æ¶é´" /> |
| | | <el-table-column prop="checkOut" label="ç¾éæ¶é´" /> |
| | |
| | | <el-table-column label="æä½" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="small" @click="editAttendanceRecord(scope.row)">ç¼è¾</el-button> |
| | | <el-button size="small" type="danger" @click="deleteAttendanceRecord(scope.$index)">å é¤</el-button> |
| | | <el-button size="small" type="danger" @click="deleteAttendanceRecord(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <template #header> |
| | | <div class="card-header"> |
| | | <span>èªèµåæ¥è¯¢</span> |
| | | <el-date-picker v-model="salaryMonth" type="month" placeholder="éæ©æä»½" /> |
| | | <el-date-picker v-model="payDateStr" type="month" placeholder="éæ©æä»½" value-format="YYYY-MM" format="YYYY-MM" @change="changMonth"/> |
| | | </div> |
| | | </template> |
| | | <el-table :data="salaryData" style="width: 100%"> |
| | | <el-table-column prop="month" label="æä»½" /> |
| | | <el-table-column prop="payDate" label="æä»½" /> |
| | | <el-table-column prop="basicSalary" label="åºæ¬å·¥èµ" /> |
| | | <el-table-column prop="bonus" label="å¥é" /> |
| | | <el-table-column prop="deduction" label="æ£æ¬¾" /> |
| | | <el-table-column prop="total" label="å®åå·¥èµ" /> |
| | | <el-table-column prop="actualWages" label="å®åå·¥èµ" /> |
| | | <el-table-column prop="status" label="ç¶æ" > |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.status === '已忾' ? 'success' : 'warning'"> |
| | |
| | | <template #header> |
| | | <div class="card-header"> |
| | | <span>åæç³è¯·ç®¡ç</span> |
| | | <el-button type="primary" @click="showLeaveDialog = true">ç³è¯·åæ</el-button> |
| | | <el-button type="primary" @click="openLeaveForm">ç³è¯·åæ</el-button> |
| | | </div> |
| | | </template> |
| | | <el-table :data="leaveData" style="width: 100%"> |
| | |
| | | <el-table-column label="æä½" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="small" @click="editLeaveRecord(scope.row)">ç¼è¾</el-button> |
| | | <el-button size="small" type="danger" @click="deleteLeaveRecord(scope.$index)">å é¤</el-button> |
| | | <el-button size="small" type="danger" @click="deleteLeaveRecord(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <template #header> |
| | | <div class="card-header"> |
| | | <span>个人信æ¯ç»´æ¤</span> |
| | | <el-button type="primary" @click="editProfile = true">ç¼è¾ä¿¡æ¯</el-button> |
| | | <el-button type="primary" @click="editProfileForm">ç¼è¾ä¿¡æ¯</el-button> |
| | | </div> |
| | | </template> |
| | | <el-descriptions :column="2" border> |
| | |
| | | <el-descriptions-item label="å
¥èæ¥æ">{{ profile.hireDate }}</el-descriptions-item> |
| | | <el-descriptions-item label="èç³»çµè¯">{{ profile.phone }}</el-descriptions-item> |
| | | <el-descriptions-item label="é®ç®±">{{ profile.email }}</el-descriptions-item> |
| | | <el-descriptions-item label="å°å">{{ profile.address }}</el-descriptions-item> |
| | | <el-descriptions-item label="å°å">{{ profile.adress }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </el-card> |
| | | </div> |
| | | |
| | | <!-- åæç³è¯·å¼¹çª --> |
| | | <el-dialog v-model="showLeaveDialog" title="ç³è¯·åæ" width="500px"> |
| | | <el-dialog v-model="showLeaveDialog" :title="leaveOperationType === 'add' ? 'ç³è¯·åæ' : 'ç¼è¾åæ'" width="500px"> |
| | | <el-form :model="leaveForm" label-width="100px"> |
| | | <el-form-item label="åæç±»å"> |
| | | <el-select v-model="leaveForm.type" placeholder="è¯·éæ©åæç±»å"> |
| | |
| | | <el-form-item label="ç³è¯·åå "> |
| | | <el-input v-model="leaveForm.reason" type="textarea" rows="3" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="审æ¹ç¶æ"> |
| | | <el-select v-model="leaveForm.status" placeholder="è¯·éæ©å®¡æ¹ç¶æ"> |
| | | <el-option label="审æ¹ä¸" value="审æ¹ä¸" /> |
| | | <el-option label="å·²éè¿" value="å·²éè¿" /> |
| | | <el-option label="å·²æç»" value="å·²æç»" /> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="showLeaveDialog = false">åæ¶</el-button> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- æ°å¢èå¤è®°å½å¼¹çª --> |
| | | <el-dialog v-model="showAttendanceDialog" title="æ°å¢èå¤è®°å½" width="500px"> |
| | | <!-- æ°å¢-ç¼è¾èå¤è®°å½å¼¹çª --> |
| | | <el-dialog v-model="showAttendanceDialog" :title="operationType === 'add' ? 'æ°å¢èå¤è®°å½' : 'ç¼è¾èå¤è®°å½'" width="500px"> |
| | | <el-form :model="attendanceForm" :rules="attendanceRules" ref="attendanceFormRef" label-width="100px"> |
| | | <el-form-item label="æ¥æ" prop="date"> |
| | | <el-date-picker v-model="attendanceForm.date" type="date" placeholder="éæ©æ¥æ" /> |
| | | <el-date-picker v-model="attendanceForm.date" type="date" value-format="YYYY-MM-DD" format="YYYY-MM-DD" placeholder="éæ©æ¥æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¾å°æ¶é´" prop="checkIn"> |
| | | <el-time-picker v-model="attendanceForm.checkIn" placeholder="éæ©ç¾å°æ¶é´" format="HH:mm" value-format="HH:mm" /> |
| | |
| | | <el-input v-model="profileForm.email" /> |
| | | </el-form-item> |
| | | <el-form-item label="å°å"> |
| | | <el-input v-model="profileForm.address" type="textarea" rows="2" /> |
| | | <el-input v-model="profileForm.adress" type="textarea" rows="2" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, watch } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ref, reactive, watch, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { |
| | | Calendar, |
| | | Money, |
| | | Clock, |
| | | User |
| | | } from '@element-plus/icons-vue' |
| | | import { personalAttendanceRecordsListPage, personalAttendanceRecordsAdd, personalAttendanceRecordsUpdate, personalAttendanceRecordsDelete, holidayApplicationListPage, holidayApplicationAdd, holidayApplicationUpdate, holidayApplicationDelete } from '@/api/personnelManagement/selfService' |
| | | import { compensationListPage, compensationAdd, compensationUpdate, compensationDelete } from '@/api/personnelManagement/payrollManagement' |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | import { getUserProfile } from '@/api/system/user.js' |
| | | import {staffJoinUpdate, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; |
| | | import { fa, id } from 'element-plus/es/locales.mjs' |
| | | |
| | | const tableLoading = ref(false) |
| | | // å页忰 |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0 |
| | | }) |
| | | |
| | | // å½åè§å¾ |
| | | const currentView = ref('attendance') |
| | |
| | | ] |
| | | |
| | | // è夿°æ® |
| | | const attendanceData = ref([ |
| | | { date: '2024-01-15', checkIn: '09:00', checkOut: '18:00', workHours: '9å°æ¶', status: 'æ£å¸¸' }, |
| | | { date: '2024-01-16', checkIn: '08:55', checkOut: '18:05', workHours: '9å°æ¶10å', status: 'æ£å¸¸' }, |
| | | { date: '2024-01-17', checkIn: '09:15', checkOut: '18:00', workHours: '8å°æ¶45å', status: 'è¿å°' } |
| | | ]) |
| | | const attendanceData = ref([]) |
| | | |
| | | // èªèµæ°æ® |
| | | const salaryData = ref([ |
| | | { month: '2024-01', basicSalary: 8000, bonus: 1000, deduction: 200, total: 8800, status: '已忾' }, |
| | | { month: '2023-12', basicSalary: 8000, bonus: 800, deduction: 150, total: 8650, status: '已忾' } |
| | | ]) |
| | | const salaryData = ref([]) |
| | | |
| | | |
| | | // åææ°æ® |
| | | const leaveData = ref([ |
| | | { type: 'å¹´å', startDate: '2024-02-01', endDate: '2024-02-03', days: 3, reason: 'æ¥èåå®¶', status: 'å·²éè¿' }, |
| | | { type: 'ç
å', startDate: '2024-01-20', endDate: '2024-01-21', days: 2, reason: 'æååç§', status: '审æ¹ä¸' } |
| | | ]) |
| | | const leaveData = ref([]) |
| | | |
| | | const currentUser = ref() |
| | | const user= ref() |
| | | // ä¸ªäººä¿¡æ¯ |
| | | const profile = ref({ |
| | | name: 'å¼ æµ·æ´', |
| | | employeeId: 'EMP001', |
| | | department: 'ææ¯é¨', |
| | | position: '软件工ç¨å¸', |
| | | hireDate: '2023-03-01', |
| | | phone: '13800138000', |
| | | email: 'zhangsan@company.com', |
| | | address: 'åäº¬å¸æé³åºxxxè¡éxxxå·' |
| | | id: '', |
| | | name: '', |
| | | employeeId: '', |
| | | department: '', |
| | | position: '', |
| | | hireDate: '', |
| | | phone: '', |
| | | email: '', |
| | | adress: '' |
| | | }) |
| | | |
| | | // å¼¹çªæ§å¶ |
| | | const showLeaveDialog = ref(false) |
| | | const editProfile = ref(false) |
| | | const salaryMonth = ref('') |
| | | const payDateStr = ref('') |
| | | |
| | | // è¡¨åæ°æ® |
| | | const leaveForm = reactive({ |
| | | id: '', |
| | | type: '', |
| | | startDate: '', |
| | | endDate: '', |
| | | reason: '' |
| | | days: 0, |
| | | reason: '', |
| | | status: '' |
| | | }) |
| | | |
| | | const profileForm = reactive({ |
| | | name: '', |
| | | phone: '', |
| | | email: '', |
| | | address: '' |
| | | name: "", |
| | | email: "", |
| | | adress: "", |
| | | phone: "", |
| | | }) |
| | | const joinForm = reactive({ |
| | | id: "", |
| | | staffNo: "", |
| | | staffName: "", |
| | | email: "", |
| | | adress: "", |
| | | sex: "", |
| | | nativePlace: "", |
| | | postJob: "", |
| | | firstStudy: "", |
| | | profession: "", |
| | | identityCard: "", |
| | | age: 0, |
| | | phone: "", |
| | | emergencyContact: "", |
| | | emergencyContactPhone: "", |
| | | contractTerm: 0, |
| | | contractStartTime: "", |
| | | contractEndTime: "", |
| | | staffState: 1, |
| | | }) |
| | | |
| | | // æ°å¢èå¤è®°å½ï¼å¼¹çªä¸è¡¨å |
| | | const operationType = ref('add') |
| | | const leaveOperationType = ref('add') |
| | | const showAttendanceDialog = ref(false) |
| | | const attendanceFormRef = ref(null) |
| | | const attendanceForm = reactive({ |
| | | id: '', |
| | | date: '', |
| | | checkIn: '', |
| | | checkOut: '', |
| | | workHours: '', |
| | | status: 'æ£å¸¸' |
| | | }) |
| | | const attendanceRules = { |
| | |
| | | |
| | | // æ°å¢èå¤è®°å½ï¼æå¼å¼¹çªå¹¶é¢å¡«é»è®¤å¼ï¼ |
| | | const addAttendanceRecord = () => { |
| | | operationType.value = 'add' |
| | | attendanceForm.date = new Date().toISOString().split('T')[0] |
| | | attendanceForm.checkIn = '09:00' |
| | | attendanceForm.checkOut = '18:00' |
| | |
| | | return m === 0 ? `${h}å°æ¶` : `${h}å°æ¶${m}å` |
| | | } |
| | | |
| | | // æäº¤æ°å¢èå¤è®°å½ |
| | | // ç¼è¾èå¤è®°å½ |
| | | const editAttendanceRecord = (row) => { |
| | | operationType.value = 'edit' |
| | | Object.assign(attendanceForm, row) |
| | | showAttendanceDialog.value = true |
| | | } |
| | | // æäº¤æ°å¢-ç¼è¾èå¤è®°å½ |
| | | const submitAttendance = () => { |
| | | if (!attendanceFormRef.value) return |
| | | attendanceFormRef.value.validate((valid) => { |
| | | if (!valid) return |
| | | // if (!attendanceFormRef.value) return |
| | | const workHours = computeWorkHours(attendanceForm.checkIn, attendanceForm.checkOut) |
| | | const newRecord = { |
| | | date: attendanceForm.date, |
| | |
| | | workHours, |
| | | status: attendanceForm.status |
| | | } |
| | | attendanceData.value.unshift(newRecord) |
| | | if (operationType.value === 'add') { |
| | | personalAttendanceRecordsAdd(newRecord) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('èå¤è®°å½æ·»å æå') |
| | | getPersonalAttendanceRecordsList() |
| | | showAttendanceDialog.value = false |
| | | // é置表å |
| | | attendanceForm.date = '' |
| | | attendanceForm.checkIn = '' |
| | | attendanceForm.checkOut = '' |
| | | attendanceForm.status = 'æ£å¸¸' |
| | | ElMessage.success('èå¤è®°å½æ·»å æå') |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error('èå¤è®°å½æ·»å 失败') |
| | | }) |
| | | }else{ |
| | | attendanceForm.workHours = computeWorkHours(attendanceForm.checkIn, attendanceForm.checkOut) |
| | | personalAttendanceRecordsUpdate(attendanceForm) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('èå¤è®°å½æ´æ°æå') |
| | | getPersonalAttendanceRecordsList() |
| | | showAttendanceDialog.value = false |
| | | // é置表å |
| | | attendanceForm.date = '' |
| | | attendanceForm.checkIn = '' |
| | | attendanceForm.checkOut = '' |
| | | attendanceForm.status = 'æ£å¸¸' |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error('èå¤è®°å½æ´æ°å¤±è´¥') |
| | | }) |
| | | } |
| | | // attendanceFormRef.value.validate((valid) => { |
| | | // if (!valid) return |
| | | |
| | | // ç¼è¾èå¤è®°å½ |
| | | const editAttendanceRecord = (row) => { |
| | | ElMessage.info('ç¼è¾åè½å¼åä¸...') |
| | | |
| | | // }) |
| | | } |
| | | |
| | | // å é¤èå¤è®°å½ |
| | | const deleteAttendanceRecord = (index) => { |
| | | attendanceData.value.splice(index, 1) |
| | | ElMessage.success('èå¤è®°å½å 餿å') |
| | | } |
| | | const deleteAttendanceRecord = (row) => { |
| | | |
| | | ElMessageBox.confirm('ç¡®å®å é¤è¯¥èå¤è®°å½åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | personalAttendanceRecordsDelete(row.id) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('èå¤è®°å½å 餿å') |
| | | getPersonalAttendanceRecordsList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error('èå¤è®°å½å é¤å¤±è´¥') |
| | | }) |
| | | }).catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }) |
| | | }) |
| | | } |
| | | // ç³è¯·åæ |
| | | const openLeaveForm = () => { |
| | | leaveOperationType.value = 'add' |
| | | showLeaveDialog.value = true |
| | | // leaveForm.type = '' |
| | | // leaveForm.startDate = '' |
| | | // leaveForm.endDate = '' |
| | | // leaveForm.days = 0 |
| | | // leaveForm.reason = '' |
| | | // leaveForm.status = 'warning' |
| | | } |
| | | // ç¼è¾åæè®°å½ |
| | | const editLeaveRecord = (row) => { |
| | | ElMessage.info('ç¼è¾åè½å¼åä¸...') |
| | | leaveOperationType.value = 'edit' |
| | | showLeaveDialog.value = true |
| | | Object.assign(leaveForm, row) |
| | | // ElMessage.info('ç¼è¾åè½å¼åä¸...') |
| | | } |
| | | |
| | | // å é¤åæè®°å½ |
| | | const deleteLeaveRecord = (index) => { |
| | | leaveData.value.splice(index, 1) |
| | | const deleteLeaveRecord = (row) => { |
| | | ElMessageBox.confirm('ç¡®å®å é¤è¯¥åæè®°å½åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | holidayApplicationDelete(row.id) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('åæè®°å½å 餿å') |
| | | getHolidayApplicationList() |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error('åæè®°å½å é¤å¤±è´¥') |
| | | }) |
| | | }).catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | //计ç®åæå¤©æ° |
| | | const calculateDays = () => { |
| | | try { |
| | | if (leaveForm.startDate && leaveForm.endDate) { |
| | | const start = new Date(leaveForm.startDate) |
| | | const end = new Date(leaveForm.endDate) |
| | | leaveForm.startDate = start.toISOString().split('T')[0] |
| | | leaveForm.endDate = end.toISOString().split('T')[0] |
| | | |
| | | if (isNaN(start.getTime()) || isNaN(end.getTime())) { |
| | | console.warn('æ æçæ¥ææ ¼å¼') |
| | | return |
| | | } |
| | | |
| | | const diffTime = Math.abs(end - start) |
| | | const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + 1 |
| | | leaveForm.days = diffDays |
| | | } |
| | | } catch (error) { |
| | | console.error('计ç®å¤©æ°å¤±è´¥:', error) |
| | | } |
| | | } |
| | | |
| | | // æäº¤åæç³è¯· |
| | | const submitLeaveApplication = () => { |
| | | if (leaveOperationType.value === 'add') { |
| | | if (!leaveForm.type || !leaveForm.startDate || !leaveForm.endDate || !leaveForm.reason) { |
| | | ElMessage.warning('请填å宿´ä¿¡æ¯') |
| | | return |
| | | } |
| | | |
| | | calculateDays() |
| | | const newLeave = { |
| | | type: leaveForm.type, |
| | | startDate: leaveForm.startDate, |
| | | endDate: leaveForm.endDate, |
| | | days: 3, // ç®åè®¡ç® |
| | | days: leaveForm.days, // ç®åè®¡ç® |
| | | reason: leaveForm.reason, |
| | | status: '审æ¹ä¸' |
| | | } |
| | | |
| | | leaveData.value.unshift(newLeave) |
| | | holidayApplicationAdd(newLeave) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('åæç³è¯·æäº¤æå') |
| | | getHolidayApplicationList() |
| | | showLeaveDialog.value = false |
| | | |
| | | // é置表å |
| | | Object.keys(leaveForm).forEach(key => { |
| | | leaveForm[key] = '' |
| | | }) |
| | | |
| | | ElMessage.success('åæç³è¯·æäº¤æå') |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error('åæç³è¯·æäº¤å¤±è´¥') |
| | | }) |
| | | }else{ |
| | | calculateDays() |
| | | holidayApplicationUpdate(leaveForm) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('åæç³è¯·æ´æ°æå') |
| | | getHolidayApplicationList() |
| | | showLeaveDialog.value = false |
| | | // é置表å |
| | | Object.keys(leaveForm).forEach(key => { |
| | | leaveForm[key] = '' |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error('åæç³è¯·æ´æ°å¤±è´¥') |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // è·åä¸ªäººä¿¡æ¯ |
| | | const getProfile = () => { |
| | | tableLoading.value = true; |
| | | getUserProfile().then(res => { |
| | | if (res.code === 200) { |
| | | currentUser.value = res.data |
| | | // console.log("----",currentUser.value) |
| | | //å¾å°äººåå表 |
| | | staffJoinListPage({staffState: 1}).then(res => { |
| | | //çéåºåcurrentUserååç人å |
| | | // let tableData = res.data.records |
| | | user.value = res.data.records.find(item => item.staffName === currentUser.value.userName) |
| | | // console.log("++++",user.value) |
| | | if(user.value){ |
| | | profile.value.id=user.value.id |
| | | profile.value.name=user.value.staffName |
| | | profile.value.employeeId=user.value.staffNo |
| | | profile.value.phone=user.value.phone |
| | | profile.value.email=currentUser.value.email |
| | | profile.value.adress=user.value.adress |
| | | profile.value.position=user.value.postJob |
| | | profile.value.hireDate=user.value.createTime |
| | | profile.value.department=currentUser.value.deptNames |
| | | } |
| | | // console.log(profile.value) |
| | | // tableLoading.value = false; |
| | | }).catch(err => {}) |
| | | } |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | ElMessage.error('è·å个人信æ¯å¤±è´¥') |
| | | }) |
| | | } |
| | | // ä¿åä¸ªäººä¿¡æ¯ |
| | | const saveProfile = () => { |
| | | Object.assign(profile.value, profileForm) |
| | | editProfile.value = false |
| | | ElMessage.success('个人信æ¯ä¿åæå') |
| | | } |
| | | const saveProfile = async () => { |
| | | tableLoading.value = true; |
| | | try { |
| | | const userRes = await getUserProfile(); |
| | | if (userRes.code === 200) { |
| | | currentUser.value = userRes.data; |
| | | const staffListRes = await staffJoinListPage({ staffState: 1 }); |
| | | user.value = staffListRes.data.records.find(item => item.staffName === currentUser.value.userName); |
| | | // console.log("++++", user.value); |
| | | |
| | | // åå§å个人信æ¯è¡¨å |
| | | const initProfileForm = () => { |
| | | Object.assign(joinForm, user.value); |
| | | joinForm.staffName = profileForm.name; |
| | | joinForm.phone = profileForm.phone; |
| | | joinForm.email = profileForm.email; |
| | | joinForm.adress = profileForm.adress; |
| | | console.log(joinForm) |
| | | // è°ç¨æ´æ°ä¸ªäººä¿¡æ¯çæ¥å£ |
| | | staffJoinUpdate(joinForm).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('个人信æ¯ä¿åæå'); |
| | | getProfile(); |
| | | editProfile.value = false; |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error('个人信æ¯ä¿å失败'); |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | ElMessage.error('è·å个人信æ¯å¤±è´¥'); |
| | | } finally { |
| | | tableLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // ç¼è¾ä¸ªäººä¿¡æ¯ |
| | | const editProfileForm = () => { |
| | | editProfile.value = true; |
| | | Object.assign(profileForm, { |
| | | name: profile.value.name, |
| | | phone: profile.value.phone, |
| | | email: profile.value.email, |
| | | address: profile.value.address |
| | | adress: profile.value.adress, |
| | | }); |
| | | }; |
| | | |
| | | //æä»½æ¹å |
| | | const changMonth = () => { |
| | | getCompensationList() |
| | | } |
| | | //è·åèå¤è®°å½å表 |
| | | const getPersonalAttendanceRecordsList = async () => { |
| | | tableLoading.value = true |
| | | personalAttendanceRecordsListPage(page) |
| | | .then(res => { |
| | | |
| | | attendanceData.value = res.data.records |
| | | page.value.total = res.data.total; |
| | | tableLoading.value = false; |
| | | |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | } |
| | | //èªèµåæ¥è¯¢ |
| | | const getCompensationList = async () => { |
| | | tableLoading.value = true |
| | | compensationListPage({...page,payDateStr:payDateStr.value}) |
| | | .then(res => { |
| | | salaryData.value = res.data.records |
| | | //è¿æ»¤åºå½åæä»½çæ£æ¬¾å计 |
| | | salaryData.value.forEach(item => { |
| | | item.deduction =0 + item.deductionAbsenteeism+item.sickLeaveDeductions+item.deductionPersonalLeave+item.forgetClockDeduct, |
| | | item.bonus=0, |
| | | item.status='已忾' |
| | | }) |
| | | |
| | | // çå¬ç¼è¾ä¸ªäººä¿¡æ¯å¼¹çª |
| | | watch(editProfile, (val) => { |
| | | if (val) { |
| | | initProfileForm() |
| | | page.value.total = res.data.total; |
| | | tableLoading.value = false; |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | } |
| | | //è·ååæç³è¯·å表 |
| | | const getHolidayApplicationList = async () => { |
| | | tableLoading.value = true |
| | | holidayApplicationListPage(page) |
| | | .then(res => { |
| | | leaveData.value = res.data.records |
| | | page.value.total = res.data.total; |
| | | tableLoading.value = false; |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | } |
| | | onMounted(() => { |
| | | // åå§å |
| | | getPersonalAttendanceRecordsList() |
| | | getCompensationList() |
| | | getHolidayApplicationList() |
| | | getProfile() |
| | | }) |
| | | </script> |
| | | |