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.

715 lines
27 KiB

3 years ago
2 years ago
5 months ago
3 months ago
3 months ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
5 months ago
3 years ago
3 months ago
3 years ago
5 months ago
3 years ago
3 months ago
3 years ago
5 months ago
3 years ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 years ago
5 months ago
3 years ago
5 months ago
3 years ago
3 months ago
3 months ago
3 months ago
3 months ago
3 years ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 years ago
5 months ago
3 years ago
3 months ago
3 months ago
3 years ago
3 months ago
3 months ago
3 years ago
5 months ago
3 years ago
3 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
3 years ago
3 years ago
3 years ago
4 months ago
3 years ago
3 years ago
5 months ago
4 months ago
4 months ago
4 months ago
3 years ago
4 months ago
5 months ago
4 months ago
5 months ago
3 years ago
2 years ago
4 months ago
3 years ago
5 months ago
3 years ago
4 months ago
5 months ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
5 months ago
3 years ago
5 months ago
4 months ago
5 months ago
5 months ago
3 months ago
5 months ago
4 months ago
4 months ago
3 years ago
5 months ago
3 months ago
5 months ago
3 years ago
5 months ago
3 months ago
5 months ago
3 years ago
5 months ago
3 years ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
3 years ago
5 months ago
4 months ago
5 months ago
4 months ago
3 years ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
3 years ago
5 months ago
4 months ago
5 months ago
4 months ago
3 years ago
5 months ago
3 years ago
5 months ago
3 years ago
5 months ago
4 months ago
5 months ago
3 years ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
3 years ago
5 months ago
3 years ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
5 months ago
3 years ago
3 months ago
3 years ago
3 years ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 years ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
3 years ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 months ago
3 years ago
3 months ago
4 months ago
5 months ago
3 years ago
3 months ago
3 years ago
3 months ago
5 months ago
3 years ago
5 months ago
3 years ago
3 months ago
3 years ago
3 years ago
3 years ago
5 months ago
3 years ago
  1. <template>
  2. <div style="display: flex;">
  3. <div :style="'width:' + (window.pageWidth - 200 - 145) + 'px;'">
  4. <u-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" use-virtual :row-height="25" big-data-checkbox :data-changes-scroll-top="false">
  6. <u-table-column type="selection" width="40" align="center" />
  7. <u-table-column type="index" label="序号" width="50" align="center" />
  8. <u-table-column prop="isRecoverGuide" label="回收" align="center" width="50" sortable>
  9. <template slot-scope="scope">
  10. <el-checkbox :value="scope.row.isRecoverGuide == 'Y'" />
  11. </template>
  12. </u-table-column>
  13. <u-table-column prop="completeFlag" label="体检进度" sortable>
  14. <template slot-scope="scope">
  15. <div>{{ ldddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}</div>
  16. </template>
  17. </u-table-column>
  18. <u-table-column prop="isLock" label="锁住" width="50" sortable>
  19. <template slot-scope="scope">
  20. <i class="el-icon-lock" v-if="scope.row.isLock == 'Y'" style="font-size: 20px; color: red" />
  21. </template>
  22. </u-table-column>
  23. <u-table-column prop="customerOrgParentName" label="单位" width="180" sortable>
  24. <template slot-scope="scope">
  25. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgParentName : scope.row.customerOrgName }}
  26. </div>
  27. </template>
  28. </u-table-column>
  29. <u-table-column prop="customerOrgName" label="部门" width="180">
  30. <template slot-scope="scope">
  31. <div>{{ scope.row.customerOrgParentName == scope.row.customerOrgName ? "" : scope.row.customerOrgName }}</div>
  32. </template>
  33. </u-table-column>
  34. <u-table-column prop="patientName" label="姓名" sortable/>
  35. <u-table-column prop="sexName" label="性别" sortable>
  36. </u-table-column>
  37. <u-table-column prop="age" label="年龄" sortable/>
  38. <u-table-column prop="patientRegisterNo" label="条码号" width="150" sortable/>
  39. <u-table-column prop="patientNo" label="档案号" sortable/>
  40. <u-table-column prop="medicalTimes" label="体检次数"></u-table-column>
  41. <u-table-column label="分组/套餐" width="150">
  42. <template slot-scope="scope">
  43. <div v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
  44. {{ scope.row.medicalPackageName }}
  45. </div>
  46. <div v-else>
  47. {{ scope.row.customerOrgGroupName }}
  48. </div>
  49. </template>
  50. </u-table-column>
  51. <u-table-column prop="nationName" label="民族" sortable>
  52. </u-table-column>
  53. <u-table-column prop="idNo" label="身份证" width="150" sortable/>
  54. <u-table-column prop="birthDate" label="出生日期" width="100" sortable>
  55. <template slot-scope="scope">
  56. <div v-if="scope.row.birthDate">
  57. {{ lmoment(scope.row.birthDate, "yyyy-MM-DD") }}
  58. </div>
  59. </template>
  60. </u-table-column>
  61. <u-table-column prop="email" label="邮箱" width="100" sortable/>
  62. <u-table-column prop="mobileTelephone" label="手机" width="100" sortable/>
  63. <u-table-column prop="telephone" label="电话" width="100" sortable/>
  64. <u-table-column prop="address" label="地址" width="300" sortable/>
  65. <u-table-column prop="medicalCardNo" label="体检卡号" sortable/>
  66. <u-table-column prop="jobCardNo" label="工卡号" sortable/>
  67. <u-table-column prop="maritalStatusName" label="婚姻状况" sortable>
  68. </u-table-column>
  69. <u-table-column prop="medicalTypeName" label="体检类别" sortable>
  70. </u-table-column>
  71. <u-table-column prop="personnelTypeName" label="人员类别" sortable>
  72. </u-table-column>
  73. <u-table-column prop="jobPost" label="职务" sortable/>
  74. <u-table-column prop="jobTitle" label="职称" sortable/>
  75. <u-table-column prop="salesman" label="介绍人" sortable/>
  76. <u-table-column prop="isVip" label="VIP" sortable>
  77. <template slot-scope="scope">
  78. <el-checkbox :value="scope.row.isVip == 'Y'" />
  79. </template>
  80. </u-table-column>
  81. <u-table-column prop="creatorName" label="登记人" sortable/>
  82. <u-table-column prop="creationTime" label="登记日期" width="100" sortable>
  83. <template slot-scope="scope">
  84. <div>{{ lmoment(scope.row.creationTime, "yyyy-MM-DD") }}</div>
  85. </template>
  86. </u-table-column>
  87. <u-table-column prop="isUpload" label="上传" sortable>
  88. <template slot-scope="scope">
  89. <el-checkbox :value="scope.row.isUpload == 'Y'" />
  90. </template>
  91. </u-table-column>
  92. </u-table>
  93. <div style="display: flex; justify-content: space-between">
  94. <div></div>
  95. <div>
  96. <span style="font-size: 12px">{{ loadOpts.totalCount }} 条记录当前显示{{
  97. tableData.length
  98. }}
  99. </span>
  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('Y')">回收表单</el-button>
  106. </div>
  107. <div class="listBtn">
  108. <el-button type="danger" class="commonbutton" @click="btnRecover('N')">取消回收</el-button>
  109. </div>
  110. <div class="listBtn">
  111. <el-button type="primary" class="commonbutton" @click="btnScanRecover">扫码回收</el-button>
  112. </div>
  113. <!-- <div class="listBtn">
  114. <download-excel :fields="jsonFields" :fetch="btnExport" type="xls" :name="tableName">
  115. <el-button type="" style="width:100%">导出excel</el-button>
  116. </download-excel>
  117. </div> -->
  118. </div>
  119. <el-dialog title="扫/输入条码回收体检表(指引单)" :visible.sync="recover.dialog" width="400px" :append-to-body="true"
  120. :close-on-click-modal="false">
  121. <div style="margin-left: 10px;">
  122. <template>
  123. <el-radio v-model="recover.recoverType" label="0">条码号</el-radio>
  124. <el-radio v-model="recover.recoverType" label="1">档案号</el-radio>
  125. </template>
  126. <el-input style="margin: 10px 0;" ref="tmh" v-model="recover.barcode" @keyup.native.enter="signByPatientRegisterNo"></el-input>
  127. </div>
  128. <div slot="footer" class="dialog-footer">
  129. <el-button type="primary" @click="signByPatientRegisterNo" class="commonbutton">确定</el-button>
  130. <el-button @click="recover.dialog = false" class="commonbutton">关闭</el-button>
  131. </div>
  132. </el-dialog>
  133. </div>
  134. </template>
  135. <script>
  136. import moment from "moment";
  137. import { mapState, mapActions } from "vuex";
  138. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  139. import { dddw, objCopy, arrayReduce,arrayExistObj,deepCopy } from "@/utlis/proFunc";
  140. import { savePeoplePhoto } from "../../utlis/proApi";
  141. import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue";
  142. import Camera from "../../components/patientRegister/Camera.vue";
  143. import { UTable, UTableColumn } from "umy-ui";
  144. export default {
  145. components: {
  146. PatientRegisterEdit,
  147. Camera,
  148. UTable,
  149. UTableColumn,
  150. },
  151. props: ["refQueryCondition"],
  152. data() {
  153. return {
  154. tableData: [], //列表数据
  155. multipleSelection: [], //选中的数据列表
  156. tableDataCurrentRow:{}, // 单行选中的行
  157. // 体检表回收
  158. recover: {
  159. dialog: false,
  160. recoverType: '0', //回收类型 0-条码号 1-档案号
  161. barcode: '', // 条码号或档案号
  162. barcodes: [], // 条码号或档案号集合
  163. isRecoverGuide: 'Y', //状态 Y-回收,N-取消回收
  164. },
  165. patientRegisterNo: '',
  166. patient_register_query_idno: 'Y', // 身份证排他
  167. patient_register_query_name: 'N', // 姓名排他
  168. patient_register_read_idno_upPhoto: 'N', // 读身份证查询 是否更新照片
  169. LocalConfig: {
  170. normal: {
  171. maxResultCount: 100, //分页时单页记录数
  172. },
  173. },
  174. loadOpts: {
  175. totalCount: 0,
  176. skipCount: 0,
  177. maxResultCount: 100,
  178. },
  179. loadOptsInit: {},
  180. lazyLoading:false,
  181. dom:null,
  182. jsonFields: {
  183. 回收:"isRecoverGuide",
  184. 体检进度: "completeFlag",
  185. 锁住: "isLock",
  186. 单位: "customerOrgParentName",
  187. 部门: "customerOrgName",
  188. 姓名: "patientName",
  189. 性别: "sexName",
  190. 年龄: "age",
  191. 条码号: "patientRegisterNo",
  192. 档案号: "patientNo",
  193. 体检次数: "medicalTimes",
  194. 分组套餐: "groupPack",
  195. 民族: "nationName",
  196. 身份证: "idNo",
  197. 出生日期: "birthDate",
  198. 邮箱: "email",
  199. 手机: "mobileTelephone",
  200. 电话: "telephone",
  201. 地址: "address",
  202. 体检卡号: "medicalCardNo",
  203. 工卡号: "jobCardNo",
  204. 婚姻状况: "maritalStatusName",
  205. 体检类别: "medicalTypeName",
  206. 人员类别: "personnelTypeName",
  207. 职务: "jobPost",
  208. 职称: "jobTitle",
  209. 介绍人: "salesman",
  210. VIP: "isVip",
  211. 登记人: "creatorName",
  212. 登记日期: "creationTime",
  213. 上传: "isUpload"
  214. },
  215. tableName:""
  216. };
  217. },
  218. created() {
  219. try {
  220. let LocalConfig = JSON.parse(window.localStorage.getItem("LocalConfig") || null)
  221. if (LocalConfig?.normal?.maxResultCount){
  222. this.LocalConfig.normal.maxResultCount = LocalConfig.normal.maxResultCount
  223. }
  224. } catch (error) {
  225. console.log('window.localStorage.getItem("LocalConfig")', error);
  226. }
  227. // console.log('this.LocalConfig',this.LocalConfig)
  228. this.loadOpts.maxResultCount = Number(
  229. this.LocalConfig.normal.maxResultCount || 100
  230. );
  231. this.loadOptsInit = Object.assign({}, this.loadOpts);
  232. // 获取系统参数 -- 身份证排他
  233. postapi("/api/app/SysParmValue/GetSysParmValueBySysParmId",
  234. { sysParmId: "patient_register_query_idno" }
  235. ).then((res) => {
  236. if (res.code > -1) {
  237. this.patient_register_query_idno = res.data || "Y";
  238. }
  239. });
  240. // 获取系统参数 -- 姓名排他
  241. postapi("/api/app/SysParmValue/GetSysParmValueBySysParmId",
  242. { sysParmId: "patient_register_query_name" }
  243. ).then((res) => {
  244. if (res.code > -1) {
  245. this.patient_register_query_name = res.data || "N";
  246. }
  247. });
  248. // 获取系统参数 -- 读身份证 是否更新照片
  249. postapi("/api/app/SysParmValue/GetSysParmValueBySysParmId",
  250. { sysParmId: "patient_register_read_idno_upPhoto" }
  251. ).then((res) => {
  252. if (res.code > -1) {
  253. this.patient_register_read_idno_upPhoto = res.data || "N";
  254. }
  255. });
  256. },
  257. //挂载完成
  258. mounted() {
  259. // this.$nextTick(() => {
  260. // this.scrollFull()
  261. // })
  262. },
  263. computed: {
  264. ...mapState(["window", "dict", "patientRegister", "customerOrg"]),
  265. },
  266. methods: {
  267. ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
  268. handleSelectionChange(val) {
  269. this.multipleSelection = val;
  270. },
  271. rowClick(row){
  272. this.tableDataCurrentRow = row
  273. },
  274. // 回收表提交 Y-回收,N-取消
  275. recoverCore(body) {
  276. // postapi(`/api/app/patientregister/updaterecoverguidemany`, body)
  277. // .then((res) => {
  278. // if (res.code > -1) {
  279. // this.$message.success({ showClose: true, message: "操作成功!"});
  280. // // 刷新页面回收状态
  281. // if(this.multipleSelection.length > 0){
  282. // this.multipleSelection.forEach(e => {
  283. // e.isRecoverGuide = 'Y'
  284. // });
  285. // }else{
  286. // let lfind = arrayExistObj(this.tableData,'id',body[0].id)
  287. // if(lfind > -1){
  288. // this.tableData[lfind].isRecoverGuide = 'Y'
  289. // }
  290. // }
  291. // }
  292. // })
  293. postapi('/api/app/PatientRegister/BatchRecoverGuide', body)
  294. .then((res) => {
  295. if (res.code > -1) {
  296. this.$message.success({ showClose: true, message: '操作成功!' })
  297. let key = body.recoverType == '0' ? 'patientRegisterNo':'patientNo'
  298. let lfind = -1
  299. body.barcodes.forEach(e => {
  300. lfind = arrayExistObj(this.tableData,key,e)
  301. if(lfind > -1) this.tableData[lfind].isRecoverGuide = body.isRecoverGuide
  302. });
  303. }
  304. });
  305. },
  306. //选中人员记录回收
  307. btnRecover(isRecoverGuide) {
  308. // 有勾选,则操作勾选的,无勾选则按选中的记录
  309. let selectedRds = []
  310. selectedRds = selectedRds.concat(this.multipleSelection)
  311. if(selectedRds.length == 0){
  312. if(this.tableDataCurrentRow.id) selectedRds.push(this.tableDataCurrentRow)
  313. }
  314. if (selectedRds.length == 0) {
  315. this.$message.warning({ showClose: true, message: "请勾选择或选中体检人员,再进行此操作" });
  316. return;
  317. }
  318. let body = {
  319. recoverType:'0',
  320. isRecoverGuide,
  321. barcodes:[]
  322. }
  323. selectedRds.forEach(e => {
  324. body.barcodes.push(e.patientRegisterNo)
  325. });
  326. this.recoverCore(body)
  327. },
  328. // 点击扫码回收体检表按钮
  329. btnScanRecover() {
  330. this.recover.barcode = ''
  331. this.recover.dialog = true
  332. this.$nextTick(() => {
  333. this.$refs['tmh'].focus(); //打开光标定位到条码栏里
  334. });
  335. },
  336. //按条码号查个人数据
  337. signByPatientRegisterNo() {
  338. // let patientRegisterNos = [this.patientRegisterNo]
  339. // let body = {
  340. // patientRegisterNos
  341. // }
  342. // //console.log(`/api/app/patientregister/getpatientregisterorpatient`, body)
  343. // postapi('/api/app/PatientRegister/BatchRecoverGuideByPatientRegisterNo', body)
  344. // .then((res) => {
  345. // if (res.code > -1) {
  346. // this.$message.success({ showClose: true, message: '操作成功!' })
  347. // //let lfind = arrayExistObj()
  348. // this.recover.barcode = ''
  349. // }
  350. // });
  351. this.recover.barcodes = [this.recover.barcode]
  352. postapi('/api/app/PatientRegister/BatchRecoverGuide', this.recover)
  353. .then((res) => {
  354. if (res.code > -1) {
  355. this.$message.success({ showClose: true, message: '操作成功!' })
  356. let key = this.recover.recoverType == '0' ? 'patientRegisterNo':'patientNo'
  357. let lfind = arrayExistObj(this.tableData,key,this.recover.barcode)
  358. if(lfind > -1) this.tableData[lfind].isRecoverGuide = this.recover.isRecoverGuide
  359. this.recover.barcode = ''
  360. }
  361. });
  362. },
  363. ldddw(arrayData, key, value, display) {
  364. return dddw(arrayData, key, value, display);
  365. },
  366. lmoment(date, forMat) {
  367. return moment(new Date(date)).format(forMat);
  368. },
  369. //查询
  370. async Query() {
  371. // 查询时,清掉明细数据 (滚动时不清)
  372. this.tableDataCurrentRow = {}; // 清除选择
  373. if (
  374. !(
  375. this.patientRegister.query.isSeries == "Y" &&
  376. this.patientRegister.query.patientRegisterNo
  377. )
  378. ) {
  379. this.tableData = [];
  380. }
  381. this.loadOpts = Object.assign(this.loadOpts, this.loadOptsInit);
  382. await this.getPrList();
  383. },
  384. //数据量多时,滚动加载
  385. async load() {
  386. this.loadOpts.skipCount++;
  387. await this.getPrList();
  388. this.lazyLoading = false
  389. },
  390. // 查询获取人员列表数据
  391. async getPrList() {
  392. if (
  393. this.loadOpts.skipCount != 0 &&
  394. this.loadOpts.skipCount * this.loadOpts.maxResultCount >=
  395. this.loadOpts.totalCount
  396. )
  397. return;
  398. // console.log('getPrList', this.loadOpts)
  399. let body = Object.assign({}, this.loadOpts)
  400. let queryType = this.refQueryCondition.queryType
  401. console.log('getPrList.this.refQueryCondition', this.refQueryCondition)
  402. // 非排他查询条件 ===================== Start ==========================
  403. if (!queryType) {
  404. // 查询条件--日期
  405. if (this.refQueryCondition.startDate && this.refQueryCondition.endDate) {
  406. body.dateType = this.refQueryCondition.dateType;
  407. body.startDate = this.refQueryCondition.startDate
  408. body.endDate = this.refQueryCondition.endDate
  409. if (body.startDate > body.endDate) {
  410. this.$message.warning({
  411. showClose: true,
  412. message: "起始日期不能大于截止日期,数据校验不通过!",
  413. });
  414. return;
  415. }
  416. }
  417. // 查询条件--单位、次数、分组
  418. if (this.refQueryCondition.customerOrgFlag) {
  419. if (this.refQueryCondition.customerOrgId) body.customerOrgId = this.refQueryCondition.customerOrgId
  420. // 获取单位体检次数与分组
  421. try {
  422. if (
  423. this.refQueryCondition.customerOrgId &&
  424. this.refQueryCondition.customerOrgId != this.dict.personOrgId &&
  425. this.refQueryCondition.customerOrgRegister.id
  426. ) {
  427. body.customerOrgRegisterId = this.refQueryCondition.customerOrgRegister.id;
  428. if (this.refQueryCondition.customerOrgGroupIds) body.customerOrgGroupIds = this.refQueryCondition.customerOrgGroupIds
  429. }
  430. } catch (error) {
  431. console.error(error);
  432. }
  433. }
  434. // 电话
  435. if (this.refQueryCondition.phone) body.phone = this.refQueryCondition.phone
  436. // 性别
  437. if (this.refQueryCondition.sexId) body.sexId = this.refQueryCondition.sexId
  438. // 体检类别
  439. if (this.refQueryCondition.medicalTypeIds) body.medicalTypeIds = this.refQueryCondition.medicalTypeIds
  440. // 人员状态
  441. if (this.refQueryCondition.completeFlags) body.completeFlags = this.refQueryCondition.completeFlags
  442. // 人员类别
  443. if (this.refQueryCondition.personnelTypeIds) body.personnelTypeIds = this.refQueryCondition.personnelTypeIds
  444. // 表格回收状态
  445. if (this.refQueryCondition.isRecoverGuide) body.isRecoverGuide = this.refQueryCondition.isRecoverGuide
  446. // 排他条件有值时
  447. if (this.refQueryCondition.patientRegisterNo) {
  448. queryType = "patientRegisterNo"
  449. } else if (this.refQueryCondition.pacsNo) {
  450. queryType = "pacsNo"
  451. } else if (this.refQueryCondition.lisNo) {
  452. queryType = "lisNo"
  453. } else if (this.refQueryCondition.patientNo) {
  454. queryType = "patientNo"
  455. } else if (this.refQueryCondition.idCardNo) {
  456. queryType = "idCardNo"
  457. } else if (this.refQueryCondition.patientName) {
  458. queryType = "patientName"
  459. }
  460. }
  461. // 非排他查询条件 ===================== End ==========================
  462. // 排他查询条件
  463. let photo = ''
  464. switch (queryType) {
  465. case 'patientName': // 姓名排他判断
  466. if (this.refQueryCondition.patientName) {
  467. body.patientName = this.refQueryCondition.patientName;
  468. if (this.patient_register_query_name == 'Y') {
  469. body = {
  470. patientName: this.refQueryCondition.patientName,
  471. skipCount: this.loadOpts.skipCount,
  472. maxResultCount: this.loadOpts.maxResultCount,
  473. };
  474. }
  475. }
  476. break;
  477. case 'idCardNo': // 身份证排他判断
  478. if (this.refQueryCondition.idCardNo) {
  479. body.idNo = this.refQueryCondition.idCardNo;
  480. if (this.patient_register_query_idno == 'Y') {
  481. body = {
  482. idNo: this.refQueryCondition.idCardNo,
  483. skipCount: this.loadOpts.skipCount,
  484. maxResultCount: this.loadOpts.maxResultCount,
  485. };
  486. }
  487. }
  488. if (this.refQueryCondition.photo) photo = this.refQueryCondition.photo;
  489. break;
  490. case 'patientNo': // 档案号排他判断
  491. if (this.refQueryCondition.patientNo)
  492. body = {
  493. patientNo: this.refQueryCondition.patientNo,
  494. skipCount: this.loadOpts.skipCount,
  495. maxResultCount: this.loadOpts.maxResultCount,
  496. };
  497. break;
  498. case 'patientRegisterNo': // 条码号排他判断
  499. if (this.refQueryCondition.patientRegisterNo)
  500. body = {
  501. patientRegisterNo: this.refQueryCondition.patientRegisterNo,
  502. skipCount: this.loadOpts.skipCount,
  503. maxResultCount: this.loadOpts.maxResultCount,
  504. };
  505. break;
  506. case 'pacsNo': // 检查条码排他判断
  507. if (this.refQueryCondition.pacsNo)
  508. body = {
  509. pacsNo: this.refQueryCondition.pacsNo,
  510. skipCount: this.loadOpts.skipCount,
  511. maxResultCount: this.loadOpts.maxResultCount,
  512. };
  513. break;
  514. case 'lisNo': // 检验条码排他判断
  515. if (this.refQueryCondition.lisNo)
  516. body = {
  517. lisNo: this.refQueryCondition.lisNo,
  518. skipCount: this.loadOpts.skipCount,
  519. maxResultCount: this.loadOpts.maxResultCount,
  520. };
  521. break;
  522. default: //
  523. break;
  524. }
  525. // 带费且合计 /api/app/PatientRegister/GetPatientRegisterWithCharge
  526. // 不带费且合计 /api/app/patientregister/getlistinfilter
  527. postapi(
  528. "/api/app/patientregister/getlistinfilter",
  529. body
  530. ).then(async (res) => {
  531. if (res.code > -1) {
  532. // 刷新最大记录数
  533. this.loadOpts.totalCount = res.data.totalCount;
  534. let curLoad = res.data.items;
  535. // let oldCount = 0
  536. // 处理:
  537. // 1、分组/套餐 排序混乱的问题
  538. // 2、扫身份证查询时,无照片自动更新照片(参数控制)
  539. curLoad.forEach((e) => {
  540. // 1、分组/套餐 排序混乱的问题
  541. if (e.customerOrgId == this.dict.personOrgId) {
  542. e.groupPack = e.medicalPackageId;
  543. } else {
  544. e.groupPack = e.customerOrgGroupId;
  545. }
  546. // 2、扫身份证查询时,无照片自动更新照片(参数控制)
  547. if (this.patient_register_read_idno_upPhoto == "Y" && photo) {
  548. if (!e.photo) {
  549. savePeoplePhoto(e.id, photo);
  550. }
  551. }
  552. });
  553. // 不是连续扫码时,需要判断是否分页查询(连续扫码不清原来的数据)
  554. // console.log("this.refQueryCondition", this.refQueryCondition.isSeries, this.refQueryCondition.patientRegisterNo);
  555. if (this.refQueryCondition.isSeries == "Y" && this.refQueryCondition.patientRegisterNo) {
  556. // 如果已经存在列表中,则不在添加
  557. for (let index = curLoad.length - 1; index > -1; index--) {
  558. const e = curLoad[index];
  559. if (arrayExistObj(this.tableData, 'id', e.id) > -1) curLoad.splice(index, 1)
  560. }
  561. } else {
  562. if (body.skipCount == 0) {
  563. //查询
  564. this.tableData = [];
  565. }
  566. }
  567. this.tableData = this.tableData.concat(curLoad);
  568. // else {
  569. // // 懒加载 ,原数据集不用清空
  570. // oldCount = this.tableData.length
  571. // }
  572. // curLoad.forEach((e, index) => {
  573. // this.tableData.push(Object.assign({ index: Number(oldCount) + Number(index), choosed: false }, e))
  574. // })
  575. }
  576. });
  577. },
  578. //滚动加载数据
  579. async scrollFull(scroll, event) {
  580. if (!scroll.judgeFlse) return;
  581. // 正在加载时阻止重复触发
  582. if (this.lazyLoading) return;
  583. if (
  584. (Number(this.loadOpts.skipCount) + 1) *
  585. Number(this.loadOpts.maxResultCount) >=
  586. Number(this.loadOpts.totalCount)
  587. ) {
  588. return;
  589. }
  590. this.lazyLoading = true;
  591. try {
  592. await this.load();
  593. } catch (e) {
  594. console.error('scrollFull load error', e);
  595. }
  596. // this.dom = this.$refs['dataList'].bodyWrapper
  597. // console.log('obj', this.dom)
  598. // this.dom.addEventListener('scroll', async () => {
  599. // // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight);
  600. // if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) {
  601. // // 获取到的不是全部数据 当滚动到底部
  602. // //console.log('scrollTop', obj.scrollTop, 'clientHeight', obj.clientHeight, 'scrollHeight', obj.scrollHeight);
  603. // if (Number(this.loadOpts.skipCount) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) {
  604. // this.lazyLoading = false
  605. // } else {
  606. // this.lazyLoading = true
  607. // this.load()
  608. // // this.dom.scrollTop = this.dom.scrollTop - 100
  609. // }
  610. // }
  611. // })
  612. },
  613. btnExport(elId) {
  614. let tableDatas = deepCopy(this.tableData)
  615. tableDatas.forEach((e, index) => {
  616. if(e.completeFlag) e.completeFlag = this.ldddw(this.dict.completeFlag, "id", e.completeFlag, "displayName")
  617. if (e.sexId) e.sexId = dddw(this.dict.sex, "id", e.sexId, "displayName")
  618. if (e.medicalPackageId !== this.dict.personOrgId && e.customerOrgId === this.dict.personOrgId) {
  619. e.groupPack = e.medicalPackageName // dddw(this.dict.medicalPackage, "id", e.medicalPackageId, "displayName")
  620. } else if (e.medicalPackageId !== this.dict.personOrgId && e.customerOrgId !== this.dict.personOrgId) {
  621. e.groupPack = e.customerOrgGroupName // dddw(this.dict.customerOrgGroupAll, "id", e.customerOrgGroupId, "displayName")
  622. }
  623. if (e.idNo) e.idNo = e.idNo + '&'
  624. if (e.birthDate) e.birthDate = moment(e.birthDate).format("yyyy-MM-DD")
  625. })
  626. this.tableName = '体检表回收' + moment(new Date()).format('yyyyMMDDHHmmss') + '.xls'
  627. return tableDatas;
  628. },
  629. },
  630. //监听事件
  631. watch: {
  632. //触发查询事件
  633. "refQueryCondition.queryConditionTimes"(newVal, oldVal) {
  634. if (newVal != oldVal) {
  635. console.log('表格回收--触发查询 refQueryCondition.queryConditionTimes', oldVal, newVal)
  636. this.Query();
  637. }
  638. },
  639. },
  640. };
  641. </script>
  642. <style scoped>
  643. @import "../../assets/css/global_table.css";
  644. .listBtn {
  645. margin-top: 10px;
  646. }
  647. .btnClass {
  648. width: 100px;
  649. }
  650. .query {
  651. margin-right: 10px;
  652. font-size: 14px;
  653. color: #232748;
  654. font-weight: 400;
  655. font-family: "NotoSansSC-Regular";
  656. }
  657. .spanClass {
  658. font-size: 14px;
  659. padding: 0 2px 0 0;
  660. }
  661. </style>