|
|
@@ -1,17 +1,17 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
|
|
- <el-form-item label="设备/工艺编号" prop="technologyCode">
|
|
|
+ <el-form-item label="设备/工艺编号" prop="machineryCode">
|
|
|
<el-input
|
|
|
- v-model="queryParams.technologyCode"
|
|
|
+ v-model="queryParams.machineryCode"
|
|
|
placeholder="请输入设备/工艺编号"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="设备/工艺名称" prop="technologyName">
|
|
|
+ <el-form-item label="设备/工艺名称" prop="machineryName">
|
|
|
<el-input
|
|
|
- v-model="queryParams.technologyName"
|
|
|
+ v-model="queryParams.machineryName"
|
|
|
placeholder="请输入部门名称"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
@@ -32,7 +32,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
- v-hasPermi="['iscs:technology:add']"
|
|
|
+ v-hasPermi="['iscs:machinery:add']"
|
|
|
>新增
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
@@ -53,17 +53,38 @@
|
|
|
v-if="refreshTable"
|
|
|
v-loading="loading"
|
|
|
:data="deptList"
|
|
|
- row-key="workstationId"
|
|
|
+ row-key="machineryId"
|
|
|
:default-expand-all="isExpandAll"
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
>
|
|
|
- <el-table-column prop="technologyCode" label="设备/工艺编码" width="260"></el-table-column>
|
|
|
- <el-table-column prop="technologyName" label="设备/工艺名称" width="260"></el-table-column>
|
|
|
- <el-table-column prop="technologyType" label="设备/工艺类型" width="260"></el-table-column>
|
|
|
- <el-table-column prop="workstationName" label="所属岗位" width="260"></el-table-column>
|
|
|
+ <el-table-column prop="machineryCode" label="设备/工艺编码" ></el-table-column>
|
|
|
+ <el-table-column prop="machineryName" label="设备/工艺名称" ></el-table-column>
|
|
|
+ <el-table-column prop="machineryType" label="设备/工艺类型" ></el-table-column>
|
|
|
+ <el-table-column prop="workstationName" label="所属岗位" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.workstationName }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="lotoName" label="所属电柜" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="look(scope.row)">{{ scope.row.lotoName }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="machineryImg" label="工艺图" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+
|
|
|
+ <img
|
|
|
+ v-if="scope.row.machineryImg"
|
|
|
+ :src="scope.row.machineryImg"
|
|
|
+ alt=""
|
|
|
+ style="width: 50px; height: 50px"
|
|
|
+ />
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
+ <span>{{ scope.row.createTime }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
@@ -73,7 +94,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['iscs:technology:edit']"
|
|
|
+ v-hasPermi="['iscs:machinery:edit']"
|
|
|
>修改
|
|
|
</el-button>
|
|
|
<el-button v-no-more-click
|
|
|
@@ -81,16 +102,17 @@
|
|
|
type="text"
|
|
|
icon="el-icon-plus"
|
|
|
@click="handleAdd(scope.row)"
|
|
|
- v-hasPermi="['iscs:technology:add']"
|
|
|
+ v-hasPermi="['iscs:machinery:add']"
|
|
|
>新增
|
|
|
</el-button>
|
|
|
+<!-- v-if="scope.row.parentId != 0"-->
|
|
|
<el-button v-no-more-click
|
|
|
- v-if="scope.row.parentId != 0"
|
|
|
+
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['iscs:technology:remove']"
|
|
|
+ v-hasPermi="['iscs:machinery:remove']"
|
|
|
>删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
@@ -98,21 +120,21 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 添加或修改部门对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="450px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
|
<el-form-item label="上级" prop="parentId" >
|
|
|
- <treeselect v-model="form.parentId" :options="technologyOptions" :normalizer="normalizer" placeholder="选择上级"/>
|
|
|
+ <treeselect v-model="form.parentId" :options="machineryOptions" :normalizer="normalizer" placeholder="选择上级"/>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="设备/工艺名称" prop="technologyName">
|
|
|
- <el-input v-model="form.technologyName" placeholder="请输入设备/工艺名称"/>
|
|
|
+ <el-form-item label="设备/工艺名称" prop="machineryName">
|
|
|
+ <el-input v-model="form.machineryName" placeholder="请输入设备/工艺名称"/>
|
|
|
</el-form-item>
|
|
|
<el-row>
|
|
|
<el-col :span="18">
|
|
|
- <el-form-item label="设备/工艺编号" prop="workstationCode">
|
|
|
+ <el-form-item label="设备/工艺编号" prop="machineryCode">
|
|
|
<el-input
|
|
|
- v-model="form.technologyCode"
|
|
|
+ v-model="form.machineryCode"
|
|
|
placeholder="请输入设备/工艺编号"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
@@ -129,11 +151,35 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-form-item label="设备/工艺类型" prop="technologyType">
|
|
|
- <el-input v-model="form.technologyType" placeholder="请输入设备/工艺类型" maxlength="20"/>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="所属mars岗位" prop="workstationId" >
|
|
|
- <treeselect v-model="form.workstationId" :options="marsOptions" :normalizer="Marsnormalizer" placeholder="选择mars岗位"/>
|
|
|
+ <treeselect v-model="form.workstationId" :options="marsOptions" :normalizer="Marsnormalizer" placeholder="选择mars岗位"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属电柜" prop="lotoId">
|
|
|
+ <el-select
|
|
|
+ style="width: 300px"
|
|
|
+ v-model="form.lotoId"
|
|
|
+ placeholder="请选择所属电柜"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in LotoOptions"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备/工艺类型" prop="machineryType">
|
|
|
+ <el-input v-model="form.machineryType" placeholder="请输入设备/工艺类型" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="工艺图" prop="machineryImg">
|
|
|
+ <ImageUploadSingle
|
|
|
+ :limit="1"
|
|
|
+ :value="form.machineryImg"
|
|
|
+ :fileSize="5"
|
|
|
+ @onUploaded="handleIconUplaoded"
|
|
|
+ @onRemoved="handleIconRemoved"
|
|
|
+ ></ImageUploadSingle>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -147,11 +193,12 @@
|
|
|
<script>
|
|
|
import {
|
|
|
listTechnology, addTechnology, updateTechnology, delTechnology, getTechnologyInfo
|
|
|
-} from '@/api/system/technology'
|
|
|
+} from '@/api/system/machinery'
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
import { genCode } from '@/api/system/autocode/rule'
|
|
|
import { listMarsDept } from '@/api/system/marsdept'
|
|
|
+import {listLoto} from '@/api/mes/lotoStation/lotoStation'
|
|
|
|
|
|
export default {
|
|
|
name: 'Dept',
|
|
|
@@ -170,7 +217,9 @@ export default {
|
|
|
// mars树选项
|
|
|
marsOptions: [],
|
|
|
//工艺树
|
|
|
- technologyOptions:[],
|
|
|
+ machineryOptions:[],
|
|
|
+ // 电柜
|
|
|
+ lotoOptions:[],
|
|
|
// 弹出层标题
|
|
|
title: '',
|
|
|
// 是否显示弹出层
|
|
|
@@ -183,33 +232,59 @@ export default {
|
|
|
queryParams: {
|
|
|
pages:1,
|
|
|
size:-1,
|
|
|
- technologyName: undefined,
|
|
|
- technologyCode: undefined
|
|
|
+ machineryName: undefined,
|
|
|
+ machineryCode: undefined
|
|
|
},
|
|
|
+ LotoOptions:[],//电柜绑定
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- technologyCode: [
|
|
|
+ machineryCode: [
|
|
|
{ required: true, message: '设备/工艺编码不能为空', trigger: 'blur' }
|
|
|
],
|
|
|
- technologyName: [
|
|
|
+ machineryName: [
|
|
|
{ required: true, message: '设备/工艺名称不能为空', trigger: 'blur' }
|
|
|
],
|
|
|
+ workstationId:[
|
|
|
+ { required: true, message: '岗位不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ lotoId:[
|
|
|
+ { required: true, message: '电柜不能为空', trigger: 'blur' }
|
|
|
+ ]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.getList()
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ "form.workstationId":function(newVal,oldVal){
|
|
|
+ if(newVal){
|
|
|
+ const data={
|
|
|
+ pasge:1,
|
|
|
+ size:-1,
|
|
|
+ workstationId:this.form.workstationId
|
|
|
+ }
|
|
|
+ listLoto(data).then(response => {
|
|
|
+ this.LotoOptions = response.data.records.map(item => {
|
|
|
+ return {
|
|
|
+ value: item.lotoId,
|
|
|
+ label: item.lotoName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
/** 查询部门列表 */
|
|
|
getList() {
|
|
|
this.loading = true
|
|
|
listTechnology(this.queryParams).then(response => {
|
|
|
debugger;
|
|
|
- this.deptList = this.handleTree(response.data.records,"technologyId","parentId")
|
|
|
- this.technologyOptions = this.handleTree(response.data.records,"technologyId","parentId")
|
|
|
+ this.deptList = this.handleTree(response.data.records,"machineryId","parentId")
|
|
|
+ this.machineryOptions = this.handleTree(response.data.records,"machineryId","parentId")
|
|
|
console.log(this.deptList,'设备/工艺列表')
|
|
|
this.loading = false
|
|
|
})
|
|
|
@@ -220,6 +295,14 @@ export default {
|
|
|
listMarsDept(data).then(response => {
|
|
|
this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
|
|
|
})
|
|
|
+ listLoto(data).then(response => {
|
|
|
+ this.LotoOptions = response.data.records.map(item => {
|
|
|
+ return {
|
|
|
+ value: item.lotoId,
|
|
|
+ label: item.lotoName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
/** 转换部门数据结构 */
|
|
|
Marsnormalizer(node) {
|
|
|
@@ -237,11 +320,18 @@ export default {
|
|
|
delete node.children
|
|
|
}
|
|
|
return {
|
|
|
- id: node.technologyId,
|
|
|
- label: node.technologyName,
|
|
|
+ id: node.machineryId,
|
|
|
+ label: node.machineryName,
|
|
|
children: node.children
|
|
|
}
|
|
|
},
|
|
|
+ // 地图预览
|
|
|
+ look(row) {
|
|
|
+ console.log(row, "row预览");
|
|
|
+ const data = row.lotoId;
|
|
|
+ this.$router.push(`/system/technology/technologyList/index/MapData?lotoId=${data}&machineryId=${row.machineryId}`);
|
|
|
+ // this.dialogVisibleMap = true; // 显示地图预览弹框
|
|
|
+ },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false
|
|
|
@@ -250,9 +340,9 @@ export default {
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
- technologyId: undefined,
|
|
|
+ machineryId: undefined,
|
|
|
parentId: undefined,
|
|
|
- technologyName: undefined,
|
|
|
+ machineryName: undefined,
|
|
|
}
|
|
|
this.autoGenFlag = false;
|
|
|
this.resetForm('form')
|
|
|
@@ -262,12 +352,20 @@ export default {
|
|
|
if (autoGenFlag) {
|
|
|
genCode("TECHNOLOGY_CODE").then((response) => {
|
|
|
console.log(response,'设备工艺编码');
|
|
|
- this.form.technologyCode = response;
|
|
|
+ this.form.machineryCode = response;
|
|
|
});
|
|
|
} else {
|
|
|
- this.form.technologyCode = null;
|
|
|
+ this.form.machineryCode = null;
|
|
|
}
|
|
|
},
|
|
|
+ //图标上传成功
|
|
|
+ handleIconUplaoded(imgUrl) {
|
|
|
+ this.form.machineryImg = imgUrl[0].url
|
|
|
+ },
|
|
|
+ // 图标移除
|
|
|
+ handleIconRemoved(imgUrl) {
|
|
|
+ this.form.machineryImg = null
|
|
|
+ },
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.getList()
|
|
|
@@ -289,8 +387,8 @@ export default {
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd(row) {
|
|
|
this.reset()
|
|
|
- if (row != null && row.technologyId) {
|
|
|
- this.form.parentId = row.technologyId;
|
|
|
+ if (row != null && row.machineryId) {
|
|
|
+ this.form.parentId = row.machineryId;
|
|
|
} else {
|
|
|
this.form.parentId = 0;
|
|
|
}
|
|
|
@@ -302,7 +400,7 @@ export default {
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset()
|
|
|
- getTechnologyInfo(row.technologyId).then(response => {
|
|
|
+ getTechnologyInfo(row.machineryId).then(response => {
|
|
|
this.form = response.data
|
|
|
this.open = true
|
|
|
this.title = '修改部门'
|
|
|
@@ -313,7 +411,7 @@ export default {
|
|
|
submitForm: function() {
|
|
|
this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.technologyId != undefined) {
|
|
|
+ if (this.form.machineryId != undefined) {
|
|
|
updateTechnology(this.form).then(response => {
|
|
|
this.$modal.msgSuccess('修改成功')
|
|
|
this.open = false
|
|
|
@@ -331,8 +429,8 @@ export default {
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- this.$modal.confirm('是否确认删除名称为"' + row.technologyName + '"的数据项?').then(function() {
|
|
|
- return delTechnology(row.technologyId)
|
|
|
+ this.$modal.confirm('是否确认删除名称为"' + row.machineryName + '"的数据项?').then(function() {
|
|
|
+ return delTechnology(row.machineryId)
|
|
|
}).then(() => {
|
|
|
this.getList()
|
|
|
this.$modal.msgSuccess('删除成功')
|