spic-rectfeedback-list.vue 16 KB

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