Quellcode durchsuchen

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

ymy vor 1 Jahr
Ursprung
Commit
f57f338b0f

+ 1 - 2
src/views/audit/orderTask/index.vue

@@ -891,7 +891,7 @@
 							this.dataId = res.data;
 						} else this.$message.error(res.msg);
 					}).catch(() => loading.close());
-				} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
+				} else {
 					api.updateList(query, 'supplyTaskOrder').then((res : any) => {
 						loading.close();
 						if (res.code === 200) {
@@ -901,7 +901,6 @@
 						} else this.$message.error(res.msg);
 					}).catch(() => loading.close());
 				};
-
 			})
 		}
 		// 打开新增

+ 76 - 62
src/views/audit/outbound/index.vue

@@ -820,8 +820,8 @@
 						(this.$refs.bill as any).setBillFormValue(parentData[0]); // 设置单据表单数据
 						(this.$refs.bill as any).setBillTableValue(parentData[0].suborderList, 0);// 设置第1张单据表格数据
 					}, 0)
-				}
-			})
+				} else loading.close();
+			}).catch(() => loading.close());
 		}
 		// 获取机构数据
 		getSupplierModal(e : any) {
@@ -862,12 +862,15 @@
 				});
 				if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
 				console.log('出库参数query ==> ', query);
+
+				let loading = this.$loading({ target: '.main-container' });
 				if (this.isAdd) {
 					query.suborderList.map((v : any) => {
 						delete v.id;
 					});
 					delete query.id;
 					api.outbound(query, 'supplyOutOrder').then((res : any) => {
+						loading.close();
 						if (res.code === 200) {
 							this.isAdd = false;
 							this.isChange = false;
@@ -875,18 +878,19 @@
 							this.$message.success('保存成功');
 							this.dataId = res.data;
 						} else this.$message.error(res.msg);
-					})
+					}).catch(() => loading.close());
 				} else {
 					query.submitState = 0;
 					api.updateList(query, 'supplyOutOrder').then((res : any) => {
+						loading.close();
 						if (res.code === 200) {
 							this.$message.success('保存成功');
 							this.isChange = false;
 							this.isSubmit = true;
 						} else this.$message.error(res.msg);
-					})
+					}).catch(() => loading.close());
 				};
-				
+
 			})
 		}
 		// 切换tab栏
@@ -916,15 +920,15 @@
 			console.log('编辑this.tabType ==>', this.tabType);
 			console.log('编辑 ==>', e);
 			e = e.row ? e.row : e;
+			let loading = this.$loading({ target: '.main-container' });
 			api.single({ id: e.id }, 'supplyOutOrder').then((res : any) => {
 				if (res.code === 200) {
 					let parentData = res.data ? res.data : e;
 					this.baseInfo = parentData;
 					if (this.tabType === 'all' || this.tabType === 'draftsBox') {
-						let loading = this.$loading({ target: '.main-container' });
 						if (parentData.submitState === 1) {
-							loading.close();
-							return this.setReadonly(parentData)
+							this.setReadonly(parentData)
+							return loading.close();
 						}
 						let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
 						if (billConfig.tableConfig[0].table.columns.at(-1).title != '操作') {
@@ -974,13 +978,13 @@
 								this.dataId = '';
 								(this.$refs.bill as any).showTab = 'bill';
 								loading.close();
-							}
-						})
+							} else loading.close();
+						}).catch(() => loading.close());
 					} else {
 						this.setReadonly(parentData);
 					};
 				}
-			})
+			}).catch(() => loading.close());
 		}
 		// 设置只读
 		setReadonly(e : any) {
@@ -1004,6 +1008,7 @@
 			console.log('array', array);
 			//  查库存
 			api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
+				loading.close();
 				if (res.code === 200) {
 					let newData : any = []
 					res.data.map((v : any, i : any) => {
@@ -1016,9 +1021,8 @@
 					(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
 					this.isAdd = false;
 					(this.$refs.bill as any).showTab = 'bill';
-					loading.close();
 				}
-			})
+			}).catch(() => loading.close());
 		}
 		// 工具栏提交
 		onSmt(e : any) {
@@ -1032,12 +1036,14 @@
 					type: 'warning',
 					center: true
 				}).then(() => {
+					let loading = this.$loading({ target: '.main-container' });
 					api.submitTo({ id: selectData[0].id }, 'supplyOutOrder').then((res : any) => {
+						loading.close();
 						if (res.code === 200) {
 							this.$message.success('提交成功');
 							this.clickTab('draftsBox');
 						} else this.$message.error(res.msg)
-					})
+					}).catch(() => loading.close());
 				}).catch(() => this.$message.info('已取消提交'));
 			} else {
 				if (this.isAdd) return this.$message.warning('新增数据必须先保存才能提交');
@@ -1050,14 +1056,15 @@
 						type: 'warning',
 						center: true
 					}).then(() => {
+						let loading = this.$loading({ target: '.main-container' });
 						api.submitTo({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
+							loading.close();
 							if (res.code === 200) {
 								this.$message.success('提交成功');
-								this.clickTab(this.tabType);
 								this.isSubmit = false;
-								(this.$refs.bill as any).showTab = this.tabType;
+								this.clickTab(this.tabType);
 							} else this.$message.error(res.msg)
-						})
+						}).catch(() => loading.close());
 					}).catch(() => this.$message.info('已取消提交'));
 				} else {
 					// 表单旧数据
@@ -1086,14 +1093,15 @@
 							center: true
 						}).then(() => {
 							let id = this.dataId ? this.dataId : this.baseInfo.id;
+							let loading = this.$loading({ target: '.main-container' });
 							api.submitTo({ id: id }, 'supplyOutOrder').then((res : any) => {
+								loading.close();
 								if (res.code === 200) {
 									this.$message.success('提交成功');
-									this.clickTab(this.tabType);
 									this.dataId = '';
-									(this.$refs.bill as any).showTab = this.tabType;
+									this.clickTab(this.tabType);
 								} else this.$message.error(res.msg)
-							})
+							}).catch(() => loading.close());
 						}).catch(() => this.$message.info('已取消提交'));
 					}
 				}
@@ -1108,12 +1116,14 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.cancelSubmission({ id: e.id }, 'supplyOutOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
 						this.$message.success('反提交成功');
 						this.clickTab(this.tabType);
 					} else this.$message.error(res.msg)
-				})
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消反提交'));
 		}
 		// 工具栏反提交
@@ -1125,12 +1135,14 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.cancelSubmission({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
 						this.$message.success('反提交成功');
 						this.clickTab(this.tabType);
 					} else this.$message.error(res.msg)
-				})
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消反提交'));
 		}
 		// 初始化
@@ -1149,6 +1161,7 @@
 		getCitationList(query : any) {
 			let loading = this.$loading({ target: '.main-container' });
 			api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
+				loading.close();
 				if (res.code === 200) {
 					(this.$refs.bill as any).setSourceTableData(0, res.data.records);
 					let page = {
@@ -1156,14 +1169,18 @@
 						pageSize: res.data.size, //每页条数
 						total: res.data.total //总条数
 					};
-					loading.close();
 					(this.$refs.bill as any).setSourcePage(0, page);
-				} else this.failHandle(res)
-			})
+				} else this.$message.error(res.msg)
+			}).catch(() => loading.close());
 		}
 		// 获取分页数据
 		getPageList(query : any, type : any) {
+			let data = (this.$refs.bill as any).getTablePage(this.tabType);
+			query.pageNo = data.pageNo;
+			query.pageSize = data.pageSize;
+			let loading = this.$loading({ target: '.main-container' });
 			api.pageList(query, 'supplyOutOrder').then((res : any) => {
+				loading.close();
 				if (res.code === 200) {
 					(this.$refs.bill as any).setTabTableValue(type, res.data.records);
 					let page = {
@@ -1172,22 +1189,8 @@
 						total: res.data.total //总条数
 					};
 					(this.$refs.bill as any).setTablePage(type, page);
-				} else this.failHandle(res)
-			})
-		}
-		// 回收站数据
-		getSelectDeleteList(query : any) {
-			api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
-				if (res.code === 200) {
-					(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
-					let page = {
-						pageNo: res.data.current, //当前页
-						pageSize: res.data.size, //每页条数
-						total: res.data.total //总条数
-					};
-					(this.$refs.bill as any).setTablePage('recycleBin', page)
-				} else this.failHandle(res)
-			});
+				} else this.$message.error(res.msg)
+			}).catch(() => loading.close());
 		}
 		// 分页
 		pagination(e : any) {
@@ -1198,37 +1201,49 @@
 			let loading = this.$loading({ target: '.main-container' });
 			if (e.type === 'recycleBin') {
 				api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
 						(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
-						loading.close()
-					} else this.failHandle(res)
-				});
+					} else this.$message.error(res.msg)
+				}).catch(() => loading.close());
 			} else {
 				api.pageList(query, 'supplyOutOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
 						(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
-						loading.close()
-					} else this.failHandle(res)
-				})
+					} else this.$message.error(res.msg)
+				}).catch(() => loading.close());
 			}
 		}
+		// 回收站数据
+		getSelectDeleteList(query : any) {
+			let loading = this.$loading({ target: '.main-container' });
+			api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
+				loading.close();
+				if (res.code === 200) {
+					(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.bill as any).setTablePage('recycleBin', page)
+				} else this.$message.error(res.msg)
+			}).catch(() => loading.close());
+		}
 		// 搜索
 		search(parames : any) {
-			let loading = this.$loading({ target: '.main-container' });
 			console.log('搜索 ==> ', parames);
 			let query = parames.value;
 			if (parames.type === 'source_0') {
 				this.getCitationList(query);
-				loading.close();
 			} else {
 				if (parames.type === 'recycleBin') {
 					this.getSelectDeleteList(query); // 回收站分页数据
-					loading.close();
 				} else {
 					if (parames.type === 'draftsBox') query.submitState = 0;// 草稿箱数据
 					if (parames.type === 'smt') query.submitState = 1; // 已提交数据
 					this.getPageList(query, parames.type) // 获取分页数据
-					loading.close();
 				}
 			}
 		}
@@ -1335,12 +1350,14 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.deleteList({ ids: ids }, 'supplyOutOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
+						this.$message.success('删除成功');
 						this.clickTab(this.tabType);
-						this.$message.success('删除成功!');
-					} else this.failHandle(res)
-				})
+					} else this.$message.error(res.msg)
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消删除'));
 		}
 		// 操作删除
@@ -1351,18 +1368,15 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.deleteList({ ids: item.id }, 'supplyOutOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
+						this.$message.success('删除成功');
 						this.clickTab(this.tabType);
-						this.$message.success('删除成功!');
-					} else this.failHandle(res)
-				})
+					} else this.$message.error(res.msg)
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消删除'));
 		}
-		// 运行错误
-		failHandle(err : any) {
-			let msg = err.msg ? err.msg : '运行错误!';
-			this.$message.error(msg)
-		}
 	}
 </script>

+ 34 - 18
src/views/audit/saleOrder/index.vue

@@ -167,7 +167,7 @@
 					},
 					table: {
 						attr: {
-							height: 620,
+							height: 600,
 							size: 'mini',
 							seq: true,
 							align: 'left',
@@ -646,13 +646,15 @@
 				center: true
 			}).then(() => {
 				let data = (this.$refs.bill as any).getBillFormValue();
+				let loading = this.$loading({ target: '.main-container' });
 				api.ordersaccepting({ ids: data.id }, 'supplyTaskOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
 						this.getDataList();
-						this.$message.success('接单成功!');
+						this.$message.success('接单成功');
 						(this.$refs.bill as any).showTab = 'all';
 					} else this.$message.error(res.msg);
-				})
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消接单'));
 		}
 		// 右拆单数据变化
@@ -675,6 +677,7 @@
 		orderTaking(item : any) {
 			let loading = this.$loading({ target: '.main-container' });
 			api.single({ id: item.id }, 'supplyPurchaseOrder').then((res : any) => {
+				loading.close();
 				console.log(res);
 				if (res.code === 200) {
 					this.vxeValue = true;
@@ -689,13 +692,12 @@
 						v.dataIndex = i;
 						v.splitNumber = v.number - v.splitOrderNumber;
 					});
-					loading.close();
 					setTimeout(() => {
 						(this.$refs.leftTable as any).setValue(this.regularData);
 						(this.$refs.rightTable as any).setValue(rightData);
 					}, 0)
 				}
-			})
+			}).catch(() => loading.close());
 		}
 		// 确认拆单
 		doConfirm() {
@@ -719,13 +721,15 @@
 					type: 'warning',
 					center: true
 				}).then(() => {
+					let loading = this.$loading({ target: '.main-container' });
 					api.splitOrder(obj, 'supplyPurchaseOrder').then((res : any) => {
+						loading.close();
 						if (res.code === 200) {
-							this.$message.success('拆单成功');
+							this.$message.success('拆单成功');
 							this.getPageList({}, 'all'); // 综合数据
 							this.vxeValue = false;
 						} else this.$message.error(res.msg);
-					})
+					}).catch(() => loading.close());
 				}).catch(() => this.$message.info('已取消拆单'));
 			} else this.$message.warning('请输入拆单销售数据');
 		}
@@ -742,7 +746,12 @@
 		}
 		// 获取分页数据
 		getPageList(query : any, type : any) {
+			let data = (this.$refs.bill as any).getTablePage('all');
+			query.pageNo = data.pageNo;
+			query.pageSize = data.pageSize;
+			let loading = this.$loading({ target: '.main-container' });
 			api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
+				loading.close();
 				if (res.code === 200) {
 					(this.$refs.bill as any).setTabTableValue(type, res.data.records);
 					let page = {
@@ -752,14 +761,18 @@
 					};
 					(this.$refs.bill as any).setTablePage(type, page)
 				} else this.$message.error(res.msg);
-			})
+			}).catch(() => loading.close());
 		}
 		// 获取引单分页数据
 		getCitationList(query : any) {
-			let loading = this.$loading({ target: '.main-container' });
+			let data = (this.$refs.bill as any).getTablePage('all');
+			query.pageNo = data.pageNo;
+			query.pageSize = data.pageSize;
 			query.submitState = 1; // 已提交
 			query.status = 0; // 未接单
+			let loading = this.$loading({ target: '.main-container' });
 			api.pageList(query, 'supplyTaskOrder').then((res : any) => {
+				loading.close();
 				if (res.code === 200) {
 					(this.$refs.bill as any).setSourceTableData(0, res.data.records);
 					let page = {
@@ -767,10 +780,9 @@
 						pageSize: res.data.size, //每页条数
 						total: res.data.total //总条数
 					};
-					loading.close();
 					(this.$refs.bill as any).setSourcePage(0, page);
 				} else this.$message.error(res.msg)
-			})
+			}).catch(() => loading.close());
 		}
 		// 打开编辑
 		openEdit(e : any) {
@@ -820,7 +832,7 @@
 					(this.$refs.bill as any).showTab = 'bill';
 					loading.close();
 				} else loading.close();
-			});
+			}).catch(() => loading.close());
 
 		}
 		// 导航切换
@@ -856,13 +868,15 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.stoporder({ ids: ids }, 'supplyPurchaseOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
-						this.$message.success('终止订单成功!');
+						this.$message.success('终止订单成功');
 						this.getDataList();
 						(this.$refs.bill as any).showTab = 'all';
 					} else this.$message.error(res.msg)
-				})
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消终止订单'));
 		}
 		// 单据操作终止订单
@@ -873,13 +887,15 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.stoporder({ ids: e.id }, 'supplyPurchaseOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
-						this.$message.success('终止订单成功!');
+						this.$message.success('终止订单成功');
 						this.getDataList();
 						(this.$refs.bill as any).showTab = 'all';
 					} else this.$message.error(res.msg)
-				})
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消终止订单'));
 		}
 		// 分页
@@ -891,11 +907,11 @@
 			if (e.type === 'returnOrder') query.status = 2; // 终止订单数据
 			let loading = this.$loading({ target: '.main-container' });
 			api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
+				loading.close();
 				if (res.code === 200) {
 					(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
-					loading.close()
 				} else this.$message.error(res.msg);
-			})
+			}).catch(() => loading.close());
 		}
 		// 搜索
 		search(parames : any) {

+ 65 - 58
src/views/audit/warehousing/index.vue

@@ -721,8 +721,10 @@
 					}
 				});
 				console.log('保存参数query ==> ', query);
+				let loading = this.$loading({ target: '.main-container' });
 				if (this.isAdd) {
 					api.saveList(query, 'supplyEntryOrder').then((res : any) => {
+						loading.close();
 						if (res.code === 200) {
 							this.isAdd = false;
 							this.isChange = false;
@@ -730,17 +732,18 @@
 							this.$message.success('保存成功');
 							this.dataId = res.data;
 						} else this.$message.error(res.msg);
-					})
-				} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
-					if (this.tabType === 'draftsBox') query.submitState = 0;
+					}).catch(() => loading.close());
+				} else {
+					query.submitState = 0;
 					console.log('保存 ==>', query);
 					api.updateList(query, 'supplyEntryOrder').then((res : any) => {
+						loading.close();
 						if (res.code === 200) {
 							this.$message.success('保存成功');
 							this.isChange = false;
 							this.isSubmit = true;
 						} else this.$message.error(res.msg);
-					})
+					}).catch(() => loading.close());
 				};
 
 			})
@@ -750,10 +753,6 @@
 			console.log('新增 ==>', e);
 			if (e === 'billTable_0') {
 				(this.$refs.product as any).setShow(true); // 打开sku弹窗
-				// let obj = (this.$refs.bill as any).getBillFormValue();
-				// if (!this.tableData) this.tableData = obj.suborderList;
-				// console.log('this.tableData ==> ', this.tableData);
-				// (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
 			} else {
 				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
 				billConfig.form.attr.readonly = false; // 设置只读
@@ -825,7 +824,7 @@
 						this.setReadonly(parentData);
 					};
 				}
-			})
+			}).catch(() => loading.close());
 
 		}
 		// 设置只读
@@ -862,15 +861,17 @@
 					type: 'warning',
 					center: true
 				}).then(() => {
+					let loading = this.$loading({ target: '.main-container' });
 					api.submitTo({ id: selectData[0].id }, 'supplyEntryOrder').then((res : any) => {
+						loading.close();
 						if (res.code === 200) {
 							this.$message.success('提交成功');
 							this.clickTab('draftsBox');
 						} else this.$message.error(res.msg)
-					})
+					}).catch(() => loading.close());
 				}).catch(() => this.$message.info('已取消提交'));
 			} else {
-				if(this.isAdd) return this.$message.warning('新增数据必须先保存才能提交');
+				if (this.isAdd) return this.$message.warning('新增数据必须先保存才能提交');
 				console.log('isChange ==> ', this.isChange);
 				console.log('isSubmit ==> ', this.isSubmit);
 				if (this.isSubmit) {
@@ -881,15 +882,16 @@
 						center: true
 					}).then(() => {
 						let id = this.dataId ? this.dataId : this.baseInfo.id;
+						let loading = this.$loading({ target: '.main-container' });
 						api.submitTo({ id: id }, 'supplyEntryOrder').then((res : any) => {
+							loading.close();
 							if (res.code === 200) {
 								this.$message.success('提交成功');
-								this.clickTab(this.tabType);
 								this.isSubmit = false;
 								this.dataId = '';
-								(this.$refs.bill as any).showTab = this.tabType;
+								this.clickTab(this.tabType);
 							} else this.$message.error(res.msg)
-						})
+						}).catch(() => loading.close());
 					}).catch(() => this.$message.info('已取消提交'));
 				} else {
 					// 表单旧数据
@@ -917,14 +919,14 @@
 							type: 'warning',
 							center: true
 						}).then(() => {
-							// console.log(this.baseInfo.id);
+							let loading = this.$loading({ target: '.main-container' });
 							api.submitTo({ id: this.baseInfo.id }, 'supplyEntryOrder').then((res : any) => {
+								loading.close();
 								if (res.code === 200) {
 									this.$message.success('提交成功');
 									this.clickTab(this.tabType);
-									(this.$refs.bill as any).showTab = this.tabType;
 								} else this.$message.error(res.msg)
-							})
+							}).catch(() => loading.close());
 						}).catch(() => this.$message.info('已取消提交'));
 					}
 				}
@@ -939,12 +941,14 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.cancelSubmission({ id: e.id }, 'supplyEntryOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
 						this.$message.success('反提交成功');
 						this.clickTab(this.tabType);
 					} else this.$message.error(res.msg)
-				})
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消反提交'));
 		}
 		// 工具栏反提交
@@ -956,13 +960,14 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.cancelSubmission({ id: this.baseInfo.id }, 'supplyEntryOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
 						this.$message.success('反提交成功');
 						this.clickTab(this.tabType);
-						(this.$refs.bill as any).showTab = 'smt';
 					} else this.$message.error(res.msg)
-				})
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消反提交'));
 		}
 		// 切换tab栏
@@ -991,7 +996,26 @@
 				return
 			}
 			clearInterval(this.timer)
-			this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 综合数据
+			this.getPageList({}, 'all'); // 综合数据
+		}
+		// 获取分页数据
+		getPageList(query : any, type : any) {
+			let data = (this.$refs.bill as any).getTablePage(this.tabType);
+			query.pageNo = data.pageNo;
+			query.pageSize = data.pageSize;
+			let loading = this.$loading({ target: '.main-container' });
+			api.pageList(query, 'supplyEntryOrder').then((res : any) => {
+				loading.close();
+				if (res.code === 200) {
+					(this.$refs.bill as any).setTabTableValue(type, res.data.records);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.bill as any).setTablePage(type, page)
+				} else this.$message.error(res.msg)
+			}).catch(() => loading.close());
 		}
 		// 分页
 		pagination(e : any) {
@@ -1002,38 +1026,25 @@
 			let loading = this.$loading({ target: '.main-container' });
 			if (e.type === 'recycleBin') {
 				api.selectDeleteList(query, 'supplyEntryOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
 						(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
-						loading.close()
-					} else this.failHandle(res)
-				});
+					} else this.$message.error(res.msg)
+				}).catch(() => loading.close());
 			} else {
 				api.pageList(query, 'supplyEntryOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
 						(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
-						loading.close()
-					} else this.failHandle(res)
-				})
+					} else this.$message.error(res.msg)
+				}).catch(() => loading.close());
 			}
-
-		}
-		// 获取分页数据
-		getPageList(query : any, type : any) {
-			api.pageList(query, 'supplyEntryOrder').then((res : any) => {
-				if (res.code === 200) {
-					(this.$refs.bill as any).setTabTableValue(type, res.data.records);
-					let page = {
-						pageNo: res.data.current, //当前页
-						pageSize: res.data.size, //每页条数
-						total: res.data.total //总条数
-					};
-					(this.$refs.bill as any).setTablePage(type, page)
-				} else this.failHandle(res)
-			})
 		}
 		// 回收站数据
 		getSelectDeleteList(query : any) {
+			let loading = this.$loading({ target: '.main-container' });
 			api.selectDeleteList(query, 'supplyEntryOrder').then((res : any) => {
+				loading.close();
 				if (res.code === 200) {
 					(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
 					let page = {
@@ -1042,22 +1053,19 @@
 						total: res.data.total //总条数
 					};
 					(this.$refs.bill as any).setTablePage('recycleBin', page)
-				} else this.failHandle(res)
-			});
+				} else this.$message.error(res.msg)
+			}).catch(() => loading.close());
 		}
 		// 搜索
 		search(parames : any) {
-			let loading = this.$loading({ target: '.main-container' });
 			let query = parames.value
 			if (parames.type === 'draftsBox') query.submitState = 0 // 草稿箱数据
 			if (parames.type === 'smt') query.submitState = 1 // 已提交数据
 			console.log('搜索 ==> ', query);
 			if (query.type === 'recycleBin') {
 				this.getSelectDeleteList(query); // 回收站分页数据
-				loading.close()
 			} else {
 				this.getPageList(query, parames.type) // 获取分页数据
-				loading.close()
 			}
 		}
 		// 刷新/重置
@@ -1157,12 +1165,14 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.deleteList({ ids: ids }, 'supplyEntryOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
+						this.$message.success('删除成功');
 						this.clickTab(this.tabType);
-						this.$message.success('删除成功!');
-					} else this.failHandle(res)
-				})
+					} else this.$message.error(res.msg)
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消删除'));
 		}
 		// 操作删除
@@ -1173,18 +1183,15 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
+				let loading = this.$loading({ target: '.main-container' });
 				api.deleteList({ ids: item.id }, 'supplyEntryOrder').then((res : any) => {
+					loading.close();
 					if (res.code === 200) {
+						this.$message.success('删除成功');
 						this.clickTab(this.tabType);
-						this.$message.success('删除成功!');
-					} else this.failHandle(res)
-				})
+					} else this.$message.error(res.msg)
+				}).catch(() => loading.close());
 			}).catch(() => this.$message.info('已取消删除'));
 		}
-		// 运行错误
-		failHandle(err : any) {
-			let msg = err.msg ? err.msg : '运行错误!';
-			this.$message.error(msg)
-		}
 	}
 </script>