audit-statistics-find.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  1. <template>
  2. <div :class="$style.searchdiv">
  3. <a-card :class="$style.searchWrap">
  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 v-model="form.timeRange" :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="true"
  23. :read-only="false"
  24. :root-node="rootNode"
  25. />
  26. </a-form-model-item>
  27. </a-col>
  28. <a-col :span="8">
  29. <a-form-model-item label="统计维度" prop="statisticsRange">
  30. <a-radio-group v-model="form.statisticsRange">
  31. <a-radio v-for="mp in statisticsOptions" :key="mp.id" :value="mp.id">
  32. {{ mp.text }}
  33. </a-radio>
  34. </a-radio-group>
  35. </a-form-model-item>
  36. </a-col>
  37. </a-row>
  38. <a-row>
  39. <a-col :span="16"> </a-col>
  40. <a-col :class="$style.searchbutton" :span="8">
  41. <div class="reportbuttonContent" style="margin-right: 15%">
  42. <a-button @click="handleReset">重置</a-button>
  43. <a-button type="primary" html-type="submit" @click="submitForm">查询</a-button>
  44. <a-button :loading="exportLoading" type="primary" @click="exportData">导出</a-button>
  45. </div>
  46. </a-col>
  47. </a-row>
  48. </a-form-model>
  49. </a-card>
  50. <a-card class="reporttablecardxm">
  51. <span class="header_sd-header_common"
  52. ><span :class="['toptitle', $style.toptitle]">审计发现统计</span></span
  53. >
  54. <template v-if="flagpie && JSON.stringify(pieoption.series[0].data) !== '[]'">
  55. <div :class="$style.piespan">
  56. <!-- <div :class="$style.cate">
  57. <a-icon
  58. v-show="historyFindCate.length > 1"
  59. type="left-circle"
  60. theme="filled"
  61. :class="$style.backicon"
  62. @click="gotoHistory"
  63. ></a-icon>
  64. <ul>
  65. <li v-for="(cate, index) in findCate" :key="cate.id" @click="rowClick_lb(cate)">
  66. <div :class="$style.pdiv" :style="{ background: bgcolor[index] }"></div>
  67. <span :class="$style.cateliSpan">{{ cate.text }}</span>
  68. <span :class="$style.cateliPoint">{{ ' |' + cate.percent + '\u2002\u2002' }}</span>
  69. <span style="color:#0162eb">{{ cate.value }}</span>
  70. </li>
  71. </ul>
  72. </div> -->
  73. <div :class="$style.cate">
  74. <a-icon
  75. v-show="historyFindCate.length > 1"
  76. type="left-circle"
  77. theme="filled"
  78. :class="$style.backicon"
  79. @click="gotoHistory"
  80. ></a-icon>
  81. <ul>
  82. <li
  83. v-for="(cate, index) in findCate"
  84. :key="cate.id"
  85. @click="clickFindAuditTree(cate)"
  86. >
  87. <div :class="$style.pdiv" :style="{ background: bgcolor[index] }"></div>
  88. <!-- {{ cate.text + ' |' + cate.percent + ' ' + cate.value }} -->
  89. <span :class="$style.cateliSpan">{{ cate.text }}</span>
  90. <span :class="$style.cateliPoint">{{ ' |' + cate.percent + '\u2002\u2002' }}</span>
  91. <span style="color: #0162eb" @click.stop="rowClick_lb(cate)">{{ cate.value }}</span>
  92. </li>
  93. </ul>
  94. </div>
  95. <sd-echart :class="$style.echarts" :options="pieoption" autoresize />
  96. </div>
  97. </template>
  98. <template v-else-if="flagtb && option.series.length !== 0">
  99. <div>
  100. <sd-echart :key="optionkey" :class="$style.echarts" :options="option" autoresize
  101. /></div>
  102. </template>
  103. <template
  104. v-else-if="
  105. JSON.stringify(pieoption.series[0].data) === '[]' && option.series.length === 0 && !flag
  106. "
  107. >
  108. <div :class="$style.emptyecharts"> </div>
  109. </template>
  110. <sd-data-table
  111. v-show="!flagpie"
  112. :key="tableKey"
  113. ref="dataTable"
  114. class="findTable"
  115. :projectlist="true"
  116. data-url="api/xcoa-mobile/v1/iam-statistics/getAuditProjectList"
  117. :columns="columns"
  118. :row-key="(record, index) => index"
  119. :process-req="processReq"
  120. :defultpagination-pagesize="50"
  121. @dataLoaded="dataLoaded"
  122. @rowClick="rowClick"
  123. @fnonloadsum="fnonloadsum"
  124. >
  125. <template slot="SUM1" slot-scope="text, record">
  126. <span v-if="text === '0' || text === 0">{{ text }}</span>
  127. <a v-else @click="rowClick(record, 1)">{{ text }}</a>
  128. </template>
  129. <template slot="SUM2" slot-scope="text, record">
  130. <span v-if="text === '0' || text === 0">{{ text }}</span>
  131. <a v-else @click="rowClick(record, 2)">{{ text }}</a>
  132. </template>
  133. </sd-data-table>
  134. </a-card>
  135. </div>
  136. </template>
  137. <script>
  138. import 'echarts/lib/chart/treemap'
  139. import 'echarts/lib/chart/pie'
  140. import 'echarts/lib/chart/pictorialBar'
  141. import 'echarts/lib/component/title'
  142. import 'echarts/lib/chart/bar'
  143. import 'echarts/lib/component/legend'
  144. import 'echarts/lib/component/legendScroll'
  145. import 'echarts/lib/component/tooltip'
  146. import moment from 'moment'
  147. import AuditRangePicker from '../../components/picker/audit-range-picker.vue'
  148. import AuditGroupPicker from '../../components/picker/audit-group-picker.vue'
  149. import StatisticsService from './statistics-service'
  150. import components from './_import-components/audit-statistics-find-import'
  151. import { Modal, message } from '@/common/one-ui'
  152. import axios from '@/common/services/axios-instance'
  153. import { getUserInfo } from '@/common/store-mixin'
  154. import TableColumnTypes from '@/common/services/table-column-types'
  155. import download from '@/common/services/download'
  156. const echarts = require('echarts/lib/echarts')
  157. export default {
  158. name: 'AuditStatisticsFind',
  159. metaInfo: {
  160. title: '审计发现统计',
  161. },
  162. components: {
  163. ...components,
  164. AuditRangePicker,
  165. AuditGroupPicker,
  166. },
  167. data() {
  168. return {
  169. exportLoading: false,
  170. optionkey: 0,
  171. bgcolor: [
  172. '#7585A2',
  173. '#73A0FA',
  174. '#8CCF9E',
  175. '#E15F30',
  176. '#EA9200',
  177. '#5553CE',
  178. '#1363D5',
  179. '#73DEB3',
  180. '#CFE615',
  181. '#FFB94E',
  182. ],
  183. parentId: null,
  184. historyFindCate: ['AUDIT_FIND_CATEGORY'],
  185. findCate: [],
  186. data: [],
  187. columns: [],
  188. findcolumns: [
  189. {
  190. title: '序号',
  191. dataIndex: 'sortNum',
  192. width: '80px',
  193. sdHidden: false,
  194. },
  195. {
  196. title: '发现类别',
  197. dataIndex: 'FIND_TYPE',
  198. },
  199. {
  200. title: '占比',
  201. dataIndex: 'PERCENT',
  202. },
  203. {
  204. title: '数量',
  205. dataIndex: 'NUM',
  206. },
  207. ],
  208. formItemLayout: {
  209. labelCol: { span: 6 },
  210. wrapperCol: { span: 14 },
  211. },
  212. dateFormat: 'YYYY',
  213. form: {
  214. statisticsRange: '1',
  215. unitNames: [],
  216. timeRange: [],
  217. },
  218. rules: {
  219. timeRange: [{ required: true, message: '请选择统计时间', trigger: 'change' }],
  220. unitNames: [{ required: true, message: '请选择审计机构', trigger: 'change' }],
  221. statisticsRange: [{ required: true, message: '请选择统计维度', trigger: 'change' }],
  222. },
  223. statisticsOptions: [
  224. { text: '按被审计单位', id: '1' },
  225. { text: '按审计发现类别', id: '2' },
  226. ],
  227. params: {},
  228. radioStyle: {
  229. display: 'block',
  230. height: '30px',
  231. lineHeight: '30px',
  232. width: '100%',
  233. },
  234. flag: true,
  235. flagpie: false,
  236. flagtb: false,
  237. option: {
  238. tooltip: {
  239. trigger: 'axis',
  240. axisPointer: {
  241. type: 'shadow',
  242. },
  243. },
  244. xAxis: {
  245. type: 'category',
  246. data: [],
  247. axisLabel: {
  248. show: true,
  249. interval: 0,
  250. rotate: -40,
  251. inside: false,
  252. margin: 6,
  253. },
  254. },
  255. yAxis: {
  256. type: 'value',
  257. },
  258. series: [
  259. // {
  260. // data: [],
  261. // type: 'bar',
  262. // itemStyle: {
  263. // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  264. // { offset: 0, color: '#6ee394' },
  265. // { offset: 0.5, color: '#5ac5c5' },
  266. // { offset: 1, color: '#49adef' },
  267. // ]),
  268. // },
  269. // },
  270. ],
  271. },
  272. total: 0,
  273. // pieoption: {
  274. // title: [
  275. // {
  276. // text: '{name|问题总计}\n{val|' + this.total + '}',
  277. // top: 'center',
  278. // left: 'center',
  279. // textStyle: {
  280. // rich: {
  281. // name: {
  282. // fontSize: 14,
  283. // fontWeight: 'normal',
  284. // color: '#666666',
  285. // padding: [10, 0],
  286. // },
  287. // val: {
  288. // fontSize: 32,
  289. // fontWeight: 'bold',
  290. // color: '#333333',
  291. // },
  292. // },
  293. // },
  294. // },
  295. // ],
  296. // tooltip: {
  297. // trigger: 'item',
  298. // formatter: '{b} <br/>{c}个 {d}%',
  299. // },
  300. // legend: {
  301. // show: false,
  302. // data: [],
  303. // icon: 'circle',
  304. // orient: 'vertical',
  305. // x: 'right',
  306. // top: 'middle',
  307. // align: 'left',
  308. // left: '70%',
  309. // },
  310. // series: [
  311. // {
  312. // type: 'pie',
  313. // radius: ['45%', '60%'],
  314. // center: ['50%', '50%'],
  315. // data: [],
  316. // hoverAnimation: false,
  317. // },
  318. // ],
  319. // },
  320. pieoption: {
  321. textStyle: {
  322. color: '#8a8a8a',
  323. fontSize: 13,
  324. },
  325. tooltip: {
  326. trigger: 'item',
  327. formatter: '{b} <br/>{c}个 {d}%',
  328. },
  329. legend: {
  330. show: false,
  331. type: 'scroll',
  332. orient: 'vertical',
  333. right: 59,
  334. icon: 'circle',
  335. top: 50,
  336. textStyle: {
  337. color: '#8a8a8a',
  338. lineHeight: 18,
  339. },
  340. data: [],
  341. },
  342. series: [
  343. {
  344. top: 30,
  345. left: -100,
  346. type: 'pie',
  347. radius: ['45%', '60%'],
  348. avoidLabelOverlap: true,
  349. data: [],
  350. label: {
  351. padding: [0, -90],
  352. formatter: '{b}\n',
  353. },
  354. labelLine: {
  355. length2: 90,
  356. },
  357. },
  358. {
  359. type: 'pie',
  360. top: 30,
  361. left: -100,
  362. radius: [9999, 9999],
  363. label: {
  364. show: true,
  365. position: 'center',
  366. fontSize: 20,
  367. fontWeight: 'bold',
  368. formatter: ['{name|{b}}', '{num|{c}}'].join('\n'),
  369. rich: {
  370. name: {
  371. fontSize: 14,
  372. lineHeight: 30,
  373. color: '#333',
  374. },
  375. num: {
  376. fontSize: 30,
  377. fontWeight: 600,
  378. color: '#333',
  379. },
  380. },
  381. },
  382. emphasis: {
  383. disabled: true,
  384. scale: true,
  385. scaleSize: 0,
  386. },
  387. tooltip: {
  388. show: false,
  389. },
  390. labelLine: {
  391. show: true,
  392. },
  393. data: [],
  394. },
  395. ],
  396. },
  397. type: '',
  398. tableKey: 0,
  399. rootNode: {},
  400. }
  401. },
  402. created() {
  403. let userInfo = getUserInfo()
  404. const params = {
  405. orgId: userInfo.deptId,
  406. }
  407. axios({
  408. url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
  409. method: 'get',
  410. }).then((res) => {
  411. userInfo = res.data
  412. params.orgId = res.data.id
  413. axios({
  414. url: 'api/xcoa-mobile/v1/iamorg/findIamOrgId',
  415. method: 'post',
  416. params,
  417. }).then((res) => {
  418. this.id = res.data
  419. const deptCode = userInfo.id.toString()
  420. const deptName = userInfo.name
  421. this.rootNode = { code: deptCode, name: deptName, id: this.id }
  422. })
  423. })
  424. // 获取审计发现类别
  425. this.getFindAuditTree(this.historyFindCate[0])
  426. },
  427. methods: {
  428. /**
  429. * 点击分类,获取下级
  430. */
  431. clickFindAuditTree(cate) {
  432. if (cate.leaf) {
  433. message.info('已是末级节点')
  434. return false
  435. }
  436. this.getFindAuditTree(cate.id)
  437. this.historyFindCate.push(cate.id)
  438. },
  439. /**
  440. * 获取审计发现类别
  441. */
  442. getFindAuditTree(parentId) {
  443. this.params.parentId = parentId
  444. this.parentId = parentId
  445. if (!parentId) this.parentId = 'AUDIT_FIND_CATEGORY'
  446. StatisticsService.getFindAuditTree(this.parentId).then((res) => {
  447. this.findCate = res.data
  448. this.dataLoaded({
  449. data: [],
  450. })
  451. })
  452. },
  453. /**
  454. * 返回上一层级
  455. */
  456. gotoHistory() {
  457. const l = this.historyFindCate.length - 2
  458. const parentId = this.historyFindCate[l]
  459. this.historyFindCate.splice(l + 1, 1)
  460. this.getFindAuditTree(parentId)
  461. },
  462. dataLoaded(eventData) {
  463. if (this.flag) {
  464. return
  465. }
  466. eventData.data.forEach((item, index) => {
  467. item.sortNum = index + 1
  468. item.id = index
  469. })
  470. const ndata = []
  471. if (this.type === '2') {
  472. const params = {
  473. // columns: columns.join(','),
  474. maxResults: 9999,
  475. startPosition: 0,
  476. expressions: [],
  477. dimension: 'findType',
  478. dateStart: '' + this.params.dateStart,
  479. dateEnd: '' + this.params.dateEnd,
  480. unitNames: this.form.unitNames.map((n) => "'" + n.id + "'").join(','),
  481. unitIds: this.form.unitNames.map((n) => "'" + n.id + "'").join(','),
  482. pageIndex: 0,
  483. pageSize: 9999,
  484. parentId: this.parentId,
  485. }
  486. // 按审计发现类别
  487. StatisticsService.getReportFindList(params).then((res) => {
  488. const dataObj = res.data
  489. // 有数据才展示
  490. if (dataObj.data.length > 0) {
  491. this.hasData = true
  492. } else {
  493. this.hasData = false
  494. }
  495. dataObj.data.forEach((item, index) => {
  496. item.sortNum = index + 1
  497. item.id = index
  498. })
  499. const ndata = []
  500. const npie = []
  501. let isAllZero = true
  502. dataObj.data.forEach((item, index) => {
  503. const obj = {
  504. name: item.FIND_TYPE.replace(/"/g, ''),
  505. value: parseFloat(item.NUM),
  506. PERCENT: item.PERCENT,
  507. label: {
  508. show: parseFloat(item.NUM) !== 0,
  509. },
  510. labelLine: {
  511. show: parseFloat(item.NUM) !== 0,
  512. },
  513. }
  514. if (parseFloat(item.NUM) !== 0) {
  515. isAllZero = false
  516. }
  517. npie.push(obj)
  518. ndata.push(item.FIND_TYPE)
  519. // 根据类别名,将数量又写会cate里面
  520. this.findCate.forEach((cate) => {
  521. if (cate.text === item.FIND_TYPE.replace(/"/g, '')) {
  522. this.$set(cate, 'value', item.NUM)
  523. this.$set(cate, 'percent', item.PERCENT)
  524. }
  525. })
  526. })
  527. if (isAllZero) {
  528. npie.forEach((item) => {
  529. item.label.show = true
  530. item.labelLine.show = true
  531. })
  532. }
  533. this.findCate.sort((a, b) => {
  534. if (parseFloat(a.value) > parseFloat(b.value)) return -1
  535. if (parseFloat(a.value) < parseFloat(b.value)) return 1
  536. if (parseFloat(a.value) === parseFloat(b.value)) return 0
  537. })
  538. // this.pieoption.title[0].text = '{name|问题总计}\n{val|' + dataObj.sum + '}'
  539. this.pieoption.series[1].data = []
  540. this.pieoption.series[1].data.push({ value: dataObj.sum, name: '问题总计' })
  541. this.pieoption.series[0].data = npie
  542. this.pieoption.legend.data = ndata
  543. this.pieoption.legend.formatter = function (name) {
  544. const obj = npie.find((item) => item.name === name)
  545. return name + ' |' + obj.PERCENT + ' ' + obj.value
  546. }
  547. })
  548. // const npie = []
  549. // this.findCate = []
  550. // eventData.data.forEach((item) => {
  551. // const obj = {
  552. // name: item.FIND_TYPE,
  553. // value: item.NUM,
  554. // PERCENT: item.PERCENT,
  555. // }
  556. // npie.push(obj)
  557. // ndata.push(item.FIND_TYPE)
  558. // // 根据类别名,将数量又写会cate里面
  559. // this.findCate.push({
  560. // text: item.FIND_TYPE.replace(/"/g, ''),
  561. // value: item.NUM,
  562. // percent: item.PERCENT,
  563. // })
  564. // })
  565. // this.findCate.sort((a, b) => {
  566. // if (parseFloat(a.value) > parseFloat(b.value)) return -1
  567. // if (parseFloat(a.value) < parseFloat(b.value)) return 1
  568. // if (parseFloat(a.value) === parseFloat(b.value)) return 0
  569. // })
  570. // this.pieoption.title[0].text = '{name|问题总计}\n{val|' + eventData.respData.sum + '}'
  571. // this.pieoption.series[0].data = npie
  572. // this.pieoption.legend.data = ndata
  573. // this.pieoption.legend.formatter = function(name) {
  574. // const obj = npie.find((item) => item.name === name)
  575. // return name + ' |' + obj.PERCENT + ' ' + obj.value
  576. // }
  577. this.flagpie = true
  578. this.flagtb = false
  579. } else {
  580. // 先默认给个空
  581. // this.historyFindCate = ['AUDIT_FIND_CATEGORY']
  582. const ntb = []
  583. this.option.series = ntb
  584. eventData.data.forEach((item) => {
  585. ntb.push(item[this.params.dateEnd])
  586. ndata.push(item.AUDITED_UNIT)
  587. })
  588. // 计算开始时间到结束时间的年份
  589. let st = parseFloat(this.params.dateStart)
  590. const et = parseFloat(this.params.dateEnd)
  591. // 开始时间结束时间差
  592. const ss = et - st
  593. for (let i = 0; i <= ss; i++) {
  594. const dataList = []
  595. eventData.data.forEach((item) => {
  596. dataList.push(item[st])
  597. })
  598. ntb.push({
  599. name: st + '',
  600. data: dataList,
  601. type: 'bar',
  602. itemStyle: {
  603. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  604. { offset: 0, color: '#6ee394' },
  605. { offset: 0.5, color: '#5ac5c5' },
  606. { offset: 1, color: '#49adef' },
  607. ]),
  608. },
  609. })
  610. st++
  611. }
  612. // this.option.series[0].data = ntb
  613. this.option.series = ntb
  614. this.option.xAxis.data = ndata
  615. this.flagtb = true
  616. this.flagpie = false
  617. this.optionkey++
  618. }
  619. return eventData
  620. },
  621. fnonloadsum() {
  622. if (this.flag) {
  623. document.querySelector('.findTable .ant-table-wrapper').style.display = 'none'
  624. } else {
  625. document.querySelector('.findTable .ant-table-wrapper').style.display = ''
  626. }
  627. },
  628. submitForm() {
  629. this.flag = false
  630. this.$refs.advancedSearchForm.validate((valid, values) => {
  631. if (valid) {
  632. let startYear = moment(this.form.timeRange[0]).format('YYYY')
  633. const endYear = moment(this.form.timeRange[1]).format('YYYY')
  634. const type = this.form.statisticsRange
  635. this.type = type
  636. this.params.dateStart = startYear
  637. this.params.dateEnd = endYear
  638. if (type === '1') {
  639. this.params.dimension = 'units'
  640. this.columns = [
  641. {
  642. title: '序号',
  643. dataIndex: 'sortNum',
  644. width: '80px',
  645. sdHidden: false,
  646. },
  647. {
  648. title: '被审计单位id',
  649. dataIndex: 'AUDITED_UNIT_IDS',
  650. width: '30%',
  651. sdHidden: true,
  652. },
  653. {
  654. title: '被审计单位',
  655. dataIndex: 'AUDITED_UNIT',
  656. width: '30%',
  657. sdHidden: false,
  658. },
  659. ]
  660. while (startYear <= endYear) {
  661. this.columns.push({
  662. title: startYear.toString(),
  663. dataIndex: startYear.toString(),
  664. scopedSlots: { customRender: 'number' },
  665. sdClickable: true,
  666. })
  667. startYear++
  668. }
  669. } else if (type === '2') {
  670. this.params.dimension = 'findType'
  671. this.columns = this.findcolumns
  672. }
  673. this.params.unitNames = this.form.unitNames.map((n) => "'" + n.id + "'").join(',')
  674. this.params.unitIds = this.form.unitNames.map((n) => "'" + n.id + "'").join(',')
  675. this.tableKey++
  676. }
  677. })
  678. },
  679. processReq(req) {
  680. if (!this.params.dimension) {
  681. this.params.dimension = 'units'
  682. }
  683. req.data = {
  684. ...req.data,
  685. dateStart: this.params.dateStart,
  686. dateEnd: this.params.dateEnd,
  687. dimension: this.params.dimension,
  688. unitIds: this.params.unitNames,
  689. pageIndex: req.data.startPosition,
  690. pageSize: req.data.maxResults,
  691. }
  692. return req
  693. },
  694. handleReset() {
  695. this.$refs.advancedSearchForm.resetFields()
  696. // 特殊处理,清空字段值
  697. // this.handlesearch()
  698. },
  699. // 导出接口
  700. exportData() {
  701. if (this.$refs.dataTable.data.length === 0) {
  702. message.warning('未查询出可导出数据', 1)
  703. return
  704. }
  705. this.exportLoading = true
  706. StatisticsService.exportData(this.params)
  707. .then((data) => {
  708. const url = URL.createObjectURL(data)
  709. download(url, '审计项目统计.xls')
  710. this.exportLoading = false
  711. })
  712. .catch(() => {
  713. message.error('导出失败')
  714. this.exportLoading = false
  715. })
  716. },
  717. rowClick_lb(cate) {
  718. const param = {}
  719. const unit = this.form.unitNames.map((n) => "'" + n.id + "'")
  720. const unitName = unit.join(',')
  721. param.unitIds = unitName
  722. param.dateStart = this.params.dateStart
  723. param.dateEnd = this.params.dateEnd
  724. param.findType = cate.id
  725. param.dimension = 'findType'
  726. const url =
  727. '#/audit-problemamount-find-list?params=' +
  728. encodeURIComponent(JSON.stringify(param)) +
  729. '&type=projectlist'
  730. window.open(url)
  731. },
  732. rowClick(record, lb) {
  733. const type = this.form.statisticsRange
  734. const param = {}
  735. if (this.form.unitNames.length) {
  736. const unit = this.form.unitNames.map((n) => "'" + n.id + "'")
  737. const unitName = unit.join(',')
  738. param.unitIds = unitName
  739. }
  740. // if (lb === 1) {
  741. // param.dateStart = this.params.dateStart
  742. // } else {
  743. // param.dateStart = this.params.dateEnd
  744. // }
  745. param.dateStart = lb.column.dataIndex
  746. if (type === '1') {
  747. param.auditedUnitId = record.AUDITED_UNIT_IDS
  748. } else {
  749. param.findType = record.findType
  750. }
  751. const url =
  752. '#/audit-problemamount-find-list?params=' +
  753. encodeURIComponent(JSON.stringify(param)) +
  754. '&type=projectlist'
  755. window.open(url)
  756. // let time = ''
  757. // if (lb === 1) {
  758. // time = this.params.dateStart
  759. // } else {
  760. // time = this.params.dateEnd
  761. // }
  762. // window.open(`#/audit-statistics-find-list?unit=${record.AUDITED_UNIT}&time=${time}`, '_blank')
  763. },
  764. },
  765. }
  766. </script>
  767. <style module lang="scss">
  768. @use '@/common/design' as *;
  769. // .conditions {
  770. // margin-bottom: 10px;
  771. // }
  772. // .statistics {
  773. // background-color: #f0f2f5;
  774. // .toggle {
  775. // float: right;
  776. // margin-right: 8px;
  777. // }
  778. // .text-right {
  779. // // text-align: right;
  780. // }
  781. // .reset-btn {
  782. // margin: 0 5px 10px;
  783. // }
  784. // .buttonContent {
  785. // text-align: right;
  786. // button {
  787. // margin: 0 4px;
  788. // }
  789. // }
  790. // .echarts {
  791. // width: 100%;
  792. // height: 400px;
  793. // margin: auto auto;
  794. // text-align: center;
  795. // }
  796. // }
  797. .toptitle {
  798. margin-left: calc(50% - 150px);
  799. font-size: 22px;
  800. font-weight: bold;
  801. color: #404040;
  802. }
  803. .search-wrap {
  804. margin-bottom: $padding-lg;
  805. :global(.ant-advanced-search-form) {
  806. padding: 0;
  807. background: transparent;
  808. border: none;
  809. }
  810. :global .ant-divider-horizontal {
  811. margin: 10px 0;
  812. }
  813. }
  814. .searchdiv {
  815. height: 100%;
  816. background-color: #f0f2f5;
  817. :global(.sd-has-table.ant-card) {
  818. min-height: calc(100vh - 320px);
  819. }
  820. :global(.reporttablecardxm) {
  821. :global(.ant-table-body) {
  822. height: calc(100vh - 350px);
  823. overflow: auto;
  824. }
  825. }
  826. }
  827. .emptyecharts {
  828. width: 600px;
  829. height: 400px;
  830. margin: auto auto;
  831. text-align: center;
  832. &::after {
  833. display: block;
  834. padding-top: 150px;
  835. content: '无数据';
  836. }
  837. }
  838. .echarts {
  839. width: 100%;
  840. height: 400px;
  841. margin: auto auto;
  842. text-align: center;
  843. }
  844. .piespan {
  845. position: relative;
  846. margin-left: -600px;
  847. .cate {
  848. position: absolute;
  849. top: 30px;
  850. right: 300px;
  851. z-index: 5;
  852. // overflow: auto;
  853. // height: 250px;
  854. li {
  855. position: relative;
  856. padding-left: 15px;
  857. font-size: 13px;
  858. line-height: 23px;
  859. color: #919191;
  860. list-style: none;
  861. cursor: pointer;
  862. }
  863. }
  864. }
  865. .pdiv {
  866. position: absolute;
  867. top: 5px;
  868. left: -7px;
  869. width: 14px;
  870. height: 14px;
  871. background: #54c5eb;
  872. border-radius: 11px;
  873. }
  874. .cateli-span {
  875. display: inline-block;
  876. width: 180px;
  877. color: #0162eb;
  878. }
  879. .cateli-point {
  880. display: inline-block;
  881. width: 80px;
  882. }
  883. .backicon {
  884. position: absolute;
  885. top: 3px;
  886. left: 5px;
  887. cursor: pointer;
  888. }
  889. </style>