From 6fcb00f27e80b38cea4ccb059112ad7cf99d8745 Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期五, 25 十月 2024 15:18:22 +0800
Subject: [PATCH] 新增干草配方历史功能模块

---
 src/views/dry/api/DryOrder.api.ts |   85 ++++++++++++++++++++++++++++--------------
 1 files changed, 57 insertions(+), 28 deletions(-)

diff --git a/src/views/dry/api/DryOrder.api.ts b/src/views/dry/api/DryOrder.api.ts
index 4d0f310..5c04447 100644
--- a/src/views/dry/api/DryOrder.api.ts
+++ b/src/views/dry/api/DryOrder.api.ts
@@ -1,64 +1,93 @@
-import { useMessage } from "/@/hooks/web/useMessage";
-import { defHttp } from '/@/utils/http/axios';
+import { useMessage } from '/@/hooks/web/useMessage'
+import { defHttp } from '/@/utils/http/axios'
 
-const { createConfirm } = useMessage();
+const { createConfirm } = useMessage()
 
 enum Api {
-  list = '/dry/dryOrder/list',
-  save='/dry/dryOrder/add',
-  edit='/dry/dryOrder/edit',
-  deleteOne = '/dry/dryOrder/delete',
-  deleteBatch = '/dry/dryOrder/deleteBatch',
-  importExcel = '/dry/dryOrder/importExcel',
-  exportXls = '/dry/dryOrder/exportXls',
+	list = '/dry/dryOrder/list',
+	queryByEqp = 'dry/dry/queryByEqp',
+	queryOrderTrendById = '/dry/dryOrder/queryOrderTrendById',
+	save = '/dry/dryOrder/add',
+	edit = '/dry/dryOrder/edit',
+	deleteOne = '/dry/dryOrder/delete',
+	deleteBatch = '/dry/dryOrder/deleteBatch',
+	importExcel = '/dry/dryOrder/importExcel',
+	exportXls = '/dry/dryOrder/exportXls',
+  sendBatch = '/dry/dryOrder/sendBatch'
 }
 /**
  * 瀵煎嚭api
  * @param params
  */
-export const getExportUrl = Api.exportXls;
+export const getExportUrl = Api.exportXls
 /**
  * 瀵煎叆api
  */
-export const getImportUrl = Api.importExcel;
+export const getImportUrl = Api.importExcel
 /**
  * 鍒楄〃鎺ュ彛
  * @param params
  */
-export const list = (params) =>
-  defHttp.get({url: Api.list, params});
+export const list = (params) => defHttp.get({ url: Api.list, params })
+
+/**
+ * 鏌ヨ鏈哄彴褰撳墠宸ュ崟
+ * @param params
+ */
+export const queryByEqp = (params) => defHttp.get({ url: Api.queryByEqp, params })
 
 /**
  * 鍒犻櫎鍗曚釜
  */
-export const deleteOne = (params,handleSuccess) => {
-  return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
-    handleSuccess();
-  });
+export const deleteOne = (params, handleSuccess) => {
+	return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
+		handleSuccess()
+	})
 }
 /**
  * 鎵归噺鍒犻櫎
  * @param params
  */
 export const batchDelete = (params, handleSuccess) => {
+	createConfirm({
+		iconType: 'warning',
+		title: '纭鍒犻櫎',
+		content: '鏄惁鍒犻櫎閫変腑鏁版嵁',
+		okText: '纭',
+		cancelText: '鍙栨秷',
+		onOk: () => {
+			return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
+				handleSuccess()
+			})
+		},
+	})
+}
+
+/**
+ * 鎵归噺涓嬪彂宸ュ崟
+ */
+export const batchSend = (params, handleSuccess) => {
   createConfirm({
     iconType: 'warning',
-    title: '纭鍒犻櫎',
-    content: '鏄惁鍒犻櫎閫変腑鏁版嵁',
-    okText: '纭',
+    title: '纭涓嬪彂',
+    content: '鏄惁灏嗛�変腑宸ュ崟涓嬪彂鍒版満鍙�',
+    okText: '涓嬪彂',
     cancelText: '鍙栨秷',
     onOk: () => {
-      return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
-        handleSuccess();
-      });
-    }
-  });
+      return defHttp.post({ url: Api.sendBatch, data: params }, { joinParamsToUrl: true }).then(() => {
+        handleSuccess()
+      })
+    },
+  })
 }
 /**
  * 淇濆瓨鎴栬�呮洿鏂�
  * @param params
  */
 export const saveOrUpdate = (params, isUpdate) => {
-  let url = isUpdate ? Api.edit : Api.save;
-  return defHttp.post({url: url, params});
+	const url = isUpdate ? Api.edit : Api.save
+	return defHttp.post({ url: url, params })
 }
+
+
+export const queryOrderTrendById = (params) => defHttp.get({url: Api.queryOrderTrendById, params})

--
Gitblit v1.9.3