Преглед изворни кода

1.修改sop,使任务中能删除解绑了销售账号的企微

jzp пре 1 месец
родитељ
комит
c8b13933c6
1 измењених фајлова са 62 додато и 24 уклоњено
  1. 62 24
      src/views/qw/sop/updateSop.vue

+ 62 - 24
src/views/qw/sop/updateSop.vue

@@ -365,7 +365,19 @@
                 closable
                 :disable-transitions="false"
                 @close="handleClosegroupUser(id)">
-                <span v-for="list in companyUserList" :key="list.qwUserId" v-if="list.id==id">{{list.qwUserName}}</span>
+                <template>
+                  <!-- 匹配到对应项:展示用户名 -->
+                  <span
+                    v-for="list in companyUserList"
+                    :key="list.qwUserId"
+                    v-if="list.id == id">
+                      {{ list.qwUserName }}
+                  </span>
+                  <!-- 未匹配到任何项:直接展示userSelectList里的id(因为list无id,无法展示list.id) -->
+                  <span v-if="!companyUserList.some(list => list.qwUserId == id)">
+                    {{ id }}
+                  </span>
+                </template>
               </el-tag>
             </div>
           </el-form-item>
@@ -651,32 +663,58 @@ export default {
       // }
       // 找到对应的员工信息
       const user = this.companyUserList.find((list) => list.id == id);
-      console.log(user)
-      if (!user) return;
-      // 确认删除提醒
-      this.$confirm('确定要删除员工"'+user.qwUserName+'"吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      })
-        .then(() => {
-          // 用户点击确定
-          const index = this.userSelectList.findIndex((t) => t === id);
-          if (index !== -1) {
-            this.userSelectList.splice(index, 1);
-          }
-          this.$message({
-            type: 'success',
-            message: '删除成功',
+
+      if (!user){
+        const qwUser = this.companyQwUserList.find((list) => list.id == id);
+        // 确认删除提醒
+        this.$confirm('确定要删除未绑定公司的企微员工"'+qwUser.qwUserName+'"吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        }).then(() => {
+            // 用户点击确定
+            const index = this.userSelectList.findIndex((t) => t === id);
+            if (index !== -1) {
+              this.userSelectList.splice(index, 1);
+            }
+            this.$message({
+              type: 'success',
+              message: '删除成功',
+            });
+          })
+          .catch(() => {
+            // 用户点击取消
+            this.$message({
+              type: 'info',
+              message: '已取消删除',
+            });
           });
+      }else{
+        // 确认删除提醒
+        this.$confirm('确定要删除员工"'+user.qwUserName+'"吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
         })
-        .catch(() => {
-          // 用户点击取消
-          this.$message({
-            type: 'info',
-            message: '已取消删除',
+          .then(() => {
+            // 用户点击确定
+            const index = this.userSelectList.findIndex((t) => t === id);
+            if (index !== -1) {
+              this.userSelectList.splice(index, 1);
+            }
+            this.$message({
+              type: 'success',
+              message: '删除成功',
+            });
+          })
+          .catch(() => {
+            // 用户点击取消
+            this.$message({
+              type: 'info',
+              message: '已取消删除',
+            });
           });
-        });
+      }
     },
     // 取消按钮
     cancel() {