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.

379 lines
14 KiB

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