From 1621b3719092d93e6c29f7a27e401529e0454420 Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期一, 01 八月 2022 18:57:45 +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