王智慧 3 лет назад
Родитель
Сommit
9dedb9d596
1 измененных файлов с 31 добавлено и 1 удалено
  1. 31 1
      src/views/shipSecurityManage/shipCheckTemplateList.vue

+ 31 - 1
src/views/shipSecurityManage/shipCheckTemplateList.vue

@@ -156,7 +156,15 @@
               text
               size="small"
             >
-              查看详情
+              编辑
+            </el-button>
+            <el-button
+              @click="deleteSecurityTemplate(scope.row.id)"
+              type="danger"
+              text
+              size="small"
+            >
+              删除
             </el-button>
           </template>
         </el-table-column>
@@ -288,6 +296,28 @@ async function getSecurityTemplateDetail(id) {
     ruleForm.value = data.result;
   }
 }
+
+function deleteSecurityTemplate(id) {
+  ElMessageBox.confirm("确认删除安检模板?", "提示", {
+    confirmButtonText: "确认",
+    cancelButtonText: "取消",
+    type: "warning",
+  })
+    .then(async () => {
+      let { data } = await api.deleteSecurityTemplate({
+        id,
+      });
+      if (data.status == 0) {
+        ElMessage({
+          type: "success",
+          message: data.msg,
+        });
+      }
+      getSecurityTemplateList();
+    })
+    .catch(() => {});
+}
+
 function pageChange(e) {
   currentPage.value = e;
   getSecurityTemplateList();