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:
commit
6e472bdd59
|
|
@ -157,6 +157,17 @@ export function delHealthInfoApi(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() {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
var port = 18080;
|
||||
var connectionMode = "ws:";
|
||||
var wsPrint = null;
|
||||
let wsGetPrinterList = null;
|
||||
var wsGetPrinterList = null;
|
||||
var CHUNK_SIZE = 1024 * 64;
|
||||
|
||||
const WebSocketPrint = function (serverURL, strPrinterName, request, callback) {
|
||||
|
|
@ -187,6 +187,7 @@ export {
|
|||
requestPrint,
|
||||
getPrinterList,
|
||||
wsPrint,
|
||||
wsGetPrinterList,
|
||||
WebSocketPrint,
|
||||
WebSocketGetPrinterList
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="住院日期" align="center" prop="inpatientDate" :show-overflow-tooltip="true">
|
||||
</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">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.labourIntensity==1">轻劳动</span>
|
||||
|
|
@ -302,7 +300,7 @@
|
|||
|
||||
<script>
|
||||
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";
|
||||
import { imgUpLoadTwo } from '@/api/system/upload'
|
||||
import { decryptWithSM4,encryptWithSM4 } from '@/utils/sm';
|
||||
|
|
@ -351,6 +349,7 @@ export default {
|
|||
dateRange:[new Date(),new Date()],
|
||||
chronicOptions:[],
|
||||
personData:{
|
||||
'nickName':''
|
||||
},
|
||||
reportDatas:[
|
||||
{"medicalProjectName":"身体","medicalProjectDetailNames":[
|
||||
|
|
@ -470,7 +469,7 @@ export default {
|
|||
// }else{
|
||||
// this.queryParams.chronicIds = ""
|
||||
// }
|
||||
getHealthInfoPageApi(param).then(response => {
|
||||
getHealthReportPageApi(param).then(response => {
|
||||
this.tableListData = response.rows;
|
||||
this.tableListData.forEach(item=>{
|
||||
if(item.mobile&&item.mobile!=""){
|
||||
|
|
@ -542,6 +541,7 @@ export default {
|
|||
this.title = "新增";
|
||||
},
|
||||
handleReport(row) {
|
||||
console.log("体检报告",)
|
||||
this.form = Object.assign({}, row);
|
||||
this.selectUser=this.form.userId;
|
||||
this.openAddReport = true;
|
||||
|
|
@ -552,7 +552,9 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
getHealthInfoDetailApi(this.form).then(response => {
|
||||
if(response.data){
|
||||
this.personData=response.data;
|
||||
|
||||
console.log("this.personData",this.personData)
|
||||
if(this.personData.bloodType==1){
|
||||
this.personData.bloodType="A型";
|
||||
|
|
@ -606,6 +608,8 @@ export default {
|
|||
}else if(this.personData.labourIntensity==3){
|
||||
this.personData.labourIntensity="重强度劳动";
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
getReportList(){
|
||||
|
|
|
|||
|
|
@ -117,14 +117,16 @@
|
|||
</el-cascader>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="小票打印机" prop="deptIdList">-->
|
||||
<!-- <el-select v-model="printerName" clearable collapse-tags style="width: 220px">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in printList"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- <el-input v-model="printerName" placeholder="请输入订单号" maxlength="20" clearable-->
|
||||
<!-- style="width: 220px"/>-->
|
||||
<!--<!– <el-select v-model="printerName" placeholder="请选择小票打印机" clearable collapse-tags style="width: 220px">–>-->
|
||||
<!--<!– <el-option–>-->
|
||||
<!--<!– v-for="item in printList"–>-->
|
||||
<!--<!– :key="item.value"–>-->
|
||||
<!--<!– :label="item.name"–>-->
|
||||
<!--<!– :value="item.value">–>-->
|
||||
<!--<!– </el-option>–>-->
|
||||
<!--<!– </el-select>–>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
|
||||
|
|
@ -537,16 +539,16 @@
|
|||
|
||||
<!-- 提醒对话框 -->
|
||||
<el-dialog :title="handleType+'提醒'" :visible.sync="openRemind" width="40%" append-to-body>
|
||||
<div>
|
||||
<el-select v-model="printerName" clearable collapse-tags style="width: 220px">
|
||||
<el-option
|
||||
v-for="item in printList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- <div>-->
|
||||
<!-- <el-select v-model="printerName" clearable collapse-tags style="width: 220px">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in printList"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </div>-->
|
||||
<div class="remind-question">请问是否对以下可{{ handleType }}订单进行{{ handleType }}操作?</div>
|
||||
<div class="remind-title">可{{ handleType }}订单 {{ ableList.length }} 笔</div>
|
||||
<div v-for="(item,index) in ableList" :key="item.orderId">{{ (index + 1) }}.
|
||||
|
|
@ -694,38 +696,46 @@ export default {
|
|||
created() {
|
||||
// this.printerName = ''
|
||||
// this.printList = []
|
||||
this.PosPrinter = new WebSDK.EscPosCommand()
|
||||
this.refreshPrinterList()
|
||||
|
||||
this.getAreaTreeData()
|
||||
this.getDeptTree()
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.PosPrinter = new WebSDK.EscPosCommand()
|
||||
this.refreshPrinterList()
|
||||
},
|
||||
methods: {
|
||||
refreshPrinterList() {
|
||||
setPort(18080)
|
||||
const category = { 'category': 1 }
|
||||
getPrinterList(category, this.updatePrinterList)
|
||||
getPrinterList({ 'category': 1 },(printer) =>{
|
||||
this.updatePrinterList(printer)
|
||||
})
|
||||
},
|
||||
updatePrinterList(printers) {
|
||||
// this.printList = printers
|
||||
// console.log(this.printList)
|
||||
// if (!Array.isArray(printers)) {
|
||||
// console.error('Expected an array of printers, but got:', typeof printers)
|
||||
// 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
|
||||
console.log("Printers from getPrinterList:", printers)
|
||||
if (!Array.isArray(printers)) {
|
||||
console.error('Expected an array of printers, but got:', typeof printers)
|
||||
return
|
||||
}
|
||||
|
||||
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() {
|
||||
|
|
@ -1046,14 +1056,14 @@ export default {
|
|||
this.$modal.msgSuccess('批量核销完成')
|
||||
}
|
||||
if (this.handleType == '打印小票') {
|
||||
if (this.printList.length === 0) {
|
||||
this.$modal.msgWarning('请先开启小票打印机服务!')
|
||||
return
|
||||
}
|
||||
if (this.printerName === '') {
|
||||
this.$modal.msgWarning('请先选择小票打印机!')
|
||||
return
|
||||
}
|
||||
// if (this.printList.length === 0) {
|
||||
// this.$modal.msgWarning('请先开启小票打印机服务,获取打印机列表,可尝试强制刷新浏览器!')
|
||||
// return
|
||||
// }
|
||||
// if (this.printerName === '') {
|
||||
// this.$modal.msgWarning('请先选择小票打印机!')
|
||||
// return
|
||||
// }
|
||||
const _titles = ['菜品名称', '数量', '单价', '总价']
|
||||
const _columnWidths = [20, 10, 10, 8]
|
||||
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!
|
||||
.printAndFeed(2)
|
||||
.feedAndCut(50)
|
||||
this.prepareAndPrint(this.printerName)
|
||||
//TODO 当前打印机名称是写死的,后续需要改成动态选择 目前动态页面赋值有问题
|
||||
this.prepareAndPrint('Printer1')
|
||||
})
|
||||
|
||||
this.$modal.msgSuccess('打印小票完成')
|
||||
|
|
|
|||
Loading…
Reference in New Issue