xm-composite-database-list.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969
  1. <template>
  2. <div :class="$style.wrapHeight">
  3. <a-card :bordered="false">
  4. <a-tabs v-model="activeKey" type="line" @change="toggleTabs">
  5. <a-tab-pane key="1" tab="资料上报">
  6. <!-- 高级搜索组件 -->
  7. <audit-advanced-query
  8. :class="$style.advancedQuery"
  9. :expand="isShowAdvSearch"
  10. :search-data="SJXMAdvSearchForm"
  11. :ref-name="searchform"
  12. :search-style="{ height: '210px', left: '10px', top: '60px' }"
  13. :search-fun="advSJXMSearch"
  14. @searchedClick="searchedClick"
  15. >
  16. <template>
  17. <a-row>
  18. <a-col :span="12">
  19. <a-form-model-item :label="'年\u2002\u2002度'" prop="reportYear">
  20. <a-input v-model="SJXMAdvSearchForm.reportYear" allow-clear />
  21. </a-form-model-item>
  22. </a-col>
  23. <a-col :span="12">
  24. <a-form-model-item :label="'标\u2002\u2002题'" prop="title">
  25. <a-input v-model="SJXMAdvSearchForm.title" allow-clear />
  26. </a-form-model-item>
  27. </a-col>
  28. </a-row>
  29. <a-row>
  30. <a-col :span="12">
  31. <a-form-model-item :label="'当前状态'" prop="flowState">
  32. <sd-select
  33. v-model="SJXMAdvSearchForm.flowState"
  34. :allow-clear="true"
  35. :options="flowStateOptions"
  36. />
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :span="12">
  40. <a-form-model-item :label="'上报单位'" prop="reportUnitName">
  41. <a-input v-model="SJXMAdvSearchForm.reportUnitName" allow-clear />
  42. </a-form-model-item>
  43. </a-col>
  44. </a-row>
  45. <a-row>
  46. <a-col :span="12">
  47. <a-form-model-item :label="'是否逾期未报'" prop="isLate">
  48. <sd-select
  49. v-model="SJXMAdvSearchForm.isLate"
  50. :allow-clear="true"
  51. :options="isLateOptions"
  52. />
  53. </a-form-model-item>
  54. </a-col>
  55. <a-col :span="12">
  56. <a-form-model-item :label="'资料类别'" prop="fromId">
  57. <a-select v-model="SJXMAdvSearchForm.docTypes">
  58. <a-select-option :value="''">&nbsp;</a-select-option>
  59. <a-select-option :value="-1"> 审计机构负责人备案 </a-select-option>
  60. <a-select-option :value="-2"> 审计机构考核结果备案 </a-select-option>
  61. <a-select-option :value="-3"> 其它 </a-select-option>
  62. <a-select-option :value="-4"> 综合资料下发 </a-select-option>
  63. </a-select>
  64. </a-form-model-item>
  65. </a-col>
  66. </a-row>
  67. </template>
  68. </audit-advanced-query>
  69. <sd-data-table-ex
  70. ref="SJXMDataTable"
  71. style="margin-top: 25px"
  72. :filter-expressions="SJXMTableExpressions"
  73. :columns="columns1"
  74. show-selection
  75. form-id="spicCompositeDatabase"
  76. :data-url="dataurl1"
  77. :actions="actions1"
  78. :page-id="pageId1"
  79. @selectedRowsChanged="selectedRowsChanged"
  80. >
  81. <div slot="islink" slot-scope="text, record">
  82. <a :title="text" @click="rowClick1(record)">{{ text }}</a>
  83. </div>
  84. </sd-data-table-ex>
  85. </a-tab-pane>
  86. <a-tab-pane key="2" tab="综合资料下发">
  87. <!-- 高级搜索区域 -->
  88. <audit-advanced-query
  89. :class="$style.advancedQuery"
  90. :expand="isShowAdvSearch"
  91. :search-data="SJJHAdvSearchForm"
  92. :ref-name="searchform"
  93. :search-style="{ height: '170px', left: '10px', top: '60px' }"
  94. :search-fun="advJHBGSearch"
  95. @searchedClick="searchedClick"
  96. >
  97. <template>
  98. <a-row>
  99. <a-col :span="12">
  100. <a-form-model-item :label="'年度'" prop="reportYear">
  101. <a-input v-model="SJJHAdvSearchForm.reportYear" allow-clear />
  102. </a-form-model-item>
  103. </a-col>
  104. <a-col :span="12">
  105. <a-form-model-item :label="'标题'" prop="title">
  106. <a-input v-model="SJJHAdvSearchForm.title" allow-clear />
  107. </a-form-model-item>
  108. </a-col>
  109. </a-row>
  110. <a-row>
  111. <a-col :span="12">
  112. <a-form-model-item :label="'当前状态'" prop="docStatus">
  113. <sd-select
  114. v-model="SJJHAdvSearchForm.docStatus"
  115. :allow-clear="true"
  116. :options="flowStateOptions1"
  117. />
  118. </a-form-model-item>
  119. </a-col>
  120. <a-col :span="12">
  121. <a-form-model-item :label="'编制人员'" prop="creatorName">
  122. <a-input v-model="SJJHAdvSearchForm.creatorName" />
  123. </a-form-model-item>
  124. </a-col>
  125. </a-row>
  126. </template>
  127. </audit-advanced-query>
  128. <sd-data-table-ex
  129. ref="JHBGDataTable"
  130. style="margin-top: 25px"
  131. :filter-expressions="JHBGTableExpressions"
  132. :columns="columns2"
  133. show-selection
  134. form-id="spicCompositeDatabasePublish"
  135. :data-url="dataurl2"
  136. :actions="actions2"
  137. :page-id="pageId2"
  138. @selectedRowsChanged="selectedRowsChanged"
  139. >
  140. <div slot="islink" slot-scope="text, record">
  141. <a :title="text" @click="rowClick2(record)">{{ text }}</a>
  142. </div>
  143. </sd-data-table-ex>
  144. </a-tab-pane>
  145. </a-tabs>
  146. <div :class="[$style.btns]">
  147. <a-input-search
  148. v-model="searchValue"
  149. style="width: 155px; vertical-align: bottom"
  150. placeholder="请输入搜索条件"
  151. allow-clear
  152. @search="onSearch"
  153. />
  154. <a-button title="高级搜索" :class="$style.advSearchBtn" @click="AdvSearchClick">
  155. <a-icon type="sd-audit-advancesearch" theme="filled" :class="$style.searchIcon" />
  156. </a-button>
  157. <a-button
  158. v-if="(activeKey === '2' && isApplicationAdmin) || activeKey === '1'"
  159. type="primary"
  160. :class="[$style.buttonSpacing]"
  161. @click="createProject"
  162. >新建
  163. </a-button>
  164. <a-button
  165. v-if="activeKey === '1' && true"
  166. :class="[$style.buttonSpacing]"
  167. :loading="exportLoading"
  168. @click="fnexport"
  169. >批量导出附件
  170. </a-button>
  171. <a-button
  172. v-if="activeKey === '2' && isApplicationAdmin"
  173. :class="[$style.buttonSpacing]"
  174. :disabled="deleteButtonDisable"
  175. @click="linkToDelete"
  176. >删除
  177. </a-button>
  178. </div>
  179. </a-card>
  180. </div>
  181. </template>
  182. <script>
  183. import moment from 'moment'
  184. import auditAdvancedQueryMixins from '@product/iam/components/audit-advanced-query-mixins'
  185. import auditAdvancedQuery from '@product/iam/components/audit-advanced-query.vue'
  186. import CompositeDatabaseService from './composite-database-service'
  187. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  188. import { message, Modal } from 'ant-design-vue'
  189. import axios from '@/common/services/axios-instance'
  190. import TableColumnTypes from '@/common/services/table-column-types'
  191. import storeMixin, { getUserInfo } from '@/common/store-mixin'
  192. import errorUtil from '@/common/services/error-util'
  193. import components from './_import-components/xm-composite-database-list-import'
  194. export default {
  195. name: 'XmCompositeDatabaseList',
  196. metaInfo: {
  197. title: '资料上报',
  198. },
  199. components: { ...components, auditAdvancedQuery },
  200. mixins: [storeMixin, auditAdvancedQueryMixins],
  201. data() {
  202. return {
  203. // radioValue: 1,
  204. exportLoading: false,
  205. activeKey: '1',
  206. searchValue: '',
  207. deleteButtonDisable: true,
  208. searchform: 'searchform',
  209. isShowAdvSearch: false,
  210. showYearPicker: false,
  211. year: null,
  212. endOpen: false,
  213. SJXMAdvSearchForm: {
  214. reportYear: '',
  215. title: '',
  216. flowState: '',
  217. reportUnitName: '',
  218. isLate: '',
  219. docTypes: '',
  220. },
  221. SJJHAdvSearchForm: {
  222. reportYear: '',
  223. docStatus: '',
  224. creatorName: '',
  225. },
  226. SJXMTableExpressions: [],
  227. JHBGTableExpressions: [],
  228. pageId1: 'audit/spiccompositedatabase/spicCompositeDatabase',
  229. pageId2: 'audit/spiccompositedatabase/spicCompositeDatabasePublish',
  230. dataurl2: 'api/xcoa-mobile/v1/spiccompositedatabasepublish/al-list',
  231. dataurl1: 'api/xcoa-mobile/v1/spiccompositedatabase/al-list',
  232. columns1: [
  233. {
  234. title: '序号',
  235. dataIndex: 'sortNumber',
  236. width: '40px',
  237. customRender: (text, record, index) => `${index + 1}`,
  238. },
  239. {
  240. title: '年度',
  241. dataIndex: 'reportYear',
  242. width: '80px',
  243. },
  244. {
  245. title: '标题',
  246. width: '15%',
  247. dataIndex: 'title',
  248. scopedSlots: { customRender: 'islink' },
  249. },
  250. {
  251. title: '上报单位',
  252. dataIndex: 'reportUnitName',
  253. width: '200px',
  254. },
  255. {
  256. title: '编制人员',
  257. dataIndex: 'creatorName',
  258. width: '100px',
  259. },
  260. {
  261. title: '编制日期',
  262. dataIndex: 'creationTime',
  263. sorter: true,
  264. sdRender: TableColumnTypes.date,
  265. width: '100px',
  266. },
  267. {
  268. title: '当前状态',
  269. dataIndex: 'flowState',
  270. width: '100px',
  271. sorter: true,
  272. },
  273. {
  274. title: '当前处理人',
  275. dataIndex: 'currentUser',
  276. width: '100px',
  277. },
  278. { title: '文档状态', dataIndex: 'endType', width: '120px', sdHidden: true },
  279. {
  280. title: '操作',
  281. dataIndex: 'opt',
  282. aligen: 'center',
  283. customRender: (text, record, index) => {
  284. const adminRole = getUserInfo().roles.find((item) => {
  285. return item.code === 'G-1_COMPOSITE_DATABASE'
  286. })
  287. if (
  288. record.endType === 5 &&
  289. (record.publishAccount === getUserInfo().account || adminRole)
  290. ) {
  291. return (
  292. <span>
  293. <a vOn:click={(evt) => this.overruleReport(record)}>驳回上报</a>
  294. </span>
  295. )
  296. }
  297. },
  298. width: '100px',
  299. },
  300. ],
  301. actions1: [],
  302. columns2: [
  303. {
  304. title: '序号',
  305. dataIndex: 'sortNumber',
  306. width: '40px',
  307. customRender: (text, record, index) => `${index + 1}`,
  308. },
  309. {
  310. title: '年度',
  311. dataIndex: 'reportYear',
  312. width: '80px',
  313. },
  314. {
  315. title: '标题',
  316. width: '30%',
  317. dataIndex: 'title',
  318. scopedSlots: { customRender: 'islink' },
  319. },
  320. {
  321. title: '在线反馈截止时间',
  322. dataIndex: 'endTime',
  323. width: '120px',
  324. sorter: true,
  325. sdRender: TableColumnTypes.date,
  326. },
  327. {
  328. title: '编制人员',
  329. dataIndex: 'creatorName',
  330. width: '120px',
  331. },
  332. {
  333. title: '编制日期',
  334. dataIndex: 'creationTime',
  335. sorter: true,
  336. sdRender: TableColumnTypes.date,
  337. width: '120px',
  338. },
  339. {
  340. title: '当前状态',
  341. dataIndex: 'docStatus',
  342. width: '120px',
  343. sorter: true,
  344. },
  345. ],
  346. actions2: [],
  347. formId: 'spicCompositeDatabase',
  348. tableId: 'SJXMDataTable',
  349. itemStatusOptions: [],
  350. flowStateOptions: [
  351. {
  352. id: '开始',
  353. name: '开始',
  354. },
  355. {
  356. id: '转其他人员上报',
  357. name: '转其他人员上报',
  358. },
  359. {
  360. id: '结束',
  361. name: '结束',
  362. },
  363. ],
  364. isLateOptions: [
  365. {
  366. id: '是',
  367. name: '是',
  368. },
  369. {
  370. id: '否',
  371. name: '否',
  372. },
  373. ],
  374. flowStateOptions1: [
  375. {
  376. id: '起草',
  377. name: '起草中',
  378. },
  379. {
  380. id: '已发布',
  381. name: '已发布',
  382. },
  383. ],
  384. isApplicationAdmin: false, // 是否为综合资料管理员
  385. }
  386. },
  387. mounted() {
  388. // 初始化权限
  389. this.initJurisdiction()
  390. },
  391. methods: {
  392. // 初始化权限
  393. initJurisdiction() {
  394. // 校验权限(检查为综合资料管理员)
  395. CompositeDatabaseService.checkPermission().then((res) => {
  396. this.isApplicationAdmin = res.data.isHasPermission // 删除按钮权限(拥有综合资料管理员)
  397. })
  398. },
  399. // 驳回上报
  400. overruleReport(record) {
  401. axios({
  402. url: 'api/xcoa-mobile/v1/spic-common/overruleReport?id=' + record.id,
  403. method: 'get',
  404. }).then((res) => {
  405. if (res.data) {
  406. Modal.info({
  407. title: '提示',
  408. content: '驳回成功!',
  409. })
  410. // this.refresh()
  411. this.$refs.SJXMDataTable.refresh()
  412. } else {
  413. Modal.warning({
  414. title: '提示',
  415. content: '驳回失败,请联系管理员!',
  416. })
  417. }
  418. })
  419. },
  420. refreshDataTable() {
  421. if (this.activeKey === '1') {
  422. this.tableId = 'SJXMDataTable'
  423. }
  424. if (this.activeKey === '2') {
  425. this.tableId = 'JHBGDataTable'
  426. }
  427. if (this.$refs[`${this.tableId}`]) {
  428. this.$refs[`${this.tableId}`].clearSelection()
  429. this.$refs[`${this.tableId}`].refresh()
  430. }
  431. },
  432. onChange(value) {
  433. if (value) {
  434. this.SJXMAdvSearchForm.reportYear = value.format('YYYY')
  435. } else {
  436. this.SJXMAdvSearchForm.reportYear = ''
  437. }
  438. },
  439. toggleTabs(key) {
  440. this.activeKey = key
  441. if (this.activeKey === '1') {
  442. this.tableId = 'SJXMDataTable'
  443. this.SJXMTableExpressions = []
  444. }
  445. if (this.activeKey === '2') {
  446. this.tableId = 'JHBGDataTable'
  447. this.JHBGTableExpressions = []
  448. }
  449. this.deleteButtonDisable = true
  450. if (this.$refs[`${this.tableId}`]) {
  451. this.$refs[`${this.tableId}`].clearSelection()
  452. }
  453. },
  454. // 新建
  455. createProject() {
  456. let url
  457. if (this.activeKey === '1') {
  458. url = '/sd-flow-guide?code=SPIC_AUDIT_ZHZLK'
  459. } else {
  460. url = '/xm-composite-database-publish-form'
  461. }
  462. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  463. if (refreshFlag) {
  464. // 这里写或者调刷新的方法
  465. this.refreshDataTable()
  466. }
  467. })
  468. },
  469. linkToDelete() {
  470. if (this.activeKey === '1') {
  471. this.tableId = 'SJXMDataTable'
  472. this.formId = 'spicCompositeDatabase'
  473. }
  474. const selectedRowKeys = this.$refs[`${this.tableId}`].getSelectedRowKeys()
  475. if (selectedRowKeys.length === 0) {
  476. Modal.info({
  477. content: '请选择需要删除的数据!',
  478. })
  479. }
  480. if (this.activeKey === '1') {
  481. // if (this.checkStateDelete('开始', '只能删除开始环节的数据!', '1')) {
  482. this.deleteMethod1(selectedRowKeys)
  483. // }
  484. }
  485. if (this.activeKey === '2') {
  486. if (this.checkStateDelete('起草中', '只能删除起草中状态的数据!', '2')) {
  487. this.deleteMethod(selectedRowKeys)
  488. }
  489. }
  490. },
  491. clearSelection() {
  492. this.$refs.SJXMDataTable.clearSelection()
  493. },
  494. // 刷新列表
  495. refresh() {
  496. this.$emit('refreshTable')
  497. },
  498. // 删除记录
  499. deleteMethod1(selectedRowKeys) {
  500. debugger
  501. if (selectedRowKeys.length === 0) {
  502. Modal.info({
  503. content: '请选择需要删除的文件',
  504. })
  505. return
  506. }
  507. const selectedRows = this.$refs.SJXMDataTable.getSelectedRows()
  508. const currentAccount = getUserInfo().account
  509. const instIds = []
  510. let flag = false
  511. selectedRows.forEach((item) => {
  512. if (item.endType !== 0) {
  513. flag = true
  514. }
  515. })
  516. if (flag) {
  517. Modal.error({
  518. title: '删除失败:存在不是草稿状态的数据',
  519. })
  520. return
  521. }
  522. var flages = true
  523. selectedRows.forEach((item) => {
  524. var instId = item.instId - 0
  525. if (item.creatorAccount !== currentAccount) {
  526. Modal.info({
  527. content: '请选择自己创建的文件',
  528. })
  529. flages = false
  530. } else {
  531. instIds.push(instId)
  532. }
  533. })
  534. if (!flages) {
  535. return
  536. }
  537. return new Promise((resolve) => {
  538. Modal.confirm({
  539. title: '您确定删除这项内容吗?',
  540. content: '删除这条数据后,就无法恢复初始的状态。',
  541. okText: '删除',
  542. okType: 'danger',
  543. onOk: () => {
  544. axios({
  545. url: 'api/flow-mobile/v1/process-manager/process-instance/remove',
  546. method: 'POST',
  547. data: {
  548. flowCallbackBeanName: 'formBeanCleanerCallBack',
  549. processInstanceIds: instIds.join(','),
  550. },
  551. })
  552. .then(() => {
  553. this.clearSelection()
  554. // this.refresh()
  555. this.$refs.SJXMDataTable.refresh()
  556. message.success('删除成功')
  557. /**
  558. * 数据删除成功后触发
  559. * @property {Array} rowKeys 已删除的记录ids
  560. */
  561. this.$emit('recordsDeleted', selectedRowKeys)
  562. })
  563. .catch((err) => {
  564. const msg = errorUtil.getMessage(err) || '删除失败'
  565. message.error(msg)
  566. })
  567. .finally(resolve)
  568. },
  569. onCancel: () => {
  570. resolve()
  571. },
  572. })
  573. })
  574. },
  575. deleteMethod(selectedRowKeys) {
  576. debugger
  577. const selectedRows = this.$refs.JHBGDataTable.getSelectedRows()
  578. const currentAccount = getUserInfo().account
  579. const instIds = []
  580. var flages = true
  581. selectedRows.forEach((item) => {
  582. console.log(item)
  583. var instId = item.instId - 0
  584. if (item.creatorAccount !== currentAccount) {
  585. Modal.info({
  586. content: '请选择自己创建的文件',
  587. })
  588. flages = false
  589. } else {
  590. instIds.push(instId)
  591. }
  592. })
  593. if (!flages) {
  594. return
  595. }
  596. return new Promise((resolve) => {
  597. Modal.confirm({
  598. title: '您确定删除这项内容吗?',
  599. content: '删除这条数据后,就无法恢复初始的状态。',
  600. cancelText: '取消',
  601. okText: '删除',
  602. okType: 'danger',
  603. onOk: () => {
  604. axios({
  605. url: 'api/framework/v1/page/' + this.$refs.JHBGDataTable.formId,
  606. method: 'delete',
  607. params: { ids: selectedRowKeys.join(',') },
  608. })
  609. .then(() => {
  610. this.$refs.JHBGDataTable.clearSelection()
  611. this.$refs.JHBGDataTable.refresh()
  612. message.success('删除成功')
  613. this.$emit('recordsDeleted', selectedRowKeys)
  614. })
  615. .catch((err) => {
  616. const msg = errorUtil.getMessage(err) || '删除失败'
  617. message.error(msg)
  618. })
  619. .finally(resolve)
  620. },
  621. onCancel: () => {
  622. resolve()
  623. },
  624. })
  625. })
  626. },
  627. // 删除是否为起草状态校验
  628. checkStateDelete(flowState, message, type) {
  629. let temp = false
  630. const selectedRows = this.$refs[`${this.tableId}`].getSelectedRows()
  631. if (type === '2') {
  632. selectedRows.some((item) => {
  633. if (item.docStatus !== '起草中') {
  634. // if (!flowState.includes(item.flowState)) {
  635. temp = true
  636. return true
  637. }
  638. })
  639. }
  640. if (type === '1') {
  641. selectedRows.some((item) => {
  642. if (item.flowState !== '开始') {
  643. // if (!flowState.includes(item.flowState)) {
  644. temp = true
  645. return true
  646. }
  647. })
  648. }
  649. if (temp) {
  650. Modal.warning({
  651. title: '提示',
  652. content: message,
  653. })
  654. return false
  655. }
  656. return true
  657. },
  658. AdvSearchClick() {
  659. this.isShowAdvSearch = !this.isShowAdvSearch
  660. },
  661. searchedClick() {
  662. this.isShowAdvSearch = !this.isShowAdvSearch
  663. },
  664. onSearch(value) {
  665. if (this.activeKey === '1') {
  666. this.SJXMTableExpressions = []
  667. if (value) {
  668. const expressions = []
  669. // 标题
  670. expressions.push({
  671. dataType: 'str',
  672. name: 'title',
  673. op: 'like',
  674. stringValue: `%${value}%`,
  675. })
  676. this.SJXMTableExpressions.push({
  677. dataType: 'exps',
  678. op: 'or',
  679. expressionsValue: expressions,
  680. })
  681. }
  682. }
  683. if (this.activeKey === '2') {
  684. this.JHBGTableExpressions = []
  685. if (value) {
  686. const expressions = []
  687. // 标题
  688. expressions.push({
  689. dataType: 'str',
  690. name: 'title',
  691. op: 'like',
  692. stringValue: `%${value}%`,
  693. })
  694. this.JHBGTableExpressions.push({
  695. dataType: 'exps',
  696. op: 'or',
  697. expressionsValue: expressions,
  698. })
  699. }
  700. }
  701. this.$refs[`${this.tableId}`].clearSelection()
  702. },
  703. // 上报
  704. advSJXMSearch() {
  705. debugger
  706. this.SJXMTableExpressions = []
  707. // 年度
  708. if (this.SJXMAdvSearchForm.reportYear) {
  709. // const reportyear = this.SJXMAdvSearchForm.reportYear.year() + ''
  710. // console.log('上报年度高级查询----', reportyear)
  711. this.SJXMTableExpressions.push({
  712. dataType: 'str',
  713. name: 'reportYear',
  714. op: 'like',
  715. stringValue: `%${this.SJXMAdvSearchForm.reportYear}%`,
  716. // stringValue: `%${reportyear}%`,
  717. })
  718. }
  719. if (this.SJXMAdvSearchForm.flowState[0]) {
  720. this.SJXMTableExpressions.push({
  721. dataType: 'str',
  722. name: 'flowState',
  723. op: 'like',
  724. stringValue: `%${this.SJXMAdvSearchForm.flowState[0].id}%`,
  725. })
  726. }
  727. // 报送机构
  728. if (this.SJXMAdvSearchForm.reportUnitName) {
  729. this.SJXMTableExpressions.push({
  730. dataType: 'str',
  731. name: 'reportUnitName',
  732. op: 'like',
  733. stringValue: `%${this.SJXMAdvSearchForm.reportUnitName}%`,
  734. })
  735. }
  736. if (this.SJXMAdvSearchForm.title) {
  737. this.SJXMTableExpressions.push({
  738. dataType: 'str',
  739. name: 'title',
  740. op: 'like',
  741. stringValue: `%${this.SJXMAdvSearchForm.title}%`,
  742. })
  743. }
  744. if (this.SJXMAdvSearchForm.isLate[0]) {
  745. this.SJXMTableExpressions.push({
  746. dataType: 'str',
  747. name: 'isLate',
  748. op: 'like',
  749. stringValue: `${this.SJXMAdvSearchForm.isLate[0].id}`,
  750. })
  751. }
  752. if (this.SJXMAdvSearchForm.docTypes) {
  753. this.SJXMTableExpressions.push({
  754. dataType: 'int',
  755. name: 'docTypes',
  756. op: 'eq',
  757. intValue: `${this.SJXMAdvSearchForm.docTypes}`,
  758. })
  759. }
  760. this.$refs[`${this.tableId}`].clearSelection()
  761. },
  762. // 下发
  763. advJHBGSearch() {
  764. // debugger
  765. this.JHBGTableExpressions = []
  766. // 年度
  767. if (this.SJJHAdvSearchForm.reportYear) {
  768. // const reportyear = this.SJJHAdvSearchForm.reportYear.year() + ''
  769. // console.log('下发年度高级查询----', reportyear)
  770. this.JHBGTableExpressions.push({
  771. dataType: 'str',
  772. name: 'reportYear',
  773. op: 'like',
  774. stringValue: `%${this.SJJHAdvSearchForm.reportYear}%`,
  775. // stringValue: `%${reportyear}%`,
  776. })
  777. }
  778. if (this.SJJHAdvSearchForm.docStatus[0]) {
  779. this.JHBGTableExpressions.push({
  780. dataType: 'str',
  781. name: 'docStatus',
  782. op: 'like',
  783. stringValue: `%${this.SJJHAdvSearchForm.docStatus[0].name}%`,
  784. })
  785. }
  786. if (this.SJJHAdvSearchForm.creatorName) {
  787. this.JHBGTableExpressions.push({
  788. dataType: 'str',
  789. name: 'creatorName',
  790. op: 'like',
  791. stringValue: `%${this.SJJHAdvSearchForm.creatorName}%`,
  792. })
  793. }
  794. if (this.SJJHAdvSearchForm.title) {
  795. this.JHBGTableExpressions.push({
  796. dataType: 'str',
  797. name: 'title',
  798. op: 'like',
  799. stringValue: `%${this.SJJHAdvSearchForm.title}%`,
  800. })
  801. }
  802. this.$refs[`${this.tableId}`].clearSelection()
  803. },
  804. rowClick1(record) {
  805. // debugger
  806. let openurl = ''
  807. if (this.activeKey === '1') {
  808. if (
  809. (record.flowState === '起草') |
  810. (record.flowState === '开始') |
  811. (record.flowState === null)
  812. ) {
  813. if (
  814. (record.flowState === '起草' || record.flowState === '开始') &&
  815. record.creatorAccount === getUserInfo().account
  816. ) {
  817. openurl = '/sd-webflow/pages/draft/' + record.instId
  818. } else {
  819. openurl = '/sd-webflow/done-pages/' + record.instId
  820. }
  821. } else {
  822. openurl = '/sd-webflow/done-pages/' + record.instId
  823. }
  824. }
  825. crossWindowWatcher.waitForChanged(openurl).then((refreshFlag) => {
  826. if (refreshFlag) {
  827. // 这里写或者调刷新的方法
  828. this.refresh()
  829. }
  830. })
  831. },
  832. rowClick2(record) {
  833. if (this.activeKey === '2') {
  834. var url = '/xm-composite-database-publish-form?record=' + record.id
  835. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  836. if (refreshFlag) {
  837. // 这里写或者调刷新的方法
  838. this.refreshDataTable()
  839. }
  840. })
  841. }
  842. },
  843. selectedRowsChanged(row) {
  844. if (row.length > 0) {
  845. this.deleteButtonDisable = false
  846. } else {
  847. this.deleteButtonDisable = true
  848. }
  849. },
  850. // 导出
  851. fnexport() {
  852. console.log('导出点击-----')
  853. const selectedRowKeys = this.$refs.SJXMDataTable.getSelectedRowKeys()
  854. if (selectedRowKeys.length === 0) {
  855. Modal.warning({
  856. title: '提示',
  857. content: '请选择要一键导出附件的报告(最多可选择10条)',
  858. })
  859. } else {
  860. const timestamp = new Date().getTime()
  861. console.log(timestamp)
  862. axios({
  863. method: 'get',
  864. url: 'api/xcoa-mobile/v1/spic-common/exportCompositeDatabaseFiles/' + selectedRowKeys,
  865. responseType: 'blob',
  866. }).then((res) => {
  867. if (res.data) {
  868. let blob = null
  869. let fileName = res.headers['content-disposition']?.split('fileName=')[1]
  870. if (fileName === null || fileName === undefined) {
  871. fileName = '.zip'
  872. }
  873. blob = new Blob([res.data], { type: 'application/zip' })
  874. const time = moment(moment()).format('yyyyMMDD')
  875. fileName = '综合资料-' + time + '.zip'
  876. if ('msSaveOrOpenBlob' in navigator) {
  877. // 适配ie
  878. window.navigator.msSaveOrOpenBlob(blob, fileName)
  879. } else {
  880. // 其他浏览器
  881. const blobUrl = window.URL.createObjectURL(blob)
  882. const a = document.createElement('a')
  883. a.style.display = 'none'
  884. a.href = blobUrl
  885. a.setAttribute('download', fileName)
  886. a.click()
  887. }
  888. message.success('导出成功')
  889. } else {
  890. message.error('导出失败,请联系系统管理员')
  891. }
  892. })
  893. }
  894. },
  895. },
  896. }
  897. </script>
  898. <style module lang="scss">
  899. @use '@/common/design' as *;
  900. .wrap-height {
  901. :global(.ant-col-offset-10) {
  902. margin-left: 0;
  903. }
  904. }
  905. .btns {
  906. position: absolute;
  907. top: 15px;
  908. right: 15px;
  909. z-index: 100;
  910. }
  911. .buttonSpacing {
  912. margin-left: 5px;
  913. }
  914. .advancedQuery {
  915. :global(.ant-col .ant-form-item-label) {
  916. width: 30% !important;
  917. }
  918. :global(.ant-col .ant-form-item-control-wrapper) {
  919. width: 60% !important;
  920. }
  921. }
  922. .advSearchBtn {
  923. width: 35px;
  924. padding: 0;
  925. margin-left: -5px;
  926. border-radius: 0 5px 5px 0;
  927. }
  928. .search-icon {
  929. margin-left: 1px !important;
  930. font-size: 12px;
  931. }
  932. .wrap-height {
  933. .success {
  934. color: $alert-success-icon-color;
  935. }
  936. .error {
  937. color: $alert-error-icon-color;
  938. }
  939. :global(.part-time) {
  940. padding-right: 5px !important;
  941. }
  942. }
  943. </style>