From 90327110ec4e600b31f3b36386a5b6cece5686a0 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Mon, 27 Nov 2023 16:48:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20=E8=AE=BE=E5=A4=87=E7=8A=B6=E6=80=81+=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=98=AF=E5=90=A6=E5=90=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/equipment.js | 13 ++++++ src/views/wms/equipment/index.vue | 72 ++++++++++++++++++++++++++----- 2 files changed, 75 insertions(+), 10 deletions(-) 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" > + + + + + + + + + + + - - - { 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"; + }); + }, }, };