From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期一, 18 九月 2023 13:24:30 +0800 Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430 --- src/views/eam/RepairOrderFinishedReport.vue | 784 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 784 insertions(+), 0 deletions(-) diff --git a/src/views/eam/RepairOrderFinishedReport.vue b/src/views/eam/RepairOrderFinishedReport.vue new file mode 100644 index 0000000..a4dfd71 --- /dev/null +++ b/src/views/eam/RepairOrderFinishedReport.vue @@ -0,0 +1,784 @@ +<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-row> + </a-form> + </div> + <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" + > + <a-form-item label="宸ュ崟鐘舵��"> + <j-dict-select-tag + allow-clear + placeholder="璇烽�夋嫨宸ュ崟鐘舵��" + :triggerChange="true" + dictCode="audit_status" + v-model="queryParam.auditStatus" + /> + </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="璁惧缂栫爜"> + <a-input + placeholder="璇疯緭鍏ヨ澶囩紪鐮�" + v-model="queryParam.equipmentNum" + ></a-input> + </a-form-item> + </a-col> + <!-- <a-col + :md="4" + :sm="8" + > + <a-form-item label="璁惧鍚嶇О"> + <a-input + placeholder="璇疯緭鍏ヨ澶囧悕绉�" + v-model="queryParam.equipmentName" + ></a-input> + </a-form-item> + </a-col> --> + <a-col + :md="4" + :sm="8" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + style="margin-right: 5px" + >鏌ヨ</a-button> + <a-button + @click="searchReset" + icon="reload" + >閲嶇疆</a-button> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <!-- <a-dropdown> + <a-menu slot="overlay"> + <a-menu-item + key="1" + @click="handleAddPre(true)" + ><a-icon type="smile" />鑷缓</a-menu-item> + <a-menu-item + key="2" + @click="handleAddPre(false)" + ><a-icon type="copy" />鍙傜収淇濅慨鏁呴殰鍗�</a-menu-item> + </a-menu> + <a-button + type="primary" + icon="plus" + >鏂板</a-button> + </a-dropdown> + <a-button + type="primary" + icon="plus" + @click="handleDispatch()" + :disabled="selectionRows.length==0" + v-if="false" + >娲惧伐</a-button> --> + <a-button + type="primary" + icon="plus" + @click="handleAddPre(true)" + >鏂板</a-button> + </div> + <!-- table鍖哄煙-begin --> + <div> + <!-- <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" + > + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a + style="margin-left: 24px" + @click="onClearSelected" + >娓呯┖</a> + </div> --> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + class="j-table-force-nowrap" + :scroll="{ x: 'calc(1900px + 50%)', y: 900 }" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + :customRow="clickThenSelect" + > + <!-- :rowSelection="rowSelection" --> + <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'" + 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'" + type="vertical" + /> + <a + v-if="record.auditStatus == 'notSubmitted' " + @click="handleEdit(record)" + >缂栬緫</a> + <a + v-if="record.auditStatus == 'pendingApproval'" + @click="handleApprove(record)" + >瀹℃壒</a> + <a-divider + v-if="record.auditStatus == 'notSubmitted' || record.auditStatus == 'pendingApproval'" + 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-item v-if="record.auditStatus == '3' || record.auditStatus == '4'"> + <a-popconfirm + v-if="record.auditStatus == '3' || record.auditStatus == '4'" + title="纭鎾ら攢鍚�?" + @confirm="() =>handleFinish(record, 'revoke')" + > + <a>鎾ら攢</a> + </a-popconfirm> + </a-menu-item> --> + </a-menu> + </a-dropdown> + </span> + + <!-- <span + slot="action" + slot-scope="text, record" + > + <span + v-if="record.auditStatus=='7'" + style="font-size: 12px;font-style: italic;" + >宸茬‘璁�</span> + <a-popconfirm + title="纭畾鎻愪氦鍚�?" + @confirm="() => handleReport(record)" + > + <a v-if="record.auditStatus=='0'">鎻愪氦</a> + </a-popconfirm> + <a-divider + type="vertical" + v-if="record.auditStatus=='0'" + /> + <a-popconfirm + title="纭畾鎾ゅ洖鍚�?" + @confirm="() => handleWithdraw(record)" + > + <a v-if="record.auditStatus=='4'">鎾ゅ洖</a> + </a-popconfirm> + <a-divider + type="vertical" + v-if="record.auditStatus=='4'" + /> + <a-popconfirm + title="纭鍚�?" + @confirm="() => handleConfirm(record)" + > + <a v-if="record.auditStatus=='4'">纭</a> + </a-popconfirm> + <a-divider + type="vertical" + v-if="record.auditStatus=='1'" + /> + <a + @click="handleEditPre(record)" + v-if="record.auditStatus=='0'" + >缂栬緫</a> + <a-divider + type="vertical" + v-if="record.auditStatus=='0'" + /> + <a-dropdown v-if="record.auditStatus=='0'"> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <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 + 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-tab-pane + tab="瀹為檯鐗╂枡" + key="2" + forceRender + > + <RepairOrderActualMaterialList :mainId="repairOrderActualMaterialMainId" /> + </a-tab-pane> + <a-tab-pane + tab="瀹為檯宸ユ椂" + key="3" + forceRender + > + <RepairOrderActualWorkHoursList :mainId="repairOrderActualWorkHoursMainId" /> + </a-tab-pane> + <a-tab-pane + tab="鏁呴殰鍒嗘瀽" + key="4" + forceRender + > + <RepairOrderFaultAnalysisList :mainId="repairOrderFaultAnalysisMainId" /> + </a-tab-pane> + </a-tabs> + <repairOrder-modal + ref="modalForm" + @ok="modalFormOk" + :isSelfCreate="isSelfCreate" + ></repairOrder-modal> + <approvel-modal + ref='approvalModalForm' + @ok='approvalModalFormOk' + @cancel='approvalModalFormOk' + @loadData = "loadData" + ></approvel-modal> + </a-card> +</template> +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction } from '@/api/manage' +import '@/assets/less/TableExpand.less' +import { putAction } from '../../api/manage' +import RepairOrderModal from './modules/repairorderfinished/RepairOrderFinishedReportModel' +import RepairOrderActualMaterialList from './repairOrderFinishedReport/RepairOrderActualMaterialReport.vue' +import RepairOrderActualWorkHoursList from './repairOrderFinishedReport/RepairOrderActualHoursReport' +import RepairOrderFaultAnalysisList from './repairOrderFinishedReport/RepairOrderFaultAnalysisReport.vue' +import RepairOrderDetailList from './repairOrderFinishedReport/RepairOrderDetailReport.vue' +import FaultDescriptionList from './FaultDescriptionList' +import ApprovelModal from './repairOrderFinishedReport/modules/ApprovelModal' +export default { + name: "RepairOrderFinishedReport", + mixins: [JeecgListMixin], + components: { + RepairOrderDetailList, + RepairOrderFaultAnalysisList, + RepairOrderActualMaterialList, + RepairOrderActualWorkHoursList, + RepairOrderModal, + FaultDescriptionList, + 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: 'auditStatusName' + }, + { + /*鍗曟嵁鍙�*/ + title: '鍗曟嵁鍙�', + align: "center", + dataIndex: 'num' + }, + { + title: '璁惧缂栫爜', + align: "center", + dataIndex: 'equipmentNum' + }, + { + title: '璁惧鍚嶇О', + align: "center", + dataIndex: 'equipmentName' + }, + { + title: '璁惧鍨嬪彿', + align: "center", + dataIndex: 'equipmentModel' + }, + { + /*璋冩暣瀛楁*/ + title: '浣跨敤閮ㄩ棬', + align: "center", + dataIndex: 'departName' + }, + { + title: '宸ユ椂瀹氶', + align: "center", + dataIndex: 'workingHourQuota' + }, + { + title: '鏁呴殰鎻忚堪', + align: "center", + dataIndex: 'faultDescription' + }, + { + title: '鏁呴殰鏃堕棿', + align: "center", + width: 150, + dataIndex: 'faultTime' + }, + /* { + title: '鏁呴殰鐓х墖', + align: "center", + dataIndex: 'photo', + scopedSlots: { customRender: 'imgSlot' } + },*/ + // { + // title: '鎶ヤ慨浜�', + // align: "center", + // dataIndex: 'reportUserName' + // }, + /* { + title: '鏄惁鍋滄満', + align: "center", + dataIndex: 'isStop_dictText' + },*/ + { + title: '缁翠繚鏂瑰紡', + align: "center", + dataIndex: 'maintenanceMethodName' + }, + + { + /*鏂板瀛楁闇�瑕佷慨鏀�*/ + title: '璐d换鐝粍', + align: "center", + width: 150, + dataIndex: 'teamName' + }, + { + /*鏂板瀛楁闇�瑕佷慨鏀�*/ + title: '璐d换浜�', + align: "center", + dataIndex: 'responsibilityName' + }, + { + /*鏂板瀛楁闇�瑕佷慨鏀�*/ + title: '瀹為檯宸ユ椂', + align: "center", + dataIndex: 'actualHour' + }, + { + /*鏂板瀛楁闇�瑕佷慨鏀�*/ + title: '瀹為檯寮�濮嬫椂闂�', + align: "center", + width: 150, + dataIndex: 'actualStartTime' + }, + { + /*鏂板瀛楁闇�瑕佷慨鏀�*/ + title: '瀹為檯瀹屾垚鏃堕棿', + align: "center", + width: 150, + dataIndex: 'actualEndTime' + }, + { + /*鏂板瀛楁闇�瑕佷慨鏀�*/ + title: '濮斿鍗曚綅', + align: "center", + dataIndex: 'outsourcingUnitName' + }, + + { + title: '鍒涘缓浜�', + align: "center", + dataIndex: 'createBy' + }, + { + title: '鍒涘缓鏃堕棿', + align: "center", + width: 150, + dataIndex: 'createTime' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: "center", + fixed: "right", + width: 200, + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/eam/reportAfterRepair/getReportAfterRepairList", + edit: "/eam/reportAfterRepair/edit", + delete: "/eam/reportAfterRepair/delete", + deleteBatch: "/eam/reportAfterRepair/deleteBatch", + exportXlsUrl: "/eam/reportAfterRepair/exportXls", + importExcelUrl: "/eam/reportAfterRepair/importExcel", + orderReport: "eam/repairOrder/report", + orderWithdraw: "eam/repairOrder/withdraw", + orderDispatch: "eam/repairOrder/dispatch", + orderReceive: "eam/repairOrder/receive", + orderStart: "eam/repairOrder/start", + orderConfirm: "eam/repairOrder/confirm" + }, + dictOptions: { + }, + /* 鍒嗛〉鍙傛暟 */ + 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: '', + // superFieldList: [], + repairOrderDetailMainId: '', + repairOrderRiskPreventionMainId: '', + repairOrderFaultAnalysisMainId: '', + repairOrderFaultAnalysis: {}, + repairOrderPlanMaterialMainId: '', + repairOrderActualMaterialMainId: '', + repairOrderActualWorkHoursMainId: '', + equipmentDocumentMainId: '', + isSelfCreate: true, + excuteRepairOrder: {}, + assignTaskList: [], + sonsAddStatus: false, + } + }, + // created() { + // this.getSuperFieldList(); + // }, + watch: { + selectionRows() { + this.$bus.$emit('repairOrderSelectionRows', this.selectionRows); + }, + }, + computed: { + importExcelUrl: function () { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + rowSelection() { + return { + type: 'checkbox', + onChange: (selectedRowKeys, selectedRows) => { + this.onSelectChange(selectedRowKeys, selectedRows); + }, + getCheckboxProps: record => ({ + props: { + }, + }), + selectedRowKeys: this.selectedRowKeys, + }; + }, + }, + methods: { + + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(","), [record]); + } + } + } + }, + onClearSelected() { + this.selectedRowKeys = []; + this.selectionRows = []; + this.selectedMainId = '' + this.repairOrderDetailMainId = '' + this.repairOrderRiskPreventionMainId = '' + this.repairOrderFaultAnalysisMainId = '' + this.repairOrderPlanMaterialMainId = '' + this.repairOrderActualMaterialMainId = '' + this.repairOrderActualWorkHoursMainId = '' + this.equipmentDocumentMainId = '' + this.repairOrderFaultAnalysis = {} + }, + onSelectChange(selectedRowKeys, selectionRows) { + if (selectedRowKeys.length == 1) { + this.selectedMainId = selectedRowKeys[0] + this.repairOrderDetailMainId = selectionRows[0]['id'] + this.repairOrderRiskPreventionMainId = selectionRows[0]['id'] + this.repairOrderFaultAnalysisMainId = selectionRows[0]['id'] + this.repairOrderFaultAnalysis = selectionRows[0] + console.log(this.repairOrderActualMaterial) + this.repairOrderPlanMaterialMainId = selectionRows[0]['id'] + this.repairOrderActualMaterialMainId = selectionRows[0]['id'] + this.repairOrderActualWorkHoursMainId = selectionRows[0]['id'] + this.equipmentDocumentMainId = selectionRows[0]['id'] + this.sonsAddStatus = (selectionRows[0]['status'] == '0' || selectionRows[0]['status'] == '1' || selectionRows[0]['status'] == '2') + this.$refs.FaultDescriptionList.faultId = selectedRowKeys[0] + } else { + this.$refs.FaultDescriptionList.faultId = '-1' + this.selectedMainId = '' + this.repairOrderDetailMainId = '' + this.repairOrderRiskPreventionMainId = '' + this.repairOrderFaultAnalysisMainId = '' + this.repairOrderPlanMaterialMainId = '' + this.repairOrderActualMaterialMainId = '' + this.repairOrderActualWorkHoursMainId = '' + this.equipmentDocumentMainId = '' + } + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows; + this.assignTaskList = []; + for (var i = 0; i < selectionRows.length; i++) { + if (selectionRows[i].status == '1') { + this.assignTaskList.push(selectionRows[i]); + } + } + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + this.onClearSelected() + //this.queryParam.repairOrderType = 1; + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + 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.$refs.FaultDescriptionList.faultId = '-1' + }) + }, + handleAddPre(isSelfCreate) { + this.isSelfCreate = isSelfCreate; + this.handleAdd(); + }, + handleEditPre(record) { + console.log(record); + if (record.reportRepairId == null && record.reportRepairId == undefined && record.reportRepairId == '') { + this.isSelfCreate = true; + } + else { + this.isSelfCreate = false; + } + this.handleEdit(record); + }, + //宸ュ崟娴佺▼鎿嶄綔 + handleCommit(record, type) { + type == 'commit' ? record.auditStatus = 'pendingApproval' : record.auditStatus = 'notSubmitted' + 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); + } + }) + }, + handleApprove: function (record) { + let edit + edit = this.url.edit + this.$refs.approvalModalForm.showModals(record, edit, 'Approved', 'Rejected') + this.$refs.approvalModalForm.title = '瀹℃壒' + this.$refs.approvalModalForm.disableSubmit = false + + }, + handleDispatch() { + if (this.assignTaskList.length == 0) { + this.$message.warn('鎵�閫夊伐鍗曟棤闇�娲惧伐'); + } else { + this.$refs.RepairOrderAssignModal.visible = true + this.$refs.RepairOrderAssignModal.title = '缁翠慨宸ュ崟娲惧伐' + this.$refs.RepairOrderAssignModal.selectionRows + this.$refs.RepairOrderAssignModal.handleShow() + } + }, + handleWithdraw(record) { + putAction(this.url.orderWithdraw, record).then(res => { + if (res.result) { + this.$message.success('鎾ら攢鎴愬姛'); + this.loadData(); + } else { + this.$message.error('鎾ら攢鍑虹幇寮傚父') + } + }) + }, + handleConfirm(record) { + putAction(this.url.orderConfirm, record).then(res => { + if (res.result) { + this.$message.success('纭鎴愬姛'); + this.loadData(); + } else { + this.$message.error('纭鍑虹幇寮傚父') + } + }) + }, + + searchQuery() { + this.loadData(1) + this.selectedRowKeys = [] + this.selectionRows = [] + 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> \ No newline at end of file -- Gitblit v1.9.3