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.

281 lines
10 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
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
3 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
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
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
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
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
  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. <span class="spanClass">登记日期</span>
  7. <el-date-picker v-model="patientRegister.query.startDate" type="date" placeholder="起始日期" size="small"
  8. style="width:90px;" value-format="yyyy-MM-dd" />
  9. <span class="spanClass"></span>
  10. <el-date-picker v-model="patientRegister.query.endDate" type="date" placeholder="截止日期" size="small"
  11. style="width:90px;" value-format="yyyy-MM-dd" />
  12. </div>
  13. <div class="query">
  14. <span class="spanClass">条码号</span>
  15. <el-input placeholder="条码号" v-model="patientRegister.query.patientRegisterNo" size="small" clearable
  16. style="width: 130px" />
  17. </div>
  18. <div class="query">
  19. <span class="spanClass">档案号</span>
  20. <el-input placeholder="档案号" v-model="patientRegister.query.patientNo" size="small" clearable
  21. style="width: 110px" />
  22. </div>
  23. <div class="query">
  24. <span class="spanClass">姓名</span>
  25. <el-input placeholder="姓名" v-model="patientRegister.query.patientName" size="small" clearable
  26. style="width: 80px" />
  27. </div>
  28. <div class="query">
  29. <span class="spanClass">性别</span>
  30. <el-select v-model="patientRegister.query.sex" placeholder="请选择" style="width: 80px" size="small">
  31. <el-option v-for="item in dict.forSex" :key="item.id" :label="item.displayName" :value="item.id">
  32. </el-option>
  33. </el-select>
  34. </div>
  35. <div class="query">
  36. <span class="spanClass">手机号</span>
  37. <el-input placeholder="手机号/电话" v-model="patientRegister.query.phone" size="small" clearable
  38. style="width: 100px" />
  39. </div>
  40. <div class="query">
  41. <span class="spanClass">身份证号</span>
  42. <el-input placeholder="身份证号" v-model="patientRegister.query.idCardNo" size="small" clearable
  43. style="width: 150px" />
  44. </div>
  45. <div class="query">
  46. <el-checkbox v-model="patientRegister.query.customerOrgFlag">单位作为查询条件</el-checkbox>
  47. <el-cascader v-model="patientRegister.query.customerOrgId" :options="patientRegister.customerOrgTreeAll"
  48. :props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" placeholder="请选择单位"
  49. :show-all-levels="false" clearable :disabled="orgEnable == 'Y' ? false : true" size="small"
  50. style="width:120px;">
  51. </el-cascader>
  52. </div>
  53. <div class="query">
  54. <span class="spanClass">次数</span>
  55. <el-select v-model="patientRegister.query.customerOrgRegister" placeholder="次数"
  56. @change="changeCustomerOrgRegister" style="width: 60px;" size="small" value-key="id">
  57. <el-option v-for="item in customerOrgRegisterList" :key="item.id" :label="item.medicalTimes" :value="item" />
  58. </el-select>
  59. </div>
  60. <div class="query">
  61. <span class="spanClass">状态</span>
  62. <el-select v-model="patientRegister.query.completeFlag" placeholder="请选择" clearable style="width: 80px"
  63. size="small">
  64. <el-option v-for="item in dict.completeFlag" :key="item.id" :label="item.displayName" :value="item.id">
  65. </el-option>
  66. </el-select>
  67. </div>
  68. </div>
  69. <!-- 按钮区域 -->
  70. <div style="margin-left: 10px;">
  71. <div v-show="checkPagePriv(pagePriv.privs, '查询')" class="listBtn">
  72. <el-button class="commonbutton" @click="btnQuery">查询</el-button>
  73. </div>
  74. <div v-show="checkPagePriv(pagePriv.privs, '读身份证')" class="listBtn">
  75. <el-button type="danger" class="commonbutton" @click="readIdCard">读身份证</el-button>
  76. </div>
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. import { mapState } from "vuex";
  82. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  83. import { getPagePriv, checkPagePriv, parsIcCardtoLocal, deepCopy } from '../../utlis/proFunc'
  84. export default {
  85. components: {},
  86. props: ["orgEnable"],
  87. data() {
  88. return {
  89. pagePriv: {
  90. routeUrlorPageName: 'patientRegister', //当前页面归属路由或归属页面权限名称
  91. privs: [] // 页面权限
  92. },
  93. dialogVisible: false,
  94. customerOrgRegisterList: [],
  95. };
  96. },
  97. created() {
  98. //获取用户当前页面的权限
  99. let userPriv = window.sessionStorage.getItem('userPriv')
  100. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  101. let ldate = new Date();
  102. this.patientRegister.query.startDate = ldate;
  103. this.patientRegister.query.endDate = ldate;
  104. },
  105. //挂载完成
  106. mounted() {
  107. this.init(this.patientRegister.query.customerOrgId)
  108. this.enterToQuery()
  109. },
  110. computed: {
  111. ...mapState(["window", "dict", "dataTransOpts", "patientRegister", "customerOrg"]),
  112. },
  113. methods: {
  114. checkPagePriv,
  115. init(customerOrgId) {
  116. if (!customerOrgId || customerOrgId == this.dict.personOrgId) {
  117. this.patientRegister.query.customerOrgRegister = null
  118. this.customerOrgRegisterList = []
  119. if (customerOrgId == this.dict.personOrgId) {
  120. let today = new Date()
  121. this.patientRegister.query.startDate = today
  122. this.patientRegister.query.endDate = today
  123. }
  124. return
  125. }
  126. getapi(`/api/app/customer-org/parent/${customerOrgId}`).then(res => {
  127. if (res.code != - 1) {
  128. return getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${res.data}`)
  129. }
  130. }).then(res => {
  131. if (res.code != -1) {
  132. this.customerOrgRegisterList = res.data;
  133. if (res.data.length > 0) {
  134. this.patientRegister.query.customerOrgRegister = res.data[res.data.length - 1];
  135. this.changeCustomerOrgRegister(res.data[res.data.length - 1])
  136. }
  137. // this.patientRegister.query.times++
  138. // console.log('this.patientRegister.query.customerOrgRegister',this.patientRegister.query.customerOrgRegister)
  139. }
  140. });
  141. },
  142. //查询
  143. btnQuery() {
  144. this.patientRegister.query.times++;
  145. console.log("this.patientRegister.query", this.patientRegister.query);
  146. },
  147. changeCustomerOrgRegister(v) {
  148. this.patientRegister.query.startDate = new Date(v.beginTime)
  149. if (v.isComplete == 'Y') {
  150. this.patientRegister.query.endDate = new Date(v.endTime)
  151. } else {
  152. this.patientRegister.query.endDate = new Date()
  153. }
  154. },
  155. //读身份证
  156. readIdCard() {
  157. if (!this.$peisAPI) {
  158. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  159. return
  160. }
  161. this.$peisAPI.peopleIcCard().then(res => {
  162. console.log('peopleIcCard', res)
  163. let lres = JSON.parse(res)
  164. if (lres.code > -1) {
  165. let idNos = parsIcCardtoLocal(lres.data, this.dict.sex, this.dict.nation)
  166. // this.form.patientName = idNos.Name
  167. // this.form.birthDate = idNos.birthDate
  168. // this.form.sexId = idNos.sexId
  169. // this.form.age = idNos.age
  170. // this.form.nationId = idNos.nationId
  171. // this.form.idNo = idNos.IDCode
  172. // this.form.address = idNos.Address
  173. // this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo
  174. this.patientRegister.query.patientName = idNos.Name
  175. this.patientRegister.query.sex = idNos.sexId
  176. this.patientRegister.query.idCardNo = idNos.IDCode
  177. this.patientRegister.query.times++;
  178. } else {
  179. this.$message.error({ showClose: true, message: lres.message })
  180. }
  181. })
  182. .catch(err => {
  183. this.$message.error({ showClose: true, message: `读取身份证失败,原因:${err}` })
  184. })
  185. },
  186. //回车替代查询
  187. enterToQuery() {
  188. // console.log('enterToTab');
  189. this.$nextTick(() => {
  190. let inputs = document.querySelectorAll(["input"]); //用数组可以读取多个标签的元素 //.inline-input
  191. // 为每个输入框添加键盘事件监听器
  192. inputs.forEach((input,i) => {
  193. // console.log('input',input);
  194. input.addEventListener('keydown', (event) => {
  195. if (event.keyCode === 13){
  196. // 阻止回车键的默认行为(换行)
  197. event.preventDefault();
  198. // 如果按下的是回车查询
  199. console.log(input.getAttribute('placeholder'),input.value)
  200. let placeholder = input.getAttribute('placeholder')
  201. switch (placeholder) {
  202. case '条码号':
  203. case '档案号':
  204. case '姓名':
  205. case '预约手机号':
  206. case '身份证号':
  207. if(input.value) this.patientRegister.query.times++;
  208. break;
  209. }
  210. input.select()
  211. }
  212. });
  213. input.addEventListener('click', (event) => {
  214. input.select()
  215. });
  216. });
  217. });
  218. },
  219. },
  220. watch: {
  221. "dataTransOpts.plus.PatientRegisterEditQuery": {
  222. // immediate: true,
  223. handler(newVal, oldVal) {
  224. console.log(`watch 体检单位切换 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.patientRegister.query.customerOrgId}`);
  225. if (newVal != oldVal) this.init(this.patientRegister.query.customerOrgId)
  226. }
  227. },
  228. },
  229. }
  230. </script>
  231. <style scoped>
  232. @import "../../assets/css/global_button.css";
  233. @import "../../assets/css/global_input.css";
  234. @import "../../assets/css/global_font.css";
  235. .query {
  236. margin-right: 10px;
  237. font-size: 14px;
  238. color: #232748;
  239. font-weight: 400;
  240. font-family: "NotoSansSC-Regular";
  241. }
  242. .listBtn {
  243. margin-top: 5px;
  244. text-align: center;
  245. }
  246. .btnClass {
  247. /* position: absolute; */
  248. /* left: 0;
  249. top: 0; */
  250. width: 100px;
  251. }
  252. .spanClass {
  253. font-size: 14px;
  254. }
  255. </style>