1、消息确认页面完成所有布局及功能
2、通过调整刷新页面的登出账号方式为路由跳转至登录页面,以试图解决token过期后无法正常跳转的问题(未在现场调试)
| | |
| | | return that.Logout({}).then(() => { |
| | | // update-begin author:wangshuai date:20200601 for: éåºç»å½è·³è½¬ç»å½é¡µé¢ |
| | | that.$router.push({ path: '/user/login' }); |
| | | window.location.reload() |
| | | // window.location.reload() |
| | | // update-end author:wangshuai date:20200601 for: éåºç»å½è·³è½¬ç»å½é¡µé¢ |
| | | }).catch(err => { |
| | | that.$message.error({ |
| | |
| | | if (token) { |
| | | store.dispatch('Logout').then(() => { |
| | | setTimeout(() => { |
| | | window.location.reload() |
| | | router.push({ path: '/user/login' }); |
| | | // window.location.reload() |
| | | }, 1500) |
| | | }) |
| | | } |
| | |
| | | onOk: () => { |
| | | store.dispatch('Logout').then(() => { |
| | | Vue.ls.remove(ACCESS_TOKEN) |
| | | window.location.reload() |
| | | setTimeout(() => { |
| | | router.push({ path: '/user/login' }); |
| | | // window.location.reload() |
| | | }, 1500) |
| | | }) |
| | | } |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | |
| | | <a-col :span="6"> |
| | | <a-form-item label="设å¤ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤ç¼å·" v-model="queryParam.equipmentId"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-item label="æ¶æ¯ç¶æ"> |
| | | <a-select v-model='queryParam.msgStatus' placeholder="è¯·éæ©æ¶æ¯ç¶æ"> |
| | | <a-select-option v-for="item in msgStatusOptionList" :value="item.value">{{item.title}} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :span="8"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="default" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange"> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="showModal(record,0)">æ¥ç</a> |
| | | <a-divider type="vertical" v-if="record.hasProcess||record.hasConfirm"></a-divider> |
| | | <a @click="showModal(record,1)" v-if="record.hasProcess">䏿¥</a> |
| | | <a-divider type="vertical" v-if="record.hasConfirm&&record.hasProcess"></a-divider> |
| | | <a @click="showModal(record,2)" v-if="record.hasConfirm">确认</a> |
| | | <!--<a @click="showModal(record,0)">æ¥ç</a>--> |
| | | <!--<a-divider type="vertical"></a-divider>--> |
| | | <!--<a @click="showModal(record,1)">䏿¥</a>--> |
| | | <!--<a-divider type="vertical"></a-divider>--> |
| | | <!--<a @click="showModal(record,2)">确认</a>--> |
| | | </span> |
| | | </a-table> |
| | | <mdc-message-approval-modal ref="modalRef" :title="modalTitle" :visible="modalVisible" :buttonId="buttonId" |
| | | @closeModal="modalVisible = false" @formHasSubmitted="loadData"/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, putAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' |
| | | import MdcMessageApprovalModal from './modules/MdcMessageApproval/MdcMessageApprovalModal' |
| | | |
| | | export default { |
| | | name: 'MdcMessageApproval', |
| | | mixins: [JeecgListMixin], |
| | | components: { MdcMessageApprovalModal }, |
| | | data() { |
| | | return { |
| | | description: 'mdcæ¶æ¯ç¡®è®¤é¡µé¢', |
| | | queryParam: {}, |
| | | columns: [ |
| | | { |
| | | title: '设å¤ç¼å·', |
| | | align: 'center', |
| | | dataIndex: 'equipmentId' |
| | | }, |
| | | { |
| | | title: 'æ é¢', |
| | | align: 'center', |
| | | dataIndex: 'titile' |
| | | }, { |
| | | title: 'å
容', |
| | | align: 'center', |
| | | dataIndex: 'msgContent', |
| | | width: 450 |
| | | }, { |
| | | title: 'åå ', |
| | | align: 'center', |
| | | dataIndex: 'reportContent', |
| | | width: 450 |
| | | }, { |
| | | title: 'å¤ç人', |
| | | align: 'center', |
| | | dataIndex: 'senderNames' |
| | | }, { |
| | | title: '确认人', |
| | | align: 'center', |
| | | dataIndex: 'approverNames' |
| | | }, { |
| | | title: 'ç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'msgStatus', |
| | | customRender: function(text) { |
| | | if (text == '0') { |
| | | return 'å¾
å¤ç' |
| | | } else if (text == '1') { |
| | | return 'å¾
确认' |
| | | } else if (text == '2') { |
| | | return '已确认' |
| | | } else { |
| | | return 'å·²æç»' |
| | | } |
| | | } |
| | | }, { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' } |
| | | }], |
| | | url: { |
| | | list: '/mdc/mdcMessageApproval/list' |
| | | }, |
| | | loading: false, |
| | | msgStatusOptionList: [], |
| | | modalTitle: '', |
| | | modalVisible: false, |
| | | buttonId: null |
| | | } |
| | | }, |
| | | created() { |
| | | this.initDictData('mdcMsgStatus') |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è°ç¨æ¥å£è·åæ°æ®åå
¸é
ç½®msgStatus |
| | | * @param dictCode æ°æ®åå
¸ç¼å· |
| | | */ |
| | | initDictData(dictCode) { |
| | | //æ ¹æ®åå
¸Code, åå§ååå
¸æ°ç» |
| | | ajaxGetDictItems(dictCode, null).then((res) => { |
| | | if (res.success) { |
| | | console.log('res================', res) |
| | | this.msgStatusOptionList = res.result |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»æé®å±ç¤ºå¼¹çª |
| | | * @param record ç¹å»è¡ä¿¡æ¯ |
| | | * @param buttonId æé®Idï¼æ¥çï¼0ï¼ä¸æ¥ï¼1ï¼ç¡®è®¤ï¼2ï¼ |
| | | */ |
| | | showModal(record, buttonId) { |
| | | this.buttonId = buttonId |
| | | switch (buttonId) { |
| | | case 0: |
| | | this.modalTitle = 'æ¶æ¯å
容' |
| | | break |
| | | case 1: |
| | | this.modalTitle = '䏿¥åå ' |
| | | break |
| | | case 2: |
| | | this.modalTitle = 'ç¡®è®¤æ¶æ¯' |
| | | break |
| | | default: |
| | | this.modalTitle = 'æ¶æ¯å
容' |
| | | } |
| | | this.$refs.modalRef.formParams = Object.assign({}, record) |
| | | this.modalVisible = true |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal :title="title" |
| | | :maskClosable="true" |
| | | @cancel="closeModal" |
| | | :visible="visible" |
| | | :footer="null"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :form="form" :model="formParams" :rules="validatorRules"> |
| | | <a-form-model-item label="设å¤ç¼å·" :labelCol="{span: 4}" :wrapperCol="{span: 8}"> |
| | | <a-input v-model="formParams.equipmentId" disabled></a-input> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="æ é¢" :labelCol="{span: 4}" :wrapperCol="{span: 20}"> |
| | | <a-input v-model="formParams.titile" disabled></a-input> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="å
容" :labelCol="{span: 4}" :wrapperCol="{span: 20}"> |
| | | <a-input v-model="formParams.msgContent" disabled></a-input> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="åå " :labelCol="{span: 4}" :wrapperCol="{span: 20}" prop="reportContent" |
| | | v-if="buttonId===1"> |
| | | <a-textarea v-model="formParams.reportContent" :disabled="buttonId!==1"></a-textarea> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="åå " :labelCol="{span: 4}" :wrapperCol="{span: 20}" v-else> |
| | | <a-textarea v-model="formParams.reportContent" :disabled="buttonId!==1"></a-textarea> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="确认" :labelCol="{span: 4}" :wrapperCol="{span: 12}" prop="isConfirm" |
| | | v-if="buttonId==2"> |
| | | <a-select v-model='formParams.isConfirm' placeholder="è¯·éæ©æ¯å¦ç¡®è®¤"> |
| | | <a-select-option value="2">确认</a-select-option> |
| | | <a-select-option value="3">æç»</a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </a-spin> |
| | | |
| | | <div class="drawer-bottom-button" v-show="buttonId!==0"> |
| | | <a-popconfirm title="ç¡®å®æ¾å¼æä½ï¼" @confirm="closeModal" okText="ç¡®å®" cancelText="åæ¶"> |
| | | <a-button style="margin-right: .8rem">åæ¶</a-button> |
| | | </a-popconfirm> |
| | | <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">æäº¤</a-button> |
| | | </div> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { postAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'MdcMessageApprovalModal', |
| | | props: { |
| | | visible: { |
| | | type: Boolean |
| | | }, |
| | | title: { |
| | | type: String |
| | | }, |
| | | buttonId: { |
| | | type: Number |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | form: this.$form.createForm(this), |
| | | formParams: { |
| | | equipmentId: '', |
| | | titile: '', |
| | | msgContent: '', |
| | | reportContent: '', |
| | | msgStatus: '', |
| | | isConfirm: '' |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | reportContent: [ |
| | | { required: true, message: '请è¾å
¥ä¸æ¥åå ' } |
| | | ], |
| | | isConfirm: [ |
| | | { required: true, message: 'è¯·éæ©æ¯å¦ç¡®è®¤' } |
| | | ] |
| | | }, |
| | | url: { |
| | | reportUrl: '/mdc/mdcMessageApproval/reportReason', |
| | | confirmUrl: '/mdc/mdcMessageApproval/handleConfirm' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | closeModal() { |
| | | this.$refs.form.clearValidate() |
| | | this.$emit('closeModal') |
| | | }, |
| | | handleSubmit() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | this.formParams.msgStatus = this.formParams.isConfirm |
| | | let obj |
| | | if (this.buttonId === 1) { |
| | | obj = postAction(this.url.reportUrl, this.formParams) |
| | | } else { |
| | | obj = postAction(this.url.confirmUrl, this.formParams) |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('formHasSubmitted') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.closeModal() |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | .drawer-bottom-button { |
| | | position: absolute; |
| | | bottom: -25px; |
| | | width: 100%; |
| | | border-top: 1px solid #e8e8e8; |
| | | padding: 10px 16px; |
| | | text-align: right; |
| | | left: 0; |
| | | background: #fff; |
| | | border-radius: 0 0 2px 2px; |
| | | } |
| | | </style> |