feat(mes/eqp/check): 替换字典选型为动态产线下拉选单
1. 统一替换页面中原有的dict-select为通过接口获取的动态产线列表 2. 新增产线默认选中酸轧线的逻辑 3. 修复产线参数传递不匹配的问题,同步前后端参数字段
This commit is contained in:
@@ -8,8 +8,9 @@
|
||||
@change="handleQuery" style="width: 260px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产线">
|
||||
<dict-select v-model="productionLine" dict-type="sys_lines" placeholder="请选择产线"
|
||||
clearable @change="handleQuery" style="width: 150px;" />
|
||||
<el-select v-model="productionLine" placeholder="请选择产线" clearable @change="handleQuery" style="width: 150px;">
|
||||
<el-option v-for="item in lineList" :key="item.lineId" :label="item.lineName" :value="item.lineId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
@@ -105,15 +106,16 @@
|
||||
<script>
|
||||
import { listEquipmentPart } from "@/api/mes/eqp/equipmentPart";
|
||||
import { listEquipmentInspectionRecord } from "@/api/mes/eqp/equipmentInspectionRecord";
|
||||
import { listProductionLine } from "@/api/wms/productionLine";
|
||||
|
||||
export default {
|
||||
name: "DailyInspectionReport",
|
||||
dicts: ['sys_lines'],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dateRange: [this.getToday(), this.getToday()],
|
||||
productionLine: '酸轧线',
|
||||
productionLine: 2,
|
||||
lineList: [],
|
||||
partList: [],
|
||||
records: [],
|
||||
};
|
||||
@@ -125,6 +127,10 @@ export default {
|
||||
partName: cl.partName || p.inspectPart,
|
||||
})));
|
||||
},
|
||||
selectedLineName() {
|
||||
const found = this.lineList.find(l => l.lineId === this.productionLine);
|
||||
return found ? found.lineName : '';
|
||||
},
|
||||
tableData() {
|
||||
const recordMap = {};
|
||||
this.records.forEach(r => {
|
||||
@@ -227,13 +233,14 @@ export default {
|
||||
this.loading = true;
|
||||
try {
|
||||
const partParams = {};
|
||||
if (this.productionLine) partParams.productionLine = this.productionLine;
|
||||
const productionLine = this.productionLine;
|
||||
if (productionLine) partParams.productionLine = productionLine;
|
||||
const recordParams = {
|
||||
startInspectTime: this.dateRange[0] + ' 00:00:00',
|
||||
endInspectTime: this.dateRange[1] + ' 23:59:59',
|
||||
pageSize: 9999,
|
||||
};
|
||||
if (this.productionLine) recordParams.productionLine = this.productionLine;
|
||||
if (productionLine) recordParams.productionLine = productionLine;
|
||||
const [partRes, recordRes] = await Promise.all([
|
||||
listEquipmentPart(partParams),
|
||||
listEquipmentInspectionRecord(recordParams),
|
||||
@@ -246,9 +253,20 @@ export default {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
async loadLineList() {
|
||||
try {
|
||||
const res = await listProductionLine({ pageSize: 999 });
|
||||
if (res.rows) this.lineList = res.rows;
|
||||
if (this.lineList.length > 0) {
|
||||
const suanYa = this.lineList.find(l => l.lineName === '酸轧线');
|
||||
this.productionLine = suanYa ? suanYa.lineId : this.lineList[0].lineId;
|
||||
}
|
||||
this.handleQuery();
|
||||
} catch (e) { console.error('加载产线列表失败', e); }
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.handleQuery();
|
||||
this.loadLineList();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user