Merge branch 'bonus-jyy-smart-canteen' of http://192.168.0.75:3000/bonus/bonus-ui into bonus-jyy-smart-canteen

This commit is contained in:
zzyuan 2025-09-11 16:40:43 +08:00
commit 6e472bdd59
4 changed files with 133 additions and 106 deletions

View File

@ -157,6 +157,17 @@ export function delHealthInfoApi(data) {
data: data data: data
}) })
} }
export function getHealthReportPageApi(data) {
return request({
url: '/smart-canteen/health_person_medical_report/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// 模板-列表 // 模板-列表
export function getModelListApi() { export function getModelListApi() {
return request({ return request({

View File

@ -1,7 +1,7 @@
var port = 18080; var port = 18080;
var connectionMode = "ws:"; var connectionMode = "ws:";
var wsPrint = null; var wsPrint = null;
let wsGetPrinterList = null; var wsGetPrinterList = null;
var CHUNK_SIZE = 1024 * 64; var CHUNK_SIZE = 1024 * 64;
const WebSocketPrint = function (serverURL, strPrinterName, request, callback) { const WebSocketPrint = function (serverURL, strPrinterName, request, callback) {
@ -187,6 +187,7 @@ export {
requestPrint, requestPrint,
getPrinterList, getPrinterList,
wsPrint, wsPrint,
wsGetPrinterList,
WebSocketPrint, WebSocketPrint,
WebSocketGetPrinterList WebSocketGetPrinterList
} }

View File

@ -42,8 +42,6 @@
</el-table-column> </el-table-column>
<el-table-column label="住院日期" align="center" prop="inpatientDate" :show-overflow-tooltip="true"> <el-table-column label="住院日期" align="center" prop="inpatientDate" :show-overflow-tooltip="true">
</el-table-column> </el-table-column>
<el-table-column label="慢性病" align="center" prop="chronicNames" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="劳动强度" align="center" prop="labourIntensity" :show-overflow-tooltip="true"> <el-table-column label="劳动强度" align="center" prop="labourIntensity" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.labourIntensity==1">轻劳动</span> <span v-if="scope.row.labourIntensity==1">轻劳动</span>
@ -302,7 +300,7 @@
<script> <script>
import { deptTreeSelect } from '@/api/system/user' import { deptTreeSelect } from '@/api/system/user'
import { dictHealthChronicApi,addHealthScienceApi,editHealthScienceApi,delHealthScienceApi,getHealthInfoPageApi import { dictHealthChronicApi,addHealthScienceApi,editHealthScienceApi,delHealthScienceApi,getHealthInfoPageApi,getHealthReportPageApi
,getModelListApi,getHealthInfoDetailApi,getModelByIdApi,addReportApi,getReportApi,delReportListApi,getReportByIdApi } from "@/api/healthCenter/index"; ,getModelListApi,getHealthInfoDetailApi,getModelByIdApi,addReportApi,getReportApi,delReportListApi,getReportByIdApi } from "@/api/healthCenter/index";
import { imgUpLoadTwo } from '@/api/system/upload' import { imgUpLoadTwo } from '@/api/system/upload'
import { decryptWithSM4,encryptWithSM4 } from '@/utils/sm'; import { decryptWithSM4,encryptWithSM4 } from '@/utils/sm';
@ -351,6 +349,7 @@ export default {
dateRange:[new Date(),new Date()], dateRange:[new Date(),new Date()],
chronicOptions:[], chronicOptions:[],
personData:{ personData:{
'nickName':''
}, },
reportDatas:[ reportDatas:[
{"medicalProjectName":"身体","medicalProjectDetailNames":[ {"medicalProjectName":"身体","medicalProjectDetailNames":[
@ -470,7 +469,7 @@ export default {
// }else{ // }else{
// this.queryParams.chronicIds = "" // this.queryParams.chronicIds = ""
// } // }
getHealthInfoPageApi(param).then(response => { getHealthReportPageApi(param).then(response => {
this.tableListData = response.rows; this.tableListData = response.rows;
this.tableListData.forEach(item=>{ this.tableListData.forEach(item=>{
if(item.mobile&&item.mobile!=""){ if(item.mobile&&item.mobile!=""){
@ -542,6 +541,7 @@ export default {
this.title = "新增"; this.title = "新增";
}, },
handleReport(row) { handleReport(row) {
console.log("体检报告",)
this.form = Object.assign({}, row); this.form = Object.assign({}, row);
this.selectUser=this.form.userId; this.selectUser=this.form.userId;
this.openAddReport = true; this.openAddReport = true;
@ -552,7 +552,9 @@ export default {
this.loading = false; this.loading = false;
}); });
getHealthInfoDetailApi(this.form).then(response => { getHealthInfoDetailApi(this.form).then(response => {
if(response.data){
this.personData=response.data; this.personData=response.data;
console.log("this.personData",this.personData) console.log("this.personData",this.personData)
if(this.personData.bloodType==1){ if(this.personData.bloodType==1){
this.personData.bloodType="A型"; this.personData.bloodType="A型";
@ -606,6 +608,8 @@ export default {
}else if(this.personData.labourIntensity==3){ }else if(this.personData.labourIntensity==3){
this.personData.labourIntensity="重强度劳动"; this.personData.labourIntensity="重强度劳动";
} }
}
}); });
}, },
getReportList(){ getReportList(){

View File

@ -117,14 +117,16 @@
</el-cascader> </el-cascader>
</el-form-item> </el-form-item>
<!-- <el-form-item label="小票打印机" prop="deptIdList">--> <!-- <el-form-item label="小票打印机" prop="deptIdList">-->
<!-- <el-select v-model="printerName" clearable collapse-tags style="width: 220px">--> <!-- <el-input v-model="printerName" placeholder="请输入订单号" maxlength="20" clearable-->
<!-- <el-option--> <!-- style="width: 220px"/>-->
<!-- v-for="item in printList"--> <!--&lt;!&ndash; <el-select v-model="printerName" placeholder="请选择小票打印机" clearable collapse-tags style="width: 220px">&ndash;&gt;-->
<!-- :key="item.value"--> <!--&lt;!&ndash; <el-option&ndash;&gt;-->
<!-- :label="item.name"--> <!--&lt;!&ndash; v-for="item in printList"&ndash;&gt;-->
<!-- :value="item.value"--> <!--&lt;!&ndash; :key="item.value"&ndash;&gt;-->
<!-- />--> <!--&lt;!&ndash; :label="item.name"&ndash;&gt;-->
<!-- </el-select>--> <!--&lt;!&ndash; :value="item.value">&ndash;&gt;-->
<!--&lt;!&ndash; </el-option>&ndash;&gt;-->
<!--&lt;!&ndash; </el-select>&ndash;&gt;-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
@ -537,16 +539,16 @@
<!-- 提醒对话框 --> <!-- 提醒对话框 -->
<el-dialog :title="handleType+'提醒'" :visible.sync="openRemind" width="40%" append-to-body> <el-dialog :title="handleType+'提醒'" :visible.sync="openRemind" width="40%" append-to-body>
<div> <!-- <div>-->
<el-select v-model="printerName" clearable collapse-tags style="width: 220px"> <!-- <el-select v-model="printerName" clearable collapse-tags style="width: 220px">-->
<el-option <!-- <el-option-->
v-for="item in printList" <!-- v-for="item in printList"-->
:key="item.value" <!-- :key="item.value"-->
:label="item.name" <!-- :label="item.name"-->
:value="item.value" <!-- :value="item.value"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</div> <!-- </div>-->
<div class="remind-question">请问是否对以下可{{ handleType }}订单进行{{ handleType }}操作</div> <div class="remind-question">请问是否对以下可{{ handleType }}订单进行{{ handleType }}操作</div>
<div class="remind-title">{{ handleType }}订单 {{ ableList.length }} </div> <div class="remind-title">{{ handleType }}订单 {{ ableList.length }} </div>
<div v-for="(item,index) in ableList" :key="item.orderId">{{ (index + 1) }}. <div v-for="(item,index) in ableList" :key="item.orderId">{{ (index + 1) }}.
@ -694,38 +696,46 @@ export default {
created() { created() {
// this.printerName = '' // this.printerName = ''
// this.printList = [] // this.printList = []
this.PosPrinter = new WebSDK.EscPosCommand()
this.refreshPrinterList()
this.getAreaTreeData() this.getAreaTreeData()
this.getDeptTree() this.getDeptTree()
this.getList() this.getList()
}, },
mounted() { mounted() {
this.PosPrinter = new WebSDK.EscPosCommand()
this.refreshPrinterList()
}, },
methods: { methods: {
refreshPrinterList() { refreshPrinterList() {
setPort(18080) setPort(18080)
const category = { 'category': 1 } getPrinterList({ 'category': 1 },(printer) =>{
getPrinterList(category, this.updatePrinterList) this.updatePrinterList(printer)
})
}, },
updatePrinterList(printers) { updatePrinterList(printers) {
// this.printList = printers console.log("Printers from getPrinterList:", printers)
// console.log(this.printList) if (!Array.isArray(printers)) {
// if (!Array.isArray(printers)) { console.error('Expected an array of printers, but got:', typeof printers)
// console.error('Expected an array of printers, but got:', typeof printers) return
// return
// }
// console.log('Available printers:', this.printList)
this.printList = printers.map(item => ({
name: item.logicalName,
value: item.logicalName
}))
console.log('Available printers:', this.printList)
if (this.printList.length > 0) {
this.printerName = this.printList[0].name
} }
this.printList = Array.isArray(printers)
? printers.map((item, index) => ({
name: item.logicalName,
value: index,
}))
: []
console.log('Available printers:', this.printList)
console.log('Available printers size:', this.printList.length)
if (this.printList.length > 0) {
console.log('Setting default printer to:', this.printList[0].value)
this.printerName = this.printList[0].value
}
console.log('this.printerName:', this.printerName)
console.log('this.printList:', this.printList)
this.$nextTick(() => {
//
this.$forceUpdate()
})
}, },
// //
getAreaTreeData() { getAreaTreeData() {
@ -1046,14 +1056,14 @@ export default {
this.$modal.msgSuccess('批量核销完成') this.$modal.msgSuccess('批量核销完成')
} }
if (this.handleType == '打印小票') { if (this.handleType == '打印小票') {
if (this.printList.length === 0) { // if (this.printList.length === 0) {
this.$modal.msgWarning('请先开启小票打印机服务!') // this.$modal.msgWarning(',,')
return // return
} // }
if (this.printerName === '') { // if (this.printerName === '') {
this.$modal.msgWarning('请先选择小票打印机!') // this.$modal.msgWarning('')
return // return
} // }
const _titles = ['菜品名称', '数量', '单价', '总价'] const _titles = ['菜品名称', '数量', '单价', '总价']
const _columnWidths = [20, 10, 10, 8] const _columnWidths = [20, 10, 10, 8]
console.log(this.ableList) console.log(this.ableList)
@ -1082,7 +1092,8 @@ export default {
}) // : 277 -> Total: 277; : 277 -> Amount Due: 277; : 1234567891011 -> Flow Number: 1234567891011; -> Thank you for your visit! Welcome again next time! }) // : 277 -> Total: 277; : 277 -> Amount Due: 277; : 1234567891011 -> Flow Number: 1234567891011; -> Thank you for your visit! Welcome again next time!
.printAndFeed(2) .printAndFeed(2)
.feedAndCut(50) .feedAndCut(50)
this.prepareAndPrint(this.printerName) //TODO
this.prepareAndPrint('Printer1')
}) })
this.$modal.msgSuccess('打印小票完成') this.$modal.msgSuccess('打印小票完成')