xm-composite-database-list.vue 28 KB

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