audit-view-sum.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <div :class="$style.wrapHeight">
  3. <div>
  4. <a-card :class="$style.conditions">
  5. <a-form-model
  6. ref="advancedSearchForm"
  7. class="ant-advanced-search-form"
  8. :model="form"
  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="businessCode">
  14. <a-input v-model="form.businessCode" placeholder="请输入业务编码" allow-clear />
  15. </a-form-model-item>
  16. </a-col>
  17. <!-- <a-col :span="8">
  18. <a-form-model-item :label="'风险名称'" prop="risk">
  19. <a-input v-model="form.risk" placeholder="请输入风险名称" allow-clear />
  20. </a-form-model-item>
  21. </a-col> -->
  22. <a-col :span="8">
  23. <a-form-model-item :label="'事件标签分类'" prop="eventTagName">
  24. <a-input v-model="form.eventTagName" placeholder="事件标签分类" allow-clear />
  25. </a-form-model-item>
  26. </a-col>
  27. <a-col :span="8">
  28. <!-- <a-form-model-item :label="'管理归属二级单位'" prop="belongedSecondUnit">
  29. <a-input
  30. v-model="form.belongedSecondUnit"
  31. placeholder="请输入管理归属二级单位"
  32. allow-clear
  33. />
  34. </a-form-model-item> -->
  35. <!-- todo 二级单位简称 -->
  36. <a-form-model-item :label="'二级单位简称'" prop="secondUnit">
  37. <a-input v-model="form.secondUnit" placeholder="请输入二级单位简称" allow-clear />
  38. </a-form-model-item>
  39. </a-col>
  40. <!-- 开始时间 ,结束时间 -->
  41. <a-col :span="8">
  42. <a-form-model-item label="业务时间">
  43. <a-range-picker v-model="time1" :format="'YYYY-MM-DD'" @change="changeTimeRange" />
  44. </a-form-model-item>
  45. </a-col>
  46. <!-- 单位 unit -->
  47. <a-col :span="8">
  48. <a-form-model-item :label="'单位'" prop="unit">
  49. <a-input v-model="form.unit" placeholder="请输入单位" allow-clear />
  50. </a-form-model-item>
  51. </a-col>
  52. <a-col :span="8">
  53. <a-form-model-item :label="'模型类型'" prop="modelType">
  54. <a-select v-model="form.modelType" placeholder="请选择模型类型" allow-clear>
  55. <!-- <a-select-option value="0">分析型</a-select-option> -->
  56. <a-select-option value="1">定位型-整改类</a-select-option>
  57. <a-select-option value="2">定位型-关注类</a-select-option>
  58. </a-select>
  59. </a-form-model-item>
  60. </a-col>
  61. <a-col :span="8">
  62. <a-form-model-item label="问题推送时间" prop="timeRange">
  63. <!-- <AuditRangeDatePicker
  64. :time-placeholder="['开始时间', '结束时间']"
  65. :time-mode="['date', 'date']"
  66. :time-format="'YYYY-MM-DD'"
  67. :time-range.sync="form.timeRange"
  68. /> -->
  69. <a-range-picker
  70. v-model="time2"
  71. :format="'YYYY-MM-DD'"
  72. @change="changeStartTimeChange"
  73. />
  74. </a-form-model-item>
  75. </a-col>
  76. <a-col :span="8">
  77. <div :class="$style.buttonContent">
  78. <a-button type="primary" @click="handleAction('serach')">查询</a-button>
  79. <a-button @click="handleReset">重置</a-button>
  80. <a-button :loading="exportLoading" type="primary" @click="fnexport">导出</a-button>
  81. </div>
  82. </a-col>
  83. </a-row>
  84. </a-form-model>
  85. </a-card>
  86. <div>
  87. <a-card>
  88. <sd-data-table
  89. ref="SJMXDataTable"
  90. :key="dataKey"
  91. :row-key="(record, index) => index"
  92. :columns="columns"
  93. :process-req="processReq"
  94. form-id="iamModelMaintain"
  95. :scroll="{ x: 1300 }"
  96. data-url="api/xcoa-mobile/v1/iamquestionreform/iamQuestionReformSummaryQueryList"
  97. >
  98. <div slot="action" slot-scope="text, record">
  99. <a-button type="link" @click="detailClick(record)">明细</a-button>
  100. </div>
  101. </sd-data-table>
  102. </a-card>
  103. <audit-advanced-export
  104. ref="export"
  105. :v-if="false"
  106. :exclebxh="false"
  107. table-id="iamModelMaintain"
  108. :expressions="exportExpressions"
  109. :config-id="121"
  110. />
  111. </div>
  112. </div>
  113. </div>
  114. </template>
  115. <script>
  116. import components from './_import-components/audit-view-sum-import'
  117. import auditAdvancedExport from '../../components/audit-advanced-export.vue'
  118. import { getUserInfo } from '@/common/store-mixin'
  119. import AuditRiskbraryService from './riskLibrary'
  120. import moment from 'moment'
  121. export default {
  122. name: 'AuditViewSum',
  123. metaInfo: {
  124. title: '审计问题总汇',
  125. },
  126. components: {
  127. ...components,
  128. auditAdvancedExport,
  129. },
  130. data() {
  131. return {
  132. exportLoading: false,
  133. exportExpressions: [],
  134. form: {
  135. businessCode: null,
  136. eventTagName: null,
  137. secondUnit: null,
  138. risk: null,
  139. modelType: null,
  140. // timeRange: [],
  141. belongedSecondUnit: null,
  142. unit: null,
  143. // buss_time
  144. bussTime: null,
  145. abbreviation: null,
  146. // bussTimeSt bussTimeEd 业务时间
  147. bussTimeSt: null,
  148. bussTimeEd: null,
  149. pushDateSt: null,
  150. pushDateEd: null,
  151. },
  152. time1: [],
  153. time2: [],
  154. reqData: {
  155. pushDateSt: '',
  156. pushDateEd: '',
  157. },
  158. formItemLayout: {
  159. labelCol: { span: 10 },
  160. wrapperCol: { span: 14 },
  161. },
  162. dataKey: 0,
  163. columns: [
  164. {
  165. title: '序号',
  166. dataIndex: 'sortNumber',
  167. width: '70px',
  168. customRender: (text, record, index) => `${index + 1}`,
  169. },
  170. {
  171. title: '业务编码',
  172. dataIndex: 'businessCode',
  173. },
  174. // todo 事件标签
  175. {
  176. title: '事件标签',
  177. dataIndex: 'jmEventType',
  178. },
  179. {
  180. title: '事件标签分类',
  181. dataIndex: 'eventTagName',
  182. },
  183. {
  184. title: '模型类型',
  185. dataIndex: 'modelTypeName',
  186. },
  187. {
  188. dataIndex: 'modelType',
  189. sdHidden: true,
  190. },
  191. {
  192. title: '问题推送日期',
  193. dataIndex: 'pushDate',
  194. },
  195. {
  196. title: '二级单位简称',
  197. dataIndex: 'secondUnit',
  198. },
  199. {
  200. dataIndex: 'secondUnitCode',
  201. sdHidden: true,
  202. },
  203. {
  204. dataIndex: 'unitCode',
  205. sdHidden: true,
  206. },
  207. {
  208. title: '单位',
  209. dataIndex: 'unit',
  210. },
  211. {
  212. title: '问题数量',
  213. dataIndex: 'questionNum',
  214. },
  215. {
  216. title: '非问题数量',
  217. dataIndex: 'nonQuestionNum',
  218. },
  219. {
  220. title: '已整改数量',
  221. dataIndex: 'reformNum',
  222. },
  223. {
  224. title: '未整改数量',
  225. dataIndex: 'nonReformNum',
  226. },
  227. {
  228. title: '操作',
  229. dataIndex: 'sharedSetting',
  230. fixed: 'right',
  231. width: '100px',
  232. scopedSlots: { customRender: 'action' },
  233. },
  234. ],
  235. }
  236. },
  237. methods: {
  238. // 开始时间 结束时间
  239. changeTimeRange(val) {
  240. // 开始天的 00:00:00 结束天的 23:59:59 时间戳
  241. const timeList = val.map((item) => {
  242. // 转化成时间戳 并忽略时分秒
  243. return moment(item._d)
  244. .startOf('day')
  245. .valueOf()
  246. })
  247. // 结束时间加一天的时间戳
  248. this.form.bussTimeSt = timeList[0]
  249. this.form.bussTimeEd = timeList[1] + 60 * 60 * 24 * 1000
  250. },
  251. changeStartTimeChange(val) {
  252. // "stringValue": "2023-12-16" 转换成这个格式
  253. this.form.pushDateSt = moment(val[0]._d).format('YYYY-MM-DD')
  254. this.form.pushDateEd = moment(val[1]._d).format('YYYY-MM-DD')
  255. },
  256. // 处理请求参数
  257. setExpressions() {
  258. const expressions = []
  259. const filter = ['bussTimeSt', 'bussTimeEd', 'pushDateSt', 'pushDateEd', 'modelType']
  260. for (const key in this.form) {
  261. if (this.form[key] && !filter.includes(key)) {
  262. expressions.push({
  263. dataType: 'str',
  264. name: key,
  265. op: 'like',
  266. stringValue: '%' + this.form[key] + '%',
  267. })
  268. }
  269. if (this.form[key] && filter.includes(key)) {
  270. expressions.push({
  271. dataType: 'str',
  272. name: key,
  273. op: 'eq',
  274. stringValue: this.form[key],
  275. })
  276. }
  277. }
  278. return expressions
  279. },
  280. processReq(req) {
  281. req.data.expressions = []
  282. req.data.expressions = this.setExpressions()
  283. return req
  284. },
  285. handleReset() {
  286. this.$refs.advancedSearchForm.resetFields()
  287. this.form.bussTimeEd = null
  288. this.form.bussTimeSt = null
  289. this.form.pushDateSt = null
  290. this.form.pushDateEd = null
  291. this.time1 = []
  292. this.time2 = []
  293. this.handleAction('serach')
  294. },
  295. // 查询
  296. handleAction(type) {
  297. // this.reqData.pushDateSt = this.form.timeRange.length ? this.form.timeRange[0] : ''
  298. // this.reqData.pushDateEd = this.form.timeRange.length ? this.form.timeRange[1] : ''
  299. // 调用方法
  300. switch (type) {
  301. case 'serach':
  302. this.handleSearch()
  303. break
  304. }
  305. },
  306. handleSearch() {
  307. this.dataKey++
  308. },
  309. detailClick(record) {
  310. const unitCode = record.unitCode
  311. let url = '#/audit-view-change?'
  312. const allQueryData = {
  313. businessCode: record.businessCode,
  314. jmEventType: record.jmEventType,
  315. eventTagName: record.eventTagName,
  316. modelTypeName: record.modelTypeName,
  317. pushDate: record.pushDate,
  318. unitCode: unitCode,
  319. modelId: record.modelId,
  320. }
  321. if (record.modelTypeName !== '整改类' && record.modelTypeName !== '定位型-整改类') {
  322. url = '#/audit-view-detail?'
  323. }
  324. for (const key in allQueryData) {
  325. if (allQueryData[key]) {
  326. url += `${key}=${allQueryData[key]}&`
  327. }
  328. }
  329. window.open(url)
  330. },
  331. fnexport() {
  332. this.exportExpressions = this.setExpressions()
  333. const account = getUserInfo().account
  334. AuditRiskbraryService.getUserInfo(account).then((res) => {
  335. this.exportExpressions.push({
  336. dataType: 'str',
  337. name: 'unitCode',
  338. op: 'eq',
  339. stringValue: res.data.parentCode,
  340. })
  341. setTimeout(() => {
  342. this.$refs.export.exportdataRisk()
  343. }, 200)
  344. })
  345. },
  346. },
  347. }
  348. </script>
  349. <style module lang="scss">
  350. @use '@/common/design' as *;
  351. .wrap-height {
  352. height: 100%;
  353. .row-height {
  354. display: flex;
  355. flex: auto;
  356. height: 100%;
  357. .rightcard {
  358. flex: 1;
  359. width: calc(100% - 20%);
  360. height: 100%;
  361. }
  362. }
  363. .button-content {
  364. button {
  365. margin: 0 4px;
  366. }
  367. }
  368. }
  369. .no-action {
  370. padding: 0 15px;
  371. color: $text-color-secondary;
  372. }
  373. </style>