ic-evaluation-list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <template>
  2. <div :class="$style.wrapHeight">
  3. <a-card>
  4. <!-- 高级搜索组件 -->
  5. <audit-advanced-query
  6. :expand="expand"
  7. :search-data="formData"
  8. :ref-name="searchform"
  9. :search-style="{ height: '170px', left: '20px', top: '57px' }"
  10. :search-fun="handleSearch"
  11. @searchedClick="searchedClick"
  12. @resetForm="resetForm"
  13. >
  14. <template>
  15. <a-col :span="12">
  16. <a-form-model-item label="计划年度" prop="year">
  17. <sd-select v-model="formData.year" :options="yearArry" allow-clear />
  18. </a-form-model-item>
  19. </a-col>
  20. <a-col :span="12">
  21. <a-form-model-item label="评价名称" prop="evaluationname">
  22. <a-input v-model="formData.evaluationname" allow-clear />
  23. </a-form-model-item>
  24. </a-col>
  25. <a-col :span="12">
  26. <a-form-model-item label="评价类型" prop="evaluationtype">
  27. <sd-select v-model="formData.evaluationtype" :options="evaluationtype" />
  28. </a-form-model-item>
  29. </a-col>
  30. <a-col :span="12">
  31. <a-form-model-item label="评价方式" prop="evaluationways">
  32. <sd-select v-model="formData.evaluationways" :options="evaluationways" />
  33. </a-form-model-item>
  34. </a-col>
  35. </template>
  36. </audit-advanced-query>
  37. <sd-data-table-ex
  38. v-show="flag"
  39. :key="key"
  40. ref="icevaluationTable"
  41. :editnode="editnode"
  42. form-id="icEvaluationPlan"
  43. page-id="ic/evaluation/icEvaluationPlan"
  44. data-url="api/xcoa-mobile/v1/icevaluationplan/all-list"
  45. :columns="columns"
  46. :actions="actions"
  47. show-selection
  48. :show-advance-query="true"
  49. :filter-expressions="expressions"
  50. :search-fields="['year', 'evaluationName']"
  51. @searchbtnClick="searchbtnClick"
  52. >
  53. <template slot="islink" slot-scope="text, record">
  54. <a @click="openversion(record)">{{ text }}</a>
  55. </template>
  56. <template slot="action" slot-scope="text, record">
  57. <a-button type="link" @click="open(record)"
  58. ><sd-icon type="sd-eye" :style="{ fontSize: '25px' }"
  59. /></a-button>
  60. </template>
  61. </sd-data-table-ex>
  62. <div :class="[$style.btns]">
  63. <a-col :span="13" :offset="0">
  64. <a-radio-group v-model="radioValue" @change="radioOnChange">
  65. <a-radio :style="radioStyle" :value="'0'">
  66. 全部
  67. </a-radio>
  68. <a-radio :style="radioStyle" :value="'1'">
  69. 待处理
  70. </a-radio>
  71. </a-radio-group>
  72. </a-col>
  73. </div>
  74. </a-card>
  75. <sd-detail-modal
  76. ref="versionform"
  77. :read-only="true"
  78. :record-id="recordId"
  79. page-id="ic/version/icMtxVersion"
  80. :modal-props="{ width: 1200 }"
  81. >
  82. <template v-slot="{ model, fields }">
  83. <table style="width:80%">
  84. <colgroup>
  85. <col style="width: 20%;" />
  86. <col style="width: 30%;" />
  87. <col style="width: 20%;" />
  88. <col style="width: 30%;" />
  89. </colgroup>
  90. <tr
  91. ><sd-form-item-td name="belongUnitName"></sd-form-item-td
  92. ><sd-form-item-td name="year"></sd-form-item-td
  93. ></tr>
  94. <tr v-show="false"
  95. ><sd-form-item-td name="belongUnitCode"></sd-form-item-td>
  96. <sd-form-item-td name="belongUnitId"></sd-form-item-td>
  97. </tr>
  98. <tr
  99. ><sd-form-item-td name="auditOrgId" :hidden="true"></sd-form-item-td>
  100. <sd-form-item-td name="modifyDeptId" :hidden="true"></sd-form-item-td>
  101. </tr>
  102. <tr
  103. ><sd-form-item-td name="modifyDeptCode" :hidden="true"></sd-form-item-td>
  104. <sd-form-item-td name="modifyDeptName" :hidden="true"></sd-form-item-td>
  105. </tr>
  106. <tr
  107. ><sd-form-item-td name="versionCode"></sd-form-item-td
  108. ><sd-form-item-td name="versuibType"></sd-form-item-td
  109. ></tr>
  110. <tr><sd-form-item-td colspan="3" name="matrixType"></sd-form-item-td></tr>
  111. <tr><sd-form-item-td colspan="3" name="matrixDesc"></sd-form-item-td></tr>
  112. <tr
  113. ><sd-form-item-td name="creatorName"></sd-form-item-td
  114. ><sd-form-item-td name="creationTime"></sd-form-item-td></tr
  115. ></table>
  116. </template>
  117. </sd-detail-modal>
  118. </div>
  119. </template>
  120. <script>
  121. import PageService from '@/common/services/page-service'
  122. import FlowcenterService from '@/flowcenter/flowcenter-service'
  123. import { Modal, message } from 'ant-design-vue'
  124. import axios from '@/common/services/axios-instance'
  125. import systemManage from '@/system-manage/system-manage'
  126. import errorUtil from '@/common/services/error-util'
  127. import download from '@/common/services/download'
  128. import TableActionTypes from '@/common/services/table-action-types'
  129. import TableColumnTypes from '@/common/services/table-column-types'
  130. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  131. import openAsTrustId from '@/common/services/open-as-trust-id'
  132. import pickValues from '@/common/services/pick-values'
  133. import sdIconPicker from '@/common/components/sd-icon-picker.vue'
  134. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  135. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  136. // import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  137. // import mtxVersionForm from './mtx-version-form'
  138. // import MtxVersionService from './ic-evaluation-service'
  139. import components from './_import-components/ic-evaluation-list-import'
  140. export default {
  141. name: 'MtxEvaluationList',
  142. metaInfo: {
  143. title: '内控评价',
  144. },
  145. components: {
  146. ...components,
  147. auditAdvancedQuery,
  148. // mtxVersionForm,
  149. },
  150. // auditAdvancedGroupMixins
  151. mixins: [auditAdvancedQueryMixins],
  152. data() {
  153. return {
  154. yearArry: [],
  155. waterMark: systemManage.getFormWaterMark(),
  156. flag: true,
  157. recordId: '',
  158. editnode: true, // 列表是否可以新建
  159. key: 0,
  160. treeData: [],
  161. searchform: 'searchform',
  162. formData: {
  163. year: '',
  164. evaluationname: '',
  165. evaluationways: '',
  166. evaluationtype: '',
  167. },
  168. evaluationways: [],
  169. evaluationtype: [],
  170. columns: [
  171. {
  172. title: '序号',
  173. customRender: (text, record, index) => `${index + 1}`,
  174. width: '80px',
  175. },
  176. { dataIndex: 'id', sdHidden: true },
  177. { dataIndex: 'instId', sdHidden: true },
  178. { dataIndex: 'evaluationType', sdHidden: true },
  179. {
  180. title: '计划年度',
  181. dataIndex: 'year',
  182. width: '120px',
  183. defaultSortOrder: 'desc',
  184. },
  185. {
  186. title: '计划名称',
  187. dataIndex: 'evaluationName',
  188. scopedSlots: { customRender: 'islink' },
  189. },
  190. {
  191. title: '检查单位',
  192. dataIndex: 'inspectUnitName',
  193. },
  194. {
  195. title: '创建日期',
  196. dataIndex: 'creationTime',
  197. sdRender: TableColumnTypes.date,
  198. width: '120px',
  199. },
  200. {
  201. title: '评价类型',
  202. dataIndex: 'evaluationType',
  203. width: '100px',
  204. },
  205. {
  206. title: '流程状态',
  207. dataIndex: 'flowState',
  208. width: '120px',
  209. },
  210. { title: '当前处理人', dataIndex: 'currentUser', width: '120px' },
  211. {
  212. title: '操作',
  213. dataIndex: '',
  214. scopedSlots: { customRender: 'action' },
  215. align: 'center',
  216. width: '80px',
  217. },
  218. ],
  219. actions: [
  220. {
  221. label: '新建计划',
  222. id: 'new',
  223. type: TableActionTypes.primary, // 新建按钮,不需要回调,自动处理
  224. permission: null,
  225. callback: this.createEvaluationPlan,
  226. index: 4,
  227. },
  228. {
  229. label: '删除',
  230. id: 'delete',
  231. permission: null,
  232. class: 'batch',
  233. callback: this.deleteRows,
  234. index: 3,
  235. },
  236. ],
  237. expressions: [],
  238. catalogId: null,
  239. catalogName: '',
  240. auditMattersPath: '',
  241. visible: false,
  242. radioValue: '0',
  243. radioType: true,
  244. radioStyle: {},
  245. }
  246. },
  247. mounted() {
  248. // 初始化年份下拉框
  249. this.initYearSelect()
  250. this.initDictionaryInfo()
  251. },
  252. methods: {
  253. radioOnChange(e, info) {
  254. this.radioValue = e.target.value
  255. this.radioType = true
  256. this.expressions.forEach((item) => {
  257. if (item.name === 'pending') {
  258. item.stringValue = this.radioValue
  259. this.radioType = false
  260. }
  261. })
  262. if (this.radioType) {
  263. this.expressions.push({
  264. dataType: 'str',
  265. name: 'pending',
  266. op: 'eq',
  267. stringValue: this.radioValue,
  268. })
  269. }
  270. this.expressions = [...this.expressions]
  271. this.$refs.icevaluationTable.clearSelection()
  272. },
  273. createEvaluationPlan() {
  274. const url = '/sd-flow-guide?code=PRODUCT_IC_NKPJJH' // 新页面要打开的路由地址
  275. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  276. if (refreshFlag) {
  277. // 这里写或者调刷新的方法
  278. this.refreshDataTable()
  279. }
  280. })
  281. },
  282. refreshDataTable() {
  283. if (this.$refs.icevaluationTable) {
  284. this.$refs.icevaluationTable.clearSelection()
  285. this.$refs.icevaluationTable.refresh()
  286. }
  287. },
  288. // 初始化年份下拉框
  289. initYearSelect() {
  290. const nowYear = new Date().getFullYear()
  291. const yearArry = []
  292. yearArry.push(nowYear)
  293. for (let i = 1; i < 6; i++) {
  294. yearArry.push(nowYear - i)
  295. }
  296. for (let i = 1; i < 11; i++) {
  297. yearArry.push(nowYear + i)
  298. }
  299. yearArry.sort()
  300. yearArry.forEach((year) => {
  301. this.yearArry.push({
  302. name: year,
  303. id: year,
  304. })
  305. })
  306. },
  307. initDictionaryInfo() {
  308. axios({
  309. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=EVALUATION_TYPE',
  310. method: 'get',
  311. }).then((res) => {
  312. if (res.status === 200) {
  313. this.evaluationtype = res.data
  314. }
  315. })
  316. axios({
  317. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=EVALUATION_MODE',
  318. method: 'get',
  319. }).then((res) => {
  320. if (res.status === 200) {
  321. this.evaluationways = res.data
  322. }
  323. })
  324. },
  325. Saved() {
  326. message.success('保存成功')
  327. this.$refs.versionform.hide()
  328. },
  329. Closed() {
  330. this.$refs.versionform.hide()
  331. // this.$refs.versionform.resetFields()
  332. },
  333. open(record) {
  334. this.recordId = record.id
  335. window.open('#/sd-webflow/done-pages/' + record.instId)
  336. },
  337. openversion(record) {
  338. if (record.flowState === '结束') {
  339. if (record.evaluationType === '穿行测试') {
  340. window.open('#/ic-work/iam-ic-cross-list?planId=' + record.id)
  341. } else {
  342. window.open('#/ic-work/iam-ic-control-list?planId=' + record.id)
  343. }
  344. } else {
  345. let url = ''
  346. if ((record.flowState === '起草') | (record.flowState === '开始')) {
  347. // window.open('#/sd-webflow/pages/draft/' + record.instId)
  348. url = `/sd-webflow/pages/draft/` + record.instId
  349. } else {
  350. // window.open('#/sd-webflow/done-pages/' + record.instId)
  351. url = `/sd-webflow/done-pages/` + record.instId
  352. }
  353. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  354. if (refreshFlag) this.refreshDataTable()
  355. })
  356. }
  357. },
  358. handleSearch() {
  359. this.expressions = []
  360. // 全部 待处理
  361. if (this.radioValue === '1') {
  362. this.Expressions.push({
  363. dataType: 'str',
  364. name: 'pending',
  365. op: 'eq',
  366. stringValue: this.radioValue,
  367. })
  368. }
  369. // 审计事项名称
  370. if (this.formData.year) {
  371. this.expressions.push({
  372. dataType: 'str',
  373. name: 'year',
  374. op: 'eq',
  375. stringValue: this.formData.year[0].name,
  376. })
  377. }
  378. // 审计事项编号
  379. if (this.formData.evaluationname) {
  380. this.expressions.push({
  381. dataType: 'str',
  382. name: 'evaluationName',
  383. op: 'like',
  384. stringValue: '%' + this.formData.evaluationname + '%',
  385. })
  386. }
  387. if (this.formData.evaluationtype) {
  388. this.expressions.push({
  389. dataType: 'str',
  390. name: 'evaluationType',
  391. op: 'like',
  392. stringValue: this.formData.evaluationtype[0].id,
  393. })
  394. }
  395. if (this.formData.evaluationways) {
  396. this.expressions.push({
  397. dataType: 'str',
  398. name: 'evaluationMode',
  399. op: 'eq',
  400. stringValue: this.formData.evaluationways[0].id,
  401. })
  402. }
  403. this.expressions = [...this.expressions]
  404. },
  405. // 重置
  406. resetForm() {
  407. this.formData.year = null
  408. this.formData.evaluationways = null
  409. this.formData.evaluationtype = null
  410. },
  411. // 删除数据
  412. deleteRows(record) {
  413. const selecteFlowState = this.$refs.icevaluationTable.getSelectedRows()
  414. const selectedRowKeys = this.$refs.icevaluationTable.getSelectedRowKeys()
  415. if (selectedRowKeys.length === 0) {
  416. Modal.info({
  417. content: '请选择需要删除的文件',
  418. })
  419. return
  420. }
  421. let flag = false
  422. selecteFlowState.forEach((item) => {
  423. if (item.endType !== 0) {
  424. flag = true
  425. }
  426. })
  427. if (flag) {
  428. // 有过错误
  429. Modal.error({
  430. title: '删除失败:存在不是草稿状态的数据',
  431. })
  432. } else {
  433. Modal.confirm({
  434. title: '你确定删除这项内容吗?',
  435. content: '删除这条数据后,就无法恢复初始的状态。',
  436. okText: '删除',
  437. okType: 'danger',
  438. onOk: () => {
  439. this.loading = true
  440. const instIds = []
  441. selecteFlowState.forEach((item) => {
  442. if (item.instId) {
  443. instIds.push(item.instId)
  444. }
  445. })
  446. const params = {
  447. flowCallbackBeanName: 'formBeanCleanerCallBack',
  448. processInstanceIds: instIds.join(','),
  449. }
  450. FlowcenterService.fnDarftsDelete(params).then((res) => {
  451. if (res.status === 200) {
  452. message.success({ content: '删除成功!' }, 1).then(() => {
  453. this.$refs.icevaluationTable.clearSelection()
  454. this.$refs.icevaluationTable.refresh()
  455. this.loading = false
  456. })
  457. }
  458. })
  459. },
  460. })
  461. }
  462. },
  463. },
  464. }
  465. </script>
  466. <style module lang="scss">
  467. @use '@/common/design' as *;
  468. .wrap-height {
  469. height: 100%;
  470. .row-height {
  471. display: flex;
  472. flex: auto;
  473. height: 100%;
  474. .rightcard {
  475. flex: 1;
  476. width: calc(100% - 20%);
  477. height: 100%;
  478. }
  479. }
  480. }
  481. .btns {
  482. position: absolute;
  483. top: 20px;
  484. right: 0;
  485. left: 20px;
  486. z-index: 100;
  487. width: calc(100% - 400px);
  488. span {
  489. color: blue;
  490. }
  491. }
  492. </style>