소스 검색

Merge branch 'yjb_ScrmStores' of http://1.14.104.71:10880/root/ylrz_his_scrm_adminUI into yjb_ScrmStores

lmx 6 일 전
부모
커밋
d8e379957c

+ 69 - 0
src/api/hisStore/storePrescription.js

@@ -0,0 +1,69 @@
+import request from '@/utils/request'
+
+// 查询处方订单列表
+export function listPrescription(query) {
+  return request({
+    url: '/store/prescription/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询处方订单详细
+export function getPrescription(preId) {
+  return request({
+    url: '/store/prescription/prescriptionDetail/' + preId,
+    method: 'get'
+  })
+}
+
+// 新增处方订单
+export function addPrescription(data) {
+  return request({
+    url: '/store/prescription',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改处方订单
+export function updatePrescription(data) {
+  return request({
+    url: '/store/prescription',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除处方订单
+export function delPrescription(preId) {
+  return request({
+    url: '/store/prescription/' + preId,
+    method: 'delete'
+  })
+}
+
+// 导出处方订单数据
+export function exportPrescription(query) {
+  return request({
+    url: '/store/prescription/export',
+    method: 'post',
+    data: query
+  })
+}
+
+// 获取问诊信息
+export function getConsultationInfo(preId) {
+  return request({
+    url: '/store/prescription/orderDetail/' + preId,
+    method: 'get'
+  })
+}
+
+// 获取聊天记录
+export function getChatMessages(preId) {
+  return request({
+    url: '/store/prescription/chatDetail/' + preId,
+    method: 'get'
+  })
+}

+ 7 - 0
src/api/hisStore/storeProduct.js

@@ -109,4 +109,11 @@ export function getStoreProductColumns(query) {
   })
 }
 
+// 同步商品到580
+export function sync580(productId) {
+  return request({
+    url: '/store/store/storeProduct/sync580/'+productId,
+    method: 'post'
+  })
+}
 

+ 231 - 0
src/components/PrescriptionCard/index.vue

@@ -0,0 +1,231 @@
+<template>
+  <div class="prescription-card">
+    <div class="prescription-header">
+      <div class="prescription-title">处方信息</div>
+      <div class="prescription-id">处方ID: {{ prescriptionData.id }}</div>
+    </div>
+    
+    <div class="prescription-content">
+      <div 
+        v-for="(medicine, index) in prescriptionData.list" 
+        :key="index"
+        class="medicine-item"
+      >
+        <!-- 药品名称区域 -->
+        <div class="medicine-header">
+          <div class="medicine-name-section">
+            <div class="common-name">{{ medicine.productCommonName }}</div>
+            <div class="product-name" v-if="medicine.productName !== medicine.productCommonName">
+              {{ medicine.productName }}
+            </div>
+          </div>
+        </div>
+        
+        <!-- 用药信息区域 -->
+        <div class="medicine-details">
+          <div class="usage-info">
+            <div class="frequency-spec">
+              <span class="frequency">{{ medicine.frequency }}</span>
+              <span class="spec" v-if="medicine.spec">{{ medicine.spec }}</span>
+            </div>
+            <div class="usage-method" v-if="medicine.usageHowto">
+              {{ medicine.usageHowto }}
+            </div>
+          </div>
+          
+          <!-- 规格和用量信息 -->
+          <div class="specification-info">
+            <div class="packing-spec" v-if="medicine.packingSpec">
+              规格:{{ medicine.packingSpec }}
+            </div>
+            <div class="dosage-info" v-if="medicine.perDosageNumber && medicine.perDosageUnit">
+              每次:{{ medicine.perDosageNumber }}{{ medicine.perDosageUnit }}
+            </div>
+            <div class="quantity" v-if="medicine.number">
+              数量:{{ medicine.number }}
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'PrescriptionCard',
+  props: {
+    prescriptionData: {
+      type: Object,
+      required: true,
+      default: () => ({
+        id: '',
+        list: []
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.prescription-card {
+  background: #ffffff;
+  border: 1px solid #e8f4fd;
+  border-radius: 8px;
+  padding: 16px;
+  margin: 8px 0;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.prescription-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 16px;
+  padding-bottom: 12px;
+  border-bottom: 2px solid #4a90e2;
+}
+
+.prescription-title {
+  font-size: 16px;
+  font-weight: bold;
+  color: #4a90e2;
+}
+
+.prescription-id {
+  font-size: 12px;
+  color: #666666;
+  background: #f5f5f5;
+  padding: 4px 8px;
+  border-radius: 4px;
+}
+
+.prescription-content {
+  space-y: 12px;
+}
+
+.medicine-item {
+  background: #fafbfc;
+  border: 1px solid #e1e8ed;
+  border-radius: 6px;
+  padding: 12px;
+  margin-bottom: 12px;
+}
+
+.medicine-item:last-child {
+  margin-bottom: 0;
+}
+
+.medicine-header {
+  margin-bottom: 12px;
+}
+
+.medicine-name-section {
+  display: flex;
+  flex-direction: column;
+  gap: 4px;
+}
+
+.common-name {
+  font-size: 16px;
+  font-weight: bold;
+  color: #2c3e50;
+  line-height: 1.4;
+}
+
+.product-name {
+  font-size: 14px;
+  color: #7f8c8d;
+  font-style: italic;
+}
+
+.medicine-details {
+  display: flex;
+  flex-direction: column;
+  gap: 8px;
+}
+
+.usage-info {
+  display: flex;
+  flex-direction: column;
+  gap: 6px;
+}
+
+.frequency-spec {
+  display: flex;
+  gap: 12px;
+  align-items: center;
+}
+
+.frequency {
+  background: #e74c3c;
+  color: white;
+  padding: 4px 8px;
+  border-radius: 4px;
+  font-size: 13px;
+  font-weight: bold;
+}
+
+.spec {
+  background: #f39c12;
+  color: white;
+  padding: 4px 8px;
+  border-radius: 4px;
+  font-size: 13px;
+  font-weight: bold;
+}
+
+.usage-method {
+  background: #27ae60;
+  color: white;
+  padding: 4px 8px;
+  border-radius: 4px;
+  font-size: 13px;
+  display: inline-block;
+  width: fit-content;
+}
+
+.specification-info {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 12px;
+  margin-top: 8px;
+  padding-top: 8px;
+  border-top: 1px solid #e1e8ed;
+}
+
+.packing-spec,
+.dosage-info,
+.quantity {
+  background: #ecf0f1;
+  color: #2c3e50;
+  padding: 3px 6px;
+  border-radius: 3px;
+  font-size: 12px;
+  border-left: 3px solid #3498db;
+}
+
+/* 响应式设计 */
+@media (max-width: 768px) {
+  .prescription-card {
+    padding: 12px;
+  }
+  
+  .prescription-header {
+    flex-direction: column;
+    align-items: flex-start;
+    gap: 8px;
+  }
+  
+  .frequency-spec {
+    flex-direction: column;
+    align-items: flex-start;
+    gap: 6px;
+  }
+  
+  .specification-info {
+    flex-direction: column;
+    gap: 6px;
+  }
+}
+</style>

+ 13 - 0
src/router/index.js

@@ -240,6 +240,19 @@ export const constantRoutes = [
         meta: { title: '直播中控台', activeMenu: '/live/liveConsole' }
       }
     ]
+  },
+  {
+    path: '/storePrescription',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'detail/:preId',
+        component: () => import('@/views/hisStore/storePrescription/detail'),
+        name: 'StorePrescriptionDetail',
+        meta: { title: '处方订单详情', activeMenu: '/hisStore/storePrescription' }
+      }
+    ]
   }
 ]
 

+ 802 - 0
src/views/hisStore/storePrescription/detail.vue

@@ -0,0 +1,802 @@
+<template>
+  <div class="detail-container">
+    <!-- 页面头部 -->
+    <div class="detail-header">
+      <h2 class="detail-title">处方订单详情</h2>
+      <el-button 
+        type="primary" 
+        icon="el-icon-arrow-left" 
+        @click="goBack"
+        class="back-button"
+        plain
+      >
+        返回列表
+      </el-button>
+    </div>
+
+    <!-- 选项卡 -->
+    <el-tabs v-model="activeTab" class="detail-tabs" @tab-click="handleTabClick">
+      <!-- 详细信息选项卡 -->
+      <el-tab-pane label="详细信息" name="detail">
+        <div class="detail-content" v-loading="detailLoading">
+          <div class="detail-card">
+            <div class="detail-info">
+              <div class="info-grid">
+                <div class="info-item">
+                  <label>用户ID:</label>
+                  <span>{{ prescriptionDetail.userId || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>处方ID:</label>
+                  <span>{{ prescriptionDetail.pid || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>处方编号:</label>
+                  <span>{{ prescriptionDetail.serialNo || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>问诊单ID:</label>
+                  <span>{{ prescriptionDetail.diagnosisId || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>商城订单ID:</label>
+                  <span>{{ prescriptionDetail.storeOrderId || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>服务类型:</label>
+                  <span>{{ getServiceTypeText(prescriptionDetail.serviceType) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>是否需要审方:</label>
+                  <span>{{ getYesNoText(prescriptionDetail.isExamine) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>来源:</label>
+                  <span>{{ getSourceText(prescriptionDetail.souceFrom) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>是否孕妇:</label>
+                  <span>{{ getYesNoText(prescriptionDetail.isPregnantWoman) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>是否哺乳期:</label>
+                  <span>{{ getYesNoText(prescriptionDetail.isLactation) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>开方情况:</label>
+                  <span>{{ getPrescriptionStatusText(prescriptionDetail.prescriptionStatus) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>就诊人姓名:</label>
+                  <span>{{ prescriptionDetail.userFamilyName || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>就诊人身份证:</label>
+                  <span>{{ prescriptionDetail.userFamilyIdCard || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>就诊人年龄:</label>
+                  <span>{{ prescriptionDetail.userFamilyAge || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>就诊人性别:</label>
+                  <span>{{ getGenderText(prescriptionDetail.userFamilyGender) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>就诊人手机号:</label>
+                  <span>{{ prescriptionDetail.userFamilyPhone || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>关系:</label>
+                  <span>{{ getRelationshipText(prescriptionDetail.relationship) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>就诊人住址:</label>
+                  <span>{{ prescriptionDetail.userFamilyAddr || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>医院名称:</label>
+                  <span>{{ prescriptionDetail.hospitalName || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>药店ID:</label>
+                  <span>{{ prescriptionDetail.storeId || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>药店名称:</label>
+                  <span>{{ prescriptionDetail.storeName || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>医生ID:</label>
+                  <span>{{ prescriptionDetail.doctorId || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>医生姓名:</label>
+                  <span>{{ prescriptionDetail.doctorName || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>医生科室:</label>
+                  <span>{{ prescriptionDetail.doctorOffice || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>医生签名时间:</label>
+                  <span>{{ parseTime(prescriptionDetail.doctorSignTime) || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>诊断标签:</label>
+                  <span>{{ prescriptionDetail.tags || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>处方状态:</label>
+                  <span>{{ getStatusText(prescriptionDetail.status) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>审核状态:</label>
+                  <span>{{ getAuditStatusText(prescriptionDetail.auditStatus) }}</span>
+                </div>
+                <div class="info-item">
+                  <label>审方药师:</label>
+                  <span>{{ prescriptionDetail.auditApothecaryName || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>审方时间:</label>
+                  <span>{{ parseTime(prescriptionDetail.auditTime) || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>审核不通过理由:</label>
+                  <span>{{ prescriptionDetail.reason || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>图片附件URL:</label>
+                  <span>{{ prescriptionDetail.imgList || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>三方跳转地址:</label>
+                  <span>{{ prescriptionDetail.thirdReturnUrl || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>问诊知情确认页面URL:</label>
+                  <span>{{ prescriptionDetail.jumpUrl || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>处方图片地址:</label>
+                  <span>{{ prescriptionDetail.dstFilePath || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>备注:</label>
+                  <span>{{ prescriptionDetail.memo || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>说明:</label>
+                  <span>{{ prescriptionDetail.remarks || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>问诊时间:</label>
+                  <span>{{ parseTime(prescriptionDetail.createTime) || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>开方时间:</label>
+                  <span>{{ parseTime(prescriptionDetail.createdTime) || '-' }}</span>
+                </div>
+                <div class="info-item">
+                  <label>更新时间:</label>
+                  <span>{{ parseTime(prescriptionDetail.updateTime) || '-' }}</span>
+                </div>
+              </div>
+            </div>
+              
+            <!-- 药品列表 -->
+            <div class="list-title">药品列表</div>
+            <el-table 
+              :data="prescriptionDetail.drugRspList || []" 
+              border 
+              style="width: 100%; margin-bottom: 20px;"
+              :empty-text="prescriptionDetail.drugRspList && prescriptionDetail.drugRspList.length === 0 ? '暂无药品信息' : ''"
+            >
+                <el-table-column prop="drugCommonName" label="药品通用名" />
+                <el-table-column prop="drugName" label="药品名称" />
+                <el-table-column prop="amount" label="药品数量" width="100" />
+                <el-table-column prop="instructions" label="使用说明" />
+                <el-table-column prop="spec" label="药品规格" />
+                <el-table-column prop="commodityCode" label="三方商品编码" width="120" />
+                <el-table-column prop="medicineId" label="系统药品ID" width="120" />
+              </el-table>
+              
+              <!-- 问诊答案列表 -->
+              <div class="list-title">问诊答案列表</div>
+              <el-table 
+                :data="prescriptionDetail.beforeAiDataList || []" 
+                border 
+                style="width: 100%; margin-bottom: 20px;"
+                :empty-text="prescriptionDetail.beforeAiDataList && prescriptionDetail.beforeAiDataList.length === 0 ? '暂无问诊答案信息' : ''"
+              >
+                <el-table-column prop="subjectId" label="题目ID" width="80" />
+                <el-table-column prop="title" label="题目" />
+                <el-table-column prop="answer" label="答案" />
+                <el-table-column prop="answerMedicine" label="用药信息" width="150" />
+              </el-table>
+            </div>
+          
+        </div>
+      </el-tab-pane>
+
+      <!-- 聊天内容选项卡 -->
+      <el-tab-pane label="聊天内容" name="chat">
+        <div class="chat-content" v-loading="chatLoading">
+          <el-card class="chat-card">
+            <div class="chat-container">
+              <!-- 聊天消息列表 -->
+              <div 
+                v-for="(message, index) in chatMessages" 
+                :key="index" 
+                class="message-item"
+                :class="{ 'patient-message': message.target === 1, 'doctor-message': message.target === 2 }"
+              >
+                <!-- 医生消息 - 左对齐 -->
+                <template v-if="message.target === 2">
+                  <div class="message-avatar">
+                    <el-avatar :size="32" :src="doctorAvatar">医</el-avatar>
+                  </div>
+                  <div class="message-bubble doctor-bubble">
+                    <!-- type=1: 纯文本内容 -->
+                    <div class="message-content" v-if="message.type === 1">
+                      <!-- 检查是否为处方信息 -->
+                      <template v-if="isPrescriptionContent(message.content)">
+                        <PrescriptionCard :prescriptionData="parsePrescriptionContent(message.content)" />
+                      </template>
+                      <template v-else>
+                        {{ message.content }}
+                      </template>
+                    </div>
+                    <!-- type=2: 图片内容 -->
+                    <div class="message-content" v-else-if="message.type === 2">
+                      <el-image 
+                        :src="message.content" 
+                        fit="cover" 
+                        style="width: 200px; height: 150px;"
+                        :preview-src-list="[message.content]"
+                      />
+                    </div>
+                    <!-- type=3: JSON数据渲染 -->
+                    <div class="message-content" v-else-if="message.type === 3">
+                      <template v-if="isPrescriptionContent(message.content)">
+                        <PrescriptionCard :prescriptionData="parsePrescriptionContent(message.content)" />
+                      </template>
+                      <template v-else>
+                        <pre class="json-content">{{ formatJsonContent(message.content) }}</pre>
+                      </template>
+                    </div>
+                    <!-- type=4: 格式化文本(HTML标签解析) -->
+                    <div class="message-content" v-else-if="message.type === 4">
+                      <div class="formatted-text" v-html="message.content"></div>
+                    </div>
+                    <!-- 其他类型: 默认显示 -->
+                    <div class="message-content" v-else>
+                      {{ message.content }}
+                    </div>
+                    <div class="message-time">
+                      {{ parseTime(message.createdTime) }}
+                    </div>
+                  </div>
+                </template>
+                
+                <!-- 患者消息 - 右对齐 -->
+                <template v-else>
+                  <div class="message-bubble patient-bubble">
+                    <!-- type=1: 纯文本内容 -->
+                    <div class="message-content" v-if="message.type === 1">
+                      <!-- 检查是否为处方信息 -->
+                      <template v-if="isPrescriptionContent(message.content)">
+                        <PrescriptionCard :prescriptionData="parsePrescriptionContent(message.content)" />
+                      </template>
+                      <template v-else>
+                        {{ message.content }}
+                      </template>
+                    </div>
+                    <!-- type=2: 图片内容 -->
+                    <div class="message-content" v-else-if="message.type === 2">
+                      <el-image 
+                        :src="message.content" 
+                        fit="cover" 
+                        style="width: 200px; height: 150px;"
+                        :preview-src-list="[message.content]"
+                      />
+                    </div>
+                    <!-- type=3: JSON数据渲染 -->
+                    <div class="message-content" v-else-if="message.type === 3">
+                      <template v-if="isPrescriptionContent(message.content)">
+                        <PrescriptionCard :prescriptionData="parsePrescriptionContent(message.content)" />
+                      </template>
+                      <template v-else>
+                        <pre class="json-content">{{ formatJsonContent(message.content) }}</pre>
+                      </template>
+                    </div>
+                    <!-- type=4: 格式化文本(HTML标签解析) -->
+                    <div class="message-content" v-else-if="message.type === 4">
+                      <div class="formatted-text" v-html="message.content"></div>
+                    </div>
+                    <!-- 其他类型: 默认显示 -->
+                    <div class="message-content" v-else>
+                      {{ message.content }}
+                    </div>
+                    <div class="message-time">
+                      {{ parseTime(message.createdTime) }}
+                    </div>
+                  </div>
+                  <div class="message-avatar">
+                    <el-avatar :size="32" :src="userAvatar">患</el-avatar>
+                  </div>
+                </template>
+              </div>
+              
+              <!-- 空状态提示 -->
+              <div v-if="chatMessages.length === 0 && !chatLoading" class="no-messages">
+                暂无聊天记录
+              </div>
+            </div>
+          </el-card>
+        </div>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+
+<script>
+import { getPrescription, getChatMessages } from "@/api/hisStore/storePrescription";
+import PrescriptionCard from "@/components/PrescriptionCard/index.vue";
+
+export default {
+  name: "StorePrescriptionDetail",
+  components: {
+    PrescriptionCard
+  },
+  data() {
+    return {
+      // 当前选中的选项卡
+      activeTab: 'detail',
+      // 处方ID
+      preId: null,
+      // 详细信息加载状态
+      detailLoading: false,
+      // 问诊信息加载状态
+      consultationLoading: false,
+      // 聊天内容加载状态
+      chatLoading: false,
+      // 处方详情数据
+      prescriptionDetail: {},
+      // 聊天消息数据
+      chatMessages: [],
+      // 头像
+      doctorAvatar: '',
+      userAvatar: '',
+      // 性别选项
+      genderOptions: [
+        { dictLabel: "未知", dictValue: "0" },
+        { dictLabel: "男", dictValue: "1" },
+        { dictLabel: "女", dictValue: "2" }
+      ],
+      // 审核状态选项
+      auditStatusOptions: [
+        { dictLabel: "待审核", dictValue: "1" },
+        { dictLabel: "审核通过", dictValue: "2" },
+        { dictLabel: "审核不通过", dictValue: "3" }
+      ]
+    };
+  },
+  created() {
+    this.preId = this.$route.params.preId;
+    this.getPrescriptionDetail();
+  },
+  methods: {
+    /** 返回列表 */
+    goBack() {
+      this.$router.go(-1);
+    },
+    /** 选项卡切换 */
+    handleTabClick(tab) {
+      if (tab.name === 'chat' && this.chatMessages.length === 0) {
+        this.getChatMessages();
+      }
+    },
+    /** 获取处方详情 */
+    getPrescriptionDetail() {
+      this.detailLoading = true;
+      getPrescription(this.preId).then(response => {
+        this.prescriptionDetail = response.data;
+        this.detailLoading = false;
+      }).catch(() => {
+        this.detailLoading = false;
+      });
+    },
+    /** 获取聊天消息 */
+    getChatMessages() {
+      this.chatLoading = true;
+      getChatMessages(this.preId).then(response => {
+        this.chatMessages = response.data || [];
+        this.chatLoading = false;
+      }).catch(() => {
+        this.chatLoading = false;
+        // 不显示模拟数据,保持空数组
+        this.chatMessages = [];
+      });
+    },
+    /** 获取性别文本 */
+    getGenderText(value) {
+      const option = this.genderOptions.find(item => item.dictValue === String(value));
+      return option ? option.dictLabel : '-';
+    },
+    /** 获取审核状态文本 */
+    getAuditStatusText(value) {
+      const option = this.auditStatusOptions.find(item => item.dictValue === String(value));
+      return option ? option.dictLabel : '-';
+    },
+    /** 获取服务类型文本 */
+    getServiceTypeText(value) {
+      const types = { '0': '图文', '1': '视频' };
+      return types[String(value)] || '-';
+    },
+    /** 获取是否文本 */
+    getYesNoText(value) {
+      const types = { '0': '否', '1': '是' };
+      return types[String(value)] || '-';
+    },
+    /** 获取来源文本 */
+    getSourceText(value) {
+      const sources = { '0': '微信小程序', '1': 'APP', '2': 'H5', '3': '支付宝小程序' };
+      return sources[String(value)] || '-';
+    },
+    /** 获取关系文本 */
+    getRelationshipText(value) {
+      const relationships = { '1': '本人', '2': '父母', '3': '配偶', '4': '子女', '5': '其他' };
+      return relationships[String(value)] || '-';
+    },
+    /** 检查是否为处方信息 */
+    isPrescriptionContent(content) {
+      // 检查输入是否为有效字符串
+      if (!content || typeof content !== 'string') {
+        return false;
+      }
+      
+      try {
+        const parsed = JSON.parse(content);
+        // 检查解析结果是否为对象,且包含必要字段
+        return parsed && 
+               typeof parsed === 'object' && 
+               parsed.id && 
+               parsed.list && 
+               Array.isArray(parsed.list);
+      } catch (e) {
+        return false;
+      }
+    },
+    /** 解析处方信息内容 */
+    parsePrescriptionContent(content) {
+      try {
+        return JSON.parse(content);
+      } catch (e) {
+        return null;
+      }
+    },
+    /** 格式化JSON内容显示 */
+    formatJsonContent(content) {
+      try {
+        const parsed = JSON.parse(content);
+        return JSON.stringify(parsed, null, 2);
+      } catch (e) {
+        return content;
+      }
+    },
+    /** 获取开方情况文本 */
+    getPrescriptionStatusText(value) {
+      const statuses = { '0': '未开方', '1': '开方', '2': '拒绝' };
+      return statuses[String(value)] || '-';
+    },
+    /** 获取处方状态文本 */
+    getStatusText(value) {
+      const statuses = { '1': '正常', '2': '已作废' };
+      return statuses[String(value)] || '-';
+    }
+  }
+};
+</script>
+
+<style scoped>
+.detail-container {
+  padding: 20px;
+  background-color: #f8f9fa;
+  min-height: 100vh;
+}
+
+.detail-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 20px;
+  padding: 16px 0;
+  border-bottom: 1px solid #e9ecef;
+}
+
+.detail-title {
+  font-size: 20px;
+  font-weight: 600;
+  color: #212529;
+  margin: 0;
+}
+
+.back-button {
+  background-color: #6c757d;
+  border-color: #6c757d;
+  color: #ffffff;
+}
+
+.back-button:hover {
+  background-color: #5a6268;
+  border-color: #545b62;
+}
+
+.detail-tabs {
+  background-color: #ffffff;
+  border-radius: 8px;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.detail-card {
+  border: none;
+  box-shadow: none;
+  background-color: #ffffff;
+}
+
+.detail-info {
+  padding: 24px;
+}
+
+/* 信息网格布局 */
+.info-grid {
+  display: grid;
+  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
+  gap: 16px 24px;
+  padding: 0;
+}
+
+.info-item {
+  display: flex;
+  align-items: flex-start;
+  padding: 12px 0;
+  border-bottom: 1px solid #f0f0f0;
+  min-height: 40px;
+}
+
+.info-item:last-child {
+  border-bottom: none;
+}
+
+.info-item label {
+  font-weight: 500;
+  color: #333333;
+  min-width: 120px;
+  margin-right: 12px;
+  flex-shrink: 0;
+  font-size: 14px;
+  line-height: 1.5;
+}
+
+.info-item span {
+  color: #666666;
+  flex: 1;
+  word-break: break-all;
+  font-size: 14px;
+  line-height: 1.5;
+}
+
+.list-title {
+  font-size: 16px;
+  font-weight: 600;
+  color: #212529;
+  margin: 32px 0 16px 0;
+  padding: 12px 0;
+  border-bottom: 2px solid #dee2e6;
+  background-color: #f8f9fa;
+  padding-left: 16px;
+  border-radius: 4px 4px 0 0;
+}
+
+/* 表格样式优化 */
+:deep(.el-table) {
+  border: 1px solid #dee2e6;
+  border-radius: 6px;
+  overflow: hidden;
+}
+
+:deep(.el-table th) {
+  background-color: #f8f9fa;
+  color: #495057;
+  font-weight: 600;
+  border-bottom: 1px solid #dee2e6;
+}
+
+:deep(.el-table td) {
+  color: #212529;
+  border-bottom: 1px solid #f1f3f4;
+}
+
+:deep(.el-table tr:hover > td) {
+  background-color: #f8f9fa;
+}
+
+/* 选项卡样式 */
+:deep(.el-tabs__header) {
+  margin: 0;
+  border-bottom: 1px solid #dee2e6;
+  background-color: #f8f9fa;
+}
+
+:deep(.el-tabs__nav-wrap) {
+  padding: 0 24px;
+}
+
+:deep(.el-tabs__item) {
+  color: #6c757d;
+  font-weight: 500;
+  padding: 0 20px;
+  height: 48px;
+  line-height: 48px;
+}
+
+:deep(.el-tabs__item.is-active) {
+  color: #212529;
+  font-weight: 600;
+}
+
+:deep(.el-tabs__active-bar) {
+  background-color: #495057;
+}
+
+/* 聊天内容样式 */
+.chat-content {
+  background-color: #ffffff;
+}
+
+.chat-card {
+  border: none;
+  box-shadow: none;
+  background-color: #ffffff;
+}
+
+.chat-container {
+  padding: 24px;
+  max-height: 600px;
+  overflow-y: auto;
+  background-color: #f8f9fa;
+  border-radius: 8px;
+}
+
+.message-item {
+  display: flex;
+  margin-bottom: 16px;
+  align-items: flex-start;
+}
+
+.doctor-message {
+  justify-content: flex-start;
+}
+
+.patient-message {
+  justify-content: flex-end;
+}
+
+.message-bubble {
+  max-width: 60%;
+  border-radius: 12px;
+  padding: 12px 16px;
+  position: relative;
+  margin: 0 10px;
+  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+}
+
+.doctor-bubble {
+  background-color: #ffffff;
+  color: #212529;
+  border: 1px solid #dee2e6;
+}
+
+.patient-bubble {
+  background-color: #6c757d;
+  color: #ffffff;
+}
+
+.message-content {
+  word-break: break-word;
+  line-height: 1.5;
+  font-size: 14px;
+}
+
+/* 格式化文本样式 */
+.formatted-text {
+  line-height: 1.6;
+  font-size: 14px;
+}
+
+.formatted-text br {
+  line-height: 1.8;
+}
+
+/* JSON内容样式 */
+.json-content {
+  background-color: #f8f9fa;
+  border: 1px solid #e9ecef;
+  border-radius: 4px;
+  padding: 12px;
+  font-family: 'Courier New', monospace;
+  font-size: 12px;
+  line-height: 1.4;
+  color: #495057;
+  white-space: pre-wrap;
+  word-break: break-all;
+  max-width: 100%;
+  overflow-x: auto;
+}
+
+.message-time {
+  font-size: 12px;
+  margin-top: 8px;
+  text-align: right;
+  opacity: 0.7;
+}
+
+.doctor-bubble .message-time {
+  color: #6c757d;
+}
+
+.patient-bubble .message-time {
+  color: rgba(255, 255, 255, 0.8);
+}
+
+.message-avatar {
+  flex-shrink: 0;
+}
+
+.no-messages {
+  text-align: center;
+  color: #6c757d;
+  padding: 60px 0;
+  font-size: 14px;
+  background-color: #ffffff;
+  border-radius: 8px;
+  border: 1px solid #dee2e6;
+}
+
+/* 响应式设计 */
+@media (max-width: 768px) {
+  .detail-container {
+    padding: 16px;
+  }
+  
+  .detail-info {
+    padding: 16px;
+  }
+  
+  .info-item {
+    flex-direction: column;
+    align-items: flex-start;
+    padding: 8px 0;
+  }
+  
+  .info-item label {
+    margin-bottom: 4px;
+    min-width: auto;
+  }
+  
+  .message-bubble {
+    max-width: 80%;
+  }
+  
+  .chat-container {
+    padding: 16px;
+  }
+  
+  .list-title {
+    margin: 24px 0 12px 0;
+    padding-left: 12px;
+  }
+}
+</style>

+ 488 - 0
src/views/hisStore/storePrescription/index.vue

@@ -0,0 +1,488 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="医院名称" prop="hospitalName">
+        <el-input
+          v-model="queryParams.hospitalName"
+          placeholder="请输入医院名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="药店名称" prop="storeName">
+        <el-input
+          v-model="queryParams.storeName"
+          placeholder="请输入药店名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="患者姓名" prop="userFamilyName">
+        <el-input
+          v-model="queryParams.userFamilyName"
+          placeholder="请输入患者姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="审核状态" prop="auditStatus">
+        <el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态" clearable size="small">
+          <el-option
+            v-for="dict in auditStatusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="创建时间">
+        <el-date-picker
+          v-model="dateRange"
+          size="small"
+          style="width: 240px"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+      </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-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['his:prescription:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['his:prescription:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['his:prescription:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['his:prescription:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row> -->
+
+    <el-table v-loading="loading" :data="prescriptionList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="处方编号" align="center" prop="serialNo" />
+      <el-table-column label="医院名称" align="center" prop="hospitalName" />
+      <el-table-column label="药店名称" align="center" prop="storeName" />
+      <el-table-column label="患者姓名" align="center" prop="userFamilyName" />
+      <el-table-column label="患者手机号" align="center" prop="userFamilyPhone" />
+      <el-table-column label="患者性别" align="center" prop="userFamilyGender">
+        <template slot-scope="scope">
+          <dict-tag :options="genderOptions" :value="scope.row.userFamilyGender"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="患者年龄" align="center" prop="userFamilyAge" />
+      <el-table-column label="医生姓名" align="center" prop="doctorName" />
+      <el-table-column label="医生科室" align="center" prop="doctorOffice" />
+      <el-table-column label="审核状态" align="center" prop="auditStatus">
+        <template slot-scope="scope">
+          <dict-tag :options="auditStatusOptions" :value="scope.row.auditStatus"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="审方药师" align="center" prop="auditApothecaryName" />
+      <el-table-column label="审方时间" align="center" prop="auditTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.auditTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createdTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createdTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <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-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['his:prescription:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['his:prescription:remove']"
+          >删除</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="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="医院名称" prop="hospitalName">
+              <el-input v-model="form.hospitalName" placeholder="请输入医院名称" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="药店名称" prop="storeName">
+              <el-input v-model="form.storeName" placeholder="请输入药店名称" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="患者姓名" prop="userFamilyName">
+              <el-input v-model="form.userFamilyName" placeholder="请输入患者姓名" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="患者手机号" prop="userFamilyPhone">
+              <el-input v-model="form.userFamilyPhone" placeholder="请输入患者手机号" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="患者性别" prop="userFamilyGender">
+              <el-select v-model="form.userFamilyGender" placeholder="请选择患者性别">
+                <el-option
+                  v-for="dict in genderOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="parseInt(dict.dictValue)"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="患者年龄" prop="userFamilyAge">
+              <el-input-number v-model="form.userFamilyAge" :min="0" :max="150" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="医生姓名" prop="doctorName">
+              <el-input v-model="form.doctorName" placeholder="请输入医生姓名" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="医生科室" prop="doctorOffice">
+              <el-input v-model="form.doctorOffice" placeholder="请输入医生科室" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="审核状态" prop="auditStatus">
+              <el-select v-model="form.auditStatus" placeholder="请选择审核状态">
+                <el-option
+                  v-for="dict in auditStatusOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="parseInt(dict.dictValue)"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="审方药师" prop="auditApothecaryName">
+              <el-input v-model="form.auditApothecaryName" placeholder="请输入审方药师" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="诊断标签" prop="tags">
+              <el-input v-model="form.tags" type="textarea" placeholder="请输入诊断标签" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="备注" prop="memo">
+              <el-input v-model="form.memo" type="textarea" placeholder="请输入备注" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="说明" prop="remarks">
+              <el-input v-model="form.remarks" type="textarea" placeholder="请输入说明" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listPrescription, getPrescription, delPrescription, addPrescription, updatePrescription, exportPrescription } from "@/api/hisStore/storePrescription";
+
+export default {
+  name: "StorePrescription",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 处方订单表格数据
+      prescriptionList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 日期范围
+      dateRange: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        hospitalName: null,
+        storeName: null,
+        userFamilyName: null,
+        serialNo: null,
+        auditStatus: null,
+        beginTime: null,
+        endTime: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        hospitalName: [
+          { required: true, message: "医院名称不能为空", trigger: "blur" }
+        ],
+        storeName: [
+          { required: true, message: "药店名称不能为空", trigger: "blur" }
+        ],
+        userFamilyName: [
+          { required: true, message: "患者姓名不能为空", trigger: "blur" }
+        ],
+        userFamilyPhone: [
+          { required: true, message: "患者手机号不能为空", trigger: "blur" },
+          { pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: "blur" }
+        ],
+        userFamilyGender: [
+          { required: true, message: "患者性别不能为空", trigger: "change" }
+        ],
+        userFamilyAge: [
+          { required: true, message: "患者年龄不能为空", trigger: "blur" }
+        ],
+        doctorName: [
+          { required: true, message: "医生姓名不能为空", trigger: "blur" }
+        ],
+        doctorOffice: [
+          { required: true, message: "医生科室不能为空", trigger: "blur" }
+        ]
+      },
+      // 性别选项
+      genderOptions: [
+        { dictLabel: "未知", dictValue: "0" },
+        { dictLabel: "男", dictValue: "1" },
+        { dictLabel: "女", dictValue: "2" }
+      ],
+      // 审核状态选项
+      auditStatusOptions: [
+        { dictLabel: "待审核", dictValue: "1" },
+        { dictLabel: "审核通过", dictValue: "2" },
+        { dictLabel: "审核不通过", dictValue: "3" }
+      ]
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询处方订单列表 */
+    getList() {
+      this.loading = true;
+      // 处理时间范围参数
+      if (this.dateRange && this.dateRange.length === 2) {
+        this.queryParams.beginTime = this.dateRange[0];
+        this.queryParams.endTime = this.dateRange[1];
+      } else {
+        this.queryParams.beginTime = null;
+        this.queryParams.endTime = null;
+      }
+      
+      listPrescription(this.queryParams).then(response => {
+          this.prescriptionList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        }
+      );
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        preId: null,
+        hospitalName: null,
+        storeName: null,
+        userFamilyName: null,
+        userFamilyPhone: null,
+        userFamilyGender: 0,
+        userFamilyAge: null,
+        doctorName: null,
+        doctorOffice: null,
+        tags: null,
+        memo: null,
+        remarks: null,
+        auditStatus: 1,
+        auditApothecaryName: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.preId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 详情按钮操作 */
+    handleDetail(row) {
+      const preId = row.preId;
+      this.$router.push('/storePrescription/detail/' + preId)
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加处方订单";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const preId = row.preId || this.ids[0]
+      getPrescription(preId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改处方订单";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.preId != null) {
+            updatePrescription(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addPrescription(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const preIds = row.preId || this.ids;
+      this.$modal.confirm('是否确认删除处方订单编号为"' + preIds + '"的数据项?').then(function() {
+        return delPrescription(preIds);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.$modal.confirm('是否确认导出所有处方订单数据项?').then(() => {
+        this.exportLoading = true;
+        return exportPrescription(this.queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+    }
+  }
+};
+</script>

+ 36 - 1
src/views/hisStore/storeProduct/index.vue

@@ -279,6 +279,17 @@
         >导出</el-button>
       </el-col>
 
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-refresh"
+          size="mini"
+          :disabled="multiple"
+          @click="handleSync"
+          v-hasPermi="['store:storeProduct:sync']"
+        >同步</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -327,6 +338,15 @@
           <el-tag prop="status" v-for="(item, index) in isShowOptions"    v-if="scope.row.isShow==item.dictValue">{{item.dictLabel}}</el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="同步状态" align="center" prop="pushStatus" >
+        <template slot-scope="scope">
+          <el-tag 
+            :type="scope.row.pushStatus === 1 ? 'success' : scope.row.pushStatus === 2 ? 'danger' : 'warning'"
+          >
+            {{ scope.row.pushStatus === 0 ? '推送中' : scope.row.pushStatus === 1 ? '成功' : scope.row.pushStatus === 2 ? '失败' : '未同步' }}
+          </el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -914,7 +934,8 @@ import {
   addOrEdit,
   exportStoreProduct,
   importTemplate,
-  batchModify
+  batchModify,
+  sync580
 } from "@/api/hisStore/storeProduct";
 import { getAllStoreProductCategory } from "@/api/hisStore/storeProductCategory";
 import { getAllStoreProductRule } from "@/api/hisStore/storeProductRule";
@@ -1683,6 +1704,20 @@ export default {
       }).then(response => {
         this.download(response.msg);
       }).catch(function() {});
+    },
+    /** 同步按钮操作 */
+    handleSync (row) {
+      const productIds = row.productId || this.ids;
+      this.$confirm('是否确认同步商品编号为"' + productIds + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return sync580(productIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("同步成功");
+      }).catch(function() {});
     }
   }
 };

+ 159 - 154
src/views/sop/companySopRole/index.vue

@@ -1,86 +1,88 @@
 <template>
   <div class="app-container">
-<!--    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">-->
-<!--      <el-form-item label="销售公司" prop="companyId">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.companyId"-->
-<!--          placeholder="请输入销售公司"-->
-<!--          clearable-->
-<!--          size="small"-->
-<!--          @keyup.enter.native="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="权限名称" prop="roleName">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.roleName"-->
-<!--          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-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">-->
+    <!--      <el-form-item label="销售公司" prop="companyId">-->
+    <!--        <el-input-->
+    <!--          v-model="queryParams.companyId"-->
+    <!--          placeholder="请输入销售公司"-->
+    <!--          clearable-->
+    <!--          size="small"-->
+    <!--          @keyup.enter.native="handleQuery"-->
+    <!--        />-->
+    <!--      </el-form-item>-->
+    <!--      <el-form-item label="权限名称" prop="roleName">-->
+    <!--        <el-input-->
+    <!--          v-model="queryParams.roleName"-->
+    <!--          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-row :gutter="10" class="mb8">-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="primary"-->
-<!--          plain-->
-<!--          icon="el-icon-plus"-->
-<!--          size="mini"-->
-<!--          @click="handleAdd"-->
-<!--          v-hasPermi="['sop:companySopRole:add']"-->
-<!--        >新增</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--          size="mini"-->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--          v-hasPermi="['sop:companySopRole:edit']"-->
-<!--        >修改</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="danger"-->
-<!--          plain-->
-<!--          icon="el-icon-delete"-->
-<!--          size="mini"-->
-<!--          :disabled="multiple"-->
-<!--          @click="handleDelete"-->
-<!--          v-hasPermi="['sop:companySopRole:remove']"-->
-<!--        >删除</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--          size="mini"-->
-<!--          :loading="exportLoading"-->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['sop:companySopRole:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
-<!--    </el-row>-->
+    <!--    <el-row :gutter="10" class="mb8">-->
+    <!--      <el-col :span="1.5">-->
+    <!--        <el-button-->
+    <!--          type="primary"-->
+    <!--          plain-->
+    <!--          icon="el-icon-plus"-->
+    <!--          size="mini"-->
+    <!--          @click="handleAdd"-->
+    <!--          v-hasPermi="['sop:companySopRole:add']"-->
+    <!--        >新增</el-button>-->
+    <!--      </el-col>-->
+    <!--      <el-col :span="1.5">-->
+    <!--        <el-button-->
+    <!--          type="success"-->
+    <!--          plain-->
+    <!--          icon="el-icon-edit"-->
+    <!--          size="mini"-->
+    <!--          :disabled="single"-->
+    <!--          @click="handleUpdate"-->
+    <!--          v-hasPermi="['sop:companySopRole:edit']"-->
+    <!--        >修改</el-button>-->
+    <!--      </el-col>-->
+    <!--      <el-col :span="1.5">-->
+    <!--        <el-button-->
+    <!--          type="danger"-->
+    <!--          plain-->
+    <!--          icon="el-icon-delete"-->
+    <!--          size="mini"-->
+    <!--          :disabled="multiple"-->
+    <!--          @click="handleDelete"-->
+    <!--          v-hasPermi="['sop:companySopRole:remove']"-->
+    <!--        >删除</el-button>-->
+    <!--      </el-col>-->
+    <!--      <el-col :span="1.5">-->
+    <!--        <el-button-->
+    <!--          type="warning"-->
+    <!--          plain-->
+    <!--          icon="el-icon-download"-->
+    <!--          size="mini"-->
+    <!--          :loading="exportLoading"-->
+    <!--          @click="handleExport"-->
+    <!--          v-hasPermi="['sop:companySopRole:export']"-->
+    <!--        >导出</el-button>-->
+    <!--      </el-col>-->
+    <!--    </el-row>-->
 
     <el-table border v-loading="loading" :data="companySopRoleList">
       <el-table-column label="销售公司" align="center" prop="companyId">
         <template slot-scope="scope">
-          <el-tag v-for="item in companyList" v-if="item.companyId == scope.row.companyId"> {{scope.row.companyName}}</el-tag>
+          <el-tag v-for="item in companyList" v-if="item.companyId == scope.row.companyId">
+            {{ scope.row.companyName }}
+          </el-tag>
         </template>
       </el-table-column>
       <el-table-column label="权限" align="center">
         <template slot-scope="scope">
           <div style="display: flex;flex-flow: wrap;justify-content: flex-start;">
-            <el-tag style="width: 30%;margin: 0 5px" v-for="item in scope.row.rules">{{roleMap[item]}}</el-tag>
+            <el-tag style="width: 30%;margin: 0 5px" v-for="item in scope.row.rules">{{ roleMap[item] }}</el-tag>
           </div>
         </template>
       </el-table-column>
@@ -92,7 +94,8 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['sop:companySopRole:edit']"
-          >修改</el-button>
+          >修改
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -109,7 +112,7 @@
     <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="销售公司" prop="companyId">
-          <el-select filterable  v-model="form.companyId" placeholder="请选择公司名" size="small">
+          <el-select filterable v-model="form.companyId" placeholder="请选择公司名" size="small">
             <el-option
               v-for="item in companyList"
               :key="item.companyId"
@@ -121,7 +124,9 @@
         <el-form-item label="权限" prop="rules">
           <div style="margin: 15px 0;"></div>
           <el-checkbox-group v-model="form.rules" style="display: flex;flex-flow: wrap;justify-content: flex-start;">
-            <el-checkbox style="width: 28%" v-for="item in roleOptions" :label="item.dictValue" :key="item.dictValue">{{item.dictLabel}}</el-checkbox>
+            <el-checkbox style="width: 28%" v-for="item in roleOptions" :label="item.dictValue" :key="item.dictValue">
+              {{ item.dictLabel }}
+            </el-checkbox>
           </el-checkbox-group>
         </el-form-item>
       </el-form>
@@ -134,11 +139,18 @@
 </template>
 
 <script>
-import { listCompanySopRole, getCompanySopRole, delCompanySopRole, addCompanySopRole, updateCompanySopRole, exportCompanySopRole } from "@/api/sop/companySopRole";
-import { getCompanyList } from "@/api/company/company";
+import {
+  listCompanySopRole,
+  getCompanySopRole,
+  delCompanySopRole,
+  addCompanySopRole,
+  updateCompanySopRole,
+  exportCompanySopRole
+} from '@/api/sop/companySopRole'
+import { getCompanyList } from '@/api/company/company'
 
 export default {
-  name: "CompanySopRole",
+  name: 'CompanySopRole',
   data() {
     return {
       // 遮罩层
@@ -160,7 +172,7 @@ export default {
       roleOptions: [],
       roleMap: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       companyList: [],
@@ -170,43 +182,42 @@ export default {
         pageSize: 10,
         companyId: null,
         roleName: null,
-        roleValue: null,
+        roleValue: null
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      }
-    };
+      rules: {}
+    }
   },
   created() {
-    this.getList();
-    this.getDicts("company_sop_role").then(response => {
-      this.roleOptions = response.data;
+    this.getList()
+    this.getDicts('company_sop_role').then(response => {
+      this.roleOptions = response.data
       this.roleMap = response.data.reduce((obj, item) => {
-        obj[item.dictValue] = item.dictLabel;
-        return obj;
-      }, {});
-    });
+        obj[item.dictValue] = item.dictLabel
+        return obj
+      }, {})
+    })
     getCompanyList().then(response => {
-      this.companyList = response.data;
-    });
+      this.companyList = response.data
+    })
   },
   methods: {
     /** 查询公司SOP权限列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listCompanySopRole(this.queryParams).then(response => {
         console.info(response.rows)
-        this.companySopRoleList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.companySopRoleList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -221,90 +232,84 @@ export default {
         updateTime: null,
         rules: this.roleOptions.map(e => e.dictValue),
         remark: null
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加公司SOP权限";
+      this.reset()
+      this.open = true
+      this.title = '添加公司SOP权限'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
-      if(row.rules && row.rules.length > 0){
-        this.form.rules = row.rules;
+      this.reset()
+      if (row.rules && row.rules.length > 0) {
+        this.form.rules = row.rules
       }
-      this.form.companyId = row.companyId;
-      this.open = true;
-      this.title = "修改公司SOP权限";
+      this.form.companyId = row.companyId
+      this.open = true
+      this.title = '修改公司SOP权限'
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
-          if (this.form.id != null) {
-            updateCompanySopRole(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addCompanySopRole(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
+          updateCompanySopRole(this.form).then(response => {
+            this.msgSuccess('修改成功')
+            this.open = false
+            this.getList()
+          })
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$confirm('是否确认删除公司SOP权限编号为"' + ids + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delCompanySopRole(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(() => {});
+      const ids = row.id || this.ids
+      this.$confirm('是否确认删除公司SOP权限编号为"' + ids + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return delCompanySopRole(ids)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(() => {
+      })
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有公司SOP权限数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportCompanySopRole(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
-    },
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有公司SOP权限数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.exportLoading = true
+        return exportCompanySopRole(queryParams)
+      }).then(response => {
+        this.download(response.msg)
+        this.exportLoading = false
+      }).catch(() => {
+      })
+    }
   }
-};
+}
 </script>

+ 6 - 2
src/views/system/config/config.vue

@@ -1625,10 +1625,10 @@
           <el-form-item label="apiV3密钥" prop="apiV3Key">
             <el-input v-model="form19.apiV3Key" label="请输入apiV3Key"></el-input>
           </el-form-item>
-           <el-form-item   label="公钥ID" prop="publicKeyId" v-if="form19.isNew==1">
+           <el-form-item   label="公钥ID" prop="publicKeyId">
             <el-input v-model="form19.publicKeyId" label="请输入公钥ID"></el-input>
           </el-form-item>
-           <el-form-item   label="公钥证书" prop="publicKeyPath" v-if="form19.isNew==1">
+           <el-form-item   label="公钥证书" prop="publicKeyPath">
             <el-input v-model="form19.publicKeyPath" label="请输入publicKeyPath"></el-input>
           </el-form-item>
           <el-form-item label="key路径" prop="privateKeyPath">
@@ -2224,6 +2224,9 @@
             </el-switch>
           </el-form-item>
 
+           <el-form-item label="处方类型(0-易诊通1-580)" prop="prescribeType">
+            <el-input v-model="form27.prescribeType" label="请输入处方类型"></el-input>
+          </el-form-item>
           <div class="footer">
             <el-button type="primary" @click="submitForm27">提 交</el-button>
           </div>
@@ -2433,6 +2436,7 @@ export default {
         }
       },
       form27: {},
+      form28: {},
       storeProductScrmColumns:[],
       storeScrmColumns: [],
       photoArr: [],