audit-shsum-list.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845
  1. <template>
  2. <a-spin :spinning="isshowLoading" :tip="istip" size="large">
  3. <div :class="$style.wrapHeight">
  4. <div>
  5. <a-card :class="$style.conditions">
  6. <a-form-model
  7. ref="advancedSearchForm"
  8. class="ant-advanced-search-form"
  9. :model="form"
  10. v-bind="formItemLayout"
  11. >
  12. <!-- 模型编码 -->
  13. <a-form-model-item label="模型编码" prop="modelCode">
  14. <a-input v-model="form.modelCode" placeholder="请输入模型编码" />
  15. </a-form-model-item>
  16. <a-form-model-item label="模型名称" prop="modelName">
  17. <a-input v-model="form.modelName" placeholder="请输入模型名称" />
  18. </a-form-model-item>
  19. <a-form-model-item :label="'模型类型'" prop="modelType">
  20. <div style="width: 200px">
  21. <a-select v-model="form.modelType" placeholder="请选择模型类型" allow-clear>
  22. <!-- <a-select-option value="0">分析型</a-select-option> -->
  23. <a-select-option value="1">定位型-整改类</a-select-option>
  24. <a-select-option value="2">定位型-关注类</a-select-option>
  25. </a-select>
  26. </div>
  27. </a-form-model-item>
  28. <a-form-model-item :label="'单位'" prop="unit">
  29. <a-input v-model="form.unit" placeholder="请输入单位" />
  30. </a-form-model-item>
  31. <a-form-model-item :label="'二级单位'" prop="secondUnit">
  32. <a-input v-model="form.secondUnit" placeholder="请输入二级单位" />
  33. </a-form-model-item>
  34. <a-form-model-item :label="'下发状态'" prop="status">
  35. <div style="width: 200px">
  36. <a-select v-model="form.status" placeholder="请选择下发状态" allow-clear>
  37. <!-- 增加下发状态 待下发0, 已下发1,,下发失败 2 -->
  38. <a-select-option value="0">待下发</a-select-option>
  39. <a-select-option value="1">已下发</a-select-option>
  40. <a-select-option value="2">下发失败</a-select-option>
  41. </a-select>
  42. </div>
  43. </a-form-model-item>
  44. <a-form-model-item :label="'问题类型'" prop="distributeType">
  45. <div style="width: 200px">
  46. <a-select v-model="form.distributeType" placeholder="请选择期初类型" allow-clear>
  47. <a-select-option value="0">期初后问题</a-select-option>
  48. <a-select-option value="1">期初前问题</a-select-option>
  49. </a-select>
  50. </div>
  51. </a-form-model-item>
  52. <!-- 业务领域 -->
  53. <a-form-model-item label="业务领域" prop="secondUnit">
  54. <audit-select-area v-model="form.modelDomain" />
  55. </a-form-model-item>
  56. <a-form-model-item :label="'删除状态'" prop="deleted">
  57. <div style="width: 200px">
  58. <a-select v-model="form.deleted" placeholder="请选择删除状态">
  59. <a-select-option value="0">未删除</a-select-option>
  60. <a-select-option value="1">已删除</a-select-option>
  61. </a-select>
  62. </div>
  63. </a-form-model-item>
  64. <a-form-model-item label="问题推送时间" prop="timeRange">
  65. <div style="width: 245px">
  66. <a-range-picker
  67. v-model="time"
  68. :format="'YYYY-MM-DD'"
  69. @change="changeStartTimeChange"
  70. />
  71. </div>
  72. </a-form-model-item>
  73. <a-form-model-item label="业务时间">
  74. <div style="width: 245px">
  75. <a-range-picker v-model="time3" :format="'YYYY-MM-DD'" @change="changeTimeRange" />
  76. </div>
  77. </a-form-model-item>
  78. <a-form-model-item>
  79. <div :class="$style.buttonContent">
  80. <a-button type="primary" @click="handleSearch">查询</a-button>
  81. <a-button @click="handleReset">重置</a-button>
  82. <!-- 导出 -->
  83. <a-button :loading="exportLoading" type="primary" @click="fnexport">导出</a-button>
  84. <!-- 下发 -->
  85. <a-dropdown>
  86. <a-menu slot="overlay">
  87. <a-menu-item key="1">
  88. <a-button
  89. size="large"
  90. :block="true"
  91. type="primary"
  92. :disabled="form.distributeType === '1'"
  93. @click="handleIssue"
  94. >下发</a-button
  95. >
  96. </a-menu-item>
  97. <a-menu-item v-if="deleteIssue" key="2">
  98. <!-- 删除 -->
  99. <a-button
  100. v-if="deleteIssue"
  101. size="large"
  102. :block="true"
  103. type="primary"
  104. @click="handleDelete"
  105. >删除</a-button
  106. >
  107. </a-menu-item>
  108. <a-menu-item key="3">
  109. <a-button @click="dataViewRw = true">下发任务管理</a-button>
  110. </a-menu-item>
  111. </a-menu>
  112. <a-button> 更多操作 <a-icon type="down" /> </a-button>
  113. </a-dropdown>
  114. </div>
  115. </a-form-model-item>
  116. </a-form-model>
  117. </a-card>
  118. <div>
  119. <a-card>
  120. <sd-data-table
  121. ref="SJMXDataTable"
  122. :key="dataKey"
  123. :columns="columns"
  124. :process-req="processReq"
  125. form-id="iamModelMaintain"
  126. :show-selection="(record) => record.status !== 1 && record.deleted === 0"
  127. :scroll="{ x: '100%' }"
  128. :pagination="{
  129. // 每页数量
  130. pageSizeOptions: ['10', '30', '50', '100', '500'],
  131. }"
  132. data-url="api/xcoa-mobile/v1/iamquestionreform/questionExamineSummaryQueryList"
  133. >
  134. <div slot="action" slot-scope="text, record">
  135. <a-button type="link" @click="openRiskDetail(record)">明细</a-button>
  136. <!-- 模型逻辑 -->
  137. <a-button type="link" @click="showModelLogic(record)">模型逻辑</a-button>
  138. </div>
  139. </sd-data-table>
  140. </a-card>
  141. </div>
  142. <a-modal v-model="issueVisible" title="下发提醒" :footer="null" @cancel="cancel">
  143. <div>
  144. <p v-for="(item, i) in issueMessageList" :key="i"
  145. >{{ item.label + item.value
  146. }}<span v-if="i === 3 && issueMessageList[3].value !== ''"
  147. >未绑定整改人与审核、复审人,请前往<a @click="toPath">模型领域</a
  148. >人员关联页面完善信息后重试
  149. </span>
  150. </p>
  151. </div>
  152. </a-modal>
  153. <audit-model-logic v-model="modelLogicVisible" :content="modelLogicContent" />
  154. <!-- 下发任务管理 -->
  155. <a-modal v-model="dataViewRw" title="下发任务列表" :footer="null" width="800px">
  156. <a-form-model v-bind="formItemLayout" style="margin-bottom: 15px">
  157. <a-form-model-item label="任务创建时间">
  158. <div style="width: 245px">
  159. <a-range-picker v-model="taskForm.time" :format="'YYYY-MM-DD'" />
  160. </div>
  161. </a-form-model-item>
  162. <!-- 任务名称 -->
  163. <a-form-model-item label="任务名称">
  164. <a-input v-model="taskForm.taskName" placeholder="请输入任务名称" />
  165. </a-form-model-item>
  166. <!-- 下发状态 -->
  167. <a-form-model-item label="下发状态">
  168. <div style="width: 200px">
  169. <a-select v-model="taskForm.status" placeholder="请选择下发状态">
  170. <a-select-option value="">全部</a-select-option>
  171. <a-select-option value="0">未下发</a-select-option>
  172. <a-select-option value="1">已下发</a-select-option>
  173. </a-select>
  174. </div>
  175. </a-form-model-item>
  176. <a-form-model-item>
  177. <div style="width: 200px;margin-left: 20px;">
  178. <a-button type="primary" @click="handleTaskSearch">查询</a-button>
  179. <a-button @click="restTaskForm">重置</a-button>
  180. </div>
  181. </a-form-model-item>
  182. </a-form-model>
  183. <SdDataTableEx
  184. :key="dataTaskKey"
  185. ref="taskTable"
  186. style="margin-top: 20px;"
  187. form-id="iamQuestionTask"
  188. :show-selection="false"
  189. :scroll="{ x: '100%' }"
  190. :process-req="processReqTask"
  191. :columns="columnsTask"
  192. ></SdDataTableEx>
  193. </a-modal>
  194. </div>
  195. </div>
  196. </a-spin>
  197. </template>
  198. <script>
  199. import components from './_import-components/audit-shsum-list-import'
  200. import moment from 'moment'
  201. import AuditRiskbraryService from '@product/iam/audit/riskLibrary/riskLibrary'
  202. import { message, Modal } from 'ant-design-vue'
  203. import { getUserInfo } from '@/common/store-mixin'
  204. import download from '@/common/services/download'
  205. import auditModelLogic from './audit-model-logic'
  206. import auditSelectArea from './audit-select-area'
  207. import SdDataTableEx from '@/common/components/sd-data-table-ex.vue'
  208. import TableColumnTypes from '@/common/services/table-column-types'
  209. export default {
  210. name: 'AuditShsumList',
  211. metaInfo: {
  212. title: '审计问题总汇审核',
  213. },
  214. components: {
  215. ...components,
  216. auditModelLogic,
  217. auditSelectArea,
  218. SdDataTableEx,
  219. },
  220. data() {
  221. return {
  222. // 导出按钮状态
  223. exportLoading: false,
  224. // 下发弹窗
  225. // 下发删除按钮权限
  226. deleteIssue: false,
  227. issueVisible: false,
  228. isshowLoading: false,
  229. istip: '正在导出请稍等……',
  230. issueMessageList: [
  231. { label: '下发总数:', value: 0 },
  232. { label: '下发成功:', value: 0 },
  233. { label: '下发失败:', value: 0 },
  234. { label: '下发失败原因:', value: '' },
  235. ],
  236. // 搜索筛选
  237. form: {
  238. modelCode: '',
  239. modelName: '',
  240. modelType: undefined,
  241. // 单位
  242. unit: '',
  243. // 二级单位简称
  244. secondUnit: '',
  245. // 下发状态,问题类型
  246. status: '0',
  247. // 问题类型
  248. distributeType: '',
  249. // 问题推送日期
  250. // 领域
  251. // model_domain
  252. modelDomain: '',
  253. pushDateSt: '',
  254. pushDateEd: '',
  255. bussTimeSt: '',
  256. bussTimeEd: '',
  257. deleted: '0',
  258. },
  259. time: [],
  260. time3: [],
  261. formItemLayout: {
  262. layout: 'inline',
  263. labelCol: { span: 8 },
  264. wrapperCol: { span: 14 },
  265. },
  266. dataKey: 0,
  267. dataTaskKey: 0,
  268. taskForm: {
  269. // 创建时间
  270. // 任务名称
  271. // 下发状态
  272. time: [],
  273. taskName: '',
  274. status: '',
  275. },
  276. dataViewRw: false,
  277. columnsTask: [
  278. {
  279. title: '序号',
  280. dataIndex: 'sortNumber',
  281. width: '70px',
  282. customRender: (text, record, index) => `${index + 1}`,
  283. },
  284. {
  285. title: '任务名称',
  286. dataIndex: 'taskName',
  287. width: '150px',
  288. },
  289. {
  290. title: '任务创建时间',
  291. dataIndex: 'creationTime',
  292. width: '150px',
  293. sdRender: TableColumnTypes.dateTime,
  294. },
  295. // 创建人,下发状态 成功条数,失败条数,失败原因
  296. {
  297. title: '创建人',
  298. dataIndex: 'creatorName',
  299. width: '100px',
  300. },
  301. {
  302. title: '下发状态',
  303. dataIndex: 'status',
  304. width: '100px',
  305. customRender: (text) => {
  306. // 执行状态 0执行者 1执行成功 2失败
  307. switch (text) {
  308. case 0:
  309. return '下发中'
  310. case 1:
  311. return '下发成功'
  312. case 2:
  313. return '下发失败'
  314. default:
  315. return ''
  316. }
  317. },
  318. },
  319. {
  320. title: '成功条数',
  321. dataIndex: 'successNum',
  322. width: '100px',
  323. },
  324. {
  325. title: '失败条数',
  326. dataIndex: 'failNum',
  327. width: '100px',
  328. },
  329. {
  330. title: '失败原因',
  331. dataIndex: 'failReason',
  332. width: '100px',
  333. },
  334. //
  335. ],
  336. columns: [
  337. {
  338. title: '序号',
  339. dataIndex: 'sortNumber',
  340. width: '70px',
  341. customRender: (text, record, index) => `${index + 1}`,
  342. },
  343. // 模型编码, 模型名称 业务领域, 业务阶段, 模型类型 ,问题推送日期,
  344. // 二级单位简称 单位, 下发状态, 失败原因 审核人 审核时间
  345. {
  346. title: '模型编码',
  347. dataIndex: 'modelCode',
  348. width: '150px',
  349. },
  350. // 模型名称
  351. {
  352. title: '模型名称',
  353. dataIndex: 'modelName',
  354. width: '100px',
  355. },
  356. // 业务领域
  357. {
  358. title: '业务领域',
  359. dataIndex: 'modelDomainName',
  360. width: '100px',
  361. },
  362. // 业务阶段
  363. {
  364. title: '业务阶段',
  365. dataIndex: 'modelPhaseName',
  366. width: '100px',
  367. },
  368. // 模型类型
  369. {
  370. title: '模型类型',
  371. dataIndex: 'modelTypeName',
  372. width: '100px',
  373. },
  374. // 问题推送日期
  375. {
  376. title: '问题推送日期',
  377. dataIndex: 'pushDate',
  378. width: '100px',
  379. },
  380. // 二级单位简称
  381. {
  382. title: '二级单位简称',
  383. dataIndex: 'secondUnit',
  384. width: '100px',
  385. },
  386. // 单位
  387. {
  388. title: '单位',
  389. dataIndex: 'unit',
  390. width: '100px',
  391. },
  392. // 下发状态
  393. {
  394. title: '下发状态',
  395. dataIndex: 'status',
  396. width: '100px',
  397. customRender: (text) => {
  398. if (text === 0) {
  399. return '待下发'
  400. }
  401. if (text === 1) {
  402. return '已下发'
  403. }
  404. if (text === 2) {
  405. return '下发失败'
  406. }
  407. },
  408. },
  409. // 失败原因
  410. {
  411. title: '失败原因',
  412. dataIndex: 'failReason',
  413. width: '100px',
  414. },
  415. // 删除状态
  416. // deleted 0 1
  417. {
  418. title: '删除状态',
  419. dataIndex: 'deleted',
  420. width: '100px',
  421. customRender: (text) => {
  422. if (text === 0) {
  423. return '未删除'
  424. }
  425. if (text === 1) {
  426. return '已删除'
  427. }
  428. },
  429. },
  430. // 审核人
  431. {
  432. title: '审核人',
  433. dataIndex: 'examineUser',
  434. width: '100px',
  435. },
  436. // 审核时间
  437. {
  438. title: '审核时间',
  439. dataIndex: 'examineTime',
  440. width: '340px',
  441. },
  442. // configIdea
  443. {
  444. title: '模型逻辑',
  445. dataIndex: 'configIdea',
  446. width: '100px',
  447. sdHidden: true,
  448. },
  449. {
  450. dataIndex: 'unitCode',
  451. sdHidden: true,
  452. },
  453. {
  454. title: '操作',
  455. dataIndex: 'sharedSetting',
  456. fixed: 'right',
  457. width: '100px',
  458. scopedSlots: { customRender: 'action' },
  459. },
  460. ],
  461. selectedRowKeys: [],
  462. selectedRows: [],
  463. modelLogicContent: '',
  464. modelLogicVisible: false,
  465. }
  466. },
  467. created() {
  468. this.time3 = [moment('2024-01-01', 'YYYY-MM-DD'), moment(new Date(), 'YYYY-MM-DD')]
  469. const timeList = this.time3.map((item) => {
  470. // 转化成时间戳 并忽略时分秒
  471. return moment(item._d)
  472. .startOf('day')
  473. .valueOf()
  474. })
  475. this.form.bussTimeSt = timeList[0]
  476. this.form.bussTimeEd = timeList[1] + 60 * 60 * 24 * 1000
  477. this.form.modelType = '1'
  478. },
  479. mounted() {
  480. // G-1_FENGXIAN_SHANCHU
  481. const roles = this.$store.state.sd.common.userInfo.default.roles
  482. this.deleteIssue = roles.map((val) => val.code).includes('G-1_FENGXIAN_SHANCHU')
  483. },
  484. methods: {
  485. /**
  486. * 搜索部分
  487. */
  488. changeStartTimeChange(val) {
  489. // "stringValue": "2023-12-16" 转换成这个格式
  490. this.form.pushDateSt = moment(val[0]._d).format('YYYY-MM-DD')
  491. this.form.pushDateEd = moment(val[1]._d).format('YYYY-MM-DD')
  492. },
  493. // 处理请求参数
  494. setExpressions() {
  495. const expressions = []
  496. const filter = [
  497. 'bussTimeSt',
  498. 'bussTimeEd',
  499. 'pushDateSt',
  500. 'pushDateEd',
  501. 'modelType',
  502. 'distributeType',
  503. 'status',
  504. 'modelDomain',
  505. 'deleted',
  506. 'modelCode',
  507. 'modelName',
  508. ]
  509. for (const key in this.form) {
  510. if (this.form[key] && !filter.includes(key)) {
  511. expressions.push({
  512. dataType: 'str',
  513. name: key,
  514. op: 'like',
  515. stringValue: '%' + this.form[key] + '%',
  516. })
  517. }
  518. if (this.form[key] && filter.includes(key)) {
  519. expressions.push({
  520. dataType: 'str',
  521. name: key,
  522. op: 'eq',
  523. stringValue: this.form[key],
  524. })
  525. }
  526. }
  527. return expressions
  528. },
  529. processReq(req) {
  530. req.data.expressions = []
  531. req.data.expressions = this.setExpressions()
  532. return req
  533. },
  534. processReqTask(req) {
  535. req.data.expressions = []
  536. if (this.taskForm.taskName) {
  537. req.data.expressions.push({
  538. dataType: 'str',
  539. name: 'taskName',
  540. op: 'like',
  541. stringValue: '%' + this.taskForm.taskName + '%',
  542. })
  543. }
  544. if (this.taskForm.time.length > 0) {
  545. req.data.expressions.push({
  546. dataType: 'long',
  547. name: 'creationTime',
  548. op: 'ge',
  549. longValue: moment(this.taskForm.time[0]._d).valueOf(),
  550. })
  551. req.data.expressions.push({
  552. dataType: 'long',
  553. name: 'creationTime',
  554. op: 'lt',
  555. longValue: moment(this.taskForm.time[1]._d).valueOf() + 60 * 60 * 24 * 1000,
  556. })
  557. }
  558. if (this.taskForm.status) {
  559. req.data.expressions.push({
  560. dataType: 'str',
  561. name: 'status',
  562. op: 'eq',
  563. stringValue: this.taskForm.status,
  564. })
  565. }
  566. return req
  567. },
  568. // 查询
  569. handleSearch() {
  570. this.dataKey++
  571. },
  572. // 重置
  573. handleReset() {
  574. this.$refs.advancedSearchForm.resetFields()
  575. this.form.bussTimeEd = null
  576. this.form.bussTimeSt = null
  577. this.form.pushDateSt = null
  578. this.form.pushDateEd = null
  579. this.form.deleted = '0'
  580. this.time3 = []
  581. this.form.distributeType = '0'
  582. this.form.status = '0'
  583. this.time = []
  584. this.handleSearch()
  585. },
  586. // 下发
  587. handleIssue() {
  588. this.istip = '下发中……'
  589. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  590. // 如果没有选中数据
  591. if (selectedRows.length !== 0) {
  592. const params = selectedRows.map((item) => {
  593. return {
  594. modelTypeName: item.modelTypeName,
  595. pushDate: item.pushDate,
  596. unitCode: item.unitCode,
  597. modelId: item.modelId,
  598. detailGroupId: item.detailGroupId,
  599. status: item.status,
  600. bussKey: item.bussKey || null,
  601. }
  602. })
  603. this.isshowLoading = true
  604. AuditRiskbraryService.questionSummaryExamine(params)
  605. .then((res) => {
  606. this.setMessageList(res.data)
  607. this.handleSearch()
  608. }) // 下发成功
  609. .finally(() => {
  610. this.isshowLoading = false
  611. })
  612. } else {
  613. // 如果
  614. if (this.form.deleted !== '0') {
  615. message.warning('请选择删除状态为未删除数据进行下发')
  616. return
  617. }
  618. // 请选择下发状态为待下发与下发失败数据进行下发
  619. if (this.form.status === '1') {
  620. message.warning('请选择下发状态为待下发与下发失败数据进行下发')
  621. this.isshowLoading = false
  622. return
  623. }
  624. this.isshowLoading = true
  625. const exportExpressions = this.setExpressions() // 导出表达式
  626. const params = {
  627. columns:
  628. 'sortNumber,modelCode,modelName,modelDomainName,modelPhaseName,modelTypeName,pushDate,secondUnit,unit,status,failReason,examineUser,examineTime,configIdea,unitCode,sharedSetting',
  629. maxResults: -1,
  630. expressions: exportExpressions,
  631. buttonExpressions: [],
  632. }
  633. AuditRiskbraryService.questionSummaryQueryExamine(params)
  634. .then((res) => {
  635. if (res.data) {
  636. const that = this
  637. Modal.info({
  638. title: '提示',
  639. content: '已创建下发任务',
  640. okText: '关闭',
  641. okType: 'danger',
  642. cancelText: '查看',
  643. onOk() {
  644. // console.log('OK')
  645. },
  646. onCancel() {
  647. that.dataViewRw = true
  648. },
  649. })
  650. } else {
  651. this.setMessageList(res.data)
  652. this.handleSearch()
  653. }
  654. }) // 下发成功
  655. .finally(() => {
  656. this.isshowLoading = false
  657. })
  658. }
  659. },
  660. restTaskForm() {
  661. this.taskForm = {
  662. time: [],
  663. status: '',
  664. taskName: '',
  665. }
  666. this.handleTaskSearch()
  667. },
  668. // 搜索
  669. handleTaskSearch() {
  670. this.dataTaskKey++
  671. },
  672. // 开始时间 结束时间
  673. changeTimeRange(val) {
  674. // 开始天的 00:00:00 结束天的 23:59:59 时间戳
  675. const timeList = val.map((item) => {
  676. // 转化成时间戳 并忽略时分秒
  677. return moment(item._d)
  678. .startOf('day')
  679. .valueOf()
  680. })
  681. // 结束时间加一天的时间戳
  682. this.form.bussTimeSt = timeList[0]
  683. this.form.bussTimeEd = timeList[1] + 60 * 60 * 24 * 1000
  684. },
  685. // 删除
  686. handleDelete() {
  687. Modal.confirm({
  688. title: '提示',
  689. content: '仅支持删除待下发及下发有误的数据,是否确认删除?',
  690. onOk: () => {
  691. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  692. const params = selectedRows.map((item) => {
  693. return {
  694. modelTypeName: item.modelTypeName,
  695. pushDate: item.pushDate,
  696. unitCode: item.unitCode,
  697. modelId: item.modelId,
  698. detailGroupId: item.detailGroupId,
  699. status: item.status,
  700. bussKey: item.bussKey || null,
  701. }
  702. })
  703. AuditRiskbraryService.questionSummaryDelete(params).then((res) => {
  704. if (res?.data) {
  705. message.success('删除成功')
  706. this.handleSearch()
  707. } else {
  708. message.warning('删除失败')
  709. }
  710. })
  711. },
  712. })
  713. },
  714. // 导出
  715. fnexport() {
  716. this.istip = '正在导出请稍等……'
  717. this.isshowLoading = true
  718. this.exportExpressions = this.setExpressions()
  719. const account = getUserInfo().account
  720. AuditRiskbraryService.getUserInfo(account).then((res) => {
  721. const params = {
  722. columns:
  723. 'sortNumber,jmEventType,eventTagName,modelTypeName,modelType,pushDate,secondUnit,secondUnitCode,unitCode,unit,questionNum,examineNum,nonExamineNum,examineFailNum,sharedSetting',
  724. maxResults: 10,
  725. startPosition: 0,
  726. expressions: this.exportExpressions,
  727. buttonExpressions: [],
  728. }
  729. AuditRiskbraryService.examineSummaryExport(params)
  730. .then((res) => {
  731. if (res.status === 200) {
  732. const url = URL.createObjectURL(res.data)
  733. const filename = res.headers['content-disposition']
  734. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  735. download(url, decodeURI(fname))
  736. // 导出成功
  737. message.success('导出成功')
  738. } else {
  739. Modal.warning({
  740. title: '提示',
  741. content: '导出报错,请联系管理员!',
  742. })
  743. return false
  744. }
  745. })
  746. .finally(() => {
  747. this.isshowLoading = false
  748. })
  749. })
  750. },
  751. // 下发回馈
  752. setMessageList(data) {
  753. this.issueMessageList = [
  754. { label: '下发总数:', value: data.questionNum },
  755. { label: '下发成功:', value: data.examineNum },
  756. { label: '下发失败:', value: data.examineFailNum },
  757. { label: '下发失败原因:', value: data.failReason },
  758. ]
  759. this.issueVisible = true
  760. },
  761. // 前往领域
  762. toPath() {
  763. window.open('#/sd-frame/audit-area-list')
  764. },
  765. // table选择
  766. onSelectChange(selectedRowKeys, selectedRows) {
  767. this.selectedRowKeys = selectedRowKeys
  768. this.selectedRows = selectedRows
  769. },
  770. // 关闭
  771. cancel() {
  772. this.issueVisible = false
  773. this.selectedRowKeys = []
  774. this.selectedRows = []
  775. },
  776. /**
  777. * 操作部分
  778. */
  779. // 模型逻辑
  780. showModelLogic(record) {
  781. this.modelLogicContent = record.configIdea
  782. this.modelLogicVisible = true
  783. },
  784. openRiskDetail(row) {
  785. // 审核状态
  786. this.detailStatus = row.status !== 1
  787. const params = {
  788. modelId: row.modelId,
  789. detailGroupId: row.detailGroupId,
  790. status: row.status,
  791. bussKey: row.bussKey || null,
  792. pushDate: row.pushDate,
  793. unitCode: row.unitCode,
  794. }
  795. const formData = new FormData()
  796. Object.keys(params).forEach((key) => {
  797. formData.append(key, params[key])
  798. })
  799. this.modelDetail = {
  800. modelDomainName: row.modelDomainName,
  801. batchName: row.modelName,
  802. batchCode: row.modelCode,
  803. riskData: row.risk,
  804. }
  805. // 地址audit-risk-detail 参数params
  806. const detailJson = JSON.stringify(this.modelDetail)
  807. const queryJson = JSON.stringify(params)
  808. const openUrl = `queryJson=${encodeURIComponent(queryJson)}&modelDetail=${encodeURIComponent(
  809. detailJson
  810. )}&detailStatus=${encodeURIComponent(this.detailStatus)}&type=sh`
  811. window.open('#/audit-risk-detail?' + openUrl)
  812. },
  813. },
  814. }
  815. </script>
  816. <style module lang="scss">
  817. @use '@/common/design' as *;
  818. .wrap-height {
  819. height: 100%;
  820. .button-content {
  821. width: 400px;
  822. margin-left: 25px;
  823. button {
  824. margin: 0 4px;
  825. }
  826. }
  827. }
  828. </style>