From 0a69c1aaad91d18953108b146e952bd7b00eec55 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期五, 31 十月 2025 16:43:07 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/erpWwreport/wwreport.html |  499 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 499 insertions(+), 0 deletions(-)

diff --git a/src/main/webapp/views/erpWwreport/wwreport.html b/src/main/webapp/views/erpWwreport/wwreport.html
new file mode 100644
index 0000000..8d08d4c
--- /dev/null
+++ b/src/main/webapp/views/erpWwreport/wwreport.html
@@ -0,0 +1,499 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <link rel="stylesheet" href="../../static/evn/index.css">
+    <style>
+        .text-center {
+            text-align: center;
+        }
+        .text-gray-500 {
+            width: 100%;
+            color: #6b7280;
+        }
+    </style>
+</head>
+
+<body>
+<div id="app">
+    <el-card>
+        <el-form :inline="true" label-width="auto">
+            <el-form-item label="寮�宸ユ棩鏈�">
+
+                <div>
+                    <el-date-picker
+                            v-model="tableSearchParam.dateStart"
+                            type="date"
+                            placeholder="寮�濮嬫棩鏈�"
+                            style="width: 150px;"
+                            :default-time="defaultTime"
+                    />
+                </div>
+                <div style="margin-left: 5px;margin-right: 5px">
+                    <span >-</span>
+                </div>
+                <div>
+                    <el-date-picker
+                            v-model="tableSearchParam.dateEnd"
+                            type="date"
+                            placeholder="缁撴潫鏃ユ湡"
+                            style="width: 150px;"
+                            :default-time="defaultTime"
+                    />
+                </div>
+            </el-form-item>
+
+
+            <el-form-item label="渚涘簲鍟�">
+                <el-select v-model="tableSearchParam.venId" placeholder="閫夋嫨渚涘簲鍟�" style="width: 150px" >
+                    <el-option
+                            v-for="item in options"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value"
+                    />
+                </el-select>
+            </el-form-item>
+            <el-form-item label="">
+                <el-button type="primary" @click="page" circle >
+                    <el-icon><Search /></el-icon>
+                </el-button>
+            </el-form-item>
+        </el-form>
+        <el-form :inline="true">
+            <el-form-item label="">
+                <el-button type="primary"  @click="export1">瀵煎嚭</el-button>
+            </el-form-item>
+            <el-form-item label="">
+                <el-button type="primary" @click="export2">瀵煎嚭1</el-button>
+            </el-form-item>
+
+
+        </el-form>
+        <el-table :data="tableData" border style="width: 100%" row-key="id" @selection-change="handleSelectionChange" max-height="300">
+            <el-table-column type="selection" >
+            </el-table-column>
+            <el-table-column type="index" width="50" >
+            </el-table-column>
+            <el-table-column prop="venCode" label="鍔犲伐鍟嗙紪鐮�" >
+            </el-table-column>
+            <el-table-column prop="invCode" label="鍔犲伐鍟嗗悕绉�">
+            </el-table-column>
+            <el-table-column prop="invCode" label="浜у搧缂栫爜" :show-overflow-tooltip="true">
+            </el-table-column>
+            <el-table-column prop="invName" label="浜у搧鍚嶇О" :show-overflow-tooltip="true">
+            </el-table-column>
+            <el-table-column prop="invStd" label="浜у搧瑙勬牸" :show-overflow-tooltip="true">
+            </el-table-column>
+            <el-table-column prop="invUnit" label="鍗曚綅" width="90">
+            </el-table-column>
+            <el-table-column prop="fqty" label="鏁伴噺">
+            </el-table-column>
+            <el-table-column prop="fdate" label="鍏ュ簱鏃ユ湡">
+            </el-table-column>
+            <el-table-column prop="tranType" label="绫诲瀷">
+            </el-table-column>
+            <el-table-column prop="orderCode" label="鐢熶骇鍗曞彿">
+            </el-table-column>
+            <el-table-column prop="gramWeight" label="鍏嬮噸">
+            </el-table-column>
+            <el-table-column prop="totalWeight" label="閲嶉噺">
+            </el-table-column>
+        </el-table>
+
+        <div style="margin-top: 10px"></div>
+        <el-table :data="otherData" border style="width: 100%" row-key="id" @selection-change="handleSelectionChange" max-height="300" show-summary :summary-method="getSummaries">
+            <el-table-column type="selection" >
+            </el-table-column>
+            <el-table-column type="index" width="50" >
+            </el-table-column>
+            <el-table-column prop="venCode" label="鍔犲伐鍟嗙紪鐮�" >
+            </el-table-column>
+            <el-table-column prop="invCode" label="鍔犲伐鍟嗗悕绉�">
+            </el-table-column>
+            <el-table-column prop="invCode" label="浜у搧缂栫爜" :show-overflow-tooltip="true">
+            </el-table-column>
+            <el-table-column prop="invName" label="浜у搧鍚嶇О" :show-overflow-tooltip="true">
+            </el-table-column>
+            <el-table-column prop="invStd" label="浜у搧瑙勬牸" :show-overflow-tooltip="true">
+            </el-table-column>
+            <el-table-column prop="invUnit" label="鍗曚綅" width="90">
+            </el-table-column>
+            <el-table-column prop="qqty" label="鏈熷垵鏁伴噺">
+            </el-table-column>
+            <el-table-column prop="fqty" label="鍙戝嚭鏁伴噺">
+            </el-table-column>
+            <el-table-column prop="hqty" label="鐞嗚鏁伴噺">
+            </el-table-column>
+            <el-table-column prop="jqty" label="缁撳瓨鏁伴噺">
+            </el-table-column>
+        </el-table>
+
+    </el-card>
+</div>
+
+<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
+<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
+<script src="../../static/evn/vue.global.js"></script>
+<script src="../../static/evn/element-plus.js"></script>
+<script src="../../static/evn/icons-vue.js"></script>
+<script src='../../static/js/erp/LodopFuncs.js'></script>
+<script type="module">
+    // 瀵煎叆涓枃璇█鍖�
+    import zhCn from '../../static/js/erp/zh-cn.js';
+
+    const { createApp, ref, onMounted, onBeforeMount ,watchEffect} = Vue;
+
+
+    const app = createApp({
+        setup() {
+            const currentPage = ref(1)
+            const pageSizes = ref([15,20, 30, 50, 100, 200])
+            const pageSize = ref(15)
+            const pageTotal = ref(0)
+            const tableSearchParam = ref({
+                izJb:"鍚�",
+                dateStart:new Date(),
+                dateEnd: new Date(),
+                venId:null,
+                izJs:"鍚�"
+            })
+            const tableSearchParamDialog = ref({
+                dateStart:new Date(),
+                dateEnd: new Date(),
+                izSync: null
+            })
+            const tableData = ref([])
+            const otherData = ref([])
+            const tableDataDialog = ref([])
+            const defaultTime = ref(new Date())
+            const fullscreenLoading = ref(false)
+
+            const selectData = ref([
+            ])
+
+            const depName = ref('')
+
+            const options = ref([])
+
+            const dialogVisible = ref(false)
+
+            watchEffect(() =>{
+                options.value.map(item =>{
+                    if (item.value === tableSearchParam.value.venId){
+                        depName.value = item.label
+                    }
+                })
+
+            })
+
+            const printOptions = [
+                {
+                    value: '鍚�',
+                    label: '鍚�'
+                },
+                {
+                    value: '鏄�',
+                    label: '鏄�'
+                },
+
+            ]
+
+            const selectList = ref([])
+
+            function page(){
+                let data = JSON.parse(JSON.stringify(tableSearchParam.value))
+                data.curr = currentPage.value
+                data.limit = pageSize.value
+                if (tableSearchParam.value.datetime != null) {
+                    data.datetime = null
+                    data.create_time = tableSearchParam.value.datetime[0] + " - " + tableSearchParam.value.datetime[1]
+                }
+                const loading = ElementPlus.ElLoading.service({
+                    lock: true,
+                    text: 'Loading',
+                    background: 'rgba(0, 0, 0, 0.7)',
+                })
+                $.ajax({
+                    url: "http://127.0.0.1:9090/mo/wwreport/getList",
+                    data: data,
+                    dataType: 'json',
+                    contentType: 'application/json;charset=UTF-8',
+                    method: 'GET',
+                    success: function(res) {
+                        loading.close()
+                        if (res.code == 200) {
+                            tableData.value = res.data
+                            otherData.value = res.other
+                            ElementPlus.ElMessage({
+                                message: "鎷夊彇鏁版嵁瀹屾垚",
+                                type: 'success'
+                            });
+                        } else if (res.code === 403) {
+                            top.location.href = baseUrl + "/";
+                        } else {
+                            ElementPlus.ElMessage({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }
+                });
+            }
+
+            function export1(){
+                ElementPlus.ElMessageBox.confirm('纭畾鎵撳嵃鍚�?')
+                    .then(() => {
+                        const loading = ElementPlus.ElLoading.service({
+                            lock: true,
+                            text: 'Loading',
+                            background: 'rgba(0, 0, 0, 0.7)',
+                        })
+                        $.ajax({
+                            url: "http://127.0.0.1:9090/mo/wwreport/export",
+                            data: JSON.stringify({
+                                data: JSON.stringify(tableData.value),
+                                datas: JSON.stringify(otherData.value)
+                            }),
+                            contentType: 'application/json;charset=UTF-8',
+                            method: 'POST',
+                            xhrFields: {
+                                responseType: 'blob' // 閲嶈锛氭寚瀹氬搷搴旂被鍨�
+                            },
+                            success: function(data, status, xhr) {
+                                // 鑾峰彇鏂囦欢鍚�
+                                let fileName = '濮斿鍔犲伐鏉愭枡瀵硅处琛�.xls';
+                                const contentDisposition = xhr.getResponseHeader('Content-Disposition');
+                                if (contentDisposition) {
+                                    const fileNameMatch = contentDisposition.match(/filename="?(.+)"?/);
+                                    if (fileNameMatch && fileNameMatch[1]) {
+                                        fileName = fileNameMatch[1];
+                                    }
+                                }
+
+                                // 鍒涘缓 Blob 瀵硅薄骞朵笅杞�
+                                const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
+                                const url = window.URL.createObjectURL(blob);
+                                const link = document.createElement('a');
+                                link.href = url;
+                                link.download = fileName;
+                                document.body.appendChild(link);
+                                link.click();
+                                document.body.removeChild(link);
+                                window.URL.revokeObjectURL(url);
+
+                                ElementPlus.ElMessage({
+                                    message: "瀵煎嚭鎴愬姛",
+                                    type: 'success'
+                                });
+                            },
+                            error: function(xhr, status, error) {
+                                console.error('瀵煎嚭澶辫触:', error);
+                                ElementPlus.ElMessage({
+                                    message: "瀵煎嚭澶辫触",
+                                    type: 'error'
+                                });
+                            },
+                            complete: function (xhr, status){
+                                loading.close()
+                            }
+                        });
+                    })
+                    .catch(() => {
+                        // catch error
+                    })
+
+
+            }
+
+            function export2(){
+                if (tableSearchParam.value.venId == "" || tableSearchParam.value.venId == null){
+                    ElementPlus.ElMessage({
+                        message: "璇烽�夋嫨渚涘簲鍟�",
+                        type: 'warning'
+                    });
+                    return ;
+                }
+                let data = JSON.parse(JSON.stringify(tableSearchParam.value))
+                ElementPlus.ElMessageBox.confirm('纭畾鎵撳嵃鍚�?')
+                    .then(() => {
+                        const loading = ElementPlus.ElLoading.service({
+                            lock: true,
+                            text: 'Loading',
+                            background: 'rgba(0, 0, 0, 0.7)',
+                        })
+                        $.ajax({
+                            url: "http://127.0.0.1:9090/mo/wwreport/export1",
+                            data: data,
+                            contentType: 'application/json;charset=UTF-8',
+                            method: 'GET',
+                            xhrFields: {
+                                responseType: 'blob' // 閲嶈锛氭寚瀹氬搷搴旂被鍨�
+                            },
+                            success: function(data, status, xhr) {
+                                // 鑾峰彇鏂囦欢鍚�
+                                let fileName = '濮斿鍔犲伐鏉愭枡瀵硅处琛�.xls';
+                                const contentDisposition = xhr.getResponseHeader('Content-Disposition');
+                                if (contentDisposition) {
+                                    const fileNameMatch = contentDisposition.match(/filename="?(.+)"?/);
+                                    if (fileNameMatch && fileNameMatch[1]) {
+                                        fileName = fileNameMatch[1];
+                                    }
+                                }
+
+                                // 鍒涘缓 Blob 瀵硅薄骞朵笅杞�
+                                const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
+                                const url = window.URL.createObjectURL(blob);
+                                const link = document.createElement('a');
+                                link.href = url;
+                                link.download = fileName;
+                                document.body.appendChild(link);
+                                link.click();
+                                document.body.removeChild(link);
+                                window.URL.revokeObjectURL(url);
+
+                                ElementPlus.ElMessage({
+                                    message: "瀵煎嚭鎴愬姛",
+                                    type: 'success'
+                                });
+                            },
+                            error: function(xhr, status, error) {
+                                console.error('瀵煎嚭澶辫触:', error);
+                                ElementPlus.ElMessage({
+                                    message: "瀵煎嚭澶辫触",
+                                    type: 'error'
+                                });
+                            },
+                            complete: function (xhr, status){
+                                loading.close()
+                            }
+                        });
+                    })
+                    .catch(() => {
+                        // catch error
+                    })
+
+
+
+            }
+
+            function getSummaries({ columns, data }) {
+                const sumFields = ['qqty', 'fqty', 'hqty', 'jqty'];
+                const sums = new Array(columns.length).fill('');
+
+                // 灏嗏�滃悎璁♀�濇枃鏈斁鍒扮涓�涓潪姹囨�讳笖鏈� property 鐨勫垪锛岄伩鍏嶉�夋嫨/搴忓彿鍒�
+                const labelIndex = columns.findIndex(
+                    (col) => col.property && !sumFields.includes(col.property)
+                );
+                if (labelIndex !== -1) {
+                    sums[labelIndex] = '鍚堣';
+                }
+
+                columns.forEach((column, index) => {
+                    const prop = column.property;
+                    if (prop && sumFields.includes(prop)) {
+                        const total = data.reduce((acc, row) => {
+                            const n = Number(row[prop]);
+                            return acc + (isNaN(n) ? 0 : n);
+                        }, 0);
+                        sums[index] = total;
+                    }
+                });
+
+                return sums;
+            }
+
+
+
+            function handleSizeChange(val) {
+                pageSize.value = val
+                currentPage.value = 1 // 閲嶇疆鍒扮涓�椤�
+                page()
+            }
+
+            function handleCurrentChange(val) {
+                currentPage.value = val
+                page()
+            }
+            function handleSelectionChange(val) {
+                selectList.value = val
+            }
+            function handleSelectionChangeDialog(val) {
+                selectList.value = val
+            }
+            function getVendor(){
+                $.ajax({
+                    url: "http://127.0.0.1:9090/basicinfo/vendor/getlistfordropdown",
+                    contentType: 'application/json;charset=UTF-8',
+                    method: 'GET',
+                    success: function(res) {
+                        if (res.code == 200) {
+                            res.data.map(item => {
+                                options.value.push({
+                                    value: item.venId, label: item.venName
+                                })
+                            })
+                        } else {
+                            ElementPlus.ElMessage({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }
+                });
+            }
+
+            onMounted(() => {
+                page()
+            })
+
+            onBeforeMount(() => {
+                getVendor()
+
+            })
+
+            return {
+                tableData,
+                tableDataDialog,
+                currentPage,
+                pageSizes,
+                pageSize,
+                pageTotal,
+                tableSearchParam,
+                tableSearchParamDialog,
+                defaultTime,
+                selectData,
+                options,
+                printOptions,
+                dialogVisible,
+                otherData,
+                page,
+                export1,
+                export2,
+                getSummaries,
+                handleSizeChange,
+                handleCurrentChange,
+                handleSelectionChange,
+                handleSelectionChangeDialog
+
+            }
+        }
+    });
+
+    app.use(ElementPlus, {
+        locale: zhCn.default || zhCn
+    });
+    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+        app.component(key, component)
+    }
+    app.mount('#app');
+</script>
+
+</body>
+
+</html>
\ No newline at end of file

--
Gitblit v1.9.1