Merge remote-tracking branch 'origin/master'
commit
cd41aed13d
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询成品下线异常记录列表
|
||||||
|
export function listRecordException(query) {
|
||||||
|
return request({
|
||||||
|
url: '/report/recordException/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询成品下线异常记录详细
|
||||||
|
export function getRecordException(objId) {
|
||||||
|
return request({
|
||||||
|
url: '/report/recordException/' + objId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增成品下线异常记录
|
||||||
|
export function addRecordException(data) {
|
||||||
|
return request({
|
||||||
|
url: '/report/recordException',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改成品下线异常记录
|
||||||
|
export function updateRecordException(data) {
|
||||||
|
return request({
|
||||||
|
url: '/report/recordException',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除成品下线异常记录
|
||||||
|
export function delRecordException(objId) {
|
||||||
|
return request({
|
||||||
|
url: '/report/recordException/' + objId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -0,0 +1,335 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="5" :xs="24">
|
||||||
|
<div class="head-container">
|
||||||
|
<el-input
|
||||||
|
v-model="workUnitName"
|
||||||
|
placeholder="请输入统计单元名称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
prefix-icon="el-icon-search"
|
||||||
|
style="margin-bottom: 20px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-tree
|
||||||
|
:data="workUnitOptions"
|
||||||
|
:props="workUnitProps"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
ref="tree"
|
||||||
|
node-key="id"
|
||||||
|
default-expand-all
|
||||||
|
highlight-current
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="19" :xs="24">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||||
|
label-width="100px">
|
||||||
|
<el-form-item label="日期类型" prop="dateType">
|
||||||
|
<el-select v-model="queryParams.dateType" placeholder="请选择日期类型">
|
||||||
|
<el-option
|
||||||
|
v-for="item in dateTypeList"
|
||||||
|
:key="item.dateTypeCode"
|
||||||
|
:label="item.dateTypeName"
|
||||||
|
:value="item.dateTypeCode"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="采集日期">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="daterangeCollectTime"
|
||||||
|
style="width: 240px"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
>导出
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="monitorWorkUnitList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
|
<el-table-column label="主键标识" align="center" prop="objId" v-if="columns[0].visible" />
|
||||||
|
<el-table-column label="统计单元编号" align="center" prop="workUnitCode" v-if="columns[1].visible" />
|
||||||
|
<el-table-column label="统计单元名称" align="center" prop="workUnitName" v-if="columns[2].visible" />
|
||||||
|
<el-table-column label="耗量(kwh)" align="center" prop="expend" v-if="columns[3].visible" />
|
||||||
|
<el-table-column label="开始日期" align="center" prop="beginTime" v-if="columns[4].visible" />
|
||||||
|
<el-table-column label="结束日期" align="center" prop="endTime" v-if="columns[5].visible" />
|
||||||
|
<el-table-column label="仪表值(kwh)" align="center" prop="instrumentValue" v-if="columns[6].visible" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import {getWorkUnitTrees} from '@//api/base/workUnit'
|
||||||
|
import {listMonitorInfo} from '@//api/base/monitorInfo'
|
||||||
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import { energyStatisticalReportList } from '@//api/report/DayDnb'
|
||||||
|
import { parseTime } from '@//utils/ruoyi'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "EnergyStatisticalReport",
|
||||||
|
components: {
|
||||||
|
Treeselect
|
||||||
|
}, data() {
|
||||||
|
return {
|
||||||
|
monitorInfoOptions: [],
|
||||||
|
workUnitOptions: [],
|
||||||
|
workUnitName: undefined,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 统计计量信息表格数据
|
||||||
|
monitorWorkUnitList: [],
|
||||||
|
daterangeCollectTime: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
monitorCode: null,
|
||||||
|
workUnitCode: null,
|
||||||
|
monitorStatus: null,
|
||||||
|
monitorType: null,
|
||||||
|
dateType: 10,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
workUnitProps: {
|
||||||
|
children: "children",
|
||||||
|
label: "label"
|
||||||
|
},
|
||||||
|
dateTypeList: [
|
||||||
|
{dateTypeCode: 19, dateTypeName: '时'},
|
||||||
|
{dateTypeCode: 10, dateTypeName: '日'},
|
||||||
|
{dateTypeCode: 7, dateTypeName: '月'},
|
||||||
|
{dateTypeCode: 4, dateTypeName: '年'},
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{key: 0, label: `主键标识`, visible: false},
|
||||||
|
{key: 1, label: `统计单元编号`, visible: true},
|
||||||
|
{key: 2, label: `统计单元名称`, visible: true},
|
||||||
|
{key: 3, label: `耗量(kwh)`, visible: true},
|
||||||
|
{key: 4, label: `开始日期`, visible: true},
|
||||||
|
{key: 5, label: `结束日期`, visible: true},
|
||||||
|
{key: 6, label: `仪表值(kwh)`, visible: true}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
const nowDate = parseTime(new Date(), '{y}-{m}-{d}')
|
||||||
|
this.daterangeCollectTime[0] = nowDate
|
||||||
|
this.daterangeCollectTime[1] = nowDate
|
||||||
|
this.getList();
|
||||||
|
this.getTreeselect();
|
||||||
|
this.getDeptTrees();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// 根据名称筛选部门树
|
||||||
|
workUnitName(val) {
|
||||||
|
this.$refs.tree.filter(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询计量设备信息下拉树结构 */
|
||||||
|
getTreeselect() {
|
||||||
|
listMonitorInfo().then(response => {
|
||||||
|
this.monitorInfoOptions = [];
|
||||||
|
this.monitorInfoOptions = this.handleTree(response.data, "objId", "parentId");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 转换计量设备信息数据结构 */
|
||||||
|
normalizer(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id: node.monitorCode,
|
||||||
|
label: node.monitorName,
|
||||||
|
children: node.children
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/** 转换统计单元信息数据结构 */
|
||||||
|
workUnitOptionsNormalizer(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id2: node.workUnitCode,
|
||||||
|
label2: node.workUnitName,
|
||||||
|
children2: node.children
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/** 查询计量设备下拉树结构 */
|
||||||
|
getDeptTrees() {
|
||||||
|
getWorkUnitTrees().then(response => {
|
||||||
|
this.workUnitOptions = [];
|
||||||
|
this.workUnitOptions = JSON.parse(JSON.stringify(response.data).replaceAll('id','id2').replaceAll('code','id'));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 筛选节点
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.label.indexOf(value) !== -1;
|
||||||
|
},
|
||||||
|
// 节点单击事件
|
||||||
|
handleNodeClick(data) {
|
||||||
|
this.queryParams.workUnitCode = data.id;
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 查询统计计量信息列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
// this.queryParams = {};
|
||||||
|
if (null != this.daterangeCollectTime && '' != this.daterangeCollectTime) {
|
||||||
|
this.queryParams.beginCollectTime = this.daterangeCollectTime[0];
|
||||||
|
this.queryParams.endCollectTime = this.daterangeCollectTime[1];
|
||||||
|
}
|
||||||
|
energyStatisticalReportList(this.queryParams).then(response => {
|
||||||
|
this.monitorWorkUnitList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
parentIds: null,
|
||||||
|
parentId: null,
|
||||||
|
objId: null,
|
||||||
|
monitorCode: null,
|
||||||
|
workUnitCode: null,
|
||||||
|
monitorStatus: 0,
|
||||||
|
monitorType: 1,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.queryParams.workUnitCode = null;
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.objId)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.getTreeselect();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加统计计量信息";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const objId = row.objId || this.ids
|
||||||
|
getMonitorWorkUnit(objId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改统计计量信息";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.objId != null) {
|
||||||
|
updateMonitorWorkUnit(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addMonitorWorkUnit(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const objIds = row.objId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除统计计量信息编号为"' + objIds + '"的数据项?').then(function () {
|
||||||
|
return delMonitorWorkUnit(objIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('report/DayDnb/energyStatisticalReportList/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `统计能耗报表_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@ -0,0 +1,333 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||||
|
<el-form-item label="产线" prop="productLineCode">
|
||||||
|
<el-select v-model="queryParams.productLineCode" placeholder="请选择产线">
|
||||||
|
<el-option
|
||||||
|
v-for="item in productLineList"
|
||||||
|
:key="item.productLineCode"
|
||||||
|
:label="item.productLineName"
|
||||||
|
:value="item.productLineCode"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="异常类型" prop="exceptionType">
|
||||||
|
<el-select v-model="queryParams.exceptionType" placeholder="请选择异常类型" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.exception_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="MES条码" prop="boxCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.boxCode"
|
||||||
|
placeholder="请输入MES条码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品条码" prop="productSncode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.productSncode"
|
||||||
|
placeholder="请输入产品条码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="扫描时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="daterangeProductScantime"
|
||||||
|
style="width: 340px"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
type="datetimerange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<!-- <el-col :span="1.5">-->
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- type="primary"-->
|
||||||
|
<!-- plain-->
|
||||||
|
<!-- icon="el-icon-plus"-->
|
||||||
|
<!-- size="mini"-->
|
||||||
|
<!-- @click="handleAdd"-->
|
||||||
|
<!-- v-hasPermi="['report:recordException:add']"-->
|
||||||
|
<!-- >新增-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!-- <el-col :span="1.5">-->
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- type="success"-->
|
||||||
|
<!-- plain-->
|
||||||
|
<!-- icon="el-icon-edit"-->
|
||||||
|
<!-- size="mini"-->
|
||||||
|
<!-- :disabled="single"-->
|
||||||
|
<!-- @click="handleUpdate"-->
|
||||||
|
<!-- v-hasPermi="['report:recordException:edit']"-->
|
||||||
|
<!-- >修改-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!-- <el-col :span="1.5">-->
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- type="danger"-->
|
||||||
|
<!-- plain-->
|
||||||
|
<!-- icon="el-icon-delete"-->
|
||||||
|
<!-- size="mini"-->
|
||||||
|
<!-- :disabled="multiple"-->
|
||||||
|
<!-- @click="handleDelete"-->
|
||||||
|
<!-- v-hasPermi="['report:recordException:remove']"-->
|
||||||
|
<!-- >删除-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['report:recordException:export']"
|
||||||
|
>导出
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="recordExceptionList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
|
<el-table-column label="主键标识" align="center" prop="objId" v-if="columns[0].visible"/>
|
||||||
|
<el-table-column label="MES条码" align="center" prop="boxCode" v-if="columns[6].visible" width="190"/>
|
||||||
|
<el-table-column label="产品条码" align="center" prop="productSncode" v-if="columns[1].visible" width="190"/>
|
||||||
|
<el-table-column label="异常类型" align="center" prop="exceptionType" v-if="columns[5].visible" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.exception_type" :value="scope.row.exceptionType"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="异常信息" align="center" prop="exceptionMsg" v-if="columns[2].visible"/>
|
||||||
|
<el-table-column label="扫描时间" align="center" prop="productScantime" width="180" v-if="columns[3].visible">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.productScantime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产线编号" align="center" prop="productLineCode" v-if="columns[4].visible"/>
|
||||||
|
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- size="mini"-->
|
||||||
|
<!-- type="text"-->
|
||||||
|
<!-- icon="el-icon-edit"-->
|
||||||
|
<!-- @click="handleUpdate(scope.row)"-->
|
||||||
|
<!-- v-hasPermi="['report:recordException:edit']"-->
|
||||||
|
<!-- >修改-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- size="mini"-->
|
||||||
|
<!-- type="text"-->
|
||||||
|
<!-- icon="el-icon-delete"-->
|
||||||
|
<!-- @click="handleDelete(scope.row)"-->
|
||||||
|
<!-- v-hasPermi="['report:recordException:remove']"-->
|
||||||
|
<!-- >删除-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
listRecordException,
|
||||||
|
getRecordException,
|
||||||
|
delRecordException,
|
||||||
|
addRecordException,
|
||||||
|
updateRecordException
|
||||||
|
} from '@/api/report/recordException'
|
||||||
|
import { findProductLineList } from '@//api/base/productLine'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'RecordException',
|
||||||
|
dicts: ['exception_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 成品下线异常记录表格数据
|
||||||
|
recordExceptionList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// MES条码时间范围
|
||||||
|
daterangeProductScantime: [],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
productSncode: null,
|
||||||
|
exceptionMsg: null,
|
||||||
|
productScantime: null,
|
||||||
|
productLineCode: 'CX_02',
|
||||||
|
exceptionType: '1',
|
||||||
|
boxCode: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {},
|
||||||
|
columns: [
|
||||||
|
{ key: 0, label: `主键标识`, visible: false },
|
||||||
|
{ key: 1, label: `产品条码`, visible: true },
|
||||||
|
{ key: 2, label: `异常信息`, visible: true },
|
||||||
|
{ key: 3, label: `扫描时间`, visible: true },
|
||||||
|
{ key: 4, label: `产线编号`, visible: false },
|
||||||
|
{ key: 5, label: `异常类型`, visible: true },
|
||||||
|
{ key: 6, label: `MES条码`, visible: true }
|
||||||
|
],
|
||||||
|
// 产线选项
|
||||||
|
productLineList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
findProductLineList({ productLineType: 1 }).then(response => {
|
||||||
|
this.productLineList = response.data
|
||||||
|
})
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询成品下线异常记录列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
this.queryParams.params = {}
|
||||||
|
if (null != this.daterangeProductScantime && '' != this.daterangeProductScantime) {
|
||||||
|
this.queryParams.params['beginProductScantime'] = this.daterangeProductScantime[0]
|
||||||
|
this.queryParams.params['endProductScantime'] = this.daterangeProductScantime[1]
|
||||||
|
}
|
||||||
|
listRecordException(this.queryParams).then(response => {
|
||||||
|
this.recordExceptionList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
objId: null,
|
||||||
|
productSncode: null,
|
||||||
|
exceptionMsg: null,
|
||||||
|
productScantime: null,
|
||||||
|
productLineCode: null,
|
||||||
|
exceptionType: null,
|
||||||
|
boxCode: null
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.daterangeProductScantime = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.objId)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = '添加成品下线异常记录'
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const objId = row.objId || this.ids
|
||||||
|
getRecordException(objId).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改成品下线异常记录'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.objId != null) {
|
||||||
|
updateRecordException(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess('修改成功')
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addRecordException(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess('新增成功')
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const objIds = row.objId || this.ids
|
||||||
|
this.$modal.confirm('是否确认删除成品下线异常记录编号为"' + objIds + '"的数据项?').then(function() {
|
||||||
|
return delRecordException(objIds)
|
||||||
|
}).then(() => {
|
||||||
|
this.getList()
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
}).catch(() => {
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('report/recordException/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `recordException_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue