Browse Source

修改企微客户状态

ct 3 days ago
parent
commit
63f65bcc50

+ 9 - 0
src/api/qw/externalContact.js

@@ -158,6 +158,15 @@ export function updateExternalContactCall(data) {
     data: data
     data: data
   })
   })
 }
 }
+
+//修改用户的状态
+export function updateExternalContactStatus(query) {
+  return request({
+    url: '/qw/externalContact/status',
+    method: 'get',
+    params: query
+  })
+}
 // 修改企业微信客户
 // 修改企业微信客户
 export function editStatus(data) {
 export function editStatus(data) {
   return request({
   return request({

+ 70 - 2
src/views/qw/externalContact/index.vue

@@ -498,7 +498,7 @@
              @click="handleMemberdetails(scope.row)"
              @click="handleMemberdetails(scope.row)"
              v-if="scope.row.fsUserId"
              v-if="scope.row.fsUserId"
              >
              >
-             <span>会员详</span>
+             <span>会员详</span>
           </el-button>
           </el-button>
           <el-button
           <el-button
              size="mini"
              size="mini"
@@ -508,6 +508,15 @@
              >
              >
              <span>信息采集</span>
              <span>信息采集</span>
           </el-button>
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleChangeStatus(scope.row)"
+            v-hasPermi="['qw:externalContact:changeStatus']"
+          >
+            修改状态
+          </el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -778,6 +787,25 @@
   <el-dialog :title="collection.title" :visible.sync="collection.open"   width="1100px" append-to-body>
   <el-dialog :title="collection.title" :visible.sync="collection.open"   width="1100px" append-to-body>
 	  <collection   ref="collection" />
 	  <collection   ref="collection" />
 	</el-dialog>
 	</el-dialog>
+
+  <el-dialog title="修改客户状态" :visible.sync="statusDialog.open" width="500px" append-to-body>
+    <el-form ref="statusForm" :model="statusForm" :rules="statusRules" label-width="100px">
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="statusForm.status" placeholder="请选择状态" size="small">
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="statusDialog.open = false">取 消</el-button>
+      <el-button type="primary" @click="submitStatusForm">提 交</el-button>
+    </div>
+  </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -797,7 +825,7 @@ import {
   setCustomerCourseSop,
   setCustomerCourseSop,
   getCustomerCourseSop,
   getCustomerCourseSop,
   setCustomerCourseSopList,
   setCustomerCourseSopList,
-  unBindUserId, updateExternalContactCall
+  unBindUserId, updateExternalContactCall,updateExternalContactStatus
 } from '@/api/qw/externalContact'
 } from '@/api/qw/externalContact'
 import {getMyQwUserList, getMyQwCompanyList, updateUser,getQwUserListLikeName} from "@/api/qw/user";
 import {getMyQwUserList, getMyQwCompanyList, updateUser,getQwUserListLikeName} from "@/api/qw/user";
 import {listTag, getTag, searchTags,} from "@/api/qw/tag";
 import {listTag, getTag, searchTags,} from "@/api/qw/tag";
@@ -817,6 +845,19 @@ export default {
   components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,userDetails,collection},
   components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,userDetails,collection},
   data() {
   data() {
     return {
     return {
+      statusDialog: {
+        open: false,
+        title: "修改客户状态"
+      },
+      statusForm: {
+        id: null,
+        status: null
+      },
+      statusRules: {
+        status: [
+          {required: true, message: '状态不能为空', trigger: 'change'}
+        ]
+      },
       notesOpen: {
       notesOpen: {
         type: 1,
         type: 1,
         nameType: 3,
         nameType: 3,
@@ -1162,6 +1203,33 @@ export default {
         });
         });
         this.getList();
         this.getList();
      },
      },
+     handleChangeStatus(row) {
+      this.statusForm = {
+        id: row.id,
+        status: String(row.status) // 保证与 dictValue 类型一致
+      };
+      this.statusDialog.open = true;
+    },
+    submitStatusForm() {
+      this.$refs["statusForm"].validate(valid => {
+        if (valid) {
+          const params = {
+            id: this.statusForm.id,
+            status: this.statusForm.status
+          };
+
+          // 调用接口更新状态
+          updateExternalContactStatus(params).then(response => {
+            this.msgSuccess("状态修改成功");
+            this.statusDialog.open = false;
+            this.getList(); // 刷新列表
+          }).catch(error => {
+            console.error('状态修改失败:', error);
+            this.$message.error('状态修改失败');
+          });
+        }
+      });
+    },
     /** 查询企业微信客户列表 */
     /** 查询企业微信客户列表 */
     getList() {
     getList() {
       this.loading = true;
       this.loading = true;

+ 71 - 3
src/views/qw/externalContact/myExternalContact.vue

@@ -483,6 +483,15 @@
                      icon="el-icon-setting"
                      icon="el-icon-setting"
                      @click="setCourseSOP(scope.row)"
                      @click="setCourseSOP(scope.row)"
           >设置课程SOP</el-button> -->
           >设置课程SOP</el-button> -->
+        <el-button
+          size="mini"
+          type="text"
+          icon="el-icon-edit"
+          @click="handleChangeStatus(scope.row)"
+          v-hasPermi="['qw:externalContact:changeStatus']"
+        >
+          修改状态
+        </el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -829,8 +838,26 @@
 	  <info  ref="Details" />
 	  <info  ref="Details" />
 	</el-drawer>
 	</el-drawer>
     <el-dialog :title="user.title" :visible.sync="user.open" width="800px" append-to-body>
     <el-dialog :title="user.title" :visible.sync="user.open" width="800px" append-to-body>
-      <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>
-    </el-dialog>
+        <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>
+      </el-dialog>
+      <el-dialog title="修改客户状态" :visible.sync="statusDialog.open" width="500px" append-to-body>
+        <el-form ref="statusForm" :model="statusForm" :rules="statusRules" label-width="100px">
+          <el-form-item label="状态" prop="status">
+            <el-select v-model="statusForm.status" placeholder="请选择状态" size="small">
+              <el-option
+                v-for="dict in statusOptions"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="dict.dictValue"
+              />
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="statusDialog.open = false">取 消</el-button>
+          <el-button type="primary" @click="submitStatusForm">提 交</el-button>
+        </div>
+      </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -852,7 +879,7 @@ import {
   setCustomerCourseSop,
   setCustomerCourseSop,
   getCustomerCourseSop,
   getCustomerCourseSop,
   setCustomerCourseSopList,
   setCustomerCourseSopList,
-  syncMyExternalContact, unBindUserId, updateExternalContactCall,exportMyExternalContact
+  syncMyExternalContact, unBindUserId, updateExternalContactCall,exportMyExternalContact,updateExternalContactStatus
 } from '@/api/qw/externalContact'
 } from '@/api/qw/externalContact'
 import info from "@/views/qw/externalContact/info.vue";
 import info from "@/views/qw/externalContact/info.vue";
 import {getMyQwUserList, getMyQwCompanyList, handleInputAuthAppKey, updateUser} from "@/api/qw/user";
 import {getMyQwUserList, getMyQwCompanyList, handleInputAuthAppKey, updateUser} from "@/api/qw/user";
@@ -872,6 +899,19 @@ export default {
   components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info},
   components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info},
   data() {
   data() {
     return {
     return {
+      statusDialog: {
+        open: false,
+        title: "修改客户状态"
+      },
+      statusForm: {
+        id: null,
+        status: null
+      },
+      statusRules: {
+        status: [
+          {required: true, message: '状态不能为空', trigger: 'change'}
+        ]
+      },
       doctorList:[],
       doctorList:[],
       diagnosisForm:{},
       diagnosisForm:{},
       diagnosisOpen:false,
       diagnosisOpen:false,
@@ -1255,6 +1295,34 @@ export default {
 
 
     },
     },
 
 
+    handleChangeStatus(row) {
+      this.statusForm = {
+        id: row.id,
+        status: String(row.status) // 保证与 dictValue 类型一致
+      };
+      this.statusDialog.open = true;
+    },
+    submitStatusForm() {
+      this.$refs["statusForm"].validate(valid => {
+        if (valid) {
+          const params = {
+            id: this.statusForm.id,
+            status: this.statusForm.status
+          };
+
+          // 调用接口更新状态
+          updateExternalContactStatus(params).then(response => {
+            this.msgSuccess("状态修改成功");
+            this.statusDialog.open = false;
+            this.getList(); // 刷新列表
+          }).catch(error => {
+            console.error('状态修改失败:', error);
+            this.$message.error('状态修改失败');
+          });
+        }
+      });
+    },
+
     /** 查询企业微信客户列表 */
     /** 查询企业微信客户列表 */
     getList() {
     getList() {
       this.loading = true;
       this.loading = true;