wenhongquan 3 rokov pred
rodič
commit
98ab3d13cb
1 zmenil súbory, kde vykonal 44 pridanie a 38 odobranie
  1. 44 38
      src/views/task/list/index.vue

+ 44 - 38
src/views/task/list/index.vue

@@ -93,7 +93,11 @@
               <el-button text size="small" @click.stop="edittask(scope.row)"
                 >修改
               </el-button>
-              <el-button text size="small" @click.stop="deltask(scope.row)">删除</el-button>
+              <el-popconfirm title="确定删除?" @confirm="deltask(scope.row)">
+                <template #reference>
+                  <el-button text size="small" @click.stop="">删除</el-button>
+                </template>
+              </el-popconfirm>
             </template>
           </el-table-column>
         </el-table>
@@ -123,7 +127,11 @@
     <el-dialog
       v-model="showadd"
       v-loading="loading"
-      :title="`${ (taskinfo.taskId==null||taskinfo.taskId==undefined) ?'新增任务':'编辑任务'}`"
+      :title="`${
+        taskinfo.taskId == null || taskinfo.taskId == undefined
+          ? '新增任务'
+          : '编辑任务'
+      }`"
       width="70%"
       draggable
     >
@@ -137,9 +145,6 @@
         </span>
       </template>
     </el-dialog>
-
-
-
   </div>
 </template>
 
@@ -163,7 +168,7 @@ import { cloneDeep } from "lodash";
 import { isArray } from "@vue/shared";
 import { useRoute } from "vue-router";
 
-const formlocation = ref({ addr: "", locations: ""});
+const formlocation = ref({ addr: "", locations: "" });
 
 const {
   task_status,
@@ -190,31 +195,33 @@ const showadd = ref(false);
 const qdate = ref([]);
 const tableData = ref([]);
 const pagedata = ref({});
-const taskinfo = ref({taskName: null,
-    taskContent: null,
-    taskAddr: null,
-    taskLocation: null,
-    taskCode: null,
-    taskType: null,
-    taskEventType: null,
-    taskEventCategory: null,
-    taskFromRemark: null,
-    taskAddrRoad: null,
-    taskOtherId: null,
-    taskTime: null,
-    taskArea: "1",
-    taskReqCompleteTime: null,
-    status: 1,
-    taskId:null,
-    remark: "",
-    taskCreater: null,
-    taskReporter: null,
-    taskPics: null,
-    taskVideos: null,
-    taskComplainConnect: null,
-    taskDeptRange: "",
-    taskFacilitieCode: "",
-    remark: "",});
+const taskinfo = ref({
+  taskName: null,
+  taskContent: null,
+  taskAddr: null,
+  taskLocation: null,
+  taskCode: null,
+  taskType: null,
+  taskEventType: null,
+  taskEventCategory: null,
+  taskFromRemark: null,
+  taskAddrRoad: null,
+  taskOtherId: null,
+  taskTime: null,
+  taskArea: "1",
+  taskReqCompleteTime: null,
+  status: 1,
+  taskId: null,
+  remark: "",
+  taskCreater: null,
+  taskReporter: null,
+  taskPics: null,
+  taskVideos: null,
+  taskComplainConnect: null,
+  taskDeptRange: "",
+  taskFacilitieCode: "",
+  remark: "",
+});
 const taskaddref = ref();
 const route = useRoute();
 const currentstatus = computed(() => route.params.status);
@@ -268,9 +275,9 @@ const ontaskadd = async () => {
   loading.value = true;
 
   if (taskobj.taskId) {
-     await updateTask(taskobj);
+    await updateTask(taskobj);
   } else {
-     await addTask(taskobj);
+    await addTask(taskobj);
   }
 
   loading.value = false;
@@ -299,14 +306,13 @@ const edittask = (row) => {
   taskinfo.value = cloneDeep(row);
   showadd.value = true;
   taskaddref.value?.doinit(taskinfo.value);
-}
+};
 const deltask = (row) => {
-  delTask(row.taskId).then(res => {
+  delTask(row.taskId).then((res) => {
     ElMessage.success("删除成功");
     getList();
-  })
-
-}
+  });
+};
 
 onMounted(() => {});
 </script>