¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | title="æ
éæ¥ä¿®" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | <a-col |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="åæ®å·"> |
| | | <a-input |
| | | placeholder="请è¾å
¥åæ®å·" |
| | | v-model="queryParam.num" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="设å¤ç¼ç "> |
| | | <a-input |
| | | placeholder="请è¾å
¥è®¾å¤ç¼ç " |
| | | v-model="queryParam.equipmentNum" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="6" |
| | | :sm="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> |
| | | <div class="table-operator"> |
| | | <a-button |
| | | @click="handleAdd" |
| | | type="primary" |
| | | icon="plus" |
| | | >æ°å¢</a-button> |
| | | </div> |
| | | |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{ x: 'calc(1900px + 50%)', y: 900 }" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange" |
| | | :customRow="clickThenSelect" |
| | | > |
| | | <!-- :rowSelection="rowSelection" --> |
| | | <!-- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" --> |
| | | |
| | | <!-- <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.status == '1' || record.status == '4'" |
| | | title="确认æäº¤å?" |
| | | @confirm="() =>handleCommit(record, 'commit')" |
| | | > |
| | | <a>æäº¤</a> |
| | | </a-popconfirm> |
| | | <a-popconfirm |
| | | v-if="record.status == '2'" |
| | | title="确认æ¤åå?" |
| | | @confirm="() =>handleCommit(record, 'back')" |
| | | > |
| | | <a>æ¤å</a> |
| | | </a-popconfirm> |
| | | |
| | | <a-divider |
| | | v-if="record.status == '1' || record.status == '2' || record.status == '4'" |
| | | type="vertical" |
| | | /> |
| | | <a |
| | | v-if="record.status == '1' || record.status == '4'" |
| | | @click="handleEdit(record)" |
| | | >ç¼è¾</a> |
| | | <a |
| | | v-if="record.status == '2'" |
| | | @click="handleApprove(record)" |
| | | >审æ¹</a> |
| | | <a-divider |
| | | v-if="record.status == '1' || record.status == '2' || record.status == '4'" |
| | | 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.status == '1'"> |
| | | <a-popconfirm |
| | | v-if="record.status == '1'" |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.status == '3' || record.status == '4'"> |
| | | <a-popconfirm |
| | | v-if="record.status == '3' || record.status == '4'" |
| | | title="确认æ¤éå?" |
| | | @confirm="() =>handleFinish(record, 'revoke')" |
| | | > |
| | | <a>æ¤é</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <a-tabs |
| | | type="card" |
| | | defaultActiveKey="1" |
| | | > |
| | | <a-tab-pane |
| | | tab="æ
éæè¿°" |
| | | key="1" |
| | | > |
| | | <div |
| | | class="table-operator" |
| | | style="margin-top: 0px" |
| | | > |
| | | <FaultDescriptionList ref="FaultDescriptionList" /> |
| | | </div> |
| | | |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | |
| | | <malfunction-repair-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></malfunction-repair-modal> |
| | | <approvel-modal |
| | | ref='approvalModalForm' |
| | | @ok='approvalModalFormOk' |
| | | @cancel='approvalModalFormOk' |
| | | ></approvel-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { putAction, getAction } from '@/api/manage' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import MalfunctionRepairModal from './modules/malfunctionRepair/MalfunctionRepaireModal' |
| | | import FaultDescriptionList from './modules/malfunctionRepair/FaultDescriptionList' |
| | | import ApprovelModal from './modules/malfunctionRepair/ApprovelModal' |
| | | |
| | | export default { |
| | | name: 'MalfunctionRepairList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | MalfunctionRepairModal, |
| | | FaultDescriptionList, |
| | | ApprovelModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'æ
éæ¥ä¿®', |
| | | queryParam: { delflag: 0 }, |
| | | selectedRowKeys: [], |
| | | selectionRows: [], |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | align: "center", |
| | | dataIndex: 'statusName', |
| | | }, |
| | | { |
| | | title: 'åæ®å·', |
| | | align: "center", |
| | | dataIndex: 'num' |
| | | }, |
| | | { |
| | | title: '设å¤ç¼ç ', |
| | | align: "center", |
| | | dataIndex: 'equipmentNum' |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | align: "center", |
| | | dataIndex: 'equipmentName', |
| | | }, |
| | | { |
| | | title: '设å¤åå·', |
| | | align: "center", |
| | | dataIndex: 'equipmentModel', |
| | | }, |
| | | { |
| | | title: 'è§æ ¼', |
| | | align: "center", |
| | | dataIndex: 'equipmentSpecification', |
| | | }, |
| | | { |
| | | title: '使ç¨é¨é¨', |
| | | align: "center", |
| | | dataIndex: 'departName', |
| | | }, |
| | | { |
| | | title: 'ç´§æ¥ç¨åº¦', |
| | | align: "center", |
| | | dataIndex: 'urgencyName', |
| | | }, |
| | | { |
| | | title: 'æ
éæè¿°', |
| | | align: "center", |
| | | dataIndex: 'faultDescription' |
| | | }, |
| | | // { |
| | | // title: 'æ
éæç
§', |
| | | // align: "center", |
| | | // dataIndex: 'photo', |
| | | // scopedSlots: { customRender: 'imgSlot' } |
| | | // }, |
| | | { |
| | | title: 'æ
éæ¶é´', |
| | | align: "center", |
| | | dataIndex: 'faultTime' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦åæºå¾
ä¿®', |
| | | align: "center", |
| | | dataIndex: 'isStopName', |
| | | }, |
| | | { |
| | | title: 'å建人', |
| | | align: "center", |
| | | dataIndex: 'createBy' |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | align: "center", |
| | | dataIndex: 'createTime', |
| | | }, |
| | | { |
| | | title: '夿³¨', |
| | | align: "center", |
| | | dataIndex: 'remark' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 200, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/equipmentReportRepair/getReportRepairList", |
| | | delete: "/eam/equipmentReportRepair/delete", |
| | | deleteBatch: "/eam/equipmentReportRepair/deleteBatch", |
| | | exportXlsUrl: "/eam/equipmentReportRepair/exportXls", |
| | | importExcelUrl: "eam/equipmentReportRepair/importExcel", |
| | | edit: "/eam/equipmentReportRepair/edit", |
| | | }, |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '50'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function () { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | rowSelection() { |
| | | return { |
| | | type: 'checkbox', |
| | | onChange: (selectedRowKeys, selectedRows) => { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.onSelectChange(selectedRowKeys, selectedRows); |
| | | }, |
| | | getCheckboxProps(record) { |
| | | return ({ |
| | | props: { |
| | | // disabled: !(record.equipmentCategoryDtlList.length == 0), |
| | | } |
| | | }) |
| | | }, |
| | | selectedRowKeys: this.selectedRowKeys, |
| | | }; |
| | | }, |
| | | }, |
| | | methods: { |
| | | |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(","), [record]); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | var params = this.getQueryParams() //æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true |
| | | getAction(this.url.list, params) |
| | | .then(res => { |
| | | if (res.success) { |
| | | //update-begin---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | this.dataSource = res.result.records || res.result |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false |
| | | this.onClearSelected() |
| | | this.$refs.FaultDescriptionList.faultId = '-1' |
| | | }) |
| | | }, |
| | | |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows; |
| | | if (selectedRowKeys.length == 1) { |
| | | this.$refs.FaultDescriptionList.faultId = selectedRowKeys[0] |
| | | } else { |
| | | this.$refs.FaultDescriptionList.faultId = '-1' |
| | | } |
| | | }, |
| | | |
| | | |
| | | handleCommit(record, type) { |
| | | type == 'commit' ? record.status = '2' : record.status = '1' |
| | | putAction(this.url.edit, record).then(res => { |
| | | if (res.success) { |
| | | if (type === 'commit') { |
| | | this.$message.success("æäº¤æåï¼"); |
| | | } else { |
| | | this.$message.success("æ¤åæåï¼"); |
| | | } |
| | | |
| | | this.loadData(); |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleFinish(record, type) { |
| | | if (type == 'agree') { |
| | | record.status = '3' |
| | | } else if (type == 'reject') { |
| | | record.status = '4' |
| | | } else if (type == 'revoke') { |
| | | record.status = '2' |
| | | } |
| | | putAction(this.url.edit, record).then(res => { |
| | | if (res.success) { |
| | | this.$message.success("确认æåï¼"); |
| | | this.loadData(); |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }) |
| | | }, |
| | | handleApprove: function (record) { |
| | | let edit |
| | | edit = this.url.edit |
| | | this.$refs.approvalModalForm.showModals(record, edit, '3', '4') |
| | | this.$refs.approvalModalForm.title = '审æ¹' |
| | | this.$refs.approvalModalForm.disableSubmit = false |
| | | |
| | | }, |
| | | approvalModalFormOk() { |
| | | // éè¿/驳忶ï¼éè½½å表 |
| | | this.loadData() |
| | | //æ¸
空å表éä¸ |
| | | this.onClearSelected() |
| | | }, |
| | | |
| | | onClearSelected() { |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = [] |
| | | }, |
| | | |
| | | searchQuery() { |
| | | this.loadData(1) |
| | | this.onClearSelected() |
| | | this.$refs.FaultDescriptionList.faultId = '-1' |
| | | }, |
| | | |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.loadData(1) |
| | | this.onClearSelected() |
| | | this.$refs.FaultDescriptionList.faultId = '-1' |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |