|
|
@@ -28,10 +28,7 @@
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="AGV编号" class="horizontal-form-item">
|
|
|
- <a-input
|
|
|
- v-model:value="formData.agvNo" class="w-full" placeholder="请输入AGV编号"
|
|
|
- @press-enter="searchDatas"
|
|
|
- />
|
|
|
+ <a-input v-model:value="formData.agvNo" class="w-full" placeholder="请输入AGV编号" @press-enter="searchDatas" />
|
|
|
</a-form-item>
|
|
|
<a-form-item label="是否成功" class="horizontal-form-item">
|
|
|
<a-select
|
|
|
@@ -49,20 +46,25 @@
|
|
|
</a-form>
|
|
|
|
|
|
<CommonTable
|
|
|
- ref="commonTableRef" :columns="columns" :data-source="taskList" :total="totalSize"
|
|
|
- :is-select="false" @get-pager="getPageParams"
|
|
|
+ ref="commonTableRef" :columns="columns" :data-source="taskList" :total="totalSize" :is-select="false" :extra-height="90"
|
|
|
+ @get-pager="getPageParams"
|
|
|
>
|
|
|
<template #bodyCell="{ column, record, index }">
|
|
|
<template v-if="column.dataIndex === 'index'">
|
|
|
{{ index + 1 }}
|
|
|
</template>
|
|
|
+ <template v-if="column.dataIndex === 'documentNo'">
|
|
|
+ <a-button type="link" @click="openWindow(record)">{{ record.documentNo }}</a-button>
|
|
|
+ </template>
|
|
|
<template v-if="column.dataIndex === 'success'">
|
|
|
<a-tag v-if="record.success === true" color="green">成功</a-tag>
|
|
|
</template>
|
|
|
<template v-if="column.dataIndex === 'operation'">
|
|
|
<a-tag v-if="record.executeStatus === '已完成'" color="green">已完成</a-tag>
|
|
|
- <a-tag v-if="record.executeStatus === '执行中'" color="error">执行中</a-tag>
|
|
|
- <a-button v-else type="link" @click="executeTask(record)">执行</a-button>
|
|
|
+ <a-button v-if="record.executeStatus === '执行中'" type="link" danger @click="cancelTask(record)">取消任务</a-button>
|
|
|
+ <a-button v-if="record.executeStatus === '未开始'" type="link" @click="executeTask(record)">
|
|
|
+ 执行
|
|
|
+ </a-button>
|
|
|
</template>
|
|
|
</template>
|
|
|
</CommonTable>
|
|
|
@@ -73,6 +75,7 @@
|
|
|
<script setup>
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
import Common from '../common/Common';
|
|
|
+import { Uuid } from 'pc-component-v3';
|
|
|
import { message } from 'ant-design-vue';
|
|
|
import CommonTable from '../common/CommonTable.vue';
|
|
|
import { taskColumns, workOptions, executeOptions, successOptions } from '../common/transferTask';
|
|
|
@@ -116,6 +119,17 @@ const executeTask = record => {
|
|
|
executeTaskById(record.schedulingTasksId);
|
|
|
};
|
|
|
|
|
|
+// 执行任务
|
|
|
+const cancelTask = record => {
|
|
|
+ cancelTaskById(record.schedulingTasksId);
|
|
|
+};
|
|
|
+
|
|
|
+// 打开窗口
|
|
|
+const openWindow = record => {
|
|
|
+ const url = Common.getHostPageBaseURL() + `#/desktop/window1/window-read/view/${record.windowNo}/0/${record.documentId}?currPage=1&currIndex=1&totalCount=1&uuid=${Uuid.createUUID()}`;
|
|
|
+ window.open(url,'_blank');
|
|
|
+};
|
|
|
+
|
|
|
// 条件变化查询
|
|
|
const searchDatas = () => {
|
|
|
commonTableRef.value.backFirstPage();
|
|
|
@@ -206,26 +220,51 @@ const executeTaskById = id => {
|
|
|
});
|
|
|
|
|
|
};
|
|
|
+// 取消任务Api
|
|
|
+const cancelTaskById = id => {
|
|
|
+ loading.value = true;
|
|
|
+ $.ajax({
|
|
|
+ type: 'get',
|
|
|
+ url: Common.getApiURL(`SchedulingTasksResource/cancelWorkById?schedulingTasksId=${id}`),
|
|
|
+ beforeSend(request) {
|
|
|
+ Common.addTokenToRequest(request);
|
|
|
+ },
|
|
|
+ success: function ({ errorCode, errorMessage }) {
|
|
|
+ if (errorCode === 0) {
|
|
|
+ searchDatas();
|
|
|
+ message.success('取消成功!');
|
|
|
+ } else {
|
|
|
+ searchDatas();
|
|
|
+ message.warning(errorMessage);
|
|
|
+ }
|
|
|
+ loading.value = false;
|
|
|
+ },
|
|
|
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
+ loading.value = false;
|
|
|
+ Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
.horizontal-form-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- gap: 8px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 8px;
|
|
|
}
|
|
|
|
|
|
.w-full {
|
|
|
- width: 230px;
|
|
|
+ width: 230px;
|
|
|
}
|
|
|
|
|
|
:deep(.ant-form-item-label > label) {
|
|
|
- font-size: 14px !important;
|
|
|
- font-weight: 600 !important;
|
|
|
+ font-size: 14px !important;
|
|
|
+ font-weight: 600 !important;
|
|
|
}
|
|
|
|
|
|
:deep(.ant-form-item) {
|
|
|
- margin-bottom: 0px !important;
|
|
|
- margin-right: 16px !important;
|
|
|
+ margin-bottom: 0px !important;
|
|
|
+ margin-right: 16px !important;
|
|
|
}
|
|
|
</style>
|