123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947 |
- <template>
- <div :class="$style.wrapHeight">
- <a-card :bordered="false">
- <a-tabs v-model="activeKey" type="line" @change="toggleTabs">
- <a-tab-pane key="1" tab="资料上报">
- <!-- 高级搜索组件 -->
- <audit-advanced-query
- :class="$style.advancedQuery"
- :expand="isShowAdvSearch"
- :search-data="SJXMAdvSearchForm"
- :ref-name="searchform"
- :search-style="{ height: '210px', left: '10px', top: '60px' }"
- :search-fun="advSJXMSearch"
- @searchedClick="searchedClick"
- >
- <template>
- <a-row>
- <a-col :span="12">
- <a-form-model-item :label="'年\u2002\u2002度'" prop="reportYear">
- <a-input v-model="SJXMAdvSearchForm.reportYear" allow-clear />
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item :label="'标\u2002\u2002题'" prop="title">
- <a-input v-model="SJXMAdvSearchForm.title" allow-clear />
- </a-form-model-item>
- </a-col>
- </a-row>
- <a-row>
- <a-col :span="12">
- <a-form-model-item :label="'当前状态'" prop="flowState">
- <sd-select
- v-model="SJXMAdvSearchForm.flowState"
- :allow-clear="true"
- :options="flowStateOptions"
- />
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item :label="'上报单位'" prop="reportUnitName">
- <a-input v-model="SJXMAdvSearchForm.reportUnitName" allow-clear />
- </a-form-model-item>
- </a-col>
- </a-row>
- <a-row>
- <a-col :span="12">
- <a-form-model-item :label="'是否逾期未报'" prop="isLate">
- <sd-select
- v-model="SJXMAdvSearchForm.isLate"
- :allow-clear="true"
- :options="isLateOptions"
- />
- </a-form-model-item>
- </a-col>
- </a-row>
- </template>
- </audit-advanced-query>
- <sd-data-table-ex
- ref="SJXMDataTable"
- style="margin-top: 25px"
- :filter-expressions="SJXMTableExpressions"
- :columns="columns1"
- show-selection
- form-id="spicCompositeDatabase"
- :data-url="dataurl1"
- :actions="actions1"
- :page-id="pageId1"
- @selectedRowsChanged="selectedRowsChanged"
- >
- <div slot="islink" slot-scope="text, record">
- <a :title="text" @click="rowClick1(record)">{{ text }}</a>
- </div>
- </sd-data-table-ex>
- </a-tab-pane>
- <a-tab-pane key="2" tab="综合资料下发">
- <!-- 高级搜索区域 -->
- <audit-advanced-query
- :class="$style.advancedQuery"
- :expand="isShowAdvSearch"
- :search-data="SJJHAdvSearchForm"
- :ref-name="searchform"
- :search-style="{ height: '170px', left: '10px', top: '60px' }"
- :search-fun="advJHBGSearch"
- @searchedClick="searchedClick"
- >
- <template>
- <a-row>
- <a-col :span="12">
- <a-form-model-item :label="'年度'" prop="reportYear">
- <a-input v-model="SJJHAdvSearchForm.reportYear" allow-clear />
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item :label="'标题'" prop="title">
- <a-input v-model="SJJHAdvSearchForm.title" allow-clear />
- </a-form-model-item>
- </a-col>
- </a-row>
- <a-row>
- <a-col :span="12">
- <a-form-model-item :label="'当前状态'" prop="docStatus">
- <sd-select
- v-model="SJJHAdvSearchForm.docStatus"
- :allow-clear="true"
- :options="flowStateOptions1"
- />
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item :label="'编制人员'" prop="creatorName">
- <a-input v-model="SJJHAdvSearchForm.creatorName" />
- </a-form-model-item>
- </a-col>
- </a-row>
- </template>
- </audit-advanced-query>
- <sd-data-table-ex
- ref="JHBGDataTable"
- style="margin-top: 25px"
- :filter-expressions="JHBGTableExpressions"
- :columns="columns2"
- show-selection
- form-id="spicCompositeDatabasePublish"
- :data-url="dataurl2"
- :actions="actions2"
- :page-id="pageId2"
- @selectedRowsChanged="selectedRowsChanged"
- >
- <div slot="islink" slot-scope="text, record">
- <a :title="text" @click="rowClick2(record)">{{ text }}</a>
- </div>
- </sd-data-table-ex>
- </a-tab-pane>
- </a-tabs>
- <div :class="[$style.btns]">
- <a-input-search
- v-model="searchValue"
- style="width: 155px; vertical-align: bottom"
- placeholder="请输入搜索条件"
- allow-clear
- @search="onSearch"
- />
- <a-button title="高级搜索" :class="$style.advSearchBtn" @click="AdvSearchClick">
- <a-icon type="sd-audit-advancesearch" theme="filled" :class="$style.searchIcon" />
- </a-button>
- <a-button
- v-if="activeKey === '2' && isApplicationAdmin"
- type="primary"
- :class="[$style.buttonSpacing]"
- @click="createProject"
- >新建
- </a-button>
- <a-button
- v-if="activeKey === '1' && true"
- :class="[$style.buttonSpacing]"
- :loading="exportLoading"
- @click="fnexport"
- >批量导出附件
- </a-button>
- <a-button
- v-if="activeKey === '2' && isApplicationAdmin"
- :class="[$style.buttonSpacing]"
- :disabled="deleteButtonDisable"
- @click="linkToDelete"
- >删除
- </a-button>
- </div>
- </a-card>
- </div>
- </template>
- <script>
- import moment from 'moment'
- import auditAdvancedQueryMixins from '@product/iam/components/audit-advanced-query-mixins'
- import auditAdvancedQuery from '@product/iam/components/audit-advanced-query.vue'
- import CompositeDatabaseService from './composite-database-service'
- import crossWindowWatcher from '@/common/services/cross-window-watcher'
- import { message, Modal } from 'ant-design-vue'
- import axios from '@/common/services/axios-instance'
- import TableColumnTypes from '@/common/services/table-column-types'
- import storeMixin, { getUserInfo } from '@/common/store-mixin'
- import errorUtil from '@/common/services/error-util'
- import components from './_import-components/xm-composite-database-list-import'
- export default {
- name: 'XmCompositeDatabaseList',
- metaInfo: {
- title: '资料上报',
- },
- components: { ...components, auditAdvancedQuery },
- mixins: [storeMixin, auditAdvancedQueryMixins],
- data() {
- return {
- // radioValue: 1,
- exportLoading: false,
- activeKey: '1',
- searchValue: '',
- deleteButtonDisable: true,
- searchform: 'searchform',
- isShowAdvSearch: false,
- showYearPicker: false,
- year: null,
- endOpen: false,
- SJXMAdvSearchForm: {
- reportYear: '',
- title: '',
- flowState: '',
- reportUnitName: '',
- isLate: '',
- },
- SJJHAdvSearchForm: {
- reportYear: '',
- docStatus: '',
- creatorName: '',
- },
- SJXMTableExpressions: [],
- JHBGTableExpressions: [],
- pageId1: 'audit/spiccompositedatabase/spicCompositeDatabase',
- pageId2: 'audit/spiccompositedatabase/spicCompositeDatabasePublish',
- dataurl2: 'api/xcoa-mobile/v1/spiccompositedatabasepublish/al-list',
- dataurl1: 'api/xcoa-mobile/v1/spiccompositedatabase/al-list',
- columns1: [
- {
- title: '序号',
- dataIndex: 'sortNumber',
- width: '40px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- {
- title: '年度',
- dataIndex: 'reportYear',
- width: '80px',
- },
- {
- title: '标题',
- width: '15%',
- dataIndex: 'title',
- scopedSlots: { customRender: 'islink' },
- },
- {
- title: '上报单位',
- dataIndex: 'reportUnitName',
- width: '200px',
- },
- {
- title: '编制人员',
- dataIndex: 'creatorName',
- width: '100px',
- },
- {
- title: '编制日期',
- dataIndex: 'creationTime',
- sorter: true,
- sdRender: TableColumnTypes.date,
- width: '100px',
- },
- {
- title: '当前状态',
- dataIndex: 'flowState',
- width: '100px',
- sorter: true,
- },
- {
- title: '当前处理人',
- dataIndex: 'currentUser',
- width: '100px',
- },
- { title: '文档状态', dataIndex: 'endType', width: '120px', sdHidden: true },
- {
- title: '操作',
- dataIndex: 'opt',
- aligen: 'center',
- customRender: (text, record, index) => {
- const adminRole = getUserInfo().roles.find((item) => {
- return item.code === 'G-1_COMPOSITE_DATABASE'
- })
- if (
- record.endType === 5 &&
- (record.publishAccount === getUserInfo().account || adminRole)
- ) {
- return (
- <span>
- <a vOn:click={(evt) => this.overruleReport(record)}>驳回上报</a>
- </span>
- )
- }
- },
- width: '100px',
- },
- ],
- actions1: [],
- columns2: [
- {
- title: '序号',
- dataIndex: 'sortNumber',
- width: '40px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- {
- title: '年度',
- dataIndex: 'reportYear',
- width: '80px',
- },
- {
- title: '标题',
- width: '30%',
- dataIndex: 'title',
- scopedSlots: { customRender: 'islink' },
- },
- {
- title: '在线反馈截止时间',
- dataIndex: 'endTime',
- width: '120px',
- sorter: true,
- sdRender: TableColumnTypes.date,
- },
- {
- title: '编制人员',
- dataIndex: 'creatorName',
- width: '120px',
- },
- {
- title: '编制日期',
- dataIndex: 'creationTime',
- sorter: true,
- sdRender: TableColumnTypes.date,
- width: '120px',
- },
- {
- title: '当前状态',
- dataIndex: 'docStatus',
- width: '120px',
- sorter: true,
- },
- ],
- actions2: [],
- formId: 'spicCompositeDatabase',
- tableId: 'SJXMDataTable',
- itemStatusOptions: [],
- flowStateOptions: [
- {
- id: '开始',
- name: '开始',
- },
- {
- id: '转其他人员上报',
- name: '转其他人员上报',
- },
- {
- id: '结束',
- name: '结束',
- },
- ],
- isLateOptions: [
- {
- id: '是',
- name: '是',
- },
- {
- id: '否',
- name: '否',
- },
- ],
- flowStateOptions1: [
- {
- id: '起草',
- name: '起草中',
- },
- {
- id: '已发布',
- name: '已发布',
- },
- ],
- isApplicationAdmin: false, // 是否为综合资料管理员
- }
- },
- mounted() {
- // 初始化权限
- this.initJurisdiction()
- },
- methods: {
- // 初始化权限
- initJurisdiction() {
- // 校验权限(检查为综合资料管理员)
- CompositeDatabaseService.checkPermission().then((res) => {
- this.isApplicationAdmin = res.data.isHasPermission // 删除按钮权限(拥有综合资料管理员)
- })
- },
- // 驳回上报
- overruleReport(record) {
- axios({
- url: 'api/xcoa-mobile/v1/spic-common/overruleReport?id=' + record.id,
- method: 'get',
- }).then((res) => {
- if (res.data) {
- Modal.info({
- title: '提示',
- content: '驳回成功!',
- })
- // this.refresh()
- this.$refs.SJXMDataTable.refresh()
- } else {
- Modal.warning({
- title: '提示',
- content: '驳回失败,请联系管理员!',
- })
- }
- })
- },
- refreshDataTable() {
- if (this.activeKey === '1') {
- this.tableId = 'SJXMDataTable'
- }
- if (this.activeKey === '2') {
- this.tableId = 'JHBGDataTable'
- }
- if (this.$refs[`${this.tableId}`]) {
- this.$refs[`${this.tableId}`].clearSelection()
- this.$refs[`${this.tableId}`].refresh()
- }
- },
- onChange(value) {
- if (value) {
- this.SJXMAdvSearchForm.reportYear = value.format('YYYY')
- } else {
- this.SJXMAdvSearchForm.reportYear = ''
- }
- },
- toggleTabs(key) {
- this.activeKey = key
- if (this.activeKey === '1') {
- this.tableId = 'SJXMDataTable'
- this.SJXMTableExpressions = []
- }
- if (this.activeKey === '2') {
- this.tableId = 'JHBGDataTable'
- this.JHBGTableExpressions = []
- }
- this.deleteButtonDisable = true
- if (this.$refs[`${this.tableId}`]) {
- this.$refs[`${this.tableId}`].clearSelection()
- }
- },
- // 新建
- createProject() {
- let url
- if (this.activeKey === '1') {
- url = '/sd-flow-guide?code=SPIC_AUDIT_ZHZLK'
- } else {
- url = '/xm-composite-database-publish-form'
- }
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refreshDataTable()
- }
- })
- },
- linkToDelete() {
- if (this.activeKey === '1') {
- this.tableId = 'SJXMDataTable'
- this.formId = 'spicCompositeDatabase'
- }
- const selectedRowKeys = this.$refs[`${this.tableId}`].getSelectedRowKeys()
- if (selectedRowKeys.length === 0) {
- Modal.info({
- content: '请选择需要删除的数据!',
- })
- }
- if (this.activeKey === '1') {
- // if (this.checkStateDelete('开始', '只能删除开始环节的数据!', '1')) {
- this.deleteMethod1(selectedRowKeys)
- // }
- }
- if (this.activeKey === '2') {
- if (this.checkStateDelete('起草中', '只能删除起草中状态的数据!', '2')) {
- this.deleteMethod(selectedRowKeys)
- }
- }
- },
- clearSelection() {
- this.$refs.SJXMDataTable.clearSelection()
- },
- // 刷新列表
- refresh() {
- this.$emit('refreshTable')
- },
- // 删除记录
- deleteMethod1(selectedRowKeys) {
- debugger
- if (selectedRowKeys.length === 0) {
- Modal.info({
- content: '请选择需要删除的文件',
- })
- return
- }
- const selectedRows = this.$refs.SJXMDataTable.getSelectedRows()
- const currentAccount = getUserInfo().account
- const instIds = []
- let flag = false
- selectedRows.forEach((item) => {
- if (item.endType !== 0) {
- flag = true
- }
- })
- if (flag) {
- Modal.error({
- title: '删除失败:存在不是草稿状态的数据',
- })
- return
- }
- var flages = true
- selectedRows.forEach((item) => {
- var instId = item.instId - 0
- if (item.creatorAccount !== currentAccount) {
- Modal.info({
- content: '请选择自己创建的文件',
- })
- flages = false
- } else {
- instIds.push(instId)
- }
- })
- if (!flages) {
- return
- }
- return new Promise((resolve) => {
- Modal.confirm({
- title: '您确定删除这项内容吗?',
- content: '删除这条数据后,就无法恢复初始的状态。',
- okText: '删除',
- okType: 'danger',
- onOk: () => {
- axios({
- url: 'api/flow-mobile/v1/process-manager/process-instance/remove',
- method: 'POST',
- data: {
- flowCallbackBeanName: 'formBeanCleanerCallBack',
- processInstanceIds: instIds.join(','),
- },
- })
- .then(() => {
- this.clearSelection()
- // this.refresh()
- this.$refs.SJXMDataTable.refresh()
- message.success('删除成功')
- /**
- * 数据删除成功后触发
- * @property {Array} rowKeys 已删除的记录ids
- */
- this.$emit('recordsDeleted', selectedRowKeys)
- })
- .catch((err) => {
- const msg = errorUtil.getMessage(err) || '删除失败'
- message.error(msg)
- })
- .finally(resolve)
- },
- onCancel: () => {
- resolve()
- },
- })
- })
- },
- deleteMethod(selectedRowKeys) {
- debugger
- const selectedRows = this.$refs.JHBGDataTable.getSelectedRows()
- const currentAccount = getUserInfo().account
- const instIds = []
- var flages = true
- selectedRows.forEach((item) => {
- console.log(item)
- var instId = item.instId - 0
- if (item.creatorAccount !== currentAccount) {
- Modal.info({
- content: '请选择自己创建的文件',
- })
- flages = false
- } else {
- instIds.push(instId)
- }
- })
- if (!flages) {
- return
- }
- return new Promise((resolve) => {
- Modal.confirm({
- title: '您确定删除这项内容吗?',
- content: '删除这条数据后,就无法恢复初始的状态。',
- cancelText: '取消',
- okText: '删除',
- okType: 'danger',
- onOk: () => {
- axios({
- url: 'api/framework/v1/page/' + this.$refs.JHBGDataTable.formId,
- method: 'delete',
- params: { ids: selectedRowKeys.join(',') },
- })
- .then(() => {
- this.$refs.JHBGDataTable.clearSelection()
- this.$refs.JHBGDataTable.refresh()
- message.success('删除成功')
- this.$emit('recordsDeleted', selectedRowKeys)
- })
- .catch((err) => {
- const msg = errorUtil.getMessage(err) || '删除失败'
- message.error(msg)
- })
- .finally(resolve)
- },
- onCancel: () => {
- resolve()
- },
- })
- })
- },
- // 删除是否为起草状态校验
- checkStateDelete(flowState, message, type) {
- let temp = false
- const selectedRows = this.$refs[`${this.tableId}`].getSelectedRows()
- if (type === '2') {
- selectedRows.some((item) => {
- if (item.docStatus !== '起草中') {
- // if (!flowState.includes(item.flowState)) {
- temp = true
- return true
- }
- })
- }
- if (type === '1') {
- selectedRows.some((item) => {
- if (item.flowState !== '开始') {
- // if (!flowState.includes(item.flowState)) {
- temp = true
- return true
- }
- })
- }
- if (temp) {
- Modal.warning({
- title: '提示',
- content: message,
- })
- return false
- }
- return true
- },
- AdvSearchClick() {
- this.isShowAdvSearch = !this.isShowAdvSearch
- },
- searchedClick() {
- this.isShowAdvSearch = !this.isShowAdvSearch
- },
- onSearch(value) {
- if (this.activeKey === '1') {
- this.SJXMTableExpressions = []
- if (value) {
- const expressions = []
- // 标题
- expressions.push({
- dataType: 'str',
- name: 'title',
- op: 'like',
- stringValue: `%${value}%`,
- })
- this.SJXMTableExpressions.push({
- dataType: 'exps',
- op: 'or',
- expressionsValue: expressions,
- })
- }
- }
- if (this.activeKey === '2') {
- this.JHBGTableExpressions = []
- if (value) {
- const expressions = []
- // 标题
- expressions.push({
- dataType: 'str',
- name: 'title',
- op: 'like',
- stringValue: `%${value}%`,
- })
- this.JHBGTableExpressions.push({
- dataType: 'exps',
- op: 'or',
- expressionsValue: expressions,
- })
- }
- }
- this.$refs[`${this.tableId}`].clearSelection()
- },
- // 上报
- advSJXMSearch() {
- debugger
- this.SJXMTableExpressions = []
- // 年度
- if (this.SJXMAdvSearchForm.reportYear) {
- // const reportyear = this.SJXMAdvSearchForm.reportYear.year() + ''
- // console.log('上报年度高级查询----', reportyear)
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'reportYear',
- op: 'like',
- stringValue: `%${this.SJXMAdvSearchForm.reportYear}%`,
- // stringValue: `%${reportyear}%`,
- })
- }
- if (this.SJXMAdvSearchForm.flowState[0]) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'flowState',
- op: 'like',
- stringValue: `%${this.SJXMAdvSearchForm.flowState[0].id}%`,
- })
- }
- // 报送机构
- if (this.SJXMAdvSearchForm.reportUnitName) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'reportUnitName',
- op: 'like',
- stringValue: `%${this.SJXMAdvSearchForm.reportUnitName}%`,
- })
- }
- if (this.SJXMAdvSearchForm.title) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'title',
- op: 'like',
- stringValue: `%${this.SJXMAdvSearchForm.title}%`,
- })
- }
- if (this.SJXMAdvSearchForm.isLate[0]) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'isLate',
- op: 'like',
- stringValue: `${this.SJXMAdvSearchForm.isLate[0].id}`,
- })
- }
- this.$refs[`${this.tableId}`].clearSelection()
- },
- // 下发
- advJHBGSearch() {
- // debugger
- this.JHBGTableExpressions = []
- // 年度
- if (this.SJJHAdvSearchForm.reportYear) {
- // const reportyear = this.SJJHAdvSearchForm.reportYear.year() + ''
- // console.log('下发年度高级查询----', reportyear)
- this.JHBGTableExpressions.push({
- dataType: 'str',
- name: 'reportYear',
- op: 'like',
- stringValue: `%${this.SJJHAdvSearchForm.reportYear}%`,
- // stringValue: `%${reportyear}%`,
- })
- }
- if (this.SJJHAdvSearchForm.docStatus[0]) {
- this.JHBGTableExpressions.push({
- dataType: 'str',
- name: 'docStatus',
- op: 'like',
- stringValue: `%${this.SJJHAdvSearchForm.docStatus[0].name}%`,
- })
- }
- if (this.SJJHAdvSearchForm.creatorName) {
- this.JHBGTableExpressions.push({
- dataType: 'str',
- name: 'creatorName',
- op: 'like',
- stringValue: `%${this.SJJHAdvSearchForm.creatorName}%`,
- })
- }
- if (this.SJJHAdvSearchForm.title) {
- this.JHBGTableExpressions.push({
- dataType: 'str',
- name: 'title',
- op: 'like',
- stringValue: `%${this.SJJHAdvSearchForm.title}%`,
- })
- }
- this.$refs[`${this.tableId}`].clearSelection()
- },
- rowClick1(record) {
- // debugger
- let openurl = ''
- if (this.activeKey === '1') {
- if (
- (record.flowState === '起草') |
- (record.flowState === '开始') |
- (record.flowState === null)
- ) {
- if (
- (record.flowState === '起草' || record.flowState === '开始') &&
- record.creatorAccount === getUserInfo().account
- ) {
- openurl = '/sd-webflow/pages/draft/' + record.instId
- } else {
- openurl = '/sd-webflow/done-pages/' + record.instId
- }
- } else {
- openurl = '/sd-webflow/done-pages/' + record.instId
- }
- }
- crossWindowWatcher.waitForChanged(openurl).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refresh()
- }
- })
- },
- rowClick2(record) {
- if (this.activeKey === '2') {
- var url = '/xm-composite-database-publish-form?record=' + record.id
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refreshDataTable()
- }
- })
- }
- },
- selectedRowsChanged(row) {
- if (row.length > 0) {
- this.deleteButtonDisable = false
- } else {
- this.deleteButtonDisable = true
- }
- },
- // 导出
- fnexport() {
- console.log('导出点击-----')
- const selectedRowKeys = this.$refs.SJXMDataTable.getSelectedRowKeys()
- if (selectedRowKeys.length === 0) {
- Modal.warning({
- title: '提示',
- content: '请选择要一键导出附件的报告(最多可选择10条)',
- })
- } else {
- const timestamp = new Date().getTime()
- console.log(timestamp)
- axios({
- method: 'get',
- url: 'api/xcoa-mobile/v1/spic-common/exportCompositeDatabaseFiles/' + selectedRowKeys,
- responseType: 'blob',
- }).then((res) => {
- if (res.data) {
- let blob = null
- let fileName = res.headers['content-disposition']?.split('fileName=')[1]
- if (fileName === null || fileName === undefined) {
- fileName = '.zip'
- }
- blob = new Blob([res.data], { type: 'application/zip' })
- const time = moment(moment()).format('yyyyMMDD')
- fileName = '综合资料-' + time + '.zip'
- if ('msSaveOrOpenBlob' in navigator) {
- // 适配ie
- window.navigator.msSaveOrOpenBlob(blob, fileName)
- } else {
- // 其他浏览器
- const blobUrl = window.URL.createObjectURL(blob)
- const a = document.createElement('a')
- a.style.display = 'none'
- a.href = blobUrl
- a.setAttribute('download', fileName)
- a.click()
- }
- message.success('导出成功')
- } else {
- message.error('导出失败,请联系系统管理员')
- }
- })
- }
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- .wrap-height {
- :global(.ant-col-offset-10) {
- margin-left: 0;
- }
- }
- .btns {
- position: absolute;
- top: 15px;
- right: 15px;
- z-index: 100;
- }
- .buttonSpacing {
- margin-left: 5px;
- }
- .advancedQuery {
- :global(.ant-col .ant-form-item-label) {
- width: 30% !important;
- }
- :global(.ant-col .ant-form-item-control-wrapper) {
- width: 60% !important;
- }
- }
- .advSearchBtn {
- width: 35px;
- padding: 0;
- margin-left: -5px;
- border-radius: 0 5px 5px 0;
- }
- .search-icon {
- margin-left: 1px !important;
- font-size: 12px;
- }
- .wrap-height {
- .success {
- color: $alert-success-icon-color;
- }
- .error {
- color: $alert-error-icon-color;
- }
- :global(.part-time) {
- padding-right: 5px !important;
- }
- }
- </style>
|