|
@@ -0,0 +1,293 @@
|
|
|
+<template>
|
|
|
+ <div class="global-variable">
|
|
|
+ <div class="inquire">
|
|
|
+ <div class="condition">
|
|
|
+ <p>部件名称:</p>
|
|
|
+ <el-input v-model="nameOfparts" size="small"></el-input>
|
|
|
+ <el-button type="primary" size="small">查询</el-button>
|
|
|
+ </div>
|
|
|
+ <el-button plain size="small" @click="newly">新增</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="assemblyList">
|
|
|
+ <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 fixed="right" label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
|
+ >部件配置</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
|
+ >品牌维护</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="新增部件"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="20%"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <p style="margin-bottom: 20px">
|
|
|
+ 部件模块:<el-select v-model="modulevalue" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in moduleoptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </p>
|
|
|
+ <p style="margin-bottom: 20px">
|
|
|
+ 部件名称:<el-select v-model="namevalue" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in nameoptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </p>
|
|
|
+ <el-checkbox
|
|
|
+ style="display: block"
|
|
|
+ v-model="checked"
|
|
|
+ :true-label="1"
|
|
|
+ :false-label="0"
|
|
|
+ >品牌/型号</el-checkbox
|
|
|
+ >
|
|
|
+ <div class="button-container">
|
|
|
+ <el-button
|
|
|
+ class="but"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="handleConfirm"
|
|
|
+ >
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 关联 -->
|
|
|
+ <el-drawer
|
|
|
+ title="新增"
|
|
|
+ :visible.sync="drawer"
|
|
|
+ size="22%"
|
|
|
+ :with-header="true"
|
|
|
+ class="drawers"
|
|
|
+ >
|
|
|
+ <div class="drawersDIV">
|
|
|
+ <el-input size="small " v-model="drawervalue"></el-input>
|
|
|
+ <el-button size="small" @click="newtype('1')">新增</el-button>
|
|
|
+ <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 fixed="right" label="操作" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ @click="handleClick(scope.row)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button type="text" size="small">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="新增部件"
|
|
|
+ :visible.sync="relevanceVisible"
|
|
|
+ width="20%"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <p class="maintain">
|
|
|
+ 品牌:<span class="one"
|
|
|
+ ><el-input v-model="brand" size="small"></el-input
|
|
|
+ ></span>
|
|
|
+ </p>
|
|
|
+ <p class="maintain">
|
|
|
+ 型号:<span class="one"
|
|
|
+ ><el-input v-model="guige" size="small"></el-input
|
|
|
+ ></span>
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <div class="button-container">
|
|
|
+ <el-button class="but" size="small" type="primary" @click="submit('2')">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 非 -->
|
|
|
+ <el-drawer
|
|
|
+ title="新增"
|
|
|
+ :visible.sync="notdrawer"
|
|
|
+ size="22%"
|
|
|
+ :with-header="true"
|
|
|
+ class="drawers"
|
|
|
+ >
|
|
|
+ <div class="drawersDIV">
|
|
|
+ <el-input size="small" v-model="drawervalue"></el-input>
|
|
|
+ <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-column fixed="right" label="操作" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ @click="handleClick(scope.row)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button type="text" size="small">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="新增部件"
|
|
|
+ :visible.sync="maintainVisible"
|
|
|
+ width="22%"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <p class="maintain">
|
|
|
+ 类型:<span class="one"><el-input size="small"></el-input></span
|
|
|
+ ><span class="Sptwo">
|
|
|
+ <el-button
|
|
|
+ class="but"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="submit('1')"
|
|
|
+ >
|
|
|
+ 确定
|
|
|
+ </el-button></span
|
|
|
+ >
|
|
|
+ </p>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+ <script>
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ nameOfparts: "",
|
|
|
+ tableData: [],
|
|
|
+ drawer: false,
|
|
|
+ notdrawer: false,
|
|
|
+ dialogVisible: false,
|
|
|
+ maintainVisible: false,
|
|
|
+ relevanceVisible: false,
|
|
|
+ modulevalue: "",
|
|
|
+ moduleoptions: [],
|
|
|
+ namevalue: "",
|
|
|
+ nameoptions: [],
|
|
|
+ checked: "0",
|
|
|
+ drawervalue: "",
|
|
|
+ brand: "",
|
|
|
+ guige: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ newly() {
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ 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() {},
|
|
|
+ newtype(type) {
|
|
|
+ if (type === "1") {
|
|
|
+ this.relevanceVisible = true;
|
|
|
+ } else if (type === "2") {
|
|
|
+ this.maintainVisible = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submit(type) {
|
|
|
+ if (type === "1") {
|
|
|
+ this.maintainVisible = false;
|
|
|
+ } else if (type === "2") {
|
|
|
+ this.relevanceVisible = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+ <style lang="scss" scoped>
|
|
|
+.inquire {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .condition {
|
|
|
+ display: flex;
|
|
|
+ p {
|
|
|
+ width: 80px;
|
|
|
+ line-height: 32px;
|
|
|
+ }
|
|
|
+ .el-input {
|
|
|
+ width: 220px;
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.assemblyList {
|
|
|
+ margin: 20px 0;
|
|
|
+}
|
|
|
+.button-container {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center; /* Center the button horizontally */
|
|
|
+ margin-top: 20px; /* Add some space above the button */
|
|
|
+ .but {
|
|
|
+ width: 100px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.drawers {
|
|
|
+ .drawersDIV {
|
|
|
+ padding: 0 20px;
|
|
|
+ }
|
|
|
+ .el-input {
|
|
|
+ width: 220px;
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ .el-button {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.maintain {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ .el-input {
|
|
|
+ width: 220px;
|
|
|
+ }
|
|
|
+ .Sptwo {
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|