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.

559 lines
19 KiB

2 years ago
2 years ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
2 years ago
1 month ago
2 years ago
3 weeks ago
2 years ago
1 month ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
2 years ago
2 years ago
1 month ago
2 years ago
2 years ago
1 month ago
2 years ago
1 month ago
2 years ago
2 years ago
1 month ago
2 years ago
1 month ago
2 years ago
1 month ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
1 month ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
1 month ago
2 years ago
1 month ago
3 weeks ago
1 month ago
2 years ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
2 years ago
1 month ago
3 weeks ago
1 month ago
2 years ago
1 month ago
2 years ago
1 month ago
2 years ago
1 month ago
2 years ago
1 month ago
2 years ago
1 month ago
2 years ago
1 month ago
2 years ago
1 month ago
2 years ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
1 month ago
3 weeks ago
2 years ago
3 weeks ago
1 month ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
1 month ago
3 weeks ago
2 years ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
1 month ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
1 month ago
2 years ago
2 years ago
2 years ago
1 month ago
2 years ago
  1. <template>
  2. <div style="display: flex;">
  3. <div :style="'width:' + (window.pageWidth - 200 - 145) + 'px;'">
  4. <el-table :data="tableData" width="100%" border :height="window.pageHeight < 600 ? 330 : window.pageHeight - 240" row-key="id"
  5. size="small" highlight-current-row ref="dataList" @selection-change="handleSelectionChange" @row-click="rowClick" @table-body-scroll="scrollFull">
  6. <el-table-column type="selection" width="40" align="center" />
  7. <el-table-column prop="isRecoverGuide" label="回收1" align="center" width="50">
  8. <template slot-scope="scope">
  9. <el-checkbox :value="scope.row.isRecoverGuide == 'Y'" />
  10. </template>
  11. </el-table-column>
  12. <el-table-column prop="completeFlag" label="体检进度">
  13. <template slot-scope="scope">
  14. <div>{{ ldddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}</div>
  15. </template>
  16. </el-table-column>
  17. <el-table-column prop="isLock" label="锁住" width="50">
  18. <template slot-scope="scope">
  19. <i class="el-icon-lock" v-if="scope.row.isLock == 'Y'" style="font-size: 20px; color: red" />
  20. </template>
  21. </el-table-column>
  22. <el-table-column prop="customerOrgParentName" label="单位" width="180">
  23. <template slot-scope="scope">
  24. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgParentName : scope.row.customerOrgName }}
  25. </div>
  26. </template>
  27. </el-table-column>
  28. <el-table-column prop="customerOrgName" label="部门" width="180">
  29. <template slot-scope="scope">
  30. <div>{{ scope.row.customerOrgParentName == scope.row.customerOrgName ? "" : scope.row.customerOrgName }}</div>
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="patientName" label="姓名" />
  34. <el-table-column prop="sexName" label="性别">
  35. </el-table-column>
  36. <el-table-column prop="age" label="年龄" />
  37. <el-table-column prop="patientRegisterNo" label="条码号" width="150" />
  38. <el-table-column prop="patientNo" label="档案号" />
  39. <el-table-column prop="medicalTimes" label="体检次数"></el-table-column>
  40. <el-table-column label="分组/套餐" width="150">
  41. <template slot-scope="scope">
  42. <div v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
  43. {{ scope.row.medicalPackageName }}
  44. </div>
  45. <div v-else>
  46. {{ scope.row.customerOrgGroupName }}
  47. </div>
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="nationName" label="民族">
  51. </el-table-column>
  52. <el-table-column prop="idNo" label="身份证" width="150" />
  53. <el-table-column prop="birthDate" label="出生日期" width="100">
  54. <template slot-scope="scope">
  55. <div v-if="scope.row.birthDate">
  56. {{ lmoment(scope.row.birthDate, "yyyy-MM-DD") }}
  57. </div>
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="email" label="邮箱" width="100" />
  61. <el-table-column prop="mobileTelephone" label="手机" width="100" />
  62. <el-table-column prop="telephone" label="电话" width="100" />
  63. <el-table-column prop="address" label="地址" width="300" />
  64. <el-table-column prop="medicalCardNo" label="体检卡号" />
  65. <el-table-column prop="jobCardNo" label="工卡号" />
  66. <el-table-column prop="maritalStatusName" label="婚姻状况">
  67. </el-table-column>
  68. <el-table-column prop="medicalTypeName" label="体检类别">
  69. </el-table-column>
  70. <el-table-column prop="personnelTypeName" label="人员类别">
  71. </el-table-column>
  72. <el-table-column prop="jobPost" label="职务" />
  73. <el-table-column prop="jobTitle" label="职称" />
  74. <el-table-column prop="salesman" label="介绍人" />
  75. <el-table-column prop="isVip" label="VIP">
  76. <template slot-scope="scope">
  77. <el-checkbox :value="scope.row.isVip == 'Y'" />
  78. </template>
  79. </el-table-column>
  80. <el-table-column prop="creatorName" label="登记人" />
  81. <el-table-column prop="creationTime" label="登记日期" width="100">
  82. <template slot-scope="scope">
  83. <div>{{ lmoment(scope.row.creationTime, "yyyy-MM-DD") }}</div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column prop="isUpload" label="上传">
  87. <template slot-scope="scope">
  88. <el-checkbox :value="scope.row.isUpload == 'Y'" />
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <div style="display: flex; justify-content: space-between">
  93. <div></div>
  94. <div style="display: flex;">
  95. <span style="font-size: 12px">{{ loadOpts.totalCount }} 条记录当前显示{{
  96. tableData.length
  97. }}
  98. </span>
  99. <i class="el-icon-bottom" style="font-size: 18px;" @click="load" />
  100. </div>
  101. </div>
  102. </div>
  103. <div style="margin-left: 10px;">
  104. <div class="listBtn">
  105. <el-button type="success" class="commonbutton" @click="btnRecover">回收表单</el-button>
  106. </div>
  107. <div class="listBtn">
  108. <el-button type="primary" class="commonbutton" @click="btnScanRecover">扫码回收</el-button>
  109. </div>
  110. </div>
  111. <el-dialog title="扫/输入条码回收体检表(指引单)" :visible.sync="dialogVisible" width="400" :append-to-body="true"
  112. :close-on-click-modal="false">
  113. <div class="query">
  114. <span class="spanClass">条码号</span>
  115. <el-input ref="tmh" v-model="patientRegisterNo" @change="signByPatientRegisterNo"></el-input>
  116. </div>
  117. <div slot="footer" class="dialog-footer">
  118. <el-button type="primary" @click="signByPatientRegisterNo" class="commonbutton">确定</el-button>
  119. <el-button @click="dialogVisible = false" class="commonbutton">关闭</el-button>
  120. </div>
  121. </el-dialog>
  122. </div>
  123. </template>
  124. <script>
  125. import moment from "moment";
  126. import { mapState, mapActions } from "vuex";
  127. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  128. import { dddw, objCopy, arrayReduce,arrayExistObj } from "@/utlis/proFunc";
  129. import { savePeoplePhoto } from "../../utlis/proApi";
  130. import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue";
  131. import Camera from "../../components/patientRegister/Camera.vue";
  132. export default {
  133. components: {
  134. PatientRegisterEdit,
  135. Camera,
  136. },
  137. data() {
  138. return {
  139. tableData: [], //列表数据
  140. multipleSelection: [], //选中的数据列表
  141. tableDataCurrentRow:{}, // 单行选中的行
  142. dialogVisible: false,
  143. patientRegisterNo: '',
  144. LocalConfig: {
  145. normal: {
  146. maxResultCount: 100, //分页时单页记录数
  147. },
  148. },
  149. loadOpts: {
  150. totalCount: 0,
  151. skipCount: 0,
  152. maxResultCount: 100,
  153. },
  154. loadOptsInit: {},
  155. lazyLoading:false
  156. };
  157. },
  158. created() {
  159. try {
  160. let LocalConfig = JSON.parse(window.localStorage.getItem("LocalConfig") || null)
  161. if (LocalConfig?.normal?.maxResultCount){
  162. this.LocalConfig.normal.maxResultCount = LocalConfig.normal.maxResultCount
  163. }
  164. } catch (error) {
  165. console.log('window.localStorage.getItem("LocalConfig")', error);
  166. }
  167. // console.log('this.LocalConfig',this.LocalConfig)
  168. this.loadOpts.maxResultCount = Number(
  169. this.LocalConfig.normal.maxResultCount || 100
  170. );
  171. this.loadOptsInit = Object.assign({}, this.loadOpts);
  172. },
  173. //挂载完成
  174. mounted() {
  175. this.$nextTick(() => {
  176. this.scrollFull()
  177. })
  178. },
  179. computed: {
  180. ...mapState(["window", "dict", "patientRegister", "customerOrg"]),
  181. },
  182. methods: {
  183. ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
  184. handleSelectionChange(val) {
  185. this.multipleSelection = val;
  186. },
  187. rowClick(row){
  188. this.tableDataCurrentRow = row
  189. },
  190. // 回收表提交
  191. recoverCore(body) {
  192. postapi(`/api/app/patientregister/updaterecoverguidemany`, body)
  193. .then((res) => {
  194. if (res.code > -1) {
  195. this.$message.success({ showClose: true, message: "操作成功!"});
  196. // 刷新页面回收状态
  197. if(this.multipleSelection.length > 0){
  198. this.multipleSelection.forEach(e => {
  199. e.isRecoverGuide = 'Y'
  200. });
  201. }else{
  202. let lfind = arrayExistObj(this.tableData,'id',body[0].id)
  203. if(lfind > -1){
  204. this.tableData[lfind].isRecoverGuide = 'Y'
  205. }
  206. }
  207. }
  208. })
  209. },
  210. //选中人员记录回收
  211. btnRecover() {
  212. // 有勾选,则操作勾选的,无勾选则按选中的记录
  213. let selectedRds = []
  214. selectedRds = selectedRds.concat(this.multipleSelection)
  215. if(selectedRds.length == 0){
  216. if(this.tableDataCurrentRow.id) selectedRds.push(this.tableDataCurrentRow)
  217. }
  218. if (selectedRds.length == 0) {
  219. this.$message.warning({ showClose: true, message: "请勾选择或选中体检人员,再进行此操作" });
  220. return;
  221. }
  222. let body = []
  223. selectedRds.forEach(e => {
  224. body.push(e.id)
  225. });
  226. this.recoverCore(body)
  227. },
  228. // 点击扫码回收体检表按钮
  229. btnScanRecover() {
  230. this.patientRegisterNo = ''
  231. this.dialogVisible = true
  232. this.$nextTick(() => {
  233. this.$refs['tmh'].focus(); //打开光标定位到条码栏里
  234. });
  235. },
  236. //按条码号查个人数据
  237. signByPatientRegisterNo() {
  238. let patientRegisterNos = [this.patientRegisterNo]
  239. let body = {
  240. patientRegisterNos
  241. }
  242. //console.log(`/api/app/patientregister/getpatientregisterorpatient`, body)
  243. postapi('/api/app/PatientRegister/BatchRecoverGuideByPatientRegisterNo', body)
  244. .then((res) => {
  245. if (res.code > -1) {
  246. this.patientRegisterNo = ''
  247. this.$message.success({ showClose: true, message: '操作成功!' })
  248. }
  249. });
  250. },
  251. ldddw(arrayData, key, value, display) {
  252. return dddw(arrayData, key, value, display);
  253. },
  254. lmoment(date, forMat) {
  255. return moment(new Date(date)).format(forMat);
  256. },
  257. //查询
  258. async Query() {
  259. // 查询时,清掉明细数据 (滚动时不清)
  260. this.tableDataCurrentRow = {}; // 清除选择
  261. if (
  262. !(
  263. this.patientRegister.query.isSeries == "Y" &&
  264. this.patientRegister.query.patientRegisterNo
  265. )
  266. ) {
  267. this.tableData = [];
  268. }
  269. this.loadOpts = Object.assign(this.loadOpts, this.loadOptsInit);
  270. await this.getPrList();
  271. },
  272. //数据量多时,滚动加载
  273. async load() {
  274. this.loadOpts.skipCount++;
  275. await this.getPrList();
  276. },
  277. // 获取列表数据
  278. async getPrList() {
  279. if (
  280. this.loadOpts.skipCount != 0 &&
  281. this.loadOpts.skipCount * this.loadOpts.maxResultCount >=
  282. this.loadOpts.totalCount
  283. )
  284. return;
  285. // console.log('getPrList', this.loadOpts)
  286. let body = {
  287. skipCount: this.loadOpts.skipCount,
  288. maxResultCount: this.loadOpts.maxResultCount,
  289. };
  290. // console.log(`this.patientRegister.query`, this.patientRegister.query);
  291. if (this.patientRegister.query.customerOrgFlag) {
  292. // if (this.patientRegister.query.CustomerOrgParentId) {
  293. // body.customerOrgId = this.patientRegister.query.CustomerOrgParentId;
  294. // } else {
  295. // if (this.patientRegister.query.customerOrgId)
  296. // body.customerOrgId = this.patientRegister.query.customerOrgId;
  297. // }
  298. if (this.patientRegister.query.customerOrgId)
  299. body.customerOrgId = this.patientRegister.query.customerOrgId;
  300. // 获取单位体检次数与分组
  301. try {
  302. if (
  303. this.patientRegister.query.customerOrgId &&
  304. this.patientRegister.query.customerOrgId != this.dict.personOrgId &&
  305. this.patientRegister.query.customerOrgRegister.id
  306. ) {
  307. body.customerOrgRegisterId =
  308. this.patientRegister.query.customerOrgRegister.id;
  309. body.customerOrgGroupIds =
  310. this.patientRegister.query.customerOrgGroupIds;
  311. }
  312. } catch (error) {
  313. console.error(error)
  314. }
  315. }
  316. if (this.patientRegister.query.sex)
  317. body.sexId = this.patientRegister.query.sex;
  318. if (this.patientRegister.query.patientName)
  319. body.patientName = this.patientRegister.query.patientName;
  320. if (
  321. this.patientRegister.query.medicalTypeIds &&
  322. this.patientRegister.query.medicalTypeIds.length > 0
  323. )
  324. body.medicalTypeIds = this.patientRegister.query.medicalTypeIds;
  325. if (
  326. this.patientRegister.query.completeFlags &&
  327. this.patientRegister.query.completeFlags.length > 0
  328. )
  329. body.completeFlags = this.patientRegister.query.completeFlags;
  330. if (
  331. this.patientRegister.query.personnelTypeIds &&
  332. this.patientRegister.query.personnelTypeIds.length > 0
  333. )
  334. body.personnelTypeIds = this.patientRegister.query.personnelTypeIds;
  335. if (this.patientRegister.query.isRecoverGuide)
  336. body.isRecoverGuide = this.patientRegister.query.isRecoverGuide;
  337. //StartDate EndDate
  338. if (
  339. this.patientRegister.query.startDate &&
  340. this.patientRegister.query.endDate
  341. ) {
  342. body.dateType = this.patientRegister.query.dateType;
  343. body.startDate = moment(this.patientRegister.query.startDate).format(
  344. "yyyy-MM-DD"
  345. );
  346. body.endDate = moment(this.patientRegister.query.endDate).format(
  347. "yyyy-MM-DD"
  348. );
  349. if (body.startDate > body.endDate) {
  350. this.$message.warning({
  351. showClose: true,
  352. message: "起始日期不能大于截止日期,数据校验不通过!",
  353. });
  354. return;
  355. }
  356. }
  357. if (this.patientRegister.query.phone)
  358. body.phone = this.patientRegister.query.phone;
  359. if (this.patientRegister.query.idCardNo) {
  360. body.idNo = this.patientRegister.query.idCardNo;
  361. try {
  362. let sysParmId = "patient_register_query_idno";
  363. let sysParam = await postapi(
  364. "/api/app/SysParmValue/GetSysParmValueBySysParmId",
  365. { sysParmId }
  366. );
  367. // console.log('sysParam', sysParam)
  368. if (sysParam.data != "N") {
  369. body = {
  370. idNo: this.patientRegister.query.idCardNo,
  371. skipCount: this.loadOpts.skipCount,
  372. maxResultCount: this.loadOpts.maxResultCount,
  373. };
  374. }
  375. } catch (error) {
  376. console.log(error);
  377. }
  378. }
  379. if (this.patientRegister.query.patientNo)
  380. body = {
  381. patientNo: this.patientRegister.query.patientNo,
  382. skipCount: this.loadOpts.skipCount,
  383. maxResultCount: this.loadOpts.maxResultCount,
  384. };
  385. if (this.patientRegister.query.patientRegisterNo)
  386. body = {
  387. patientRegisterNo: this.patientRegister.query.patientRegisterNo,
  388. skipCount: this.loadOpts.skipCount,
  389. maxResultCount: this.loadOpts.maxResultCount,
  390. };
  391. // console.log("/api/app/patientregister/getlistinfilter", body);
  392. let upPhoto = "patient_register_read_idno_upPhoto"; // 是否读身份证查询更新照片
  393. let upPhotoParam = await postapi(
  394. "/api/app/SysParmValue/GetSysParmValueBySysParmId",
  395. { sysParmId: upPhoto }
  396. );
  397. let photo = this.patientRegister.photo;
  398. this.patientRegister.photo = "";
  399. postapi("/api/app/patientregister/getlistinfilter", body).then(
  400. async (res) => {
  401. if (res.code > -1) {
  402. // 刷新最大记录数
  403. this.loadOpts.totalCount = res.data.totalCount;
  404. let curLoad = res.data.items;
  405. // let oldCount = 0
  406. // 处理:
  407. // 1、分组/套餐 排序混乱的问题
  408. // 2、扫身份证查询时,无照片自动更新照片(参数控制)
  409. curLoad.forEach((e) => {
  410. // 1、分组/套餐 排序混乱的问题
  411. if (e.customerOrgId == this.dict.personOrgId) {
  412. e.groupPack = e.medicalPackageId;
  413. } else {
  414. e.groupPack = e.customerOrgGroupId;
  415. }
  416. // 2、扫身份证查询时,无照片自动更新照片(参数控制)
  417. if (upPhotoParam != "N" && photo) {
  418. if (!e.photo) {
  419. savePeoplePhoto(e.id, photo);
  420. }
  421. }
  422. });
  423. // 不是连续扫码时,需要判断是否分页查询(连续扫码不清原来的数据)
  424. console.log(
  425. "this.patientRegister.query",
  426. this.patientRegister.query.isSeries,
  427. this.patientRegister.query.patientRegisterNo
  428. );
  429. if (
  430. !(
  431. this.patientRegister.query.isSeries == "Y" &&
  432. this.patientRegister.query.patientRegisterNo
  433. )
  434. ) {
  435. if (body.skipCount == 0) {
  436. //查询
  437. this.tableData = [];
  438. }
  439. }
  440. this.tableData = this.tableData.concat(curLoad);
  441. // else {
  442. // // 懒加载 ,原数据集不用清空
  443. // oldCount = this.tableData.length
  444. // }
  445. // curLoad.forEach((e, index) => {
  446. // this.tableData.push(Object.assign({ index: Number(oldCount) + Number(index), choosed: false }, e))
  447. // })
  448. }
  449. }
  450. );
  451. },
  452. //滚动加载数据
  453. scrollFull() {
  454. let obj = this.$refs['dataList'].bodyWrapper
  455. console.log('obj', obj)
  456. obj.addEventListener('scroll', async () => {
  457. // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight);
  458. if (obj.scrollTop + obj.clientHeight + 20 > obj.scrollHeight && !this.lazyLoading) {
  459. // 获取到的不是全部数据 当滚动到底部
  460. console.log('scrollTop', obj.scrollTop, 'clientHeight', obj.clientHeight, 'scrollHeight', obj.scrollHeight);
  461. if (Number(this.loadOpts.skipCount) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) {
  462. this.lazyLoading = false
  463. } else {
  464. this.lazyLoading = true
  465. this.load()
  466. // this.dom.scrollTop = this.dom.scrollTop - 100
  467. }
  468. }
  469. })
  470. },
  471. },
  472. //监听事件
  473. watch: {
  474. //触发查询事件
  475. "patientRegister.query.times"(newVal, oldVal) {
  476. if (newVal != oldVal) {
  477. //alert('触发查询事件')
  478. this.Query();
  479. }
  480. },
  481. },
  482. };
  483. </script>
  484. <style scoped>
  485. .listBtn {
  486. margin-top: 10px;
  487. }
  488. .btnClass {
  489. width: 100px;
  490. }
  491. .query {
  492. margin-right: 10px;
  493. font-size: 14px;
  494. color: #232748;
  495. font-weight: 400;
  496. font-family: "NotoSansSC-Regular";
  497. }
  498. .spanClass {
  499. font-size: 14px;
  500. padding: 0 2px 0 0;
  501. }
  502. </style>