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.

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