Przeglądaj źródła

完善客户信息表+患者信息表逻辑

cgp 1 miesiąc temu
rodzic
commit
1de67ed1c4
1 zmienionych plików z 130 dodań i 11 usunięć
  1. 130 11
      src/views/companyCustomer/index.vue

+ 130 - 11
src/views/companyCustomer/index.vue

@@ -49,9 +49,11 @@
       </el-table-column>
       </el-table-column>
       <el-table-column label="客服姓名" align="center" prop="companyUserName" />
       <el-table-column label="客服姓名" align="center" prop="companyUserName" />
       <el-table-column label="负责医生" align="center" prop="doctorName" />
       <el-table-column label="负责医生" align="center" prop="doctorName" />
-      <el-table-column label="操作" align="center" width="80">
+      <el-table-column label="操作" align="center" width="240">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">详情</el-button>
           <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">详情</el-button>
+          <el-button size="mini" type="text" icon="el-icon-view" @click="handlePrescribe(scope.row)">查看处方</el-button>
+          <el-button size="mini" type="text" icon="el-icon-document" @click="handleCollection(scope.row)">查看信息采集</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -106,21 +108,69 @@
         <el-form-item label="过敏史">{{ detailForm.allergyHistory }}</el-form-item>
         <el-form-item label="过敏史">{{ detailForm.allergyHistory }}</el-form-item>
       </el-form>
       </el-form>
     </el-dialog>
     </el-dialog>
+
+    <!-- 处方列表弹窗 -->
+    <el-dialog title="处方信息" :visible.sync="prescribeOpen" width="1100px" append-to-body :close-on-click-modal="false">
+      <el-table v-loading="prescribeLoading" :data="prescribeList">
+        <el-table-column label="处方ID" align="center" prop="prescribeId" />
+        <el-table-column label="处方单号" align="center" prop="prescribeCode" />
+        <el-table-column label="处方类型" align="center" prop="prescribeType">
+          <template slot-scope="scope">
+            <dict-tag :options="prescribeTypeOptions" :value="scope.row.prescribeType" />
+          </template>
+        </el-table-column>
+        <el-table-column label="患者姓名" align="center" prop="patientName" />
+        <el-table-column label="医生姓名" align="center" prop="doctorName" />
+        <el-table-column label="是否确认" align="center" prop="doctorConfirm">
+          <template slot-scope="scope">
+            <dict-tag :options="doctorConfirmOptions" :value="scope.row.doctorConfirm" />
+          </template>
+        </el-table-column>
+        <el-table-column label="审核时间" align="center" prop="auditTime" width="180">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="处方图片" align="center" prop="prescribeImgUrl">
+          <template slot-scope="scope">
+            <el-image
+              v-if="scope.row.doctorConfirm == 1 && scope.row.prescribeImgUrl"
+              style="width: 60px; height: 60px"
+              :src="scope.row.prescribeImgUrl"
+              :preview-src-list="[scope.row.prescribeImgUrl]"
+            />
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="prescribeTotal > 0"
+        :total="prescribeTotal"
+        :page.sync="prescribeQueryParams.pageNum"
+        :limit.sync="prescribeQueryParams.pageSize"
+        @pagination="getPrescribeList"
+      />
+    </el-dialog>
+
+    <!-- 信息采集弹窗 -->
+    <collection-info-dialog :visible.sync="collectionVisible" :phone="currentPhone" />
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import { companyCustomerList, companyCustomer } from '@/api/companyCustomer'
 import { companyCustomerList, companyCustomer } from '@/api/companyCustomer'
+import { getPrescribeListByPhone } from '@/api/patientInfo'
 import { parseTime } from '@/utils/common'
 import { parseTime } from '@/utils/common'
+import CollectionInfoDialog from '../patientInfo/CollectionInfoDialog.vue'
 
 
 export default {
 export default {
   name: 'CustomerList',
   name: 'CustomerList',
+  components: { CollectionInfoDialog },
   data() {
   data() {
     return {
     return {
       loading: false,
       loading: false,
       total: 0,
       total: 0,
       customerList: [],
       customerList: [],
-      // 查询参数,增加搜索字段
       queryParams: {
       queryParams: {
         pageNum: 1,
         pageNum: 1,
         pageSize: 10,
         pageSize: 10,
@@ -131,10 +181,31 @@ export default {
       detailOpen: false,
       detailOpen: false,
       detailForm: {},
       detailForm: {},
       sexOptions: [
       sexOptions: [
-        {label: '女', value: '0'},
-        {label: '男', value: '1'},
-        {label: '未知', value: '2'}
-      ]
+        { label: '女', value: '0' },
+        { label: '男', value: '1' },
+        { label: '未知', value: '2' }
+      ],
+      // 处方相关
+      prescribeOpen: false,
+      prescribeLoading: false,
+      prescribeList: [],
+      prescribeTotal: 0,
+      currentPhone: '',
+      prescribeQueryParams: {
+        pageNum: 1,
+        pageSize: 10
+      },
+      doctorConfirmOptions: [
+        { dictValue: '0', dictLabel: '未确认' },
+        { dictValue: '1', dictLabel: '已确认' }
+      ],
+      prescribeTypeOptions: [
+        { dictValue: '1', dictLabel: '西药' },
+        { dictValue: '2', dictLabel: '中药' },
+        { dictValue: '3', dictLabel: 'OTC' }
+      ],
+      // 信息采集弹窗控制
+      collectionVisible: false
     }
     }
   },
   },
   created() {
   created() {
@@ -142,7 +213,8 @@ export default {
   },
   },
   methods: {
   methods: {
     parseTime,
     parseTime,
-    // 获取分页列表
+
+    /** 获取客户分页列表 */
     getList() {
     getList() {
       this.loading = true
       this.loading = true
       companyCustomerList(this.queryParams)
       companyCustomerList(this.queryParams)
@@ -156,21 +228,25 @@ export default {
           this.loading = false
           this.loading = false
         })
         })
     },
     },
-    // 搜索(重置页码)
+
+    /** 搜索(重置页码) */
     handleQuery() {
     handleQuery() {
       this.queryParams.pageNum = 1
       this.queryParams.pageNum = 1
       this.getList()
       this.getList()
     },
     },
-    // 重置搜索条件并查询
+
+    /** 重置搜索条件并查询 */
     resetQuery() {
     resetQuery() {
       this.resetForm('queryForm')
       this.resetForm('queryForm')
       this.handleQuery()
       this.handleQuery()
     },
     },
-    // 性别格式化
+
+    /** 性别格式化 */
     sexFormat(row) {
     sexFormat(row) {
       return this.sexOptions.find((o) => o.value === row.sex)?.label ?? row.sex
       return this.sexOptions.find((o) => o.value === row.sex)?.label ?? row.sex
     },
     },
-    // 查看详情
+
+    /** 查看客户详情 */
     handleDetail(row) {
     handleDetail(row) {
       companyCustomer(row.id)
       companyCustomer(row.id)
         .then((response) => {
         .then((response) => {
@@ -180,6 +256,49 @@ export default {
         .catch(() => {
         .catch(() => {
           this.$message.error('获取详情失败')
           this.$message.error('获取详情失败')
         })
         })
+    },
+
+    /** 打开处方弹窗 */
+    handlePrescribe(row) {
+      if (!row.phone) {
+        this.$message.warning('该客户未登记手机号,无法查询处方')
+        return
+      }
+      this.currentPhone = row.phone
+      this.prescribeQueryParams.pageNum = 1
+      this.prescribeOpen = true
+      this.getPrescribeList()
+    },
+
+    /** 查询处方列表 */
+    getPrescribeList() {
+      this.prescribeLoading = true
+      const params = {
+        phone: this.currentPhone,
+        pageNum: this.prescribeQueryParams.pageNum,
+        pageSize: this.prescribeQueryParams.pageSize
+      }
+      getPrescribeListByPhone(params)
+        .then((response) => {
+          // 根据后端结构,处方列表可能返回 data 对象,其中含 list 和 total
+          const data = response.data || response
+          this.prescribeList = data.list || data.rows || []
+          this.prescribeTotal = data.total || 0
+          this.prescribeLoading = false
+        })
+        .catch(() => {
+          this.prescribeLoading = false
+        })
+    },
+
+    /** 打开信息采集弹窗 */
+    handleCollection(row) {
+      if (!row.phone) {
+        this.$message.warning('该客户未登记手机号,无法查看信息采集表')
+        return
+      }
+      this.currentPhone = row.phone
+      this.collectionVisible = true
     }
     }
   }
   }
 }
 }