Explorar o código

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

%!s(int64=5) %!d(string=hai) anos
pai
achega
43451cd83c
Modificáronse 1 ficheiros con 17 adicións e 6 borrados
  1. 17 6
      ys_vue/src/views/base/allocation.vue

+ 17 - 6
ys_vue/src/views/base/allocation.vue

@@ -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() {