|
@@ -4,28 +4,41 @@
|
|
<div class="condition">
|
|
<div class="condition">
|
|
<p>部件名称:</p>
|
|
<p>部件名称:</p>
|
|
<el-input v-model="nameOfparts" size="small"></el-input>
|
|
<el-input v-model="nameOfparts" size="small"></el-input>
|
|
- <el-button type="primary" size="small">查询</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="GETquery" size="small"
|
|
|
|
+ >查询</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
<el-button plain size="small" @click="newly">新增</el-button>
|
|
<el-button plain size="small" @click="newly">新增</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="assemblyList">
|
|
<div class="assemblyList">
|
|
<el-table :data="tableData" border style="width: 100%">
|
|
<el-table :data="tableData" border style="width: 100%">
|
|
- <el-table-column prop="date" label="部件模块"> </el-table-column>
|
|
|
|
- <el-table-column prop="name" label="部件名称"> </el-table-column>
|
|
|
|
- <el-table-column prop="name" label="部件编码"> </el-table-column>
|
|
|
|
- <el-table-column prop="name" label="维护时间"> </el-table-column>
|
|
|
|
|
|
+ <el-table-column prop="unitModuleName" label="部件模块">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="contentsName" label="部件名称">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="contentsType" label="部件编码">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="updateTime" label="维护时间"> </el-table-column>
|
|
<el-table-column fixed="right" label="操作">
|
|
<el-table-column fixed="right" label="操作">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
<el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
- <el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.associatedFunctionType === 1"
|
|
|
|
+ @click="ONallocation(scope.row)"
|
|
|
|
+ type="text"
|
|
|
|
+ size="small"
|
|
>部件配置</el-button
|
|
>部件配置</el-button
|
|
>
|
|
>
|
|
- <el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.associatedFunctionType === 2"
|
|
|
|
+ @click="ONbrand(scope.row)"
|
|
|
|
+ type="text"
|
|
|
|
+ size="small"
|
|
>品牌维护</el-button
|
|
>品牌维护</el-button
|
|
>
|
|
>
|
|
- <el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
|
|
|
|
+ <el-button @click="ONdelete(scope.row)" type="text" size="small"
|
|
>删除</el-button
|
|
>删除</el-button
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
@@ -43,9 +56,9 @@
|
|
部件模块:<el-select v-model="modulevalue" placeholder="请选择">
|
|
部件模块:<el-select v-model="modulevalue" placeholder="请选择">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in moduleoptions"
|
|
v-for="item in moduleoptions"
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value"
|
|
|
|
|
|
+ :key="item.contentsValue"
|
|
|
|
+ :label="item.contentsName"
|
|
|
|
+ :value="item.contentsValue"
|
|
>
|
|
>
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
@@ -54,20 +67,25 @@
|
|
部件名称:<el-select v-model="namevalue" placeholder="请选择">
|
|
部件名称:<el-select v-model="namevalue" placeholder="请选择">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in nameoptions"
|
|
v-for="item in nameoptions"
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value"
|
|
|
|
|
|
+ :key="item.contentsValue"
|
|
|
|
+ :label="item.contentsName"
|
|
|
|
+ :value="item.contentsValue"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </p>
|
|
|
|
+ <p style="margin-bottom: 20px">
|
|
|
|
+ 功能类型:<el-select v-model="functionvalue" placeholder="请选择">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in functionoptions"
|
|
|
|
+ :key="item.contentsValue"
|
|
|
|
+ :label="item.contentsName"
|
|
|
|
+ :value="item.contentsValue"
|
|
>
|
|
>
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</p>
|
|
</p>
|
|
- <el-checkbox
|
|
|
|
- style="display: block"
|
|
|
|
- v-model="checked"
|
|
|
|
- :true-label="1"
|
|
|
|
- :false-label="0"
|
|
|
|
- >品牌/型号</el-checkbox
|
|
|
|
- >
|
|
|
|
|
|
+
|
|
<div class="button-container">
|
|
<div class="button-container">
|
|
<el-button
|
|
<el-button
|
|
class="but"
|
|
class="but"
|
|
@@ -142,8 +160,8 @@
|
|
<div class="drawersDIV">
|
|
<div class="drawersDIV">
|
|
<el-input size="small" v-model="drawervalue"></el-input>
|
|
<el-input size="small" v-model="drawervalue"></el-input>
|
|
<el-button size="small" @click="newtype('2')">新增</el-button>
|
|
<el-button size="small" @click="newtype('2')">新增</el-button>
|
|
- <el-table :data="tableData" border style="width: 100%">
|
|
|
|
- <el-table-column prop="name" label="型号"> </el-table-column>
|
|
|
|
|
|
+ <el-table :data="nothaveData" border style="width: 100%">
|
|
|
|
+ <el-table-column prop="contentsName" label="型号"> </el-table-column>
|
|
<el-table-column fixed="right" label="操作" width="100">
|
|
<el-table-column fixed="right" label="操作" width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
@@ -152,7 +170,9 @@
|
|
size="small"
|
|
size="small"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
- <el-button type="text" size="small">删除</el-button>
|
|
|
|
|
|
+ <el-button type="text" @click="DELshuxing(scope.row)" size="small"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -166,7 +186,8 @@
|
|
:before-close="handleClose"
|
|
:before-close="handleClose"
|
|
>
|
|
>
|
|
<p class="maintain">
|
|
<p class="maintain">
|
|
- 类型:<span class="one"><el-input size="small"></el-input></span
|
|
|
|
|
|
+ 类型:<span class="one"
|
|
|
|
+ ><el-input v-model="bujianval" size="small"></el-input></span
|
|
><span class="Sptwo">
|
|
><span class="Sptwo">
|
|
<el-button
|
|
<el-button
|
|
class="but"
|
|
class="but"
|
|
@@ -183,6 +204,16 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import {
|
|
|
|
+ getDictList,
|
|
|
|
+ createUnitDict,
|
|
|
|
+ getUnitDictConstantsPage,
|
|
|
|
+ delUnitDict,
|
|
|
|
+ createUnitDictProperty,
|
|
|
|
+ getUnitDictConstantsList,
|
|
|
|
+ delUnitDictProperty,
|
|
|
|
+} from "@/api/maintain.js";
|
|
|
|
+import { log } from "plotly.js-dist";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -197,31 +228,140 @@ export default {
|
|
moduleoptions: [],
|
|
moduleoptions: [],
|
|
namevalue: "",
|
|
namevalue: "",
|
|
nameoptions: [],
|
|
nameoptions: [],
|
|
|
|
+ functionvalue: "",
|
|
|
|
+ functionoptions: [],
|
|
checked: "0",
|
|
checked: "0",
|
|
drawervalue: "",
|
|
drawervalue: "",
|
|
brand: "",
|
|
brand: "",
|
|
guige: "",
|
|
guige: "",
|
|
|
|
+ rowList: {},
|
|
|
|
+ bujianval: "",
|
|
|
|
+ nothaveData: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ created() {
|
|
|
|
+ this.GETquery();
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 获取属性
|
|
|
|
+ GETmokuai() {
|
|
|
|
+ getDictList({ dictType: 3 }).then((res) => {
|
|
|
|
+ this.moduleoptions = res.data;
|
|
|
|
+ });
|
|
|
|
+ getDictList({ dictType: 4 }).then((res) => {
|
|
|
|
+ this.nameoptions = res.data;
|
|
|
|
+ });
|
|
|
|
+ getDictList({ dictType: 5 }).then((res) => {
|
|
|
|
+ this.functionoptions = res.data;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 新增属性
|
|
|
|
+ handleConfirm() {
|
|
|
|
+ const params = {
|
|
|
|
+ associatedFunctionType: this.functionvalue,
|
|
|
|
+ contentsDictKey: this.namevalue,
|
|
|
|
+ contentsName:
|
|
|
|
+ this.nameoptions.find((item) => item.contentsValue === this.namevalue)
|
|
|
|
+ ?.contentsName || "", // 赋值nameoptions当前选中的label
|
|
|
|
+ unitModule: this.modulevalue,
|
|
|
|
+ parentId: 0,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ createUnitDict(params).then((res) => {
|
|
|
|
+ if (res.status == true) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "恭喜你,这是一条成功消息",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.GETquery();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 查询
|
|
|
|
+ GETquery() {
|
|
|
|
+ const params = {
|
|
|
|
+ contentsName: this.nameOfparts,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ };
|
|
|
|
+ getUnitDictConstantsPage(params).then((res) => {
|
|
|
|
+ this.tableData = res.data.list;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 删除属性
|
|
|
|
+ ONdelete(row) {
|
|
|
|
+ const params = {
|
|
|
|
+ contentsType: row.contentsType,
|
|
|
|
+ id: row.id,
|
|
|
|
+ };
|
|
|
|
+ delUnitDict(params).then((res) => {
|
|
|
|
+ this.tableData = this.tableData.filter((item) => item.id !== row.id);
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "删除成功!",
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 非关联
|
|
|
|
+ ONallocation(row) {
|
|
|
|
+ this.rowList = row;
|
|
|
|
+ this.notdrawer = true;
|
|
|
|
+ getUnitDictConstantsList({
|
|
|
|
+ contentsType: this.rowList.contentsType,
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.nothaveData = res.data;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ submit(type) {
|
|
|
|
+ if (type === "1") {
|
|
|
|
+ const params = {
|
|
|
|
+ contentsName: this.bujianval,
|
|
|
|
+ contentsType: this.rowList.contentsType,
|
|
|
|
+ parentId: this.rowList.id,
|
|
|
|
+ unitModule: this.rowList.unitModule,
|
|
|
|
+ contentsDictKey: 0,
|
|
|
|
+ };
|
|
|
|
+ createUnitDictProperty(params).then((res) => {
|
|
|
|
+ this.maintainVisible = false;
|
|
|
|
+ getUnitDictConstantsList({
|
|
|
|
+ contentsType: this.rowList.contentsType,
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.nothaveData = res.data;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ } else if (type === "2") {
|
|
|
|
+ this.relevanceVisible = false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ DELshuxing(row) {
|
|
|
|
+ const params = {
|
|
|
|
+ updateBy: row.updateBy,
|
|
|
|
+ id: row.id,
|
|
|
|
+ };
|
|
|
|
+ delUnitDictProperty(params).then((res) => {
|
|
|
|
+ this.nothaveData = this.nothaveData.filter(
|
|
|
|
+ (item) => item.id !== row.id
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ ONbrand(row) {
|
|
|
|
+ this.drawer = true;
|
|
|
|
+ console.log("row", row);
|
|
|
|
+ },
|
|
|
|
+
|
|
newly() {
|
|
newly() {
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
|
|
+ this.GETmokuai();
|
|
},
|
|
},
|
|
|
|
+
|
|
handleClose() {
|
|
handleClose() {
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
},
|
|
},
|
|
- handleConfirm() {
|
|
|
|
- this.dialogVisible = false;
|
|
|
|
|
|
|
|
- if (this.checked == "0") {
|
|
|
|
- console.log(this.checked);
|
|
|
|
- this.notdrawer = true;
|
|
|
|
- }
|
|
|
|
- if (this.checked == "1") {
|
|
|
|
- console.log(this.checked);
|
|
|
|
- this.drawer = true;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
handleClick() {},
|
|
handleClick() {},
|
|
newtype(type) {
|
|
newtype(type) {
|
|
if (type === "1") {
|
|
if (type === "1") {
|
|
@@ -230,13 +370,6 @@ export default {
|
|
this.maintainVisible = true;
|
|
this.maintainVisible = true;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- submit(type) {
|
|
|
|
- if (type === "1") {
|
|
|
|
- this.maintainVisible = false;
|
|
|
|
- } else if (type === "2") {
|
|
|
|
- this.relevanceVisible = false;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -272,12 +405,11 @@ export default {
|
|
.drawers {
|
|
.drawers {
|
|
.drawersDIV {
|
|
.drawersDIV {
|
|
padding: 0 20px;
|
|
padding: 0 20px;
|
|
|
|
+ margin-bottom: 20px;
|
|
}
|
|
}
|
|
.el-input {
|
|
.el-input {
|
|
width: 220px;
|
|
width: 220px;
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|
|
- }
|
|
|
|
- .el-button {
|
|
|
|
margin-bottom: 20px;
|
|
margin-bottom: 20px;
|
|
}
|
|
}
|
|
}
|
|
}
|