audit-project-completion-status.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <div :class="$style.personalStatistics">
  3. <a-card :class="$style.conditions">
  4. <a-form-model
  5. ref="projectSearchForm"
  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. <!-- <a-button :loading="exportLoading" type="primary" @click="exportGroup"
  36. >导出单位及内部审计机构基本情况</a-button
  37. > -->
  38. </div>
  39. </a-col>
  40. </a-row>
  41. </a-form-model>
  42. </a-card>
  43. <p :class="$style.tableTitle"> 审计项目完成情况 </p>
  44. <a-card class="reporttablecardxm">
  45. <sd-data-table
  46. ref="dataTable"
  47. :key="dataKey"
  48. :columns="columns"
  49. :process-req="processReq"
  50. :defultpagination-pagesize="10"
  51. data-url="api/xcoa-mobile/v1/spicAuditReportList/projectCompletionStatusList"
  52. @dataLoaded="dataLoaded"
  53. >
  54. </sd-data-table>
  55. </a-card>
  56. </div>
  57. </template>
  58. <script>
  59. import moment from 'moment'
  60. import components from './_import-components/audit-project-completion-status-import'
  61. import AuditRangePicker from '@product/iam/components/picker/audit-range-picker.vue'
  62. import AuditGroupPicker from '@product/iam/components/picker/audit-group-picker.vue'
  63. import { message } from '@/common/one-ui'
  64. import download from '@/common/services/download'
  65. import axios from '@/common/services/axios-instance'
  66. import { getUserInfo } from '@/common/store-mixin'
  67. export default {
  68. name: 'AuditProjectCompletionStatusVue',
  69. metaInfo: {
  70. title: '审计项目完成情况',
  71. },
  72. components: {
  73. ...components,
  74. AuditRangePicker,
  75. AuditGroupPicker,
  76. },
  77. data() {
  78. return {
  79. auditTypeOptions: [],
  80. exportLoading: false,
  81. dataKey: 0,
  82. reqData: {
  83. dateStart: '',
  84. dateEnd: '',
  85. unitNames: '',
  86. },
  87. data: [],
  88. columns: [
  89. {
  90. title: '序号',
  91. dataIndex: 'id',
  92. width: '100px',
  93. },
  94. {
  95. title: '单位',
  96. dataIndex: 'unitName',
  97. width: '300px',
  98. },
  99. {
  100. title: '计划内项目数',
  101. dataIndex: 'inPlanNum',
  102. width: '150px',
  103. },
  104. {
  105. title: '计划外项目数',
  106. dataIndex: 'outPlanNum',
  107. width: '150px',
  108. },
  109. {
  110. title: '完成数',
  111. dataIndex: 'closeNum',
  112. width: '120px',
  113. },
  114. {
  115. title: '完成率(%)',
  116. dataIndex: 'finshedCate',
  117. width: '150px',
  118. },
  119. {
  120. title: '纳入审计全覆盖范围项目数',
  121. dataIndex: 'coverNum',
  122. width: '230px',
  123. },
  124. {
  125. title: '审计子企业户数(户)',
  126. dataIndex: 'childOrgNum',
  127. width: '200px',
  128. },
  129. {
  130. title: '其中:审计境外子企业户数(户)',
  131. dataIndex: 'overseasOrgNum',
  132. width: '280px',
  133. },
  134. {
  135. title: '审计资产总额(亿元)',
  136. dataIndex: 'auditAssets',
  137. width: '200px',
  138. },
  139. {
  140. title: '其中:审计境外资产总额(亿元)',
  141. dataIndex: 'overseasAuditAssets',
  142. width: '280px',
  143. },
  144. {
  145. title: '贯彻落实国家重大政策措施审计',
  146. dataIndex: 'auditType01',
  147. width: '280px',
  148. },
  149. {
  150. title: '经济责任审计-离任审计',
  151. dataIndex: 'auditType03',
  152. width: '220px',
  153. },
  154. {
  155. title: '经济责任审计-任中审计',
  156. dataIndex: 'auditType04',
  157. width: '220px',
  158. },
  159. {
  160. title: '资产负债损益审计',
  161. dataIndex: 'auditType05',
  162. width: '200px',
  163. },
  164. {
  165. title: '基本建设项目审计',
  166. dataIndex: 'auditType06',
  167. width: '200px',
  168. },
  169. {
  170. title: '境外审计',
  171. dataIndex: 'auditType07',
  172. width: '120px',
  173. },
  174. {
  175. title: '大数据审计',
  176. dataIndex: 'auditType08',
  177. width: '150px',
  178. },
  179. {
  180. title: '回头看审计',
  181. dataIndex: 'auditType09',
  182. width: '150px',
  183. },
  184. {
  185. title: '信息系统审计',
  186. dataIndex: 'auditType10',
  187. width: '150px',
  188. },
  189. {
  190. title: '风险管理审计',
  191. dataIndex: 'auditType11',
  192. width: '150px',
  193. },
  194. {
  195. title: '内部控制审计',
  196. dataIndex: 'auditType02',
  197. width: '150px',
  198. },
  199. {
  200. title: '绩效审计',
  201. dataIndex: 'auditType12',
  202. width: '120px',
  203. },
  204. {
  205. title: '金融业务审计',
  206. dataIndex: 'auditType13',
  207. width: '150px',
  208. },
  209. {
  210. title: '燃料专项审计',
  211. dataIndex: 'auditType14',
  212. width: '150px',
  213. },
  214. {
  215. title: '投资专项审计',
  216. dataIndex: 'auditType15',
  217. width: '150px',
  218. },
  219. {
  220. title: '科研经费审计',
  221. dataIndex: 'auditType16',
  222. width: '150px',
  223. },
  224. {
  225. title: '资金管理审计',
  226. dataIndex: 'auditType17',
  227. width: '150px',
  228. },
  229. {
  230. title: '其他',
  231. dataIndex: 'auditType18',
  232. width: '120px',
  233. },
  234. ],
  235. form: {
  236. unitNames: [],
  237. timeRange: [],
  238. },
  239. rules: {
  240. timeRange: [{ required: true, message: '请选择统计时间', trigger: 'change' }],
  241. unitNames: [{ required: true, message: '请选择审计机构', trigger: 'change' }],
  242. },
  243. formItemLayout: {
  244. labelCol: { span: 6 },
  245. wrapperCol: { span: 14 },
  246. },
  247. rootNode: {},
  248. }
  249. },
  250. created() {
  251. let userInfo = getUserInfo()
  252. const params = {
  253. orgId: userInfo.deptId,
  254. }
  255. axios({
  256. url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
  257. method: 'get',
  258. }).then((res) => {
  259. userInfo = res.data
  260. params.orgId = res.data.id
  261. axios({
  262. url: 'api/xcoa-mobile/v1/iamorg/findIamOrg',
  263. method: 'post',
  264. params,
  265. }).then((res) => {
  266. this.id = res.data.id
  267. const deptCode = res.data.orgId + ''
  268. const deptName = res.data.orgName
  269. this.rootNode = { code: deptCode, name: deptName, id: this.id }
  270. })
  271. })
  272. },
  273. mounted() {
  274. this.tableResize()
  275. // 初始化审计类型数据字典信息
  276. this.initDictionaryInfo()
  277. this.initDatePicker()
  278. this.initGroupPicker()
  279. // this.handleAction('serach')
  280. },
  281. methods: {
  282. initDictionaryInfo() {
  283. axios({
  284. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_AUDIT_TYPE',
  285. method: 'get',
  286. }).then((res) => {
  287. if (res.status === 200) {
  288. this.auditTypeOptions = res.data
  289. }
  290. })
  291. },
  292. initDatePicker() {
  293. const datePick = []
  294. const time = moment(new Date())
  295. datePick.push(time)
  296. datePick.push(time)
  297. this.form.timeRange = datePick
  298. },
  299. initGroupPicker() {
  300. let userInfo = getUserInfo()
  301. const params = {
  302. orgId: userInfo.deptId,
  303. }
  304. axios({
  305. url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
  306. method: 'get',
  307. }).then((res) => {
  308. userInfo = res.data
  309. params.orgId = res.data.id
  310. axios({
  311. url: 'api/xcoa-mobile/v1/iamorg/findIamOrg',
  312. method: 'post',
  313. params,
  314. }).then((res) => {
  315. const userDeptValue = []
  316. const userDept = {
  317. code: res.data.orgId + '',
  318. name: res.data.orgName,
  319. text: res.data.orgName,
  320. id: res.data.orgId,
  321. type: 'Group',
  322. }
  323. userDeptValue.push(userDept)
  324. this.form.unitNames = userDeptValue
  325. this.$refs.projectSearchForm.validate()
  326. this.handleAction('serach')
  327. })
  328. })
  329. },
  330. tableResize() {
  331. document
  332. .getElementsByClassName('ant-table-empty')[0]
  333. .getElementsByClassName('ant-table-tbody')[0]
  334. .appendChild(document.getElementsByClassName('ant-table-placeholder')[0])
  335. var width = document.getElementsByClassName('ant-table-tbody')[0].offsetWidth
  336. document.getElementsByClassName('ant-table-placeholder')[0].style.width = `${width}%`
  337. },
  338. dataLoaded(res) {
  339. if (res.data.length) {
  340. res.data.forEach((item, index) => {
  341. item.id = index + 1
  342. })
  343. } else {
  344. this.tableResize()
  345. }
  346. return res
  347. },
  348. handleReset() {
  349. this.$refs.projectSearchForm.resetFields()
  350. },
  351. processReq(req) {
  352. req.data = {
  353. maxResults: req.data.maxResults,
  354. startPosition: req.data.startPosition,
  355. dateStart: this.reqData.dateStart,
  356. dateEnd: this.reqData.dateEnd,
  357. unitIds: this.reqData.unitNames,
  358. }
  359. return req
  360. },
  361. handleAction(type) {
  362. this.$refs.projectSearchForm.validate((valid, values) => {
  363. if (valid) {
  364. debugger
  365. if (type === 'serach') {
  366. if (this.form.timeRange.length === 0 && this.form.unitNames.length === 0) {
  367. this.handleSearch()
  368. } else {
  369. // 处理时间
  370. this.reqData.dateStart = this.form.timeRange[0].year() + ''
  371. this.reqData.dateEnd = this.form.timeRange[1].year() + ''
  372. // 处理部门
  373. const arr = []
  374. this.form.unitNames.forEach((item) => {
  375. arr.push(`'${item.id}'`)
  376. })
  377. this.reqData.unitNames = arr.join(',')
  378. this.reqData.unitIds = arr.join(',')
  379. this.handleSearch()
  380. }
  381. } else {
  382. debugger
  383. if (this.form.timeRange.length === 0 && this.form.unitNames.length === 0) {
  384. this.handleExport()
  385. } else {
  386. // 处理时间
  387. this.reqData.dateStart = this.form.timeRange[0].year() + ''
  388. this.reqData.dateEnd = this.form.timeRange[1].year() + ''
  389. // 处理部门
  390. const arr = []
  391. this.form.unitNames.forEach((item) => {
  392. arr.push(`'${item.id}'`)
  393. })
  394. this.reqData.unitNames = arr.join(',')
  395. this.reqData.unitIds = arr.join(',')
  396. this.handleExport()
  397. }
  398. }
  399. }
  400. })
  401. },
  402. handleSearch() {
  403. this.reqData.startPosition = 0
  404. this.dataKey++
  405. },
  406. handleExport() {
  407. axios({
  408. method: 'post',
  409. url: 'api/xcoa-mobile/v1/spicAuditReportExport/exportProjectCompletionStatus',
  410. responseType: 'blob',
  411. data: {
  412. unitIds: this.reqData.unitIds,
  413. dateStart: this.reqData.dateStart,
  414. dateEnd: this.reqData.dateEnd,
  415. },
  416. }).then((res) => {
  417. const url = URL.createObjectURL(res.data)
  418. download(url, '审计项目完成情况-内审.xlsx')
  419. })
  420. },
  421. },
  422. }
  423. </script>
  424. <style module lang="scss">
  425. @use '@/common/design' as *;
  426. .personalStatistics {
  427. :global(.ant-table-body) {
  428. overflow-x: scroll !important;
  429. }
  430. :global(.ant-form-item) {
  431. margin: 0;
  432. }
  433. :global(.ant-table-empty) {
  434. :global(.ant-table-body) {
  435. overflow-x: scroll !important;
  436. }
  437. }
  438. .conditions {
  439. margin-bottom: 20px;
  440. }
  441. .buttonContent {
  442. padding-top: 6px;
  443. text-align: right;
  444. button {
  445. margin: 0 4px;
  446. }
  447. }
  448. :global(.anticon-setting) {
  449. display: none;
  450. }
  451. .tableTitle {
  452. padding-top: 16px;
  453. margin: 0;
  454. font-size: 22px;
  455. font-weight: bold;
  456. color: #404040;
  457. text-align: center;
  458. background: white;
  459. }
  460. :global(.reporttablecardxm) {
  461. :global(.ant-table-body) {
  462. height: auto !important;
  463. min-height: auto !important;
  464. overflow: auto;
  465. }
  466. }
  467. :global(.ant-table-placeholder) {
  468. height: auto !important;
  469. }
  470. }
  471. </style>