Просмотр исходного кода

1.恢复清空默认文本功能

jzp 1 месяц назад
Родитель
Сommit
d2a0900695

+ 3 - 5
src/views/company/companyUser/index.vue

@@ -1547,12 +1547,10 @@ export default {
 
     submitBindReplyTxt() {
       // 验证回复内容不能为空
-      if (!this.bindReplyTxtForm.replyText || !this.bindReplyTxtForm.replyText.trim()) {
-        this.$message.error('回复内容不能为空');
-        return;
-      }
+      // 将空值转换为空字符串,而不是 null
+      const replyText = this.bindReplyTxtForm.replyText ? this.bindReplyTxtForm.replyText.trim() : "";
 
-      bindCompanyUserReplyTxt({ replyText: this.bindReplyTxtForm.replyText.trim() }, this.ids).then(response => {
+      bindCompanyUserReplyTxt({ replyText: replyText }, this.ids).then(response => {
         if (response.code === 200) {
           this.$message.success('默认回复文本设置成功');
           this.bindReplyTxtViewOpen = false;

+ 11 - 4
src/views/company/components/selectQwUser.vue

@@ -46,7 +46,7 @@
       @selection-change="handleSelectionChange"
     >
       <!-- 添加多选列 -->
-      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column type="selection" width="55" align="center" :selectable="checkSelectable"/>
       <el-table-column label="企微昵称" align="center" prop="qwUserName" />
       <el-table-column label="企微账号" align="center" prop="qwUserId" />
       <el-table-column label="企微所属部门" align="center" prop="departmentName" />
@@ -129,6 +129,10 @@ export default {
     updateCorpId(){
       this.getList();
     },
+    // 检查是否可选择(状态不为1的用户才可选择)
+    checkSelectable(row, index) {
+      return row.status !== 1;
+    },
     /** 查询客户列表 */
     getList() {
       this.loading = true;
@@ -148,9 +152,10 @@ export default {
     // 设置预选中的项
     setPreSelectedItems() {
       if (this.preSelectedUserIds.length > 0 && this.customerList.length > 0) {
-        // 找到需要预选中的行
+        // 找到需要预选中的行,排除状态为1的用户
         const selectedRows = this.customerList.filter(row =>
-          this.preSelectedUserIds.includes(row.id)
+          this.preSelectedUserIds.includes(row.id) &&
+          row.status !== 1
         );
 
         // 设置选中状态
@@ -164,7 +169,9 @@ export default {
 
     // 多选处理
     handleSelectionChange(selection) {
-      this.selectedUsers = selection;
+      this.selectedUsers = selection.filter(item =>
+        item.status !== 1
+      );
     },
 
     // 批量绑定选择