Compare commits
No commits in common. "count_1" and "main" have entirely different histories.
@ -50,7 +50,6 @@
|
|||||||
"jsencrypt": "3.0.0-rc.1",
|
"jsencrypt": "3.0.0-rc.1",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"quill": "1.3.7",
|
"quill": "1.3.7",
|
||||||
"sass": "^1.32.0",
|
|
||||||
"screenfull": "5.0.2",
|
"screenfull": "5.0.2",
|
||||||
"sortablejs": "1.10.2",
|
"sortablejs": "1.10.2",
|
||||||
"vue": "2.6.12",
|
"vue": "2.6.12",
|
||||||
@ -72,6 +71,7 @@
|
|||||||
"eslint-plugin-vue": "7.2.0",
|
"eslint-plugin-vue": "7.2.0",
|
||||||
"lint-staged": "10.5.3",
|
"lint-staged": "10.5.3",
|
||||||
"runjs": "4.4.2",
|
"runjs": "4.4.2",
|
||||||
|
"sass": "3.32.0",
|
||||||
"sass-loader": "10.1.0",
|
"sass-loader": "10.1.0",
|
||||||
"script-ext-html-webpack-plugin": "2.1.5",
|
"script-ext-html-webpack-plugin": "2.1.5",
|
||||||
"svg-sprite-loader": "5.1.1",
|
"svg-sprite-loader": "5.1.1",
|
||||||
|
|||||||
@ -1,53 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询能效检测点列表
|
|
||||||
export function listCheckpoint(query) {
|
|
||||||
return request({
|
|
||||||
url: '/footprint/checkpoint/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询能效检测点详细
|
|
||||||
export function getCheckpoint(id) {
|
|
||||||
return request({
|
|
||||||
url: '/footprint/checkpoint/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增能效检测点
|
|
||||||
export function addCheckpoint(data) {
|
|
||||||
return request({
|
|
||||||
url: '/footprint/checkpoint',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改能效检测点
|
|
||||||
export function updateCheckpoint(data) {
|
|
||||||
return request({
|
|
||||||
url: '/footprint/checkpoint',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除能效检测点
|
|
||||||
export function delCheckpoint(id) {
|
|
||||||
return request({
|
|
||||||
url: '/footprint/checkpoint/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出能效检测点
|
|
||||||
export function exportCheckpoint(query) {
|
|
||||||
return request({
|
|
||||||
url: '/footprint/checkpoint/export',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询设备信息列表
|
|
||||||
export function listEquipmentInfo(query) {
|
|
||||||
return request({
|
|
||||||
url: '/baseInfo/equipmentInfo/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询设备信息详细
|
|
||||||
export function getEquipmentInfo(id) {
|
|
||||||
return request({
|
|
||||||
url: '/baseInfo/equipmentInfo/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增设备信息
|
|
||||||
export function addEquipmentInfo(data) {
|
|
||||||
return request({
|
|
||||||
url: '/baseInfo/equipmentInfo',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改设备信息
|
|
||||||
export function updateEquipmentInfo(data) {
|
|
||||||
return request({
|
|
||||||
url: '/baseInfo/equipmentInfo',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除设备信息
|
|
||||||
export function delEquipmentInfo(id) {
|
|
||||||
return request({
|
|
||||||
url: '/baseInfo/equipmentInfo/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出设备信息
|
|
||||||
export function exportEquipmentInfo(query) {
|
|
||||||
return request({
|
|
||||||
url: '/baseInfo/equipmentInfo/export',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询工厂建模列表
|
|
||||||
export function listModel(query) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/model/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询工厂建模详细
|
|
||||||
export function getModel(id) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/model/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增工厂建模
|
|
||||||
export function addModel(data) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/model',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改工厂建模
|
|
||||||
export function updateModel(data) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/model',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除工厂建模
|
|
||||||
export function delModel(id) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/model/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出工厂建模
|
|
||||||
export function exportModel(query) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/model/export',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询项目维护列表
|
|
||||||
export function listProject(query) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/project/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询项目维护详细
|
|
||||||
export function getProject(id) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/project/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增项目维护
|
|
||||||
export function addProject(data) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/project',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改项目维护
|
|
||||||
export function updateProject(data) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/project',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除项目维护
|
|
||||||
export function delProject(id) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/project/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出项目维护
|
|
||||||
export function exportProject(query) {
|
|
||||||
return request({
|
|
||||||
url: '/mes/project/export',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询工艺建模列表
|
|
||||||
export function listProcessModel(query) {
|
|
||||||
return request({
|
|
||||||
url: '/mesModel/processModel/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询工艺建模详细
|
|
||||||
export function getProcessModel(id) {
|
|
||||||
return request({
|
|
||||||
url: '/mesModel/processModel/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增工艺建模
|
|
||||||
export function addProcessModel(data) {
|
|
||||||
return request({
|
|
||||||
url: '/mesModel/processModel',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改工艺建模
|
|
||||||
export function updateProcessModel(data) {
|
|
||||||
return request({
|
|
||||||
url: '/mesModel/processModel',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除工艺建模
|
|
||||||
export function delProcessModel(id) {
|
|
||||||
return request({
|
|
||||||
url: '/mesModel/processModel/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出工艺建模
|
|
||||||
export function exportProcessModel(query) {
|
|
||||||
return request({
|
|
||||||
url: '/mesModel/processModel/export',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,364 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="项目名" prop="name">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.name"
|
|
||||||
placeholder="请输入项目名"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="负责人" prop="leader">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.leader"
|
|
||||||
placeholder="请输入负责人"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="开始日期" prop="startDate">
|
|
||||||
<el-date-picker clearable size="small"
|
|
||||||
v-model="queryParams.startDate"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择开始日期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结束日期" prop="endDate">
|
|
||||||
<el-date-picker clearable size="small"
|
|
||||||
v-model="queryParams.endDate"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择结束日期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="项目状态" prop="status">
|
|
||||||
<el-select v-model="queryParams.status" placeholder="请选择项目状态" clearable filterable size="small">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in statusOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</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="['mes:project: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="['mes:project: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="['mes:project: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="['mes:project:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
|
||||||
<el-table-column label="项目名" align="center" prop="name" />
|
|
||||||
<el-table-column label="负责人" align="center" prop="leader" />
|
|
||||||
<el-table-column label="开始日期" align="center" prop="startDate" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="结束日期" align="center" prop="endDate" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="项目介绍" align="center" prop="description">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div v-html='scope.row.description'></div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="项目状态" align="center" prop="status" :formatter="statusFormat" />
|
|
||||||
<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="['mes:project:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['mes:project: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"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改项目维护对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="项目名" prop="name">
|
|
||||||
<el-input v-model="form.name" placeholder="请输入项目名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="负责人" prop="leader">
|
|
||||||
<el-input v-model="form.leader" placeholder="请输入负责人" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="开始日期" prop="startDate">
|
|
||||||
<el-date-picker clearable size="small"
|
|
||||||
v-model="form.startDate"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择开始日期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结束日期" prop="endDate">
|
|
||||||
<el-date-picker clearable size="small"
|
|
||||||
v-model="form.endDate"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择结束日期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="项目介绍">
|
|
||||||
<imageUpload v-model="form.description"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="项目状态" prop="status">
|
|
||||||
<el-select v-model="form.status" placeholder="请选择项目状态" clearable filterable>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in statusOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listProject, getProject, delProject, addProject, updateProject, exportProject } from "@/api/mes/project";
|
|
||||||
import ImageUpload from '@/components/ImageUpload';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Project",
|
name: "ProjectInfo",
|
||||||
components: {
|
|
||||||
ImageUpload,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 项目维护表格数据
|
|
||||||
projectList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 项目状态字典
|
|
||||||
statusOptions: [],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
name: null,
|
|
||||||
leader: null,
|
|
||||||
startDate: null,
|
|
||||||
endDate: null,
|
|
||||||
description: null,
|
|
||||||
status: null
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
|
||||||
this.getDicts("project_status").then(response => {
|
|
||||||
this.statusOptions = response.data;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询项目维护列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listProject(this.queryParams).then(response => {
|
|
||||||
this.projectList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 项目状态字典翻译
|
|
||||||
statusFormat(row, column) {
|
|
||||||
return this.selectDictLabel(this.statusOptions, row.status);
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
name: null,
|
|
||||||
leader: null,
|
|
||||||
startDate: null,
|
|
||||||
endDate: null,
|
|
||||||
description: null,
|
|
||||||
status: null,
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加项目维护";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getProject(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改项目维护";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateProject(this.form).then(response => {
|
|
||||||
this.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addProject(this.form).then(response => {
|
|
||||||
this.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$confirm('是否确认删除项目维护编号为"' + ids + '"的数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function() {
|
|
||||||
return delProject(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.msgSuccess("删除成功");
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
const queryParams = this.queryParams;
|
|
||||||
this.$confirm('是否确认导出所有项目维护数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function() {
|
|
||||||
return exportProject(queryParams);
|
|
||||||
}).then(response => {
|
|
||||||
this.download(response.msg);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,328 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="站点名称" prop="name">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.name"
|
|
||||||
placeholder="请输入站点名称"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="站点地址" prop="address">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.address"
|
|
||||||
placeholder="请输入站点地址"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="状态 0未过载 1已过载" prop="status">
|
|
||||||
<el-select v-model="queryParams.status" placeholder="请选择状态 0未过载 1已过载" clearable filterable size="small">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in statusOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</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="['footprint:checkpoint: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="['footprint:checkpoint: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="['footprint:checkpoint: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="['footprint:checkpoint:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="checkpointList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
|
||||||
<el-table-column label="站点名称" align="center" prop="name" />
|
|
||||||
<el-table-column label="站点地址" align="center" prop="address" />
|
|
||||||
<el-table-column label="实时功率" align="center" prop="rtPower" />
|
|
||||||
<el-table-column label="实时电压" align="center" prop="rtVoltage" />
|
|
||||||
<el-table-column label="状态 0未过载 1已过载" align="center" prop="status" :formatter="statusFormat" />
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
|
||||||
<el-table-column label="上报时间" align="center" prop="createTime" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<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="['footprint:checkpoint:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['footprint:checkpoint: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"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改能效检测点对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="站点名称" prop="name">
|
|
||||||
<el-input v-model="form.name" placeholder="请输入站点名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="站点地址" prop="address">
|
|
||||||
<el-input v-model="form.address" placeholder="请输入站点地址" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="实时功率" prop="rtPower">
|
|
||||||
<el-input v-model="form.rtPower" placeholder="请输入实时功率" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="实时电压" prop="rtVoltage">
|
|
||||||
<el-input v-model="form.rtVoltage" placeholder="请输入实时电压" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="状态 0未过载 1已过载" prop="status">
|
|
||||||
<el-select v-model="form.status" placeholder="请选择状态 0未过载 1已过载" clearable filterable>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in statusOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listCheckpoint, getCheckpoint, delCheckpoint, addCheckpoint, updateCheckpoint, exportCheckpoint } from "@/api/footprint/checkpoint";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Checkpoint",
|
name: "Checkpoint",
|
||||||
components: {
|
|
||||||
},
|
data() {
|
||||||
data() {
|
return {
|
||||||
return {
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 能效检测点表格数据
|
|
||||||
checkpointList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 状态 0未过载 1已过载字典
|
|
||||||
statusOptions: [],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
name: null,
|
|
||||||
address: null,
|
|
||||||
status: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
this.getDicts("overload_status").then(response => {
|
|
||||||
this.statusOptions = response.data;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询能效检测点列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listCheckpoint(this.queryParams).then(response => {
|
|
||||||
this.checkpointList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 状态 0未过载 1已过载字典翻译
|
|
||||||
statusFormat(row, column) {
|
|
||||||
return this.selectDictLabel(this.statusOptions, row.status);
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
name: null,
|
|
||||||
address: null,
|
|
||||||
rtPower: null,
|
|
||||||
rtVoltage: null,
|
|
||||||
status: null,
|
|
||||||
remark: null,
|
|
||||||
createBy: null,
|
|
||||||
createTime: null,
|
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
created() {
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
methods: {
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加能效检测点";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getCheckpoint(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改能效检测点";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateCheckpoint(this.form).then(response => {
|
|
||||||
this.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addCheckpoint(this.form).then(response => {
|
|
||||||
this.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$confirm('是否确认删除能效检测点编号为"' + ids + '"的数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function() {
|
|
||||||
return delCheckpoint(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.msgSuccess("删除成功");
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
const queryParams = this.queryParams;
|
|
||||||
this.$confirm('是否确认导出所有能效检测点数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function() {
|
|
||||||
return exportCheckpoint(queryParams);
|
|
||||||
}).then(response => {
|
|
||||||
this.download(response.msg);
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,432 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
|
|
||||||
<el-form-item label="产品名称" prop="materialName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.materialName"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="生产线名称" prop="productLineName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.productLineName"
|
|
||||||
placeholder="请输入生产线名称"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</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="['mes:model: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="['mes:model: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="['mes:model: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="['mes:model:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="modelList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
|
||||||
<el-table-column label="产品名称" align="center" prop="materialName" />
|
|
||||||
<el-table-column label="生产线名称" align="center" prop="productLineName" />
|
|
||||||
<!-- <el-table-column label="描述" align="center" prop="remark" /> -->
|
|
||||||
<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="['mes:model:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['mes:model: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"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改工厂建模对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :inline="true" :rules="rules" label-width="100px">
|
|
||||||
<el-form-item label="生产线名称" prop="productLineName">
|
|
||||||
<el-input v-model="form.productLineName" placeholder="请输入生产线名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="产品" prop="materialName">
|
|
||||||
<el-input v-model="form.materialName" placeholder="请输入产品名称" disabled>
|
|
||||||
<template slot="append">
|
|
||||||
<el-button @click="factoryModel_open=true">选择</el-button>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="产品型号" prop="productModel">
|
|
||||||
<el-input v-model="form.productModel" placeholder="请输入生产线名称" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="产品规格" prop="productSpecification">
|
|
||||||
<el-input v-model="form.productSpecification" placeholder="请输入生产线名称" disabled/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="描述" prop="remark">
|
|
||||||
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> -->
|
|
||||||
<Editor :height=127 v-model="form.remark" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-divider content-position="center">设备信息信息</el-divider>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddMesEquipment">添加</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteMesEquipment">删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-table :data="form.mesEquipmentList" :row-class-name="rowMesEquipmentIndex" @selection-change="handleMesEquipmentSelectionChange" ref="mesEquipmentList">
|
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
|
||||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
|
||||||
<el-table-column label="设备" prop="name" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-select v-model="value[scope.$index]" placeholder="请选择" @change="seleqcted(value[scope.$index], scope.$index)">
|
|
||||||
<el-option
|
|
||||||
v-for="item in mesEquipmentLists"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
style="color: black; font-weight: 300;">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="编码" prop="code" width="100">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="型号" prop="model" width="100">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="生产日期" prop="productDate" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.productDate }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="生产批号" prop="batchNo" width="150">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="制造商" prop="manufacturer" width="150">
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<factoryModel :open.sync="factoryModel_open" @onCancel="factoryModel_open=false" @onSelected="handleMaterialSelected" />
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listModel, getModel, delModel, addModel, updateModel, exportModel } from "@/api/mes/model";
|
|
||||||
import { listEquipmentInfo } from "@/api/mes/equipmentInfo";
|
|
||||||
import Editor from "@/components/Editor/index"
|
|
||||||
import factoryModel from "@/components/Material/MaterialSelect";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Model",
|
name: "FactoryModel",
|
||||||
components: {
|
|
||||||
Editor,
|
|
||||||
factoryModel
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: [],
|
|
||||||
factoryModel_open: false,
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 子表选中数据
|
|
||||||
checkedMesEquipment: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 工厂建模表格数据
|
|
||||||
modelList: [],
|
|
||||||
// 设备信息表格数据
|
|
||||||
mesEquipmentList: [],
|
|
||||||
// 设备信息列表
|
|
||||||
mesEquipmentLists: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
materialId: null,
|
|
||||||
materialName: null,
|
|
||||||
productLineName: null,
|
|
||||||
remark: null
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
productLineName: [
|
|
||||||
{ required: true, message: "请输入生产线名称", trigger: "blur" }
|
|
||||||
],
|
|
||||||
materialName: [
|
|
||||||
{ required: true, message: "请选择产品", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'mesEquipmentList': {
|
|
||||||
handler(newVal, oldVal) {
|
|
||||||
this.form.mesEquipmentList = newVal;
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
deep: true,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
seleqcted(row, index) {
|
|
||||||
this.mesEquipmentLists.forEach(element => {
|
|
||||||
if (element.id == row) {
|
|
||||||
console.log(index, element);
|
|
||||||
|
|
||||||
this.form.mesEquipmentList[index] = element;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleMaterialSelected(list){
|
|
||||||
this.form.materialId = list[0].id;
|
|
||||||
this.form.materialName = list[0].name;
|
|
||||||
this.form.productModel = list[0].model;
|
|
||||||
this.form.productSpecification = list[0].specification;
|
|
||||||
// this.form.mesFactoryModelDetailList = list[0].mesFactoryModelDetailList;
|
|
||||||
this.factoryModel_open=false;
|
|
||||||
},
|
|
||||||
/** 查询工厂建模列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listModel(this.queryParams).then(response => {
|
|
||||||
this.modelList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
listEquipmentInfo().then(response => {
|
|
||||||
this.mesEquipmentLists = response.rows;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
materialId: null,
|
|
||||||
materialName: null,
|
|
||||||
productLineName: null,
|
|
||||||
remark: null,
|
|
||||||
mesEquipmentList: [],
|
|
||||||
productSpecification: null,
|
|
||||||
productModel: null
|
|
||||||
};
|
|
||||||
this.value = []
|
|
||||||
this.mesEquipmentList = [];
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加工厂建模";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getModel(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.mesEquipmentList = this.form.mesFactoryModelDetailList
|
|
||||||
this.form.mesEquipmentList = this.form.mesFactoryModelDetailList;
|
|
||||||
this.form.materialName = this.form.mesFactoryModelDetail.name;
|
|
||||||
this.form.productModel = this.form.mesFactoryModelDetail.model;
|
|
||||||
this.form.productSpecification = this.form.mesFactoryModelDetail.specification;
|
|
||||||
console.log(this.form);
|
|
||||||
|
|
||||||
this.form.mesFactoryModelDetailList.forEach((item, index) => {
|
|
||||||
this.value[index] = item.equipmentId;
|
|
||||||
this.seleqcted(item.equipmentId, index);
|
|
||||||
});
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改工厂建模";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
this.form.mesFactoryModelDetailList = this.form.mesEquipmentList;
|
|
||||||
delete this.form.mesEquipmentList; // 删除多余字段
|
|
||||||
delete this.form.mesFactoryModelDetail; // 删除多余字段
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateModel(this.form).then(response => {
|
|
||||||
this.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addModel(this.form).then(response => {
|
|
||||||
this.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$confirm('是否确认删除工厂建模编号为"' + ids + '"的数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function() {
|
|
||||||
return delModel(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.msgSuccess("删除成功");
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 设备信息序号 */
|
|
||||||
rowMesEquipmentIndex({ row, rowIndex }) {
|
|
||||||
row.index = rowIndex + 1;
|
|
||||||
},
|
|
||||||
/** 设备信息添加按钮操作 */
|
|
||||||
handleAddMesEquipment() {
|
|
||||||
let obj = {};
|
|
||||||
obj.code = "";
|
|
||||||
obj.model = "";
|
|
||||||
obj.name = "";
|
|
||||||
obj.productDate = "";
|
|
||||||
obj.batchNo = "";
|
|
||||||
obj.manufacturer = "";
|
|
||||||
this.mesEquipmentList.push(obj);
|
|
||||||
},
|
|
||||||
/** 设备信息删除按钮操作 */
|
|
||||||
handleDeleteMesEquipment() {
|
|
||||||
if (this.checkedMesEquipment.length == 0) {
|
|
||||||
this.$alert("请先选择要删除的设备信息数据", "提示", { confirmButtonText: "确定", });
|
|
||||||
} else {
|
|
||||||
this.mesEquipmentList = this.mesEquipmentList.filter((item, index) => {
|
|
||||||
let isDelete = this.checkedMesEquipment.includes(item);
|
|
||||||
if (isDelete) this.value.splice(index, 1);
|
|
||||||
return !isDelete;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 单选框选中数据 */
|
|
||||||
handleMesEquipmentSelectionChange(selection) {
|
|
||||||
this.checkedMesEquipment = selection;
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
const queryParams = this.queryParams;
|
|
||||||
this.$confirm('是否确认导出所有工厂建模数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function() {
|
|
||||||
return exportModel(queryParams);
|
|
||||||
}).then(response => {
|
|
||||||
this.download(response.msg);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,323 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="物料档案编号" prop="materialId">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.materialId"
|
|
||||||
placeholder="请输入物料档案编号"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="工艺名称" prop="processName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.processName"
|
|
||||||
placeholder="请输入工艺名称"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="单位耗电量" prop="powerConsume">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.powerConsume"
|
|
||||||
placeholder="请输入单位耗电量"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</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">
|
</template>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['mesModel:processModel: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="['mesModel:processModel: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="['mesModel:processModel: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="['mesModel:processModel:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="processModelList" @selection-change="handleSelectionChange">
|
<script>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
|
||||||
<el-table-column label="产品" align="center" prop="materialIName" />
|
|
||||||
<el-table-column label="工艺名称" align="center" prop="processName" />
|
|
||||||
<el-table-column label="工艺描述" align="center" prop="description" />
|
|
||||||
<el-table-column label="单位耗电量" align="center" prop="powerConsume" />
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
|
||||||
<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="['mesModel:processModel:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['mesModel:processModel:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
export default {
|
||||||
v-show="total>0"
|
name: "ProcessModel",
|
||||||
:total="total"
|
data() {
|
||||||
:page.sync="queryParams.pageNum"
|
return {
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改工艺建模对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="产品" prop="materialIName">
|
|
||||||
<el-input v-model="form.materialIName" placeholder="请输入产品" disabled>
|
|
||||||
<template slot="append">
|
|
||||||
<el-button @click="factoryModel_open=true">选择</el-button>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="工艺名称" prop="processName">
|
|
||||||
<el-input v-model="form.processName" placeholder="请输入工艺名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="工艺描述" prop="description">
|
|
||||||
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="单位耗电量" prop="powerConsume">
|
|
||||||
<el-input v-model="form.powerConsume" placeholder="请输入单位耗电量" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<factoryModel :open.sync="factoryModel_open" @onCancel="factoryModel_open=false" @onSelected="handleMaterialSelected" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { listProcessModel, getProcessModel, delProcessModel, addProcessModel, updateProcessModel, exportProcessModel } from "@/api/mesModel/processModel";
|
|
||||||
import Editor from "@/components/Editor/index"
|
|
||||||
import factoryModel from "@/components/Material/MaterialSelect";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "ProcessModel",
|
|
||||||
components: {
|
|
||||||
Editor,
|
|
||||||
factoryModel
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
factoryModel_open: false,
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 工艺建模表格数据
|
|
||||||
processModelList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
materialId: null,
|
|
||||||
processName: null,
|
|
||||||
description: null,
|
|
||||||
powerConsume: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
processName: [
|
|
||||||
{ required: true, message: "工艺名称不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
powerConsume: [
|
|
||||||
{ required: true, message: "单位耗电量不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleMaterialSelected(list){
|
|
||||||
this.form.materialId = list[0].id;
|
|
||||||
this.form.materialIName = list[0].name;
|
|
||||||
// this.form.mesFactoryModelDetailList = list[0].mesFactoryModelDetailList;
|
|
||||||
this.factoryModel_open=false;
|
|
||||||
},
|
|
||||||
/** 查询工艺建模列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listProcessModel(this.queryParams).then(response => {
|
|
||||||
this.processModelList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
materialId: null,
|
|
||||||
processName: null,
|
|
||||||
description: null,
|
|
||||||
powerConsume: null,
|
|
||||||
remark: null,
|
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
created() {
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
methods: {
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加工艺建模";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getProcessModel(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改工艺建模";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateProcessModel(this.form).then(response => {
|
|
||||||
this.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addProcessModel(this.form).then(response => {
|
|
||||||
this.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$confirm('是否确认删除工艺建模编号为"' + ids + '"的数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function() {
|
|
||||||
return delProcessModel(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.msgSuccess("删除成功");
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
const queryParams = this.queryParams;
|
|
||||||
this.$confirm('是否确认导出所有工艺建模数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function() {
|
|
||||||
return exportProcessModel(queryParams);
|
|
||||||
}).then(response => {
|
|
||||||
this.download(response.msg);
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
</script>
|
||||||
</script>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user