|
|
@@ -0,0 +1,190 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- 搜索栏 -->
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="80px">
|
|
|
+ <el-form-item label="客户姓名" prop="customerName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.customerName"
|
|
|
+ placeholder="请输入客户姓名"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="电话" prop="phone">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.phone"
|
|
|
+ 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 v-loading="loading" :data="customerList">
|
|
|
+ <el-table-column label="客户姓名" align="center" prop="customerName" />
|
|
|
+ <el-table-column label="性别" align="center" prop="sex" :formatter="sexFormat" />
|
|
|
+ <el-table-column label="年龄" align="center" prop="age" />
|
|
|
+ <el-table-column label="地址" align="center" prop="address" show-overflow-tooltip />
|
|
|
+ <el-table-column label="电话" align="center" prop="phone" />
|
|
|
+ <el-table-column label="建档时间" align="center" prop="filingTime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ parseTime(scope.row.filingTime) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="客服姓名" align="center" prop="companyUserName" />
|
|
|
+ <el-table-column label="负责医生" align="center" prop="doctorName" />
|
|
|
+ <el-table-column label="操作" align="center" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">详情</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="客户详情" :visible.sync="detailOpen" width="800px" append-to-body>
|
|
|
+ <el-form :model="detailForm" label-width="100px" size="small" disabled>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="客户姓名">{{ detailForm.customerName }}</el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="性别">{{ sexFormat({ sex: detailForm.sex }) }}</el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="年龄">{{ detailForm.age }}</el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="电话">{{ detailForm.phone }}</el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="地址">{{ detailForm.address }}</el-form-item>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="建档时间">{{ parseTime(detailForm.filingTime) }}</el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="客服姓名">{{ detailForm.companyUserName }}</el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="约诊时间">{{ parseTime(detailForm.appointmentTime) }}</el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="负责医生">{{ detailForm.doctorName }}</el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="现病史">{{ detailForm.presentIllness }}</el-form-item>
|
|
|
+ <el-form-item label="现用药情况">{{ detailForm.currentMedication }}</el-form-item>
|
|
|
+ <el-form-item label="过敏史">{{ detailForm.allergyHistory }}</el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { companyCustomerList, companyCustomer } from '@/api/companyCustomer'
|
|
|
+import { parseTime } from '@/utils/common'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'CustomerList',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ total: 0,
|
|
|
+ customerList: [],
|
|
|
+ // 查询参数,增加搜索字段
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ customerName: null,
|
|
|
+ phone: null,
|
|
|
+ companyUserName: null
|
|
|
+ },
|
|
|
+ detailOpen: false,
|
|
|
+ detailForm: {},
|
|
|
+ sexOptions: [
|
|
|
+ {label: '女', value: '0'},
|
|
|
+ {label: '男', value: '1'},
|
|
|
+ {label: '未知', value: '2'}
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ parseTime,
|
|
|
+ // 获取分页列表
|
|
|
+ getList() {
|
|
|
+ this.loading = true
|
|
|
+ companyCustomerList(this.queryParams)
|
|
|
+ .then((response) => {
|
|
|
+ const data = response.data || response
|
|
|
+ this.customerList = data.list || []
|
|
|
+ this.total = data.total || 0
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 搜索(重置页码)
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ // 重置搜索条件并查询
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm('queryForm')
|
|
|
+ this.handleQuery()
|
|
|
+ },
|
|
|
+ // 性别格式化
|
|
|
+ sexFormat(row) {
|
|
|
+ return this.sexOptions.find((o) => o.value === row.sex)?.label ?? row.sex
|
|
|
+ },
|
|
|
+ // 查看详情
|
|
|
+ handleDetail(row) {
|
|
|
+ companyCustomer(row.id)
|
|
|
+ .then((response) => {
|
|
|
+ this.detailForm = response.data || response
|
|
|
+ this.detailOpen = true
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message.error('获取详情失败')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+/* 按需添加样式 */
|
|
|
+</style>
|