图片预览
This commit is contained in:
		| @@ -29,10 +29,21 @@ | ||||
|       > | ||||
|         <div v-for="con in item.content" :key="con.value"> | ||||
|           <text-info | ||||
|             v-if="item.title !== '体检报告'" | ||||
|             :title="con.title" | ||||
|             :value="data[con.value]" | ||||
|             extraclass="text-info-extra" | ||||
|           /> | ||||
|           <div v-else> | ||||
|             <span :style="{ color: '#8c8c8c' }">{{ con.title }}:</span> | ||||
|             <el-button | ||||
|               v-if="data[con.value]" | ||||
|               type="text" | ||||
|               size="mini" | ||||
|               @click="handleOnPreviewClick(data[con.value])" | ||||
|               >查看</el-button | ||||
|             > | ||||
|           </div> | ||||
|         </div> | ||||
|       </el-collapse-item> | ||||
|     </el-collapse> | ||||
| @@ -52,6 +63,17 @@ | ||||
|         <el-button @click="onClosed">取 消</el-button> | ||||
|       </div> | ||||
|     </el-dialog> | ||||
|  | ||||
|     <!-- 预览弹窗 --> | ||||
|     <el-dialog | ||||
|       :visible.sync="previewVisible" | ||||
|       title="体检报告" | ||||
|       class="preview_dialog_wrapper" | ||||
|     > | ||||
|       <div class="preview_content"> | ||||
|         <img :src="previewUrl" alt="" class="preview_img" /> | ||||
|       </div> | ||||
|     </el-dialog> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| @@ -103,6 +125,8 @@ export default { | ||||
|  | ||||
|     return { | ||||
|       open: false, | ||||
|       previewVisible: false, | ||||
|       previewUrl: "", | ||||
|       basicInfo, | ||||
|       healthyInvestigate: [ | ||||
|         { | ||||
| @@ -244,6 +268,10 @@ export default { | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     handleOnPreviewClick(url) { | ||||
|       this.previewVisible = true; | ||||
|       this.previewUrl = `${window.location.origin}${url}`; | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|   | ||||
| @@ -1,245 +1,258 @@ | ||||
| <template> | ||||
|   <el-dialog | ||||
|     :visible.sync="visible" | ||||
|     :title="title" | ||||
|     append-to-body | ||||
|     @closed="onClosed" | ||||
|     :width="dialogWidth" | ||||
|   > | ||||
|     <div style="display:flex;flex-direction:row"> | ||||
|     <div v-if="showFlag" style="float: left;width: 900px"> | ||||
|       <div | ||||
|         style="float: right; margin-top: -10px; margin-bottom: 10px" | ||||
|         v-show="dataList.length > 0" | ||||
|       > | ||||
|         <!-- 只有新版健康评估信息才可修改,旧的体征数据不支持修改 --> | ||||
|         <el-button | ||||
|           type="info" | ||||
|           v-show="dataType == 0" | ||||
|           @click="generateReport()" | ||||
|           plain | ||||
|           >下载报告</el-button | ||||
|         > | ||||
|         <el-button | ||||
|           type="info" | ||||
|           v-show="dataType == 0" | ||||
|           @click="handleEditGuidanceClick()" | ||||
|           plain | ||||
|           >减脂指导</el-button | ||||
|         > | ||||
|         <el-button | ||||
|           v-hasPermi="['custom:healthy:edit']" | ||||
|           type="info" | ||||
|           v-show="dataType == 0" | ||||
|           @click="handleEditRemarkClick()" | ||||
|           plain | ||||
|           >修改备注</el-button | ||||
|         > | ||||
|         <el-button | ||||
|           v-hasPermi="['custom:healthy:edit']" | ||||
|           type="warning" | ||||
|           v-show="dataType == 0" | ||||
|           @click="handleEditHealthyClick()" | ||||
|           plain | ||||
|           >修改信息</el-button | ||||
|         > | ||||
|         <el-button | ||||
|           type="danger" | ||||
|           v-hasPermi="['custom:healthy:remove']" | ||||
|           @click="handleDelete()" | ||||
|           plain | ||||
|           >删除信息</el-button | ||||
|         > | ||||
|       </div> | ||||
|       <!-- 客户健康评估 --> | ||||
|       <div v-if="dataList.length > 0 && dataType == 0"> | ||||
|         <!-- 基础信息 --> | ||||
|         <div | ||||
|           v-for="(item, index) in dataList.slice(0, 1)" | ||||
|           style="margin-bottom: 50px" | ||||
|           :key="index" | ||||
|         > | ||||
|           <div> | ||||
|             <p class="p_title_1" style="margin-top: 5px"> | ||||
|               {{ titleArray[index] }} | ||||
|             </p> | ||||
|             <table-detail-message :data="item"></table-detail-message> | ||||
|           </div> | ||||
|           <!-- 备注 --> | ||||
|           <el-table | ||||
|             :data="remarkList" | ||||
|             :show-header="false" | ||||
|             border | ||||
|             :cell-style="remarkColumnStyle" | ||||
|             style="width: 100%" | ||||
|           > | ||||
|             <el-table-column width="140" prop="remarkTitle"> </el-table-column> | ||||
|             <el-table-column prop="remarkValue"> | ||||
|               <template slot-scope="scope"> | ||||
|                 <auto-hide-message | ||||
|                   :data="scope.row.remarkValue" | ||||
|                   :maxLength="100" | ||||
|               /></template> | ||||
|             </el-table-column> | ||||
|           </el-table> | ||||
|           <!-- 指导 --> | ||||
|           <el-table | ||||
|             :data="guidanceList" | ||||
|             :show-header="false" | ||||
|             border | ||||
|             :cell-style="remarkColumnStyle" | ||||
|             style="width: 100%" | ||||
|           > | ||||
|             <el-table-column width="140" prop="guidanceTitle"> | ||||
|             </el-table-column> | ||||
|             <el-table-column prop="guidanceValue"> | ||||
|               <template slot-scope="scope"> | ||||
|                 <auto-hide-message | ||||
|                   :data="scope.row.guidanceValue" | ||||
|                   :maxLength="100" | ||||
|               /></template> | ||||
|             </el-table-column> | ||||
|           </el-table> | ||||
|         </div> | ||||
|         <!-- 其他信息 --> | ||||
|         <div style="height: 390px; overflow: auto"> | ||||
|   <div> | ||||
|     <el-dialog | ||||
|       :visible.sync="visible" | ||||
|       :title="title" | ||||
|       append-to-body | ||||
|       @closed="onClosed" | ||||
|       :width="dialogWidth" | ||||
|     > | ||||
|       <div style="display: flex; flex-direction: row"> | ||||
|         <div v-if="showFlag" style="float: left; width: 900px"> | ||||
|           <div | ||||
|             v-for="(item, index) in dataList.slice(1, 10)" | ||||
|             style="margin-bottom: 50px" | ||||
|             :key="index" | ||||
|             style="float: right; margin-top: -10px; margin-bottom: 10px" | ||||
|             v-show="dataList.length > 0" | ||||
|           > | ||||
|             <div> | ||||
|               <p class="p_title_1" style="margin-top: 5px"> | ||||
|                 {{ titleArray[index + 1] }} | ||||
|               </p> | ||||
|               <table-detail-message | ||||
|                 :data="item" | ||||
|                 v-if="index != dataList.length - 2" | ||||
|               ></table-detail-message> | ||||
|             <!-- 只有新版健康评估信息才可修改,旧的体征数据不支持修改 --> | ||||
|             <el-button | ||||
|               type="info" | ||||
|               v-show="dataType == 0" | ||||
|               @click="generateReport()" | ||||
|               plain | ||||
|               >下载报告</el-button | ||||
|             > | ||||
|             <el-button | ||||
|               type="info" | ||||
|               v-show="dataType == 0" | ||||
|               @click="handleEditGuidanceClick()" | ||||
|               plain | ||||
|               >减脂指导</el-button | ||||
|             > | ||||
|             <el-button | ||||
|               v-hasPermi="['custom:healthy:edit']" | ||||
|               type="info" | ||||
|               v-show="dataType == 0" | ||||
|               @click="handleEditRemarkClick()" | ||||
|               plain | ||||
|               >修改备注</el-button | ||||
|             > | ||||
|             <el-button | ||||
|               v-hasPermi="['custom:healthy:edit']" | ||||
|               type="warning" | ||||
|               v-show="dataType == 0" | ||||
|               @click="handleEditHealthyClick()" | ||||
|               plain | ||||
|               >修改信息</el-button | ||||
|             > | ||||
|             <el-button | ||||
|               type="danger" | ||||
|               v-hasPermi="['custom:healthy:remove']" | ||||
|               @click="handleDelete()" | ||||
|               plain | ||||
|               >删除信息</el-button | ||||
|             > | ||||
|           </div> | ||||
|           <!-- 客户健康评估 --> | ||||
|           <div v-if="dataList.length > 0 && dataType == 0"> | ||||
|             <!-- 基础信息 --> | ||||
|             <div | ||||
|               v-for="(item, index) in dataList.slice(0, 1)" | ||||
|               style="margin-bottom: 50px" | ||||
|               :key="index" | ||||
|             > | ||||
|               <div> | ||||
|                 <p class="p_title_1" style="margin-top: 5px"> | ||||
|                   {{ titleArray[index] }} | ||||
|                 </p> | ||||
|                 <table-detail-message :data="item"></table-detail-message> | ||||
|               </div> | ||||
|               <!-- 备注 --> | ||||
|               <el-table | ||||
|                 :data="remarkList" | ||||
|                 :show-header="false" | ||||
|                 v-if="index == dataList.length - 2" | ||||
|                 :data="item" | ||||
|                 border | ||||
|                 :cell-style="columnStyle" | ||||
|                 :cell-style="remarkColumnStyle" | ||||
|                 style="width: 100%" | ||||
|               > | ||||
|                 <el-table-column width="140" prop="attr_name_one"> | ||||
|                 <el-table-column width="140" prop="remarkTitle"> | ||||
|                 </el-table-column> | ||||
|                 <el-table-column prop="value_one"> | ||||
|                 <el-table-column prop="remarkValue"> | ||||
|                   <template slot-scope="scope"> | ||||
|                     <auto-hide-message | ||||
|                       :data=" | ||||
|                         scope.row.value_one == null | ||||
|                           ? '' | ||||
|                           : scope.row.value_one + '' | ||||
|                       " | ||||
|                       :maxLength="20" | ||||
|                     /> | ||||
|                     <el-button | ||||
|                       type="primary" | ||||
|                       v-show="scope.row.value_one" | ||||
|                       @click="downloadFile(medicalReportPathArray[0])" | ||||
|                       >下载</el-button | ||||
|                     > | ||||
|                   </template> | ||||
|                       :data="scope.row.remarkValue" | ||||
|                       :maxLength="100" | ||||
|                   /></template> | ||||
|                 </el-table-column> | ||||
|                 <el-table-column | ||||
|                   width="140" | ||||
|                   prop="attr_name_two" | ||||
|                 ></el-table-column> | ||||
|                 <el-table-column prop="value_two"> | ||||
|               </el-table> | ||||
|               <!-- 指导 --> | ||||
|               <el-table | ||||
|                 :data="guidanceList" | ||||
|                 :show-header="false" | ||||
|                 border | ||||
|                 :cell-style="remarkColumnStyle" | ||||
|                 style="width: 100%" | ||||
|               > | ||||
|                 <el-table-column width="140" prop="guidanceTitle"> | ||||
|                 </el-table-column> | ||||
|                 <el-table-column prop="guidanceValue"> | ||||
|                   <template slot-scope="scope"> | ||||
|                     <auto-hide-message | ||||
|                       :data=" | ||||
|                         scope.row.value_two == null | ||||
|                           ? '' | ||||
|                           : scope.row.value_two + '' | ||||
|                       " | ||||
|                       :maxLength="20" | ||||
|                     /> | ||||
|                     <el-button | ||||
|                       type="primary" | ||||
|                       v-show="scope.row.value_two" | ||||
|                       @click="downloadFile(medicalReportPathArray[1])" | ||||
|                       >下载</el-button | ||||
|                     > | ||||
|                   </template> | ||||
|                 </el-table-column> | ||||
|                 <el-table-column | ||||
|                   width="140" | ||||
|                   prop="attr_name_three" | ||||
|                 ></el-table-column> | ||||
|                 <el-table-column prop="value_three"> | ||||
|                   <template slot-scope="scope"> | ||||
|                     <auto-hide-message | ||||
|                       :data=" | ||||
|                         scope.row.value_three == null | ||||
|                           ? '' | ||||
|                           : scope.row.value_three + '' | ||||
|                       " | ||||
|                       :maxLength="20" | ||||
|                     /> | ||||
|                     <el-button | ||||
|                       type="primary" | ||||
|                       v-show="scope.row.value_three" | ||||
|                       @click="downloadFile(medicalReportPathArray[2])" | ||||
|                       >下载</el-button | ||||
|                     > | ||||
|                   </template> | ||||
|                       :data="scope.row.guidanceValue" | ||||
|                       :maxLength="100" | ||||
|                   /></template> | ||||
|                 </el-table-column> | ||||
|               </el-table> | ||||
|             </div> | ||||
|             <!-- 其他信息 --> | ||||
|             <div style="height: 390px; overflow: auto"> | ||||
|               <div | ||||
|                 v-for="(item, index) in dataList.slice(1, 10)" | ||||
|                 style="margin-bottom: 50px" | ||||
|                 :key="index" | ||||
|               > | ||||
|                 <div> | ||||
|                   <p class="p_title_1" style="margin-top: 5px"> | ||||
|                     {{ titleArray[index + 1] }} | ||||
|                   </p> | ||||
|                   <table-detail-message | ||||
|                     :data="item" | ||||
|                     v-if="index != dataList.length - 2" | ||||
|                   ></table-detail-message> | ||||
|                   <el-table | ||||
|                     :show-header="false" | ||||
|                     v-if="index == dataList.length - 2" | ||||
|                     :data="item" | ||||
|                     border | ||||
|                     :cell-style="columnStyle" | ||||
|                     style="width: 100%" | ||||
|                   > | ||||
|                     <el-table-column width="140" prop="attr_name_one"> | ||||
|                     </el-table-column> | ||||
|                     <el-table-column prop="value_one"> | ||||
|                       <template slot-scope="scope"> | ||||
|                         <!-- <auto-hide-message | ||||
|                           :data=" | ||||
|                             scope.row.value_one == null | ||||
|                               ? '' | ||||
|                               : scope.row.value_one + '' | ||||
|                           " | ||||
|                           :maxLength="20" | ||||
|                         /> --> | ||||
|                         <el-button | ||||
|                           type="text" | ||||
|                           v-show="scope.row.value_one" | ||||
|                           @click="downloadFile(medicalReportPathArray[0])" | ||||
|                           >查看</el-button | ||||
|                         > | ||||
|                       </template> | ||||
|                     </el-table-column> | ||||
|                     <el-table-column | ||||
|                       width="140" | ||||
|                       prop="attr_name_two" | ||||
|                     ></el-table-column> | ||||
|                     <el-table-column prop="value_two"> | ||||
|                       <template slot-scope="scope"> | ||||
|                         <!-- <auto-hide-message | ||||
|                           :data=" | ||||
|                             scope.row.value_two == null | ||||
|                               ? '' | ||||
|                               : scope.row.value_two + '' | ||||
|                           " | ||||
|                           :maxLength="20" | ||||
|                         /> --> | ||||
|                         <el-button | ||||
|                           type="text" | ||||
|                           v-show="scope.row.value_two" | ||||
|                           @click="downloadFile(medicalReportPathArray[1])" | ||||
|                           >查看</el-button | ||||
|                         > | ||||
|                       </template> | ||||
|                     </el-table-column> | ||||
|                     <el-table-column | ||||
|                       width="140" | ||||
|                       prop="attr_name_three" | ||||
|                     ></el-table-column> | ||||
|                     <el-table-column prop="value_three"> | ||||
|                       <template slot-scope="scope"> | ||||
|                         <!-- <auto-hide-message | ||||
|                           :data=" | ||||
|                             scope.row.value_three == null | ||||
|                               ? '' | ||||
|                               : scope.row.value_three + '' | ||||
|                           " | ||||
|                           :maxLength="20" | ||||
|                         /> --> | ||||
|                         <el-button | ||||
|                           type="text" | ||||
|                           v-show="scope.row.value_three" | ||||
|                           @click="downloadFile(medicalReportPathArray[2])" | ||||
|                           >查看</el-button | ||||
|                         > | ||||
|                       </template> | ||||
|                     </el-table-column> | ||||
|                   </el-table> | ||||
|                 </div> | ||||
|               </div> | ||||
|             </div> | ||||
|           </div> | ||||
|           <!-- 客户体征 --> | ||||
|           <div v-else> | ||||
|             <table-detail-message | ||||
|               v-show="dataList.length > 0" | ||||
|               :data="dataList" | ||||
|             ></table-detail-message> | ||||
|             <div | ||||
|               v-show="dataList.length == 0" | ||||
|               style="font-size: 20px; text-align: center" | ||||
|             > | ||||
|               <VueQr :text="copyValue" :logoSrc="logo" :size="256" /> | ||||
|               <div style="text-align: center; margin-top: 20px"> | ||||
|                 <el-button | ||||
|                   icon="el-icon-share" | ||||
|                   size="small" | ||||
|                   title="点击复制链接" | ||||
|                   class="copyBtn" | ||||
|                   type="primary" | ||||
|                   :data-clipboard-text="copyValue" | ||||
|                   @click="handleCopy()" | ||||
|                   >健康评估表链接 | ||||
|                 </el-button> | ||||
|               </div> | ||||
|             </div> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <!-- 客户体征 --> | ||||
|       <div v-else> | ||||
|         <table-detail-message | ||||
|           v-show="dataList.length > 0" | ||||
|           :data="dataList" | ||||
|         ></table-detail-message> | ||||
|         <div | ||||
|           v-show="dataList.length == 0" | ||||
|           style="font-size: 20px; text-align: center" | ||||
|         > | ||||
|           <VueQr :text="copyValue" :logoSrc="logo" :size="256" /> | ||||
|           <div style="text-align: center; margin-top: 20px"> | ||||
|             <el-button | ||||
|               icon="el-icon-share" | ||||
|               size="small" | ||||
|               title="点击复制链接" | ||||
|               class="copyBtn" | ||||
|               type="primary" | ||||
|               :data-clipboard-text="copyValue" | ||||
|               @click="handleCopy()" | ||||
|               >健康评估表链接 | ||||
|             </el-button> | ||||
|           </div> | ||||
|         <div style="width: 200px" v-show="guidanceShow"> | ||||
|           <!-- 编辑减脂指导 --> | ||||
|           <physicalSigns-guidance | ||||
|             ref="physicalSignsGuidanceDialog" | ||||
|             @close="editGuidanceShow(false)" | ||||
|             @refreshHealthyData="getCustomerHealthyByCusId()" | ||||
|           ></physicalSigns-guidance> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div style="width: 200px;" v-show="guidanceShow"> | ||||
|       <!-- 编辑减脂指导 --> | ||||
|       <physicalSigns-guidance | ||||
|         ref="physicalSignsGuidanceDialog" | ||||
|         @close="editGuidanceShow(false)" | ||||
|       <!-- 编辑 --> | ||||
|       <physicalSigns-edit | ||||
|         ref="physicalSignsEditDialog" | ||||
|         @refreshHealthyData="getCustomerHealthyByCusId()" | ||||
|       ></physicalSigns-guidance> | ||||
|     </div> | ||||
|     </div> | ||||
|     <!-- 编辑 --> | ||||
|     <physicalSigns-edit | ||||
|       ref="physicalSignsEditDialog" | ||||
|       @refreshHealthyData="getCustomerHealthyByCusId()" | ||||
|     ></physicalSigns-edit> | ||||
|     <!-- 编辑备注 --> | ||||
|     <physicalSigns-remark | ||||
|       ref="physicalSignsRemarkDialog" | ||||
|       @refreshHealthyData="getCustomerHealthyByCusId()" | ||||
|     ></physicalSigns-remark> | ||||
|       ></physicalSigns-edit> | ||||
|       <!-- 编辑备注 --> | ||||
|       <physicalSigns-remark | ||||
|         ref="physicalSignsRemarkDialog" | ||||
|         @refreshHealthyData="getCustomerHealthyByCusId()" | ||||
|       ></physicalSigns-remark> | ||||
|     </el-dialog> | ||||
|  | ||||
|   </el-dialog> | ||||
|     <!-- 预览弹窗 --> | ||||
|     <el-dialog | ||||
|       :visible.sync="previewVisible" | ||||
|       title="体检报告" | ||||
|       class="preview_dialog_wrapper" | ||||
|     > | ||||
|       <div class="preview_content"> | ||||
|         <img :src="previewUrl" alt="" class="preview_img" /> | ||||
|       </div> | ||||
|     </el-dialog> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import { | ||||
| @@ -269,6 +282,8 @@ export default { | ||||
|   data() { | ||||
|     return { | ||||
|       logo, | ||||
|       previewVisible: false, | ||||
|       previewUrl: "", | ||||
|       visible: false, | ||||
|       showFlag: false, | ||||
|       title: "", | ||||
| @@ -411,8 +426,7 @@ export default { | ||||
|       copyValue: "", | ||||
|       detailHealthy: null, | ||||
|       dialogWidth: "950px", | ||||
|       guidanceShow : false | ||||
|  | ||||
|       guidanceShow: false, | ||||
|     }; | ||||
|   }, | ||||
|   methods: { | ||||
| @@ -781,7 +795,9 @@ export default { | ||||
|       return signList.length > 0 ? signStr.substring(1) : signStr; | ||||
|     }, | ||||
|     downloadFile(fileName) { | ||||
|       this.downloadResource(fileName); | ||||
|       // this.downloadResource(fileName); | ||||
|       this.previewVisible = true; | ||||
|       this.previewUrl = `${window.location.origin}${fileName}`; | ||||
|     }, | ||||
|     generateReport() { | ||||
|       let data = this.detailHealthy; | ||||
| @@ -868,15 +884,15 @@ export default { | ||||
|         this.healthyData | ||||
|       ); | ||||
|     }, | ||||
|     editGuidanceShow(flag){ | ||||
|     editGuidanceShow(flag) { | ||||
|       this.guidanceShow = flag; | ||||
|       this.dialogWidth = flag ? "1200px" : "950px"; | ||||
|     } | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|  | ||||
| <style scoped> | ||||
| <style lang="scss" scoped> | ||||
| .margin-top-20 { | ||||
|   margin-top: 20px; | ||||
| } | ||||
| @@ -885,4 +901,13 @@ export default { | ||||
|   font-weight: bold; | ||||
|   margin-top: 20px; | ||||
| } | ||||
| .preview_dialog_wrapper { | ||||
|   .preview_content { | ||||
|     text-align: center; | ||||
|     .preview_img { | ||||
|       max-height: 600px; | ||||
|       width: auto; | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
|   | ||||
| @@ -175,7 +175,7 @@ export default { | ||||
|   }, | ||||
|   methods: { | ||||
|     showDrawer(data) { | ||||
|       console.log(data); | ||||
|       // console.log(data); | ||||
|       this.data = data; | ||||
|       if (!this.data) { | ||||
|         return; | ||||
| @@ -288,7 +288,7 @@ export default { | ||||
|       this.reset(); | ||||
|     }, | ||||
|     handleOnDelete(data) { | ||||
|       console.log(data); | ||||
|       // console.log(data); | ||||
|  | ||||
|       this.$confirm("此操作将删除对计划的食谱, 是否继续?", "提示", { | ||||
|         confirmButtonText: "确定", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user