From 4b62098fb4528e3f38df4265e1e2ec081664d4b4 Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期三, 25 十月 2023 13:18:41 +0800 Subject: [PATCH] 鉴定工单调整 --- src/views/eam/MalfunctionRepair.vue | 172 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 94 insertions(+), 78 deletions(-) diff --git a/src/views/eam/MalfunctionRepair.vue b/src/views/eam/MalfunctionRepair.vue index 007551e..ea0a7f5 100644 --- a/src/views/eam/MalfunctionRepair.vue +++ b/src/views/eam/MalfunctionRepair.vue @@ -77,11 +77,12 @@ :loading="loading" class="j-table-force-nowrap" @change="handleTableChange" - :rowSelection = "rowSelection" + :customRow="clickThenSelect" > + <!-- :rowSelection="rowSelection" --> <!-- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" --> - <template + <!-- <template slot="htmlSlot" slot-scope="text" > @@ -122,38 +123,41 @@ > 涓嬭浇 </a-button> - </template> + </template> --> <span slot="action" slot-scope="text, record" > - <a-popconfirm - v-if="record.status == '1'" - 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-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'" + v-if="record.status == '1' || record.status == '2' || record.status == '4'" type="vertical" /> <a - v-if="record.status == '1' " + v-if="record.status == '1' || record.status == '4'" @click="handleEdit(record)" >缂栬緫</a> - <a v-if="record.status == '2'" @click="handleApprove(record)">瀹℃壒</a> + <a + v-if="record.status == '2'" + @click="handleApprove(record)" + >瀹℃壒</a> <a-divider - v-if="record.status == '1' || record.status == '2'" + v-if="record.status == '1' || record.status == '2' || record.status == '4'" type="vertical" /> <a-dropdown> @@ -171,33 +175,6 @@ <a>鍒犻櫎</a> </a-popconfirm> </a-menu-item> - <!-- <a-menu-item v-if="record.status == '1'"> - <a-popconfirm - v-if="record.status == '1'" - title="纭鎻愪氦鍚�?" - @confirm="() =>handleCommit(record, 'commit')" - > - <a>鎻愪氦</a> - </a-popconfirm> - </a-menu-item> - <a-menu-item v-if="record.status == '2'"> - <a-popconfirm - v-if="record.status == '2'" - title="纭鎾ゅ洖鍚�?" - @confirm="() =>handleCommit(record, 'back')" - > - <a>鎾ゅ洖</a> - </a-popconfirm> - </a-menu-item> - <a-menu-item v-if="record.status == '2'"> - <a-popconfirm - v-if="record.status == '2'" - title="纭椹冲洖鍚�?" - @confirm="() =>handleFinish(record, 'reject')" - > - <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'" @@ -209,6 +186,9 @@ </a-menu-item> </a-menu> </a-dropdown> + </span> + <span slot="faultDescription" slot-scope="text"> + <j-ellipsis :value="text" :length="10" /> </span> </a-table> @@ -236,19 +216,24 @@ ref="modalForm" @ok="modalFormOk" ></malfunction-repair-modal> - <approvel-modal ref='approvalModalForm' @ok='approvalModalFormOk' @cancel='approvalModalFormOk'></approvel-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 { putAction, getAction } from '@/api/manage' import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import MalfunctionRepairModal from './modules/malfunctionRepair/MalfunctionRepaireModal' -import FaultDescriptionList from './FaultDescriptionList' +import FaultDescriptionList from './modules/malfunctionRepair/FaultDescriptionList' import ApprovelModal from './modules/malfunctionRepair/ApprovelModal' +import JEllipsis from '@/components/jeecg/JEllipsis' export default { name: 'MalfunctionRepairList', @@ -256,7 +241,8 @@ components: { MalfunctionRepairModal, FaultDescriptionList, - ApprovelModal + ApprovelModal, + JEllipsis }, data() { return { @@ -310,15 +296,19 @@ align: "center", dataIndex: 'departName', }, - { - title: '绱ф�ョ▼搴�', - align: "center", - dataIndex: 'urgencyName', - }, + // { + // title: '绱ф�ョ▼搴�', + // align: "center", + // dataIndex: 'urgencyName', + // }, { title: '鏁呴殰鎻忚堪', align: "center", - dataIndex: 'faultDescription' + dataIndex: 'faultDescription', + scopedSlots: { + customRender: 'faultDescription' + } + }, // { // title: '鏁呴殰鎷嶇収', @@ -326,16 +316,21 @@ // dataIndex: 'photo', // scopedSlots: { customRender: 'imgSlot' } // }, + // { + // title: '鏁呴殰鍘熷洜', + // align: "center", + // dataIndex: 'faultReason' + // }, { title: '鏁呴殰鏃堕棿', align: "center", dataIndex: 'faultTime' }, - // { - // title: '鏄惁鍋滄満寰呬慨', - // align: "center", - // dataIndex: 'isStop_dictText', - // }, + { + title: '鏄惁鍋滄満寰呬慨', + align: "center", + dataIndex: 'isStopName', + }, { title: '鍒涘缓浜�', align: "center", @@ -351,14 +346,14 @@ align: "center", dataIndex: 'remark' }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align: "center", - fixed: "right", - width: 147, - scopedSlots: { customRender: 'action' } - } + // { + // title: '鎿嶄綔', + // dataIndex: 'action', + // align: "center", + // fixed: "right", + // width: 200, + // scopedSlots: { customRender: 'action' } + // } ], url: { list: "/eam/equipmentReportRepair/getReportRepairList", @@ -368,7 +363,18 @@ importExcelUrl: "eam/equipmentReportRepair/importExcel", edit: "/eam/equipmentReportRepair/edit", }, - imgList:'' + /* 鍒嗛〉鍙傛暟 */ + 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() { @@ -397,6 +403,16 @@ }, }, methods: { + + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(","), [record]); + } + } + } + }, loadData(arg) { if (!this.url.list) { @@ -459,12 +475,12 @@ }) }, - handleFinish(record,type) { - if(type == 'agree'){ + handleFinish(record, type) { + if (type == 'agree') { record.status = '3' - }else if(type == 'reject'){ + } else if (type == 'reject') { record.status = '4' - }else if(type == 'revoke'){ + } else if (type == 'revoke') { record.status = '2' } putAction(this.url.edit, record).then(res => { @@ -476,10 +492,10 @@ } }) }, - handleApprove: function(record) { + handleApprove: function (record) { let edit edit = this.url.edit - this.$refs.approvalModalForm.showModals(record, edit,'3','4') + this.$refs.approvalModalForm.showModals(record, edit, '3', '4') this.$refs.approvalModalForm.title = '瀹℃壒' this.$refs.approvalModalForm.disableSubmit = false -- Gitblit v1.9.3