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.

495 lines
18 KiB

3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 months ago
2 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
1 year ago
2 years ago
3 months ago
3 years ago
2 years ago
3 months ago
3 years ago
3 years ago
2 years ago
3 months ago
3 years ago
2 years ago
3 months ago
2 years ago
3 months ago
2 years ago
3 months ago
5 months ago
3 years ago
3 years ago
3 years ago
2 years ago
3 months ago
3 years ago
3 years ago
2 years ago
3 months ago
3 years ago
2 years ago
3 months ago
2 years ago
3 months ago
5 months ago
3 months ago
2 years ago
5 months ago
3 years ago
2 years ago
2 years ago
3 months ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 months ago
2 years ago
2 years ago
3 months ago
2 years ago
3 years ago
2 years ago
3 months ago
3 years ago
3 years ago
3 years ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
3 years ago
3 years ago
3 years ago
2 years ago
5 months ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 months ago
3 years ago
3 months ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 months ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 months ago
3 years ago
3 years ago
2 years ago
3 months ago
2 years ago
2 years ago
3 years ago
3 months ago
2 years ago
2 years ago
3 months ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 months ago
4 months ago
2 years ago
3 months ago
2 years ago
3 months ago
2 years ago
5 months ago
3 months ago
5 months ago
3 months ago
2 years ago
3 years ago
3 months ago
3 months ago
3 months ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 months ago
2 years ago
3 months ago
2 years ago
3 months ago
2 years ago
2 years ago
3 months ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
4 months ago
3 months ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 months ago
2 years ago
3 months ago
3 months ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 months ago
2 years ago
2 years ago
2 years ago
3 months ago
2 years ago
2 years ago
3 years ago
3 years ago
3 months 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
3 months ago
2 years ago
3 months ago
2 years ago
3 months ago
2 years ago
3 months 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
3 months ago
3 years ago
3 years ago
2 years ago
3 months ago
2 years ago
3 months ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
  1. <template>
  2. <div style="display: flex;">
  3. <div
  4. :style="'display: flex;flex-wrap: wrap;height: 80px;width: 1216px;background-color: #fff;border-radius: 8px;margin-bottom: 15px;align-items: center;padding: 10px;width:' + (window.pageWidth - (orgEnable == 'Y' ? 0 : 200) - 110 - 10) + 'px;'">
  5. <div class="query">
  6. <el-select v-model="query.dateType" placeholder="请选择" style="width: 80px" size="small">
  7. <el-option label="登记日期" :value="'1'" />
  8. <el-option label="体检日期" :value="'2'" />
  9. <el-option label="登记或体检" :value="'3'" />
  10. </el-select>
  11. <!-- dateType 1 登记2 体检3 体检或登记-->
  12. <el-date-picker v-model="query.startDate" type="date" placeholder="起始日期" size="small" style="width:90px;"
  13. value-format="yyyy-MM-dd" :picker-options="pickerOptions" />
  14. <span class="spanClass"></span>
  15. <el-date-picker v-model="query.endDate" type="date" placeholder="截止日期" size="small" style="width:90px;"
  16. value-format="yyyy-MM-dd" :picker-options="pickerOptions" />
  17. </div>
  18. <div class="query">
  19. <span class="spanClass">连续扫码</span>
  20. <el-checkbox v-model="query.isSeries" size="small" true-label="Y" false-label="N" />
  21. </div>
  22. <div class="query">
  23. <span class="spanClass">条码号</span>
  24. <el-input placeholder="条码号" v-model="query.patientRegisterNo" size="small" clearable style="width: 120px" />
  25. </div>
  26. <div class="query">
  27. <span class="spanClass">档案号</span>
  28. <el-input placeholder="档案号" v-model="query.patientNo" size="small" clearable style="width: 80px"
  29. @input="changeValue" />
  30. </div>
  31. <div class="query">
  32. <span class="spanClass">姓名</span>
  33. <el-input placeholder="姓名" v-model="query.patientName" size="small" clearable style="width: 60px" />
  34. </div>
  35. <div class="query">
  36. <span class="spanClass">检查条码</span>
  37. <el-input placeholder="检查条码" v-model="query.pacsNo" size="small" clearable style="width: 120px" />
  38. </div>
  39. <div class="query">
  40. <span class="spanClass">检验条码</span>
  41. <el-input placeholder="检验条码" v-model="query.lisNo" size="small" clearable style="width: 120px" />
  42. </div>
  43. <div class="query">
  44. <span class="spanClass">性别</span>
  45. <el-select v-model="query.sex" placeholder="性别" style="width: 50px" size="small" clearable>
  46. <el-option v-for="item in dict.sex" :key="item.id" :label="item.displayName" :value="item.id">
  47. </el-option>
  48. </el-select>
  49. </div>
  50. <div class="query">
  51. <span class="spanClass">手机号</span>
  52. <el-input placeholder="手机号/电话" v-model="query.phone" size="small" clearable style="width: 100px" />
  53. </div>
  54. <div class="query">
  55. <span class="spanClass">身份证</span>
  56. <el-input placeholder="身份证" v-model="query.idCardNo" size="small" clearable style="width: 150px" />
  57. </div>
  58. <div class="query">
  59. <el-tooltip class="item" effect="dark" content="单位作为查询条件" placement="top">
  60. <el-checkbox v-model="query.customerOrgFlag"></el-checkbox>
  61. </el-tooltip>
  62. <el-input placeholder="请选择单位" v-model="query.customerOrgName" size="small" disabled style="width: 120px" />
  63. <!--
  64. <el-cascader v-model="query.customerOrgId" :options="patientRegister.customerOrgTreeAll"
  65. :props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" placeholder="请选择单位"
  66. :show-all-levels="false" clearable :disabled="orgEnable == 'Y' ? false : true" size="small"
  67. style="width:120px;">
  68. </el-cascader>
  69. -->
  70. </div>
  71. <div v-show="dispTimes" class="query">
  72. <span class="spanClass">次数</span>
  73. <el-select v-model="query.customerOrgRegister" placeholder="次数" clearable @change="changeCustomerOrgRegister"
  74. style="width: 50px;" size="small" value-key="id">
  75. <el-option v-for="item in customerOrgRegisterList" :key="item.id" :label="item.medicalTimes" :value="item">{{
  76. item.medicalTimes + '次' }}</el-option>
  77. </el-select>
  78. </div>
  79. <div v-show="dispTimes" class="query">
  80. <span class="spanClass">分组</span>
  81. <el-select v-model="query.customerOrgGroupIds" placeholder="请选择" clearable filterable style="width: 150px"
  82. size="small" multiple collapse-tags>
  83. <el-option v-for="item in dict.customerOrgGroup" :key="item.id" :label="item.displayName" :value="item.id" />
  84. </el-select>
  85. </div>
  86. <div class="query">
  87. <span class="spanClass">体检类别</span>
  88. <el-select v-model="query.medicalTypeIds" placeholder="请选择" clearable filterable style="width: 170px"
  89. size="small" multiple collapse-tags>
  90. <el-option v-for="item in dict.medicalType" :key="item.id" :label="item.displayName" :value="item.id" />
  91. </el-select>
  92. </div>
  93. <div class="query">
  94. <span class="spanClass">状态</span>
  95. <el-select v-model="query.completeFlags" placeholder="请选择" clearable style="width: 100px" size="small" multiple
  96. collapse-tags>
  97. <el-option v-for="item in dict.completeFlag" :key="item.id" :label="item.displayName" :value="item.id">
  98. </el-option>
  99. </el-select>
  100. </div>
  101. <div class="query">
  102. <span class="spanClass">人员类别</span>
  103. <el-select v-model="query.personnelTypeIds" placeholder="请选择" clearable filterable style="width: 170px"
  104. size="small" multiple collapse-tags>
  105. <el-option v-for="item in dict.personnelType" :key="item.id" :label="item.displayName" :value="item.id" />
  106. </el-select>
  107. </div>
  108. <div class="query">
  109. <span class="spanClass">表回收</span>
  110. <el-select v-model="query.isRecoverGuide" placeholder="请选择" clearable style="width: 80px" size="small">
  111. <el-option label="未回收" value="N" />
  112. <el-option label="已回收" value="Y" />
  113. </el-select>
  114. </div>
  115. </div>
  116. <!-- 按钮区域 -->
  117. <div style="margin-left: 10px;margin-top: -10px;">
  118. <div class="listBtn">
  119. <el-button class="commonbutton" @click="btnQuery">查询</el-button>
  120. </div>
  121. <div v-show="checkPagePriv(pagePriv.privs, '读身份证')" class="listBtn">
  122. <el-button type="danger" class="commonbutton" @click="readIdCard">读身份证</el-button>
  123. </div>
  124. <div class="listBtn">
  125. <el-button type="danger" class="commonbutton" @click="btnClear">清除条件</el-button>
  126. </div>
  127. </div>
  128. </div>
  129. </template>
  130. <script>
  131. import { mapState } from "vuex";
  132. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  133. import { getPagePriv, checkPagePriv, parsIcCardtoLocal, deepCopy } from '../../utlis/proFunc'
  134. import moment from "moment";
  135. export default {
  136. components: {},
  137. props: ["orgEnable", "refParams"],
  138. data() {
  139. return {
  140. pagePriv: {
  141. routeUrlorPageName: 'patientRegister', //当前页面归属路由或归属页面权限名称
  142. privs: [] // 页面权限
  143. },
  144. dialogVisible: false,
  145. customerOrgRegisterList: [],
  146. query: { //查询条件
  147. queryType: '', // 条码号patientRegisterNo/档案号patientNo 等 排他查询
  148. dateType: 'creationTime', //登记日期
  149. dateRange: null, //日期范围
  150. startDate: null,
  151. endDate: null,
  152. containRefuse: true, //包含弃检项目
  153. times: 0, //触发查询次数
  154. customerOrgId: "", //体检单位ID
  155. customerOrgTopId: "", //单位顶级ID
  156. customerOrgFlag: true, //单位作为查询条件
  157. customerOrgRegister: { id: '' }, //单位体检次数
  158. customerOrgGroupIds: [], //体检分组
  159. checkAsbs: null,
  160. patientRegisterNo: '',
  161. pacsNo: '',
  162. lisNo: '',
  163. patientName: '', //姓名
  164. sex: '', //性别
  165. idCardNo: '', //身份证号
  166. isReportPrint: '', // 报告是否打印
  167. isSeries: 'N',
  168. isSmsComplete: "N",
  169. isPhoneComplete: "N",
  170. diagnosisLevelId: [],
  171. medicalTypeIds: [],
  172. completeFlags: [],
  173. medicalConclusionId: [],
  174. personnelTypeIds: [],
  175. isRecoverGuide: '',
  176. photo: '', // 参数控制 读身份证查询时,是否更新照片用
  177. },
  178. };
  179. },
  180. created() {
  181. //获取用户当前页面的权限
  182. let userPriv = window.sessionStorage.getItem('userPriv')
  183. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  184. let ldate = moment(new Date()).format('yyyy-MM-DD');
  185. this.query.startDate = ldate;
  186. this.query.endDate = ldate;
  187. this.query.dateType = '2'
  188. },
  189. //挂载完成
  190. mounted() {
  191. // 字典数据初始化
  192. this.dictInit()
  193. // 触发回车事件
  194. this.enterToQuery()
  195. },
  196. computed: {
  197. ...mapState(["pickerOptions", "window", "dict", "dataTransOpts", "customerOrg"]),
  198. dispTimes() {
  199. return this.query.customerOrgFlag && this.query.customerOrgId && this.query.customerOrgId != this.dict.personOrgId
  200. }
  201. },
  202. methods: {
  203. checkPagePriv,
  204. btnClear() {
  205. this.query.patientRegisterNo = ''
  206. this.query.patientNo = ''
  207. this.query.patientName = ''
  208. this.query.pacsNo = ''
  209. this.query.lisNo = ''
  210. this.query.sex = ''
  211. this.query.phone = ''
  212. this.query.idCardNo = ''
  213. this.query.medicalTypeIds = []
  214. this.query.completeFlags = []
  215. this.query.personnelTypeIds = []
  216. this.query.isRecoverGuide = ''
  217. },
  218. changeValue(e) {
  219. this.$forceUpdate()
  220. },
  221. // 字典数据初始化
  222. dictInit() {
  223. //体检类别
  224. getapi("/api/app/medical-type/in-filter").then((res) => {
  225. if (res.code > -1) {
  226. this.dict.medicalType = res.data;
  227. }
  228. });
  229. //人员类别
  230. getapi("/api/app/personnel-type/in-filter").then((res) => {
  231. if (res.code > -1) {
  232. this.dict.personnelType = res.data;
  233. }
  234. });
  235. },
  236. changeOrgId(customerOrgId) {
  237. if (!customerOrgId || customerOrgId == this.dict.personOrgId) {
  238. this.query.customerOrgRegister = null
  239. this.customerOrgRegisterList = []
  240. if (customerOrgId == this.dict.personOrgId) {
  241. let today = new Date()
  242. this.query.startDate = today
  243. this.query.endDate = today
  244. }
  245. return
  246. }
  247. this.query.customerOrgId = customerOrgId
  248. this.query.customerOrgName = this.refParams.customerOrgName
  249. // 获取顶级ID (优化无需获取顶级ID)
  250. if (this.refParams?.parentNodes.length > 1) {
  251. this.query.customerOrgTopId = this.refParams.parentNodes[1]
  252. } else {
  253. this.query.customerOrgTopId = customerOrgId
  254. }
  255. // getapi(`/api/app/customer-org/parent/${customerOrgId}`).then(res => {
  256. // if (res.code > - 1) {
  257. // = res.data
  258. // // 获取体检次数列表
  259. // return getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${this.query.customerOrgTopId}`)
  260. // }
  261. // })
  262. getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${this.query.customerOrgTopId}`)
  263. .then(res => {
  264. if (res && res.code > -1) {
  265. this.customerOrgRegisterList = res.data;
  266. if (res.data.length > 0) {
  267. this.query.customerOrgRegister = res.data[res.data.length - 1];
  268. this.changeCustomerOrgRegister(res.data[res.data.length - 1])
  269. }
  270. // this.query.times++
  271. // console.log('this.query.customerOrgRegister',this.query.customerOrgRegister)
  272. }
  273. });
  274. },
  275. //查询
  276. btnQuery(queryType) {
  277. this.query.queryType = queryType
  278. if(queryType != 'idCardNo') this.query.photo = ''
  279. this.$emit('triggerQuery', this.query)
  280. },
  281. // 选择体检次数
  282. changeCustomerOrgRegister(v) {
  283. // console.log('changeCustomerOrgRegister')
  284. this.query.startDate = new Date(v.beginTime)
  285. if (v.isComplete == 'Y') {
  286. this.query.endDate = new Date(v.endTime)
  287. } else {
  288. this.query.endDate = new Date()
  289. }
  290. if (v && v.id) this.getCustomerOrgGroup(v.id)
  291. },
  292. //获取体检次数下的分组
  293. getCustomerOrgGroup(customerOrgRegisterId) {
  294. // console.log('getCustomerOrgGroup')
  295. this.query.customerOrgGroupIds = []
  296. this.dict.customerOrgGroup = []
  297. // /api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${customerOrgRegisterId}`
  298. postapi('/api/app/CustomerOrgGroup/GetListForPatentRegisterByFilter', { customerOrgRegisterId }).then(res => {
  299. if (res.code > - 1) {
  300. this.dict.customerOrgGroup = res.data;
  301. this.$forceUpdate() // 强制视图更新(页面渲染)
  302. }
  303. })
  304. },
  305. //读身份证
  306. readIdCard() {
  307. if (!this.$peisAPI) {
  308. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  309. return
  310. }
  311. this.btnClear()
  312. this.$peisAPI.peopleIcCard().then(res => {
  313. console.log('peopleIcCard', res)
  314. let lres = JSON.parse(res)
  315. if (lres.code > -1) {
  316. let idNos = parsIcCardtoLocal(lres.data, this.dict.sex, this.dict.nation)
  317. // this.form.patientName = idNos.Name
  318. // this.form.birthDate = idNos.birthDate
  319. // this.form.sexId = idNos.sexId
  320. // this.form.age = idNos.age
  321. // this.form.nationId = idNos.nationId
  322. // this.form.idNo = idNos.IDCode
  323. // this.form.address = idNos.Address
  324. this.query.photo = 'data:image/bmp;base64,' + idNos.Photo //批量导入人员无照片,读身份证查询时,可以控制更新
  325. this.query.patientName = idNos.Name
  326. this.query.sex = idNos.sexId
  327. this.query.idCardNo = idNos.IDCode
  328. // 触发按身份证查询
  329. this.btnQuery('idCardNo')
  330. } else {
  331. this.$message.error({ showClose: true, message: lres.message })
  332. }
  333. })
  334. .catch(err => {
  335. this.$message.error({ showClose: true, message: `读取身份证失败,原因:${err}` })
  336. })
  337. },
  338. // 根据pacs条码查询
  339. onQueryByPacsNo(checkRequestNo) {
  340. postapi('/api/app/PatientRegister/GetPatientRegisterNoByCheckRequestNo', { checkRequestNo }).then(res => {
  341. if (res.code > 0) {
  342. this.query.patientRegisterNo = res.data.patientRegisterNo
  343. this.btnQuery("patientRegisterNo")
  344. }
  345. })
  346. },
  347. // 根据lis条码查询
  348. onQueryByLisNo(lisRequestNo) {
  349. postapi('/api/app/PatientRegister/GetPatientRegisterNoByLisRequestNo', { lisRequestNo }).then(res => {
  350. if (res.code > 0) {
  351. this.query.patientRegisterNo = res.data.patientRegisterNo
  352. this.btnQuery("patientRegisterNo")
  353. }
  354. })
  355. },
  356. //回车替代查询(取消)
  357. enterToQuery() {
  358. // console.log('enterToTab');
  359. this.$nextTick(() => {
  360. let inputs = document.querySelectorAll(["input"]); //用数组可以读取多个标签的元素 //.inline-input
  361. // 为每个输入框添加键盘事件监听器
  362. inputs.forEach((input, i) => {
  363. // console.log('input',input);
  364. input.addEventListener('keydown', (event) => {
  365. if (event.keyCode === 13) {
  366. // 阻止回车键的默认行为(换行)
  367. event.preventDefault();
  368. // 如果按下的是回车查询
  369. // console.log(input.getAttribute('placeholder'),input.value)
  370. let placeholder = input.getAttribute('placeholder')
  371. switch (placeholder) {
  372. case '条码号':
  373. if (input.value) this.btnQuery('patientRegisterNo')
  374. input.select()
  375. break;
  376. case '档案号':
  377. if (input.value) this.btnQuery('patientNo')
  378. input.select()
  379. break;
  380. case '姓名':
  381. if (input.value) this.btnQuery('patientName')
  382. input.select()
  383. break;
  384. //case '预约手机号':
  385. case '身份证':
  386. if (input.value) this.btnQuery('idCardNo')
  387. input.select()
  388. break;
  389. case '检查条码':
  390. if (input.value) this.onQueryByPacsNo(input.value)
  391. input.select()
  392. break;
  393. case '检验条码':
  394. if (input.value) this.onQueryByLisNo(input.value)
  395. input.select()
  396. break;
  397. }
  398. }
  399. });
  400. input.addEventListener('click', (event) => {
  401. let placeholder = input.getAttribute('placeholder')
  402. switch (placeholder) {
  403. case '条码号':
  404. case '档案号':
  405. case '姓名':
  406. case '预约手机号':
  407. case '身份证':
  408. case '检查条码':
  409. case '检验条码':
  410. input.select()
  411. break;
  412. }
  413. });
  414. });
  415. });
  416. },
  417. },
  418. watch: {
  419. "refParams.PatientRegisterQueryTimes": {
  420. // immediate: true,
  421. handler(newVal, oldVal) {
  422. console.log(`watch 体检单位切换 newVal:${newVal} oldVal:${oldVal}`, `customerOrgId: ${this.refParams.customerOrgId}`);
  423. if (newVal != oldVal) this.changeOrgId(this.refParams.customerOrgId)
  424. }
  425. },
  426. },
  427. }
  428. </script>
  429. <style scoped>
  430. @import "../../assets/css/global_button.css";
  431. @import "../../assets/css/global_input.css";
  432. @import "../../assets/css/global_font.css";
  433. .query {
  434. margin-right: 10px;
  435. font-size: 14px;
  436. color: #232748;
  437. font-weight: 400;
  438. font-family: "NotoSansSC-Regular";
  439. }
  440. .listBtn {
  441. margin-top: 5px;
  442. text-align: center;
  443. }
  444. .btnClass {
  445. /* position: absolute; */
  446. /* left: 0;
  447. top: 0; */
  448. width: 100px;
  449. }
  450. .spanClass {
  451. font-size: 14px;
  452. padding: 0 2px 0 0;
  453. }
  454. </style>