From 31f0fe4c7b914b0e7e7c181e248da3a020828bbb Mon Sep 17 00:00:00 2001
From: qb <1191961160@qq.com>
Date: Thu, 12 Oct 2023 19:15:15 +0800
Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E9=A1=B5=E9=9D=A2=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/distribution/createTask.js | 11 +++
.../checkInventoryTask/createTask.vue | 78 +++++++++++--------
2 files changed, 57 insertions(+), 32 deletions(-)
diff --git a/src/api/distribution/createTask.js b/src/api/distribution/createTask.js
index 0b83f762..7b84f208 100644
--- a/src/api/distribution/createTask.js
+++ b/src/api/distribution/createTask.js
@@ -43,4 +43,15 @@ export const postEditTaskQuestUpdate = data => {
method: 'post',
data,
});
+};
+
+/**
+ * 批量删除盘点任务
+ */
+export const postBatchDelete = params => {
+ return request({
+ url: '/api/logpm-warehouse/blade-taskQuest/taskQuest/remove',
+ method: 'post',
+ params,
+ });
};
\ No newline at end of file
diff --git a/src/views/distribution/checkInventoryTask/createTask.vue b/src/views/distribution/checkInventoryTask/createTask.vue
index e3c8cc89..076bc699 100644
--- a/src/views/distribution/checkInventoryTask/createTask.vue
+++ b/src/views/distribution/checkInventoryTask/createTask.vue
@@ -31,6 +31,9 @@
创建盘点任务
+
+ 批量删除
+
@@ -190,6 +193,7 @@ import {
postAddtaskQuest,
getTaskQuestPage,
postEditTaskQuestUpdate,
+ postBatchDelete,
} from '@/api/distribution/createTask';
import { mapGetters } from 'vuex';
import dayjs from 'dayjs';
@@ -327,11 +331,6 @@ export default {
// 弹框标题
title: '',
- stockList: {}, //拆包对象
- // stockId: '', //拆包id
- // materialId: '', //物料id
- // marketId: '', //客户id
- // storeId: '', //客户id
// 是否展示弹框
box: false,
// 是否显示查询
@@ -449,6 +448,9 @@ export default {
},
},
methods: {
+ /**
+ * 表单事件选择器改变时触发回调
+ */
timeChange(value) {
// 当前时间戳
const _time = new Date().getTime();
@@ -510,6 +512,40 @@ export default {
}
},
+ /**
+ * 批量删除
+ */
+ handleBatchDelete() {
+ if (this.selectionList.length === 0)
+ return this.$message({
+ type: 'error',
+ message: '最少选择一条数据',
+ });
+ const ids = this.selectionList.map(item => item.id).join(',');
+
+ this.$confirm('确定将选择数据删除?', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ })
+ .then(async () => {
+ return postBatchDelete({ ids });
+ })
+ .then((res) => {
+ this.onLoad(this.page);
+ const { code, msg } = res.data;
+ if (code === 200) {
+ return this.$message({
+ type: 'success',
+ message: msg,
+ });
+ }
+ });
+
+
+
+ },
+
btnsc(index, row) {
console.log(index, row);
},
@@ -685,7 +721,7 @@ export default {
formData.endTime = this.form.time[1].toLocaleString();
console.log('formData :>> ', formData);
formData.questStatus = this.form.dictKey;
- formData.questNum = this.form.questNum;
+ formData.id = this.form.id;
const res = await postEditTaskQuestUpdate(formData);
const { code, msg } = res.data;
@@ -704,40 +740,17 @@ export default {
this.box = false;
},
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning('请选择至少一条数据');
- return;
- }
- this.$confirm('确定将选择数据删除?', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- return;
- })
- .then(() => {
- this.selectionClear();
- this.onLoad(this.page);
- this.$message({
- type: 'success',
- message: '操作成功!',
- });
- });
- },
-
/**
* 删除单个任务
*/
- handleDeleteCheck() {
+ handleDeleteCheck(row) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
- return;
+ return postBatchDelete({ids: row.id});
})
.then(() => {
this.onLoad(this.page);
@@ -770,7 +783,7 @@ export default {
this.form.clientList = row.list.map(val => val.refId);
this.form.dictKey = row.questStatus;
this.form.selectList = [];
- this.form.questNum = row.questNum;
+ this.form.id = row.id;
console.log('this.form :>> ', this.form);
@@ -799,6 +812,7 @@ export default {
},
selectionChange(list) {
this.selectionList = list;
+ console.log('this.selectionList :>> ', this.selectionList);
},
selectionClear() {
this.selectionList = [];