cube-audit-find-report.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <template>
  2. <div :class="$style.searchdiv">
  3. <a-card :class="$style.searchWrap">
  4. <a-form-model
  5. ref="advancedSearchForm"
  6. :class="$style.antAdvancedSearchForm"
  7. :model="form"
  8. v-bind="formItemLayout"
  9. layout="horizontal"
  10. >
  11. <a-row :gutter="24">
  12. <a-col :span="8">
  13. <a-form-model-item
  14. :label="'年度'"
  15. prop="year"
  16. :rules="[{ required: true, message: '请选择年度' }]"
  17. >
  18. <!-- <a-space direction="vertical" :size="12"> -->
  19. <AudiitRangePicker :time-range.sync="form.year"></AudiitRangePicker>
  20. <!-- </a-space> -->
  21. </a-form-model-item>
  22. </a-col>
  23. <a-col :span="8">
  24. <a-form-model-item
  25. :label="'审计机构'"
  26. prop="units"
  27. :rules="[{ required: true, message: '请选择审计机构' }]"
  28. >
  29. <AuditGroupPicker
  30. v-model="form.units"
  31. :single="false"
  32. :read-only="false"
  33. :root-node="rootNode"
  34. />
  35. </a-form-model-item>
  36. </a-col>
  37. <a-col :span="8">
  38. <a-form-model-item label="项目名称">
  39. <a-input v-model="form.projectName"></a-input>
  40. </a-form-model-item>
  41. </a-col>
  42. </a-row>
  43. <a-row :gutter="24">
  44. <a-col :span="8">
  45. <a-form-model-item label="被审计单位">
  46. <sd-group-picker v-model="form.auditedUnits" :single="false" :read-only="false" />
  47. </a-form-model-item>
  48. </a-col>
  49. <a-col :span="8">
  50. <a-form-model-item label="是否问责">
  51. <a-select v-model="form.whetherOrderDuty" :allow-clear="true" :placeholder="'请选择'">
  52. <a-select-option value="0">
  53. </a-select-option>
  54. <a-select-option value="1">
  55. </a-select-option>
  56. </a-select>
  57. </a-form-model-item>
  58. </a-col>
  59. <a-col :span="8">
  60. <a-form-model-item label="审计发现标题">
  61. <a-input v-model="form.findTitle"></a-input>
  62. </a-form-model-item>
  63. </a-col>
  64. </a-row>
  65. <a-row :gutter="24">
  66. <a-col :span="8">
  67. <a-form-model-item label="审计发现类别">
  68. <a-input v-model="form.findType"></a-input>
  69. </a-form-model-item>
  70. </a-col>
  71. <a-col :span="8">
  72. <a-form-model-item label="问题类型">
  73. <a-select v-model="form.problemType" :allow-clear="true" :placeholder="'请选择'">
  74. <a-select-option
  75. v-for="(item, index) in problemOptions"
  76. :key="index"
  77. :value="item.id"
  78. >
  79. {{ item.name }}
  80. </a-select-option>
  81. </a-select>
  82. </a-form-model-item>
  83. </a-col>
  84. <a-col :span="8">
  85. <a-form-model-item label="风险评级">
  86. <a-select v-model="form.riskLevel" :allow-clear="true" :placeholder="'请选择'">
  87. <a-select-option
  88. v-for="(risk, index) in riskOptions"
  89. :key="index"
  90. :value="risk.id"
  91. >{{ risk.name }}</a-select-option
  92. >
  93. </a-select>
  94. </a-form-model-item>
  95. </a-col>
  96. </a-row>
  97. <a-row>
  98. <a-col :span="16"> </a-col>
  99. <a-col :class="$style.searchbutton" :span="8">
  100. <div class="reportbuttonContent" style="margin-right:15%">
  101. <a-button @click="handleReset">
  102. 重置
  103. </a-button>
  104. <a-button type="primary" @click="handleSearch">
  105. 查询
  106. </a-button>
  107. <a-button type="primary" @click="exportForm">知识图谱</a-button>
  108. <audit-advanced-export
  109. ref="export"
  110. :class-style="[$style.buttonSpacing]"
  111. :v-if="false"
  112. :config-id="91"
  113. :exclebxh="false"
  114. :expressions="expressions"
  115. ></audit-advanced-export>
  116. </div>
  117. </a-col>
  118. </a-row>
  119. </a-form-model>
  120. <!-- <findReportSearch :search="search" :expressions="expressions"> </findReportSearch> -->
  121. </a-card>
  122. <a-card class="reporttablecardxm">
  123. <span class="header_sd-header_common"
  124. ><span :class="['toptitle', $style.toptitle]">审计问题查询</span></span
  125. >
  126. <sd-data-table
  127. ref="sjzlTable"
  128. :row-key="(record, index) => index"
  129. :filter-expressions="expressions"
  130. :projectlist="true"
  131. :columns="columns"
  132. :data-url="'api/xcoa-mobile/v1/audit-report-find/find-report'"
  133. :show-advance-query="false"
  134. :scroll="{ x: 1500, y: 300 }"
  135. :defultpagination-pagesize="50"
  136. @searchbtnClick="searchbtnClick"
  137. >
  138. <template slot="findType" slot-scope="text, record">
  139. {{ JSON.parse(text).text }}
  140. </template>
  141. <template slot="whetherOrderDuty" slot-scope="text, record">
  142. {{ text === 0 ? '是' : '否' }}
  143. </template>
  144. </sd-data-table>
  145. </a-card>
  146. </div>
  147. </template>
  148. <script>
  149. import { message } from '@/common/one-ui'
  150. import axios from '@/common/services/axios-instance'
  151. import { getUserInfo } from '@/common/store-mixin'
  152. import auditAdvancedExport from '@product/iam/components/audit-advanced-export'
  153. import AudiitRangePicker from '@product/iam/components/picker/audit-range-picker'
  154. import AuditGroupPicker from '@product/iam/components/picker/audit-group-picker.vue'
  155. import auditAdvancedQueryMixins from '@product/iam/components/audit-advanced-query-mixins'
  156. import components from './_import-components/cube-audit-find-report-import'
  157. export default {
  158. name: 'CubeAuditFindReport',
  159. components: {
  160. ...components,
  161. AudiitRangePicker,
  162. auditAdvancedExport,
  163. AuditGroupPicker,
  164. },
  165. metaInfo: {
  166. title: '审计问题',
  167. },
  168. mixins: [auditAdvancedQueryMixins],
  169. data() {
  170. return {
  171. expressions: [],
  172. columns: [
  173. {
  174. title: '序号',
  175. customRender: (text, record, index) => `${index + 1}`,
  176. width: '80px',
  177. },
  178. {
  179. title: '审计机构',
  180. dataIndex: 'unitName',
  181. width: '120px',
  182. },
  183. {
  184. title: '项目名称',
  185. dataIndex: 'projectTitle',
  186. width: '170px',
  187. },
  188. {
  189. title: '项目编号',
  190. dataIndex: 'projectCode',
  191. width: '170px',
  192. },
  193. {
  194. title: '项目组长',
  195. dataIndex: 'groupLeaderName',
  196. width: '170px',
  197. },
  198. {
  199. title: '被审计单位',
  200. dataIndex: 'auditedUnitName',
  201. width: '170px',
  202. },
  203. {
  204. title: '审计问题发现提出人',
  205. dataIndex: 'creatFindOr',
  206. width: '180px',
  207. },
  208. {
  209. title: '审计发现标题',
  210. dataIndex: 'findTitle',
  211. width: '170px',
  212. },
  213. {
  214. title: '审计发现类别',
  215. dataIndex: 'findType',
  216. scopedSlots: { customRender: 'findType' },
  217. width: '170px',
  218. },
  219. {
  220. title: '审计发现描述',
  221. dataIndex: 'findDesc',
  222. width: '170px',
  223. },
  224. {
  225. title: '审计建议类型',
  226. dataIndex: 'suggestionType',
  227. scopedSlots: { customRender: 'suggestionType' },
  228. width: '170px',
  229. },
  230. {
  231. title: '问题类型',
  232. dataIndex: 'problemType',
  233. scopedSlots: { customRender: 'problemType' },
  234. width: '170px',
  235. },
  236. {
  237. title: '问题涉及金额(万元)',
  238. dataIndex: 'allMoney',
  239. width: '200px',
  240. },
  241. {
  242. title: '风险评级',
  243. dataIndex: 'riskLevel',
  244. width: '170px',
  245. },
  246. {
  247. title: '问题所属领域',
  248. dataIndex: 'businessProcess',
  249. width: '170px',
  250. },
  251. {
  252. title: '是否问责',
  253. dataIndex: 'whetherOrderDuty',
  254. scopedSlots: { customRender: 'whetherOrderDuty' },
  255. width: '170px',
  256. },
  257. ],
  258. formItemLayout: {
  259. labelCol: { span: 6 },
  260. wrapperCol: { span: 14 },
  261. },
  262. form: {},
  263. riskOptions: [],
  264. problemOptions: [],
  265. auditModeOptions: [],
  266. rootNode: {},
  267. }
  268. },
  269. created() {
  270. let userInfo = getUserInfo()
  271. const params = {
  272. orgId: userInfo.deptId,
  273. }
  274. axios({
  275. url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
  276. method: 'get',
  277. }).then((res) => {
  278. userInfo = res.data
  279. params.orgId = res.data.id
  280. axios({
  281. url: 'api/xcoa-mobile/v1/iamorg/findIamOrgId',
  282. method: 'post',
  283. params,
  284. }).then((res) => {
  285. this.id = res.data
  286. const deptCode = userInfo.id.toString()
  287. const deptName = userInfo.name
  288. this.rootNode = { code: deptCode, name: deptName, id: this.id }
  289. })
  290. })
  291. },
  292. mounted() {
  293. // 初始化数据字典信息
  294. this.initDictionaryInfo()
  295. },
  296. methods: {
  297. handleReset() {
  298. this.$refs.advancedSearchForm.resetFields()
  299. this.form = {}
  300. },
  301. initDictionaryInfo() {
  302. // 风险等级
  303. axios({
  304. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=RISK_RATE',
  305. method: 'get',
  306. }).then((res) => {
  307. if (res.status === 200) {
  308. this.riskOptions = res.data
  309. }
  310. })
  311. // 问题类型
  312. axios({
  313. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PROBLEM_TYPE',
  314. method: 'get',
  315. }).then((res) => {
  316. if (res.status === 200) {
  317. this.problemOptions = res.data
  318. }
  319. })
  320. },
  321. exportForm() {
  322. if (!this.$refs.sjzlTable.data || this.$refs.sjzlTable.data.length === 0) {
  323. message.warning('未查询出可展示图谱的数据', 1)
  324. return
  325. }
  326. this.$refs.advancedSearchForm.validate((valid, values) => {
  327. if (valid) {
  328. // 此处直接打开知识图谱地址
  329. window.open('http://kg.smartdot.com:3001/schema/37/knowledge-atlas')
  330. }
  331. })
  332. },
  333. handleSearch() {
  334. this.$refs.advancedSearchForm.validate((valid, values) => {
  335. if (valid) {
  336. const units = this.form.units
  337. if (units && units.length > 0) {
  338. var unitsIds = []
  339. for (var i = 0; i < units.length; i++) {
  340. unitsIds.push(units[i].id.toString())
  341. }
  342. this.form.unitIds = unitsIds
  343. }
  344. const auditedUnits = this.form.auditedUnits
  345. if (auditedUnits && auditedUnits.length > 0) {
  346. var auditedUnitIds = []
  347. for (var j = 0; j < auditedUnits.length; j++) {
  348. auditedUnitIds.push(auditedUnits[j].id.toString())
  349. }
  350. this.form.auditedUnitIds = auditedUnitIds
  351. }
  352. this.search(this.form)
  353. }
  354. })
  355. },
  356. // 查询
  357. search(form) {
  358. // 默认查询条件
  359. this.expressions = []
  360. // 审计发现标题
  361. if (form.year[0]) {
  362. var startYear = new Date(form.year[0])
  363. this.expressions.push({
  364. dataType: 'str',
  365. name: 'planYear',
  366. op: 'ge',
  367. stringValue: startYear.getFullYear(),
  368. })
  369. }
  370. if (form.year[1]) {
  371. var endYear = new Date(form.year[1])
  372. this.expressions.push({
  373. dataType: 'str',
  374. name: 'planYear',
  375. op: 'le',
  376. stringValue: endYear.getFullYear(),
  377. })
  378. }
  379. if (form.unitIds) {
  380. this.expressions.push({
  381. dataType: 'str',
  382. name: 'unitIds',
  383. op: 'in',
  384. stringValue: form.unitIds
  385. .map((item) => {
  386. return "'" + item + "'"
  387. })
  388. .join(','),
  389. })
  390. }
  391. if (form.projectName) {
  392. this.expressions.push({
  393. dataType: 'str',
  394. name: 'projectName',
  395. op: 'like',
  396. stringValue: form.projectName,
  397. })
  398. }
  399. if (form.auditedUnitIds) {
  400. this.expressions.push({
  401. dataType: 'str',
  402. name: 'auditedUnitIds',
  403. op: 'in',
  404. stringValue: form.auditedUnitIds
  405. .map((item) => {
  406. return "'" + item + "'"
  407. })
  408. .join(','),
  409. })
  410. }
  411. if (form.whetherOrderDuty) {
  412. this.expressions.push({
  413. dataType: 'str',
  414. name: 'whetherOrderDuty',
  415. op: 'ne',
  416. stringValue: form.whetherOrderDuty,
  417. })
  418. }
  419. if (form.findTitle) {
  420. this.expressions.push({
  421. dataType: 'str',
  422. name: 'findTitle',
  423. op: 'like',
  424. stringValue: form.findTitle,
  425. })
  426. }
  427. if (form.findType) {
  428. this.expressions.push({
  429. dataType: 'str',
  430. name: 'findType',
  431. op: 'like',
  432. stringValue: form.findType,
  433. })
  434. }
  435. if (form.problemType) {
  436. this.expressions.push({
  437. dataType: 'str',
  438. name: 'problemType',
  439. op: 'ne',
  440. stringValue: form.problemType,
  441. })
  442. }
  443. if (form.riskLevel) {
  444. this.expressions.push({
  445. dataType: 'str',
  446. name: 'riskLevel',
  447. op: 'ne',
  448. stringValue: form.riskLevel,
  449. })
  450. }
  451. },
  452. },
  453. }
  454. </script>
  455. <style module lang="scss">
  456. @use '@/common/design' as *;
  457. // .statistics {
  458. // :global(.ant-table-body) {
  459. // overflow-x: auto;
  460. // }
  461. // }
  462. .toptitle {
  463. color: #404040;
  464. font-weight: bold;
  465. font-size: 22px;
  466. margin-left: calc(50% - 150px);
  467. }
  468. .search-wrap {
  469. margin-bottom: $padding-lg;
  470. :global(.ant-advanced-search-form) {
  471. padding: 0;
  472. background: transparent;
  473. border: none;
  474. }
  475. :global .ant-divider-horizontal {
  476. margin: 10px 0;
  477. }
  478. }
  479. .searchdiv {
  480. height: 100%;
  481. :global(.sd-has-table.ant-card) {
  482. min-height: 50%;
  483. }
  484. :global(.reporttablecardxm) {
  485. :global(.ant-table-body) {
  486. height: auto !important;
  487. overflow: auto;
  488. min-height: auto !important;
  489. }
  490. }
  491. :global(.ant-table-placeholder) {
  492. height: auto !important;
  493. }
  494. }
  495. </style>