diff --git a/src/api/distribution/SeparateTheList.js b/src/api/distribution/SeparateTheList.js
index 7ff39556..54a415a0 100644
--- a/src/api/distribution/SeparateTheList.js
+++ b/src/api/distribution/SeparateTheList.js
@@ -1,9 +1,18 @@
import request from '@/axios';
-export const $_alltasklist = (params) => {
+export const $_alltasklist = params => {
return request({
url: '/api/logpm-distribution/split-order-task/all-task-list',
method: 'get',
- params
+ params,
});
-};
\ No newline at end of file
+};
+
+// 完成总任务
+export const $_finishalltask = params => {
+ return request({
+ url: '/api/logpm-distribution/split-order-task/finish-all-task',
+ method: 'post',
+ params,
+ });
+};
diff --git a/src/option/distribution/SeparateTheList.js b/src/option/distribution/SeparateTheList.js
index 802ba7d3..5decb506 100644
--- a/src/option/distribution/SeparateTheList.js
+++ b/src/option/distribution/SeparateTheList.js
@@ -58,9 +58,9 @@ export const columnList = [
},
{
- prop: 'state',
+ prop: 'stateNameS',
label: '拆单任务状态',
- type: 1,
+ type: 3,
values: '',
width: '150',
fixed: true,
diff --git a/src/views/distribution/inventory/delivery/SeparateTheList.vue b/src/views/distribution/inventory/delivery/SeparateTheList.vue
index f21e67cb..f08a453f 100644
--- a/src/views/distribution/inventory/delivery/SeparateTheList.vue
+++ b/src/views/distribution/inventory/delivery/SeparateTheList.vue
@@ -53,8 +53,8 @@
>
- 详 情
-
+ 详 情
+ 完成任务
取 消
@@ -111,83 +111,82 @@ import { columnList } from '@/option/distribution/SeparateTheList.js';
import { useStore } from 'vuex';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
-import { $_alltasklist } from '@/api/distribution/SeparateTheList';
+import { $_alltasklist, $_finishalltask } from '@/api/distribution/SeparateTheList';
// 获取路由实例
const $router = useRouter();
const $store = useStore();
-const details =
- reactive ({
- /** 是否开启搜索 */
- search: true,
- /** 表格搜索条件 */
- query: {},
- /** 时间快捷选择设置 */
- shortcuts: [
- {
- text: '最近一周',
- value: () => {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- return [start, end];
- },
- },
- {
- text: '最近一个月',
- value: () => {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- return [start, end];
- },
- },
- {
- text: '最近三个月',
- value: () => {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- return [start, end];
- },
+const details = reactive({
+ /** 是否开启搜索 */
+ search: true,
+ /** 表格搜索条件 */
+ query: {},
+ /** 时间快捷选择设置 */
+ shortcuts: [
+ {
+ text: '最近一周',
+ value: () => {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+ return [start, end];
},
- ],
- /** 列表 */
- columnList: deepClone(columnList),
- /** 列表数据 */
- data: [],
- /** 页面loading */
- loadingObj: {
- /** 列表加载loading */
- list: false,
- /** 页面loading */
- pageLoading: false,
- },
- /** 列表复选框选中的数据 */
- selectionList: [],
- /** 是否显示设置表格 */
- drawerShow: false,
- /** 分页参数 */
- page: {
- current: 1,
- size: 30,
- total: 0,
},
- /** 弹出层显示 */
- popUpShow: {
- /** 图片预览 */
- abnormalVisited: false,
+ {
+ text: '最近一个月',
+ value: () => {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+ return [start, end];
+ },
},
- /** 列表Dom节点 */
- listNode: '',
- form: {},
- /** 全屏 */
- fullscreenObj: {
- /** 查看 */
- view: false,
+ {
+ text: '最近三个月',
+ value: () => {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+ return [start, end];
+ },
},
- });
+ ],
+ /** 列表 */
+ columnList: deepClone(columnList),
+ /** 列表数据 */
+ data: [],
+ /** 页面loading */
+ loadingObj: {
+ /** 列表加载loading */
+ list: false,
+ /** 页面loading */
+ pageLoading: false,
+ },
+ /** 列表复选框选中的数据 */
+ selectionList: [],
+ /** 是否显示设置表格 */
+ drawerShow: false,
+ /** 分页参数 */
+ page: {
+ current: 1,
+ size: 30,
+ total: 0,
+ },
+ /** 弹出层显示 */
+ popUpShow: {
+ /** 图片预览 */
+ abnormalVisited: false,
+ },
+ /** 列表Dom节点 */
+ listNode: '',
+ form: {},
+ /** 全屏 */
+ fullscreenObj: {
+ /** 查看 */
+ view: false,
+ },
+});
const { search, query, shortcuts, stockupDate, data, loadingObj, selectionList, drawerShow, page } =
toRefs(details);
@@ -212,6 +211,15 @@ const onLoad = debounce(async (params = {}) => {
console.log('初始化参数 ', res);
const { code, data } = res.data;
if (code !== 200) return;
+ data.records.forEach(item => {
+ if (item.state == 1) {
+ item.stateNameS = '未完成';
+ } else if (item.state == 2) {
+ item.stateNameS = '已完成';
+ } else if (item.state == 3) {
+ item.stateNameS = '已撤销';
+ }
+ });
details.data = data.records;
handleTranslationDataSeclect(details.data, details.columnList);
details.page.total = data.total;
@@ -346,6 +354,24 @@ const handleDelete = (isBatch, row = {}) => {
const handleExport = () => {
getVehicleExport();
};
+// 完成任务
+const determine = row => {
+ console.log(row);
+ ElMessageBox.confirm('是否确认完成任务?', '提示', {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ })
+ .then(() => {
+ let data = {
+ taskId: row.id,
+ };
+ $_finishalltask(data).then(res => {
+ console.log(res, '完成');
+ });
+ })
+ .catch(() => {});
+};