From f6abc8c724eed706487b7616bc6c816e5db5c939 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期二, 09 十二月 2025 20:13:48 +0800
Subject: [PATCH] 数量检测页面提交
---
fzzy-igdss-web/src/main/resources/static/grain/grain-export.js | 130 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 130 insertions(+), 0 deletions(-)
diff --git a/fzzy-igdss-web/src/main/resources/static/grain/grain-export.js b/fzzy-igdss-web/src/main/resources/static/grain/grain-export.js
new file mode 100644
index 0000000..bd270ee
--- /dev/null
+++ b/fzzy-igdss-web/src/main/resources/static/grain/grain-export.js
@@ -0,0 +1,130 @@
+// 绮儏鎵归噺瀵煎嚭EXCEL
+function exportBatch() {
+ // 寮瑰嚭閫夋嫨妗�
+ layer.open({
+ type: 1,
+ title: '鎵归噺瀵煎嚭鎶ヨ〃',
+ area: ['730px', '450px'],
+ shade: 0,
+ content: $('#batchExportSelect'),
+ btn: ['鍏ㄩ��', '鍙嶉��', '閲嶉��', '鎵ц瀵煎嚭', '鍙栨秷瀵煎嚭'],
+ yes: function () {
+ var name;
+ $('#batchExportSelect input').each(function () {
+ name = $(this).prop("name");
+ if (name == "printCheckDate2" || $(this).prop("disabled")) {
+
+ } else {
+ $(this).prop("checked", true);
+ }
+ });
+ form.render();
+ },
+ btn2: function () {
+ var name;
+ $('#batchExportSelect input').each(function () {
+ name = $(this).prop("name");
+ if (name == "printCheckDate2" || $(this).prop("disabled")) {
+ // doNothing
+ } else {
+ if ($(this).prop("checked")) {
+ $(this).prop("checked", false);
+ } else {
+ $(this).prop("checked", false);
+ }
+ }
+ });
+ form.render();
+ return false;
+ },
+ btn3: function () {
+ var name;
+ $('#batchExportSelect input').each(function () {
+ name = $(this).prop("name");
+ if (name == "printCheckDate2" || $(this).prop("disabled")) {
+ // doNothing
+ } else {
+ $(this).prop("checked", false);
+ }
+ });
+ form.render();
+ return false;
+ },
+ btn4: function () {
+ exportBatchTodo();
+ },
+ btn5: function () {
+ layer.close(0);
+ },
+ closeBtn: 0
+ });
+
+ // 榛樿璋冪敤鑾峰彇鏁版嵁鏇存柊
+ if (grainData) {
+ $("#printCheckDate2").prop("value", grainData.receiveDate.substr(0, 10));
+ } else {
+ $("#printCheckDate2").prop("value", dateFtt("yyyy-MM-dd", new Date()));
+ }
+};
+
+function exportBatchTodo() {
+ var depotIds = "";
+ $('#batchExportSelect input').each(function () {
+ if ($(this).prop("checked")) {
+ depotIds += $(this).val() + ",";
+ }
+ });
+
+ if (depotIds == "") {
+ layer.alert("璇烽�夋嫨闇�瑕佸鍑虹殑浠撳簱鈥︹��");
+ return false;
+ }
+
+ layer.load();
+ // 璋冪敤鍚庡彴鎵归噺妫�娴�
+ var checkDate = $("#printCheckDate2").val();
+ var data = {
+ companyId: companyId,
+ deptId: deptId,
+ depotIds: depotIds,
+ checkDate: checkDate
+ };
+
+ $.ajax({
+ type: "POST",
+ url: "/grain/export-batch",
+ dataType: "json",
+ contentType: "application/json;charset=UTF-8",
+ data: JSON.stringify(data),
+ success: function (result) {
+ layer.closeAll('loading');
+ if (result.code != "ORDER_SUCCESS") {
+ layer.alert("瀵煎嚭妯$増澶辫触锛�" + result.msg);
+ return false;
+ } else {
+ layer.closeAll('loading');
+ downLoadExcel(result.msg);
+ return true;
+ }
+ },
+ error: function () {
+ layer.closeAll('loading');
+ layer.alert("绮儏瀵煎嚭EXCEl鎵ц鍑洪敊锛岃浠庢柊鎵ц");
+ return false;
+ }
+ });
+ return true;
+}
+
+/**
+ * 鍒涘缓涓�涓狝鏍囩鎵ц涓嬭浇
+ * @param fileName
+ */
+function downLoadExcel(fileName) {
+ var url = "../../basic/file/download-temp?companyId=" + companyId + "&fileName=" + fileName;
+ var link = document.createElement('a');
+ link.style.display = 'none';
+ link.href = url;
+ document.body.appendChild(link)
+ link.click();
+}
\ No newline at end of file
--
Gitblit v1.9.3