From f93a3a605d6d949515bedbcdc633c5f454014f02 Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期二, 26 七月 2022 17:07:06 +0800
Subject: [PATCH] 添加修改页面

---
 src/views/specialWorkSystem/approveProcessManagement/approveProcessList/index.vue |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/views/specialWorkSystem/approveProcessManagement/approveProcessList/index.vue b/src/views/specialWorkSystem/approveProcessManagement/approveProcessList/index.vue
index f3d5ac6..6b0615c 100644
--- a/src/views/specialWorkSystem/approveProcessManagement/approveProcessList/index.vue
+++ b/src/views/specialWorkSystem/approveProcessManagement/approveProcessList/index.vue
@@ -245,6 +245,7 @@
 				}
 			]
 	)
+
 	// 时间格式化
 	const timeForm = {
 		hour12: false,
@@ -269,10 +270,14 @@
 	const deleteDialog = ref(false)
 	const addRecord = ref({})
 	const details = ref({})
+
+	// 查看记录
 	const viewRecord = (row) =>{
 		details.value = JSON.parse(JSON.stringify(row))
 		dialogDetails.value = true
 	}
+
+	// 删除记录
 	const deleteRecord = (index) =>{
 		chosenIndex.value = index
 		deleteDialog.value = true
@@ -281,13 +286,22 @@
 		tableData.splice(chosenIndex.value,1)
 		deleteDialog.value = false
 	}
+
+	// 修改记录
+	const editRecord =(index, row)=>{
+		dialogAddRecord.value = true
+		chosenIndex.value = index
+		addRecord.value = JSON.parse(JSON.stringify(row))
+	}
+
+	// 新增修改记录确认
 	const confirmAddRecord = async (formEl: FormInstance | undefined) =>{
 		if (!formEl) return
 		await formEl.validate((valid, fields) => {
 			if (valid) {
 				if(chosenIndex.value == -1){
 					addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-')
-					tableData.push(addRecord.value)
+					tableData.unshift(addRecord.value)
 				}else{
 					addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-')
 					tableData[chosenIndex.value] = addRecord.value
@@ -305,11 +319,6 @@
 	}
 	const indexClear = ()=>{
 		chosenIndex.value = -1
-	}
-	const editRecord =(index, row)=>{
-		dialogAddRecord.value = true
-		chosenIndex.value = index
-		addRecord.value = JSON.parse(JSON.stringify(row))
 	}
 	// 折线图
 	const renderMenu = async (value: string) => {

--
Gitblit v1.9.2