|
|
|
@ -31,6 +31,9 @@
|
|
|
|
|
<el-button icon="el-icon-plus" type="primary" @click="createCheckTask" |
|
|
|
|
>创建盘点任务</el-button |
|
|
|
|
> |
|
|
|
|
<el-button icon="el-icon-delete" type="primary" @click="handleBatchDelete"> |
|
|
|
|
批量删除 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
<!-- 头部右侧按钮模块 --> |
|
|
|
|
<div class="avue-crud__right"> |
|
|
|
@ -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 = []; |
|
|
|
|