diff --git a/src/api/wms/equipment.js b/src/api/wms/equipment.js
index b2751ea2..c7a4ccf6 100644
--- a/src/api/wms/equipment.js
+++ b/src/api/wms/equipment.js
@@ -83,3 +83,16 @@ export function bindSpareParts(data) {
data: data
});
}
+
+// 设备状态修改
+export function changeEquipmentStatus(equipmentId, status) {
+ const data = {
+ equipmentId,
+ status
+ }
+ return request({
+ url: '/wms/equipment/changeStatus',
+ method: 'put',
+ data: data
+ })
+}
diff --git a/src/views/wms/equipment/index.vue b/src/views/wms/equipment/index.vue
index c597c98a..c9b678ee 100644
--- a/src/views/wms/equipment/index.vue
+++ b/src/views/wms/equipment/index.vue
@@ -6,12 +6,13 @@
size="small"
:inline="true"
v-show="showSearch"
- label-width="98px"
+ label-width="88px"
>
@@ -21,6 +22,7 @@
v-model="queryParams.equipmentName"
placeholder="请输入设备名称"
clearable
+ style="width: 180px"
@keyup.enter.native="handleQuery"
/>
@@ -31,7 +33,7 @@
@change="$forceUpdate()"
clearable
filterable
- style="width: 205px"
+ style="width: 180px"
@keyup.enter.native="handleQuery"
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- {{ scope.row.status == 1 ? "正常" : "停用" }}
-
-
{
for (let i in response.rows) {
@@ -1428,6 +1464,22 @@ export default {
`equipment_template_${new Date().getTime()}.xlsx`
);
},
+
+ // 设备状态修改
+ handleStatusChange(row) {
+ let text = row.status === "1" ? "启用" : "停用";
+ this.$modal
+ .confirm('确认要"' + text + '""' + row.equipmentCode + '"设备吗?')
+ .then(function () {
+ return changeEquipmentStatus(row.equipmentId, row.status);
+ })
+ .then(() => {
+ this.$modal.msgSuccess(text + "成功");
+ })
+ .catch(function () {
+ row.status = row.status === "0" ? "1" : "0";
+ });
+ },
},
};