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.

504 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
2 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
2 years ago
2 years ago
2 years ago
3 months ago
2 years ago
2 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
4 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 months 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 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
3 months 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
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
5 months ago
3 months ago
2 years ago
3 months ago
3 years ago
3 months ago
3 months 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
3 months 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
3 months ago
2 years ago
2 years ago
2 years ago
3 months 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
3 months 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
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
2 years ago
2 years ago
3 months ago
2 years ago
3 months ago
2 years ago
2 years ago
2 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
2 years ago
2 years ago
2 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.sexId" 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. times: 0, //触发查询次数
  149. customerOrgTopId: "", //单位顶级ID
  150. isSeries: 'N', // 是否连续扫码
  151. photo: '', // 参数控制 读身份证查询时,是否更新照片用
  152. customerOrgName:'', //部门名称
  153. // 查询条件 ================== Start ======================
  154. dateType: '2', //体检日期
  155. startDate: null,
  156. endDate: null,
  157. customerOrgFlag: true, //单位作为查询条件
  158. customerOrgId: "", //体检单位ID
  159. customerOrgRegister: { id: '' }, //单位体检次数
  160. customerOrgGroupIds: [], //体检分组
  161. patientRegisterNo: '', //人员条码
  162. pacsNo: '', //检查条码
  163. lisNo: '', //检验条码
  164. patientNo:'', //档案号
  165. idCardNo: '', //身份证号
  166. patientName: '', //姓名
  167. phone:'', // 电话
  168. sexId: '', //性别
  169. medicalTypeIds: [], // 体检类别
  170. completeFlags: [], // 人员状态
  171. personnelTypeIds: [], //人员类别
  172. isRecoverGuide: '', //表格回收状态
  173. // 查询条件 ================== End ======================
  174. },
  175. };
  176. },
  177. created() {
  178. //获取用户当前页面的权限
  179. let userPriv = window.sessionStorage.getItem('userPriv')
  180. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  181. let ldate = moment(new Date()).format('yyyy-MM-DD');
  182. this.query.startDate = ldate;
  183. this.query.endDate = ldate;
  184. this.query.dateType = '2'
  185. },
  186. //挂载完成
  187. mounted() {
  188. // 字典数据初始化
  189. this.dictInit()
  190. // 触发回车事件
  191. this.enterToQuery()
  192. },
  193. computed: {
  194. ...mapState(["pickerOptions", "window", "dict", "dataTransOpts", "customerOrg"]),
  195. dispTimes() {
  196. return this.query.customerOrgFlag && this.query.customerOrgId && this.query.customerOrgId != this.dict.personOrgId
  197. }
  198. },
  199. methods: {
  200. checkPagePriv,
  201. btnClear() {
  202. this.query.patientRegisterNo = ''
  203. this.query.patientNo = ''
  204. this.query.patientName = ''
  205. this.query.pacsNo = ''
  206. this.query.lisNo = ''
  207. this.query.sexId = ''
  208. this.query.phone = ''
  209. this.query.idCardNo = ''
  210. this.query.medicalTypeIds = []
  211. this.query.completeFlags = []
  212. this.query.personnelTypeIds = []
  213. this.query.isRecoverGuide = ''
  214. },
  215. changeValue(e) {
  216. this.$forceUpdate()
  217. },
  218. // 字典数据初始化
  219. dictInit() {
  220. //体检类别
  221. getapi("/api/app/medical-type/in-filter").then((res) => {
  222. if (res.code > -1) {
  223. this.dict.medicalType = res.data;
  224. }
  225. });
  226. //人员类别
  227. getapi("/api/app/personnel-type/in-filter").then((res) => {
  228. if (res.code > -1) {
  229. this.dict.personnelType = res.data;
  230. }
  231. });
  232. },
  233. changeOrgId(customerOrgId) {
  234. this.query.customerOrgId = customerOrgId
  235. this.query.customerOrgName = this.refParams.customerOrgName
  236. if (!customerOrgId || customerOrgId == this.dict.personOrgId) {
  237. this.query.customerOrgTopId = this.dict.personOrgId
  238. this.query.customerOrgRegister = null
  239. this.customerOrgRegisterList = []
  240. if (customerOrgId == this.dict.personOrgId) {
  241. let today = moment(new Date()).format('yyyy-MM-DD')
  242. this.query.startDate = today
  243. this.query.endDate = today
  244. }
  245. return
  246. }
  247. // 获取顶级ID (优化无需获取顶级ID)
  248. if (this.refParams?.parentNodes.length > 1) {
  249. this.query.customerOrgTopId = this.refParams.parentNodes[1]
  250. } else {
  251. this.query.customerOrgTopId = customerOrgId
  252. }
  253. // getapi(`/api/app/customer-org/parent/${customerOrgId}`).then(res => {
  254. // if (res.code > - 1) {
  255. // = res.data
  256. // // 获取体检次数列表
  257. // return getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${this.query.customerOrgTopId}`)
  258. // }
  259. // })
  260. getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${this.query.customerOrgTopId}`)
  261. .then(res => {
  262. if (res && res.code > -1) {
  263. this.customerOrgRegisterList = res.data;
  264. if (res.data.length > 0) {
  265. this.query.customerOrgRegister = res.data[res.data.length - 1];
  266. this.changeCustomerOrgRegister(res.data[res.data.length - 1])
  267. }
  268. // this.query.times++
  269. // console.log('this.query.customerOrgRegister',this.query.customerOrgRegister)
  270. }
  271. });
  272. },
  273. btnQuery(){
  274. this.toQuery('')
  275. },
  276. //查询
  277. toQuery(queryType) {
  278. console.log('toQuery.queryType',queryType)
  279. this.query.queryType = queryType
  280. if(queryType != 'idCardNo') this.query.photo = ''
  281. this.$emit('triggerQuery', this.query)
  282. },
  283. // 选择体检次数
  284. changeCustomerOrgRegister(v) {
  285. // console.log('changeCustomerOrgRegister')
  286. this.query.startDate = moment(new Date(v.beginTime)).format('yyyy-MM-DD')
  287. if (v.isComplete == 'Y') {
  288. this.query.endDate = moment(new Date(v.endTime)).format('yyyy-MM-DD')
  289. } else {
  290. this.query.endDate = moment(new Date()).format('yyyy-MM-DD')
  291. }
  292. if (v && v.id) this.getCustomerOrgGroup(v.id)
  293. },
  294. //获取体检次数下的分组
  295. getCustomerOrgGroup(customerOrgRegisterId) {
  296. // console.log('getCustomerOrgGroup')
  297. this.query.customerOrgGroupIds = []
  298. this.dict.customerOrgGroup = []
  299. // /api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${customerOrgRegisterId}`
  300. postapi('/api/app/CustomerOrgGroup/GetListForPatentRegisterByFilter', { customerOrgRegisterId }).then(res => {
  301. if (res.code > - 1) {
  302. this.dict.customerOrgGroup = res.data;
  303. this.$forceUpdate() // 强制视图更新(页面渲染)
  304. }
  305. })
  306. },
  307. //读身份证
  308. readIdCard() {
  309. if (!this.$peisAPI) {
  310. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  311. return
  312. }
  313. this.btnClear()
  314. this.$peisAPI.peopleIcCard().then(res => {
  315. console.log('peopleIcCard', res)
  316. let lres = JSON.parse(res)
  317. if (lres.code > -1) {
  318. let idNos = parsIcCardtoLocal(lres.data, this.dict.sex, this.dict.nation)
  319. // this.form.patientName = idNos.Name
  320. // this.form.birthDate = idNos.birthDate
  321. // this.form.sexId = idNos.sexId
  322. // this.form.age = idNos.age
  323. // this.form.nationId = idNos.nationId
  324. // this.form.idNo = idNos.IDCode
  325. // this.form.address = idNos.Address
  326. this.query.photo = 'data:image/bmp;base64,' + idNos.Photo //批量导入人员无照片,读身份证查询时,可以控制更新
  327. this.query.patientName = idNos.Name
  328. this.query.sexId = idNos.sexId
  329. this.query.idCardNo = idNos.IDCode
  330. // 触发按身份证查询
  331. this.toQuery('idCardNo')
  332. } else {
  333. this.$message.error({ showClose: true, message: lres.message })
  334. }
  335. })
  336. .catch(err => {
  337. this.$message.error({ showClose: true, message: `读取身份证失败,原因:${err}` })
  338. })
  339. },
  340. // 根据pacs条码查询
  341. onQueryByPacsNo(checkRequestNo) {
  342. postapi('/api/app/PatientRegister/GetPatientRegisterNoByCheckRequestNo', { checkRequestNo }).then(res => {
  343. if (res.code > 0) {
  344. this.query.patientRegisterNo = res.data.patientRegisterNo
  345. this.toQuery("patientRegisterNo")
  346. }
  347. })
  348. },
  349. // 根据lis条码查询
  350. onQueryByLisNo(lisRequestNo) {
  351. postapi('/api/app/PatientRegister/GetPatientRegisterNoByLisRequestNo', { lisRequestNo }).then(res => {
  352. if (res.code > 0) {
  353. this.query.patientRegisterNo = res.data.patientRegisterNo
  354. this.toQuery("patientRegisterNo")
  355. }
  356. })
  357. },
  358. //回车替代查询(取消)
  359. enterToQuery() {
  360. // console.log('enterToTab');
  361. this.$nextTick(() => {
  362. let inputs = document.querySelectorAll(["input"]); //用数组可以读取多个标签的元素 //.inline-input
  363. // 为每个输入框添加键盘事件监听器
  364. inputs.forEach((input, i) => {
  365. // console.log('input',input);
  366. input.addEventListener('keydown', (event) => {
  367. if (event.keyCode === 13) {
  368. // 阻止回车键的默认行为(换行)
  369. event.preventDefault();
  370. // 如果按下的是回车查询
  371. // console.log(input.getAttribute('placeholder'),input.value)
  372. let placeholder = input.getAttribute('placeholder')
  373. switch (placeholder) {
  374. case '条码号':
  375. if (input.value) this.toQuery('patientRegisterNo')
  376. input.select()
  377. break;
  378. case '档案号':
  379. if (input.value) this.toQuery('patientNo')
  380. input.select()
  381. break;
  382. case '检查条码':
  383. if (input.value) this.onQueryByPacsNo(input.value)
  384. input.select()
  385. break;
  386. case '检验条码':
  387. if (input.value) this.onQueryByLisNo(input.value)
  388. input.select()
  389. break;
  390. //case '预约手机号':
  391. case '身份证':
  392. if (input.value) this.toQuery('idCardNo')
  393. input.select()
  394. break;
  395. case '姓名':
  396. if (input.value) this.toQuery('patientName')
  397. input.select()
  398. break;
  399. }
  400. }
  401. });
  402. input.addEventListener('click', (event) => {
  403. let placeholder = input.getAttribute('placeholder')
  404. switch (placeholder) {
  405. case '条码号':
  406. case '档案号':
  407. case '姓名':
  408. case '预约手机号':
  409. case '身份证':
  410. case '检查条码':
  411. case '检验条码':
  412. input.select()
  413. break;
  414. }
  415. });
  416. });
  417. });
  418. },
  419. },
  420. watch: {
  421. "refParams.PatientRegisterQueryTimes": {
  422. // immediate: true,
  423. handler(newVal, oldVal) {
  424. console.log(`watch 体检单位切换 newVal:${newVal} oldVal:${oldVal}`, `customerOrgId: ${this.refParams.customerOrgId}`);
  425. if (newVal != oldVal) this.changeOrgId(this.refParams.customerOrgId)
  426. }
  427. },
  428. },
  429. }
  430. </script>
  431. <style scoped>
  432. @import "../../assets/css/global_button.css";
  433. @import "../../assets/css/global_input.css";
  434. @import "../../assets/css/global_font.css";
  435. .query {
  436. margin-right: 10px;
  437. font-size: 14px;
  438. color: #232748;
  439. font-weight: 400;
  440. font-family: "NotoSansSC-Regular";
  441. }
  442. .listBtn {
  443. margin-top: 5px;
  444. text-align: center;
  445. }
  446. .btnClass {
  447. /* position: absolute; */
  448. /* left: 0;
  449. top: 0; */
  450. width: 100px;
  451. }
  452. .spanClass {
  453. font-size: 14px;
  454. padding: 0 2px 0 0;
  455. }
  456. </style>