audit-shdetail-list.vue 15 KB

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