audit-personnel-statistics.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <div :class="$style.personalStatistics">
  3. <a-card :class="$style.conditions">
  4. <a-form-model
  5. ref="advancedSearchForm"
  6. class="ant-advanced-search-form"
  7. :model="form"
  8. :rules="rules"
  9. v-bind="formItemLayout"
  10. >
  11. <a-row :gutter="24" :class="$style.antformitem">
  12. <a-col :span="8">
  13. <a-form-model-item label="年度" prop="timeRange">
  14. <AuditRangePicker :time-range.sync="form.timeRange" />
  15. </a-form-model-item>
  16. </a-col>
  17. <a-col :span="8">
  18. <a-form-model-item label="审计机构" prop="unitNames">
  19. <AuditGroupPicker
  20. ref="unitNames"
  21. v-model="form.unitNames"
  22. :single="false"
  23. :read-only="false"
  24. :root-node="rootNode"
  25. />
  26. </a-form-model-item>
  27. </a-col>
  28. <a-col :span="8">
  29. <div :class="$style.buttonContent">
  30. <a-button @click="handleReset">重置</a-button>
  31. <a-button type="primary" @click="handleAction('serach')">查询</a-button>
  32. <a-button :loading="exportLoading" type="primary" @click="handleAction('export')"
  33. >导出</a-button
  34. >
  35. </div>
  36. </a-col>
  37. </a-row>
  38. </a-form-model>
  39. </a-card>
  40. <p :class="$style.tableTitle"> 机构基本情况统计 </p>
  41. <a-card class="reporttablecardxm">
  42. <sd-data-table
  43. ref="dataTable"
  44. :key="dataKey"
  45. :columns="columns"
  46. :process-req="processReq"
  47. :defultpagination-pagesize="50"
  48. data-url="api/xcoa-mobile/v1/iam-statistics/getOrgStatusList"
  49. @dataLoaded="dataLoaded"
  50. @rowClick="rowClick"
  51. >
  52. </sd-data-table>
  53. </a-card>
  54. </div>
  55. </template>
  56. <script>
  57. import AuditRangePicker from '../../components/picker/audit-range-picker.vue'
  58. import AuditGroupPicker from '../../components/picker/audit-group-picker.vue'
  59. import components from './_import-components/audit-personnel-statistics-import'
  60. import StatisticsService from './statistics-service'
  61. import { message } from '@/common/one-ui'
  62. import download from '@/common/services/download'
  63. import axios from '@/common/services/axios-instance'
  64. import { getUserInfo } from '@/common/store-mixin'
  65. export default {
  66. name: 'AuditPersonnelStatistics',
  67. metaInfo: {
  68. title: '机构人员统计',
  69. },
  70. components: {
  71. ...components,
  72. AuditRangePicker,
  73. AuditGroupPicker,
  74. },
  75. data() {
  76. return {
  77. exportLoading: false,
  78. dataKey: 0,
  79. reqData: {
  80. dateStart: '',
  81. dateEnd: '',
  82. unitNames: '',
  83. },
  84. data: [],
  85. columns: [
  86. {
  87. title: '序号',
  88. dataIndex: 'id',
  89. width: '66px',
  90. },
  91. {
  92. title: '审计机构',
  93. dataIndex: 'ORG_NAME',
  94. width: '400px',
  95. },
  96. {
  97. title: '机构类型',
  98. dataIndex: 'ORG_TYPE',
  99. width: '100px',
  100. },
  101. {
  102. title: '编制人数',
  103. dataIndex: 'PERSON_NUMBER',
  104. width: '100px',
  105. },
  106. {
  107. title: '专职人数',
  108. dataIndex: 'SPEC',
  109. width: '100px',
  110. },
  111. {
  112. title: 'CIA资格人数',
  113. dataIndex: 'CIA',
  114. width: '130px',
  115. },
  116. {
  117. title: '学历',
  118. children: [
  119. {
  120. title: '硕士及以上',
  121. dataIndex: 'MASTER',
  122. width: '115px',
  123. },
  124. {
  125. title: '大学本科',
  126. dataIndex: 'BACHELOR',
  127. width: '100px',
  128. },
  129. {
  130. title: '大学专科及以下',
  131. dataIndex: 'COLLEGE',
  132. width: '150px',
  133. },
  134. ],
  135. },
  136. {
  137. title: '职称',
  138. children: [
  139. {
  140. title: '高级',
  141. dataIndex: 'SENIOR',
  142. width: '100px',
  143. },
  144. {
  145. title: '中级',
  146. dataIndex: 'INTERMEDIATE',
  147. width: '100px',
  148. },
  149. {
  150. title: '正高级',
  151. dataIndex: 'ELEMENTARY',
  152. width: '100px',
  153. },
  154. ],
  155. },
  156. {
  157. title: '知识结构',
  158. children: [
  159. {
  160. title: '审计',
  161. dataIndex: 'AUDIT',
  162. width: '100px',
  163. },
  164. {
  165. title: '会计',
  166. dataIndex: 'ACCOUNTINT',
  167. width: '100px',
  168. },
  169. {
  170. title: '经济',
  171. dataIndex: 'ECONOMY',
  172. width: '100px',
  173. },
  174. {
  175. title: '法律',
  176. dataIndex: 'LAW',
  177. width: '100px',
  178. },
  179. {
  180. title: '管理',
  181. dataIndex: 'MANAGE',
  182. width: '100px',
  183. },
  184. {
  185. title: '信息技术',
  186. dataIndex: 'IT',
  187. width: '100px',
  188. },
  189. {
  190. title: '工程',
  191. dataIndex: 'ENGINEERING',
  192. width: '100px',
  193. },
  194. {
  195. title: '其他',
  196. dataIndex: 'OTHER',
  197. width: '100px',
  198. },
  199. ],
  200. },
  201. {
  202. title: '实际项目数',
  203. dataIndex: 'REAL_NUM',
  204. width: '120px',
  205. sdClickable: true,
  206. },
  207. {
  208. title: '境外项目数',
  209. dataIndex: 'OUTSIDE_NUM',
  210. width: '120px',
  211. sdClickable: true,
  212. },
  213. {
  214. title: '发现问题数',
  215. dataIndex: 'FIND_NUM',
  216. width: '120px',
  217. sdClickable: true,
  218. },
  219. {
  220. title: '需整改问题数',
  221. dataIndex: 'RECT_NUM',
  222. width: '135px',
  223. sdClickable: true,
  224. },
  225. {
  226. title: '已整改问题数',
  227. dataIndex: 'DONE_NUM',
  228. width: '135px',
  229. sdClickable: true,
  230. },
  231. {
  232. title: '整改完成率',
  233. dataIndex: 'PERCENT',
  234. width: '120px',
  235. },
  236. {
  237. title: '审计资产金额(万元)',
  238. dataIndex: 'AUDIT_ASSETS',
  239. width: '200px',
  240. },
  241. // {
  242. // title:'整改率',
  243. // dataIndex: 'RECT_RATE',
  244. // width: '120px'
  245. // }
  246. ],
  247. form: {
  248. unitNames: [],
  249. timeRange: [],
  250. },
  251. rules: {
  252. timeRange: [{ required: true, message: '请选择统计时间', trigger: 'change' }],
  253. unitNames: [{ required: true, message: '请选择审计机构', trigger: 'change' }],
  254. },
  255. formItemLayout: {
  256. labelCol: { span: 6 },
  257. wrapperCol: { span: 14 },
  258. },
  259. rootNode: {},
  260. }
  261. },
  262. created() {
  263. let userInfo = getUserInfo()
  264. const params = {
  265. orgId: userInfo.deptId,
  266. }
  267. axios({
  268. url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
  269. method: 'get',
  270. }).then((res) => {
  271. userInfo = res.data
  272. params.orgId = res.data.id
  273. axios({
  274. url: 'api/xcoa-mobile/v1/iamorg/findIamOrg',
  275. method: 'post',
  276. params,
  277. }).then((res) => {
  278. this.id = res.data.id
  279. const deptCode = res.data.orgId + ''
  280. const deptName = res.data.orgName
  281. this.rootNode = { code: deptCode, name: deptName, id: this.id }
  282. // const deptCode = userInfo.id.toString()
  283. // const deptName = res.data.orgName
  284. // this.rootNode = { code: deptCode, name: deptName, id: this.id }
  285. })
  286. })
  287. },
  288. mounted() {
  289. this.tableResize()
  290. },
  291. methods: {
  292. tableResize() {
  293. document
  294. .getElementsByClassName('ant-table-empty')[0]
  295. .getElementsByClassName('ant-table-tbody')[0]
  296. .appendChild(document.getElementsByClassName('ant-table-placeholder')[0])
  297. var width = document.getElementsByClassName('ant-table-tbody')[0].offsetWidth
  298. document.getElementsByClassName('ant-table-placeholder')[0].style.width = `${width}%`
  299. },
  300. processReq(req) {
  301. req.data = {
  302. maxResults: req.data.maxResults,
  303. startPosition: req.data.startPosition,
  304. dateStart: this.reqData.dateStart,
  305. dateEnd: this.reqData.dateEnd,
  306. unitIds: this.reqData.unitNames,
  307. }
  308. return req
  309. },
  310. dataLoaded(res) {
  311. if (res.data.length) {
  312. res.data.forEach((item, index) => {
  313. item.id = index + 1
  314. })
  315. } else {
  316. this.tableResize()
  317. }
  318. return res
  319. },
  320. handleReset() {
  321. this.$refs.advancedSearchForm.resetFields()
  322. },
  323. handleAction(type) {
  324. this.$refs.advancedSearchForm.validate((valid, values) => {
  325. if (valid) {
  326. // 处理时间
  327. this.reqData.dateStart = this.form.timeRange[0].year() + ''
  328. this.reqData.dateEnd = this.form.timeRange[1].year() + ''
  329. // 处理部门
  330. const arr = []
  331. this.form.unitNames.forEach((item) => {
  332. arr.push(`'${item.id}'`)
  333. })
  334. this.reqData.unitNames = arr.join(',')
  335. this.reqData.unitIds = arr.join(',')
  336. // 调用方法
  337. switch (type) {
  338. case 'serach':
  339. this.handleSearch()
  340. break
  341. case 'export':
  342. this.handleExport()
  343. break
  344. }
  345. }
  346. })
  347. },
  348. handleSearch() {
  349. this.reqData.startPosition = 0
  350. this.dataKey++
  351. },
  352. handleExport() {
  353. if (this.$refs.dataTable.data.length === 0) {
  354. message.warning('未查询出可导出数据', 1)
  355. return
  356. }
  357. this.exportLoading = true
  358. StatisticsService.exportPersonalStatisticsList(this.reqData).then((data) => {
  359. const url = URL.createObjectURL(data)
  360. download(url, '机构人员统计表.xls')
  361. this.exportLoading = false
  362. })
  363. },
  364. rowClick(record, { rowIndex, column }) {
  365. const param = {
  366. dateStart: this.reqData.dateStart,
  367. dateEnd: this.reqData.dateEnd,
  368. unitIds: "'" + record.ORG_ID + "'",
  369. }
  370. let url = ''
  371. if (column.dataIndex === 'REAL_NUM' || column.dataIndex === 'OUTSIDE_NUM') {
  372. if (column.dataIndex === 'REAL_NUM') {
  373. param.columnValue = 'SJXMS'
  374. } else {
  375. param.columnValue = 'JWXMS'
  376. }
  377. // 项目列表 实际 和境外
  378. url = '#/audit-annualplancompletion-project-list?params='
  379. } else if (column.dataIndex === 'FIND_NUM') {
  380. // 发现列表
  381. url = '#/audit-problemamount-find-list?params='
  382. } else {
  383. // 整改列表
  384. if (column.dataIndex === 'DONE_NUM') {
  385. param.rectStatus = '03'
  386. }
  387. param.rectUnitFlag = 'true'
  388. url = '#/audit-statistics-find-list?params='
  389. }
  390. url = url + encodeURIComponent(JSON.stringify(param)) + '&type=personnelstatistics'
  391. window.open(url)
  392. },
  393. },
  394. }
  395. </script>
  396. <style module lang="scss">
  397. @use '@/common/design' as *;
  398. .personalStatistics {
  399. :global(.ant-table-body) {
  400. overflow-x: scroll !important;
  401. }
  402. :global(.ant-form-item) {
  403. margin: 0;
  404. }
  405. :global(.ant-table-empty) {
  406. :global(.ant-table-body) {
  407. overflow-x: scroll !important;
  408. }
  409. }
  410. .conditions {
  411. margin-bottom: 20px;
  412. }
  413. .buttonContent {
  414. padding-top: 6px;
  415. text-align: right;
  416. button {
  417. margin: 0 4px;
  418. }
  419. }
  420. :global(.anticon-setting) {
  421. display: none;
  422. }
  423. .tableTitle {
  424. padding-top: 16px;
  425. margin: 0;
  426. font-size: 22px;
  427. font-weight: bold;
  428. color: #404040;
  429. text-align: center;
  430. background: white;
  431. }
  432. :global(.reporttablecardxm) {
  433. :global(.ant-table-body) {
  434. height: auto !important;
  435. min-height: auto !important;
  436. overflow: auto;
  437. }
  438. }
  439. :global(.ant-table-placeholder) {
  440. height: auto !important;
  441. }
  442. }
  443. </style>