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.

154 lines
5.3 KiB

2 years ago
  1. <template>
  2. <div style="display: flex">
  3. <div style="display: flex; flex-wrap: wrap; height:80px;">
  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: 215px">
  26. </el-date-picker>
  27. </div>
  28. <div class="query">
  29. <span>组合项目</span>
  30. <el-select v-model="patientRegister.query.checkAsbs" multiple collapse-tags filterable clearable placeholder="请选择"
  31. size="small" >
  32. <el-option v-for="item in dict.asbItemAll" :key="item.value" :label="item.displayName" :value="item.id"/>
  33. </el-select>
  34. </div>
  35. <div class="query">
  36. <span>状态</span>
  37. <el-select v-model="patientRegister.query.checkCompleteFlag" placeholder="请选择" clearable style="width: 80px"
  38. size="small">
  39. <el-option v-for="item in dict.checkCompleteFlag" :key="item.id" :label="item.displayName" :value="item.id">
  40. </el-option>
  41. </el-select>
  42. </div>
  43. <div class="query">
  44. <el-button type="primary" class="btnClass" @click="btnQuery" size="small">查询</el-button>
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { mapState } from "vuex";
  51. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  52. export default {
  53. components: {},
  54. props: ["orgEnable"],
  55. data() {
  56. return {
  57. dialogVisible: false,
  58. pickerOptions: {
  59. shortcuts: [
  60. {
  61. text: "最近一周",
  62. onClick(picker) {
  63. const end = new Date();
  64. const start = new Date();
  65. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  66. picker.$emit("pick", [start, end]);
  67. },
  68. },
  69. {
  70. text: "最近一个月",
  71. onClick(picker) {
  72. const end = new Date();
  73. const start = new Date();
  74. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  75. picker.$emit("pick", [start, end]);
  76. },
  77. },
  78. {
  79. text: "最近三个月",
  80. onClick(picker) {
  81. const end = new Date();
  82. const start = new Date();
  83. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  84. picker.$emit("pick", [start, end]);
  85. },
  86. },
  87. ],
  88. },
  89. };
  90. },
  91. created() { },
  92. //挂载完成
  93. mounted() { },
  94. computed: {
  95. ...mapState(["window", "dict", "patientRegister", "customerOrg"]),
  96. },
  97. methods: {
  98. //选择单位
  99. changeCustomerOrgId(v) {
  100. console.log(v)
  101. if (!v) {
  102. this.patientRegister.query.customerOrgRegister = null;
  103. return;
  104. }
  105. let customerOrgId = v[0];
  106. if (customerOrgId == this.dict.personOrgId) {
  107. this.patientRegister.query.customerOrgRegister = null;
  108. return;
  109. }
  110. getapi(
  111. `/api/app/customer-org-register/in-customer-org-id/${customerOrgId}`
  112. ).then((res) => {
  113. //console.log('res.data',res.data)
  114. if (res.code != -1) {
  115. this.customerOrg.customerOrgRegisterList = res.data;
  116. if (res.data.length > 0) {
  117. this.patientRegister.query.customerOrgRegister = res.data[res.data.length - 1];
  118. this.patientRegister.query.dateRange = [
  119. res.data[res.data.length - 1].beginTime,
  120. res.data[res.data.length - 1].isComplete == 'N' ? new Date() : res.data[res.data.length - 1].endTime
  121. ]
  122. }
  123. }
  124. });
  125. },
  126. //选择单位体检次数是,更新起止日期
  127. changeMedicalTimes(v){
  128. this.patientRegister.query.customerOrgRegister = v;
  129. this.patientRegister.query.dateRange = [
  130. v.beginTime,
  131. v.isComplete == 'N' ? new Date() : v.endTime
  132. ];
  133. },
  134. btnQuery(){
  135. console.log('query',this.patientRegister.query);
  136. this.patientRegister.query.times++;
  137. }
  138. },
  139. };
  140. </script>
  141. <style scoped>
  142. .query {
  143. margin-left: 10px;
  144. }
  145. </style>