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

销售端新增查询未绑定企微userId的信息采集用户列表

cgp 4 недель назад
Родитель
Сommit
7fc5a844cc

+ 17 - 0
src/api/qw/collectionUnBind.js

@@ -0,0 +1,17 @@
+import request from '@/utils/request'
+/**
+ * 查询未绑定的信息采集列表
+ * @param {Object} queryDto 查询参数
+ * @param {number} queryDto.pageNum 页码
+ * @param {number} queryDto.pageSize 每页条数
+ * @param {string} queryDto.userName 用户姓名
+ * @param {string} queryDto.doctorName 医生姓名
+ * @param {string} queryDto.companyUserName 销售人员姓名
+ */
+export function listUnbindCollection(queryDto) {
+  return request({
+    url: '/hisStore/collection/getUnBindCollectionList',
+    method: 'post',
+    data: queryDto
+  })
+}

+ 127 - 0
src/views/qw/collectionUnBind/index.vue

@@ -0,0 +1,127 @@
+<template>
+  <div class="app-container">
+    <!-- 查询表单 -->
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="用户姓名" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入用户姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="医生姓名" prop="doctorName">
+        <el-input
+          v-model="queryParams.doctorName"
+          placeholder="请输入医生姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="销售人员" prop="companyUserName">
+        <el-input
+          v-model="queryParams.companyUserName"
+          placeholder="请输入销售人员姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </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-table border v-loading="loading" :data="collectionList">
+      <el-table-column label="用户姓名" align="center" prop="userName" />
+      <el-table-column label="用户性别" align="center" prop="sex">
+        <template slot-scope="scope">
+          <span>{{ sexFormat(scope.row.sex) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="用户年龄" align="center" prop="age" />
+      <el-table-column label="电话尾号" align="center" prop="userPhoneFour" />
+      <el-table-column label="是否过敏" align="center" prop="allergy" />
+      <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
+      <el-table-column label="医生姓名" align="center" prop="doctorName" />
+      <el-table-column label="销售人员" align="center" prop="companyUserName" />
+      <el-table-column label="创建时间" align="center" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页组件 -->
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { listUnbindCollection } from "@/api/qw/collectionUnBind";
+
+export default {
+  name: "UnbindCollection",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 表格数据
+      collectionList: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userName: null,
+        doctorName: null,
+        companyUserName: null,
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询未绑定的信息采集列表 */
+    getList() {
+      this.loading = true;
+      listUnbindCollection(this.queryParams).then(response => {
+        this.collectionList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 性别格式化 */
+    sexFormat(sex) {
+      return sex === 1 ? "男" : sex === 0 ? "女" : "";
+    }
+  }
+};
+</script>
+
+<style scoped>
+</style>

+ 17 - 5
src/views/qw/externalContact/collection.vue

@@ -20,7 +20,10 @@
             <span style="font-size: 15px;font-weight: bold; margin-left: 31px">{{ answer.title }}</span>
           </div>
           <div style="margin-left: 31px;">
-            <el-checkbox-group v-model="answer.value" size="mini">
+            <el-checkbox-group
+              v-model="answer.value"
+              size="mini"
+              :disabled="!canEditAnswers">
               <el-checkbox v-for="option in answer.options" :key="option.value" :label="option.value">
                 {{ option.name }}
               </el-checkbox>
@@ -115,7 +118,7 @@ export default {
       if (numberRegex.test(value)) {
         return callback(new Error('姓名不能包含数字'));
       }
-      // 可选:校验只能包含中文、英文和空格
+      //校验只能包含中文、英文和空格
       const nameRegex = /^[\u4e00-\u9fa5a-zA-Z\s]+$/;
       if (!nameRegex.test(value)) {
         return callback(new Error('姓名只能包含中文、英文和空格'));
@@ -123,6 +126,7 @@ export default {
       callback();
     };
     return {
+      isSalesProxyFill: true, // 控制问题是否可编辑
       sourceList:[],
       extraParams: {
         companyId: null,
@@ -206,6 +210,12 @@ export default {
       this.sourceList = res.data;
     })
   },
+  computed: {
+    // 计算属性:判断问题区域是否可编辑
+    canEditAnswers() {
+      return this.isSalesProxyFill === true;
+    }
+  },
   methods: {
     // 新增:用于接收主页面传来的公司id和销售id
     setExtraParams(params) {
@@ -273,7 +283,6 @@ export default {
     },
 
     processFormData(data) {
-      // 处理 answers 数据,确保 value 是数组格式
       let processedAnswers = [];
       if (data.answers && Array.isArray(data.answers)) {
         processedAnswers = data.answers.map(answer => ({
@@ -281,6 +290,7 @@ export default {
           value: Array.isArray(answer.value) ? answer.value : []
         }));
       }
+      this.isSalesProxyFill = data.isSalesProxyFill === true;
 
       this.form = {
         ...this.form,
@@ -318,6 +328,7 @@ export default {
         remark: ''
       };
       this.extraParams = { companyId: null, companyUserId: null };
+      this.isSalesProxyFill = true;
     },
 
     //选择问答模板
@@ -343,7 +354,7 @@ export default {
         amount: null,
         id: null
       };
-
+      this.isSalesProxyFill = true;
       // 查询该用户+该模板下是否有历史采集记录
       if (this.userId && val) {
         getInfo({ userId: this.userId, questionId: val }).then(res => {
@@ -365,7 +376,8 @@ export default {
             ...this.form,
             userId: this.userId,
             companyId: this.extraParams.companyId,
-            companyUserId: this.extraParams.companyUserId
+            companyUserId: this.extraParams.companyUserId,
+            source: 'pc'  // 添加标识符
           };
           submitData.userId = this.userId;