feat: 新增产线维度数据隔离与异常挂接功能
1. 新增全局产线常量配置,统一设置当前产线为双机架 2. 为设备点检、换辊、轧辊管理等接口添加产线过滤逻辑 3. 新增异常记录挂接与撤回功能,完善异常管理流程 4. 重构生产指标、报表接口路径与参数命名 5. 为设备检查表新增产线字段并优化查询逻辑 6. 优化点检页面UI交互与空状态提示
This commit is contained in:
@@ -44,10 +44,25 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="editable">
|
||||
<el-table-column label="挂接状态" align="center" width="100" v-if="showBindActions">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<template v-if="getRelationStatus(scope.row.abnormalId) === 1">
|
||||
<el-tag type="success">已挂接</el-tag>
|
||||
</template>
|
||||
<template v-else-if="getRelationStatus(scope.row.abnormalId) === 2">
|
||||
<el-tag type="info">已撤回</el-tag>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-tag type="warning">未挂接</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="editable || showBindActions">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="editable" size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button v-if="editable" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button v-if="showBindActions && getRelationStatus(scope.row.abnormalId) !== 1" size="mini" type="text" icon="el-icon-upload2" @click="handleBind(scope.row)" v-hasPermi="['mill:relation:bind']">挂接</el-button>
|
||||
<el-button v-if="showBindActions && getRelationStatus(scope.row.abnormalId) === 1" size="mini" type="text" icon="el-icon-refresh-left" style="color: #f56c6c;" @click="handleWithdraw(scope.row)" v-hasPermi="['mill:relation:withdraw']">撤回</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -71,6 +86,14 @@ export default {
|
||||
coilInfo: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
showBindActions: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
relationMap: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
dicts: ['coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree'],
|
||||
@@ -85,6 +108,16 @@ export default {
|
||||
this.$emit('update', row);
|
||||
}
|
||||
},
|
||||
getRelationStatus(abnormalId) {
|
||||
const rel = this.relationMap[abnormalId];
|
||||
return rel ? rel.bindStatus : 0;
|
||||
},
|
||||
handleBind(row) {
|
||||
this.$emit('bind', row);
|
||||
},
|
||||
handleWithdraw(row) {
|
||||
this.$emit('withdraw', row);
|
||||
},
|
||||
// 计算目标列的异常挂载时机
|
||||
// 如果coilInfo.coilId存在,且与row.coilId相同,
|
||||
// 判断钢卷的createBy和row.createBy是否相同
|
||||
|
||||
@@ -168,8 +168,12 @@
|
||||
:list="abnormalList"
|
||||
:editable="true"
|
||||
:showCoil="false"
|
||||
:showBindActions="true"
|
||||
:relationMap="relationMap"
|
||||
@update="handleAbnormalUpdate"
|
||||
@delete="handleAbnormalDelete"
|
||||
@bind="handleBind"
|
||||
@withdraw="handleWithdraw"
|
||||
/>
|
||||
</el-card>
|
||||
<el-card shadow="never" v-else>
|
||||
@@ -191,12 +195,25 @@
|
||||
<el-button @click="abnormalOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="撤回确认" :visible.sync="withdrawOpen" width="500px" append-to-body @closed="handleWithdrawDialogClosed">
|
||||
<el-form :model="{ remark: withdrawRemark }" label-width="80px">
|
||||
<el-form-item label="撤回原因">
|
||||
<el-input v-model="withdrawRemark" type="textarea" :rows="3" placeholder="请输入撤回原因" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitWithdraw">确 定</el-button>
|
||||
<el-button @click="withdrawOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listActual } from "@/api/mill/actual";
|
||||
import { listCoilAbnormal, addCoilAbnormal, updateCoilAbnormal, delCoilAbnormal } from "@/api/mill/coilAbnormal";
|
||||
import { listRelation, bindRelation, withdrawRelation } from "@/api/mill/coilAbnormalRelation";
|
||||
import AbnormalTable from "./components/AbnormalTable";
|
||||
import AbnormalForm from "./components/AbnormalForm";
|
||||
import ExceptionManager from "./components/ExceptionManager";
|
||||
@@ -216,6 +233,7 @@ export default {
|
||||
actualList: [],
|
||||
currentRow: null,
|
||||
abnormalList: [],
|
||||
relationMap: {},
|
||||
abnormalOpen: false,
|
||||
abnormalTitle: "",
|
||||
abnormalFormData: {},
|
||||
@@ -223,6 +241,9 @@ export default {
|
||||
exceptionTitle: "",
|
||||
exceptionCoilNo: "",
|
||||
exceptionRowData: null,
|
||||
withdrawOpen: false,
|
||||
withdrawRow: null,
|
||||
withdrawRemark: "",
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -301,10 +322,27 @@ export default {
|
||||
loadAbnormalList() {
|
||||
if (!this.currentRow || !this.currentRow.exitMatId) {
|
||||
this.abnormalList = [];
|
||||
this.relationMap = {};
|
||||
return;
|
||||
}
|
||||
listCoilAbnormal({ currentCoilNo: this.currentRow.exitMatId }).then(response => {
|
||||
this.abnormalList = response.rows || [];
|
||||
this.loadRelationMap();
|
||||
});
|
||||
},
|
||||
loadRelationMap() {
|
||||
if (!this.currentRow || !this.currentRow.exitMatId) {
|
||||
this.relationMap = {};
|
||||
return;
|
||||
}
|
||||
listRelation({ currentCoilNo: this.currentRow.exitMatId }).then(response => {
|
||||
const map = {};
|
||||
(response.rows || []).forEach(rel => {
|
||||
if (rel.secondAbnormalId) {
|
||||
map[rel.secondAbnormalId] = rel;
|
||||
}
|
||||
});
|
||||
this.relationMap = map;
|
||||
});
|
||||
},
|
||||
handleAbnormalAdd() {
|
||||
@@ -366,6 +404,36 @@ export default {
|
||||
if (this.$refs.abnormalFormRef && this.$refs.abnormalFormRef.resetFields) {
|
||||
this.$refs.abnormalFormRef.resetFields();
|
||||
}
|
||||
},
|
||||
handleBind(row) {
|
||||
this.$modal.confirm('确认将该异常记录挂接到三级异常表吗?').then(() => {
|
||||
return bindRelation(row.abnormalId);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("挂接成功");
|
||||
this.loadRelationMap();
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleWithdraw(row) {
|
||||
const rel = this.relationMap[row.abnormalId];
|
||||
if (!rel || !rel.relationId) {
|
||||
this.$modal.msgError("未找到挂接记录");
|
||||
return;
|
||||
}
|
||||
this.withdrawRow = rel;
|
||||
this.withdrawRemark = "";
|
||||
this.withdrawOpen = true;
|
||||
},
|
||||
submitWithdraw() {
|
||||
if (!this.withdrawRow) return;
|
||||
withdrawRelation(this.withdrawRow.relationId, { operateRemark: this.withdrawRemark }).then(() => {
|
||||
this.$modal.msgSuccess("撤回成功");
|
||||
this.withdrawOpen = false;
|
||||
this.loadRelationMap();
|
||||
});
|
||||
},
|
||||
handleWithdrawDialogClosed() {
|
||||
this.withdrawRow = null;
|
||||
this.withdrawRemark = "";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
</el-row>
|
||||
|
||||
<div v-loading="partLoading" style="flex: 1; overflow-y: auto; overflow-x: hidden;">
|
||||
<template v-if="!partLoading && equipmentPartList.length === 0">
|
||||
<el-empty description="暂无点检部位数据" />
|
||||
</template>
|
||||
<div v-for="item in equipmentPartList" :key="item.partId" class="part-card"
|
||||
:class="{ 'part-card-selected': isCurrentPart(item) }" @click="handlePartRowClick(item)">
|
||||
<el-checkbox :value="!!partCheckedMap[item.partId]" @click.stop @change="togglePartSelect(item)"
|
||||
@@ -69,13 +72,6 @@
|
||||
<el-input v-model="checklistQueryParams.checkNo" placeholder="请输入检验编号" clearable
|
||||
@keyup.enter.native="handleChecklistQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验部位" prop="partId">
|
||||
<el-select v-model="checklistQueryParams.partId" placeholder="请选择检验部位" clearable size="mini"
|
||||
@change="handleChecklistQuery" style="width: 150px;">
|
||||
<el-option v-for="item in equipmentPartList" :key="item.partId" :label="item.inspectPart"
|
||||
:value="item.partId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" prop="equipmentState">
|
||||
<el-select v-model="checklistQueryParams.equipmentState" placeholder="请选择设备状态" clearable
|
||||
@change="handleChecklistQuery" style="width: 150px;">
|
||||
@@ -97,28 +93,35 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div v-loading="checklistLoading" style="flex: 1; overflow: hidden;">
|
||||
<el-table :data="equipmentChecklistList" height="calc(100% - 20px)"
|
||||
@selection-change="handleChecklistSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="检验编号" align="center" prop="checkNo" />
|
||||
<el-table-column label="设备部件名称" align="center" prop="partName" width="120" />
|
||||
<el-table-column label="检验内容" align="center" prop="checkContent" show-overflow-tooltip />
|
||||
<el-table-column label="设备状态" align="center" prop="equipmentState" />
|
||||
<el-table-column label="检验标准" align="center" prop="checkStandard" show-overflow-tooltip />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-document-copy"
|
||||
@click.stop="handleChecklistCopy(scope.row)">
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit"
|
||||
@click.stop="handleChecklistUpdate(scope.row)"></el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete"
|
||||
@click.stop="handleChecklistDelete(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="flex: 1; overflow: hidden;">
|
||||
<template v-if="!currentPartId">
|
||||
<el-empty description="请在左侧选择点检部位" style="height: 100%;" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-loading="checklistLoading" style="height: 100%;">
|
||||
<el-table :data="equipmentChecklistList" height="calc(100% - 20px)"
|
||||
@selection-change="handleChecklistSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="检验编号" align="center" prop="checkNo" />
|
||||
<el-table-column label="设备部件名称" align="center" prop="partName" width="120" />
|
||||
<el-table-column label="检验内容" align="center" prop="checkContent" show-overflow-tooltip />
|
||||
<el-table-column label="设备状态" align="center" prop="equipmentState" />
|
||||
<el-table-column label="检验标准" align="center" prop="checkStandard" show-overflow-tooltip />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-document-copy"
|
||||
@click.stop="handleChecklistCopy(scope.row)">
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit"
|
||||
@click.stop="handleChecklistUpdate(scope.row)"></el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete"
|
||||
@click.stop="handleChecklistDelete(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- <pagination v-show="checklistTotal > 0" :total="checklistTotal" :page.sync="checklistQueryParams.pageNum"
|
||||
@@ -276,7 +279,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getPartList();
|
||||
this.getChecklistList();
|
||||
},
|
||||
methods: {
|
||||
// ========== Part (Left) ==========
|
||||
|
||||
Reference in New Issue
Block a user