Ver Fonte

新增,批量删除SOP 的执行任务并添加权限 qw:sopLogs:removeAll

吴树波 há 5 dias atrás
pai
commit
3ed82b76c8
2 ficheiros alterados com 35 adições e 3 exclusões
  1. 8 0
      src/api/qw/sop.js
  2. 27 3
      src/views/qw/sop/sop.vue

+ 8 - 0
src/api/qw/sop.js

@@ -105,6 +105,14 @@ export function delSop(id) {
   })
 }
 
+// 删除企微sop
+export function delSopLogs(id) {
+  return request({
+    url: '/qw/sop/delSopLogs/' + id,
+    method: 'delete'
+  })
+}
+
 //批量执行企微sop
 export function executeSop(ids) {
   return request({

+ 27 - 3
src/views/qw/sop/sop.vue

@@ -104,6 +104,18 @@
         >删除
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleSopLogsDelete"
+          v-hasPermi="['qw:sopLogs:removeAll']"
+        >批量删除执行任务
+        </el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="success"
@@ -276,7 +288,7 @@
             type="text"
             style="color: green;"
             @click="handleQueryDetails(scope.row)"
-            v-hasPermi="['qw:sop:list']"
+            v-hasPermi="['qw:sopTemp:info']"
           >查看模板
           </el-button>
         </template>
@@ -287,6 +299,7 @@
           <el-button
             size="mini"
             type="text"
+            v-hasPermi="['qw:sop:edit']"
             @click="handleUpdateOutTime(scope.row)"
           >修改规则
           </el-button>
@@ -866,7 +879,7 @@
 import {
   addSop,
   courseList,
-  delSop,
+  delSop, delSopLogs,
   exportSop,
   getSopVoiceList,
   listSop,
@@ -875,7 +888,7 @@ import {
   updateSopStatus,
   updateStatus,
   videoList
-} from "@/api/qw/sop";
+} from '@/api/qw/sop'
 import {sendMsgSop} from "@/api/qw/sopUserLogsInfo";
 import {listSopTemp} from "@/api/qw/sopTemp";
 import {getQwAllUserList, listUser} from '@/api/company/companyUser'
@@ -1664,6 +1677,17 @@ export default {
       }).catch(() => {
       });
     },
+    /** 删除按钮操作 */
+    handleSopLogsDelete() {
+      this.$confirm('是否确认删除企微sop编号为"' + this.ids + '"的所有发送任务(执行记录)数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => delSopLogs(this.ids)).then(() => {
+        this.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
     /**
      * 批量执行SOP任务
      */