feat(wms): 添加批量处理和批量忽略功能
This commit is contained in:
@@ -38,11 +38,35 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleBatchProcess"
|
||||||
|
>批量处理</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleBatchIgnore"
|
||||||
|
>批量忽略</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="materialWarningList" @selection-change="handleSelectionChange" :row-class-name="getRowClassName">
|
<el-table v-loading="loading" :data="materialWarningList" @selection-change="handleSelectionChange" :row-class-name="getRowClassName">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<!-- <el-table-column label="钢卷ID" align="center" prop="coilId" /> -->
|
<!-- <el-table-column label="钢卷ID" align="center" prop="coilId" /> -->
|
||||||
<el-table-column label="告警类型" align="center" prop="warningType">
|
<el-table-column label="告警类型" align="center" prop="warningType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -154,7 +178,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listMaterialWarning, getMaterialWarning, delMaterialWarning, addMaterialWarning, updateMaterialWarning } from "@/api/wms/materialWarning";
|
import { listMaterialWarning, getMaterialWarning, delMaterialWarning, addMaterialWarning, updateMaterialWarning, batchHandleMaterial } from "@/api/wms/materialWarning";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MaterialWarning",
|
name: "MaterialWarning",
|
||||||
@@ -330,6 +354,42 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/** 批量处理按钮操作 */
|
||||||
|
handleBatchProcess() {
|
||||||
|
if (this.ids.length === 0) {
|
||||||
|
this.$modal.msgWarning("请至少选择一条记录");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$modal.confirm('确认将选中的 ' + this.ids.length + ' 条告警标记为已处理?').then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return batchHandleMaterial({ warningIds: this.ids, warningStatus: 1 });
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.$modal.msgSuccess("批量处理成功");
|
||||||
|
this.getList();
|
||||||
|
}).catch(() => {
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 批量忽略按钮操作 */
|
||||||
|
handleBatchIgnore() {
|
||||||
|
if (this.ids.length === 0) {
|
||||||
|
this.$modal.msgWarning("请至少选择一条记录");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$modal.confirm('确认将选中的 ' + this.ids.length + ' 条告警标记为已忽略?').then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return batchHandleMaterial({ warningIds: this.ids, warningStatus: 2 });
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.$modal.msgSuccess("批量忽略成功");
|
||||||
|
this.getList();
|
||||||
|
}).catch(() => {
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user