Browse Source

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI

lmx 5 days ago
parent
commit
5010f44883

+ 53 - 0
src/api/tag/api.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询视频小节看课标签关联列表
+export function listTag(query) {
+  return request({
+    url: '/shop/tag/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询视频小节看课标签关联详细
+export function getTag(id) {
+  return request({
+    url: '/shop/tag/' + id,
+    method: 'get'
+  })
+}
+
+// 新增视频小节看课标签关联
+export function addTag(data) {
+  return request({
+    url: '/shop/tag',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改视频小节看课标签关联
+export function updateTag(data) {
+  return request({
+    url: '/shop/tag',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除视频小节看课标签关联
+export function delTag(id) {
+  return request({
+    url: '/shop/tag/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出视频小节看课标签关联
+export function exportTag(query) {
+  return request({
+    url: '/shop/tag/export',
+    method: 'get',
+    params: query
+  })
+}

+ 19 - 130
src/views/components/course/userCourseCatalogDetails.vue

@@ -33,10 +33,6 @@
       <el-table-column label="上传时间" align="center" prop="createTime" />
       <el-table-column label="默认红包" align="center" prop="redPacketMoney" />
       <el-table-column label="公司红包" align="center" prop="companyRedPacketMoney" />
-      <el-table-column label="标签组名称" align="center" prop="tagGroupName" />
-      <el-table-column label="看课标签" align="center" prop="watchingTagName" />
-      <el-table-column label="完课标签" align="center" prop="watchedTagName" />
-
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -91,8 +87,7 @@
       :visible.sync="dialogVisible"
       width="400px"
       @close="resetForm"
-      append-to-body
-    >
+      append-to-body>
       <div>
         <p style="color: gray;">不传默认以系统参数为准</p>
         <el-form :model="linkForm" label-width="120px">
@@ -111,70 +106,13 @@
       </div>
     </el-dialog>
 
-    <!-- 弹框 -->
-    <el-dialog
-      title="绑定看课标签"
+    <AutoTagDialog
       :visible.sync="tagDialogVisible"
-      width="500px"
-      @closed="resetDialog"
+      :title="tagDialogTitle"
+      :videoId="currentVideoId"
       append-to-body
-    >
-      <el-form :model="tagDialog" label-width="120px">
-        <!-- 标签组选择 -->
-        <el-form-item label="标签组" required>
-          <el-select
-            v-model="tagDialog.groupId"
-            placeholder="请选择标签组"
-            @change="onGroupChange"
-            filterable
-          >
-            <el-option
-              v-for="group in tagGroups"
-              :key="group.groupId"
-              :label="group.name"
-              :value="group.groupId"
-            />
-          </el-select>
-        </el-form-item>
-        <!-- 看课标签选择 -->
-        <el-form-item label="看课标签" required>
-          <el-select
-            v-model="tagDialog.watchTagId"
-            placeholder="请选择看课标签"
-            :disabled="!tagDialog.groupId"
-            @change="handleWatchingChange"
-            filterable
-          >
-            <el-option
-              v-for="tag in tagsInGroup"
-              :key="tag.tagId"
-              :label="tag.name"
-              :value="tag.tagId"
-            />
-          </el-select>
-        </el-form-item>
-        <!-- 完课标签选择 -->
-        <el-form-item label="完课标签" required>
-          <el-select
-            v-model="tagDialog.finishTagId"
-            placeholder="请选择完课标签"
-            :disabled="!tagDialog.groupId"
-            @change="handleWatchedChange"
-            filterable>
-            <el-option
-              v-for="tag in tagsInGroup"
-              :key="tag.tagId"
-              :label="tag.name"
-              :value="tag.tagId"
-            />
-          </el-select>
-        </el-form-item>
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="cancelDialog">取消</el-button>
-        <el-button type="primary" @click="submitTagBinding">确定</el-button>
-      </span>
-    </el-dialog>
+    />
+
   </div>
 </template>
 
@@ -182,12 +120,14 @@
 import {getVideoListByCourseId, updatePacketMoney, updateUserCourseVideoUpdate} from "@/api/course/userCourseVideo";
 import userCourseVideoDetails from '../../components/course/userCourseVideoDetails.vue';
 import {createLinkUrl} from "@/api/course/sopCourseLink";
-import {listTagGroup} from "@/api/qw/tagGroup";
+import AutoTagDialog from "@/views/components/tag/AutoTagDialog.vue";
+import {addTag, updateTag} from "@/api/tag/api";
 
 export default {
     name: "userCourseCatalog",
     components: {
-      userCourseVideoDetails
+      userCourseVideoDetails,
+      AutoTagDialog
     },
     props: {
       video: {
@@ -199,9 +139,12 @@ export default {
       return {
         currentRow: null,
         // 假设这里有当前课程小节的数据传入,里面含id等
-        tagDialogVisible: false,
         tagGroups: [],
         tagsInGroup: [],
+        tagDialogVisible: false,
+        tagDialogTitle: "",
+        tagDialogFormData: null,
+        currentVideoId:null,
         tagDialog: {
           videoId: null,
           groupId: null,
@@ -293,33 +236,16 @@ export default {
       });
     },
     methods: {
-      handleWatchingChange(tagId){
-        this.tagDialog.watchingTgId = this.tagsInGroup.find(e => e.tagId === tagId)?.id;
-      },
-      handleWatchedChange(tagId){
-        this.tagDialog.watchedTgId = this.tagsInGroup.find(e => e.tagId === tagId)?.id;
+
+      closeTagDialog(){
+        this.tagDialogVisible = false;
       },
       openTagDialog(row) {
         this.currentRow = row;
-        this.tagDialogVisible = true;
-        this.tagDialog.videoId = row.videoId;
-        this.tagDialog.groupId = this.currentRow.tagGroupId;
-        this.tagDialog.watchTagId = this.currentRow.watchingTagId;
-        this.tagDialog.finishTagId = this.currentRow.watchedTagId;
 
 
-        // 查询所有的标签组
-        listTagGroup({
-          pageNum: 1,
-          pageSize: 1000
-        }).then((res) => {
-          if(res.code === 200) {
-            this.tagGroups = res.rows;
-
-            let tagGroup = this.tagGroups.find(e=>e.groupId === this.currentRow.tagGroupId);
-            this.tagsInGroup = tagGroup.tag || [];
-          }
-        });
+        this.tagDialogVisible = true;
+        this.currentVideoId = row.videoId;
       },
       updateTagsInGroup(groupId) {
         let tagGroup = this.tagGroups.find(e=> e.groupId === groupId);
@@ -330,13 +256,6 @@ export default {
         this.tagDialog.finishTagId = null;
         this.tagDialog.tgId = tagGroup.id;
       },
-      onGroupChange(groupId) {
-        this.updateTagsInGroup(groupId);
-      },
-      cancelDialog() {
-        this.tagDialogVisible = false;
-        this.resetDialog();
-      },
       resetDialog() {
         this.tagDialog = {
           videoId: null,
@@ -347,36 +266,6 @@ export default {
         this.tagGroups = [];
         this.tagsInGroup = [];
       },
-      submitTagBinding() {
-        // 使用表单校验
-        if(!this.tagDialog.groupId){
-          this.$message.warning("标签组必选!");
-          return;
-        }
-        if(!this.tagDialog.watchTagId){
-          this.$message.warning("看课标签必选!");
-          return;
-        }
-        if(!this.tagDialog.finishTagId){
-          this.$message.warning("完课标签必选!");
-          return;
-        }
-        this.currentRow.tagGroupId = this.tagDialog.groupId;
-        this.currentRow.watchingTagId = this.tagDialog.watchTagId;
-        this.currentRow.watchedTagId = this.tagDialog.finishTagId;
-
-        this.currentRow.watchingTgId = this.tagDialog.watchingTgId;
-        this.currentRow.watchedTgId = this.tagDialog.watchedTgId;
-        this.currentRow.tgId = this.tagDialog.tgId;
-
-        updateUserCourseVideoUpdate(this.currentRow).then(res=>{
-          this.$message.success("绑定成功");
-          this.resetDialog();
-          this.currentRow = null;
-          this.tagDialogVisible = false;
-          this.getList();
-        })
-      },
       // 打开弹框
       openDialog(row) {
         this.linkForm.courseId = row.courseId;

+ 504 - 0
src/views/components/tag/AutoTagDialog.vue

@@ -0,0 +1,504 @@
+<template>
+  <el-dialog :visible.sync="visible" title="标签绑定管理" width="1000px"
+   @close="handleClose"
+   append-to-body
+  >
+    <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form-item label="企微公司" prop="corpId">
+          <el-select v-model="queryParams.corpId" placeholder="企微公司"  size="small" @change="updateCorpId()">
+            <el-option
+              v-for="dict in myQwCompanyList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="视频ID" prop="videoId">
+          <el-input
+            v-model="queryParams.videoId"
+            placeholder="请输入视频ID"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"
+            disabled
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+
+      <el-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-button
+            type="primary"
+            plain
+            icon="el-icon-plus"
+            size="mini"
+            @click="handleAdd"
+            v-hasPermi="['shop:tag:add']"
+          >新增</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button
+            type="success"
+            plain
+            icon="el-icon-edit"
+            size="mini"
+            :disabled="single"
+            @click="handleUpdate"
+            v-hasPermi="['shop:tag:edit']"
+          >修改</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button
+            type="danger"
+            plain
+            icon="el-icon-delete"
+            size="mini"
+            :disabled="multiple"
+            @click="handleDelete"
+            v-hasPermi="['shop:tag:remove']"
+          >删除</el-button>
+        </el-col>
+<!--        <el-col :span="1.5">-->
+<!--          <el-button-->
+<!--            type="warning"-->
+<!--            plain-->
+<!--            icon="el-icon-download"-->
+<!--            size="mini"-->
+<!--            :loading="exportLoading"-->
+<!--            @click="handleExport"-->
+<!--            v-hasPermi="['shop:tag:export']"-->
+<!--          >导出</el-button>-->
+<!--        </el-col>-->
+        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      </el-row>
+
+      <el-table border v-loading="loading" :data="tagList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="ID" align="center" prop="id" />
+        <el-table-column label="企微公司" align="center" prop="corpId" />
+        <el-table-column label="视频ID" align="center" prop="videoId" />
+        <el-table-column label="看课中-标签组名" align="center" prop="watchingGroupName" />
+        <el-table-column label="看课中-标签名" align="center" prop="watchingTgName" />
+        <el-table-column label="完课-标签组名" align="center" prop="watchedGroupName" />
+        <el-table-column label="完课-标签名" align="center" prop="watchedTgName" />
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-edit"
+              @click="handleUpdate(scope.row)"
+              v-hasPermi="['shop:tag:edit']"
+            >修改</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.row)"
+              v-hasPermi="['shop:tag:remove']"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+
+      <!-- 添加或修改视频小节看课标签关联对话框 -->
+      <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+          <el-form-item label="企微公司" prop="corpId">
+            <el-select v-model="queryParams.corpId" placeholder="企微公司"  size="small" @change="updateCorpId()">
+              <el-option
+                v-for="dict in myQwCompanyList"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="dict.dictValue"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="视频ID" prop="videoId">
+            <el-input v-model="form.videoId" placeholder="请输入视频ID" disabled/>
+          </el-form-item>
+          <el-form-item label="看课中-标签组" prop="watchingGroupTgId">
+            <el-select
+              v-model="form.watchingGroupTgId"
+              placeholder="请选择标签组"
+              @change="onWatchingGroupChange"
+              filterable
+            >
+              <el-option
+                v-for="group in tagGroups"
+                :key="group.groupId"
+                :label="group.name"
+                :value="group.groupId"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="看课中-标签" prop="watchingTagId">
+            <el-select
+              v-model="form.watchingTagId"
+              placeholder="请选择看课标签"
+              @change="onWatchingTagChange"
+              filterable>
+              <el-option
+                v-for="tag in watchingTagsInGroup"
+                :key="tag.tagId"
+                :label="tag.name"
+                :value="tag.tagId"
+              />
+            </el-select>
+          </el-form-item>
+
+          <el-form-item label="完课-标签组" prop="watchedGroupTgId">
+            <el-select
+              v-model="form.watchedGroupTgId"
+              placeholder="请选择标签组"
+              @change="onWatchedGroupChange"
+              filterable>
+              <el-option
+                v-for="group in tagGroups"
+                :key="group.groupId"
+                :label="group.name"
+                :value="group.groupId"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="完课-标签" prop="watchedTagId">
+            <el-select
+              v-model="form.watchedTagId"
+              placeholder="请选择看课标签"
+              @change="onWatchedTagChange"
+              filterable>
+              <el-option
+                v-for="tag in watchedTagsInGroup"
+                :key="tag.tagId"
+                :label="tag.name"
+                :value="tag.tagId"
+              />
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </el-dialog>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import {addTag, delTag, exportTag, getTag, listTag, updateTag} from "@/api/tag/api";
+import {getMyQwCompanyList} from "@/api/qw/user";
+import {listTagGroup} from "@/api/qw/tagGroup";
+
+export default {
+  name: 'BindLabelsDialog',
+  props: {
+    visible: {
+      type: Boolean,
+      required: true,
+    },
+    videoId: {
+      type: String,
+      required: true,
+    },
+  },
+  watch: {
+    visible(val) {
+      if (val) {
+        this.queryParams.videoId = this.videoId;
+        this.getList();
+      }
+    }
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 视频小节看课标签关联表格数据
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      myQwCompanyList:[],
+      // 看课中标签组
+      watchingTagsInGroup: [],
+      // 完课标签组
+      watchedTagsInGroup: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        corpId: null,
+        videoId: null,
+        watchingGroupId: null,
+        watchedGroupId: null,
+        watchingTgId: null,
+        watchedTgId: null,
+        watchingGroupTagId: null,
+        watchedGroupTagId: null,
+        watchingTagId: null,
+        watchedTagId: null,
+      },
+      tagList: [],
+      totalTags: 0,
+      pageNum: 1,
+      pageSize: 10,
+      loadingList: false,
+      selection: [],
+      formDialogVisible: false,
+      isEditing: false,
+      form: {
+        id: null,
+        corpId: null,
+        videoId: null,
+        watchingGroupId: null,
+        watchedGroupId: null,
+        watchingTgId:null,
+        watchedTgId: null,
+        watchingGroupTagId: null,
+        watchedGroupTagId: null,
+        watchingTagId: null,
+        watchedTagId:null
+      },
+      rules: {
+        corpId: [{ required: true, message: '请选择企微公司', trigger: 'change' }],
+        videoId: [{ required: true, message: '请输入视频ID', trigger: 'blur' }],
+        watchingGroupTgId: [{ required: true, message: '请选择看课中标签组', trigger: 'change' }],
+        watchingTagId: [{ required: true, message: '请选择看课中标签', trigger: 'change' }],
+        watchedGroupTgId: [{ required: true, message: '请选择完课标签组', trigger: 'change' }],
+        watchedTagId: [{ required: true, message: '请选择完课标签', trigger: 'change' }]
+      },
+      tagGroups: []
+    }
+  },
+  created() {
+    getMyQwCompanyList().then(response => {
+      this.myQwCompanyList = response.data;
+      if(this.myQwCompanyList != null && this.myQwCompanyList.length > 0){
+        this.queryParams.corpId = this.myQwCompanyList[0].dictValue;
+        this.getList();
+      }
+    });
+  },
+  methods: {
+    onWatchingTagChange(tagId){
+      let find = this.watchingTagsInGroup.find(e=> e.tagId === tagId);
+      this.form.watchingTgId = find.id;
+    },
+    onWatchedTagChange(tagId){
+      let find = this.watchedTagsInGroup.find(e=> e.tagId === tagId);
+      this.form.watchedTgId = find.id;
+    },
+    onWatchingGroupChange(groupId){
+      let find = this.tagGroups.find(e=> e.groupId===groupId);
+      this.watchingTagsInGroup=find.tag || [];
+      this.form.watchingGroupId = find.id;
+    },
+    onWatchedGroupChange(groupId){
+      let find = this.tagGroups.find(e=> e.groupId===groupId);
+      this.watchedTagsInGroup=find.tag || [];
+      this.form.watchedGroupId = find.id;
+    },
+    updateCorpId(){
+      this.getList();
+      // 查询所有的标签组
+      listTagGroup({
+        pageNum: 1,
+        pageSize: 1000,
+        corpId: this.queryParams.corpId
+      }).then((res) => {
+        if(res.code === 200) {
+          this.tagGroups = res.rows;
+        }
+      });
+    },
+    handleClose(){
+      this.$emit('update:visible', false);
+    },
+    /** 查询视频小节看课标签关联列表 */
+    getList() {
+      this.loading = true;
+      listTag(this.queryParams).then(response => {
+        this.tagList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+      this.$emit('close')
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        corpId: null,
+        videoId: null,
+        watchingGroupId: null,
+        watchedGroupId: null,
+        watchingTgId: null,
+        watchedTgId: null,
+        watchingGroupTagId: null,
+        watchedGroupTagId: null,
+        watchingTagId: null,
+        watchedTagId: null,
+        createTime: null,
+        updateTime: null,
+        createBy: null,
+        updateBy: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加视频小节看课标签关联";
+      this.form.videoId = this.videoId;
+      this.form.corpId = this.queryParams.corpId;
+
+      listTagGroup({
+        pageNum: 1,
+        pageSize: 1000,
+        corpId: this.queryParams.corpId
+      }).then((res) => {
+        if(res.code === 200) {
+          this.tagGroups = res.rows;
+        }
+      });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids;
+
+      // 先加载标签组数据
+      listTagGroup({
+        pageNum: 1,
+        pageSize: 1000,
+        corpId: this.queryParams.corpId
+      }).then((res) => {
+        if(res.code === 200) {
+          this.tagGroups = res.rows;
+
+          // 再获取详情数据
+          getTag(id).then(response => {
+            this.form = response.data;
+
+            // 根据标签组ID加载对应的标签列表
+            if(this.form.watchingGroupTgId) {
+              let watchingGroup = this.tagGroups.find(e => e.id === this.form.watchingGroupId);
+              if(watchingGroup) {
+                this.watchingTagsInGroup = watchingGroup.tag || [];
+              }
+            }
+
+            if(this.form.watchedGroupTgId) {
+              let watchedGroup = this.tagGroups.find(e => e.id === this.form.watchedGroupId);
+              if(watchedGroup) {
+                this.watchedTagsInGroup = watchedGroup.tag || [];
+              }
+            }
+
+            this.open = true;
+            this.title = "修改视频小节看课标签关联";
+          });
+        }
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateTag(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addTag(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除视频小节看课标签关联编号为"' + ids + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delTag(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有视频小节看课标签关联数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportTag(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+    }
+  }
+}
+</script>

+ 52 - 16
src/views/course/courseWatchLog/deptWatchLog.vue

@@ -703,9 +703,11 @@ export default {
     },
     /** 查询短链课程看课记录列表 */
     getList() {
-      // xgb 看课数据量太大必须限制时间
-      if (!this.createTimeText) {
-        this.$message.warning('请选择创建时间');
+      // xgb 看课数据量太大必须限制时间if (this.isEmptyArray(this.createTimeText) &&
+      if (this.isEmptyArray(this.createTimeText) &&
+        this.isEmptyArray(this.updateTimeText) &&
+        this.isEmptyArray(this.scheduleTimeText)) {
+        this.$message.warning('请选择创建时间或营期时间或最新更新时间');
         return;
       }
 
@@ -717,7 +719,14 @@ export default {
         this.courseWatchLogList = response.rows;
         this.total = response.total;
         this.loading = false;
-      });
+      }).catch(() => {
+          this.loading = false;
+        }
+      );
+    },
+    // 添加辅助方法
+    isEmptyArray(arr) {
+      return !arr || arr.length === 0;
     },
     // 取消按钮
     cancel() {
@@ -839,8 +848,11 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      if (!this.createTimeText) {
-        this.$message.warning('请选择创建时间');
+      // xgb 看课数据量太大必须限制时间
+      if (this.isEmptyArray(this.createTimeText) &&
+        this.isEmptyArray(this.updateTimeText) &&
+        this.isEmptyArray(this.scheduleTimeText)) {
+        this.$message.warning('请选择创建时间或营期时间或最新更新时间');
         return;
       }
 
@@ -907,6 +919,12 @@ export default {
     // 营期时间
     handleScheduleTimeChange(scheduleTime) {
       if (scheduleTime && scheduleTime.length >= 2) {
+        if(!this.checkDateRangeLimit(scheduleTime)){
+          this.scheduleTimeText = null;
+          this.queryParams.scheduleStartTime=null;
+          this.queryParams.scheduleStartTime=null;
+          return;
+        }
         // this.scheduleTimeText = this.formatDateRange(scheduleTime);
         this.queryParams.scheduleStartTime = scheduleTime[0] || null;
         this.queryParams.scheduleEndTime = scheduleTime[1] || null;
@@ -916,20 +934,32 @@ export default {
         this.queryParams.scheduleEndTime = null;
       }
     },
+    checkDateRangeLimit(dateRange) {
+      if (dateRange && dateRange.length >= 2) {
+        const startDate = new Date(dateRange[0]);
+        const endDate = new Date(dateRange[1]);
+
+        // 设置时间为当天开始,避免时间部分影响计算
+        startDate.setHours(0, 0, 0, 0);
+        endDate.setHours(0, 0, 0, 0);
+
+        const timeDiff = Math.abs(endDate - startDate);
+        const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
+
+        if (diffDays > 31) { // maxDays-1 因为包含起始日
+          this.$message.warning('时间区间不能超过一个月');
+          return false;
+        }
+      }
+      return true;
+    },
     // 创建时间
     createChange(createTime) {
       if (createTime && createTime.length >= 2) {
-        const startDate = new Date(createTime[0]);
-        const endDate = new Date(createTime[1]);
-        const timeDiff = Math.abs(endDate.getTime() - startDate.getTime());
-        const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
-
-        // 限制时间区间为一个月
-        if (diffDays > 31) {
-          this.$message.warning('创建时间区间不能超过一个月');
+        if(!this.checkDateRangeLimit(createTime)){
           this.createTimeText = null;
-          this.queryParams.sTime = null;
-          this.queryParams.eTime = null;
+          this.queryParams.sTime=null;
+          this.queryParams.eTime=null;
           return;
         }
         // this.createTimeText = this.formatDateRange(createTime);
@@ -945,6 +975,12 @@ export default {
     // 更新时间
     updateChange(updateTime) {
       if (updateTime && updateTime.length >= 2) {
+        if(!this.checkDateRangeLimit(updateTime)){
+          this.updateTimeText = null;
+          this.queryParams.upSTime=null;
+          this.queryParams.upETime=null;
+          return;
+        }
         this.updateTimeText = this.formatDateRange(updateTime);
         this.queryParams.upSTime = updateTime[0] || null;
         this.queryParams.upETime = updateTime[1] || null;

+ 51 - 15
src/views/course/courseWatchLog/index.vue

@@ -832,6 +832,10 @@ export default {
     this.loading=false;
   },
   methods: {
+    // 添加辅助方法
+    isEmptyArray(arr) {
+      return !arr || arr.length === 0;
+    },
     setToday(){
       const today = new Date();
       const todayStart = new Date(today);
@@ -1019,10 +1023,35 @@ export default {
         this.videoList=response.list
       });
     },
+    checkDateRangeLimit(dateRange) {
+      if (dateRange && dateRange.length >= 2) {
+        const startDate = new Date(dateRange[0]);
+        const endDate = new Date(dateRange[1]);
+
+        // 设置时间为当天开始,避免时间部分影响计算
+        startDate.setHours(0, 0, 0, 0);
+        endDate.setHours(0, 0, 0, 0);
 
+        const timeDiff = Math.abs(endDate - startDate);
+        const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
+
+        if (diffDays > 31) { // maxDays-1 因为包含起始日
+          this.$message.warning('时间区间不能超过一个月');
+          return false;
+        }
+      }
+      return true;
+    },
     // 营期时间
     handleScheduleTimeChange(scheduleTime) {
       if (scheduleTime && scheduleTime.length >= 2) {
+        if(!this.checkDateRangeLimit(scheduleTime)){
+          this.scheduleTimeText = null;
+          this.queryParams.scheduleStartTime=null;
+          this.queryParams.scheduleStartTime=null;
+          return;
+        }
+
         // this.scheduleTimeText = this.formatDateRange(scheduleTime);
         this.queryParams.scheduleStartTime = scheduleTime[0] || null;
         this.queryParams.scheduleEndTime = scheduleTime[1] || null;
@@ -1037,17 +1066,10 @@ export default {
     // 创建时间
     createChange(createTime) {
       if (createTime && createTime.length >= 2) {
-        const startDate = new Date(createTime[0]);
-        const endDate = new Date(createTime[1]);
-        const timeDiff = Math.abs(endDate.getTime() - startDate.getTime());
-        const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
-
-        // 限制时间区间为一个月
-        if (diffDays > 31) {
-          this.$message.warning('创建时间区间不能超过一个月');
+        if(!this.checkDateRangeLimit(createTime)){
           this.createTimeText = null;
-          this.queryParams.sTime = null;
-          this.queryParams.eTime = null;
+          this.queryParams.sTime=null;
+          this.queryParams.eTime=null;
           return;
         }
 
@@ -1064,6 +1086,12 @@ export default {
     // 更新时间
     updateChange(updateTime) {
       if (updateTime && updateTime.length >= 2) {
+        if(!this.checkDateRangeLimit(updateTime)){
+          this.updateTimeText = null;
+          this.queryParams.upSTime=null;
+          this.queryParams.upETime=null;
+          return;
+        }
         // this.updateTimeText = this.formatDateRange(updateTime);
         this.queryParams.upSTime = updateTime[0] || null;
         this.queryParams.upETime = updateTime[1] || null;
@@ -1189,8 +1217,10 @@ export default {
     /** 查询短链课程看课记录列表 */
     getList() {
       // xgb 看课数据量太大必须限制时间
-      if (!this.createTimeText) {
-        this.$message.warning('请选择创建时间');
+      if (this.isEmptyArray(this.createTimeText) &&
+        this.isEmptyArray(this.updateTimeText) &&
+        this.isEmptyArray(this.scheduleTimeText)) {
+        this.$message.warning('请选择创建时间或营期时间或最新更新时间');
         return;
       }
 
@@ -1203,6 +1233,8 @@ export default {
         this.courseWatchLogList = response.rows;
         this.total = response.total;
         this.loading = false;
+      }).catch(() => {
+        this.loading = false;
       });
     },
     // 取消按钮
@@ -1261,7 +1293,6 @@ export default {
       this.queryParams.scheduleEndTime = null;
       this.queryParams.sopId = null; // 重置SOP ID
 
-      this.setToday();
 
       // 重置SOP搜索
       this.handleSopClear();
@@ -1269,6 +1300,8 @@ export default {
       // 统一重置日历组件
       this.resetCalendars();
 
+      this.setToday();
+
       this.handleQuery();
     },
     // 多选框选中数据
@@ -1329,8 +1362,11 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      if (!this.createTimeText) {
-        this.$message.warning('请选择创建时间');
+      // xgb 看课数据量太大必须限制时间
+      if (this.isEmptyArray(this.createTimeText) &&
+        this.isEmptyArray(this.updateTimeText) &&
+        this.isEmptyArray(this.scheduleTimeText)) {
+        this.$message.warning('请选择创建时间或营期时间或最新更新时间');
         return;
       }
       const queryParams = this.queryParams;

+ 57 - 21
src/views/course/courseWatchLog/watchLog.vue

@@ -930,10 +930,10 @@ export default {
       this.qecCreateTime = [];
       this.periodTime = [];
 
-      this.scheduleTimeText = '';
-      this.createTimeText = '';
-      this.updateTimeText = '';
-      this.qecCreateTimeText = '';
+      this.scheduleTimeText = [];
+      this.createTimeText = [];
+      this.updateTimeText = [];
+      this.qecCreateTimeText = [];
       this.periodTimeText = [];
 
       // 强制刷新日历组件
@@ -980,31 +980,48 @@ export default {
     // 营期时间
     handleScheduleTimeChange(scheduleTime) {
       if (scheduleTime && scheduleTime.length >= 2) {
+        if(!this.checkDateRangeLimit(scheduleTime)){
+          this.scheduleTimeText = null;
+          this.queryParams.scheduleStartTime=null;
+          this.queryParams.scheduleStartTime=null;
+          return;
+        }
+
         // this.scheduleTimeText = this.formatDateRange(scheduleTime);
         this.queryParams.scheduleStartTime = scheduleTime[0] || null;
         this.queryParams.scheduleEndTime = scheduleTime[1] || null;
-        console.log(this.queryParams.scheduleStartTime)
-        console.log(this.queryParams.scheduleEndTime)
       } else {
         this.scheduleTimeText = [];
         this.queryParams.scheduleStartTime = null;
         this.queryParams.scheduleEndTime = null;
       }
     },
+    checkDateRangeLimit(dateRange) {
+      if (dateRange && dateRange.length >= 2) {
+        const startDate = new Date(dateRange[0]);
+        const endDate = new Date(dateRange[1]);
+
+        // 设置时间为当天开始,避免时间部分影响计算
+        startDate.setHours(0, 0, 0, 0);
+        endDate.setHours(0, 0, 0, 0);
+
+        const timeDiff = Math.abs(endDate - startDate);
+        const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
+
+        if (diffDays > 31) { // maxDays-1 因为包含起始日
+          this.$message.warning('时间区间不能超过一个月');
+          return false;
+        }
+      }
+      return true;
+    },
     // 创建时间
     createChange(createTime) {
       if (createTime && createTime.length >= 2) {
-        const startDate = new Date(createTime[0]);
-        const endDate = new Date(createTime[1]);
-        const timeDiff = Math.abs(endDate.getTime() - startDate.getTime());
-        const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
-
-        // 限制时间区间为一个月
-        if (diffDays > 31) {
-          this.$message.warning('创建时间区间不能超过一个月');
+        if(!this.checkDateRangeLimit(createTime)){
           this.createTimeText = null;
-          this.queryParams.sTime = null;
-          this.queryParams.eTime = null;
+          this.queryParams.sTime=null;
+          this.queryParams.eTime=null;
           return;
         }
 
@@ -1021,6 +1038,13 @@ export default {
     // 更新时间
     updateChange(updateTime) {
       if (updateTime && updateTime.length >= 2) {
+        if(!this.checkDateRangeLimit(updateTime)){
+          this.updateTimeText = null;
+          this.queryParams.upSTime=null;
+          this.queryParams.upETime=null;
+          return;
+        }
+
         // this.updateTimeText = this.formatDateRange(updateTime);
         this.queryParams.upSTime = updateTime[0] || null;
         this.queryParams.upETime = updateTime[1] || null;
@@ -1133,11 +1157,14 @@ export default {
 
     /** 查询短链课程看课记录列表 */
     getList() {
-      // xgb 看课数据量太大必须限制时间
-      if (!this.createTimeText) {
-        this.$message.warning('请选择创建时间');
+      // xgb 看课数据量太大必须限制时间if (this.isEmptyArray(this.createTimeText) &&
+      if (this.isEmptyArray(this.createTimeText) &&
+        this.isEmptyArray(this.updateTimeText) &&
+        this.isEmptyArray(this.scheduleTimeText)) {
+        this.$message.warning('请选择创建时间或营期时间或最新更新时间');
         return;
       }
+
       this.loading = true;
       let param = JSON.parse(JSON.stringify(this.queryParams));
       if (param.logType == "10") {
@@ -1147,6 +1174,8 @@ export default {
         this.courseWatchLogList = response.rows;
         this.total = response.total;
         this.loading = false;
+      }).catch(() => {
+        this.loading = false;
       });
     },
     // 取消按钮
@@ -1272,10 +1301,17 @@ export default {
       }).catch(() => {
       });
     },
+    // 添加辅助方法
+    isEmptyArray(arr) {
+      return !arr || arr.length === 0;
+    },
     /** 导出按钮操作 */
     handleExport() {
-      if (!this.createTimeText) {
-        this.$message.warning('请选择创建时间');
+      // xgb 看课数据量太大必须限制时间
+      if (this.isEmptyArray(this.createTimeText) &&
+        this.isEmptyArray(this.updateTimeText) &&
+        this.isEmptyArray(this.scheduleTimeText)) {
+        this.$message.warning('请选择创建时间或营期时间或最新更新时间');
         return;
       }
       const queryParams = this.queryParams;

+ 174 - 513
src/views/qw/sop/updateSop.vue

@@ -1,151 +1,85 @@
 <template>
   <div class="app-container">
     <div style="margin: 30px;" v-if="handleType==1"> 修改sop任务</div>
-    <div style="margin: 30px;" v-if="handleType==2"> 查看sop任务</div>
+    <div style="margin: 30px;" v-if="handleType==2"> 查看sop任务
+      <div style="float: right">
+        <!--        <el-button-->
+        <!--          type="primary"-->
+        <!--          @click="handleUpdateTags()"-->
+        <!--          v-hasPermi="['qw:sop:remove']"-->
+        <!--        >修改标签</el-button>-->
+        <el-button
+          type="primary"
+          @click="handleUpdateQwUser()"
+          v-hasPermi="['qw:sop:updateSopQwUser']"
+        >修改员工</el-button>
+        <el-button
+          type="primary"
+          @click="handleUpdateSopTemp()"
+          v-hasPermi="['qw:sop:updateSopTemp']"
+        >修改模板</el-button>
+      </div>
+
+      <el-divider></el-divider>
+      <el-alert
+        title="注意事项"
+        type="warning"
+        description="【持续生成记录中的状态】 的SOP任务仅能查看,不能修改(ps:可以在外面修改【过期时间】和【新客户自动创建sop】)"
+        :closable="false"
+        show-icon>
+      </el-alert>
+    </div>
+
     <div style="margin-top: 10px;margin-left: 50px;margin-right: 100px;margin-bottom: 60px;">
 
-      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-form-item label="规则名称" prop="name">
-          <el-input v-model="form.name" placeholder="请输入规则名称"/>
+          <el-input v-model="form.name" placeholder="请输入规则名称" />
         </el-form-item>
-        <el-form-item label="类别" prop="type">
-          <el-radio-group v-model="form.type" @change="clearUser">
-            <!--            <el-radio-->
-            <!--              :label="1"-->
-            <!--            >个微-->
-            <!--            </el-radio>-->
-
-            <el-radio
-              :label="2"
-            >企微
-            </el-radio>
-          </el-radio-group>
-          <Tip title="针对于企业微信平台" />
+        <el-form-item label="状态" prop="status">
+          <dict-tag :options="statusOptions" :value="form.status"></dict-tag>
         </el-form-item>
-
-
-        <el-form-item label="筛选方式" prop="filterMode">
-          <el-radio-group v-model="form.filterMode">
+        <!--        <el-form-item label="状态">-->
+        <!--          <el-radio-group v-model="form.status">-->
+        <!--            <el-radio-->
+        <!--              v-for="dict in statusOptions"-->
+        <!--              :label="dict.dictValue"-->
+        <!--            >{{dict.dictLabel}}</el-radio>-->
+        <!--          </el-radio-group>-->
+        <!--        </el-form-item>-->
+        <el-form-item label="类别" prop="type">
+          <el-radio-group v-model="form.type">
             <el-radio
               :label="1"
-            >标签
-            </el-radio>
+            >个微</el-radio>
             <el-radio
               :label="2"
-            >群聊
-            </el-radio>
+            >企微</el-radio>
           </el-radio-group>
-          <Tip :title="'标签:根据企微客户的标签筛选客户进入SOP'" />
+          <Tip title="针对于企业微信平台" />
         </el-form-item>
-        <el-form-item label="小转天数" prop="minConversionDay" v-if="form.filterMode == 1">
-          <!--          <el-input class="el-input" type="" v-model="form.minConversionDay" placeholder="请输入" />-->
-          <el-input-number v-model="form.minConversionDay" :min="1" :max="100"></el-input-number>
+        <el-form-item label="小转天数" prop="minConversionDay">
+          <el-input class="el-input" v-model="form.minConversionDay" placeholder="请输入" style="width: 300px">
+            <template slot="append">天</template>
+          </el-input>
           <Tip title="第一次提醒销售,去联系客户,在【催课看板】处显示,哪些需要联系的客户" />
         </el-form-item>
-        <el-form-item label="大转天数" prop="maxConversionDay" v-if="form.filterMode == 1">
-          <!--          <el-input class="el-input" v-model="form.maxConversionDay" placeholder="请输入" />-->
-          <el-input-number v-model="form.maxConversionDay" :min="1" :max="100"></el-input-number>
+        <el-form-item label="大转天数" prop="maxConversionDay">
+          <el-input class="el-input" v-model="form.maxConversionDay" placeholder="请输入" style="width: 300px">
+            <template slot="append">天</template>
+          </el-input>
           <Tip title="第二次提醒销售,去联系客户,在【催课看板】处显示,哪些需要联系的客户" />
         </el-form-item>
-        <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%" v-if="form.filterMode == 2">
-          <div>
-            <el-button
-              size="medium"
-              icon="el-icon-circle-plus-outline"
-              plain
-              @click="handlelistUser(form.type,form.sendType, true)">请选择使用员工
-            </el-button>
-          </div>
-          <div>
-            <el-tag
-              style="margin-left: 5px"
-              size="medium"
-              :key="id"
-              v-for="id in userSelectList"
-              closable
-              :disable-transitions="false"
-              @close="handleClosegroupUser(id)">
-              <span v-for="list in companyQwUserList" :key="list.qwUserId"
-                    v-if="list.id==id">{{ list.qwUserName }}</span>
-            </el-tag>
-          </div>
-          <Tip title="企业微信员工账号" />
-        </el-form-item>
-        <el-form-item label="是否自动创建群" prop="autoGroup" v-if="form.filterMode == 2">
-          <el-radio-group v-model="form.autoGroup">
-            <el-radio
-              :label="0"
-            >否
-            </el-radio>
-            <el-radio
-              :label="1"
-            >是
-            </el-radio>
-          </el-radio-group>
-          <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
-            <i class="el-icon-info"></i>
-            选择的企业微信员工下面的群聊
-          </div>
-        </el-form-item>
-        <el-form-item label="是否注册用户" prop="autoGroup" v-if="form.filterMode == 2 && form.autoGroup == 1">
-          <el-radio-group v-model="form.autoUserReg">
-            <el-radio
-              :label="0"
-            >否
-            </el-radio>
-            <el-radio
-              :label="1"
-            >是
-            </el-radio>
-          </el-radio-group>
-          <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
-            <i class="el-icon-info"></i>
-            筛选是否注册的用户
-          </div>
-        </el-form-item>
-        <el-form-item label="创建群聊评级" prop="chatIds" v-if="form.filterMode == 2 && form.autoGroup == 1">
-          <el-select multiple filterable clearable v-model="form.autoGroupLevelArray">
-            <el-option v-for="item in levelList" :key="item.value" :label="item.label" :value="item.value"/>
-          </el-select>
-          <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
-            <i class="el-icon-info"></i>
-            选择需要拉取的客户评级
-          </div>
-        </el-form-item>
-        <el-form-item label="群聊名称" prop="chatIds" v-if="form.filterMode == 2 && form.autoGroup == 1">
-          <el-input v-model="form.groupName" maxlength="10" placeholder="请输入群聊名称" />
-          <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
-            <i class="el-icon-info"></i>
-            创建群聊的名称(如有重复自动加数字区分)
-          </div>
-        </el-form-item>
-        <el-form-item label="群聊" prop="chatIds" v-if="form.filterMode == 2 && form.autoGroup == 0">
-          <el-select multiple filterable clearable v-model="form.chatIds">
-            <el-option v-for="item in qwGroupList" :key="item.chatId" :label="item.name" :value="item.chatId"/>
-          </el-select>
-          <Tip title="选择的企业微信员工下面的群聊" />
-        </el-form-item>
-        <el-form-item label="客户评级" prop="isRating" style="margin-top: 2%" v-if="form.filterMode == 1">
-          <el-switch
-            v-model="form.isRating"
-            active-color="#13ce66"
-            inactive-color="#ff4949"
-            :active-value="1"
-            :inactive-value="2">
-          </el-switch>
-          <span v-if="form.isRating == '1'" style="margin-left: 10px;color: #13ce66">已开启</span>
-          <span v-if="form.isRating == '2'" style="margin-left: 10px;color: #ff4949">已关闭</span>
-          <Tip title="根据客户的【看课记录】进行评级,新进客户前4天不评级,第5天开始 根据客户近7天的看课记录进行评级 ABCD级" />
-        </el-form-item>
-        <div v-if="form.type==2 && form.filterMode == 1">
+
+        <div v-if="form.type==2">
+
           <el-form-item label="推送方式 ">
             <el-radio-group v-model="form.sendType" @input="handleSendTypeChange">
               <el-radio
                 v-for="dict in sysQwSopType"
                 :key="dict.dictValue"
                 :label="parseInt(dict.dictValue)"
-              >{{ dict.dictLabel }}
-              </el-radio>
+              >{{dict.dictLabel}}</el-radio>
             </el-radio-group>
             <Tip title="选择模板类型" />
           </el-form-item>
@@ -155,8 +89,7 @@
                 size="medium"
                 icon="el-icon-circle-plus-outline"
                 plain
-                @click="handlelistUser(form.type,form.sendType, false)">请选择使用员工
-              </el-button>
+                @click="handlelistUser(form.type,form.sendType)">请选择使用员工</el-button>
             </div>
             <div>
               <el-tag
@@ -164,127 +97,69 @@
                 size="medium"
                 :key="id"
                 v-for="id in userSelectList"
-                closable
                 :disable-transitions="false"
                 @close="handleClosegroupUser(id)">
-                <span v-for="list in companyQwUserList" :key="list.qwUserId"
-                      v-if="list.id==id">{{ list.qwUserName }}</span>
+                <span v-for="list in companyUserList" :key="list.qwUserId" v-if="list.id==id">{{list.qwUserName}}</span>
               </el-tag>
             </div>
-            <Tip title="选择的企业微信员工下面的群聊" />
           </el-form-item>
           <el-form-item label="标签规则" prop="filterType">
             <el-radio-group v-model="form.filterType">
               <el-radio
                 :label="1"
-              >含全部标签
-              </el-radio>
+              >含全部标签</el-radio>
               <el-radio
                 :label="2"
-              >含任意标签
-              </el-radio>
+              >含任意标签</el-radio>
             </el-radio-group>
-            <Tip :title="'含全部标签:客户要完全一对一匹配上选择标签,ps:多一个少一个都不行 \r\n含任意标签:客户只要有一个标签匹配上即可'" />
           </el-form-item>
           <el-form-item label="选择的标签" prop="tags">
-            <!--            <el-select v-model="tags" remote multiple placeholder="请选择" filterable  style="width: 100%;">-->
-            <!--              <el-option-->
-            <!--                v-for="dict in tagList"-->
-            <!--                :label="dict.name"-->
-            <!--                :value="dict.tagId">-->
-            <!--              </el-option>-->
-            <!--            </el-select>-->
-            <div @click="hangleChangeTags()"
-                 style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 390px">
-              <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
-                <el-tag type="success"
-                        closable
-                        :disable-transitions="false"
-                        v-for="list in this.tagsIdsChangeSelectList"
-                        :key="list.tagId"
-                        @close="handleCloseTags(list)"
-                        style="margin: 3px;"
-                >{{ list.name }}
-                </el-tag>
-              </div>
-            </div>
-            <Tip title="选择进入SOP任务的标签" />
+            <el-select v-model="tags" remote multiple placeholder="请选择" filterable  style="width: 100%;">
+              <el-option
+                v-for="dict in tagList"
+                :label="dict.name"
+                :value="dict.tagId">
+              </el-option>
+            </el-select>
+
           </el-form-item>
           <el-form-item label="排除的标签" prop="excludeTags">
-            <!--            <el-select v-model="excludeTags" remote multiple placeholder="请选择" filterable  style="width: 100%;">-->
-            <!--              <el-option-->
-            <!--                v-for="dict in tagList"-->
-            <!--                :label="dict.name"-->
-            <!--                :value="dict.tagId">-->
-            <!--              </el-option>-->
-            <!--            </el-select>-->
-            <div @click="hangleChangeOutTags()"
-                 style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 390px">
-              <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
-                <el-tag type="success"
-                        closable
-                        :disable-transitions="false"
-                        v-for="list in this.outTagsIdsChangeSelectList"
-                        :key="list.tagId"
-                        @close="handleCloseOutTags(list)"
-                        style="margin: 3px;"
-                >{{ list.name }}
-                </el-tag>
-              </div>
-            </div><Tip title="选择不想进入SOP的标签" />
+            <el-select v-model="excludeTags" remote multiple placeholder="请选择" filterable  style="width: 100%;">
+              <el-option
+                v-for="dict in tagList"
+                :label="dict.name"
+                :value="dict.tagId">
+              </el-option>
+            </el-select>
           </el-form-item>
         </div>
         <div v-if="form.type==1">
           <el-form-item label="推送方式 ">
             <el-tag type="success" v-model="form.sendType=2">AI插件</el-tag>
           </el-form-item>
-          <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%">
-            <div>
-              <el-button
-                size="medium"
-                icon="el-icon-circle-plus-outline"
-                plain
-                @click="handleCompanyUser(form.type,form.sendType)">请选择使用员工
-              </el-button>
-            </div>
-            <div>
-              <el-tag
-                style="margin-left: 5px"
-                size="medium"
-                :key="userId"
-                v-for="userId in userSelectList"
-                closable
-                :disable-transitions="false"
-                @close="handleClosegroupUser(userId)">
-                <span v-for="list in companyUserLists " :key="list.userId"
-                      v-if="list.userId==userId">{{ list.nickName }}</span>
-              </el-tag>
-            </div>
-          </el-form-item>
           <el-form-item label="标签规则" prop="filterType">
             <el-radio-group v-model="form.filterType">
               <el-radio
                 :label="1"
-              >含全部分组
-              </el-radio>
+              >含全部分组</el-radio>
               <el-radio
                 :label="2"
-              >含任意分组
-              </el-radio>
+              >含任意分组</el-radio>
             </el-radio-group>
           </el-form-item>
           <el-form-item label="选择的分组" prop="tags">
-            <el-select v-model="tags" remote multiple placeholder="请选择" filterable style="width: 100%;">
+            <el-select v-model="tags" remote multiple placeholder="请选择" filterable  style="width: 100%;">
               <el-option
                 v-for="dict in wxUserGroupList"
                 :label="dict.groupName"
-                :value="dict.groupId">
+                :value="dict.groupId.toString()">
               </el-option>
             </el-select>
 
           </el-form-item>
         </div>
-        <el-form-item label="是否固定营期" prop="isFixed" v-if="form.type != 3 && form.filterMode == 1">
+
+        <el-form-item label="是否固定营期" prop="isFixed" v-if="form.type != 3">
           <el-radio-group v-model="form.isFixed">
             <el-radio
               :label="1"
@@ -305,31 +180,35 @@
                           value-format="yyyy-MM-dd"
                           placeholder="选择开始时间">
           </el-date-picker>
-          <Tip title="SOP开始发送时间" />
         </el-form-item>
-        <el-form-item label="任务过期时间" prop="expiryTime">
-          <el-row>
-            <el-input-number v-model="form.expiryTime" :min="1" :max="100"></el-input-number>
-            (小时)
-          </el-row>
-          <Tip title="任务生成的代发送消息,如果超过此设置的时间还未发送,自动作废" />
+
+        <el-form-item label="是否只发送注册用户" prop="isRegister" v-if="form.type != 3">
+          <el-radio-group v-model="form.isRegister">
+            <el-radio
+              :label="1"
+            >是
+            </el-radio>
+            <el-radio
+              :label="0"
+            >否
+            </el-radio>
+          </el-radio-group>
+          <Tip title="是否只发送在平台注册了会员的客户" />
         </el-form-item>
-        <el-form-item v-if="(form.sendType==2 || form.sendType==4 || form.sendType==11) && form.type != 3 && form.isFixed == 0 && form.filterMode == 1" label="自动添加SOP"
-                      prop="autoSopTime.autoSopType">
+
+        <el-form-item v-if="form.sendType==2 || form.sendType==4" label="自动添加SOP" prop="autoSopTime" >
           <el-radio-group v-model="form.autoSopTime.autoSopType">
             <el-radio
               :label="1"
-            >当天开始
-            </el-radio>
+            >当天开始</el-radio>
             <el-radio
               :label="2"
-            >次日开始
-            </el-radio>
+            >次日开始</el-radio>
           </el-radio-group>
           <Tip :title="'这个选项仅作用于【新客户】进线时或【给客户打标签时】,是进入当日的营期 还是 次日的营期'" />
         </el-form-item>
         <div style="display: flex; align-items: center; flex-wrap: nowrap;">
-          <div v-if="form.autoSopTime.autoSopType==1 && form.isFixed == 0" style="display: flex; align-items: center">
+          <div v-if="form.autoSopTime.autoSopType==1" style="display: flex; align-items: center">
             <el-form-item
               label="起始时间"
               prop="autoStartTime"
@@ -363,47 +242,40 @@
                 }">
               </el-time-select>
             </el-form-item>
-            <Tip :title="'起始时间-结束时间之内的进线客户,进入【当日营期】,时间之外的,进入【次日营期】'" />
+            <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
+              <i class="el-icon-info"></i>
+              起始时间-结束时间之内的进线客户,进入【当日营期】,时间之外的,进入【次日营期】
+            </div>
           </div>
         </div>
-        <!--        <el-form-item v-if="form.autoSopTime.autoSopType==1" label="过期消息是否发送" prop="autoSopSend"-->
-        <!--                      label-width="130px">-->
-        <!--          <el-radio-group v-model="form.autoSopTime.autoSopSend">-->
-        <!--            <el-radio-->
-        <!--              :label="1"-->
-        <!--            >是-->
-        <!--            </el-radio>-->
-        <!--            <el-radio-->
-        <!--              :label="2"-->
-        <!--            >否-->
-        <!--            </el-radio>-->
-        <!--          </el-radio-group>-->
-        <!--        </el-form-item>-->
-
-
-        <el-form-item label="是否只发送注册用户" prop="isRegister" v-if="form.type != 3 && form.filterMode == 1">
-          <el-radio-group v-model="form.isRegister">
-            <el-radio
-              :label="1"
-            >是
-            </el-radio>
-            <el-radio
-              :label="0"
-            >否
-            </el-radio>
-          </el-radio-group>
-          <Tip title="是否只发送在平台注册了会员的客户" />
+        <el-form-item label="任务过期时间" prop="expiryTime">
+          <el-row>
+            <el-input-number  v-model="form.expiryTime"  :min="1" :max="100" ></el-input-number>
+            (小时)
+          </el-row>
+          <Tip title="发送sop任务消息的过期时间,超过这个时间,消息将不再发送(作废),比如:9点的消息,设置3个小时过期,12点之后还未发送 则这条消息将过期且不再发送" />
         </el-form-item>
-
         <el-form-item label="模板" prop="tempId">
-          <div @click="selectListSopTemp(form.sendType)"
-               style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;">
-            <el-tag v-if="form.tempId" type="success" style="margin: 3px;">
-              {{ form.tempName }}
+          <div @click="selectListSopTemp(form.sendType,0)" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;">
+            <el-tag type="success" style="margin: 3px;"
+                    :disable-transitions="false"
+                    v-for="list in tempList"
+                    :key="list.id"
+                    v-if="list.id === form.tempId">
+              {{ form.tempName || list.name }}
             </el-tag>
-            <span v-else style="margin: 3px; color: #999;">请点我选择模板</span>
+
+            <!-- 如果 form.tempId 没有值,显示 '请选择模板' -->
+            <span v-if="!form.tempId" style="margin: 3px; color: #999;">请选择模板</span>
           </div>
-          <Tip title="选择想要发送的模板规则" />
+          <!--          <el-select v-model="form.tempId"  @focus="selectListSopTemp(form.sendType)" placeholder="请选择模板" v-loading="tempListLoading"   >-->
+          <!--            <el-option-->
+          <!--              v-for="dict in tempList"-->
+          <!--              :label="dict.name"-->
+          <!--              :value="dict.id">-->
+          <!--            </el-option>-->
+          <!--            <div v-if="tempListLoading" slot="prefix" class="select-prefix">正在查询相应模板...</div>-->
+          <!--          </el-select>-->
         </el-form-item>
 
         <el-form-item label="开启评论/弹幕" prop="openCommentStatus">
@@ -414,73 +286,50 @@
           </el-radio-group>
         </el-form-item>
       </el-form>
-      <div slot="footer" class="dialog-footer" style="display: flex;justify-content: flex-end;">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
+      <div slot="footer" class="dialog-footer" style="float: right;" >
+        <el-button v-if="handleType==1" type="primary" @click="submitForm">确 定</el-button>
+        <el-button v-if="handleType==1" @click="cancel">取 消</el-button>
+
       </div>
-      <el-dialog :title="listUser.title" :visible.sync="listUser.open" width="700px" append-to-body>
+      <el-dialog :custom-class="'fixed-dialog'" :title="listUser.title" :visible.sync="listUser.open" width="700px" append-to-body>
         <qwUserList ref="QwUserList" @selectUserList="selectUserList"></qwUserList>
       </el-dialog>
-
-      <el-dialog :title="companyUser.title" :visible.sync="companyUser.open" width="700px" append-to-body>
-        <company-user-list ref="companyUserList" @selectCompanyUserList="selectCompanyUserList"></company-user-list>
+      <el-dialog title="选择模板"  :visible.sync="tempOpen" append-to-body  >
+        <sop-temp ref="SopTempComments" @sopTemp="sopTemp" @submitUpdateTemp="submitUpdateTemp"></sop-temp>
       </el-dialog>
-
-      <el-dialog title="选择模板" :visible.sync="tempOpen" append-to-body>
-        <sop-temp ref="SopTempComments" @sopTemp="sopTemp"></sop-temp>
-      </el-dialog>
-
-      <!--  选择/排除标签   -->
-      <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" width="800px" append-to-body>
-
-        <div>搜索标签:
-          <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small"
-                    style="width: 200px;margin-right: 10px"/>
-          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags">搜索</el-button>
-          <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
-        </div>
-        <div v-for="item in tagGroupList" :key="item.id">
-          <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
-            <span class="name-background">{{ item.name }}</span>
-          </div>
-          <!-- 添加外层滚动容器 -->
-          <div class="scroll-wrapper">
-            <div class="tag-container">
-              <a
-                v-for="tagItem in item.tag"
-                class="tag-box"
-                @click="tagSelection(tagItem)"
-                :class="{ 'tag-selected': tagItem.isSelected }"
-              >
-                {{ tagItem.name }}
-              </a>
+      <!--  修改模板  -->
+      <el-dialog :title="updateQwUserDialog.title" :visible.sync="updateQwUserDialog.open" width="500px" append-to-body>
+        <el-form ref="form" :model="form" label-width="100px">
+          <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%">
+            <div>
+              <el-button
+                size="medium"
+                icon="el-icon-circle-plus-outline"
+                plain
+                @click="handlelistUser(form.type,form.sendType)">请选择使用员工</el-button>
             </div>
-          </div>
-          <!--          <div class="tag-container">-->
-          <!--            <a-->
-          <!--              v-for="tagItem in item.tag"-->
-          <!--              class="tag-box"-->
-          <!--              @click="tagSelection(tagItem)"-->
-          <!--              :class="{ 'tag-selected': tagItem.isSelected }"-->
-          <!--            >-->
-          <!--              {{ tagItem.name }}-->
-          <!--            </a>-->
-          <!--          </div>-->
-        </div>
-
-        <pagination
-          v-show="total>0"
-          :total="total"
-          :page.sync="queryTagParams.pageNum"
-          :limit.sync="queryTagParams.pageSize"
-          @pagination="cancelSearchTags"
-        />
-        <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="tagSubmitForm(changeTagDialog.type)">确 定</el-button>
-          <el-button @click="tagCancel(changeTagDialog.type)">取消</el-button>
+            <div>
+              <el-tag
+                style="margin-left: 5px"
+                size="medium"
+                :key="id"
+                v-for="id in userSelectList"
+                closable
+                :disable-transitions="false"
+                @close="handleClosegroupUser(id)">
+                <span v-for="list in companyUserList" :key="list.qwUserId" v-if="list.id==id">{{list.qwUserName}}</span>
+              </el-tag>
+            </div>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer" >
+          <el-button  type="primary" @click="submitUpdateQwUser">确 定</el-button>
+          <el-button  @click="cancel">取 消</el-button>
         </div>
       </el-dialog>
+
     </div>
+
   </div>
 </template>
 
@@ -492,28 +341,18 @@ import qwUserList from '@/views/qw/user/qwUserList.vue'
 import ImageUpload from "@/views/qw/sop/ImageUpload";
 import CustomerGroupDetails from '@/views/qw/groupMsg/customerGroupDetails.vue'
 import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
-import {listTag, getTag, searchTags,} from "@/api/qw/tag";
-import { getMyQwUserList,getMyQwCompanyList,getQwUserByIds } from "@/api/qw/user";
+import { listTag, getTag, } from "@/api/qw/tag";
+import { getMyQwUserList,getMyQwCompanyList } from "@/api/qw/user";
 import {sopListWxUserGroup} from "@/api/wxUser/wxUserGroup";
 import source from "echarts/src/data/Source";
 import SopTemp from "@/views/qw/sopTemp/sopTemp.vue";
 import Tip from "../../../components/Tip/index.vue";
-import companyUserList from "@/views/company/companyUser/companyUserList.vue";
-import {allListTagGroup} from "@/api/qw/tagGroup";
 // import { ElMessageBox } from 'element-plus';
 export default {
   name: "updateSop",
-  components: {companyUserList, Tip, SopTemp, CustomerGroupDetails, qwUserList,ImageUpload,sopLogsDetails},
+  components: {Tip, SopTemp, CustomerGroupDetails, qwUserList,ImageUpload,sopLogsDetails},
   data() {
     return {
-      levelList: [
-        {value: 1, label: "A"},
-        {value: 2, label: "B"},
-        {value: 3, label: "C"},
-        {value: 4, label: "D"},
-        {value: 5, label: "E"},
-        {value: -1, label: "未评级"},
-      ],
       updateQwUserDialog:{
         title:"修改成员",
         open:false
@@ -560,43 +399,17 @@ export default {
 
       //个微客户的分组
       wxUserGroupList:[],
-      tagsIdsChangeSelectList: null,
-      //排除的标签
-      outTagsIdsChangeSelectList: null,
-      //添加的标签
-      addTagsIdsChangeSelectList: null,
 
       sopLogsDialog:{
         title:'',
         open:false,
         sopLogsForm:[],
       },
-      queryTagParams: {
-        pageNum: 1,
-        pageSize: 5,
-        total: 0,
-        name: null,
-        corpId: null,
-      },
-      //标签组
-      tagGroupList: [],
-      //标签
-      changeTagDialog: {
-        title: "",
-        open: false,
-        type: null,
-      },
-      companyUser: {
-        title: "",
-        open: false
-      },
-      companyQwUserList: [],
       // 表单参数
       form: {
         status: 1,
         sendType:2,
         type: 2,
-        autoGroupLevelArray:[],
         filterType:2,
         autoSopTime:{},
       },
@@ -649,146 +462,6 @@ export default {
     }
   },
   methods: {
-    handleSearchTags() {
-
-      if (!this.queryTagParams.name){
-        return this.$message.error("请输入要搜索的标签")
-      }
-      searchTags(this.queryTagParams).then(response => {
-        this.tagGroupList = response.rows;
-        this.total = response.total;
-      });
-
-    },
-    cancelSearchTags() {
-      allListTagGroup(this.queryTagParams).then(response => {
-        this.tagGroupList = response.rows;
-        this.total = response.total;
-      });
-
-      listTag(this.queryTagParams).then(response => {
-        this.tagList = response.rows;
-      });
-    },
-    //标签的选择
-    tagSelection(row) {
-      row.isSelected = !row.isSelected;
-      this.$forceUpdate();
-    },
-    //确定选择标签
-    tagSubmitForm(type) {
-
-      if (type == 1) {
-        for (let i = 0; i < this.tagGroupList.length; i++) {
-          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
-            if (this.tagGroupList[i].tag[x].isSelected === true) {
-
-              if (!this.tagsIdsChangeSelectList) {
-                this.tagsIdsChangeSelectList = [];
-              }
-
-              // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
-              let tagExists = this.tagsIdsChangeSelectList.some(
-                tag => tag.id === this.tagGroupList[i].tag[x].id
-              );
-
-              // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
-              if (!tagExists) {
-                this.tagsIdsChangeSelectList.push(this.tagGroupList[i].tag[x]);
-              }
-            }
-          }
-        }
-        if (!this.tagsIdsChangeSelectList || this.tagsIdsChangeSelectList.length === 0) {
-          return this.$message('请选择标签');
-        }
-
-      } else if (type == 2) {
-
-        for (let i = 0; i < this.tagGroupList.length; i++) {
-          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
-            if (this.tagGroupList[i].tag[x].isSelected === true) {
-
-              if (!this.outTagsIdsChangeSelectList) {
-                this.outTagsIdsChangeSelectList = [];
-              }
-
-              // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
-              let tagExists = this.outTagsIdsChangeSelectList.some(
-                tag => tag.id === this.tagGroupList[i].tag[x].id
-              );
-
-              // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
-              if (!tagExists) {
-                this.outTagsIdsChangeSelectList.push(this.tagGroupList[i].tag[x]);
-              }
-            }
-          }
-        }
-        if (!this.outTagsIdsChangeSelectList || this.outTagsIdsChangeSelectList.length === 0) {
-          return this.$message('请选择标签');
-        }
-
-      }
-      this.changeTagDialog.open = false;
-    },
-
-    //取消选择标签
-    tagCancel() {
-      this.changeTagDialog.open = false;
-    },
-
-    //选择标签
-    hangleChangeTags() {
-
-      this.changeTagDialog.title = "选择标签"
-      this.changeTagDialog.open = true;
-      this.changeTagDialog.type = 1;
-
-      // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
-      const selectedTagIds = new Set(
-        (this.tagsIdsChangeSelectList || []).map(tagItem => tagItem?.tagId)
-      );
-      for (let i = 0; i < this.tagGroupList.length; i++) {
-        for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
-          this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
-        }
-      }
-
-    },
-    //选择排除标签
-    hangleChangeOutTags() {
-      this.changeTagDialog.title = "选择排除的标签"
-      this.changeTagDialog.open = true;
-      this.changeTagDialog.type = 2;
-
-      // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
-      const selectedTagIds = new Set(
-        (this.outTagsIdsChangeSelectList || []).map(tagItem => tagItem?.tagId)
-      );
-      for (let i = 0; i < this.tagGroupList.length; i++) {
-        for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
-          this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
-        }
-      }
-    },
-    //销售员工
-    selectCompanyUserList(list) {
-
-      this.companyUser.open = false;
-      list.forEach(obj => {
-        if (!this.userSelectList.some(item => item == obj.userId)) {
-          this.userSelectList.push(obj.userId);
-        }
-      });
-    },
-    //选择销售员工时
-    handleCompanyUser(type, sendType) {
-
-      this.companyUser.title = "选择销售"
-      this.companyUser.open = true;
-
-    },
     submitUpdateQwUser(){
       this.form.qwUserIds = this.userSelectList.join(",");
       const data ={
@@ -800,11 +473,11 @@ export default {
         '<span style="color: red;">(如有删除员工,对应的【营期也会删除】且【不可恢复】,请谨慎操作)</span>',
         "警告",
         {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
-      }).then(() => {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }).then(() => {
         this.updateQwUserDialog.open=false;
         return updateSopQwUser(data);
       }).then(response => {
@@ -915,6 +588,7 @@ export default {
     //删除员工
     handleClosegroupUser(id){
       // const index = this.userSelectList.findIndex(t => t === list);
+      console.log(id)
       // if (index !== -1) {
       //   this.userSelectList.splice(index, 1);
       // }
@@ -971,14 +645,6 @@ export default {
         if (this.form.setting!=null){
           this.setting=JSON.parse(this.form.setting);
         }
-        if(this.form.autoGroupLevel != null){
-          this.form.autoGroupLevelArray = this.form.autoGroupLevel.split(",").map(Number);
-        }
-        if(this.form.qwUserIds != null){
-          getQwUserByIds(this.form.qwUserIds).then(res => {
-            this.companyQwUserList = res.data;
-          })
-        }
 
         listSopTemp({id:this.form.tempId}).then(response => {
           this.tempList = response.rows;
@@ -1001,7 +667,6 @@ export default {
         type: 2,
         filterType:2,
         qwUserIds: null,
-        autoGroupLevelArray:[],
         corpId: null,
         setting: null,
         createBy: null,
@@ -1017,10 +682,6 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
-    clearUser() {
-      this.userSelectList = [];
-      this.tags = null;
-    },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)

+ 92 - 136
src/views/qw/sopTemp/updateSopTemp.vue

@@ -496,26 +496,26 @@
                                             </el-card>
                                           </div>
                                         </el-form-item>
-<!--                                        <el-form-item label="添加短链"-->
-<!--                                                      v-if="content.type == 2 && setList.contentType == 1  ">-->
-<!--                                          <el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark"-->
-<!--                                                      :disabled="!content.videoId">-->
-<!--                                            <el-switch-->
-<!--                                              @change="updateHtml"-->
-<!--                                              v-model="setList.isBindUrl"-->
-<!--                                              :disabled="!content.videoId && formType == 3 && !roles.includes('edit_sop_temp_content')"-->
-<!--                                              active-color="#13ce66"-->
-<!--                                              inactive-color="#DCDFE6"-->
-<!--                                              active-value="1"-->
-<!--                                              inactive-value="2">-->
-<!--                                            </el-switch>-->
-<!--                                          </el-tooltip>-->
-
-<!--                                          <span v-if="setList.isBindUrl == '1'"-->
-<!--                                                style="margin-left: 10px; color: #13ce66">添加URL</span>-->
-<!--                                          <span v-if="setList.isBindUrl == '2'"-->
-<!--                                                style="margin-left: 10px; color: #b1b4ba">不加URL</span>-->
-<!--                                        </el-form-item>-->
+                                        <!--                                        <el-form-item label="添加短链"-->
+                                        <!--                                                      v-if="content.type == 2 && setList.contentType == 1  ">-->
+                                        <!--                                          <el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark"-->
+                                        <!--                                                      :disabled="!content.videoId">-->
+                                        <!--                                            <el-switch-->
+                                        <!--                                              @change="updateHtml"-->
+                                        <!--                                              v-model="setList.isBindUrl"-->
+                                        <!--                                              :disabled="!content.videoId && formType == 3 && !roles.includes('edit_sop_temp_content')"-->
+                                        <!--                                              active-color="#13ce66"-->
+                                        <!--                                              inactive-color="#DCDFE6"-->
+                                        <!--                                              active-value="1"-->
+                                        <!--                                              inactive-value="2">-->
+                                        <!--                                            </el-switch>-->
+                                        <!--                                          </el-tooltip>-->
+
+                                        <!--                                          <span v-if="setList.isBindUrl == '1'"-->
+                                        <!--                                                style="margin-left: 10px; color: #13ce66">添加URL</span>-->
+                                        <!--                                          <span v-if="setList.isBindUrl == '2'"-->
+                                        <!--                                                style="margin-left: 10px; color: #b1b4ba">不加URL</span>-->
+                                        <!--                                        </el-form-item>-->
                                         <el-form-item label="课节过期时间"
                                                       v-if="content.type == 2 && (setList.isBindUrl == '1' || setList.contentType==4) && setList.contentType != 2  && setList.contentType != 5  && setList.contentType != 6 && setList.contentType != 8 && setList.contentType != 9 && setList.contentType != 10  ">
                                           <el-row>
@@ -543,25 +543,25 @@
                                           </el-input-number>
                                           <span class="tip">单位:分钟,最大1440分钟(24小时)</span>
                                         </el-form-item>
-<!--                                        <el-form-item label="内容" style="margin: 2%">-->
-<!--                                          <el-input-->
-<!--                                            v-model="setList.value"-->
-<!--                                            type="textarea"-->
-<!--                                            :rows="3"-->
-<!--                                            placeholder="内容"-->
-<!--                                            style="width: 90%;margin-top: 10px;"/>-->
-<!--                                        </el-form-item>-->
-<!--                                        <el-form-item label="交流状态" style="margin: 2%">-->
-<!--                                          <el-select v-model="setList.talkType" placeholder="更改交流状态" size="mini"-->
-<!--                                                     style=" margin-right: 10px;" clearable>-->
-<!--                                            <el-option label="非首次交流" value="非首次交流"></el-option>-->
-<!--                                            <el-option label="首次交流1" value="首次交流1"></el-option>-->
-<!--                                            <el-option label="首次交流2" value="首次交流2"></el-option>-->
-<!--                                            <el-option label="交流状态1" value="交流状态1"></el-option>-->
-<!--                                            <el-option label="交流状态2" value="交流状态2"></el-option>-->
-<!--                                            <el-option label="交流状态3" value="交流状态3"></el-option>-->
-<!--                                          </el-select>-->
-<!--                                        </el-form-item>-->
+                                        <!--                                        <el-form-item label="内容" style="margin: 2%">-->
+                                        <!--                                          <el-input-->
+                                        <!--                                            v-model="setList.value"-->
+                                        <!--                                            type="textarea"-->
+                                        <!--                                            :rows="3"-->
+                                        <!--                                            placeholder="内容"-->
+                                        <!--                                            style="width: 90%;margin-top: 10px;"/>-->
+                                        <!--                                        </el-form-item>-->
+                                        <!--                                        <el-form-item label="交流状态" style="margin: 2%">-->
+                                        <!--                                          <el-select v-model="setList.talkType" placeholder="更改交流状态" size="mini"-->
+                                        <!--                                                     style=" margin-right: 10px;" clearable>-->
+                                        <!--                                            <el-option label="非首次交流" value="非首次交流"></el-option>-->
+                                        <!--                                            <el-option label="首次交流1" value="首次交流1"></el-option>-->
+                                        <!--                                            <el-option label="首次交流2" value="首次交流2"></el-option>-->
+                                        <!--                                            <el-option label="交流状态1" value="交流状态1"></el-option>-->
+                                        <!--                                            <el-option label="交流状态2" value="交流状态2"></el-option>-->
+                                        <!--                                            <el-option label="交流状态3" value="交流状态3"></el-option>-->
+                                        <!--                                          </el-select>-->
+                                        <!--                                        </el-form-item>-->
                                       </el-form>
                                     </el-col>
                                     <el-col :span="1" :offset="1">
@@ -663,7 +663,7 @@
   cursor: pointer;
 }
 
-.custom-input /deep/ .el-badge__content.is-fixed {
+/deep/ .el-badge__content.is-fixed {
   top: 10px !important;
   right: 0 !important;
   width: 8px;
@@ -708,8 +708,6 @@ export default {
   components: {ImageUpload, userVideo, draggable},
   data() {
     return {
-      tabDataCache: {}, // tab数据缓存
-      tabLoadingStates: {}, // tab加载状态跟踪
       projectFrom:process.env.VUE_APP_PROJECT_FROM,
       addTag: [{
         addTag: [],
@@ -980,95 +978,46 @@ export default {
     leave(index, oldIndex) {
       const newData = this.setting[index]
       if (newData.dayNum && newData.id) {
-        // 检查是否有缓存数据
-        if (this.tabDataCache[newData.id]) {
-          // 使用缓存数据
-          this.applyCachedData(index, newData, this.tabDataCache[newData.id]);
-          // 预加载下一个tab数据
-          this.preloadNextTab(index);
-          return true;
-        }
-
-        // 防止重复请求同一tab数据
-        if (this.tabLoadingStates[newData.id]) {
-          return false;
-        }
-
-        this.tabLoadingStates[newData.id] = true;
         this.loading = true;
-
         selectRulesInfo(newData.id).then(res => {
-          // 缓存当前tab数据
-          this.tabDataCache[newData.id] = res.data;
-          this.applyCachedData(index, newData, res.data);
-          this.loading = false;
-          this.tabLoadingStates[newData.id] = false;
-
-          // 预加载下一个tab数据
-          this.preloadNextTab(index);
-        }).catch(() => {
-          this.loading = false;
-          this.tabLoadingStates[newData.id] = false;
-        });
-      }
-      return false;
-    },
+          this.$nextTick(() => {
+            this.loading = false;
+            this.videoList = [];
+            this.addTag = [];
+            this.$set(this.setting, index, {
+              ...newData,
+              voice: res.data.voice,
+              content: res.data.list || [{type: this.defaultContentType, contentType: '1', setting: [{contentType: '1', value: ""}]}]
+            });
 
-    // 应用缓存数据到tab
-    applyCachedData(index, newData, cachedData) {
-      this.$nextTick(() => {
-        this.videoList = [];
-        this.addTag = [];
-        this.$set(this.setting, index, {
-          ...newData,
-          voice: cachedData.voice,
-          content: cachedData.list || [{type: this.defaultContentType, contentType: '1', setting: [{contentType: '1', value: ""}]}]
-        });
+            for (let j = 0; j < this.setting[index].content.length; j++) {
 
-        for (let j = 0; j < this.setting[index].content.length; j++) {
-          if (this.setting[index].content[j].addTag != null) {
-            this.setting[index].content[j].addTag = JSON.parse(this.setting[index].content[j].addTag)
-          }
-          if (this.setting[index].content[j].delTag != null) {
-            this.setting[index].content[j].delTag = JSON.parse(this.setting[index].content[j].delTag)
-          }
-          this.videoList.push([])
-          this.addTag.push({
-            addTag: [],
-            inputVisible: false,
-            inputValue: '',
-            delTag: [],
-            delTagVisible: false,
-            delTagValue: ''
-          })
-          if (this.setting[index].content[j].type == 2) {
-            if (this.setting[index].content[j].hasOwnProperty('courseId')) {
-              this.courseChange(this.setting[index].content[j], index, j);
+              if (this.setting[index].content[j].addTag != null) {
+                this.setting[index].content[j].addTag = JSON.parse(this.setting[index].content[j].addTag)
+              }
+              if (this.setting[index].content[j].delTag != null) {
+                this.setting[index].content[j].delTag = JSON.parse(this.setting[index].content[j].delTag)
+              }
+              this.videoList.push([])
+              this.addTag.push({
+                addTag: [],
+                inputVisible: false,
+                inputValue: '',
+                delTag: [],
+                delTagVisible: false,
+                delTagValue: ''
+              })
+              if (this.setting[index].content[j].type == 2) {
+                if (this.setting[index].content[j].hasOwnProperty('courseId')) {
+                  this.courseChange(this.setting[index].content[j], index, j);
+                }
+              }
             }
-          }
-        }
-      })
-    },
-
-    // 预加载下一个tab数据
-    preloadNextTab(currentIndex) {
-      const nextIndex = (parseInt(currentIndex) + 1) % this.setting.length;
-      if (nextIndex !== parseInt(currentIndex) && this.setting[nextIndex] && this.setting[nextIndex].id) {
-        const nextTabId = this.setting[nextIndex].id;
-
-        // 如果下一个tab数据还没有缓存且未在加载中,则预加载
-        if (!this.tabDataCache[nextTabId] && !this.tabLoadingStates[nextTabId]) {
-          this.tabLoadingStates[nextTabId] = true;
-          selectRulesInfo(nextTabId).then(res => {
-            this.tabDataCache[nextTabId] = res.data;
-            this.tabLoadingStates[nextTabId] = false;
-          }).catch(() => {
-            this.tabLoadingStates[nextTabId] = false;
-          });
-        }
+          })
+        });
       }
-    },
 
+    },
     save() {
       let data = this.setting[this.tabIndex];
       let check = this.checkData(data);
@@ -1134,7 +1083,6 @@ export default {
         this.loading = false;
       });
     },
-
     checkData(data) {
       if (this.form.sendType != 4) {
 
@@ -1339,10 +1287,12 @@ export default {
           content[contentIndex].setting.push(newSetting);
         }
       }
-    },
 
+
+    },
     delSetList(index, contentIndex, setIndex) {
       this.setting[index].content[contentIndex].setting.splice(setIndex, 1)
+
     },
 
     addContent(index) {
@@ -1391,6 +1341,7 @@ export default {
         dayNum: (this.form.gap * this.setting.length) + 1,
         content
       })
+
     },
     delSetting(index) {
       const newData = this.setting[index]
@@ -1407,6 +1358,7 @@ export default {
       } else {
         this.del(index);
       }
+
     },
     del(index) {
       if (index == 0) {
@@ -1459,13 +1411,18 @@ export default {
 
     //修改
     courseChangeUpdate(content, index, countIndex) {
+
       this.$set(content, 'videoId', null);
       // 查找选中的课程对应的 label
       const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === content.courseId);
       for (let i = 0; i < content.setting.length; i++) {
+
+
         this.$set(content.setting[i], 'linkTitle', null);
         this.$set(content.setting[i], 'linkDescribe', null);
         this.$set(content.setting[i], 'linkImageUrl', null);
+
+
         //如果是链接的才上
         if (selectedCourse && content.type == 2 && content.courseId != null) {
           //响应式直接给链接的标题/封面上值
@@ -1477,22 +1434,31 @@ export default {
           if (content.setting[i].contentType == 4 || content.setting[i].contentType == 10) {
             this.$set(content.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
           }
+
+
         }
       }
+
+
       this.courseUpdate(content, index, countIndex);
     },
     handleInputVideoText(value, content) {
       // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
       const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
+
       // 删除不符合条件的字符
       const filteredValue = value.split('').filter(char => regex.test(char)).join('');
+
       this.$set(content, 'value', filteredValue);
+
     },
     courseUpdate(content, index, countIndex) {
       videoList(content.courseId).then(response => {
         // this.$set(this.videoList, countIndex, response.list); // 响应式设置videoList
         this.videoList.splice(countIndex, 1, response.list);
+
       });
+
     },
     toggleSalesCall(itemIndex, contentIndex, setIndex) {
       // 获取目标对象
@@ -1840,9 +1806,6 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(id) {
       getSopTemp(id).then(response => {
-        this.tabDataCache = {}; // 清空缓存
-        this.tabLoadingStates = {}; // 清空加载状态
-
         this.videoList = []
         this.form = response.data;
         this.setting = this.form.list || [];
@@ -1883,13 +1846,6 @@ export default {
             });
           }
         });
-        // 默认加载第一个 tab 的数据
-        if (this.setting && this.setting.length > 0) {
-          this.tabIndex = "0";
-          this.$nextTick(() => {
-            this.leave(0);
-          });
-        }
         // this.addTag.push({
         //   addTag: [],
         //   inputVisible: false,