|
@@ -41,14 +41,21 @@
|
|
|
<el-table-column prop="assets" label="资产方" width="120" sortable></el-table-column>
|
|
|
<el-table-column prop="state" label="模具状态" width="100" sortable>
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.state == true">运行</span>
|
|
|
- <span v-else>停止</span>
|
|
|
- <el-switch v-model="scope.row.state"></el-switch>
|
|
|
+ <span v-if="scope.row.state == false">未启用</span>
|
|
|
+ <span v-else>已启用</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="160" sortable>
|
|
|
- <el-button size="small">修改</el-button>
|
|
|
- <el-button type="danger" size="small">删除</el-button>
|
|
|
+ <el-table-column label="操作" width="220" sortable>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="enable(scope.$index)"
|
|
|
+ :disabled="scope.row.state == true"
|
|
|
+ >启用</el-button>
|
|
|
+ <el-button size="small">修改</el-button>
|
|
|
+ <el-button type="danger" size="small">删除</el-button>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
@@ -155,6 +162,10 @@ export default {
|
|
|
deviceNumber: "",
|
|
|
company: ""
|
|
|
};
|
|
|
+ },
|
|
|
+ //启用设备
|
|
|
+ enable(index) {
|
|
|
+ this.allocations[index].state = true;
|
|
|
}
|
|
|
},
|
|
|
created() {
|