|
|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<div style="display: flex;"> |
|
|
|
<div> |
|
|
|
<div :style="'width:' + (window.pageWidth - 200 - 145) + 'px;'"> |
|
|
|
<el-table :data="dataTransOpts.tableM.lis_request" border @row-click="rowClick" |
|
|
|
:height="window.pageHeight < 600 ? 140 : Math.floor((window.pageHeight - 250) * 2 / 5)" size="small" |
|
|
|
highlight-current-row ref="lis_request"> |
|
|
|
@ -40,27 +40,29 @@ |
|
|
|
<el-button type="success" class="commonbutton" @click="btnChoose(true)">全选</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '取消全选')" class="listBtn"> |
|
|
|
<el-button type="success" class="commonbutton" @click="btnChoose(false)">取消全选</el-button> |
|
|
|
<el-button type="success" class="deleteButton" @click="btnChoose(false)">取消全选</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '打印')" class="listBtn"> |
|
|
|
<el-button type="primary" class="commonbutton" @click="lisPrint(false)">打印条码</el-button> |
|
|
|
<el-button type="primary" class="commonbutton" @click="btnLisPrint(false)">打印条码</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '预览条码')" class="listBtn"> |
|
|
|
<el-button type="danger" class="deleteButton" @click="lisPrint(true)">预览条码</el-button> |
|
|
|
<el-button type="danger" class="commonbutton" @click="btnLisPrint(true)">预览条码</el-button> |
|
|
|
</div> |
|
|
|
<!-- 预留 |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '发送申请')" class="listBtn"> |
|
|
|
<el-button type="danger" class="deleteButton" @click="LisRequest(true)">发送申请</el-button> |
|
|
|
<el-button type="danger" class="commonbutton" @click="LisRequest(true)">发送申请</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '撤消申请')" class="listBtn"> |
|
|
|
<el-button type="danger" class="deleteButton" @click="LisRequest(false)">撤消申请</el-button> |
|
|
|
</div> |
|
|
|
--> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import moment from "moment"; |
|
|
|
import { mapState } from "vuex"; |
|
|
|
import { dddw, getPagePriv, checkPagePriv, } from "../../utlis/proFunc"; |
|
|
|
import { arrayExistObj, dddw, getPagePriv, checkPagePriv, deepCopy, } from "../../utlis/proFunc"; |
|
|
|
import { getapi, postapi, putapi, deletapi } from "../../api/api"; |
|
|
|
import LisRequest from "./LisRequest.vue"; |
|
|
|
|
|
|
|
@ -72,7 +74,7 @@ export default { |
|
|
|
routeUrlorPageName: 'patientLis', //当前页面归属路由或归属页面权限名称 |
|
|
|
privs: [] // 页面权限 |
|
|
|
}, |
|
|
|
chooseRows:[], // 选中的行 |
|
|
|
chooseRows: [], // 选中的行 |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -94,7 +96,7 @@ export default { |
|
|
|
...mapState(["window", "dataTransOpts", "dict", "patientRegister"]), |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
dddw, moment,checkPagePriv, |
|
|
|
dddw, moment, checkPagePriv, |
|
|
|
|
|
|
|
//颜色转换 |
|
|
|
colorTrans(intDataColor) { |
|
|
|
@ -104,17 +106,118 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 选中行 |
|
|
|
rowClick(row){ |
|
|
|
rowClick(row) { |
|
|
|
this.chooseRows = [row] |
|
|
|
}, |
|
|
|
|
|
|
|
// 全选 / 取消全选 |
|
|
|
btnChoose(isChooseAll){ |
|
|
|
// this.$refs.singleTable.setCurrentRow(row); |
|
|
|
// lis_request |
|
|
|
btnChoose(isChooseAll) { |
|
|
|
if (isChooseAll) { |
|
|
|
this.chooseRows = deepCopy(this.dataTransOpts.tableM.lis_request) |
|
|
|
this.chooseRows.forEach(e => { |
|
|
|
this.$refs['lis_request'].setCurrentRow(e); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.chooseRows = [] |
|
|
|
this.$refs['lis_request'].setCurrentRow(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//检验申请 |
|
|
|
async btnLisRequest(isRequest) { |
|
|
|
if (this.chooseRows.length == 0) { |
|
|
|
this.$message.warning({ showClose: true, message: "请先选择要操作的条码记录!" }) |
|
|
|
return |
|
|
|
} |
|
|
|
console.log('btnLisRequest',isRequest) |
|
|
|
}, |
|
|
|
|
|
|
|
// 打印或预览 |
|
|
|
async btnLisPrint(isPreview) { |
|
|
|
if (!this.$peisAPI) { |
|
|
|
this.$message.warning({ showClose: true, message: "此功能需要在壳客户端中方可运行!" }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.chooseRows.length == 0) { |
|
|
|
this.$message.warning({ showClose: true, message: "请先选择要操作的条码记录!" }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (isPreview) { |
|
|
|
lisPrint(this.chooseRows[0].lisRequestId,"0003",isPreview) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 打印 |
|
|
|
for (let i = 0; i < this.chooseRows.length; i++) { |
|
|
|
let e = this.chooseRows[i]; |
|
|
|
try { |
|
|
|
let err = await lisPrint(e.lisRequestId,"0003",isPreview) |
|
|
|
if(!err){ |
|
|
|
let lfind = arrayExistObj(this.dataTransOpts.tableM.lis_request,"lisRequestId",e.lisRequestId) |
|
|
|
if(lfind > -1) this.dataTransOpts.tableM.lis_request[lfind].isPrint = "Y" |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.log(`打印条码或更新条码打印状态失败,原因:${error}`) |
|
|
|
this.$message.warning({ showClose: true, message: `打印条码或更新条码打印状态失败,原因:${error}`}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//单个检验条码打印 |
|
|
|
async lisPrint(lisRequestId, ReportCode, isPreview) { |
|
|
|
let err = "" |
|
|
|
let token = window.sessionStorage.getItem("token"); |
|
|
|
let user = window.sessionStorage.getItem("user"); |
|
|
|
let toOutShell = { |
|
|
|
ReportCode, |
|
|
|
token, |
|
|
|
IsMoreLabel: 'N', |
|
|
|
isBuildImage: 'N', |
|
|
|
IsUploadPdf: 'N', |
|
|
|
preViewCanPrint: "N", |
|
|
|
Parameters: [ |
|
|
|
{ Name: "printer", Value: user }, |
|
|
|
{ Name: "hisLog", Value: "pic/hisLog.jpg" }, |
|
|
|
], |
|
|
|
BusinessCode: lisRequestId |
|
|
|
}; |
|
|
|
console.log('this.$peisAPI.print', toOutShell) |
|
|
|
if (isPreview) { |
|
|
|
this.$peisAPI.printPre(JSON.stringify(toOutShell)) |
|
|
|
.then(res => { |
|
|
|
console.log('this.$peisAPI.printPre', res) |
|
|
|
if (JSON.parse(res).code < 0) { |
|
|
|
this.$message.warning({ showClose: true, message: JSON.parse(res).message }); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log('打印检验条码错误', err) |
|
|
|
this.$message.warning({ showClose: true, message: `${err}` }); |
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
try { |
|
|
|
let lres = await this.$peisAPI.print(JSON.stringify(toOutShell)) |
|
|
|
let Jres = JSON.parse(lres) |
|
|
|
if(Jres.code < 0){ |
|
|
|
err = Jres.message |
|
|
|
console.log('打印检验条码错误', err) |
|
|
|
this.$message.error({ showClose: true, message: `打印检验条码错误 ${err}` }); |
|
|
|
}else{ |
|
|
|
// 更新条码打印状态 |
|
|
|
// let res = await postapi('/api/app/lisrequest/updatelisrequestisprint',{}); |
|
|
|
// if(res.code < 0){ |
|
|
|
// err = res.message |
|
|
|
// this.$message.error({ showClose: true, message: `更新条码打印状态失败,原因 ${err}` }); |
|
|
|
// } |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
err = `${error}` |
|
|
|
} |
|
|
|
} |
|
|
|
return err |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 刷新条码项目 |
|
|
|
retrieve_lis_request(patientRegisterId) { |
|
|
|
@ -129,8 +232,6 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//监听事件 |
|
|
|
@ -149,7 +250,7 @@ export default { |
|
|
|
<style scoped> |
|
|
|
@import "../../assets/css/global.css"; |
|
|
|
|
|
|
|
.box { |
|
|
|
display: flex; |
|
|
|
.listBtn { |
|
|
|
padding: 2px 0; |
|
|
|
} |
|
|
|
</style> |