¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | title='设å¤å¯å°' |
| | | :bordered="false" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24" v-if="false"> |
| | | <a-form-item label="å卿¹å¼(å°å-sealï¼å¯å°-unseal,æ¥åº-scrapï¼å¤ç½®-disposal)"> |
| | | <a-input placeholder="请è¾å
¥å卿¹å¼(å°å-sealï¼å¯å°-unseal,æ¥åº-scrapï¼å¤ç½®-disposal)" |
| | | :defaultValue="changeMethod"></a-input> |
| | | </a-form-item> |
| | | </a-col> --> |
| | | <a-col |
| | | :xl="6" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="åæ®å·"> |
| | | <a-input |
| | | placeholder="请è¾å
¥åæ®å·" |
| | | v-model="queryParam.num" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :xl="6" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="审æ¹ç¶æ"> |
| | | <j-dict-select-tag |
| | | placeholder="è¯·éæ©å®¡æ¹ç¶æ" |
| | | v-model="queryParam.auditStatus" |
| | | dictCode="audit_status" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!-- <template v-if="toggleSearchStatus"> |
| | | |
| | | <a-col :xl="10" :lg="11" :md="12" :sm="24"> |
| | | <a-form-item label="å建æ¶é´"> |
| | | <j-date placeholder="è¯·éæ©å¼å§æ¥æ" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
| | | <span class="query-group-split-cust"></span> |
| | | <j-date placeholder="è¯·éæ©ç»ææ¥æ" class="query-group-cust" v-model="queryParam.createTime_end"></j-date> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> --> |
| | | <a-col |
| | | :xl="6" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <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> |
| | | <!-- <a @click="handleToggleSearch" style="margin-left: 8px"> |
| | | {{ toggleSearchStatus ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="toggleSearchStatus ? 'up' : 'down'" /> |
| | | </a> --> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button |
| | | @click="handleAdd" |
| | | type="primary" |
| | | icon="plus" |
| | | >æ°å¢</a-button> |
| | | </div> |
| | | |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | class="j-table-force-nowrap" |
| | | :scroll="{ x: true }" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }" |
| | | :customRow="clickThenSelect" |
| | | @change="handleTableChange" |
| | | > |
| | | <span slot="num" slot-scope="text"> |
| | | <j-ellipsis :value="text" :length="15" /> |
| | | </span> |
| | | <template |
| | | slot="htmlSlot" |
| | | slot-scope="text" |
| | | > |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template |
| | | slot="imgSlot" |
| | | slot-scope="text,record" |
| | | > |
| | | <span |
| | | v-if="!text" |
| | | style="font-size: 12px;font-style: italic;" |
| | | >æ å¾ç</span> |
| | | <img |
| | | v-else |
| | | :src="getImgView(text)" |
| | | :preview="record.id" |
| | | height="25px" |
| | | alt="" |
| | | style="max-width:80px;font-size: 12px;font-style: italic;" |
| | | /> |
| | | </template> |
| | | <template |
| | | slot="fileSlot" |
| | | slot-scope="text" |
| | | > |
| | | <span |
| | | v-if="!text" |
| | | style="font-size: 12px;font-style: italic;" |
| | | >æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)" |
| | | > |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a-popconfirm |
| | | v-if="record.auditStatus == 'notSubmitted' || record.auditStatus == 'Rejected'" |
| | | title="确认æäº¤å?" |
| | | @confirm="() =>handleCommit(record,'commit')" |
| | | > |
| | | <a>æäº¤</a> |
| | | </a-popconfirm> |
| | | <a-popconfirm |
| | | v-if="record.auditStatus == 'pendingApproval'" |
| | | title="确认æ¤åå?" |
| | | @confirm="() =>handleCommit(record,'back')" |
| | | > |
| | | <a>æ¤å</a> |
| | | </a-popconfirm> |
| | | |
| | | <a-divider |
| | | v-if="record.auditStatus == 'notSubmitted' || record.auditStatus == 'pendingApproval' || record.auditStatus == 'Rejected'" |
| | | type="vertical" |
| | | /> |
| | | <a |
| | | v-if="record.auditStatus == 'notSubmitted' || record.auditStatus == 'Rejected'" |
| | | @click="handleEdit(record)" |
| | | >ç¼è¾</a> |
| | | <a |
| | | v-if="record.auditStatus == 'pendingApproval'" |
| | | @click="handleApprove(record)" |
| | | >审æ¹</a> |
| | | <a-divider |
| | | v-if="record.auditStatus == 'notSubmitted' || record.auditStatus == 'pendingApproval' || record.auditStatus == 'Rejected'" |
| | | type="vertical" |
| | | /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.auditStatus == 'notSubmitted'"> |
| | | <a-popconfirm |
| | | v-if="record.auditStatus == 'notSubmitted'" |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | <!-- <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> --> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane |
| | | tab="设å¤å¯å°æç»" |
| | | key="1" |
| | | > |
| | | <EquipmentUnsealDetailList :mainId="equipmentUnsealDetailMainId" /> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | |
| | | <equipmentUnseal-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></equipmentUnseal-modal> |
| | | <approvel-modal |
| | | ref="approvalModalForm" |
| | | @ok='approvalModalFormOk' |
| | | @cancel='approvalModalFormOk' |
| | | ></approvel-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import EquipmentUnsealModal from './modules/equipmentUnseal/EquipmentUnsealModal' |
| | | import { getAction, deleteAction, postAction } from '@/api/manage' |
| | | import EquipmentUnsealDetailList from './modules/equipmentUnseal/EquipmentUnsealDetailList' |
| | | import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil' |
| | | import '@/assets/less/TableExpand.less' |
| | | import ApprovelModal from './modules/equipmentSeal/ApprovelModal' |
| | | |
| | | export default { |
| | | name: 'EquipmentUnsealList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | EquipmentUnsealModal, |
| | | EquipmentUnsealDetailList, |
| | | ApprovelModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: '设å¤å¯å°ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '审æ¹ç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'auditStatus_dictText' |
| | | }, |
| | | { |
| | | title: 'åæ®å·', |
| | | align: 'center', |
| | | sorter: true, |
| | | dataIndex: 'num', |
| | | scopedSlots: { customRender: 'num' }, |
| | | width: 100, |
| | | ellipsis: true |
| | | }, |
| | | { |
| | | title: 'å建人', |
| | | align: 'center', |
| | | dataIndex: 'createBy' |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'createTime', |
| | | customRender: function (text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'ä¿®æ¹äºº', |
| | | align: 'center', |
| | | dataIndex: 'updateBy' |
| | | }, |
| | | { |
| | | title: 'ä¿®æ¹æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'updateTime', |
| | | customRender: function (text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: '夿³¨', |
| | | align: 'center', |
| | | dataIndex: 'remark' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/eam/equipmentUnseal/list', |
| | | approve: '/eam/equipmentUnseal/approve', |
| | | delete: '/eam/equipmentUnseal/delete', |
| | | deleteBatch: '/eam/equipmentUnseal/deleteBatch', |
| | | exportXlsUrl: '/eam/equipmentUnseal/exportXls', |
| | | importExcelUrl: 'eam/equipmentUnseal/importExcel', |
| | | submit: 'eam/equipmentUnseal/submit', |
| | | revocation: 'eam/equipmentUnseal/revocation' |
| | | }, |
| | | dictOptions: { |
| | | auditStatus: [] |
| | | }, |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '50'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | selectedMainId: '', |
| | | equipmentUnsealDetailMainId: '', |
| | | // é»è®¤å卿¹å¼ å°å-sealï¼å¯å°-unseal,æ¥åº-scrapï¼å¤ç½®-disposal |
| | | changeMethod: 'unseal' |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function () { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | initDictConfig() { |
| | | }, |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(','), [record]) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = [] |
| | | this.selectedMainId = '' |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedMainId = selectedRowKeys[0] |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectionRows = selectionRows |
| | | this.equipmentUnsealDetailMainId = selectionRows[0]['id'] |
| | | }, |
| | | async loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | this.onClearSelected() |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true |
| | | await getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | this.ipagination.total = res.result.total |
| | | } |
| | | if (res.code === 510) { |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false |
| | | }) |
| | | this.equipmentUnsealDetailMainId = "" |
| | | }, |
| | | handleCommit(record, type) { |
| | | let url |
| | | type == 'commit' ? record.auditStatus = 'pendingApproval' : record.auditStatus = 'notSubmitted' |
| | | type == 'commit' ? url = this.url.submit : url = this.url.revocation |
| | | postAction(url, record).then(res => { |
| | | if (res.success) { |
| | | if (type === 'commit') { |
| | | this.$message.success("æäº¤æåï¼"); |
| | | } else { |
| | | this.$message.success("æ¤åæåï¼"); |
| | | } |
| | | |
| | | this.loadData(1); |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }) |
| | | }, |
| | | handleApprove: function (record) { |
| | | let approve |
| | | approve = this.url.approve |
| | | this.$refs.approvalModalForm.showModals(record, approve, 'Approved', 'Rejected') |
| | | this.$refs.approvalModalForm.title = '审æ¹' |
| | | this.$refs.approvalModalForm.disableSubmit = false |
| | | |
| | | }, |
| | | approvalModalFormOk() { |
| | | // éè¿/驳忶ï¼éè½½å表 |
| | | this.loadData() |
| | | //æ¸
空å表éä¸ |
| | | this.onClearSelected() |
| | | }, |
| | | |
| | | searchReset() { |
| | | this.queryParam = { |
| | | changeMethod: this.changeMethod |
| | | } |
| | | this.loadData(1) |
| | | }, |
| | | // æ¨¡ææ¡ç¡®è®¤ |
| | | async modalFormOk() { |
| | | this.queryParam = { |
| | | changeMethod: this.changeMethod |
| | | } |
| | | // æ°å¢/ä¿®æ¹ æåæ¶ï¼éè½½å表 |
| | | await this.loadData(1) |
| | | // éä¸å表æ°å¢é¡¹ |
| | | this.selectedRowKeys = [this.dataSource[0].id] |
| | | this.selectionRows = [this.dataSource[0]] |
| | | this.selectedMainId = this.dataSource[0].id |
| | | this.equipmentUnsealDetailMainId = this.dataSource[0].id |
| | | }, |
| | | handleDelete(id) { |
| | | this.queryParam = { |
| | | changeMethod: this.changeMethod |
| | | } |
| | | if (!this.url.delete) { |
| | | this.$message.error('请设置url.delete屿§!') |
| | | return |
| | | } |
| | | deleteAction(this.url.delete, { id: id }).then(res => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | this.reCalculatePage(1) |
| | | this.$message.success(res.message) |
| | | this.loadData() |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |