|
@@ -24,13 +24,17 @@
|
|
|
<el-form-item style="margin-left: 0">
|
|
|
<el-button type="info" icon="Search" @click="submitQuery">提交
|
|
|
</el-button>
|
|
|
+ <el-button type="danger" icon="Close" @click="deleteLots">删除
|
|
|
+ </el-button>
|
|
|
<el-button type="primary" icon="Check" @click="handleTaksLot">一键盘点
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="el-table-container">
|
|
|
<div class="el-table-inner-container">
|
|
|
- <el-table v-loading="loading" :data="dataList" size="small" border height="100%">
|
|
|
+ <el-table v-loading="loading" :data="dataList" size="small" border height="100%"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="48" align="center" />
|
|
|
<el-table-column label="行号" type="index" align="center" width="48" />
|
|
|
<el-table-column label="批次号" prop="lotCode" align="center" width="120px">
|
|
|
<template #default="scope">
|
|
@@ -116,6 +120,9 @@ const total = ref(0)
|
|
|
const isDispatch = ref(false)
|
|
|
const deptList = ref([])
|
|
|
const dataList = ref([])
|
|
|
+const ids = ref([]);
|
|
|
+const single = ref(true);
|
|
|
+const multiple = ref(true);
|
|
|
/** 查询对象 */
|
|
|
const queryParams = ref({
|
|
|
pageNum: 1,
|
|
@@ -196,6 +203,18 @@ function submitQuery() {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+// 多选框选中数据
|
|
|
+function handleSelectionChange(selection) {
|
|
|
+ ids.value = selection.map((item) => item.id);
|
|
|
+ single.value = selection.length != 1;
|
|
|
+ multiple.value = !selection.length;
|
|
|
+}
|
|
|
+
|
|
|
+function deleteLots() {
|
|
|
+ dataList.value = dataList.value.filter(e => !ids.value.includes(e.id))
|
|
|
+ handleSelectionChange([])
|
|
|
+}
|
|
|
/** 取消按钮 */
|
|
|
const cancel = () => {
|
|
|
visible.value = false;
|