xm-composite-database-list.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  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. id: '结束',
  349. name: '结束',
  350. },
  351. ],
  352. isLateOptions: [
  353. {
  354. id: '是',
  355. name: '是',
  356. },
  357. {
  358. id: '否',
  359. name: '否',
  360. },
  361. ],
  362. flowStateOptions1: [
  363. {
  364. id: '起草',
  365. name: '起草中',
  366. },
  367. {
  368. id: '已发布',
  369. name: '已发布',
  370. },
  371. ],
  372. isApplicationAdmin: false, // 是否为综合资料管理员
  373. }
  374. },
  375. mounted() {
  376. // 初始化权限
  377. this.initJurisdiction()
  378. },
  379. methods: {
  380. // 初始化权限
  381. initJurisdiction() {
  382. // 校验权限(检查为综合资料管理员)
  383. CompositeDatabaseService.checkPermission().then((res) => {
  384. this.isApplicationAdmin = res.data.isHasPermission // 删除按钮权限(拥有综合资料管理员)
  385. })
  386. },
  387. // 驳回上报
  388. overruleReport(record) {
  389. axios({
  390. url: 'api/xcoa-mobile/v1/spic-common/overruleReport?id=' + record.id,
  391. method: 'get',
  392. }).then((res) => {
  393. if (res.data) {
  394. Modal.info({
  395. title: '提示',
  396. content: '驳回成功!',
  397. })
  398. // this.refresh()
  399. this.$refs.SJXMDataTable.refresh()
  400. } else {
  401. Modal.warning({
  402. title: '提示',
  403. content: '驳回失败,请联系管理员!',
  404. })
  405. }
  406. })
  407. },
  408. refreshDataTable() {
  409. if (this.activeKey === '1') {
  410. this.tableId = 'SJXMDataTable'
  411. }
  412. if (this.activeKey === '2') {
  413. this.tableId = 'JHBGDataTable'
  414. }
  415. if (this.$refs[`${this.tableId}`]) {
  416. this.$refs[`${this.tableId}`].clearSelection()
  417. this.$refs[`${this.tableId}`].refresh()
  418. }
  419. },
  420. onChange(value) {
  421. if (value) {
  422. this.SJXMAdvSearchForm.reportYear = value.format('YYYY')
  423. } else {
  424. this.SJXMAdvSearchForm.reportYear = ''
  425. }
  426. },
  427. toggleTabs(key) {
  428. this.activeKey = key
  429. if (this.activeKey === '1') {
  430. this.tableId = 'SJXMDataTable'
  431. this.SJXMTableExpressions = []
  432. }
  433. if (this.activeKey === '2') {
  434. this.tableId = 'JHBGDataTable'
  435. this.JHBGTableExpressions = []
  436. }
  437. this.deleteButtonDisable = true
  438. if (this.$refs[`${this.tableId}`]) {
  439. this.$refs[`${this.tableId}`].clearSelection()
  440. }
  441. },
  442. // 新建
  443. createProject() {
  444. let url
  445. if (this.activeKey === '1') {
  446. url = '/sd-flow-guide?code=SPIC_AUDIT_ZHZLK'
  447. } else {
  448. url = '/xm-composite-database-publish-form'
  449. }
  450. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  451. if (refreshFlag) {
  452. // 这里写或者调刷新的方法
  453. this.refreshDataTable()
  454. }
  455. })
  456. },
  457. linkToDelete() {
  458. if (this.activeKey === '1') {
  459. this.tableId = 'SJXMDataTable'
  460. this.formId = 'spicCompositeDatabase'
  461. }
  462. const selectedRowKeys = this.$refs[`${this.tableId}`].getSelectedRowKeys()
  463. if (selectedRowKeys.length === 0) {
  464. Modal.info({
  465. content: '请选择需要删除的数据!',
  466. })
  467. }
  468. if (this.activeKey === '1') {
  469. // if (this.checkStateDelete('开始', '只能删除开始环节的数据!', '1')) {
  470. this.deleteMethod1(selectedRowKeys)
  471. // }
  472. }
  473. if (this.activeKey === '2') {
  474. if (this.checkStateDelete('起草中', '只能删除起草中状态的数据!', '2')) {
  475. this.deleteMethod(selectedRowKeys)
  476. }
  477. }
  478. },
  479. clearSelection() {
  480. this.$refs.SJXMDataTable.clearSelection()
  481. },
  482. // 刷新列表
  483. refresh() {
  484. this.$emit('refreshTable')
  485. },
  486. // 删除记录
  487. deleteMethod1(selectedRowKeys) {
  488. debugger
  489. if (selectedRowKeys.length === 0) {
  490. Modal.info({
  491. content: '请选择需要删除的文件',
  492. })
  493. return
  494. }
  495. const selectedRows = this.$refs.SJXMDataTable.getSelectedRows()
  496. const currentAccount = getUserInfo().account
  497. const instIds = []
  498. let flag = false
  499. selectedRows.forEach((item) => {
  500. if (item.endType !== 0) {
  501. flag = true
  502. }
  503. })
  504. if (flag) {
  505. Modal.error({
  506. title: '删除失败:存在不是草稿状态的数据',
  507. })
  508. return
  509. }
  510. var flages = true
  511. selectedRows.forEach((item) => {
  512. var instId = item.instId - 0
  513. if (item.creatorAccount !== currentAccount) {
  514. Modal.info({
  515. content: '请选择自己创建的文件',
  516. })
  517. flages = false
  518. } else {
  519. instIds.push(instId)
  520. }
  521. })
  522. if (!flages) {
  523. return
  524. }
  525. return new Promise((resolve) => {
  526. Modal.confirm({
  527. title: '您确定删除这项内容吗?',
  528. content: '删除这条数据后,就无法恢复初始的状态。',
  529. okText: '删除',
  530. okType: 'danger',
  531. onOk: () => {
  532. axios({
  533. url: 'api/flow-mobile/v1/process-manager/process-instance/remove',
  534. method: 'POST',
  535. data: {
  536. flowCallbackBeanName: 'formBeanCleanerCallBack',
  537. processInstanceIds: instIds.join(','),
  538. },
  539. })
  540. .then(() => {
  541. this.clearSelection()
  542. // this.refresh()
  543. this.$refs.SJXMDataTable.refresh()
  544. message.success('删除成功')
  545. /**
  546. * 数据删除成功后触发
  547. * @property {Array} rowKeys 已删除的记录ids
  548. */
  549. this.$emit('recordsDeleted', selectedRowKeys)
  550. })
  551. .catch((err) => {
  552. const msg = errorUtil.getMessage(err) || '删除失败'
  553. message.error(msg)
  554. })
  555. .finally(resolve)
  556. },
  557. onCancel: () => {
  558. resolve()
  559. },
  560. })
  561. })
  562. },
  563. deleteMethod(selectedRowKeys) {
  564. debugger
  565. const selectedRows = this.$refs.JHBGDataTable.getSelectedRows()
  566. const currentAccount = getUserInfo().account
  567. const instIds = []
  568. var flages = true
  569. selectedRows.forEach((item) => {
  570. console.log(item)
  571. var instId = item.instId - 0
  572. if (item.creatorAccount !== currentAccount) {
  573. Modal.info({
  574. content: '请选择自己创建的文件',
  575. })
  576. flages = false
  577. } else {
  578. instIds.push(instId)
  579. }
  580. })
  581. if (!flages) {
  582. return
  583. }
  584. return new Promise((resolve) => {
  585. Modal.confirm({
  586. title: '您确定删除这项内容吗?',
  587. content: '删除这条数据后,就无法恢复初始的状态。',
  588. cancelText: '取消',
  589. okText: '删除',
  590. okType: 'danger',
  591. onOk: () => {
  592. axios({
  593. url: 'api/framework/v1/page/' + this.$refs.JHBGDataTable.formId,
  594. method: 'delete',
  595. params: { ids: selectedRowKeys.join(',') },
  596. })
  597. .then(() => {
  598. this.$refs.JHBGDataTable.clearSelection()
  599. this.$refs.JHBGDataTable.refresh()
  600. message.success('删除成功')
  601. this.$emit('recordsDeleted', selectedRowKeys)
  602. })
  603. .catch((err) => {
  604. const msg = errorUtil.getMessage(err) || '删除失败'
  605. message.error(msg)
  606. })
  607. .finally(resolve)
  608. },
  609. onCancel: () => {
  610. resolve()
  611. },
  612. })
  613. })
  614. },
  615. // 删除是否为起草状态校验
  616. checkStateDelete(flowState, message, type) {
  617. let temp = false
  618. const selectedRows = this.$refs[`${this.tableId}`].getSelectedRows()
  619. if (type === '2') {
  620. selectedRows.some((item) => {
  621. if (item.docStatus !== '起草中') {
  622. // if (!flowState.includes(item.flowState)) {
  623. temp = true
  624. return true
  625. }
  626. })
  627. }
  628. if (type === '1') {
  629. selectedRows.some((item) => {
  630. if (item.flowState !== '开始') {
  631. // if (!flowState.includes(item.flowState)) {
  632. temp = true
  633. return true
  634. }
  635. })
  636. }
  637. if (temp) {
  638. Modal.warning({
  639. title: '提示',
  640. content: message,
  641. })
  642. return false
  643. }
  644. return true
  645. },
  646. AdvSearchClick() {
  647. this.isShowAdvSearch = !this.isShowAdvSearch
  648. },
  649. searchedClick() {
  650. this.isShowAdvSearch = !this.isShowAdvSearch
  651. },
  652. onSearch(value) {
  653. if (this.activeKey === '1') {
  654. this.SJXMTableExpressions = []
  655. if (value) {
  656. const expressions = []
  657. // 标题
  658. expressions.push({
  659. dataType: 'str',
  660. name: 'title',
  661. op: 'like',
  662. stringValue: `%${value}%`,
  663. })
  664. this.SJXMTableExpressions.push({
  665. dataType: 'exps',
  666. op: 'or',
  667. expressionsValue: expressions,
  668. })
  669. }
  670. }
  671. if (this.activeKey === '2') {
  672. this.JHBGTableExpressions = []
  673. if (value) {
  674. const expressions = []
  675. // 标题
  676. expressions.push({
  677. dataType: 'str',
  678. name: 'title',
  679. op: 'like',
  680. stringValue: `%${value}%`,
  681. })
  682. this.JHBGTableExpressions.push({
  683. dataType: 'exps',
  684. op: 'or',
  685. expressionsValue: expressions,
  686. })
  687. }
  688. }
  689. this.$refs[`${this.tableId}`].clearSelection()
  690. },
  691. // 上报
  692. advSJXMSearch() {
  693. debugger
  694. this.SJXMTableExpressions = []
  695. // 年度
  696. if (this.SJXMAdvSearchForm.reportYear) {
  697. // const reportyear = this.SJXMAdvSearchForm.reportYear.year() + ''
  698. // console.log('上报年度高级查询----', reportyear)
  699. this.SJXMTableExpressions.push({
  700. dataType: 'str',
  701. name: 'reportYear',
  702. op: 'like',
  703. stringValue: `%${this.SJXMAdvSearchForm.reportYear}%`,
  704. // stringValue: `%${reportyear}%`,
  705. })
  706. }
  707. if (this.SJXMAdvSearchForm.flowState[0]) {
  708. this.SJXMTableExpressions.push({
  709. dataType: 'str',
  710. name: 'flowState',
  711. op: 'like',
  712. stringValue: `%${this.SJXMAdvSearchForm.flowState[0].id}%`,
  713. })
  714. }
  715. // 报送机构
  716. if (this.SJXMAdvSearchForm.reportUnitName) {
  717. this.SJXMTableExpressions.push({
  718. dataType: 'str',
  719. name: 'reportUnitName',
  720. op: 'like',
  721. stringValue: `%${this.SJXMAdvSearchForm.reportUnitName}%`,
  722. })
  723. }
  724. if (this.SJXMAdvSearchForm.title) {
  725. this.SJXMTableExpressions.push({
  726. dataType: 'str',
  727. name: 'title',
  728. op: 'like',
  729. stringValue: `%${this.SJXMAdvSearchForm.title}%`,
  730. })
  731. }
  732. if (this.SJXMAdvSearchForm.isLate[0]) {
  733. this.SJXMTableExpressions.push({
  734. dataType: 'str',
  735. name: 'isLate',
  736. op: 'like',
  737. stringValue: `${this.SJXMAdvSearchForm.isLate[0].id}`,
  738. })
  739. }
  740. this.$refs[`${this.tableId}`].clearSelection()
  741. },
  742. // 下发
  743. advJHBGSearch() {
  744. // debugger
  745. this.JHBGTableExpressions = []
  746. // 年度
  747. if (this.SJJHAdvSearchForm.reportYear) {
  748. // const reportyear = this.SJJHAdvSearchForm.reportYear.year() + ''
  749. // console.log('下发年度高级查询----', reportyear)
  750. this.JHBGTableExpressions.push({
  751. dataType: 'str',
  752. name: 'reportYear',
  753. op: 'like',
  754. stringValue: `%${this.SJJHAdvSearchForm.reportYear}%`,
  755. // stringValue: `%${reportyear}%`,
  756. })
  757. }
  758. if (this.SJJHAdvSearchForm.docStatus[0]) {
  759. this.JHBGTableExpressions.push({
  760. dataType: 'str',
  761. name: 'docStatus',
  762. op: 'like',
  763. stringValue: `%${this.SJJHAdvSearchForm.docStatus[0].name}%`,
  764. })
  765. }
  766. if (this.SJJHAdvSearchForm.creatorName) {
  767. this.JHBGTableExpressions.push({
  768. dataType: 'str',
  769. name: 'creatorName',
  770. op: 'like',
  771. stringValue: `%${this.SJJHAdvSearchForm.creatorName}%`,
  772. })
  773. }
  774. if (this.SJJHAdvSearchForm.title) {
  775. this.JHBGTableExpressions.push({
  776. dataType: 'str',
  777. name: 'title',
  778. op: 'like',
  779. stringValue: `%${this.SJJHAdvSearchForm.title}%`,
  780. })
  781. }
  782. this.$refs[`${this.tableId}`].clearSelection()
  783. },
  784. rowClick1(record) {
  785. // debugger
  786. let openurl = ''
  787. if (this.activeKey === '1') {
  788. if (
  789. (record.flowState === '起草') |
  790. (record.flowState === '开始') |
  791. (record.flowState === null)
  792. ) {
  793. if (
  794. (record.flowState === '起草' || record.flowState === '开始') &&
  795. record.creatorAccount === getUserInfo().account
  796. ) {
  797. openurl = '/sd-webflow/pages/draft/' + record.instId
  798. } else {
  799. openurl = '/sd-webflow/done-pages/' + record.instId
  800. }
  801. } else {
  802. openurl = '/sd-webflow/done-pages/' + record.instId
  803. }
  804. }
  805. crossWindowWatcher.waitForChanged(openurl).then((refreshFlag) => {
  806. if (refreshFlag) {
  807. // 这里写或者调刷新的方法
  808. this.refresh()
  809. }
  810. })
  811. },
  812. rowClick2(record) {
  813. if (this.activeKey === '2') {
  814. var url = '/xm-composite-database-publish-form?record=' + record.id
  815. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  816. if (refreshFlag) {
  817. // 这里写或者调刷新的方法
  818. this.refreshDataTable()
  819. }
  820. })
  821. }
  822. },
  823. selectedRowsChanged(row) {
  824. if (row.length > 0) {
  825. this.deleteButtonDisable = false
  826. } else {
  827. this.deleteButtonDisable = true
  828. }
  829. },
  830. // 导出
  831. fnexport() {
  832. console.log('导出点击-----')
  833. const selectedRowKeys = this.$refs.SJXMDataTable.getSelectedRowKeys()
  834. if (selectedRowKeys.length === 0) {
  835. Modal.warning({
  836. title: '提示',
  837. content: '请选择要一键导出附件的报告(最多可选择10条)',
  838. })
  839. } else {
  840. const timestamp = new Date().getTime()
  841. console.log(timestamp)
  842. axios({
  843. method: 'get',
  844. url: 'api/xcoa-mobile/v1/spic-common/exportCompositeDatabaseFiles/' + selectedRowKeys,
  845. responseType: 'blob',
  846. }).then((res) => {
  847. if (res.data) {
  848. let blob = null
  849. let fileName = res.headers['content-disposition']?.split('fileName=')[1]
  850. if (fileName === null || fileName === undefined) {
  851. fileName = '.zip'
  852. }
  853. blob = new Blob([res.data], { type: 'application/zip' })
  854. const time = moment(moment()).format('yyyyMMDD')
  855. fileName = '综合资料-' + time + '.zip'
  856. if ('msSaveOrOpenBlob' in navigator) {
  857. // 适配ie
  858. window.navigator.msSaveOrOpenBlob(blob, fileName)
  859. } else {
  860. // 其他浏览器
  861. const blobUrl = window.URL.createObjectURL(blob)
  862. const a = document.createElement('a')
  863. a.style.display = 'none'
  864. a.href = blobUrl
  865. a.setAttribute('download', fileName)
  866. a.click()
  867. }
  868. message.success('导出成功')
  869. } else {
  870. message.error('导出失败,请联系系统管理员')
  871. }
  872. })
  873. }
  874. },
  875. },
  876. }
  877. </script>
  878. <style module lang="scss">
  879. @use '@/common/design' as *;
  880. .wrap-height {
  881. :global(.ant-col-offset-10) {
  882. margin-left: 0;
  883. }
  884. }
  885. .btns {
  886. position: absolute;
  887. top: 15px;
  888. right: 15px;
  889. z-index: 100;
  890. }
  891. .buttonSpacing {
  892. margin-left: 5px;
  893. }
  894. .advancedQuery {
  895. :global(.ant-col .ant-form-item-label) {
  896. width: 30% !important;
  897. }
  898. :global(.ant-col .ant-form-item-control-wrapper) {
  899. width: 60% !important;
  900. }
  901. }
  902. .advSearchBtn {
  903. width: 35px;
  904. padding: 0;
  905. margin-left: -5px;
  906. border-radius: 0 5px 5px 0;
  907. }
  908. .search-icon {
  909. margin-left: 1px !important;
  910. font-size: 12px;
  911. }
  912. .wrap-height {
  913. .success {
  914. color: $alert-success-icon-color;
  915. }
  916. .error {
  917. color: $alert-error-icon-color;
  918. }
  919. :global(.part-time) {
  920. padding-right: 5px !important;
  921. }
  922. }
  923. </style>