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.

165 lines
5.8 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
  1. <template>
  2. <div style="display: flex">
  3. <div style="display: flex; flex-wrap: wrap; height:100px;">
  4. <div class="query">
  5. <span>体检单位/次数</span>
  6. <el-cascader v-model="patientRegister.query.customerOrgId" :options="patientRegister.customerOrgTreeAll"
  7. :props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" placeholder="请选择单位"
  8. :show-all-levels="false" clearable size="small" @change="changeCustomerOrgId" style="width:180px;">
  9. </el-cascader>
  10. <el-select v-model="patientRegister.query.customerOrgRegister" placeholder="次数" style="width: 60px" size="small"
  11. :disabled="patientRegister.query.customerOrgId == dict.personOrgId" @change="changeMedicalTimes" value-key="id">
  12. <el-option v-for="item in customerOrg.customerOrgRegisterList" :key="item.id" :label="item.medicalTimes"
  13. :value="item" />
  14. </el-select>
  15. </div>
  16. <div class="query">
  17. <el-select v-model="patientRegister.query.dateType" placeholder="请选择" filterable clearable size="small"
  18. style="width: 100px">
  19. <el-option label="登记日期" value="creationTime" />
  20. <el-option label="体检日期" value="medicalStartDate" />
  21. <el-option label="总检日期" value="summaryDate" />
  22. </el-select>
  23. <el-date-picker v-model="patientRegister.query.dateRange" type="daterange" align="right" unlink-panels
  24. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" size="small"
  25. style="width: 240px">
  26. </el-date-picker>
  27. </div>
  28. <div class="query">
  29. <span>条码号</span>
  30. <el-input placeholder="条码号" v-model="patientRegister.query.patientRegisterNo" size="small" clearable
  31. style="width: 150px" />
  32. </div>
  33. <div class="query">
  34. <span>档案号</span>
  35. <el-input placeholder="档案号" v-model="patientRegister.query.patientNo" size="small" clearable
  36. style="width: 135px" />
  37. </div>
  38. <div class="query">
  39. <span>姓名</span>
  40. <el-input placeholder="姓名" v-model="patientRegister.query.patientName" size="small" clearable
  41. style="width: 100px" />
  42. </div>
  43. <div class="query">
  44. <span>性别</span>
  45. <el-select v-model="patientRegister.query.sex" placeholder="请选择" style="width: 80px" size="small">
  46. <el-option v-for="item in dict.sex" :key="item.id" :label="item.displayName" :value="item.id" />
  47. </el-select>
  48. </div>
  49. <div class="query">
  50. <span>身份证号</span>
  51. <el-input placeholder="身份证号" v-model="patientRegister.query.idCardNo" size="small" clearable
  52. style="width: 180px" />
  53. </div>
  54. <div class="query">
  55. <span>状态</span>
  56. <el-select v-model="patientRegister.query.completeFlag" placeholder="请选择" clearable style="width: 80px"
  57. size="small">
  58. <el-option v-for="item in dict.completeFlag" :key="item.id" :label="item.displayName" :value="item.id">
  59. </el-option>
  60. </el-select>
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import { mapState } from "vuex";
  67. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  68. export default {
  69. components: {},
  70. props: ["orgEnable"],
  71. data() {
  72. return {
  73. dialogVisible: false,
  74. pickerOptions: {
  75. shortcuts: [
  76. {
  77. text: "最近一周",
  78. onClick(picker) {
  79. const end = new Date();
  80. const start = new Date();
  81. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  82. picker.$emit("pick", [start, end]);
  83. },
  84. },
  85. {
  86. text: "最近一个月",
  87. onClick(picker) {
  88. const end = new Date();
  89. const start = new Date();
  90. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  91. picker.$emit("pick", [start, end]);
  92. },
  93. },
  94. {
  95. text: "最近三个月",
  96. onClick(picker) {
  97. const end = new Date();
  98. const start = new Date();
  99. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  100. picker.$emit("pick", [start, end]);
  101. },
  102. },
  103. ],
  104. },
  105. };
  106. },
  107. created() { },
  108. //挂载完成
  109. mounted() { },
  110. computed: {
  111. ...mapState(["window", "dict", "patientRegister", "customerOrg"]),
  112. },
  113. methods: {
  114. //选择单位
  115. changeCustomerOrgId(v) {
  116. console.log(v)
  117. if (!v) {
  118. this.patientRegister.query.customerOrgRegister = null;
  119. return;
  120. }
  121. let customerOrgId = v[0];
  122. if (customerOrgId == this.dict.personOrgId) {
  123. this.patientRegister.query.customerOrgRegister = null;
  124. return;
  125. }
  126. getapi(
  127. `/api/app/customer-org-register/in-customer-org-id/${customerOrgId}`
  128. ).then((res) => {
  129. //console.log('res.data',res.data)
  130. if (res.code != -1) {
  131. this.customerOrg.customerOrgRegisterList = res.data;
  132. if (res.data.length > 0) {
  133. this.patientRegister.query.customerOrgRegister = res.data[res.data.length - 1];
  134. this.patientRegister.query.dateRange = [
  135. res.data[res.data.length - 1].beginTime,
  136. res.data[res.data.length - 1].isComplete == 'N' ? new Date() : res.data[res.data.length - 1].endTime
  137. ]
  138. }
  139. }
  140. });
  141. },
  142. //选择单位体检次数是,更新起止日期
  143. changeMedicalTimes(v){
  144. this.patientRegister.query.customerOrgRegister = v;
  145. this.patientRegister.query.dateRange = [
  146. v.beginTime,
  147. v.isComplete == 'N' ? new Date() : v.endTime
  148. ];
  149. }
  150. },
  151. };
  152. </script>
  153. <style scoped>
  154. .query {
  155. margin-left: 10px;
  156. }
  157. </style>