From 779166d9c0bed49c3cc47287ba854781d4123287 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期二, 09 九月 2025 16:22:22 +0800
Subject: [PATCH] 用印管理修改,值班与计划页面调整
---
src/views/collaborativeApproval/planTemplate/index.vue | 275 ++++++++++++++++++++++++++------------
src/api/collaborativeApproval/planTemplate.js | 64 +++++++++
src/views/collaborativeApproval/sealManagement/index.vue | 34 +++-
3 files changed, 274 insertions(+), 99 deletions(-)
diff --git a/src/api/collaborativeApproval/planTemplate.js b/src/api/collaborativeApproval/planTemplate.js
new file mode 100644
index 0000000..24a6ac4
--- /dev/null
+++ b/src/api/collaborativeApproval/planTemplate.js
@@ -0,0 +1,64 @@
+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,
+// });
+// }
+
diff --git a/src/views/collaborativeApproval/planTemplate/index.vue b/src/views/collaborativeApproval/planTemplate/index.vue
index f46a203..7c67f22 100644
--- a/src/views/collaborativeApproval/planTemplate/index.vue
+++ b/src/views/collaborativeApproval/planTemplate/index.vue
@@ -18,6 +18,8 @@
v-model="currentDate"
:type="datePickerType"
placeholder="閫夋嫨鏃ユ湡"
+ format="YYYY-MM-DD"
+ value-format="YYYY-MM-DD"
style="width: 180px; margin-left: 10px"
@change="handleDateChange"
/>
@@ -25,7 +27,7 @@
<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>
@@ -107,7 +109,7 @@
<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>
@@ -122,14 +124,14 @@
<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="copy">澶嶅埗</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>
</template>
@@ -180,7 +182,7 @@
<!-- 鏂板/缂栬緫璁″垝瀵硅瘽妗� -->
<el-dialog
v-model="planDialogVisible"
- :title="dialogTitle"
+ :title="operationType === 'add' ? '鍙戝竷璁″垝' : '缂栬緫璁″垝'"
width="600px"
@close="handleDialogClose"
>
@@ -215,6 +217,8 @@
<el-date-picker
v-model="planForm.startDate"
type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
placeholder="閫夋嫨寮�濮嬫椂闂�"
style="width: 100%"
/>
@@ -223,6 +227,8 @@
<el-date-picker
v-model="planForm.endDate"
type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
placeholder="閫夋嫨缁撴潫鏃堕棿"
style="width: 100%"
/>
@@ -237,8 +243,48 @@
<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>
@@ -248,12 +294,31 @@
</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,
@@ -264,17 +329,22 @@
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',
@@ -283,7 +353,9 @@
endDate: '',
assignee: '',
priority: 'medium',
- tags: ''
+ tags: [],
+ status: '',
+ progress: 0
})
// 琛ㄥ崟楠岃瘉瑙勫垯
@@ -297,74 +369,17 @@
assignee: [{ required: true, message: '璇疯緭鍏ヨ礋璐d汉', 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: '璁捐绯荤粺鎶�鏈灦鏋勶紝鍖呮嫭鏁版嵁搴撹璁°�佹帴鍙h璁$瓑',
- 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(() => {
@@ -383,20 +398,24 @@
// 鏂规硶
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
// 閲嶇疆琛ㄥ崟
@@ -406,26 +425,35 @@
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('璁″垝宸插叡浜�')
@@ -439,17 +467,40 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- ElMessage.success('璁″垝宸插垹闄�')
+
+ delDutyPlan(ids).then(res => {
+ if (res.code === 200) {
+ ElMessage.success('璁″垝宸插垹闄�')
+ ids.value = [];
+ getPlanList()
+ }
+ })
})
break
}
}
-
+//
const handleSavePlan = async () => {
try {
await planFormRef.value.validate()
- ElMessage.success('璁″垝淇濆瓨鎴愬姛')
- planDialogVisible.value = false
+ 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)
}
@@ -460,7 +511,8 @@
}
const handleRefresh = () => {
- ElMessage.success('鏁版嵁宸插埛鏂�')
+ getPlanList()
+ // ElMessage.success('鏁版嵁宸插埛鏂�')
}
const handleFilter = () => {
@@ -468,9 +520,21 @@
}
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('璁″垝宸插叡浜�')
}
@@ -527,8 +591,41 @@
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>
diff --git a/src/views/collaborativeApproval/sealManagement/index.vue b/src/views/collaborativeApproval/sealManagement/index.vue
index 0ee068b..1f88715 100644
--- a/src/views/collaborativeApproval/sealManagement/index.vue
+++ b/src/views/collaborativeApproval/sealManagement/index.vue
@@ -124,11 +124,11 @@
<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>
+ <!-- <el-button link type="warning" @click="viewReadStatus(scope.row)">闃呰鐘舵��</el-button> -->
</template>
</el-table-column>
</el-table>
- <!-- 鍒嗛〉 -->
+ <!-- 鍒嗛〉
<pagination
v-show="total > 0"
:total="total"
@@ -136,7 +136,7 @@
:page="page.current"
:limit="page.size"
@pagination="paginationChange"
- />
+ /> -->
</div>
</el-tab-pane>
</el-tabs>
@@ -270,8 +270,14 @@
<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>
@@ -375,11 +381,7 @@
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' },
@@ -603,6 +605,15 @@
// 鏌ョ湅鍒跺害鐗堟湰鍘嗗彶
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 viewReadStatus = (row) => {
@@ -629,6 +640,8 @@
.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;
@@ -677,6 +690,7 @@
border-radius: 4px;
line-height: 1.6;
white-space: pre-wrap;
+ height: 200px;
}
.dialog-footer {
--
Gitblit v1.9.3