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.

1031 lines
35 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
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>
  3. <div @contextmenu.prevent="onContextmenu">
  4. <el-table :data="patientRegister.prList" border :height="(window.pageHeight < 600) ? 290 : (window.pageHeight - 350)"
  5. highlight-current-row @row-click="rowClick" size="small" @selection-change="handleSelectionChange"
  6. @cell-contextmenu="onCellRightClick">
  7. <el-table-column type="selection" width="40" align="center" />
  8. <el-table-column prop="completeFlag" label="体检进度">
  9. <template slot-scope="scope">
  10. <div>{{ ldddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}</div>
  11. </template>
  12. </el-table-column>
  13. <el-table-column prop="guidePrintTimes" label="打印" width="50" align="center">
  14. <template slot-scope="scope">
  15. <i class="el-icon-printer" v-if="scope.row.guidePrintTimes > 0" style="font-size: 24px;color: green;"></i>
  16. </template>
  17. </el-table-column>
  18. <el-table-column prop="isLock" label="锁住" align="center">
  19. <template slot-scope="scope">
  20. <div>{{ scope.row.isLock == "Y" ? "是" : "否" }}</div>
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="customerOrgName" label="单位" width="180" />
  24. <!--
  25. <el-table-column prop="customerOrgParentName" label="单位" width="180">
  26. <template slot-scope="scope">
  27. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgParentName : scope.row.customerOrgName }}</div>
  28. </template>
  29. </el-table-column>
  30. -->
  31. <el-table-column prop="departmentName" label="部门" width="180" />
  32. <!--
  33. <el-table-column prop="customerOrgName" label="部门" width="180">
  34. <template slot-scope="scope">
  35. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgName : "" }}</div>
  36. </template>
  37. </el-table-column>
  38. -->
  39. <el-table-column prop="patientName" label="姓名" />
  40. <el-table-column prop="sexName" label="性别" align="center" />
  41. <!--
  42. <el-table-column prop="sexId" label="性别" >
  43. <template slot-scope="scope">
  44. <div>{{ dddw(dict.sex, "id", scope.row.sexId, "displayName") }}</div>
  45. </template>
  46. </el-table-column>
  47. -->
  48. <el-table-column prop="age" label="年龄" align="center" />
  49. <el-table-column prop="patientRegisterNo" label="条码号" width="150" />
  50. <el-table-column prop="patientNo" label="档案号" />
  51. <el-table-column prop="medicalTimes" label="体检次数" align="center" />
  52. <el-table-column label="分组/套餐" width="150">
  53. <template slot-scope="scope">
  54. <!--
  55. <div v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
  56. {{ ldddw(dict.medicalPackage, "id", scope.row.medicalPackageId, "displayName") }}
  57. </div>
  58. <div v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId !== dict.personOrgId">
  59. {{ ldddw(dict.customerOrgGroupAll, "id", scope.row.customerOrgGroupId, "displayName") }}
  60. </div>
  61. -->
  62. <div v-if="scope.row.medicalPackageName">
  63. {{ scope.row.medicalPackageName }}
  64. </div>
  65. <div v-if="scope.row.customerOrgGroupName">
  66. {{ scope.row.customerOrgGroupName }}
  67. </div>
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="nationId" label="民族">
  71. <template slot-scope="scope">
  72. <div>
  73. {{ ldddw(dict.nation, "nationId", scope.row.nationId, "displayName") }}
  74. </div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="idNo" label="身份证" width="150" />
  78. <el-table-column prop="birthDate" label="出生日期" width="100">
  79. <template slot-scope="scope">
  80. <div v-if="scope.row.birthDate">
  81. {{ lmoment(scope.row.birthDate, "yyyy-MM-DD") }}
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="email" label="邮箱" width="180" />
  86. <el-table-column prop="mobileTelephone" label="手机" width="100" />
  87. <el-table-column prop="telephone" label="电话" width="100" />
  88. <el-table-column prop="address" label="地址" width="300" />
  89. <el-table-column prop="medicalCardNo" label="体检卡号" />
  90. <el-table-column prop="jobCardNo" label="工卡号" />
  91. <el-table-column prop="maritalStatusId" label="婚姻状况">
  92. <template slot-scope="scope">
  93. <div>
  94. {{ ldddw(dict.maritalStatus, "id", scope.row.maritalStatusId, "displayName") }}
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column prop="medicalTypeId" label="体检类别">
  99. <template slot-scope="scope">
  100. <div v-if="scope.row.medicalTypeId !== dict.personOrgId">
  101. {{ ldddw(dict.medicalType, "id", scope.row.medicalTypeId, "displayName") }}
  102. </div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column prop="personnelTypeId" label="人员类别">
  106. <template slot-scope="scope">
  107. <div v-if="scope.row.personnelTypeId !== dict.personOrgId">
  108. {{ ldddw(dict.personnelType, "id", scope.row.personnelTypeId, "displayName") }}
  109. </div>
  110. </template>
  111. </el-table-column>
  112. <el-table-column prop="jobPost" label="职务" />
  113. <el-table-column prop="jobTitle" label="职称" />
  114. <el-table-column prop="salesman" label="介绍人" />
  115. <el-table-column prop="isVip" label="是否VIP" align="center">
  116. <template slot-scope="scope">
  117. <div>{{ scope.row.isVip == "Y" ? "是" : "否" }}</div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column prop="creatorName" label="登记人" />
  121. <el-table-column prop="creationTime" label="登记日期" width="100">
  122. <template slot-scope="scope">
  123. <div v-if="scope.row.creationTime">
  124. {{ lmoment(scope.row.creationTime, "yyyy-MM-DD") }}
  125. </div>
  126. </template>
  127. </el-table-column>
  128. <el-table-column prop="isUpload" label="是否上传" align="center">
  129. <template slot-scope="scope">
  130. <div>{{ scope.row.isUpload == "Y" ? "是" : "否" }}</div>
  131. </template>
  132. </el-table-column>
  133. <!--
  134. "sexHormoneTermId": "00000000-0000-0000-0000-000000000000",
  135. "interposeMeasure": null,
  136. "medicalConclusionId": "00000000-0000-0000-0000-000000000000",
  137. "reportPrintTimes": 0,
  138. "isMedicalStart": "N",
  139. "medicalStartDate": "6/28/2023",
  140. "isRecoverGuide": "N",
  141. "summaryDate": "",
  142. "summaryDoctor": null,
  143. "isAudit": "N",
  144. "auditDoctor": null,
  145. "auditDate": "",
  146. "isNameHide": "N",
  147. "isPhoneFollow": "N",
  148. "thirdInfo": null,
  149. "guidePrintTimes": null,
  150. "remark": null,
  151. "medicalCenterId": "00000000-0000-0000-0000-000000000000",
  152. "customerOrgRegisterId": "00000000-0000-0000-0000-000000000000",
  153. "lastModifierName": "",
  154. "lastModificationTime": null,
  155. "lastModifierId": null,
  156. "creatorId": null,
  157. "id": "3a0c196d-a6d0-37fe-5c32-4806bdc4530f"
  158. -->
  159. </el-table>
  160. </div>
  161. </div>
  162. </template>
  163. <script>
  164. import moment from "moment";
  165. import { mapState, mapActions } from "vuex";
  166. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  167. import { dddw, deepCopy, objCopy, arrayReduce, arrayExistObj } from "@/utlis/proFunc";
  168. import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue";
  169. import Camera from "../../components/patientRegister/Camera.vue";
  170. import PatientRegisterAsbItem from "../../components/patientRegister/patientRegisterAsbItem.vue";
  171. export default {
  172. components: {
  173. PatientRegisterEdit,
  174. Camera,
  175. PatientRegisterAsbItem,
  176. },
  177. data() {
  178. return {
  179. multipleSelection: [], //选中的数据列表
  180. dialogVisible: false,
  181. dialogCamera: false,
  182. dialogGuide: false,
  183. guideMsg: 'guideMsg',
  184. tabChoosed: "1",
  185. formInitData: {}, //体检登记初始表单数据
  186. editTimes: 0,
  187. rClickRow: null, //右击的行
  188. rClickColumn: null, //右击的列(预留)
  189. dialogGroup: false,
  190. groupBatch: {
  191. patientRegisterId: null,
  192. customerOrgGroupId: null,
  193. payTypeFlag: "1", //0:个人付费,1:单位付费 2:免费
  194. isReserveAddAsbitem: true, //是否保留加做项目
  195. },
  196. dialogAsbitem: false,
  197. asbitemBatch: {
  198. operate: 'add',
  199. isDeleteGroup: false,
  200. asbItemId: '',
  201. asbitemsTemp: [], //删除或增加项目临时用
  202. asbitemCurr: {}, //当前选中要删除的项目(批量调整)
  203. },
  204. quickAsb: [], //可供快速选择的组合项目
  205. };
  206. },
  207. created() { },
  208. //挂载完成
  209. mounted() {
  210. this.quickAsb = this.dict.asbItemAll;
  211. },
  212. computed: {
  213. ...mapState(["window", "dict", 'dataTransOpts', "patientRegister", "customerOrg"]),
  214. },
  215. methods: {
  216. ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
  217. // 打印指引单(isPreview)
  218. async guidePrint(ReportCode, isPreview) {
  219. let token = window.sessionStorage.getItem('token');
  220. let user = window.sessionStorage.getItem('user');
  221. let toOutShell = {
  222. ReportCode, token,
  223. isBuildImage:'N',
  224. preViewCanPrint: 'N',
  225. Parameters: [
  226. { Name: 'printer', Value: user },
  227. { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
  228. ],
  229. };
  230. let lfind = -1;
  231. if (this.multipleSelection.length < 1) {
  232. this.$message.info("请勾选要打印指引单的人员记录!");
  233. return;
  234. }
  235. if (!this.$peisAPI) {
  236. this.$message.info("此功能,需要在壳客户端才可运行!")
  237. return
  238. }
  239. if (isPreview) {
  240. //
  241. //this.multipleSelection.forEach((item,index) =>{
  242. postapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.multipleSelection[0].id}`)
  243. .then((res) => {
  244. if (res.code != -1) {
  245. toOutShell.ReportTable = res.data;
  246. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  247. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  248. }
  249. })
  250. .catch(err => {
  251. this.$message.warning(err);
  252. });
  253. // });
  254. } else {
  255. this.multipleSelection.forEach((item, index) => {
  256. postapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${item.id}`)
  257. .then((res) => {
  258. if (res.code != -1) {
  259. toOutShell.ReportTable = res.data;
  260. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  261. return this.$peisAPI.print(JSON.stringify(toOutShell));
  262. }
  263. })
  264. .then(res => {
  265. if (res.code != -1) {
  266. //更新打印次数
  267. return postapi('api/app/patientregister/updatepatientregisterguideprinttimesmany', [item.id])
  268. }
  269. })
  270. .then(res => {
  271. if (res.code != -1) {
  272. lfind = arrayExistObj(this.patientRegister.prList, 'id', item.id)
  273. if (lfind > -1) {
  274. if (this.patientRegister.prList[lfind].guidePrintTimes) {
  275. this.patientRegister.prList[lfind].guidePrintTimes = Number(this.patientRegister.prList[lfind].guidePrintTimes) + 1;
  276. } else {
  277. this.patientRegister.prList[lfind].guidePrintTimes = 1;
  278. }
  279. }
  280. }
  281. })
  282. .catch(err => {
  283. this.$message.warning(err);
  284. });
  285. });
  286. }
  287. },
  288. handleSelectionChange(val) {
  289. this.multipleSelection = val;
  290. //console.log('this.multipleSelection',this.multipleSelection)
  291. },
  292. //获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
  293. getCustomerOrgGroup(customerOrgld) {
  294. getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`)
  295. .then((res) => {
  296. console.log("getCustomerOrgGroup", res.data);
  297. if (res.code == 1) {
  298. this.patientRegister.customerOrgGroup = res.data;
  299. }
  300. });
  301. },
  302. //点击体检次数行
  303. rowClick(row) {
  304. this.dataTransOpts.tableS.patient_register = deepCopy(row)
  305. this.dataTransOpts.tableS.patient_register.id = row.patientRegisterId
  306. // 刷新个人资料
  307. this.dataTransOpts.refresh.patient_register.S++
  308. // 刷新总检状态
  309. this.dataTransOpts.refresh.sumDoctor.M++
  310. // 刷新检查项目
  311. this.dataTransOpts.refresh.register_check.M++
  312. },
  313. //体检次数 相关操作
  314. add() {
  315. let customerOrgId = this.patientRegister.query.customerOrgId;
  316. if (!customerOrgId) {
  317. alert("请选择单位或个人");
  318. return;
  319. }
  320. //console.log('customerOrgId',customerOrgId)
  321. this.patientRegister.patientRegisterId = "";
  322. // this.patientRegister.patientRegisterRd.photo = '';
  323. // this.patientRegister.patientRegisterRdInit.id = "";
  324. // this.patientRegister.patientRegisterRdInit.customerOrgId = this.patientRegister.query.customerOrgId;
  325. // this.patientRegister.addTimes++;
  326. // this.patientRegister.patientRegisterTimes++;
  327. this.patientRegister.patientRegisterRdInit.customerOrgId = this.patientRegister.query.customerOrgId;
  328. this.formInitData = { ...this.patientRegister.patientRegisterRdInit };
  329. this.patientRegister.patientRegisterAbs = [];
  330. this.dialogVisible = true;
  331. this.editTimes++; //触发表单窗口,数据更新
  332. this.getPatientRegisterAbs();
  333. },
  334. edit() {
  335. if (!this.patientRegister.patientRegisterRd.id) {
  336. alert("请选择要操作的记录");
  337. return;
  338. }
  339. //this.patientRegister.patientRegisterTimes++;
  340. this.getPatientRegisterAbs(this.patientRegister.patientRegisterRd.id);
  341. this.formInitData = { ...this.patientRegister.patientRegisterRd };
  342. this.dialogVisible = true;
  343. this.editTimes++; //触发表单窗口,数据更新
  344. },
  345. //拍照
  346. openCamera() {
  347. if (!this.patientRegister.patientRegisterId) {
  348. alert("请选择要操作的记录");
  349. return;
  350. }
  351. this.patientRegister.cameraVisble = true;
  352. },
  353. //删除(可批量删除)
  354. // /api/app/patient-register/many?PatientRegisterIds=3a0c2cac-f44c-f407-9504-c1fc5e80a159&PatientRegisterIds=3a0c2cb3-d10c-ed70-db6a-b835e75ce641
  355. del() {
  356. if (this.multipleSelection.length < 1) {
  357. alert("请先勾选要操作的记录");
  358. return;
  359. }
  360. let patientRegisterIds = [];
  361. for (let i = 0; i < this.multipleSelection.length; i++) {
  362. patientRegisterIds.push(this.multipleSelection[i]["id"]);
  363. }
  364. this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
  365. confirmButtonText: "确定",
  366. cancelButtonText: "取消",
  367. type: "warning",
  368. })
  369. .then(() => {
  370. //console.log('{patientRegisterIds}',{patientRegisterIds})
  371. return postapi(`/api/app/patient-register/delete-many`, {
  372. patientRegisterIds,
  373. });
  374. })
  375. .then((res) => {
  376. console.log("删除成功");
  377. this.patientRegister.query.times++;
  378. this.patientRegister.patientRegisterId = "";
  379. })
  380. .catch(() => {
  381. this.$message({
  382. type: "info",
  383. message: "已取消删除",
  384. });
  385. });
  386. },
  387. //单个删除方式
  388. delBak() {
  389. if (!this.patientRegister.patientRegisterId) {
  390. alert("请选择要操作的记录");
  391. return;
  392. }
  393. this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
  394. confirmButtonText: "确定",
  395. cancelButtonText: "取消",
  396. type: "warning",
  397. })
  398. .then(() => {
  399. //console.log('${this.patientRegister.patientRegisterId}',this.patientRegister.patientRegisterId)
  400. return deletapi(`/api/app/patient-register/${this.patientRegister.patientRegisterId}`);
  401. })
  402. .then((res) => {
  403. console.log("删除成功");
  404. this.patientRegister.query.times++;
  405. this.patientRegister.patientRegisterId = "";
  406. })
  407. .catch(() => {
  408. this.$message({ type: "info", message: "已取消删除", });
  409. });
  410. },
  411. ldddw(arrayData, key, value, display) {
  412. return dddw(arrayData, key, value, display);
  413. },
  414. lmoment(date, forMat) {
  415. return moment(new Date(date)).format(forMat);
  416. },
  417. //查询
  418. async query() {
  419. this.patientRegister.prList = [];
  420. const loading = this.$loading({
  421. lock: true,
  422. text: 'Loading',
  423. spinner: 'el-icon-loading',
  424. background: 'rgba(0, 0, 0, 0.7)'
  425. });
  426. let body = {}
  427. console.log(`this.patientRegister.query`, this.patientRegister.query)
  428. if (this.patientRegister.query.customerOrgFlag) {
  429. if (this.patientRegister.query.CustomerOrgParentId) {
  430. body.customerOrgId = this.patientRegister.query.CustomerOrgParentId
  431. } else {
  432. if (this.patientRegister.query.customerOrgId) body.customerOrgId = this.patientRegister.query.customerOrgId
  433. }
  434. }
  435. if (this.patientRegister.query.sex) body.sexId = this.patientRegister.query.sex
  436. if (this.patientRegister.query.patientName) body.patientName = this.patientRegister.query.patientName
  437. if (this.patientRegister.query.completeFlag) body.completeFlag = this.patientRegister.query.completeFlag
  438. //StartDate EndDate
  439. if (this.patientRegister.query.dateRange) {
  440. body.startDate = moment(new Date(this.patientRegister.query.dateRange[0])).format("yyyy-MM-DD")
  441. body.endDate = moment(new Date(this.patientRegister.query.dateRange[1])).format("yyyy-MM-DD")
  442. }
  443. if (this.patientRegister.query.idCardNo) body = { idNo: this.patientRegister.query.idCardNo }
  444. if (this.patientRegister.query.patientNo) body = { patientNo: this.patientRegister.query.patientNo }
  445. if (this.patientRegister.query.patientRegisterNo) body = { patientRegisterNo: this.patientRegister.query.patientRegisterNo }
  446. console.log('/api/app/patientregister/getlistinfilter', body)
  447. postapi('/api/app/patientregister/getlistinfilter', body)
  448. .then((res) => {
  449. if (res.code != -1) {
  450. this.patientRegister.prList = res.data.items;
  451. }
  452. loading.close();
  453. })
  454. .catch((err) => {
  455. loading.close();
  456. });
  457. // try {
  458. // let res =await postapi('/api/app/patientregister/getlistinfilter', body);
  459. // this.patientRegister.prList = res.data;
  460. // } catch (error) {
  461. // console.log("query error",error);
  462. // }
  463. },
  464. //右击菜单
  465. onCellRightClick(row, column) {
  466. this.rClickRow = { ...row }; //右击的行
  467. this.rClickColumn = { ...column }; //右击的列(预留)
  468. console.log(row, column.property);
  469. },
  470. onContextmenu(event) {
  471. //console.log('onContextmenu',event);
  472. if (!this.rClickRow) return false;
  473. let row = { ...this.rClickRow };
  474. this.$contextmenu({
  475. items: [
  476. {
  477. label: "发送检验申请",
  478. onClick: () => {
  479. this.lisRequest(row.id);
  480. }
  481. },
  482. {
  483. label: "预览检验条码",
  484. onClick: () => {
  485. this.lisPrint(row.id, '0002', true);
  486. }
  487. },
  488. {
  489. label: "打印检验条码",
  490. onClick: () => {
  491. this.lisPrint(row.id, '0002', false);
  492. }
  493. },
  494. {
  495. label: "预览Pacs条码",
  496. onClick: () => {
  497. this.pacsPrint(row.id, '0004', true);
  498. }
  499. },
  500. {
  501. label: "打印Pacs条码",
  502. onClick: () => {
  503. this.pacsPrint(row.id, '0004', false);
  504. }
  505. },
  506. ],
  507. event,
  508. //x: event.clientX,
  509. //y: event.clientY,
  510. customClass: "custom-class",
  511. zIndex: 3,
  512. minWidth: 80,
  513. });
  514. this.rClickRow = null;
  515. return false;
  516. },
  517. //批量更新分组按钮
  518. btnGroupBatch() {
  519. let customerOrgId = this.patientRegister.query.customerOrgId;
  520. if (!customerOrgId) {
  521. alert("请选择单位或个人");
  522. return;
  523. }
  524. if (this.multipleSelection.length < 1) {
  525. this.$message.info("请勾选要操作的人员!");
  526. return;
  527. }
  528. this.dialogGroup = true;
  529. },
  530. //批量更新分组处理
  531. async groupBatchHandle() {
  532. let groupBatch = { patientRegisterId: null, ...this.groupBatch };
  533. if (groupBatch.isReserveAddAsbitem) {
  534. groupBatch.isReserveAddAsbitem = 'Y';
  535. } else {
  536. groupBatch.isReserveAddAsbitem = 'N';
  537. }
  538. console.log('groupBatch', groupBatch);
  539. if (!groupBatch.customerOrgGroupId) {
  540. this.$message.warning("请选择分组");
  541. return;
  542. }
  543. for (let i = 0; i < this.multipleSelection.length; i++) {
  544. groupBatch.patientRegisterId = this.multipleSelection[i].id;
  545. try {
  546. await postapi('/api/app/patientregister/updatepatientregistercustomerorggroup', groupBatch);
  547. } catch (error) {
  548. console.log(error);
  549. }
  550. }
  551. console.log("操作成功!");
  552. this.dialogGroup = false;
  553. this.query();
  554. },
  555. //快速查询项目
  556. remoteMethod(keyWords) {
  557. //console.log('remoteMethod',this.dict.asbItemQuick)
  558. if (keyWords) {
  559. this.quickAsb = [];
  560. this.dict.asbItemQuick.forEach(item => {
  561. if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  562. || item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  563. || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1) {
  564. this.quickAsb.push(item);
  565. }
  566. });
  567. } else {
  568. this.quickAsb = [...this.dict.asbItemQuick];
  569. }
  570. },
  571. //快速选择项目
  572. quickChoosedAsb(v) {
  573. //过滤已选的的组合项目
  574. let lfind = -1
  575. if (v) {
  576. lfind = arrayExistObj(this.quickAsb, 'id', v)
  577. if (lfind > -1) {
  578. this.asbitemBatch.asbitemsTemp.push({
  579. asbitemId: v,
  580. asbitemName: this.quickAsb[lfind].displayName, //仅作显示用
  581. patientRegisterId: null,
  582. standardPrice: this.quickAsb[lfind].price,
  583. chargePrice: this.quickAsb[lfind].price,
  584. payTypeFlag: '1',//默认单位支付
  585. isCharge: 'N',
  586. amount: 1,
  587. });
  588. this.quickAsb.splice(lfind, 1);
  589. arrayReduce(this.dict.asbItemQuick, { id: v }, 'id');
  590. }
  591. }
  592. console.log(v, this.asbitemBatch.asbitemsTemp)
  593. },
  594. //删除临时显示的组合项目
  595. removeAbs(row) {
  596. let lfind = arrayExistObj(this.asbitemBatch.asbitemsTemp, 'asbitemId', row.asbitemId);
  597. if (lfind > - 1) this.asbitemBatch.asbitemsTemp.splice(lfind, 1);
  598. },
  599. rowClickaAbitemCurr(row) {
  600. this.asbitemBatch.asbitemCurr = row;
  601. },
  602. btnRemoveAbs() {
  603. if (!this.asbitemBatch.asbitemCurr.asbitemId) {
  604. this.$message.warning("请选择要删除的组合项目!");
  605. return;
  606. }
  607. this.removeAbs(this.asbitemBatch.asbitemCurr);
  608. this.asbitemBatch.asbitemCurr.asbitemId = null;
  609. },
  610. removeAllAbs() {
  611. this.asbitemBatch.asbitemsTemp = [];
  612. },
  613. //批量更新项目
  614. asbBatch() {
  615. let customerOrgId = this.patientRegister.query.customerOrgId;
  616. if (!customerOrgId) {
  617. alert("请选择单位或个人");
  618. return;
  619. }
  620. this.dialogAsbitem = true;
  621. //供快速选择的组合项目
  622. this.dict.asbItemQuick = [...this.dict.asbItemAll];
  623. this.asbitemBatch.asbitemCurr.asbitemId = null;
  624. this.asbitemBatch.asbitemsTemp = [];
  625. },
  626. asbitemDel(type) {
  627. //typ==0 为批量删除
  628. if (Number(type) == 0) {
  629. this.asbitemBatch.asbitemsTemp = [];
  630. } else {
  631. if (!this.asbitemBatch.asbitemCurr.asbitemId) {
  632. this.$message.warning("请选中要删除的项目!");
  633. return;
  634. }
  635. //console.log(this.asbitemBatch.asbitemsTemp,this.asbitemBatch.asbitemCurr)
  636. let lfind = arrayExistObj(this.asbitemBatch.asbitemsTemp, 'asbitemId', this.asbitemBatch.asbitemCurr.asbitemId);
  637. if (lfind > -1) {
  638. this.asbitemBatch.asbitemsTemp.splice(lfind, 1);
  639. this.asbitemBatch.asbitemCurr.asbitemId = null;
  640. }
  641. //console.log(lfind);
  642. }
  643. },
  644. //批量调整支付方式
  645. changePayTypeFlag(flag) {
  646. this.asbitemBatch.asbitemsTemp.forEach(e => {
  647. e.payTypeFlag = flag;
  648. return e;
  649. });
  650. },
  651. async asbitemBatchHandle() {
  652. let msg = '', body = {};
  653. if (this.asbitemBatch.asbitemsTemp.length == 0) {
  654. this.$message.warning("没有选择组合项目,不可执行此操作!");
  655. return;
  656. }
  657. if (this.asbitemBatch.operate == 'add') {
  658. this.asbitemBatch.asbitemsTemp.forEach((e, index) => {
  659. if (!e.amount || !e.chargePrice) {
  660. msg = '第 ' + (index + 1) + " 行,未输入数量或价格!";
  661. }
  662. });
  663. if (msg) {
  664. this.$message.warning(msg);
  665. return;
  666. }
  667. // {
  668. // "medicalCenterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  669. // "createRegisterAsbitemDtos": [
  670. // {
  671. // "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  672. // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  673. // "standardPrice": 0,
  674. // "chargePrice": 0,
  675. // "payTypeFlag": "string",
  676. // "isCharge": "string",
  677. // "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  678. // "amount": 0,
  679. // "groupPackageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  680. // }
  681. // ]
  682. // }
  683. let createRegisterAsbitemDtos = [...this.asbitemBatch.asbitemsTemp];
  684. createRegisterAsbitemDtos.forEach(e => {
  685. delete e.asbitemName;
  686. return e;
  687. });
  688. for (let i = 0; i < this.multipleSelection.length; i++) {
  689. createRegisterAsbitemDtos.forEach(e => {
  690. e.patientRegisterId = this.multipleSelection[i].id;
  691. return e;
  692. });
  693. body = {
  694. medicalCenterId: this.multipleSelection[i].medicalCenterId,
  695. createRegisterAsbitemDtos,
  696. }
  697. try {
  698. await postapi('/api/app/registerasbitem/createregisterasbitemincustomerorgmany', body);
  699. } catch (error) {
  700. console.log('批量增加项目错误,原因:', error);
  701. }
  702. }
  703. } else {
  704. // {
  705. // isDeleteGroup: 'N',
  706. // patientRegisterId: null,
  707. // asbitemIds: [],
  708. // }
  709. let asbitemIds = [];
  710. if (this.asbitemBatch.isDeleteGroup) {
  711. body.isDeleteGroup = 'Y';
  712. } else {
  713. body.isDeleteGroup = 'N';
  714. }
  715. for (let i = 0; i < this.multipleSelection.length; i++) {
  716. this.asbitemBatch.asbitemsTemp.forEach(e => {
  717. asbitemIds.push(e.asbitemId);
  718. });
  719. body.patientRegisterId = this.multipleSelection[i].id;
  720. body.asbitemIds = asbitemIds
  721. try {
  722. await postapi('/api/app/registerasbitem/deleteregisterasbitemincustomerorgmany', body);
  723. } catch (error) {
  724. console.log('批量删除项目错误,原因:', error);
  725. }
  726. }
  727. }
  728. console.log("操作成功!");
  729. this.dialogAsbitem = false;
  730. this.query();
  731. },
  732. //检验申请
  733. async lisRequest(prId) {
  734. let isPrintLisRequest = false
  735. let res = null
  736. if (prId.length < 1) {
  737. this.$message.info("人员信息尚未保存,不可执行此操作!");
  738. return;
  739. }
  740. try {
  741. res = await postapi(`/api/app/lisrequest/setlisrequest?PatientRegisterId=${prId}`);
  742. console.log(`/api/app/lisrequest/setlisrequest?PatientRegisterId=${prId}`, res)
  743. } catch (error) {
  744. return;
  745. }
  746. if (res.code != -1) {
  747. this.$message.info("发送检验申请成功!");
  748. isPrintLisRequest = true;
  749. }
  750. //重复申请,重打
  751. if (res.code == -1 && res.message.indexOf('已申请') > -1) {
  752. isPrintLisRequest = true;
  753. }
  754. if (!isPrintLisRequest) return;
  755. try {
  756. await this.$confirm("是否打印检验申请单?", "提示", {
  757. confirmButtonText: "是",
  758. cancelButtonText: "否",
  759. type: "info",
  760. showClose: false,
  761. closeOnClickModal: false,
  762. closeOnPressEscape: false,
  763. });
  764. } catch (error) {
  765. return;
  766. }
  767. //打印检验申请单
  768. this.lisPrint(prId, '0003', false);
  769. },
  770. //检验条码打印
  771. lisPrint(prId, ReportCode, isPreview) {
  772. let token = window.sessionStorage.getItem('token');
  773. let user = window.sessionStorage.getItem('user');
  774. let toOutShell = {
  775. ReportCode, token,
  776. isBuildImage:'N',
  777. preViewCanPrint: 'N',
  778. Parameters: [
  779. { Name: 'printer', Value: user },
  780. { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
  781. ],
  782. };
  783. if (!this.$peisAPI) {
  784. this.$message.info("此功能,需要在壳客户端才可运行!")
  785. return
  786. }
  787. if (isPreview) {
  788. //http://140.143.162.39:9529/api/app/printreport/getlisrequestreport?PatientRegisterId=3a0d2e90-da68-3746-6775-bf17e5f9b295
  789. //this.multipleSelection.forEach((item,index) =>{
  790. postapi(`/api/app/printreport/getlisrequestreport?PatientRegisterId=${prId}`)
  791. .then((res) => {
  792. if (res.code != -1) {
  793. toOutShell.ReportTable = { lisRequest: res.data };
  794. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  795. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  796. }
  797. })
  798. .catch(err => {
  799. this.$message.warning(err);
  800. });
  801. // });
  802. } else {
  803. postapi(`/api/app/printreport/getlisrequestreport?PatientRegisterId=${prId}`)
  804. .then((res) => {
  805. if (res.code != -1) {
  806. toOutShell.ReportTable = { lisRequest: res.data };
  807. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  808. return this.$peisAPI.print(JSON.stringify(toOutShell));
  809. }
  810. })
  811. .then(res => {
  812. if (res.code != -1) {
  813. //更新打印状态 /api/app/lisrequest/updatelisrequestisprint
  814. // {
  815. // "operateType": 0, 操作类型(1.按PatientRegisterId 2.按LisRequestId)
  816. // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  817. // "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  818. // }
  819. return postapi('/api/app/lisrequest/updatelisrequestisprint', { operateType: 1, patientRegisterId: prId })
  820. }
  821. })
  822. .catch(err => {
  823. this.$message.warning(err);
  824. });
  825. }
  826. },
  827. //pacs条码打印
  828. pacsPrint(prId, ReportCode, isPreview) {
  829. let token = window.sessionStorage.getItem('token');
  830. let user = window.sessionStorage.getItem('user');
  831. let toOutShell = {
  832. ReportCode, token,
  833. isBuildImage:'N',
  834. preViewCanPrint: 'Y',
  835. Parameters: [
  836. { Name: 'printer', Value: user },
  837. { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
  838. ],
  839. };
  840. if (!this.$peisAPI) {
  841. this.$message.info("此功能,需要在壳客户端才可运行!")
  842. return
  843. }
  844. if (isPreview) {
  845. //http://140.143.162.39:9529/api/app/printreport/getpacsnoreport?PatientRegisterId=3a0c990e-5756-2dc0-19d5-69a617fe4048
  846. //this.multipleSelection.forEach((item,index) =>{
  847. postapi(`/api/app/printreport/getpacsnoreport?PatientRegisterId=${prId}`)
  848. .then((res) => {
  849. if (res.code != -1) {
  850. toOutShell.ReportTable = { lisRequest: res.data };
  851. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  852. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  853. }
  854. })
  855. .catch(err => {
  856. this.$message.warning(err);
  857. });
  858. // });
  859. } else {
  860. postapi(`/api/app/printreport/getpacsnoreport?PatientRegisterId=${prId}`)
  861. .then((res) => {
  862. if (res.code != -1) {
  863. toOutShell.ReportTable = { lisRequest: res.data };
  864. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  865. return this.$peisAPI.print(JSON.stringify(toOutShell));
  866. }
  867. })
  868. .then(res => {
  869. if (res.code != -1) {
  870. //更新打印状态 /api/app/lisrequest/updatelisrequestisprint
  871. // {
  872. // "operateType": 0, 操作类型(1.按PatientRegisterId 2.按LisRequestId)
  873. // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  874. // "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  875. // }
  876. return postapi('/api/app/lisrequest/updatelisrequestisprint', { operateType: 1, patientRegisterId: prId })
  877. }
  878. })
  879. .catch(err => {
  880. this.$message.warning(err);
  881. });
  882. }
  883. },
  884. },
  885. //监听事件
  886. watch: {
  887. //触发查询事件
  888. "patientRegister.query.times"(newVal, oldVal) {
  889. if (newVal != oldVal) {
  890. //alert('触发查询事件')
  891. this.query();
  892. }
  893. },
  894. //新增后,触发赋值
  895. "patientRegister.patientRegisterRd.id"(newVal, oldVal) {
  896. if (newVal != oldVal) {
  897. //console.log('patientRegister.patientRegisterRd.customerOrgId',this.patientRegister.patientRegisterRd.customerOrgId)
  898. objCopy(this.patientRegister.patientRegisterRd, this.form);
  899. }
  900. },
  901. },
  902. };
  903. </script>
  904. <style scoped>
  905. .box {
  906. display: flex;
  907. }
  908. .listBtn {
  909. margin-top: 5px;
  910. text-align: center;
  911. }
  912. .btnClass {
  913. width: 110px;
  914. }
  915. ::v-deep .el-input__inner {
  916. text-align: center;
  917. padding-left: 1px;
  918. padding-right: 1px;
  919. }
  920. ::v-deep .el-table th.el-table__cell {
  921. text-align: center;
  922. padding-left: 1px;
  923. padding-right: 1px;
  924. }
  925. ::v-deep .el-table td.el-table__cell {
  926. padding-left: 1px;
  927. padding-right: 1px;
  928. }
  929. ::v-deep .el-table .cell {
  930. padding-left: 1px;
  931. padding-right: 1px;
  932. }
  933. ::v-deep input[type="number"]::-webkit-inner-spin-button,
  934. input[type="number"]::-webkit-outer-spin-button {
  935. -webkit-appearance: none !important;
  936. margin: 0 !important;
  937. }
  938. </style>