You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
10 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div style="display: flex;">
  3. <div :style="'width:' + (window.pageWidth - 200 - 145) + 'px;'">
  4. <el-table :data="dataTransOpts.tableM.lis_request" border @row-click="rowClick"
  5. :height="window.pageHeight < 600 ? 140 : Math.floor((window.pageHeight - 250) * 2 / 5)" size="small"
  6. highlight-current-row ref="lis_request" :row-class-name="handleRowClassName">
  7. <el-table-column type="index" label="序号" width="50" align="center" />
  8. <el-table-column prop="isPrint" label="打印" min-width="50">
  9. <template slot-scope="scope">
  10. <i class="el-icon-printer" v-if="scope.row.isPrint == 'Y'" style="font-size: 20px; color: green" />
  11. </template>
  12. </el-table-column>
  13. <el-table-column prop="patientName" label="姓名" min-width="70" align="center" />
  14. <el-table-column prop="lisRequestNo" label="条码号" min-width="120" align="center" />
  15. <el-table-column prop="sampleTypeName" label="标本" min-width="50" align="center" />
  16. <el-table-column prop="sampleContainerName" label="标本容器" min-width="100" />
  17. <el-table-column prop="containerColor" label="颜色" width="50" align="center">
  18. <template slot-scope="scope">
  19. <div
  20. :style="`width: 45px;height: 25px;border-radius: 3px;background-color: ${colorTrans(scope.row.containerColor)};`">
  21. </div>
  22. </template>
  23. </el-table-column>
  24. <el-table-column prop="sampleContainerRemark" label="容器说明" min-width="100" />
  25. <el-table-column prop="asbitemNames" label="检验项目" min-width="120" />
  26. <el-table-column prop="samplerName" label="采样人" min-width="70" align="center" />
  27. <el-table-column prop="samplingTime" label="采样时间" min-width="120" align="center" />
  28. <el-table-column prop="isSignIn" label="是否签收" width="70" align="center">
  29. <template slot-scope="scope">
  30. <div>{{ scope.row.isSignIn == 'Y' ? '√' : '' }}</div>
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="signInOrder" label="签收顺序" width="70" align="center" />
  34. <el-table-column prop="signInPerson" label="签收人" min-width="70" align="center" />
  35. <el-table-column prop="signInTime" label="签收时间" min-width="120" align="center" />
  36. </el-table>
  37. </div>
  38. <div style="margin-left: 10px;width: 110px;">
  39. <div v-show="checkPagePriv(pagePriv.privs, '全选')" class="listBtn">
  40. <el-button type="success" class="commonbutton" @click="btnChoose(true)">全选</el-button>
  41. </div>
  42. <div v-show="checkPagePriv(pagePriv.privs, '取消全选')" class="listBtn">
  43. <el-button type="success" class="deleteButton" @click="btnChoose(false)">取消全选</el-button>
  44. </div>
  45. <div v-show="checkPagePriv(pagePriv.privs, '打印')" class="listBtn">
  46. <el-button type="primary" class="commonbutton" @click="btnLisPrint(false)">打印条码</el-button>
  47. </div>
  48. <div v-show="checkPagePriv(pagePriv.privs, '预览条码')" class="listBtn">
  49. <el-button type="danger" class="commonbutton" @click="btnLisPrint(true)">预览条码</el-button>
  50. </div>
  51. <!-- 预留
  52. <div v-show="checkPagePriv(pagePriv.privs, '发送申请')" class="listBtn">
  53. <el-button type="danger" class="commonbutton" @click="LisRequest(true)">发送申请</el-button>
  54. </div>
  55. <div v-show="checkPagePriv(pagePriv.privs, '撤消申请')" class="listBtn">
  56. <el-button type="danger" class="deleteButton" @click="LisRequest(false)">撤消申请</el-button>
  57. </div>
  58. -->
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import moment from "moment";
  64. import { mapState } from "vuex";
  65. import { arrayExistObj, dddw, getPagePriv, checkPagePriv, deepCopy, } from "../../utlis/proFunc";
  66. import { getapi, postapi, putapi, deletapi } from "../../api/api";
  67. import LisRequest from "./LisRequest.vue";
  68. export default {
  69. components: {},
  70. data() {
  71. return {
  72. pagePriv: {
  73. routeUrlorPageName: 'patientLis', //当前页面归属路由或归属页面权限名称
  74. privs: [] // 页面权限
  75. },
  76. chooseRows: [], // 选中的行
  77. };
  78. },
  79. created() {
  80. //获取用户当前页面的权限
  81. let userPriv = window.sessionStorage.getItem('userPriv')
  82. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  83. },
  84. updated() {
  85. },
  86. //挂载完成
  87. mounted() {
  88. this.retrieve_lis_request(this.dataTransOpts.tableS.patient_register.id)
  89. },
  90. computed: {
  91. ...mapState(["window", "dataTransOpts", "dict", "patientRegister"]),
  92. },
  93. methods: {
  94. dddw, moment, checkPagePriv,
  95. // 扩展定义表格行样式
  96. handleRowClassName({ row, rowIndex }) {
  97. // highLightBg 为 'selected'的高亮
  98. //console.log(rowIndex, row)
  99. //return row.highLightBg == 'selected' ? 'high-light-bg' : '';
  100. if (row.choosed) {
  101. return "current-row";
  102. } else {
  103. return "";
  104. }
  105. },
  106. //颜色转换
  107. colorTrans(intDataColor) {
  108. let tempColor = '000000' + Number(intDataColor).toString(16)
  109. let backgroundColor = '#' + tempColor.substring(tempColor.length - 6)
  110. return backgroundColor
  111. },
  112. // 选中行
  113. rowClick(row) {
  114. this.btnChoose(false)
  115. this.chooseRows = [row]
  116. this.$refs['lis_request'].setCurrentRow(row);
  117. },
  118. // 全选 / 取消全选
  119. btnChoose(isChooseAll) {
  120. if (isChooseAll) {
  121. this.chooseRows = deepCopy(this.dataTransOpts.tableM.lis_request)
  122. this.dataTransOpts.tableM.lis_request.forEach(e => {
  123. e.choosed = true;
  124. this.$refs['lis_request'].setCurrentRow(e);
  125. });
  126. } else {
  127. this.chooseRows = []
  128. this.dataTransOpts.tableM.lis_request.forEach(e => {
  129. e.choosed = false;
  130. });
  131. this.$refs['lis_request'].setCurrentRow();
  132. }
  133. this.$nextTick(() => {
  134. this.$refs['lis_request'].doLayout()
  135. })
  136. },
  137. //检验申请
  138. async btnLisRequest(isRequest) {
  139. if (this.chooseRows.length == 0) {
  140. this.$message.warning({ showClose: true, message: "请先选择要操作的条码记录!" })
  141. return
  142. }
  143. console.log('btnLisRequest',isRequest)
  144. },
  145. // 打印或预览
  146. async btnLisPrint(isPreview) {
  147. if (this.chooseRows.length == 0) {
  148. this.$message.warning({ showClose: true, message: "请先选择要操作的条码记录!" })
  149. return
  150. }
  151. if (!this.$peisAPI) {
  152. this.$message.warning({ showClose: true, message: "此功能需要在壳客户端中方可运行!" })
  153. return
  154. }
  155. if (isPreview) {
  156. this.lisPrint(this.chooseRows[0].lisRequestId,"0002",isPreview)
  157. return
  158. }
  159. // 打印
  160. for (let i = 0; i < this.chooseRows.length; i++) {
  161. let e = this.chooseRows[i];
  162. try {
  163. let err = await this.lisPrint(e.lisRequestId,"0002",isPreview)
  164. if(!err){
  165. let lfind = arrayExistObj(this.dataTransOpts.tableM.lis_request,"lisRequestId",e.lisRequestId)
  166. if(lfind > -1) this.dataTransOpts.tableM.lis_request[lfind].isPrint = "Y"
  167. }
  168. } catch (error) {
  169. console.log(`打印条码或更新条码打印状态失败,原因:${error}`)
  170. this.$message.warning({ showClose: true, message: `打印条码或更新条码打印状态失败,原因:${error}`})
  171. }
  172. }
  173. },
  174. //单个检验条码打印
  175. async lisPrint(lisRequestId, ReportCode, isPreview) {
  176. let err = ""
  177. let token = window.sessionStorage.getItem("token");
  178. let user = window.sessionStorage.getItem("user");
  179. let toOutShell = {
  180. ReportCode,
  181. token,
  182. IsMoreLabel: 'N',
  183. isBuildImage: 'N',
  184. IsUploadPdf: 'N',
  185. preViewCanPrint: "N",
  186. Parameters: [
  187. { Name: "printer", Value: user },
  188. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  189. ],
  190. BusinessCode: lisRequestId
  191. };
  192. console.log('this.$peisAPI.print', toOutShell)
  193. if (isPreview) {
  194. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  195. .then(res => {
  196. console.log('this.$peisAPI.printPre', res)
  197. if (JSON.parse(res).code < 0) {
  198. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  199. }
  200. })
  201. .catch((err) => {
  202. console.log('打印检验条码错误', err)
  203. this.$message.warning({ showClose: true, message: `${err}` });
  204. });
  205. } else {
  206. try {
  207. let lres = await this.$peisAPI.print(JSON.stringify(toOutShell))
  208. let Jres = JSON.parse(lres)
  209. if(Jres.code < 0){
  210. err = Jres.message
  211. console.log('打印检验条码错误', err)
  212. this.$message.error({ showClose: true, message: `打印检验条码错误 ${err}` });
  213. }else{
  214. // 更新条码打印状态
  215. // let res = await postapi('/api/app/lisrequest/updatelisrequestisprint',{});
  216. // if(res.code < 0){
  217. // err = res.message
  218. // this.$message.error({ showClose: true, message: `更新条码打印状态失败,原因 ${err}` });
  219. // }
  220. }
  221. } catch (error) {
  222. err = `${error}`
  223. }
  224. }
  225. return err
  226. },
  227. // 刷新条码项目
  228. retrieve_lis_request(patientRegisterId) {
  229. this.chooseRows = []
  230. this.dataTransOpts.tableM.lis_request = []
  231. if (!patientRegisterId) return
  232. // console.log(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, res)
  233. postapi('/api/app/printreport/GetLisRequestReportByPatientRegisterId', { patientRegisterId })
  234. .then(res => {
  235. if (res.code > -1) {
  236. this.dataTransOpts.tableM.lis_request = res.data
  237. this.btnChoose(true)
  238. }
  239. })
  240. },
  241. },
  242. //监听事件
  243. watch: {
  244. //人员ID未切换换时 也可以强制刷新数据
  245. "dataTransOpts.refresh.lis_request.M": {
  246. // immediate:true,
  247. handler(newVal, oldVal) {
  248. console.log(`watch 人员登记 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.dataTransOpts.tableS.patient_register.id}`);
  249. if(newVal != oldVal) this.retrieve_lis_request(this.dataTransOpts.tableS.patient_register.id)
  250. }
  251. },
  252. }
  253. };
  254. </script>
  255. <style scoped>
  256. @import "../../assets/css/global.css";
  257. @import "../../assets/css/global_table.css";
  258. .listBtn {
  259. padding: 2px 0;
  260. }
  261. </style>