spic-rectfeedback-list.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <template>
  2. <a-card>
  3. <!-- 高级搜索区域 -->
  4. <audit-advanced-query
  5. :expand="expand"
  6. :class="$style.advancedQuery"
  7. :search-data="advSearchForm"
  8. :ref-name="searchform"
  9. :search-style="{ height: '260px', left: '0px', top: '50px' }"
  10. :search-fun="advSearch"
  11. @searchedClick="searchedClick"
  12. @resetForm="resetForm"
  13. >
  14. <template>
  15. <a-row>
  16. <a-col :span="12">
  17. <a-form-model-item label="问题名称" prop="findingTitle">
  18. <a-input v-model="advSearchForm.findingTitle" />
  19. </a-form-model-item>
  20. </a-col>
  21. <a-col :span="12">
  22. <a-form-model-item label="问题编号" prop="findingCode">
  23. <a-input v-model="advSearchForm.findingCode" />
  24. </a-form-model-item>
  25. </a-col>
  26. </a-row>
  27. <a-row>
  28. <a-col :span="12">
  29. <a-form-model-item :label="'项目名称'" prop="projectName">
  30. <a-input v-model="advSearchForm.projectName" />
  31. </a-form-model-item>
  32. </a-col>
  33. <a-col :span="12">
  34. <a-form-model-item label="销号状态" prop="cancellStatus">
  35. <sd-select
  36. v-model="advSearchForm.cancellStatus"
  37. :allow-clear="true"
  38. :options="cancellStatusOptions"
  39. />
  40. </a-form-model-item>
  41. </a-col>
  42. </a-row>
  43. <a-row>
  44. <a-col :span="12">
  45. <a-form-model-item label="整改责任主体" prop="auditedUnit">
  46. <sd-group-picker
  47. ref="unitSelect"
  48. v-model="advSearchForm.auditedUnit"
  49. :single="true"
  50. :read-only="false"
  51. @change="changeunit"
  52. />
  53. </a-form-model-item>
  54. </a-col>
  55. <a-col :span="12">
  56. <a-form-model-item label="整改责任主体联系人" prop="auditedContacts">
  57. <sd-user-picker
  58. ref="userSelect"
  59. v-model="advSearchForm.auditedContacts"
  60. :hierarchical="false"
  61. :single="true"
  62. :read-only="false"
  63. @change="changeauditedContacts"
  64. />
  65. </a-form-model-item>
  66. </a-col>
  67. </a-row>
  68. <a-row>
  69. <a-col :span="12">
  70. <a-form-model-item label="计划年度" prop="planYear">
  71. <a-date-picker
  72. v-model="advSearchForm.planYear"
  73. mode="year"
  74. picker="YYYY"
  75. format="YYYY"
  76. :allow-clear="false"
  77. placeholder="选择年度"
  78. :input-read-only="true"
  79. :value="year"
  80. :open="endOpen"
  81. @panelChange="yearChange"
  82. @openChange="handleEndOpenChange"
  83. ></a-date-picker>
  84. </a-form-model-item>
  85. </a-col>
  86. <a-col :span="12">
  87. <a-form-model-item :label="'整改状态'" prop="rectStatus">
  88. <sd-select
  89. v-model="advSearchForm.rectStatus"
  90. :allow-clear="true"
  91. :options="StatusOptions"
  92. />
  93. </a-form-model-item>
  94. </a-col>
  95. </a-row>
  96. </template>
  97. </audit-advanced-query>
  98. <div :class="$style.rectPlanProjectlist">
  99. <sd-data-table-ex
  100. ref="dataTable"
  101. :projectlist="true"
  102. :class="$style.rectfeedbacklist"
  103. :columns="columns"
  104. :actions="actions"
  105. show-selection
  106. form-id="spicRectFeedback"
  107. data-url="api/xcoa-mobile/v1/spicrectfeedback/list"
  108. :filter-expressions="tableExpressions"
  109. :show-advance-query="true"
  110. :search-fields="['findingTitle']"
  111. :custom-delete-fun="deleteRows"
  112. @searchbtnClick="searchbtnClick"
  113. >
  114. <div slot="isLink" slot-scope="text, record">
  115. <a :title="text" @click="linkFindingtitle(record)">{{ text }}</a>
  116. </div>
  117. </sd-data-table-ex>
  118. </div>
  119. </a-card>
  120. </template>
  121. <script>
  122. import axios from '@/common/services/axios-instance'
  123. import { message, Modal } from 'ant-design-vue'
  124. import errorUtil from '@/common/services/error-util'
  125. import { getUserInfo } from '@/common/store-mixin'
  126. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  127. import auditAdvancedQuery from '@product/iam/components/audit-advanced-query.vue'
  128. import auditAdvancedQueryMixins from '@product/iam/components/audit-advanced-query-mixins'
  129. import components from './_import-components/spic-rectfeedback-list-import'
  130. export default {
  131. name: 'SpicRectfeedbackList',
  132. metaInfo: {
  133. title: '整改反馈',
  134. },
  135. components: { ...components, auditAdvancedQuery },
  136. mixins: [auditAdvancedQueryMixins],
  137. data() {
  138. return {
  139. endOpen: false,
  140. year: null,
  141. searchYear: '',
  142. yearArry: [],
  143. searchValue: '',
  144. mainSendUnit: [],
  145. checkboxValue: false,
  146. pageId: 'audit/spicrectfeedback/spicRectFeedback',
  147. columns: [
  148. {
  149. title: '序号',
  150. customRender: (text, record, index) => `${index + 1}`,
  151. width: '80px',
  152. },
  153. {
  154. title: 'id',
  155. dataIndex: 'id',
  156. sdHidden: true,
  157. },
  158. {
  159. title: '问题名称(定性描述)',
  160. dataIndex: 'findingTitle',
  161. width: '300px',
  162. scopedSlots: { customRender: 'isLink' },
  163. },
  164. {
  165. title: '问题编号',
  166. dataIndex: 'findingCode',
  167. sorter: true,
  168. width: '200px',
  169. // sortDirections: ['ascend', 'descend'],
  170. },
  171. {
  172. title: '项目名称',
  173. dataIndex: 'projectName',
  174. width: '300px',
  175. },
  176. {
  177. title: '计划年度',
  178. dataIndex: 'planYear',
  179. width: '100px',
  180. },
  181. {
  182. title: '整改责任主体',
  183. dataIndex: 'auditedUnitName',
  184. width: '150px',
  185. },
  186. {
  187. title: '整改责任主体联系人',
  188. dataIndex: 'auditedContactsName',
  189. width: '150px',
  190. // sdHidden: true,
  191. },
  192. {
  193. title: '整改责任部门',
  194. dataIndex: 'responsibleDeptName',
  195. width: '150px',
  196. },
  197. {
  198. title: '问题性质',
  199. dataIndex: 'problemNature',
  200. width: '100px',
  201. },
  202. {
  203. title: '问题分类',
  204. dataIndex: 'problemCategoryFunction',
  205. width: '180px',
  206. },
  207. // {
  208. // title: '整改责任主体',
  209. // dataIndex: 'auditedUnitName',
  210. // sorter: true,
  211. // width: '150px',
  212. // sortDirections: ['ascend', 'descend'],
  213. // },
  214. {
  215. title: '整改类型',
  216. dataIndex: 'rectType',
  217. width: '150px',
  218. },
  219. {
  220. title: '整改状态',
  221. dataIndex: 'rectState',
  222. width: '150px',
  223. },
  224. {
  225. title: '销号状态',
  226. dataIndex: 'cancellStatus',
  227. width: '150px',
  228. },
  229. {
  230. dataIndex: 'auditedContactsAccount',
  231. sdHidden: true,
  232. },
  233. // {
  234. // title: '操作',
  235. // dataIndex: 'id',
  236. // scopedSlots: { customRender: 'opt' },
  237. // width: '100px',
  238. // },
  239. {
  240. title: '操作',
  241. dataIndex: 'opt',
  242. aligen: 'center',
  243. customRender: (text, record, index) => {
  244. if (
  245. record.problemNature === '问题类' &&
  246. record.auditedContactsAccount === getUserInfo().account
  247. ) {
  248. return (
  249. <span>
  250. <a vOn:click={(evt) => this.delayApply(record)}>延期申请</a>
  251. </span>
  252. )
  253. }
  254. },
  255. width: '100px',
  256. },
  257. {
  258. title: '流程ID',
  259. dataIndex: 'instId',
  260. sdHidden: true,
  261. },
  262. ],
  263. actions: [
  264. // {
  265. // label: '新建',
  266. // id: 'new',
  267. // type: TableActionTypes.primary, // 新建按钮,不需要回调,自动处理
  268. // permission: null, // 纯前端操作,不需要权限控制
  269. // callback: this.createrectfeedback,
  270. // },
  271. // {
  272. // label: '删除',
  273. // id: 'delete',
  274. // type: TableActionTypes.ex.delete, // 删除按钮,不需要回调,会自动处理(对sd-data-table无效)
  275. // },
  276. // {
  277. // label: '删除',
  278. // id: 'delete',
  279. // type: 'delete', // 删除按钮,不需要回调,会自动处理(对sd-data-table无效)
  280. // permission: null,
  281. // },
  282. // {
  283. // label: '导出',
  284. // permission: null, // 纯前端操作,不需要权限控制
  285. // callback: () => {
  286. // this.$refs.exportExcel.exportdata()
  287. // },
  288. // },
  289. ],
  290. tableExpressions: [],
  291. buttonsfortable: [
  292. // {
  293. // label: '变更',
  294. // id: 'changeleader',
  295. // showCondition: '',
  296. // },
  297. ],
  298. searchform: 'searchform',
  299. expand: false,
  300. advSearchForm: {
  301. findingTitle: '',
  302. findingCode: '',
  303. cancellStatus: '',
  304. projectName: '',
  305. planYear: '',
  306. auditedUnit: '',
  307. auditedContacts: '',
  308. rectStatus: [],
  309. },
  310. StatusOptions: [],
  311. cancellStatusOptions: [],
  312. projectId: '',
  313. setType: '',
  314. unitName: '',
  315. contactsName: '',
  316. }
  317. },
  318. mounted() {
  319. // 初始化数据字典信息
  320. this.initDictionaryInfo()
  321. },
  322. methods: {
  323. yearChange(value) {
  324. this.year = value
  325. this.advSearchForm.planYear = value.format('YYYY')
  326. if (document.getElementsByClassName('ant-calendar-picker-container').length > 0) {
  327. document.getElementsByClassName('ant-calendar-picker-container')[0].style.display = 'none'
  328. }
  329. },
  330. changeunit(values) {
  331. this.unitName = ''
  332. values.forEach((element) => {
  333. this.unitName = element.name
  334. })
  335. },
  336. changeauditedContacts(values) {
  337. this.contactsName = ''
  338. values.forEach((element) => {
  339. this.contactsName = element.name
  340. })
  341. console.log('---------------', this.contactsName)
  342. },
  343. handleEndOpenChange(open) {
  344. this.endOpen = open
  345. },
  346. // 整改延期
  347. delayApply(record) {
  348. axios({
  349. url:
  350. `api/xcoa-mobile/v1/spicRectifyQuestionDelay/enable-status?rectFeedbackId=` + record.id,
  351. method: 'get',
  352. }).then((res) => {
  353. if (res.data) {
  354. Modal.info({
  355. content: '延期申请未结束',
  356. })
  357. } else {
  358. const url = `/sd-flow-guide?code=SPIC_RECT_DELAY&rectFeedbackId=${record.id}&projectId=${record.projectId}`
  359. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  360. if (refreshFlag) {
  361. this.refresh()
  362. }
  363. })
  364. }
  365. })
  366. },
  367. initDictionaryInfo() {
  368. axios({
  369. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=RECT_STATUS',
  370. method: 'get',
  371. }).then((res) => {
  372. this.StatusOptions = res.data.map((val) => {
  373. return {
  374. id: val.id,
  375. name: val.name,
  376. }
  377. })
  378. })
  379. axios({
  380. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=CANCELL_STATUS',
  381. method: 'get',
  382. }).then((res) => {
  383. if (res.status === 200) {
  384. this.cancellStatusOptions = res.data
  385. }
  386. })
  387. },
  388. createrectfeedback() {
  389. // 审计问题反馈
  390. // const url = `/sd-flow-guide?code=SPIC_AUDIT_WTFK` // 新页面要打开的路由地址
  391. // 审计风险反馈
  392. const url = `/sd-flow-guide?code=SPIC_AUDIT_FXFK`
  393. // 审计建议反馈
  394. // const url = `/sd-flow-guide?code=SPIC_AUDIT_JYFK`
  395. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  396. if (refreshFlag) {
  397. this.$refs.dataTable.refresh()
  398. }
  399. })
  400. },
  401. onSearch(value) {
  402. this.tableExpressions = []
  403. if (value) {
  404. const expressions = []
  405. // 问题名称
  406. expressions.push({
  407. dataType: 'str',
  408. name: 'findingTitle',
  409. op: 'like',
  410. stringValue: `%${value}%`,
  411. })
  412. // 问题编号
  413. expressions.push({
  414. dataType: 'str',
  415. name: 'findingCode',
  416. op: 'like',
  417. stringValue: `%${value}%`,
  418. })
  419. this.tableExpressions.push({
  420. dataType: 'exps',
  421. op: 'or',
  422. expressionsValue: expressions,
  423. })
  424. // 项目名称
  425. expressions.push({
  426. dataType: 'str',
  427. name: 'projectName',
  428. op: 'like',
  429. stringValue: `%${value}%`,
  430. })
  431. }
  432. },
  433. advSearch() {
  434. this.tableExpressions = []
  435. // 问题名称
  436. if (this.advSearchForm.findingTitle) {
  437. this.tableExpressions.push({
  438. dataType: 'str',
  439. name: 'findingTitle',
  440. op: 'like',
  441. stringValue: `%${this.advSearchForm.findingTitle}%`,
  442. })
  443. }
  444. // 问题编号
  445. if (this.advSearchForm.findingCode) {
  446. this.tableExpressions.push({
  447. dataType: 'str',
  448. name: 'findingCode',
  449. op: 'like',
  450. stringValue: `%${this.advSearchForm.findingCode}%`,
  451. })
  452. }
  453. // 整改状态
  454. if (this.advSearchForm.cancellStatus.length > 0) {
  455. this.tableExpressions.push({
  456. dataType: 'str',
  457. name: 'cancellStatus',
  458. op: 'like',
  459. stringValue: `%${this.advSearchForm.cancellStatus[0].id}%`,
  460. })
  461. }
  462. // 项目名称
  463. if (this.advSearchForm.projectName) {
  464. this.tableExpressions.push({
  465. dataType: 'str',
  466. name: 'projectName',
  467. op: 'like',
  468. stringValue: `%${this.advSearchForm.projectName}%`,
  469. })
  470. }
  471. // 年度计划
  472. if (this.advSearchForm.planYear) {
  473. this.tableExpressions.push({
  474. dataType: 'str',
  475. name: 'planYear',
  476. op: 'eq',
  477. stringValue: `${this.advSearchForm.planYear}`,
  478. })
  479. }
  480. // 整改责任主体
  481. if (this.advSearchForm.auditedUnit) {
  482. this.tableExpressions.push({
  483. dataType: 'str',
  484. name: 'auditedUnitName',
  485. op: 'like',
  486. stringValue: `%${this.unitName}%`,
  487. })
  488. }
  489. // 整改责任主体联系人
  490. if (this.advSearchForm.auditedContacts) {
  491. this.tableExpressions.push({
  492. dataType: 'str',
  493. name: 'auditedContactsName',
  494. op: 'like',
  495. stringValue: `%${this.contactsName}%`,
  496. })
  497. }
  498. console.log('aaaaaaaaaaaaaaaa')
  499. // 整改状态
  500. if (this.advSearchForm.rectStatus.length > 0) {
  501. this.tableExpressions.push({
  502. dataType: 'str',
  503. name: 'RECT_STATE',
  504. op: 'eq',
  505. stringValue: `${this.advSearchForm.rectStatus[0].id}`,
  506. })
  507. }
  508. },
  509. searchedClick() {
  510. this.expand = !this.expand
  511. },
  512. // 重置年份
  513. resetForm() {
  514. this.advSearchForm.auditedUnit = ''
  515. this.advSearchForm.auditedContacts = ''
  516. this.unitName = ''
  517. this.advSearchForm.cancellStatus = []
  518. this.advSearchForm.rectStatus = []
  519. },
  520. deleteRows() {
  521. const selectedRowKeys = this.$refs.dataTable.getSelectedRowKeys()
  522. if (selectedRowKeys.length === 0) {
  523. Modal.info({
  524. content: '请选择需要删除的文件',
  525. })
  526. return
  527. }
  528. const selectedRows = this.$refs.dataTable.getSelectedRows()
  529. let flag = false
  530. selectedRows.forEach((item) => {
  531. if (item.endType !== '0') {
  532. flag = true
  533. }
  534. })
  535. if (flag) {
  536. Modal.error({
  537. title: '删除失败:存在不是草稿状态的数据',
  538. })
  539. return
  540. }
  541. return new Promise((resolve) => {
  542. Modal.confirm({
  543. title: '您确定删除这项内容吗?',
  544. content: '删除这条数据后,就无法恢复初始的状态。',
  545. okText: '删除',
  546. cancelText: '取消',
  547. okType: 'danger',
  548. onOk: () => {
  549. axios({
  550. url: 'api/framework/v1/page/' + this.$refs.dataTable.formId,
  551. method: 'delete',
  552. params: { ids: selectedRowKeys.join(',') },
  553. })
  554. .then(() => {
  555. this.$refs.dataTable.clearSelection()
  556. this.$refs.dataTable.refresh()
  557. message.success('删除成功')
  558. this.$emit('recordsDeleted', selectedRowKeys)
  559. })
  560. .catch((err) => {
  561. const msg = errorUtil.getMessage(err) || '删除失败'
  562. message.error(msg)
  563. })
  564. .finally(resolve)
  565. },
  566. onCancel: () => {
  567. resolve()
  568. },
  569. })
  570. })
  571. },
  572. linkFindingtitle(record) {
  573. // debugger
  574. window.open('#/sd-webflow/done-pages/' + record.instId)
  575. },
  576. AdvSearchClick() {
  577. this.expand = !this.expand
  578. },
  579. },
  580. }
  581. </script>
  582. <style module lang="scss">
  583. @use '@/common/design' as *;
  584. .advancedQuery {
  585. :global(.ant-col .ant-form-item-label) {
  586. width: 20% !important;
  587. }
  588. :global(.ant-col .ant-form-item-control-wrapper) {
  589. width: 80% !important;
  590. }
  591. }
  592. </style>