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.

241 lines
7.2 KiB

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
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year 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>
  3. <!-- border: 1px solid #888;border-radius:5px;background-color: #F5F7FA; -->
  4. <div style="display: flex; flex-wrap: wrap; height:32px;">
  5. <div class="query">
  6. <!--
  7. <span class="querySpan">查找&nbsp;&nbsp;条码号</span>
  8. -->
  9. <el-input placeholder="条码号" v-model="query.patientRegisterNo" size="small"
  10. clearable style="width: 140px"/>
  11. </div>
  12. <div class="query">
  13. <!--
  14. <span class="querySpan">档案号</span>
  15. -->
  16. <el-input placeholder="档案号" v-model="query.patientNo" size="small"
  17. clearable style="width: 100px" />
  18. </div>
  19. <div class="query">
  20. <!--
  21. <span class="querySpan">姓名</span>
  22. -->
  23. <el-input placeholder="姓名" v-model="query.patientName" size="small"
  24. clearable style="width: 80px"/>
  25. </div>
  26. <div class="query">
  27. <!--
  28. <span class="querySpan">手机号</span>
  29. -->
  30. <el-input placeholder="手机号" v-model="query.tel" size="small"
  31. clearable style="width: 120px"/>
  32. </div>
  33. </div>
  34. <!-- 体检人员记录列表 -->
  35. <el-dialog title="体检人员列表" :visible.sync="dialogWin.PatientRegisterForChoose" width="800px" :show-close="false" :close-on-click-modal="false"
  36. :append-to-body="true">
  37. <PatientRegisterForChoose :params="PatientRegisterList"/>
  38. </el-dialog>
  39. </div>
  40. </template>
  41. <script>
  42. import { mapState, mapActions } from "vuex";
  43. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  44. import { getPagePriv,checkPagePriv, objCopy, setNull, dddw,checkIDCode, parseID, birthdayToAge,ageToBirthday, deepCopy, arrayFilter, arrayReduce,parsIcCardtoLocal, photoParse, savePeoplePhoto, arrayExistObj } from "../../utlis/proFunc";
  45. import PatientRegisterForChoose from "./PatientRegisterForChoose.vue";
  46. export default {
  47. components: {
  48. PatientRegisterForChoose
  49. },
  50. data() {
  51. return {
  52. query: {
  53. patientRegisterNo: '',
  54. patientNo: '',
  55. patientName: '',
  56. tel: ''
  57. },
  58. PatientRegisterList:[],
  59. };
  60. },
  61. created() {
  62. },
  63. //挂载完成
  64. mounted() {
  65. this.enterToQuery()
  66. },
  67. computed: {
  68. ...mapState(["dialogWin","dataTransOpts"]),
  69. },
  70. methods: {
  71. //回车替代查询
  72. enterToQuery() {
  73. // console.log('enterToTab');
  74. this.$nextTick(() => {
  75. let inputs = document.querySelectorAll(["input"]); //用数组可以读取多个标签的元素 //.inline-input
  76. // 为每个输入框添加键盘事件监听器
  77. inputs.forEach((input,i) => {
  78. // console.log('input',input);
  79. input.addEventListener('keydown', (event) => {
  80. if (event.keyCode === 13){
  81. // 阻止回车键的默认行为(换行)
  82. event.preventDefault();
  83. // 如果按下的是回车查询
  84. console.log(input.getAttribute('placeholder'),input.value)
  85. let placeholder = input.getAttribute('placeholder')
  86. switch (placeholder) {
  87. case '条码号':
  88. if(input.value) this.quickQuery('patientRegisterNo')
  89. break;
  90. case '档案号':
  91. if(input.value) this.quickQuery('patientNo')
  92. break;
  93. case '姓名':
  94. if(input.value) this.quickQuery('patientName')
  95. break;
  96. case '手机号':
  97. if(input.value) this.quickQuery('tel')
  98. break;
  99. }
  100. }
  101. });
  102. });
  103. });
  104. },
  105. //快速查找个人数据
  106. quickQuery(type) {
  107. let url1 = '/api/app/patientregister/getpatientregisterorpatient'
  108. let body={}
  109. let url2 = '/api/app/patientregister/getlistinfilter'
  110. switch (type) {
  111. case 'patientNo':
  112. if(!this.query.patientNo) return;
  113. body = {
  114. sType:2,
  115. patientNo:this.query.patientNo
  116. }
  117. this.getpatientregisterorpatient(url1,body)
  118. break;
  119. case 'patientRegisterNo':
  120. if(!this.query.patientRegisterNo) return;
  121. body = {
  122. sType:1,
  123. patientRegisterNo:this.query.patientRegisterNo
  124. }
  125. this.getpatientregisterorpatient(url1,body)
  126. break;
  127. case 'tel':
  128. if(!this.query.tel) return;
  129. body = {
  130. phone:this.query.tel
  131. }
  132. this.getlistinfilter(body);
  133. break;
  134. case 'patientName':
  135. if(!this.query.patientName) return;
  136. body = {
  137. patientName:this.query.patientName
  138. }
  139. this.getlistinfilter(body);
  140. break;
  141. default:
  142. return;
  143. }
  144. },
  145. //按流水号或档案号查客户信息
  146. getpatientregisterorpatient(url,body){
  147. postapi(url,body)
  148. .then((res) => {
  149. console.log('getpatientregisterorpatient', res)
  150. if (res.code == 1) {
  151. objCopy(res.data, this.form)
  152. this.dataTransOpts.tableS.patient_register.id = res.data.id
  153. setTimeout(() => {
  154. this.dataTransOpts.refresh.patient_register.S++
  155. }, 10);
  156. // this.patientRegister.patientRegisterId = res.data.id
  157. // this.patientRegister.photo = res.data.photo
  158. // this.getPatientRegisterAbs(res.data.id)
  159. }else if(res.code == 0){
  160. this.$message.info({ showClose: true, message: "未找到相关信息"})
  161. }
  162. });
  163. },
  164. //按手机号或姓名查找客户信息
  165. getlistinfilter(body){
  166. postapi('/api/app/patientregister/getlistinfilter', body)
  167. .then(res => {
  168. if (res.code != -1) {
  169. if (res.data.items.length == 1) {
  170. this.dataTransOpts.tableS.patient_register.id = res.data.items[0].id
  171. setTimeout(() => {
  172. this.dataTransOpts.refresh.patient_register.S++
  173. }, 10);
  174. // this.getPatientRegister(res.data.items[0].id)
  175. } else if (res.data.items.length > 1) {
  176. this.PatientRegisterList = res.data.items
  177. this.dialogWin.PatientRegisterForChoose = true // 弹窗
  178. this.dataTransOpts.plus.PatientRegisterForChoose++
  179. } else {
  180. this.dataTransOpts.tableS.patient_register.id = ''
  181. setTimeout(() => {
  182. this.dataTransOpts.refresh.patient_register.S++
  183. }, 10);
  184. }
  185. }
  186. })
  187. },
  188. },
  189. //监听事件
  190. watch: {
  191. // 清空查询条件
  192. "dataTransOpts.plus.clearPatientRegisterQuery":{
  193. immediate:true,
  194. handler(newVal, oldVal) {
  195. console.log(`watch 清空查询条件 newVal:${newVal} oldVal:${oldVal}`);
  196. this.query.patientRegisterNo = ''
  197. this.query.patientNo = ''
  198. this.query.patientName = ''
  199. this.query.tel = ''
  200. }
  201. },
  202. },
  203. };
  204. </script>
  205. <style scoped>
  206. .btn {
  207. margin-top: 5px;
  208. }
  209. .commonbutton {
  210. width: 100px;
  211. }
  212. .query {
  213. margin-left: 10px;
  214. }
  215. .querySpan {
  216. margin-right: 2px;
  217. }
  218. </style>