audit-shsum-list.vue 28 KB

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