audit-view-detail.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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="viewFlag">
  13. <a-select v-model="form.viewFlag" placeholder="请选择状态" allow-clear>
  14. <a-select-option value="1">已查看</a-select-option>
  15. <a-select-option value="0">未查看</a-select-option>
  16. </a-select>
  17. </a-form-model-item>
  18. </a-col>
  19. <a-col :span="8">
  20. <div :class="$style.buttonContent">
  21. <a-button type="primary" @click="handleSearch">查询</a-button>
  22. <a-button @click="handleReset">重置</a-button>
  23. <!-- 导出 -->
  24. <a-button @click="exportExcel">导出</a-button>
  25. </div>
  26. </a-col>
  27. </a-row>
  28. </a-form-model>
  29. </a-card>
  30. <div>
  31. <a-card>
  32. <sd-data-table
  33. ref="SJMXDataTable"
  34. :key="dataKey"
  35. :columns="columns"
  36. :process-req="processReq"
  37. form-id="iamModelMaintain"
  38. :scroll="{ x: 1300 }"
  39. show-selection
  40. data-url="api/xcoa-mobile/v1/iamquestionreform/iamQuestionReformListNew"
  41. :filter-expressions="expressions"
  42. >
  43. <div slot="action" slot-scope="text, record">
  44. <!-- 如果 -->
  45. <a-button type="link" @click="showModal(record)">详情</a-button>
  46. <!-- <a-button
  47. type="link"
  48. :disabled="record.viewFlag !== 0"
  49. @click="viewFlagClick(record)"
  50. >{{ record.viewFlag === 0 ? '查看' : '已查看' }}</a-button
  51. > -->
  52. </div>
  53. <div slot="viewFlag" slot-scope="text, record">
  54. <span>{{ record.viewFlag === 1 ? '已查看' : '未查看' }}</span>
  55. </div>
  56. </sd-data-table>
  57. </a-card>
  58. <a-modal v-model="visible" title="问题详情" :footer="null" width="1200px" @cancel="cancel">
  59. <div :class="$style.modelDetail">
  60. <span>模型编码:{{ modelDetail.batchCode }}</span>
  61. <span>模型名称:{{ modelDetail.batchName }}</span>
  62. <span>业务领域:{{ modelDetail.modelDomainName }}</span>
  63. </div>
  64. <div :class="$style.detail">
  65. <a-table
  66. :columns="columnsDetail"
  67. :data-source="dataDetail"
  68. :row-key="(_, index) => index"
  69. :scroll="{ x: 1150, y: 500 }"
  70. >
  71. </a-table>
  72. </div>
  73. </a-modal>
  74. </div>
  75. </audit-form-top-banner>
  76. </template>
  77. <script>
  78. import components from './_import-components/audit-view-detail-import'
  79. import AuditRiskbraryService from '@product/iam/audit/riskLibrary/riskLibrary'
  80. import { message, Modal } from 'ant-design-vue'
  81. import auditFormTopBanner from './audit-top-banner'
  82. import download from '@/common/services/download'
  83. export default {
  84. name: 'AuditViewDetail',
  85. metaInfo: {
  86. title: '审计问题明细-关注类',
  87. },
  88. components: {
  89. ...components,
  90. auditFormTopBanner,
  91. },
  92. data() {
  93. return {
  94. modelDetail: {},
  95. form: {
  96. viewFlag: null,
  97. },
  98. visible: false,
  99. ModalquestionDetail: '',
  100. dataKey: 0,
  101. formItemLayout: {
  102. labelCol: { span: 6 },
  103. wrapperCol: { span: 14 },
  104. },
  105. columns: [
  106. {
  107. title: '序号',
  108. dataIndex: 'sortNumber',
  109. width: '70px',
  110. customRender: (text, record, index) => `${index + 1}`,
  111. },
  112. // {
  113. // title: '批次号',
  114. // dataIndex: 'batchCode',
  115. // },
  116. // {
  117. // title: '批次名称',
  118. // dataIndex: 'batchCode',
  119. // },
  120. {
  121. title: '模型编码',
  122. dataIndex: 'batchCode',
  123. },
  124. {
  125. title: '模型名称',
  126. dataIndex: 'batchName',
  127. },
  128. {
  129. title: '业务领域',
  130. dataIndex: 'modelDomainName',
  131. },
  132. {
  133. title: '业务阶段',
  134. dataIndex: 'modelPhaseName',
  135. },
  136. {
  137. title: '风险描述',
  138. dataIndex: 'risk',
  139. },
  140. {
  141. title: '问题推送日期',
  142. dataIndex: 'pushDate',
  143. },
  144. {
  145. title: '状态',
  146. dataIndex: 'viewFlag',
  147. scopedSlots: { customRender: 'viewFlag' },
  148. },
  149. {
  150. title: '查看人',
  151. dataIndex: 'modifyEmpAccount',
  152. },
  153. {
  154. title: '操作',
  155. dataIndex: 'sharedSetting',
  156. fixed: 'right',
  157. width: '150px',
  158. scopedSlots: { customRender: 'action' },
  159. },
  160. ],
  161. expressions: [
  162. {
  163. dataType: 'str',
  164. name: 'modelType',
  165. op: 'eq',
  166. stringValue: '0',
  167. },
  168. ],
  169. queryData: {},
  170. columnsDetail: [],
  171. dataDetail: [],
  172. }
  173. },
  174. created() {
  175. this.initQueryData()
  176. },
  177. methods: {
  178. //
  179. // 初始化initQueryData
  180. initQueryData() {
  181. this.queryData = this.$route.query
  182. this.queryData.modelType = '2'
  183. },
  184. // 导出
  185. // 导出
  186. exportExcel() {
  187. // 判断选中的数据,至少选中一条数据
  188. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  189. if (selectedRows.length === 0) {
  190. message.warning('请至少选择一条数据')
  191. return
  192. }
  193. // 调用导出
  194. // 导出参数
  195. const params = selectedRows.map((item) => {
  196. return {
  197. modelId: item.modelId,
  198. detailGroupId: item.detailGroupId,
  199. businessCode: item.businessCode,
  200. jmEventType: item.jmEventType,
  201. eventTagName: item.eventTagName,
  202. modelTypeName: item.modelTypeName,
  203. pushDate: item.pushDate,
  204. unitCode: item.unitCode,
  205. modelType: item.modelType,
  206. bussKey: item.bussKey || null,
  207. }
  208. })
  209. // exportQuestionDetail
  210. AuditRiskbraryService.exportQuestionDetail(params).then((res) => {
  211. if (res.status === 200) {
  212. //
  213. const url = URL.createObjectURL(res.data)
  214. const filename = res.headers['content-disposition']
  215. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  216. download(url, decodeURI(fname))
  217. // 导出成功
  218. message.success('导出成功')
  219. } else {
  220. Modal.warning({
  221. title: '提示',
  222. content: '导出报错,请联系管理员!',
  223. })
  224. return false
  225. }
  226. })
  227. },
  228. processReq(req) {
  229. req.data.expressions = [
  230. { dataType: 'str', name: 'pushDate', op: 'eq', stringValue: this.$route.query.pushDate },
  231. { dataType: 'str', name: 'modelType', op: 'eq', stringValue: '2' },
  232. { dataType: 'str', name: 'viewFlag', op: 'eq', stringValue: this.form.viewFlag },
  233. ]
  234. Object.keys(this.queryData).map((key) => {
  235. req.data.expressions.push({
  236. dataType: 'str',
  237. name: key,
  238. op: 'eq',
  239. stringValue: this.queryData[key],
  240. })
  241. })
  242. return req
  243. },
  244. handleSearch() {
  245. this.dataKey++
  246. },
  247. handleReset() {
  248. this.$refs.advancedSearchForm.resetFields()
  249. },
  250. viewFlagClick(row) {
  251. const params = {
  252. ...this.queryData,
  253. modelId: row.modelId,
  254. detailGroupId: row.detailGroupId,
  255. viewFlag: 1,
  256. reformStatus: 1,
  257. }
  258. AuditRiskbraryService.saveIamQuestionReform(params).then((res) => {
  259. if (res) {
  260. message.success('提交成功')
  261. this.handleSearch()
  262. }
  263. })
  264. },
  265. // showModal(row) {
  266. // this.ModalquestionDetail = JSON.parse(row.questionDetail)
  267. // this.visible = true
  268. // },
  269. showModal(row) {
  270. // this.ModalquestionDetail = JSON.parse(row.questionDetail)
  271. const params = {
  272. modelId: row.modelId,
  273. detailGroupId: row.detailGroupId,
  274. ...this.queryData,
  275. bussKey: row.bussKey || null,
  276. }
  277. const formData = new FormData()
  278. Object.keys(params).forEach((key) => {
  279. formData.append(key, params[key])
  280. })
  281. this.modelDetail = {
  282. modelDomainName: row.modelDomainName,
  283. batchName: row.batchName,
  284. batchCode: row.batchCode,
  285. riskData: row.risk,
  286. }
  287. const detailJson = JSON.stringify(this.modelDetail)
  288. const queryJson = JSON.stringify(params)
  289. window.open(
  290. `#/audit-risk-detail?queryJson=${queryJson}&modelDetail=${detailJson}&detailStatus=${this.detailStatus}`
  291. )
  292. },
  293. cancel() {
  294. this.visible = false
  295. this.dataDetail = []
  296. this.columnsDetail = []
  297. this.modelDetail = {}
  298. },
  299. },
  300. }
  301. </script>
  302. <style module lang="scss">
  303. @use '@/common/design' as *;
  304. .wrap-height {
  305. height: 100%;
  306. .row-height {
  307. display: flex;
  308. flex: auto;
  309. height: 100%;
  310. .rightcard {
  311. flex: 1;
  312. width: calc(100% - 20%);
  313. height: 100%;
  314. }
  315. }
  316. }
  317. .button-content {
  318. button {
  319. margin: 0 4px;
  320. }
  321. }
  322. .no-action {
  323. padding: 0 15px;
  324. color: $text-color-secondary;
  325. }
  326. .detail {
  327. width: 100%;
  328. overflow-x: auto;
  329. }
  330. .detail-delete {
  331. display: flex;
  332. justify-content: flex-end;
  333. }
  334. .model-detail {
  335. display: flex;
  336. margin-bottom: 10px;
  337. span {
  338. margin-right: 20px;
  339. }
  340. }
  341. </style>