audit-project-rect-statistics.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893
  1. <template>
  2. <div :class="$style.personalStatistics">
  3. <a-card :class="$style.conditions">
  4. <a-form-model
  5. ref="StatisticsSearchForm"
  6. class="ant-advanced-search-form"
  7. :model="rectForm"
  8. :rules="rectRules"
  9. v-bind="formItemLayout"
  10. >
  11. <div>
  12. <a-card>
  13. <a-row :gutter="24" :class="$style.antformitem">
  14. <a-col :span="8">
  15. <span>查询维度: </span>
  16. <a-radio-group
  17. v-model="radioValue"
  18. :class="$style.radioGroup"
  19. @change="radioOnChange"
  20. >
  21. <a-radio :value="'01'"> 审计情况 </a-radio>
  22. <a-radio :value="'02'"> 被审计情况 </a-radio>
  23. </a-radio-group>
  24. </a-col>
  25. </a-row>
  26. </a-card>
  27. </div>
  28. <a-row :gutter="24" :class="$style.antformitem">
  29. <a-col :span="8">
  30. <a-form-model-item label="年度" prop="timeRange">
  31. <AuditRangePicker :time-range.sync="rectForm.timeRange" />
  32. </a-form-model-item>
  33. </a-col>
  34. <a-col :span="8">
  35. <a-form-model-item label="审计机构" prop="unitNames">
  36. <AuditGroupPicker
  37. ref="unitNames"
  38. v-model="rectForm.unitNames"
  39. :single="false"
  40. :read-only="false"
  41. :root-node="rootNode"
  42. />
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :span="8">
  46. <a-form-model-item label="审计类型" prop="auditType">
  47. <sd-select
  48. v-model="rectForm.auditType"
  49. :allow-clear="true"
  50. :options="auditTypeOptions"
  51. mode="multiple"
  52. />
  53. </a-form-model-item>
  54. </a-col>
  55. <a-col :span="8">
  56. <div :class="$style.buttonContent">
  57. <a-button @click="handleReset">重置</a-button>
  58. <a-button type="primary" @click="handleRectStatistics('serach')">查询</a-button>
  59. <a-button
  60. :loading="exportLoading"
  61. type="primary"
  62. @click="handleRectStatistics('export')"
  63. >导出</a-button
  64. >
  65. </div>
  66. </a-col>
  67. </a-row>
  68. </a-form-model>
  69. </a-card>
  70. <p :class="$style.tableTitle"> 审计项目整改完成情况及成果统计表 </p>
  71. <a-card class="reporttablecardxm">
  72. <div v-show="false" id="hj">
  73. <sd-data-table-hj
  74. ref="dataTablehj"
  75. :key="dataKeysum"
  76. :process-req="processReqsum"
  77. :columns="columnssum"
  78. :projectlist="true"
  79. :defultpagination-pagesize="10"
  80. data-url="api/xcoa-mobile/v1/spicAuditReportList/projectRectStatisticsList"
  81. @dataLoaded1="dataLoadedsum"
  82. @fnonloadsum="fnonloadsum"
  83. >
  84. </sd-data-table-hj>
  85. </div>
  86. <sd-data-table
  87. ref="dataTable"
  88. :key="dataKey"
  89. :columns="columns"
  90. :projectlist="true"
  91. :process-req="processReq"
  92. :defultpagination-pagesize="10"
  93. data-url="api/xcoa-mobile/v1/spicAuditReportList/projectRectStatisticsList"
  94. @dataLoaded="dataLoaded"
  95. >
  96. <div slot="projectLink" slot-scope="text, record">
  97. <a :title="text" @click="linkProject(record)">{{ text }}</a>
  98. </div>
  99. <div slot="detail" slot-scope="text, record">
  100. <a :title="text" @click="showFindDetail(record)">{{ text }}</a>
  101. </div>
  102. </sd-data-table>
  103. </a-card>
  104. <a-modal
  105. v-model="hasDetailData"
  106. :title="detailRecord.projectTitle + ' 审计问题成果明细'"
  107. :width="1500"
  108. @ok="
  109. projectFindsList = []
  110. detailRecord = {}
  111. "
  112. @cancel="
  113. projectFindsList = []
  114. detailRecord = {}
  115. "
  116. >
  117. <a-checkbox v-model="onlyMoreThanZero" @change="showFindDetail(detailRecord)"
  118. >仅显示数值不全为零的数据</a-checkbox
  119. >
  120. <a-table :columns="detailColumns" :data-source="projectFindsList"> </a-table>
  121. </a-modal>
  122. </div>
  123. </template>
  124. <script>
  125. import moment from 'moment'
  126. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  127. import components from './_import-components/audit-project-rect-statistics-import'
  128. import AuditRangePicker from '@product/iam/components/picker/audit-range-picker.vue'
  129. import AuditGroupPicker from '@product/iam/components/picker/audit-group-picker.vue'
  130. import download from '@/common/services/download'
  131. import axios from '@/common/services/axios-instance'
  132. import { getUserInfo } from '@/common/store-mixin'
  133. export default {
  134. name: 'AuditProjectRectStatistics',
  135. metaInfo: {
  136. title: '审计项目整改完成情况及成果统计表',
  137. },
  138. components: {
  139. ...components,
  140. AuditRangePicker,
  141. AuditGroupPicker,
  142. },
  143. data() {
  144. return {
  145. detailRecord: {},
  146. onlyMoreThanZero: false,
  147. projectFindsList: [],
  148. auditTypeOptions: [],
  149. exportLoading: false,
  150. radioValue: '01',
  151. radioType: true,
  152. dataKey: 0,
  153. detailColumns: [
  154. {
  155. title: '项目名称',
  156. dataIndex: 'projectTitle',
  157. width: '300px',
  158. },
  159. {
  160. title: '问题名称',
  161. dataIndex: 'rectTitle',
  162. width: '600px',
  163. },
  164. {
  165. title: '纠正违规金额(万元)',
  166. dataIndex: 'accounts',
  167. width: '200px',
  168. },
  169. {
  170. title: '节约成本费用数额(万元)',
  171. dataIndex: 'svaingSum',
  172. width: '250px',
  173. },
  174. {
  175. title: '挽回损失(万元)',
  176. dataIndex: 'improperSum',
  177. width: '200px',
  178. },
  179. {
  180. title: '增加收入数额(万元)',
  181. dataIndex: 'recoverySum',
  182. width: '200px',
  183. },
  184. {
  185. title: '督促清理往来款项收回资金(万元)',
  186. dataIndex: 'wasteAmount',
  187. width: '300px',
  188. },
  189. {
  190. title: '工程结算及竣工决算项目数量(个)',
  191. dataIndex: 'completionNumber',
  192. width: '300px',
  193. },
  194. {
  195. title: '新建修订制度、流程、标准数量(项)',
  196. dataIndex: 'itemNum',
  197. width: '330px',
  198. },
  199. {
  200. title: '追责问责',
  201. children: [
  202. {
  203. title: '追责问责人次',
  204. dataIndex: 'personNum',
  205. width: '200px',
  206. },
  207. {
  208. title: '经济处罚金额(万元)',
  209. dataIndex: 'economicMoney',
  210. width: '200px',
  211. },
  212. ],
  213. },
  214. {
  215. title: '移送纪检监察线索(条)',
  216. dataIndex: 'clue',
  217. width: '250px',
  218. },
  219. ],
  220. columns: [
  221. {
  222. title: '序号',
  223. dataIndex: 'id',
  224. width: '100px',
  225. },
  226. {
  227. title: '项目名称',
  228. dataIndex: 'projectTitle',
  229. width: '300px',
  230. scopedSlots: { customRender: 'projectLink' },
  231. },
  232. {
  233. title: '项目实施年度',
  234. dataIndex: 'planYear',
  235. width: '200px',
  236. },
  237. {
  238. title: '纠正违规金额(万元)',
  239. dataIndex: 'accounts',
  240. width: '200px',
  241. scopedSlots: { customRender: 'detail' },
  242. },
  243. {
  244. title: '节约成本费用数额(万元)',
  245. dataIndex: 'svaingSum',
  246. width: '250px',
  247. scopedSlots: { customRender: 'detail' },
  248. },
  249. {
  250. title: '挽回损失(万元)',
  251. dataIndex: 'improperSum',
  252. width: '200px',
  253. scopedSlots: { customRender: 'detail' },
  254. },
  255. {
  256. title: '增加收入数额(万元)',
  257. dataIndex: 'recoverySum',
  258. width: '200px',
  259. scopedSlots: { customRender: 'detail' },
  260. },
  261. {
  262. title: '督促清理往来款项收回资金(万元)',
  263. dataIndex: 'wasteAmount',
  264. width: '300px',
  265. scopedSlots: { customRender: 'detail' },
  266. },
  267. {
  268. title: '工程结算及竣工决算项目数量(个)',
  269. dataIndex: 'completionNumber',
  270. width: '300px',
  271. scopedSlots: { customRender: 'detail' },
  272. },
  273. {
  274. title: '新建修订制度、流程、标准数量(项)',
  275. dataIndex: 'itemNum',
  276. width: '330px',
  277. scopedSlots: { customRender: 'detail' },
  278. },
  279. {
  280. title: '追责问责',
  281. children: [
  282. {
  283. title: '追责问责人次',
  284. dataIndex: 'personNum',
  285. width: '200px',
  286. scopedSlots: { customRender: 'detail' },
  287. },
  288. {
  289. title: '经济处罚金额(万元)',
  290. dataIndex: 'economicMoney',
  291. width: '200px',
  292. scopedSlots: { customRender: 'detail' },
  293. },
  294. ],
  295. },
  296. {
  297. title: '移送纪检监察线索(条)',
  298. dataIndex: 'clue',
  299. width: '250px',
  300. scopedSlots: { customRender: 'detail' },
  301. },
  302. {
  303. title: '整改完成情况',
  304. children: [
  305. {
  306. title: '审计发现主要问题汇总表问题数量',
  307. dataIndex: 'findNum',
  308. width: '300px',
  309. },
  310. {
  311. title: '审计发现主要问题汇总表累计整改完成率(%)',
  312. dataIndex: 'rectRates',
  313. width: '400px',
  314. },
  315. {
  316. title: '审计发现主要问题汇总表到期整改完成率(%)',
  317. dataIndex: 'rectRate',
  318. width: '400px',
  319. },
  320. {
  321. title: '审计意见书问题数量(个)',
  322. dataIndex: 'giveOptionsNum',
  323. width: '250px',
  324. },
  325. {
  326. title: '审计意见书累计整改完成率(%)',
  327. dataIndex: 'optionsRectRates',
  328. width: '400px',
  329. },
  330. {
  331. title: '审计意见书到期整改完成率(%)',
  332. dataIndex: 'optionsRectRate',
  333. width: '400px',
  334. },
  335. {
  336. title: '审计建议数量(条)',
  337. dataIndex: 'suggestion',
  338. width: '200px',
  339. },
  340. {
  341. title: '建议采纳率(%)',
  342. dataIndex: 'rectTypeRate',
  343. width: '200px',
  344. },
  345. {
  346. title: '揭示风险(条)',
  347. dataIndex: 'peoblemNatuer',
  348. width: '200px',
  349. },
  350. {
  351. title: '截止本月审计发现主要问题汇总表问题整改完成数',
  352. dataIndex: 'wanChengNum',
  353. width: '400px',
  354. },
  355. {
  356. title: '截止本月审计意见书问题整改完成数',
  357. dataIndex: 'wanChengOptionsNum',
  358. width: '300px',
  359. },
  360. ],
  361. },
  362. ],
  363. columnssum: [
  364. {
  365. title: '年度',
  366. dataIndex: 'sumName',
  367. width: '200px',
  368. },
  369. {
  370. title: '纠正违规金额(万元)',
  371. dataIndex: 'accountsTotal',
  372. width: '200px',
  373. },
  374. {
  375. title: '节约成本费用数额(万元)',
  376. dataIndex: 'svaingSumTotal',
  377. width: '250px',
  378. },
  379. {
  380. title: '挽回损失(万元)',
  381. dataIndex: 'improperSumTotal',
  382. width: '200px',
  383. },
  384. {
  385. title: '增加收入数额(万元)',
  386. dataIndex: 'recoverySumTotal',
  387. width: '200px',
  388. },
  389. {
  390. title: '督促清理往来款项收回资金(万元)',
  391. dataIndex: 'wasteAmountTotal',
  392. width: '300px',
  393. },
  394. {
  395. title: '工程结算及竣工决算项目数量(个)',
  396. dataIndex: 'completionNumberTotal',
  397. width: '300px',
  398. },
  399. {
  400. title: '新建修订制度、流程、标准数量(项)',
  401. dataIndex: 'itemNumTotal',
  402. width: '330px',
  403. },
  404. {
  405. title: '追责问责人次',
  406. dataIndex: 'personNumTotal',
  407. width: '200px',
  408. },
  409. {
  410. title: '经济处罚金额(万元)',
  411. dataIndex: 'economicMoneyTotal',
  412. width: '200px',
  413. },
  414. {
  415. title: '移送纪检监察线索(条)',
  416. dataIndex: 'clueTotal',
  417. width: '250px',
  418. },
  419. {
  420. title: '审计发现主要问题汇总表问题数量',
  421. dataIndex: 'findNumTotal',
  422. width: '300px',
  423. },
  424. {
  425. title: '审计发现主要问题汇总表累计整改完成率(%)',
  426. dataIndex: 'rectRatesTotal',
  427. width: '400px',
  428. },
  429. {
  430. title: '审计发现主要问题汇总表到期整改完成率(%)',
  431. dataIndex: 'rectRateTotal',
  432. width: '400px',
  433. },
  434. {
  435. title: '审计意见书问题数量(个)',
  436. dataIndex: 'giveOptionsNumTotal',
  437. width: '250px',
  438. },
  439. {
  440. title: '审计意见书累计整改完成率(%)',
  441. dataIndex: 'optionsRectRatesTotal',
  442. width: '400px',
  443. },
  444. {
  445. title: '审计意见书到期整改完成率(%)',
  446. dataIndex: 'optionsRectRateTotal',
  447. width: '400px',
  448. },
  449. {
  450. title: '审计建议数量(条)',
  451. dataIndex: 'suggestionTotal',
  452. width: '200px',
  453. },
  454. {
  455. title: '建议采纳率(%)',
  456. dataIndex: 'rectTypeRateTotal',
  457. width: '200px',
  458. },
  459. {
  460. title: '揭示风险(条)',
  461. dataIndex: 'peoblemNatuerTotal',
  462. width: '200px',
  463. },
  464. {
  465. title: '截止本月审计发现主要问题汇总表问题整改完成数',
  466. dataIndex: 'wanChengNumTotal',
  467. width: '400px',
  468. },
  469. {
  470. title: '截止本月审计意见书问题整改完成数',
  471. dataIndex: 'wanChengOptionsNumTotal',
  472. width: '300px',
  473. },
  474. ],
  475. reqData: {
  476. dateStart: '',
  477. dateEnd: '',
  478. unitNames: '',
  479. auditType: '',
  480. },
  481. rectForm: {
  482. unitNames: [],
  483. timeRange: [],
  484. auditType: [],
  485. },
  486. rectRules: {
  487. timeRange: [{ required: true, message: '请选择统计时间', trigger: 'change' }],
  488. unitNames: [{ required: true, message: '请选择审计机构', trigger: 'change' }],
  489. },
  490. formItemLayout: {
  491. labelCol: { span: 6 },
  492. wrapperCol: { span: 14 },
  493. },
  494. rootNode: {},
  495. hj: {},
  496. hjarr: [],
  497. dataKeysum: 0,
  498. }
  499. },
  500. computed: {
  501. hasDetailData() {
  502. return Object.keys(this.detailRecord).length !== 0
  503. },
  504. },
  505. // computed: {
  506. // dataUrl() {
  507. // debugger
  508. // const userInfo = getUserInfo()
  509. // const id = userInfo.getdeptId + ''
  510. // const date = new Date()
  511. // const year = date.getFullYear
  512. // return (
  513. // 'api/xcoa-mobile/v1/spicAuditReportList/projectRectStatisticsList?dateStart=' +
  514. // year +
  515. // '&dateEnd=' +
  516. // year +
  517. // 'unitIds=' +
  518. // id
  519. // )
  520. // },
  521. // },
  522. created() {
  523. let userInfo = getUserInfo()
  524. const params = {
  525. orgId: userInfo.deptId,
  526. }
  527. axios({
  528. url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
  529. method: 'get',
  530. }).then((res) => {
  531. userInfo = res.data
  532. params.orgId = res.data.id
  533. axios({
  534. url: 'api/xcoa-mobile/v1/iamorg/findIamOrg',
  535. method: 'post',
  536. params,
  537. }).then((res) => {
  538. this.id = res.data.id
  539. const deptCode = res.data.orgId + ''
  540. const deptName = res.data.orgName
  541. this.rootNode = { code: deptCode, name: deptName, id: this.id }
  542. })
  543. })
  544. },
  545. mounted() {
  546. const ym =
  547. 'accountsTotal;svaingSumTotal;improperSumTotal;recoverySumTotal;wasteAmountTotal;' +
  548. 'completionNumberTotal;itemNumTotal;personNumTotal;economicMoneyTotal;clueTotal;findNumTotal;' +
  549. 'rectRatesTotal;rectRateTotal;giveOptionsNumTotal;optionsRectRatesTotal;optionsRectRateTotal;' +
  550. 'suggestionTotal;rectTypeRateTotal;peoblemNatuerTotal;wanChengNumTotal;wanChengOptionsNumTotal'
  551. const arrym = ym.split(';')
  552. this.hjarr = arrym
  553. this.tableResize()
  554. // 初始化审计类型数据字典信息
  555. this.initDictionaryInfo()
  556. this.initDatePicker()
  557. this.initGroupPicker()
  558. // this.handleRectStatistics('serach')
  559. },
  560. methods: {
  561. showFindDetail(record) {
  562. this.detailRecord = record
  563. axios({
  564. url:
  565. 'api/xcoa-mobile/v1/spicAuditReportList/projectRectStatisticsDetail?projectId=' +
  566. record.projectId +
  567. '&onlyMoreThanZero=' +
  568. this.onlyMoreThanZero,
  569. method: 'post',
  570. }).then((res) => {
  571. console.log(res.data)
  572. this.projectFindsList = res.data.data
  573. })
  574. },
  575. hsaReadAuthorityPermission(record) {
  576. if (
  577. record.readAuthorityCodes != null &&
  578. record.readAuthorityCodes.indexOf(getUserInfo().account) > -1
  579. ) {
  580. return true
  581. }
  582. return false
  583. },
  584. linkProject(record) {
  585. if (
  586. (record.operatePermission || this.hsaReadAuthorityPermission(record)) &&
  587. (record.itemStatus === '02' ||
  588. record.itemStatus === '03' ||
  589. record.itemStatus === '04' ||
  590. record.itemStatus === '05' ||
  591. record.itemStatus === '07')
  592. ) {
  593. window.open('#/audit-work/?projectId=' + record.projectId)
  594. } else {
  595. var url = '/audit-project-detail?record=' + record.projectId
  596. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  597. if (refreshFlag) {
  598. }
  599. })
  600. }
  601. },
  602. radioOnChange(e, info) {
  603. debugger
  604. if (this.radioValue === '01') {
  605. this.rectRules.unitNames[0].required = true
  606. this.initGroupPicker()
  607. } else {
  608. this.rectRules.unitNames[0].required = false
  609. this.rectForm.unitNames = []
  610. this.handleRectStatistics('serach')
  611. }
  612. },
  613. initDatePicker() {
  614. const datePick = []
  615. const time = moment(new Date())
  616. datePick.push(time)
  617. datePick.push(time)
  618. this.rectForm.timeRange = datePick
  619. },
  620. initGroupPicker() {
  621. let userInfo = getUserInfo()
  622. const params = {
  623. orgId: userInfo.deptId,
  624. }
  625. axios({
  626. url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
  627. method: 'get',
  628. }).then((res) => {
  629. userInfo = res.data
  630. params.orgId = res.data.id
  631. axios({
  632. url: 'api/xcoa-mobile/v1/iamorg/findIamOrg',
  633. method: 'post',
  634. params,
  635. }).then((res) => {
  636. const userDeptValue = []
  637. const userDept = {
  638. code: res.data.orgId + '',
  639. name: res.data.orgName,
  640. text: res.data.orgName,
  641. id: res.data.orgId,
  642. type: 'Group',
  643. }
  644. userDeptValue.push(userDept)
  645. this.rectForm.unitNames = userDeptValue
  646. this.$refs.StatisticsSearchForm.validate()
  647. this.handleRectStatistics('serach')
  648. })
  649. })
  650. },
  651. initDictionaryInfo() {
  652. axios({
  653. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_AUDIT_TYPE',
  654. method: 'get',
  655. }).then((res) => {
  656. if (res.status === 200) {
  657. this.auditTypeOptions = res.data
  658. }
  659. })
  660. },
  661. dataLoadedsum(res) {
  662. if (res.data.length) {
  663. res.data.splice(0, res.data.length)
  664. const obj = {}
  665. let j = 0
  666. this.columnssum.forEach((item, index) => {
  667. if (index > 0) {
  668. obj[item.dataIndex] = res.respData[this.hjarr[j]]
  669. j++
  670. }
  671. })
  672. obj.id = 1
  673. obj.sumName = '合计'
  674. res.data.push(obj)
  675. return res
  676. }
  677. },
  678. fnonloadsum() {
  679. // 先删除合计行
  680. document.querySelectorAll('.ant-table-tbody .childsum').forEach((item) => item.remove())
  681. setTimeout(() => {
  682. if (
  683. document
  684. .getElementById('hj')
  685. .getElementsByClassName('ant-table-tbody')[0]
  686. .getElementsByTagName('tr').length > 0
  687. ) {
  688. const obj = document
  689. .getElementById('hj')
  690. .getElementsByClassName('ant-table-tbody')[0].firstChild
  691. obj.firstChild.colSpan = 3
  692. obj.classList.add('childsum')
  693. document.getElementsByClassName('ant-table-tbody')[1].appendChild(obj)
  694. }
  695. }, 0)
  696. },
  697. tableResize() {
  698. document
  699. .getElementsByClassName('ant-table-empty')[0]
  700. .getElementsByClassName('ant-table-tbody')[0]
  701. .appendChild(document.getElementsByClassName('ant-table-placeholder')[0])
  702. var width = document.getElementsByClassName('ant-table-tbody')[0].offsetWidth
  703. document.getElementsByClassName('ant-table-placeholder')[0].style.width = `${width}%`
  704. },
  705. dataLoaded(res) {
  706. this.dataKeysum++
  707. if (res.data.length) {
  708. res.data.forEach((item, index) => {
  709. item.id = index + 1
  710. })
  711. } else {
  712. this.tableResize()
  713. }
  714. return res
  715. },
  716. handleReset() {
  717. this.$refs.StatisticsSearchForm.resetFields()
  718. },
  719. processDetailReq(req, pagination) {
  720. req.data = {}
  721. },
  722. processReq(req, pagination) {
  723. req.data = {
  724. maxResults: req.data.maxResults,
  725. startPosition: req.data.startPosition,
  726. dateStart: this.reqData.dateStart,
  727. dateEnd: this.reqData.dateEnd,
  728. unitIds: this.reqData.unitNames,
  729. auditType: this.reqData.auditType,
  730. }
  731. return req
  732. },
  733. processReqsum(req, pagination) {
  734. req.data = {
  735. maxResults: req.data.maxResults,
  736. startPosition: req.data.startPosition,
  737. dateStart: this.reqData.dateStart,
  738. dateEnd: this.reqData.dateEnd,
  739. unitIds: this.reqData.unitNames,
  740. auditType: this.reqData.auditType,
  741. }
  742. return req
  743. },
  744. handleSearch() {
  745. this.reqData.startPosition = 0
  746. this.dataKey++
  747. this.dataKeysum++
  748. },
  749. handleRectStatistics(type) {
  750. this.$refs.StatisticsSearchForm.validate((valid, values) => {
  751. if (valid) {
  752. if (type === 'serach') {
  753. if (
  754. this.rectForm.timeRange.length === 0 &&
  755. this.rectForm.unitNames.length === 0 &&
  756. this.problemForm.auditType.length === 0
  757. ) {
  758. this.handleSearch()
  759. } else {
  760. // 处理时间
  761. this.reqData.dateStart = this.rectForm.timeRange[0].year() + ''
  762. this.reqData.dateEnd = this.rectForm.timeRange[1].year() + ''
  763. // 处理部门
  764. const arr = []
  765. this.rectForm.unitNames.forEach((item) => {
  766. arr.push(`'${item.id}'`)
  767. })
  768. this.reqData.unitNames = arr.join(',')
  769. this.reqData.unitIds = arr.join(',')
  770. if (this.rectForm.auditType.length !== 0) {
  771. const auditTypes = []
  772. this.rectForm.auditType.forEach((item) => {
  773. auditTypes.push(`'${item.id}'`)
  774. })
  775. this.reqData.auditType = auditTypes.join(',')
  776. } else {
  777. this.reqData.auditType = ''
  778. }
  779. this.handleSearch()
  780. }
  781. } else {
  782. debugger
  783. if (this.rectForm.timeRange.length === 0 && this.rectForm.unitNames.length === 0) {
  784. this.projectRectExport()
  785. } else {
  786. // 处理时间
  787. this.reqData.dateStart = this.rectForm.timeRange[0].year() + ''
  788. this.reqData.dateEnd = this.rectForm.timeRange[1].year() + ''
  789. // 处理部门
  790. const arr = []
  791. this.rectForm.unitNames.forEach((item) => {
  792. arr.push(`'${item.id}'`)
  793. })
  794. this.reqData.unitNames = arr.join(',')
  795. this.reqData.unitIds = arr.join(',')
  796. if (this.rectForm.auditType.length !== 0) {
  797. const auditTypes = []
  798. this.rectForm.auditType.forEach((item) => {
  799. auditTypes.push(`'${item.id}'`)
  800. })
  801. this.reqData.auditType = auditTypes.join(',')
  802. } else {
  803. this.reqData.auditType = ''
  804. }
  805. this.projectRectExport()
  806. }
  807. }
  808. }
  809. })
  810. },
  811. projectRectExport() {
  812. axios({
  813. method: 'post',
  814. url: 'api/xcoa-mobile/v1/spicAuditReportExport/exportProjectRectStatistics',
  815. responseType: 'blob',
  816. data: {
  817. unitIds: this.reqData.unitIds,
  818. dateStart: this.reqData.dateStart,
  819. dateEnd: this.reqData.dateEnd,
  820. auditType: this.reqData.auditType,
  821. },
  822. }).then((res) => {
  823. const url = URL.createObjectURL(res.data)
  824. download(url, '审计项目整改完成情况及成果统计表.xls')
  825. })
  826. },
  827. },
  828. }
  829. </script>
  830. <style module lang="scss">
  831. @use '@/common/design' as *;
  832. .personalStatistics {
  833. :global(.ant-table-body) {
  834. overflow-x: scroll !important;
  835. }
  836. :global(.ant-form-item) {
  837. margin: 0;
  838. }
  839. :global(.ant-table-empty) {
  840. :global(.ant-table-body) {
  841. overflow-x: scroll !important;
  842. }
  843. }
  844. .conditions {
  845. margin-bottom: 20px;
  846. }
  847. .buttonContent {
  848. padding-top: 6px;
  849. text-align: right;
  850. button {
  851. margin: 0 4px;
  852. }
  853. }
  854. :global(.anticon-setting) {
  855. display: none;
  856. }
  857. .tableTitle {
  858. padding-top: 16px;
  859. margin: 0;
  860. font-size: 22px;
  861. font-weight: bold;
  862. color: #404040;
  863. text-align: center;
  864. background: white;
  865. }
  866. :global(.reporttablecardxm) {
  867. :global(.ant-table-body) {
  868. height: auto !important;
  869. min-height: auto !important;
  870. overflow: auto;
  871. }
  872. }
  873. :global(.ant-table-placeholder) {
  874. height: auto !important;
  875. }
  876. }
  877. </style>