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
8.7 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
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
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
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
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
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
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. },
  109. computed: {
  110. ...mapState(["window", "dict", "dataTransOpts", "patientRegister", "customerOrg"]),
  111. },
  112. methods: {
  113. checkPagePriv,
  114. init(customerOrgId) {
  115. if (!customerOrgId || customerOrgId == this.dict.personOrgId) {
  116. this.patientRegister.query.customerOrgRegister = null
  117. this.customerOrgRegisterList = []
  118. if (customerOrgId == this.dict.personOrgId) {
  119. let today = new Date()
  120. this.patientRegister.query.startDate = today
  121. this.patientRegister.query.endDate = today
  122. }
  123. return
  124. }
  125. getapi(`/api/app/customer-org/parent/${customerOrgId}`).then(res => {
  126. if (res.code != - 1) {
  127. return getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${res.data}`)
  128. }
  129. }).then(res => {
  130. if (res.code != -1) {
  131. this.customerOrgRegisterList = res.data;
  132. if (res.data.length > 0) {
  133. this.patientRegister.query.customerOrgRegister = res.data[res.data.length - 1];
  134. this.changeCustomerOrgRegister(res.data[res.data.length - 1])
  135. }
  136. // this.patientRegister.query.times++
  137. // console.log('this.patientRegister.query.customerOrgRegister',this.patientRegister.query.customerOrgRegister)
  138. }
  139. });
  140. },
  141. //查询
  142. btnQuery() {
  143. this.patientRegister.query.times++;
  144. console.log("this.patientRegister.query", this.patientRegister.query);
  145. },
  146. changeCustomerOrgRegister(v) {
  147. this.patientRegister.query.startDate = new Date(v.beginTime)
  148. if (v.isComplete == 'Y') {
  149. this.patientRegister.query.endDate = new Date(v.endTime)
  150. } else {
  151. this.patientRegister.query.endDate = new Date()
  152. }
  153. },
  154. //读身份证
  155. readIdCard() {
  156. if (!this.$peisAPI) {
  157. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  158. return
  159. }
  160. this.$peisAPI.peopleIcCard().then(res => {
  161. console.log('peopleIcCard', res)
  162. let lres = JSON.parse(res)
  163. if (lres.code > -1) {
  164. let idNos = parsIcCardtoLocal(lres.data, this.dict.sex, this.dict.nation)
  165. // this.form.patientName = idNos.Name
  166. // this.form.birthDate = idNos.birthDate
  167. // this.form.sexId = idNos.sexId
  168. // this.form.age = idNos.age
  169. // this.form.nationId = idNos.nationId
  170. // this.form.idNo = idNos.IDCode
  171. // this.form.address = idNos.Address
  172. // this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo
  173. this.patientRegister.query.patientName = idNos.Name
  174. this.patientRegister.query.sex = idNos.sexId
  175. this.patientRegister.query.idCardNo = idNos.IDCode
  176. } else {
  177. this.$message.error({ showClose: true, message: lres.message })
  178. }
  179. })
  180. .catch(err => {
  181. this.$message.error({ showClose: true, message: `读取身份证失败,原因:${err}` })
  182. })
  183. },
  184. },
  185. watch: {
  186. "dataTransOpts.plus.PatientRegisterEditQuery": {
  187. // immediate: true,
  188. handler(newVal, oldVal) {
  189. console.log(`watch 体检单位切换 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.patientRegister.query.customerOrgId}`);
  190. if (newVal != oldVal) this.init(this.patientRegister.query.customerOrgId)
  191. }
  192. },
  193. },
  194. }
  195. </script>
  196. <style scoped>
  197. @import "../../assets/css/global_button.css";
  198. @import "../../assets/css/global_input.css";
  199. @import "../../assets/css/global_font.css";
  200. .query {
  201. margin-right: 10px;
  202. font-size: 14px;
  203. color: #232748;
  204. font-weight: 400;
  205. font-family: "NotoSansSC-Regular";
  206. }
  207. .listBtn {
  208. margin-top: 5px;
  209. text-align: center;
  210. }
  211. .btnClass {
  212. /* position: absolute; */
  213. /* left: 0;
  214. top: 0; */
  215. width: 100px;
  216. }
  217. .spanClass {
  218. font-size: 14px;
  219. }
  220. </style>