😎前端控件增加加载动画;bom、工艺路线列表默认显示行数改为2000行

This commit is contained in:
bairubing 2024-10-25 10:51:11 +08:00
parent 179b17a4c8
commit 04e0050b97
6 changed files with 220 additions and 76 deletions

View File

@ -45,7 +45,8 @@
<template #row_buttons="{ row }"> <template #row_buttons="{ row }">
<el-tooltip content="同步到ERP" placement="top"> <el-tooltip content="同步到ERP" placement="top">
<el-button icon="ele-Promotion" size="small" text="" type="success" @click="syncToSAP(row)" <el-button icon="ele-Promotion" size="small" text="" type="success" @click="syncToSAP(row)"
v-auth="'productionMaterialsManagement/syncToSAP'" v-if="row.fld004607=='A'||row.fld004607=='M'"> 同步到SAP </el-button> v-auth="'productionMaterialsManagement/syncToSAP'"
v-if="row.fld004607 == 'A' || row.fld004607 == 'M'"> 同步到SAP </el-button>
</el-tooltip> </el-tooltip>
</template> </template>
</vxe-grid> </vxe-grid>
@ -57,7 +58,7 @@
<script lang="ts" setup name="productionMaterialsManagement"> <script lang="ts" setup name="productionMaterialsManagement">
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { auth } from '/@/utils/authFunction'; import { auth } from '/@/utils/authFunction';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table'; import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
@ -134,9 +135,9 @@ const gridEvents: VxeGridListeners = {
const options = useVxeTable( const options = useVxeTable(
{ {
id: 'productionMaterialsManagement', id: 'productionMaterialsManagement',
name: '产品管理', name: '生产物料',
columns: [ columns: [
{ type: 'checkbox', title: '', width: 60}, { type: 'checkbox', title: '', width: 60 },
{ type: 'seq', title: '序号', width: 60 }, { type: 'seq', title: '序号', width: 60 },
{ field: '_System_objNBS', title: '项目编号', minWidth: 100, showOverflow: 'tooltip', sortable: false }, { field: '_System_objNBS', title: '项目编号', minWidth: 100, showOverflow: 'tooltip', sortable: false },
{ field: '_System_ObjDescription', title: '项目名称', minWidth: 100, showOverflow: 'tooltip', sortable: false }, { field: '_System_ObjDescription', title: '项目名称', minWidth: 100, showOverflow: 'tooltip', sortable: false },
@ -171,6 +172,10 @@ onMounted(() => {
// SAP // SAP
const syncToSAP = async (row: any) => { const syncToSAP = async (row: any) => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '同步中,请勿操作',
});
ElMessageBox.confirm(`确定要同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要同步物料吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -184,8 +189,13 @@ const syncToSAP = async (row: any) => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
}; };
@ -194,7 +204,10 @@ const syncToSAP = async (row: any) => {
const batchSyncToSAP = async () => { const batchSyncToSAP = async () => {
options.loading = true; options.loading = true;
var data = xGrid.value?.getCheckboxRecords(); var data = xGrid.value?.getCheckboxRecords();
//
const loadingInstance = ElLoading.service({
text: '批量同步中,请勿操作',
});
ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -213,13 +226,18 @@ const batchSyncToSAP = async () => {
error++ error++
} }
} }
//
loadingInstance.close();
ElMessageBox.alert("同步成功:" + succeed + "" + "同步失败:" + error, '批量同步结果', { ElMessageBox.alert("同步成功:" + succeed + "" + "同步失败:" + error, '批量同步结果', {
// //
// autofocus: false, // autofocus: false,
confirmButtonText: 'OK' confirmButtonText: 'OK'
}) })
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }

View File

@ -57,7 +57,7 @@
<script lang="ts" setup name="administrativeMaterialManagement"> <script lang="ts" setup name="administrativeMaterialManagement">
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { auth } from '/@/utils/authFunction'; import { auth } from '/@/utils/authFunction';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table'; import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
@ -171,6 +171,10 @@ onMounted(() => {
// SAP // SAP
const syncToSAP = async (row: any) => { const syncToSAP = async (row: any) => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '同步中,请勿操作',
});
ElMessageBox.confirm(`确定要同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要同步物料吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -184,8 +188,13 @@ const syncToSAP = async (row: any) => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
}; };
@ -193,6 +202,10 @@ const syncToSAP = async (row: any) => {
//SAP //SAP
const batchSyncToSAP = async () => { const batchSyncToSAP = async () => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '批量同步中,请勿操作',
});
var data = xGrid.value?.getCheckboxRecords(); var data = xGrid.value?.getCheckboxRecords();
ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', {
@ -218,8 +231,13 @@ const batchSyncToSAP = async () => {
// autofocus: false, // autofocus: false,
confirmButtonText: 'OK' confirmButtonText: 'OK'
}) })
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }

View File

@ -72,7 +72,7 @@
<!-- 这里可以放置 BOM 的具体内容 --> <!-- 这里可以放置 BOM 的具体内容 -->
<el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;"> <el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;">
<el-form :model="stateBom.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" <el-form :model="stateBom.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true"
label-width="auto" style="flex: 1 1 0%" @submit.prevent="handleQueryBom"> label-width="auto" style="flex: 1 1 0%;display: none;" @submit.prevent="handleQueryBom">
<el-input v-model="stateBom.queryParams.ParentGuid" placeholder="父GUID" @click="handleQueryBom" /> <el-input v-model="stateBom.queryParams.ParentGuid" placeholder="父GUID" @click="handleQueryBom" />
</el-form> </el-form>
@ -91,7 +91,7 @@
<!-- 这里可以放置 BOM 的具体内容 --> <!-- 这里可以放置 BOM 的具体内容 -->
<el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;"> <el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;">
<el-form :model="stateProcessRoute.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" <el-form :model="stateProcessRoute.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true"
label-width="auto" style="flex: 1 1 0%" @submit.prevent="handleQueryProcessRoute"> label-width="auto" style="flex: 1 1 0% ;display: none" @submit.prevent="handleQueryProcessRoute">
<el-input v-model="stateProcessRoute.queryParams.ParentGuid" placeholder="父GUID" @click="handleQueryProcessRoute" /> <el-input v-model="stateProcessRoute.queryParams.ParentGuid" placeholder="父GUID" @click="handleQueryProcessRoute" />
</el-form> </el-form>
@ -111,7 +111,7 @@
<script lang="ts" setup name="productManagement"> <script lang="ts" setup name="productManagement">
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { auth } from '/@/utils/authFunction'; import { auth } from '/@/utils/authFunction';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table'; import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
@ -249,6 +249,10 @@ const gridEvents: VxeGridListeners = {
// SAP // SAP
const syncToSAP = async (row: any) => { const syncToSAP = async (row: any) => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '同步中,请勿操作',
});
ElMessageBox.confirm(`确定要同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要同步物料吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -262,8 +266,13 @@ const syncToSAP = async (row: any) => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
}; };
@ -296,7 +305,7 @@ const stateBom = reactive({
ParentGuid: undefined ParentGuid: undefined
}, },
localPageParam: { localPageParam: {
pageSize: 50 as number, pageSize: 2000 as number,
defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' }, defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' },
}, },
visible: false, visible: false,
@ -349,6 +358,10 @@ const handleQueryBom = async (reset = false) => {
//Bomsap //Bomsap
const syncToSAPBom = async () => { const syncToSAPBom = async () => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: 'Bom同步中请勿操作',
});
var data = bomxGrid.value?.getTableData().fullData; var data = bomxGrid.value?.getTableData().fullData;
ElMessageBox.confirm(`确定要同步BOM吗`, '提示', { ElMessageBox.confirm(`确定要同步BOM吗`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -363,13 +376,22 @@ const syncToSAPBom = async () => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }
//SAP //SAP
const batchSyncToSAP = async () => { const batchSyncToSAP = async () => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '批量同步中,请勿操作',
});
var data = xGrid.value?.getCheckboxRecords(); var data = xGrid.value?.getCheckboxRecords();
ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', {
@ -396,8 +418,13 @@ const batchSyncToSAP = async () => {
// autofocus: false, // autofocus: false,
confirmButtonText: 'OK' confirmButtonText: 'OK'
}) })
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }
@ -422,7 +449,7 @@ const stateProcessRoute = reactive({
ParentGuid: undefined ParentGuid: undefined
}, },
localPageParam: { localPageParam: {
pageSize: 50 as number, pageSize: 2000 as number,
defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' }, defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' },
}, },
visible: false, visible: false,
@ -475,6 +502,10 @@ const handleQueryProcessRoute = async (reset = false) => {
//线sap //线sap
const syncToSAPprocessRoute = async () => { const syncToSAPprocessRoute = async () => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '工艺路线同步中,请勿操作',
});
var data = processRoutexGrid.value?.getTableData().fullData; var data = processRoutexGrid.value?.getTableData().fullData;
ElMessageBox.confirm(`确定要同步工艺路线吗?`, '提示', { ElMessageBox.confirm(`确定要同步工艺路线吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -489,8 +520,13 @@ const syncToSAPprocessRoute = async () => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }

View File

@ -64,7 +64,7 @@
<!-- 这里可以放置 BOM 的具体内容 --> <!-- 这里可以放置 BOM 的具体内容 -->
<el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;"> <el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;">
<el-form :model="stateBom.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" <el-form :model="stateBom.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true"
label-width="auto" style="flex: 1 1 0%" @submit.prevent="handleQueryBom"> label-width="auto" style="flex: 1 1 0%;display: none;" @submit.prevent="handleQueryBom">
<el-input v-model="stateBom.queryParams.ParentGuid" placeholder="父GUID" @click="handleQueryBom" /> <el-input v-model="stateBom.queryParams.ParentGuid" placeholder="父GUID" @click="handleQueryBom" />
</el-form> </el-form>
@ -82,7 +82,7 @@
<!-- 这里可以放置 BOM 的具体内容 --> <!-- 这里可以放置 BOM 的具体内容 -->
<el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;"> <el-card class="full-table" shadow="hover" style="margin-top: 5px;height: 100%;">
<el-form :model="stateProcessRoute.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" <el-form :model="stateProcessRoute.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true"
label-width="auto" style="flex: 1 1 0%" @submit.prevent="handleQueryProcessRoute"> label-width="auto" style="flex: 1 1 0%;display: none" @submit.prevent="handleQueryProcessRoute">
<el-input v-model="stateProcessRoute.queryParams.ParentGuid" placeholder="父GUID" @click="handleQueryProcessRoute" /> <el-input v-model="stateProcessRoute.queryParams.ParentGuid" placeholder="父GUID" @click="handleQueryProcessRoute" />
</el-form> </el-form>
@ -100,7 +100,7 @@
</template> </template>
<script lang="ts" setup name="projectManagement"> <script lang="ts" setup name="projectManagement">
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { auth } from '/@/utils/authFunction'; import { auth } from '/@/utils/authFunction';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table'; import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
@ -226,6 +226,10 @@ const handleQuery = async (reset = false) => {
// SAP // SAP
const syncToSAP = async (row: any) => { const syncToSAP = async (row: any) => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '同步中,请勿操作',
});
ElMessageBox.confirm(`确定要同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要同步物料吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -239,8 +243,13 @@ const syncToSAP = async (row: any) => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
}; };
@ -248,6 +257,10 @@ const syncToSAP = async (row: any) => {
//SAP //SAP
const batchSyncToSAP = async () => { const batchSyncToSAP = async () => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '批量同步中,请勿操作',
});
var data = xGrid.value?.getCheckboxRecords(); var data = xGrid.value?.getCheckboxRecords();
ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', {
@ -273,8 +286,13 @@ const batchSyncToSAP = async () => {
// autofocus: false, // autofocus: false,
confirmButtonText: 'OK' confirmButtonText: 'OK'
}) })
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }
@ -287,7 +305,7 @@ const stateBom = reactive({
ParentGuid: undefined ParentGuid: undefined
}, },
localPageParam: { localPageParam: {
pageSize: 50 as number, pageSize: 2000 as number,
defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' }, defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' },
}, },
visible: false, visible: false,
@ -349,6 +367,10 @@ const handleQueryBom = async (reset = false) => {
//Bomsap //Bomsap
const syncToSAPBom = async () => { const syncToSAPBom = async () => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: 'Bom同步中请勿操作',
});
var data = bomxGrid.value?.getTableData().fullData; var data = bomxGrid.value?.getTableData().fullData;
ElMessageBox.confirm(`确定要同步BOM吗`, '提示', { ElMessageBox.confirm(`确定要同步BOM吗`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -363,8 +385,13 @@ const syncToSAPBom = async () => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }
@ -389,7 +416,7 @@ const stateProcessRoute = reactive({
ParentGuid: undefined ParentGuid: undefined
}, },
localPageParam: { localPageParam: {
pageSize: 50 as number, pageSize: 2000 as number,
defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' }, defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' },
}, },
visible: false, visible: false,
@ -442,6 +469,10 @@ const handleQueryProcessRoute = async (reset = false) => {
//线sap //线sap
const syncToSAPprocessRoute = async () => { const syncToSAPprocessRoute = async () => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '工艺路线同步中,请勿操作',
});
var data = processRoutexGrid.value?.getTableData().fullData; var data = processRoutexGrid.value?.getTableData().fullData;
ElMessageBox.confirm(`确定要同步工艺路线吗?`, '提示', { ElMessageBox.confirm(`确定要同步工艺路线吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -456,8 +487,13 @@ const syncToSAPprocessRoute = async () => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }

View File

@ -50,7 +50,7 @@
<script lang="ts" setup name="changeNoticeEcn"> <script lang="ts" setup name="changeNoticeEcn">
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { auth } from '/@/utils/authFunction'; import { auth } from '/@/utils/authFunction';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table'; import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
@ -91,7 +91,7 @@ const options = useVxeTable(
{ type: 'checkbox', title: '', width: 60 }, { type: 'checkbox', title: '', width: 60 },
{ type: 'seq', title: '序号', width: 60 }, { type: 'seq', title: '序号', width: 60 },
{ field: '_System_objNBS', title: 'ECN编号', minWidth: 100, showOverflow: 'tooltip', sortable: false }, { field: '_System_objNBS', title: 'ECN编号', minWidth: 100, showOverflow: 'tooltip', sortable: false },
{ field: '_System_objDescription', title: '变更原因', minWidth: 100, showOverflow: 'tooltip', sortable: false }, { field: '_System_ObjDescription', title: '变更原因', minWidth: 100, showOverflow: 'tooltip', sortable: false },
{field: 'fld004693', title: '有效日期', minWidth: 100, showOverflow: 'tooltip', sortable: false }, {field: 'fld004693', title: '有效日期', minWidth: 100, showOverflow: 'tooltip', sortable: false },
{ field: '_System_CurrentStage', title: '_System_CurrentStage', minWidth: 100, showOverflow: 'tooltip', sortable: false }, { field: '_System_CurrentStage', title: '_System_CurrentStage', minWidth: 100, showOverflow: 'tooltip', sortable: false },
{ field: 'fld005294', title: '物料同步状态', minWidth: 100, showOverflow: 'tooltip', sortable: false }, { field: 'fld005294', title: '物料同步状态', minWidth: 100, showOverflow: 'tooltip', sortable: false },
@ -162,6 +162,10 @@ const gridEvents: VxeGridListeners = {
// SAP // SAP
const syncToSAP = async (row: any) => { const syncToSAP = async (row: any) => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '同步中,请勿操作',
});
ElMessageBox.confirm(`确定要同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要同步物料吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -175,8 +179,13 @@ const syncToSAP = async (row: any) => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
}; };
@ -184,6 +193,10 @@ const syncToSAP = async (row: any) => {
//ECNSAP //ECNSAP
const batchSyncToSAP = async () => { const batchSyncToSAP = async () => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '批量同步中,请勿操作',
});
var data = xGrid.value?.getCheckboxRecords(); var data = xGrid.value?.getCheckboxRecords();
ElMessageBox.confirm(`确定要批量同步ECN吗`, '提示', { ElMessageBox.confirm(`确定要批量同步ECN吗`, '提示', {
@ -209,8 +222,13 @@ const batchSyncToSAP = async () => {
// autofocus: false, // autofocus: false,
confirmButtonText: 'OK' confirmButtonText: 'OK'
}) })
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }

View File

@ -100,7 +100,7 @@
</template> </template>
<script lang="ts" setup name="projectManagement"> <script lang="ts" setup name="projectManagement">
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { auth } from '/@/utils/authFunction'; import { auth } from '/@/utils/authFunction';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table'; import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
@ -226,6 +226,10 @@ const handleQuery = async (reset = false) => {
// SAP // SAP
const syncToSAP = async (row: any) => { const syncToSAP = async (row: any) => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '同步中,请勿操作',
});
ElMessageBox.confirm(`确定要同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要同步物料吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -239,8 +243,13 @@ const syncToSAP = async (row: any) => {
} else { } else {
ElMessage.error("同步失败"); ElMessage.error("同步失败");
} }
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
}; };
@ -248,6 +257,10 @@ const syncToSAP = async (row: any) => {
//SAP //SAP
const batchSyncToSAP = async () => { const batchSyncToSAP = async () => {
options.loading = true; options.loading = true;
//
const loadingInstance = ElLoading.service({
text: '批量同步中,请勿操作',
});
var data = xGrid.value?.getCheckboxRecords(); var data = xGrid.value?.getCheckboxRecords();
ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', { ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', {
@ -273,8 +286,13 @@ const batchSyncToSAP = async () => {
// autofocus: false, // autofocus: false,
confirmButtonText: 'OK' confirmButtonText: 'OK'
}) })
//
loadingInstance.close();
}) })
.catch(() => { }); .catch(() => {
//
loadingInstance.close();
});
options.loading = false; options.loading = false;
} }