|
|
@@ -381,7 +381,7 @@ export default {
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
-
|
|
|
+
|
|
|
/*this.queryParams.startTime =
|
|
|
this.time && this.formatTime(this.time[0], "yyyy-MM-dd");
|
|
|
this.queryParams.endTime =
|
|
|
@@ -461,22 +461,18 @@ export default {
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- const queryParams = this.queryParams;
|
|
|
- this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.exportLoading = true;
|
|
|
- return exportInventory(queryParams);
|
|
|
- })
|
|
|
- .then((response) => {
|
|
|
- this.download(response.msg);
|
|
|
- this.exportLoading = false;
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ async handleExport() {
|
|
|
+ this.exportLoading = true;
|
|
|
+ try {
|
|
|
+ await this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ const data = await exportInventory(this.queryParams)
|
|
|
+ this.$message.success(`导出 ${data.name} 成功`);
|
|
|
+ } catch (e) {}
|
|
|
+ this.exportLoading = false;
|
|
|
},
|
|
|
},
|
|
|
};
|