audit-shchange-list.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. <template>
  2. <audit-form-top-banner>
  3. <a-card :class="$style.conditions">
  4. <a-form-model
  5. ref="advancedSearchForm"
  6. class="ant-advanced-search-form"
  7. :model="form"
  8. v-bind="formItemLayout"
  9. >
  10. <a-row :gutter="24" :class="$style.antformitem">
  11. <a-col :span="8">
  12. <a-form-model-item :label="'下发状态'" prop="status" allow-clear>
  13. <a-select v-model="form.status" placeholder="请选择下发状态" allow-clear>
  14. <a-select-option :value="0">待下发</a-select-option>
  15. <a-select-option :value="1">已下发</a-select-option>
  16. <a-select-option :value="2">下发失败</a-select-option>
  17. </a-select>
  18. </a-form-model-item>
  19. </a-col>
  20. <a-col :span="8">
  21. <a-form-model-item label="整改截止时间" prop="timeRange">
  22. <a-range-picker
  23. v-model="reformDeadline"
  24. :format="'YYYY-MM-DD'"
  25. @change="changeReformDeadline"
  26. />
  27. </a-form-model-item>
  28. </a-col>
  29. <a-col :span="8">
  30. <a-form-model-item label="问题推送时间" prop="timeRange">
  31. <a-range-picker v-model="pushDate" :format="'YYYY-MM-DD'" @change="changePushDate" />
  32. </a-form-model-item>
  33. </a-col>
  34. <a-col :span="8">
  35. <div :class="$style.buttonContent">
  36. <a-button type="primary" @click="handleAction('serach')">查询</a-button>
  37. <a-button @click="handleReset">重置</a-button>
  38. <!-- 审核 -->
  39. <a-button type="primary" @click="handleExamine">下发</a-button>
  40. <!-- 删除 -->
  41. <a-button type="primary" @click="handleDelete">删除</a-button>
  42. <a-button @click="exportExcel">导出</a-button>
  43. </div>
  44. </a-col>
  45. </a-row>
  46. </a-form-model>
  47. </a-card>
  48. <div>
  49. <a-card>
  50. <sd-data-table-ex
  51. ref="SJMXDataTable"
  52. :key="dataKey"
  53. :columns="columns"
  54. :process-req="processReq"
  55. form-id="iamModelMaintain"
  56. :scroll="{ x: 2800 }"
  57. data-url="api/xcoa-mobile/v1/iamquestionreform/questionExamineQueryList"
  58. :filter-expressions="expressions"
  59. show-selection
  60. >
  61. <!-- :show-selection="(item) => item.status !== 1" -->
  62. <div slot="action" slot-scope="text, record">
  63. <a-button type="link" @click="showModal(record)">详情</a-button>
  64. <a-button
  65. type="link"
  66. @click="
  67. () => {
  68. modelLogicContent = record.configIdea
  69. modelLogicVisible = true
  70. }
  71. "
  72. >模型逻辑</a-button
  73. >
  74. </div>
  75. <template slot="status" slot-scope="text, record">
  76. <span v-if="record.status === 0">待下发</span>
  77. <span v-if="record.status === 1">已下发</span>
  78. <!-- 下发失败 2 -->
  79. <span v-if="record.status === 2">下发失败</span>
  80. </template>
  81. <template slot="failReason" slot-scope="text, record">
  82. <span v-if="record.status === 2">模型领域未绑定整改人及初审、复审人</span>
  83. </template>
  84. </sd-data-table-ex>
  85. </a-card>
  86. <a-modal v-model="visible" title="问题详情" :footer="null" width="1200px" @cancel="cancel">
  87. <div :class="$style.detail">
  88. <div :class="$style.detailDelete">
  89. <a-button v-if="detailStatus" type="primary" @click="ondetailDelete">删除</a-button>
  90. </div>
  91. <div :class="$style.modelDetail">
  92. <span>模型编码:{{ modelDetail.batchCode }}</span>
  93. <span>模型名称:{{ modelDetail.batchName }}</span>
  94. <span>业务领域:{{ modelDetail.modelDomainName }}</span>
  95. </div>
  96. <a-table
  97. :columns="columnsDetail"
  98. :data-source="dataDetail"
  99. :row-key="(_, index) => index"
  100. :scroll="{ x: 1150, y: 500 }"
  101. :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  102. >
  103. </a-table>
  104. </div>
  105. </a-modal>
  106. <a-modal v-model="issueVisible" title="下发提醒" :footer="null" @cancel="cancel">
  107. <div>
  108. <p v-for="(item, i) in issueMessageList" :key="i"
  109. >{{ item.label + item.value
  110. }}<span v-if="i === 3 && issueMessageList[3].value !== ''"
  111. >未绑定整改人与审核、复审人,请前往<a @click="toPath">模型领域</a
  112. >人员关联页面完善信息后重试
  113. </span>
  114. </p>
  115. </div>
  116. </a-modal>
  117. </div>
  118. <audit-model-logic v-model="modelLogicVisible" :content="modelLogicContent" />
  119. </audit-form-top-banner>
  120. </template>
  121. <script>
  122. import components from './_import-components/audit-shchange-list-import'
  123. import AuditRiskbraryService from './riskLibrary'
  124. import moment from 'moment/moment'
  125. import sdDataTableEx from '@/common/components/sd-data-table-ex.vue'
  126. import { message, Modal } from 'ant-design-vue'
  127. import auditFormTopBanner from './audit-top-banner'
  128. import download from '@/common/services/download'
  129. import auditModelLogic from './audit-model-logic'
  130. export default {
  131. name: 'AuditShchangeList',
  132. metaInfo: {
  133. title: '问题明细审核-整改类',
  134. },
  135. components: {
  136. ...components,
  137. sdDataTableEx,
  138. auditModelLogic,
  139. auditFormTopBanner,
  140. },
  141. data() {
  142. return {
  143. modelLogicVisible: false,
  144. modelLogicContent: '',
  145. selectedRowKeys: [],
  146. selectedRows: [],
  147. // 问题标签
  148. visible: false,
  149. dataKey: 0,
  150. form: {
  151. reformStatus: null,
  152. status: null,
  153. },
  154. reformDeadline: [],
  155. pushDate: [],
  156. reqData: {
  157. reformDeadlineSt: '',
  158. reformDeadlineEd: '',
  159. pushDateSt: '',
  160. pushDateEd: '',
  161. },
  162. queryData: {},
  163. formItemLayout: {
  164. labelCol: { span: 6 },
  165. wrapperCol: { span: 14 },
  166. },
  167. // 详情信息
  168. columnsDetail: [],
  169. dataDetail: [],
  170. // 模型信息
  171. modelDetail: {},
  172. columns: [
  173. {
  174. title: '序号',
  175. dataIndex: 'sortNumber',
  176. width: '70px',
  177. customRender: (text, record, index) => `${index + 1}`,
  178. },
  179. // 模型逻辑
  180. {
  181. title: '模型逻辑',
  182. dataIndex: 'configIdea',
  183. sdHidden: true,
  184. },
  185. {
  186. title: '模型编码',
  187. dataIndex: 'batchCode',
  188. },
  189. {
  190. title: '模型名称',
  191. dataIndex: 'batchName',
  192. },
  193. {
  194. title: '业务领域',
  195. dataIndex: 'modelDomainName',
  196. },
  197. {
  198. title: '业务阶段',
  199. dataIndex: 'modelPhaseName',
  200. },
  201. {
  202. title: '关注风险',
  203. dataIndex: 'risk',
  204. },
  205. {
  206. title: '问题推送日期',
  207. dataIndex: 'pushDate',
  208. },
  209. {
  210. title: '整改截止日期',
  211. dataIndex: 'reformDeadline',
  212. },
  213. {
  214. title: '整改期限',
  215. dataIndex: 'reformTime',
  216. },
  217. // // 状态 审核人 审核时间
  218. {
  219. title: '状态',
  220. dataIndex: 'status',
  221. scopedSlots: { customRender: 'status' },
  222. },
  223. // 失败原因
  224. {
  225. title: '失败原因',
  226. dataIndex: 'failReason',
  227. scopedSlots: { customRender: 'failReason' },
  228. },
  229. // examineUser examineTime status
  230. // 审核人
  231. {
  232. title: '审核人',
  233. dataIndex: 'examineUser',
  234. },
  235. // 审核时间
  236. {
  237. title: '审核时间',
  238. dataIndex: 'examineTime',
  239. width: '300px',
  240. },
  241. {
  242. title: '操作',
  243. dataIndex: 'sharedSetting',
  244. fixed: 'right',
  245. width: '100px',
  246. scopedSlots: { customRender: 'action' },
  247. },
  248. ],
  249. expressions: [
  250. {
  251. dataType: 'str',
  252. name: 'modelType',
  253. op: 'eq',
  254. stringValue: '1',
  255. },
  256. ],
  257. detailStatus: false,
  258. // 下发弹窗
  259. issueVisible: false,
  260. issueMessageList: [],
  261. }
  262. },
  263. created() {
  264. this.initQueryData()
  265. },
  266. methods: {
  267. // 导出
  268. exportExcel() {
  269. // 判断选中的数据,至少选中一条数据
  270. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  271. if (selectedRows.length === 0) {
  272. message.warning('请至少选择一条数据')
  273. return
  274. }
  275. // 调用导出
  276. // 导出参数
  277. const params = selectedRows.map((item) => {
  278. return {
  279. modelId: item.modelId,
  280. detailGroupId: item.detailGroupId,
  281. jmEventType: item.jmEventType,
  282. eventTagName: item.eventTagName,
  283. modelTypeName: item.modelTypeName,
  284. pushDate: item.pushDate,
  285. unitCode: item.unitCode,
  286. modelType: item.modelType,
  287. status: item.status,
  288. bussKey: item.bussKey || null,
  289. }
  290. })
  291. // examineDetailExport
  292. AuditRiskbraryService.examineDetailExport(params).then((res) => {
  293. if (res.status === 200) {
  294. //
  295. const url = URL.createObjectURL(res.data)
  296. const filename = res.headers['content-disposition']
  297. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  298. download(url, decodeURI(fname))
  299. // 导出成功
  300. message.success('导出成功')
  301. } else {
  302. Modal.warning({
  303. title: '提示',
  304. content: '导出报错,请联系管理员!',
  305. })
  306. return false
  307. }
  308. })
  309. },
  310. cancel() {
  311. this.visible = false
  312. this.selectedRowKeys = []
  313. this.selectedRows = []
  314. this.columnsDetail = []
  315. this.dataDetail = []
  316. this.issueVisible = false
  317. this.modelDetail = {}
  318. },
  319. toPath() {
  320. window.open('#/sd-frame/audit-area-list')
  321. },
  322. setMessageList(data) {
  323. this.issueMessageList = [
  324. { label: '下发总数:', value: data.questionNum },
  325. { label: '下发成功:', value: data.examineNum },
  326. { label: '下发失败:', value: data.examineFailNum },
  327. { label: '下发失败原因:', value: data.failReason },
  328. ]
  329. this.issueVisible = true
  330. },
  331. onSelectChange(selectedRowKeys, selectedRows) {
  332. this.selectedRowKeys = selectedRowKeys
  333. this.selectedRows = selectedRows
  334. },
  335. ondetailDelete() {
  336. Modal.confirm({
  337. title: '提示',
  338. content: '是否确认删除?',
  339. onOk: () => {
  340. const ids = this.selectedRows.map((item) => item.id).join(',')
  341. AuditRiskbraryService.deleteDetailInfo(ids).then((res) => {
  342. message.success('删除成功')
  343. this.visible = false
  344. this.cancel()
  345. this.handleSearch()
  346. })
  347. },
  348. })
  349. },
  350. // 删除
  351. handleDelete() {
  352. // 判断选中的数据,如果存在已下发数据则提示已下发数据不可删除
  353. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  354. const isExamine = selectedRows.some((item) => item.status === 1)
  355. if (isExamine) {
  356. message.warning('已下发数据不可删除')
  357. return
  358. }
  359. Modal.confirm({
  360. title: '提示',
  361. content: '是否确认删除?',
  362. onOk: () => {
  363. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  364. const params = selectedRows.map((item) => {
  365. return {
  366. modelId: item.modelId,
  367. detailGroupId: item.detailGroupId,
  368. jmEventType: item.jmEventType,
  369. eventTagName: item.eventTagName,
  370. modelTypeName: item.modelTypeName,
  371. pushDate: item.pushDate,
  372. unitCode: item.unitCode,
  373. modelType: item.modelType,
  374. bussKey: item.bussKey || null,
  375. }
  376. })
  377. AuditRiskbraryService.questionDetailDelete(params).then((res) => {
  378. message.success('删除成功')
  379. this.handleSearch()
  380. })
  381. },
  382. })
  383. },
  384. // 审核
  385. handleExamine() {
  386. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  387. // /questionExamine 问题审核
  388. // {"modelId":472,"detailGroupId":"1","businessCode":"null-1701238800000-1","jmEventType":"2","eventTagName":"测试风险库","modelTypeName":"定位型-整改类","pushDate":"2023-11-29","unitCode":"100000","":null,"modelType":"1","status":1}
  389. const params = selectedRows.map((item) => {
  390. return {
  391. modelId: item.modelId,
  392. detailGroupId: item.detailGroupId,
  393. jmEventType: item.jmEventType,
  394. eventTagName: item.eventTagName,
  395. modelTypeName: item.modelTypeName,
  396. pushDate: item.pushDate,
  397. unitCode: item.unitCode,
  398. modelType: item.modelType,
  399. status: item.status,
  400. bussKey: item.bussKey || null,
  401. }
  402. })
  403. AuditRiskbraryService.questionDetailExamine(params).then((res) => {
  404. this.setMessageList(res.data)
  405. this.handleSearch()
  406. })
  407. },
  408. // 初始化initQueryData
  409. initQueryData() {
  410. this.queryData = this.$route.query
  411. this.queryData.modelType = '1'
  412. },
  413. // 时间变化
  414. changeReformDeadline(val) {
  415. this.reqData.reformDeadlineSt = moment(val[0]._d).format('YYYY-MM-DD')
  416. this.reqData.reformDeadlineEd = moment(val[1]._d).format('YYYY-MM-DD')
  417. },
  418. changePushDate(val) {
  419. this.reqData.pushDateSt = moment(val[0]._d).format('YYYY-MM-DD')
  420. this.reqData.pushDateEd = moment(val[1]._d).format('YYYY-MM-DD')
  421. },
  422. processReq(req) {
  423. req.data.expressions = [
  424. { dataType: 'str', name: 'reformStatus', op: 'eq', stringValue: this.form.reformStatus },
  425. { dataType: 'str', name: 'status', op: 'eq', stringValue: this.form.status },
  426. {
  427. dataType: 'str',
  428. name: 'reformDeadlineSt',
  429. op: 'eq',
  430. stringValue: this.reqData.reformDeadlineSt,
  431. },
  432. {
  433. dataType: 'str',
  434. name: 'reformDeadlineEd',
  435. op: 'eq',
  436. stringValue: this.reqData.reformDeadlineEd,
  437. },
  438. { dataType: 'str', name: 'pushDateSt', op: 'eq', stringValue: this.reqData.pushDateSt },
  439. { dataType: 'str', name: 'pushDateEd', op: 'eq', stringValue: this.reqData.pushDateEd },
  440. ]
  441. Object.keys(this.queryData).map((key) => {
  442. req.data.expressions.push({
  443. dataType: 'str',
  444. name: key,
  445. op: 'eq',
  446. stringValue: this.queryData[key],
  447. })
  448. })
  449. // 过滤没有stringvalue的对象
  450. req.data.expressions = req.data.expressions.filter(
  451. (item) => item?.stringValue !== undefined || item.stringValue === ''
  452. )
  453. return req
  454. },
  455. handleReset() {
  456. this.$refs.advancedSearchForm.resetFields()
  457. this.reqData = {
  458. reformDeadlineSt: '',
  459. reformDeadlineEd: '',
  460. pushDateSt: '',
  461. pushDateEd: '',
  462. }
  463. this.reformDeadline = []
  464. this.pushDate = []
  465. this.handleSearch()
  466. },
  467. // 查询
  468. handleAction(type) {
  469. switch (type) {
  470. case 'serach':
  471. this.handleSearch()
  472. break
  473. }
  474. },
  475. handleSearch() {
  476. this.dataKey++
  477. },
  478. // 查看详情
  479. showModal(row) {
  480. // 审核状态
  481. this.detailStatus = row.status !== 1
  482. const params = {
  483. modelId: row.modelId,
  484. detailGroupId: row.detailGroupId,
  485. status: row.status,
  486. bussKey: row.bussKey || null,
  487. ...this.queryData,
  488. }
  489. const formData = new FormData()
  490. Object.keys(params).forEach((key) => {
  491. formData.append(key, params[key])
  492. })
  493. this.modelDetail = {
  494. modelDomainName: row.modelDomainName,
  495. batchName: row.modelName,
  496. batchCode: row.modelCode,
  497. riskData: row.risk,
  498. }
  499. // 地址audit-risk-detail 参数params
  500. const detailJson = JSON.stringify(this.modelDetail)
  501. const queryJson = JSON.stringify(params)
  502. window.open(
  503. `#/audit-risk-detail?queryJson=${queryJson}&modelDetail=${detailJson}&detailStatus=${this.detailStatus}&type=sh`
  504. )
  505. },
  506. },
  507. }
  508. </script>
  509. <style module lang="scss">
  510. @use '@/common/design' as *;
  511. .wrap-height {
  512. height: 100%;
  513. .row-height {
  514. display: flex;
  515. flex: auto;
  516. height: 100%;
  517. .rightcard {
  518. flex: 1;
  519. width: calc(100% - 20%);
  520. height: 100%;
  521. }
  522. }
  523. }
  524. .button-content {
  525. button {
  526. margin: 0 4px;
  527. }
  528. }
  529. .no-action {
  530. padding: 0 15px;
  531. color: $text-color-secondary;
  532. }
  533. .detail {
  534. width: 100%;
  535. overflow-x: auto;
  536. }
  537. .detail-delete {
  538. display: flex;
  539. justify-content: flex-end;
  540. margin-bottom: 10px;
  541. }
  542. .model-detail {
  543. display: flex;
  544. margin-bottom: 10px;
  545. span {
  546. margin-right: 20px;
  547. }
  548. }
  549. </style>