mycustomer.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="客户编码" prop="customerCode">
  5. <el-input
  6. style="width:220px"
  7. v-model="queryParams.customerCode"
  8. placeholder="请输入客户编码"
  9. clearable
  10. size="small"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. <el-form-item label="客户名称" prop="customerName">
  15. <el-input
  16. style="width:220px"
  17. v-model="queryParams.customerName"
  18. placeholder="请输入客户名称"
  19. clearable
  20. size="small"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. </el-form-item>
  24. <el-form-item label="手机" prop="mobile">
  25. <el-input
  26. style="width:220px"
  27. v-model="queryParams.mobile"
  28. placeholder="请输入手机"
  29. clearable
  30. size="small"
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  36. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  37. </el-form-item>
  38. </el-form>
  39. <el-table height="500" border v-loading="loading" :data="customerList" ref="customerList" >
  40. <el-table-column label="客户编码" align="center" prop="customerCode" />
  41. <el-table-column label="客户名称" align="center" prop="customerName" :show-overflow-tooltip="true">
  42. </el-table-column>
  43. <el-table-column label="手机" width="120px" align="center" prop="mobile" >
  44. </el-table-column>
  45. <el-table-column label="客户来源" align="center" prop="source">
  46. <template slot-scope="scope">
  47. <el-tag prop="status" v-for="(item, index) in sourceOptions" v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</el-tag>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="跟进阶段" width="200" align="center" prop="visitStatus">
  51. <template slot-scope="scope">
  52. <el-tag prop="visitStatus" v-for="(item, index) in statusOptions" v-if="scope.row.visitStatus==item.dictValue">{{item.dictLabel}}</el-tag><br/>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="客户类型" width="200" align="center" prop="customerType">
  56. <template slot-scope="scope">
  57. <el-tag prop="status" v-for="(item, index) in typeOptions" v-if="scope.row.customerType==item.dictValue">{{item.dictLabel}}</el-tag>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="标签" width="120px" align="center" prop="tags" >
  61. </el-table-column>
  62. <el-table-column label="备注" width="150px" align="center" prop="remark" >
  63. </el-table-column>
  64. <el-table-column label="进线客户详情" align="center" :show-overflow-tooltip="true" prop="registerDesc" />
  65. <el-table-column label="最新跟进时间" align="center" prop="lastTime" />
  66. <el-table-column label="领取时间" align="center" prop="receiveTime" />
  67. <el-table-column label="进线客户提交日期" align="center" prop="registerSubmitTime" />
  68. <el-table-column label="创建时间" align="center" prop="customerCreateTime" width="180">
  69. </el-table-column>
  70. <el-table-column label="操作" align="center" fixed="right" width="120px" class-name="small-padding fixed-width">
  71. <template slot-scope="scope">
  72. <el-button
  73. size="medium"
  74. type="primary"
  75. plain
  76. @click="handleBind(scope.row)"
  77. >绑定</el-button>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. <pagination
  82. v-show="total>0"
  83. :total="total"
  84. :page.sync="queryParams.pageNum"
  85. :limit.sync="queryParams.pageSize"
  86. @pagination="getList"
  87. />
  88. </div>
  89. </template>
  90. <script>
  91. import { getMyCustomerList,recover,exportCustomer } from "@/api/crm/customer";
  92. export default {
  93. name: "mycustomer",
  94. components: {},
  95. data() {
  96. return {
  97. dateRange:[],
  98. statusOptions:[],
  99. typeOptions:[],
  100. sourceOptions:[],
  101. // 遮罩层
  102. loading: true,
  103. // 显示搜索条件
  104. showSearch: true,
  105. // 总条数
  106. total: 0,
  107. // 客户表格数据
  108. customerList: [],
  109. // 弹出层标题
  110. title: "",
  111. // 是否显示弹出层
  112. open: false,
  113. // 查询参数
  114. queryParams: {
  115. pageNum: 1,
  116. pageSize: 10,
  117. customerCode: null,
  118. customerName: null,
  119. mobile: null,
  120. sex: null,
  121. weixin: null,
  122. userId: null,
  123. createUserId: null,
  124. receiveUserId: null,
  125. customerUserId: null,
  126. address: null,
  127. location: null,
  128. detailAddress: null,
  129. lng: null,
  130. lat: null,
  131. status: null,
  132. deptId: null,
  133. isDel: null,
  134. customerType: null,
  135. receiveTime: null,
  136. poolTime: null,
  137. companyId: null,
  138. isLine: null,
  139. source: null,
  140. tags: null
  141. },
  142. // 表单参数
  143. form: {
  144. },
  145. // 表单校验
  146. rules: {
  147. },
  148. };
  149. },
  150. created() {
  151. this.getDicts("crm_customer_source").then((response) => {
  152. this.sourceOptions = response.data;
  153. });
  154. this.getDicts("crm_customer_user_status").then((response) => {
  155. this.statusOptions = response.data;
  156. });
  157. this.getDicts("crm_customer_type").then((response) => {
  158. this.typeOptions = response.data;
  159. });
  160. this.getList();
  161. },
  162. methods: {
  163. /** 查询客户列表 */
  164. getList() {
  165. this.loading = true;
  166. getMyCustomerList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  167. this.customerList = response.rows;
  168. console.log("哈话",this.customerList)
  169. this.total = response.total;
  170. this.loading = false;
  171. });
  172. },
  173. //绑定选择
  174. handleBind(row){
  175. console.log("绑定",row)
  176. this.$emit("bindCustomerId",row.customerId)
  177. this.$refs.customerList.clearSelection();
  178. },
  179. // 取消按钮
  180. cancel() {
  181. this.open = false;
  182. this.reset();
  183. },
  184. /** 搜索按钮操作 */
  185. handleQuery() {
  186. this.queryParams.pageNum = 1;
  187. this.getList();
  188. },
  189. /** 重置按钮操作 */
  190. resetQuery() {
  191. this.resetForm("queryForm");
  192. this.handleQuery();
  193. },
  194. }
  195. };
  196. </script>
  197. <style>
  198. .el-tag + .el-tag {
  199. margin-left: 10px;
  200. }
  201. .button-new-tag {
  202. margin-left: 10px;
  203. height: 32px;
  204. line-height: 30px;
  205. padding-top: 0;
  206. padding-bottom: 0;
  207. }
  208. .input-new-tag {
  209. width: 90px;
  210. margin-left: 10px;
  211. vertical-align: bottom;
  212. }
  213. .el-dialog__wrapper{
  214. z-index: 100000;
  215. }
  216. </style>