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.

440 lines
17 KiB

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