TargetScoreSummary.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <div class="layout_display_flex_y">
  3. <div style="background-color: #fff; margin-bottom: 5px">
  4. <el-select v-model="reportCycle" placeholder="请选择年度周期" style="width: 200px" v-if="showCycle">
  5. <el-option v-for="item in reportCycleList" :key="item.reportCycle"
  6. :label="item.yearRange" :value="item.reportCycle" selected>
  7. <span style="float: left">{{ item.yearRange }}</span>
  8. <span style="float: right; padding-left: 4px; color: var(--el-text-color-secondary); font-size: 13px;">
  9. {{ item.remark }}</span>
  10. </el-option>
  11. </el-select>
  12. <el-date-picker v-model="dateRange" type="monthrange" range-separator="至" start-placeholder="开始月份" format="YYYYMM" value-format="YYYYMM"
  13. end-placeholder="结束月份" :shortcuts="monthShortcuts" style="width: 360px;margin-left: 3px" v-if="showDate">
  14. </el-date-picker>
  15. <el-cascader v-model="targetInfo" :options="targetTreeData" style="width: 400px" :show-all-levels="false"
  16. :props="{ value: 'id', label: 'label', children: 'children', expandTrigger: 'hover' }"
  17. :clearable="true" :filterable="true" placeholder="请选择指标">
  18. </el-cascader>
  19. <el-select v-model="ks" placeholder="请选择科室" filterable clearable style="width: 240px">
  20. <el-option v-for="item in deptWardList" :key="item.code"
  21. :label="item.name" :value="item.code" selected>
  22. <span style="float: left">{{ item.code }}</span>
  23. <span style="float: right; padding-left: 4px; color: var(--el-text-color-secondary); font-size: 13px;">
  24. {{ item.name }}</span>
  25. </el-option>
  26. </el-select>
  27. <el-button type="primary" icon="Search" @click="queryTargetScoreSummaryInfo" style="margin-left: 10px">查询</el-button>
  28. <!-- <el-button type="primary" icon="Download" @click="exportData" style="margin-left: 5px">导出</el-button>-->
  29. </div>
  30. <div class="layout_display_flex_y">
  31. <el-tabs class="el-tabs__fill" v-model="editableTabsValue" type="border-card" @tab-click="handleClick">
  32. <el-tab-pane key="yearScore" label="周期年度得分" name="yearScore">
  33. <div class="layout_display_flex_y layout_el-table">
  34. <div class="layout_flex_1-y">
  35. <el-table :data="targetYearScoreSummaryData.slice(pageSize * (currentPage - 1), pageSize * currentPage)"
  36. stripe border highlight-current-row row-key="id" style="width: 100%" height="100%"
  37. :expand-row-keys="expands" @expand-change="expandCharge" @row-dblclick="scoreComparison">
  38. <el-table-column type="expand">
  39. <template #default="scope">
  40. <div m="4" style="margin-left: 5px">
  41. <h3>得分结果明细</h3>
  42. <el-table :data="scope.row.results" :row-key="scope.row.id" stripe border highlight-current-row>
  43. <el-table-column type="index" header-align="center" />
  44. <el-table-column prop="year" label="年份" header-align="center" />
  45. <el-table-column prop="dataType" label="数据方式" header-align="center">
  46. <template #default="scope">
  47. {{ '1' === scope.row.dataType ? 'sql统计' : '手动输入' }}
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="childResult" label="分子结果" header-align="center" />
  51. <el-table-column prop="momResult" label="分母结果" header-align="center" />
  52. <el-table-column prop="calcResult" label="计算结果" header-align="center" />
  53. <el-table-column prop="op" label="统计人员" header-align="center" />
  54. <el-table-column prop="opTime" label="统计时间" header-align="center" width="200" />
  55. </el-table>
  56. </div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="id" label="指标id" v-if="false"></el-table-column>
  60. <el-table-column prop="deptCode" label="科室id" v-if="false"></el-table-column>
  61. <el-table-column prop="name" label="指标名称" width="360" show-overflow-tooltip></el-table-column>
  62. <el-table-column prop="dept" label="责任科室"></el-table-column>
  63. <el-table-column prop="op" label="责任人"></el-table-column>
  64. <el-table-column prop="remark" label="周期"></el-table-column>
  65. <el-table-column prop="yearRange" label="年度"></el-table-column>
  66. <el-table-column prop="criterionScore" label="周期年度总分"></el-table-column>
  67. <el-table-column prop="reportScore" label="周期年度得分"></el-table-column>
  68. </el-table>
  69. </div>
  70. <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[10, 12, 15, 18]"
  71. :total="targetYearScoreSummaryData.length" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
  72. @size-change="handleSizeChange" @current-change="handleCurrentChange">
  73. </el-pagination>
  74. </div>
  75. </el-tab-pane>
  76. <el-tab-pane key="monthScore" label="周期月度得分" name="monthScore">
  77. <div class="layout_display_flex_y layout_el-table">
  78. <div class="layout_flex_1-y">
  79. <el-table :data="targetMonthScoreSummaryData.slice(pageSizeM * (currentPageM - 1), pageSizeM * currentPageM)"
  80. stripe border highlight-current-row style="width: 100%" height="100%">
  81. <el-table-column type="index" label="序号" align="center" fixed></el-table-column>
  82. <el-table-column prop="id" label="指标id" v-if="false"></el-table-column>
  83. <el-table-column prop="deptId" label="科室id" v-if="false"></el-table-column>
  84. <el-table-column prop="name" label="指标名称" width="360" show-overflow-tooltip></el-table-column>
  85. <el-table-column prop="month" label="月份"></el-table-column>
  86. <el-table-column prop="dataType" label="数据方式" header-align="center">
  87. <template #default="scope">
  88. {{ '1' === scope.row.dataType ? 'sql统计' : '手动输入' }}
  89. </template>
  90. </el-table-column>
  91. <el-table-column prop="deptName" label="责任科室"></el-table-column>
  92. <el-table-column prop="authorName" label="责任人"></el-table-column>
  93. <el-table-column prop="childResult" label="分子结果"></el-table-column>
  94. <el-table-column prop="momResult" label="分母结果"></el-table-column>
  95. <el-table-column prop="calcResult" label="计算结果"></el-table-column>
  96. <el-table-column prop="score" label="得分"></el-table-column>
  97. <el-table-column prop="createTime" label="统计时间" width="140"></el-table-column>
  98. </el-table>
  99. </div>
  100. <div>
  101. <el-pagination :current-page="currentPageM" :page-size="pageSizeM" :page-sizes="[15, 30, 45, 60]"
  102. :total="targetMonthScoreSummaryData.length" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
  103. @size-change="handleSizeChangeM" @current-change="handleCurrentChangeM">
  104. </el-pagination>
  105. </div>
  106. </div>
  107. </el-tab-pane>
  108. </el-tabs>
  109. </div>
  110. </div>
  111. </template>
  112. <script setup name="TargetScoreSummary">
  113. import {nextTick, onMounted, ref} from "vue";
  114. import {ElMessage} from "element-plus";
  115. import {selectScoreCycle, selectTargetYearScoreSummary, selectTargetMonthScoreSummary} from '@/api/target-management/target-dict'
  116. import {useUserStore} from "@/pinia/user-store";
  117. import {selectTargetDictTree} from "@/api/target-management/target-dict";
  118. import {queryDept} from "@/api/public-api";
  119. import {clone} from "@/utils/clone";
  120. import {monthShortcuts} from "@/data/shortcuts";
  121. import {getFormatDatetime} from "@/utils/date";
  122. import {selectYsDaysDetails} from "@/api/reports/bedDays";
  123. let param = ref({
  124. reportCycle: '',
  125. startTime: '',
  126. endTime: '',
  127. dept: '',
  128. id: '',
  129. pid: '',
  130. dataInfo: '',
  131. exportName: ''
  132. })
  133. const userInfo = useUserStore().userInfo
  134. const editableTabsValue = ref('yearScore')
  135. // 查询科室
  136. const ks = ref('')
  137. // 指标信息
  138. const targetInfo = ref([])
  139. // 得分年份
  140. const reportCycleList = ref([])
  141. // 年度周期
  142. const reportCycle = ref('Y1')
  143. const showCycle = ref(true)
  144. const showDate = ref(false)
  145. const targetTreeData = ref()
  146. const deptWardList = ref([])
  147. const targetYearScoreSummaryData = ref([])
  148. const pageSize = ref(15)
  149. const currentPage = ref(1)
  150. const handleSizeChange = (val) => {
  151. pageSize.value = val
  152. }
  153. const handleCurrentChange = (val) => {
  154. currentPage.value = val
  155. }
  156. const targetMonthScoreSummaryData = ref([])
  157. const pageSizeM = ref(30)
  158. const currentPageM = ref(1)
  159. const handleSizeChangeM = (val) => {
  160. pageSizeM.value = val
  161. }
  162. const handleCurrentChangeM = (val) => {
  163. currentPageM.value = val
  164. }
  165. const startMonth = getFormatDatetime(monthShortcuts[0].value[0], 'YYYYMM')
  166. const dateRange = ref([startMonth,startMonth])
  167. onMounted(() => {
  168. nextTick(() => {
  169. deptMethod('')
  170. queryTargetDictTree()
  171. queryScoreCycle()
  172. queryTargetYearScoreSummaryInfo()
  173. })
  174. })
  175. //查询指标周期年度得分情况
  176. const queryTargetYearScoreSummaryInfo = async () => {
  177. param.value.dept = ks.value
  178. param.value.reportCycle = reportCycle.value
  179. param.value.startTime = ''
  180. param.value.endTime = ''
  181. if(targetInfo.value && targetInfo.value.length > 0){
  182. param.value.id = targetInfo.value[2];
  183. param.value.pid = targetInfo.value[1];
  184. } else {
  185. param.value.id = '';
  186. param.value.pid = '';
  187. }
  188. await selectTargetYearScoreSummary(param.value)
  189. .then((res) => {
  190. if(res){
  191. targetYearScoreSummaryData.value = res
  192. }
  193. })
  194. }
  195. //查询指标周期月度得分情况
  196. const queryTargetMonthScoreSummaryInfo = async () => {
  197. param.value.dept = ks.value
  198. param.value.reportCycle = ''
  199. if(dateRange.value){
  200. param.value.startTime = dateRange.value[0]
  201. param.value.endTime = dateRange.value[1]
  202. }
  203. if(targetInfo.value && targetInfo.value.length > 0){
  204. param.value.id = targetInfo.value[2];
  205. param.value.pid = targetInfo.value[1];
  206. } else {
  207. param.value.id = '';
  208. param.value.pid = '';
  209. }
  210. await selectTargetMonthScoreSummary(param.value)
  211. .then((res) => {
  212. if(res){
  213. targetMonthScoreSummaryData.value = res
  214. }
  215. })
  216. }
  217. //导出指标得分情况
  218. const exportData = () => {
  219. alert('功能建设中。。。')
  220. }
  221. //查询科室
  222. const deptMethod = (val) => {
  223. queryDept(val).then((res) => {
  224. deptWardList.value = res
  225. })
  226. }
  227. //查询指标树
  228. const queryTargetDictTree = () => {
  229. param.value.dataInfo = targetInfo.value
  230. selectTargetDictTree(param.value)
  231. .then((res) => {
  232. targetTreeData.value = clone(res[0].children)
  233. });
  234. }
  235. //查询指标年度周期
  236. const queryScoreCycle = () => {
  237. selectScoreCycle()
  238. .then((res) => {
  239. reportCycleList.value = res
  240. param.value.startTime = reportCycleList.value[0].startYear
  241. param.value.endTime = reportCycleList.value[0].endYear
  242. });
  243. }
  244. // 指定table展开行id
  245. const expands = ref([])
  246. // 指定table展开行方法
  247. const expandCharge = (row, expandedRows) => {
  248. expands.value = []
  249. if(expandedRows.length > 0){
  250. row ? expands.value.push(row.id) : ''
  251. } else {
  252. expands.value = []
  253. }
  254. }
  255. //tab切换
  256. const handleClick = (tab, event) => {
  257. // 查询哪个tab页面
  258. editableTabsValue.value = tab.props.name
  259. if (editableTabsValue.value === 'yearScore') {
  260. if(showCycle.value === false){
  261. showCycle.value = true
  262. }
  263. if(showDate.value === true){
  264. showDate.value = false
  265. }
  266. queryTargetYearScoreSummaryInfo()
  267. currentPage.value = 1
  268. } else if (editableTabsValue.value === 'monthScore') {
  269. if(showDate.value === false){
  270. showDate.value = true
  271. }
  272. if(showCycle.value === true){
  273. showCycle.value = false
  274. }
  275. queryTargetMonthScoreSummaryInfo()
  276. currentPageM.value = 1
  277. }
  278. }
  279. // 按钮查询
  280. const queryTargetScoreSummaryInfo = () => {
  281. if (editableTabsValue.value === 'yearScore') {
  282. queryTargetYearScoreSummaryInfo()
  283. currentPage.value = 1
  284. } else if (editableTabsValue.value === 'monthScore') {
  285. queryTargetMonthScoreSummaryInfo()
  286. currentPageM.value = 1
  287. }
  288. }
  289. // 指标年度与月度得分比对
  290. const scoreComparison = (row) => {
  291. };
  292. </script>