ExamineRecord.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <div class="record-container">
  3. <ResultAnalysis />
  4. </div>
  5. </template>
  6. <script>
  7. let that;
  8. import { mapGetters } from 'vuex';
  9. import moment from 'moment';
  10. import ResultAnalysis from "./ResultAnalysis" // 考核详情组件
  11. export default {
  12. components: {
  13. ResultAnalysis
  14. },
  15. data() {
  16. return {
  17. reviewPackageId: 0,
  18. detailInfo: null,
  19. year: '2025',
  20. headValue: [],
  21. options: [{ value: '0', label: '未定义', leaf: false, children: [] },
  22. { value: '1', label: '年度', leaf: false, children: [] },
  23. { value: '2', label: '半年度', leaf: false, children: [] },
  24. { value: '3', label: '季度', leaf: false, children: [] },
  25. { value: '4', label: '月度', leaf: false, children: [] },
  26. ], //
  27. props: {
  28. value: 'value',
  29. label: 'label',
  30. children: 'children',
  31. lazy: true,
  32. lazyLoad(node, resolve) {
  33. that.getAssessTree(node, resolve);
  34. }
  35. },
  36. total: 0,
  37. loading: false,
  38. tableData: [],
  39. deptList: [], // 部门列表 - 树形结构
  40. dept_list: [], // 部门列表
  41. selected_dept_ids: [], // 选择的部门列表
  42. placeholder: "",
  43. chooseChildren: [],
  44. noDataText: '暂无数据'
  45. }
  46. },
  47. watch: {
  48. year(val) {
  49. this.getRecords()
  50. },
  51. headValue(val) {
  52. if (this.chooseChildren && this.chooseChildren.length > 0) {
  53. let obj = this.chooseChildren.find(child => child.value == this.headValue[1])
  54. if (obj) {
  55. let value = ''
  56. if (this.headValue[0] && this.headValue[0] == '0') value = "未定义 / "
  57. if (this.headValue[0] && this.headValue[0] == '1') value = "年度 / "
  58. if (this.headValue[0] && this.headValue[0] == '2') value = "半年度 / "
  59. if (this.headValue[0] && this.headValue[0] == '3') value = "季度 / "
  60. if (this.headValue[0] && this.headValue[0] == '4') value = "月度 / "
  61. this.placeholder = obj.label || ''
  62. }
  63. }
  64. this.getResultAnalyze()
  65. },
  66. },
  67. created() {
  68. // that = this;
  69. // this.getRecords('4'); // 优先获取当月最新考核数据 递归周期类型,获取考核数据,优先按月,季,半年度,年度来调用
  70. },
  71. computed: {
  72. ...mapGetters(['user_info']),
  73. },
  74. filters: {
  75. formatDate(val) {
  76. if (val) return moment(val).format('YYYY-MM-DD')
  77. else return "--"
  78. },
  79. filterProgress(list) {
  80. if (list && list.length > 0) {
  81. let sum = 0;
  82. list.forEach(item => {
  83. if (item.status == 1) sum += 1 // 完成的个数
  84. })
  85. return Number(sum / list.length) * 100
  86. }
  87. }
  88. },
  89. methods: {
  90. getAssessTree(node, resolve) {
  91. if (this.options.length == 0) {
  92. return
  93. }
  94. const { value } = node;
  95. this.chooseChildren = node.children // 用来回显选择的文本
  96. node.children = []
  97. let url = `/performance/statistics/cycle/info/${this.user_info.site_id}/${value}`
  98. this.$axiosUser("get", url, {}).then(res => {
  99. let { data: { data: { items, cycleType } } } = res
  100. if (items && items.length > 0) {
  101. items.forEach(item => {
  102. item.leaf = true;
  103. item.label = item.remark
  104. })
  105. resolve(items)
  106. } else {
  107. resolve([])
  108. }
  109. }).finally(() => {
  110. // this.tableDataLoad = false;
  111. });
  112. },
  113. getRecords(cycle) {
  114. if (cycle < 0) {
  115. cycle = 0
  116. return
  117. }
  118. this.loading = true
  119. // 周期种类 0-未定义 1-年度 2-半年度 3-季度 4-月度
  120. let url = `/performance/statistics/cycle/info/${this.user_info.site_id}/${cycle}`
  121. this.$axiosUser("get", url, {}).then(res => {
  122. this.loading = false;
  123. let { data: { data: { items, cycleType } } } = res
  124. if (items && items.length > 0) {
  125. items.forEach(item => {
  126. item.leaf = true
  127. item.label = item.remark
  128. })
  129. this.options[parseInt(cycle)].children = items
  130. this.headValue = [cycle + '', this.options[parseInt(cycle)].children[[0]].value]
  131. // if (this.headValue[1]) this.placeholder = this.options[parseInt(cycle)].children[[0]].label || ''
  132. } else {
  133. this.getRecords(parseInt(cycle) - 1) // 递归周期类型,获取考核数据,优先按月,季,半年度,年度来调用
  134. }
  135. })
  136. },
  137. getResultAnalyze() {
  138. this.reviewPackageId = 0
  139. let url = `/performance/statistics/cycle/${this.user_info.site_id}/${this.headValue[0]}`
  140. if (!this.headValue[1]) return
  141. this.$axiosUser("get", url, { value: this.headValue[1]}).then(res => {
  142. this.detailInfo = res.data.data
  143. this.reviewPackageId = 1
  144. })
  145. },
  146. }
  147. };
  148. </script>
  149. <style lang="scss">
  150. .record-container {
  151. .el-cascader .el-input__inner::placeholder {
  152. color: #606266;
  153. /* 设置为你想要的颜色 */
  154. }
  155. }
  156. </style>
  157. <style scoped="scoped" lang="scss">
  158. // .el-cascader .el-input{
  159. // cursor: pointer;
  160. // // #606266
  161. // }
  162. .record-container {
  163. width: 100%;
  164. height: 100%;
  165. background-color: #fff;
  166. border-radius: 5px;
  167. display: flex;
  168. flex-direction: column;
  169. .title-container {
  170. display: flex;
  171. align-items: center;
  172. .searchBox {
  173. width: 300px;
  174. .search-title {
  175. border-bottom: 1px solid #f1f1f1;
  176. font-size: 16px;
  177. font-weight: 700;
  178. padding: 0 10px;
  179. padding-bottom: 10px;
  180. }
  181. }
  182. .title {
  183. font-weight: 700;
  184. font-size: 16px;
  185. }
  186. }
  187. .search-box {
  188. display: flex;
  189. align-items: center;
  190. justify-content: space-between;
  191. width: 100%;
  192. height: 50px;
  193. padding: 0 10px;
  194. box-sizing: border-box;
  195. .btn-box {
  196. padding: 7px 5px;
  197. border: 1px solid #DCDFE6;
  198. border-radius: 4px;
  199. &:hover {
  200. cursor: pointer;
  201. }
  202. }
  203. }
  204. .line {
  205. width: 100%;
  206. height: 1px;
  207. background: #f1f1f1;
  208. margin-bottom: 10px;
  209. }
  210. .main-content {
  211. width: 100%;
  212. flex: 1;
  213. overflow-y: auto;
  214. /* 设置滚动条的宽度和背景色 */
  215. &::-webkit-scrollbar {
  216. width: 6px;
  217. height: 6px;
  218. background-color: #f9f9f9;
  219. }
  220. /* 设置滚动条滑块的样式 */
  221. &::-webkit-scrollbar-thumb {
  222. border-radius: 6px;
  223. background-color: #c1c1c1;
  224. }
  225. /* 设置滚动条滑块hover样式 */
  226. &::-webkit-scrollbar-thumb:hover {
  227. background-color: #a8a8a8;
  228. }
  229. /* 设置滚动条轨道的样式 */
  230. &::-webkit-scrollbar-track {
  231. box-shadow: inset 0 0 5px rgba(87, 175, 187, 0.1);
  232. border-radius: 6px;
  233. background: #ededed;
  234. }
  235. }
  236. .no-data-box {
  237. width: 100%;
  238. height: 100%;
  239. padding: 26px 35px;
  240. background-color: #fff;
  241. box-sizing: border-box;
  242. border-radius: 4px;
  243. img {
  244. width: 200px;
  245. height: 200px;
  246. margin-bottom: 10px;
  247. }
  248. }
  249. }
  250. </style>