From c9456c5f264a9da1df9963cc30f43659659ac9b3 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期二, 11 十一月 2025 14:43:21 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/erpOutstock/outstock.html | 1047 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 526 insertions(+), 521 deletions(-)

diff --git a/src/main/webapp/views/erpOutstock/outstock.html b/src/main/webapp/views/erpOutstock/outstock.html
index 382b7cc..121923b 100644
--- a/src/main/webapp/views/erpOutstock/outstock.html
+++ b/src/main/webapp/views/erpOutstock/outstock.html
@@ -11,566 +11,571 @@
 </head>
 
 <body>
-<div id="app">
-    <el-card>
-        <el-form :inline="true">
-            <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-input v-model="tableSearchParam.fbillno" placeholder="璇疯緭鍏ュ崟鎹彿" style="width: 150px;"></el-input>
-            </el-form-item>
-            <el-form-item label="鐢熶骇鍗曞彿">
-                <el-input v-model="tableSearchParam.fentryselfp0362" placeholder="璇疯緭鍏ョ敓浜у崟鍙�" style="width: 150px;"></el-input>
-            </el-form-item>
-            <el-form-item label="渚涘簲鍟�">
-                <el-select v-model="tableSearchParam.fsupplyid" 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-select v-model="tableSearchParam.bizTypeName" placeholder="閫夋嫨涓氬姟绫诲瀷" style="width: 150px" >
-                    <el-option
-                            v-for="item in businessOptions"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                    />
-                </el-select>
-            </el-form-item>
-            <el-form-item label="鐘舵��">
-                <el-select v-model="tableSearchParam.fstatus" placeholder="閫夋嫨鐘舵��" style="width: 150px" >
-                    <el-option
-                            v-for="item in statusOptions"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                    />
-                </el-select>
-            </el-form-item>
-            <el-form-item label="鐢熶骇閮ㄩ棬">
-                <el-select v-model="tableSearchParam.fheadselfp0339" placeholder="閫夋嫨鐢熶骇閮ㄩ棬" style="width: 150px" >
-                    <el-option
-                            v-for="item in depOptions"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                    />
-                </el-select>
-            </el-form-item>
-            <el-form-item label="">
-                <el-button type="primary" @click="search" circle >
-                    <el-icon><Search /></el-icon>
-                </el-button>
-            </el-form-item>
-        </el-form>
-        <el-form :inline="true">
-            <el-form-item label="">
-                <el-button type="danger" @click="selectDelete">鍒犻櫎</el-button>
-            </el-form-item>
-        </el-form>
-        <el-table size="small" :data="tableData" border style="width: 100%" @selection-change="handleSelectionChange" max-height="620" @cell-dblclick="dblclick">
-            <el-table-column type="selection" >
-            </el-table-column>
-            <el-table-column type="index" width="55" >
-            </el-table-column>
-            <el-table-column prop="fbillno" label="鍗曟嵁缂栧彿" width="150" :show-overflow-tooltip="true">
-            </el-table-column>
-            <el-table-column prop="fdate" label="鏃ユ湡">
-            </el-table-column>
-            <el-table-column prop="venName" label="渚涘簲鍟�" width="100" :show-overflow-tooltip="true">
-            </el-table-column>
-            <el-table-column prop="bizTypeName" label="涓氬姟绫诲瀷" >
-            </el-table-column>
-            <el-table-column prop="invCode" label="鐗╂枡缂栫爜" width="150" :show-overflow-tooltip="true">
-            </el-table-column>
-            <el-table-column prop="invName" label="鐗╂枡鍚嶇О" width="150" :show-overflow-tooltip="true">
-            </el-table-column>
-            <el-table-column prop="fqty" label="鏁伴噺">
-            </el-table-column>
-            <el-table-column prop="inStockQty" label="绔嬪簱鍏ュ簱閲�">
-            </el-table-column>
-            <el-table-column prop="forderbillno" label="璁㈠崟鍗曞彿">
-            </el-table-column>
-            <el-table-column prop="fentryselfp0362" label="鐢熶骇鍗曞彿">
-            </el-table-column>
-            <el-table-column prop="fheadselfp0339" label="鐢熶骇閮ㄩ棬">
-            </el-table-column>
-            <el-table-column prop="fheadselfp0338" label="浜よ揣鏃ユ湡">
-            </el-table-column>
-        </el-table>
-        <div style="margin-top: 10px">
-            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                           :current-page="currentPage" :page-sizes="pageSizes" :page-size="pageSize"
-                           layout="total, sizes, prev, pager, next, jumper" :total="pageTotal">
-            </el-pagination>
-        </div>
-
-        <el-dialog v-model="dialogVisible" fullscreen>
-            <el-form :inline="true" label-width="auto">
-                <el-form-item label="">
-                    <el-button type="primary"  @click="save">淇濆瓨</el-button>
+    <div id="app">
+        <el-card>
+            <el-form :inline="true">
+                <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>
-            <el-form :inline="true" :model="formData" label-width="auto">
-                <el-form-item label="鍗曟嵁鍙�" >
-                    <el-input v-model="formData.fbillno" disabled></el-input>
-                </el-form-item>
-                <el-form-item label="鍒跺崟鏃ユ湡" >
-                    <el-input v-model="formData.fdate" disabled></el-input>
-                </el-form-item>
-                <el-form-item label="涓氬姟绫诲瀷" >
-                    <el-input v-model="formData.bizTypeName" disabled></el-input>
-                </el-form-item>
-                <el-form-item label="渚涘簲鍟�" required>
-                    <el-select v-model="formData.fsupplyid" placeholder="閫夋嫨杞﹂棿" style="width: 240px" >
-                        <el-option
-                                v-for="item in options"
-                                :key="item.value"
-                                :label="item.label"
-                                :value="item.value"></el-option>
+                <el-form-item label="瀹㈡埛">
+                    <el-select v-model="tableSearchParam.fcustid" 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="浜よ揣鏃ユ湡" required>
-                    <el-date-picker
-                            v-model="formData.fheadselfp0338"
-                            type="date"
-                            placeholder="閫夋嫨浜よ揣鏃ユ湡"
-                    />
+                <el-form-item label="鍗曟嵁鍙�">
+                    <el-input v-model="tableSearchParam.fbillno" placeholder="璇疯緭鍏ュ崟鎹彿" style="width: 150px;"></el-input>
                 </el-form-item>
-                <el-form-item label="鐢熶骇杞﹂棿" >
-                    <el-input v-model="formData.fheadselfp0339" disabled></el-input>
-                </el-form-item>
-            </el-form>
-            <el-form :inline="true" label-width="auto">
                 <el-form-item label="">
-                    <el-button type="danger"  @click="selectDeleteDialog">鍒犺</el-button>
+                    <el-button type="primary" @click="search" circle>
+                        <el-icon>
+                            <Search />
+                        </el-icon>
+                    </el-button>
                 </el-form-item>
             </el-form>
-            <el-table :data="tableDataDialog" border style="width: 100%" row-key="id" @selection-change="handleSelectionChangeDialog" max-height="650">
-                <el-table-column type="selection" >
+            <el-form :inline="true">
+                <el-form-item label="">
+                    <el-button type="danger" @click="selectDelete">鍒犻櫎</el-button>
+                </el-form-item>
+            </el-form>
+            <el-table size="small" :data="tableData" border style="width: 100%"
+                @selection-change="handleSelectionChange" :height="tableHeight" @cell-dblclick="dblclick"
+                ref="mainTable">
+                <el-table-column type="selection">
                 </el-table-column>
-                <el-table-column type="index" width="50" >
+                <el-table-column type="index" width="55">
                 </el-table-column>
-                <el-table-column prop="invCode" label="鐗╂枡缂栫爜" >
+                <el-table-column prop="fbillno" label="鍗曟嵁缂栧彿" width="150" :show-overflow-tooltip="true">
                 </el-table-column>
-                <el-table-column prop="invName" label="鐗╂枡鍚嶇О">
+                <el-table-column prop="fdate" label="鏃ユ湡">
+                </el-table-column>
+                <el-table-column prop="custName" label="瀹㈡埛" width="100" :show-overflow-tooltip="true">
+                </el-table-column>
+                <el-table-column prop="fheadselfs0237" label="鍙戣揣鏃ユ湡">
+                </el-table-column>
+                <el-table-column prop="invCode" label="鐗╂枡缂栫爜" width="150" :show-overflow-tooltip="true">
+                </el-table-column>
+                <el-table-column prop="invName" label="鐗╂枡鍚嶇О" width="150" :show-overflow-tooltip="true">
                 </el-table-column>
                 <el-table-column prop="invStd" label="鐗╂枡瑙勬牸">
                 </el-table-column>
                 <el-table-column prop="fqty" label="鏁伴噺">
-                    <template #default="scope">
-                        <el-input v-model="scope.row.fqty"></el-input>
-                    </template>
                 </el-table-column>
-                <el-table-column prop="inStockQty" label="绔嬪簱鍏ュ簱閲�">
+                <el-table-column prop="ffetchdate" label="浜よ揣鏃ユ湡">
                 </el-table-column>
-                <el-table-column prop="forderbillno" label="璁㈠崟鍗曞彿">
+                <el-table-column prop="memo" label="澶囨敞">
                 </el-table-column>
-                <el-table-column prop="fentryselfp0362" label="鐢熶骇鍗曞彿">
+                <el-table-column prop="soCode" label="璁㈠崟鍗曞彿">
                 </el-table-column>
             </el-table>
-            <template #footer>
-                <div class="dialog-footer" style="text-align: left;">
-                    <el-button @click="dialogVisible = false">鍏抽棴</el-button>
-                </div>
-            </template>
-        </el-dialog>
+            <div style="margin-top: 10px">
+                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                    :current-page="currentPage" :page-sizes="pageSizes" :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper" :total="pageTotal">
+                </el-pagination>
+            </div>
 
-    </el-card>
-</div>
+            <el-dialog v-model="dialogVisible" fullscreen>
+                <el-form :inline="true" label-width="auto">
+                    <el-form-item label="">
+                        <el-button type="primary" @click="save">淇濆瓨</el-button>
+                    </el-form-item>
+                </el-form>
+                <el-form :inline="true" :model="formData" label-width="auto">
+                    <el-form-item label="鍗曟嵁鍙�">
+                        <el-input v-model="formData.fbillno" disabled></el-input>
+                    </el-form-item>
+                    <el-form-item label="鍒跺崟鏃ユ湡">
+                        <el-input v-model="formData.fdate" disabled></el-input>
+                    </el-form-item>
+                    <el-form-item label="瀹㈡埛">
+                        <el-input v-model="formData.custName" disabled></el-input>
+                    </el-form-item>
+                    <el-form-item label="鍙戣揣鏃ユ湡" required>
+                        <el-date-picker v-model="formData.fheadselfs0237" type="date" placeholder="閫夋嫨鍙戣揣鏃ユ湡" />
+                    </el-form-item>
+                </el-form>
+                <el-form :inline="true" label-width="auto">
+                    <el-form-item label="">
+                        <el-button type="danger" @click="selectDeleteDialog">鍒犺</el-button>
+                    </el-form-item>
+                </el-form>
+                <el-table :data="tableDataDialog" border style="width: 100%" row-key="id"
+                    @selection-change="handleSelectionChangeDialog" max-height="650">
+                    <el-table-column type="selection">
+                    </el-table-column>
+                    <el-table-column type="index" width="50">
+                    </el-table-column>
+                    <el-table-column prop="invCode" label="鐗╂枡缂栫爜">
+                    </el-table-column>
+                    <el-table-column prop="invName" label="鐗╂枡鍚嶇О" width="150" :show-overflow-tooltip="true">
+                    </el-table-column>
+                    <el-table-column prop="invStd" label="鐗╂枡瑙勬牸">
+                    </el-table-column>
+                    <el-table-column prop="fqty" label="鏁伴噺">
+                        <template #default="scope">
+                            <el-input v-model="scope.row.fqty"></el-input>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="inStockQty" label="澶囨敞">
+                        <template #default="scope">
+                            <el-input v-model="scope.row.memo"></el-input>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="forderbillno" label="浜よ揣鏃ユ湡">
+                        <template #default="scope">
+                            <el-date-picker v-model="scope.row.ffetchdate" type="date" placeholder="浜よ揣鏃ユ湡"
+                                style="width: 150px;" :value-format="yyyy-MM-dd" />
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="fentryselfp0362" label="璁㈠崟鍗曞彿">
+                    </el-table-column>
+                </el-table>
+                <template #footer>
+                    <div class="dialog-footer" style="text-align: left;">
+                        <el-button @click="dialogVisible = false">鍏抽棴</el-button>
+                    </div>
+                </template>
+            </el-dialog>
 
-<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 type="module">
-    // 瀵煎叆涓枃璇█鍖�
-    import zhCn from '../../static/js/erp/zh-cn.js';
+        </el-card>
+    </div>
 
-    const { createApp, ref, onMounted,onBeforeMount } = Vue;
+    <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 type="module">
+        // 瀵煎叆涓枃璇█鍖�
+        import zhCn from '../../static/js/erp/zh-cn.js';
+
+        const { createApp, ref, onMounted, onBeforeMount, nextTick, onBeforeUnmount } = Vue;
 
 
-    const app = createApp({
-        setup() {
-            const currentPage = ref(1)
-            const pageSizes = ref([100,500,1000, 1500])
-            const pageSize = ref(100)
-            const pageTotal = ref(0)
-            const tableSearchParam = ref({
-                dateStart:null,
-                dateEnd: null,
-                // dateStart:new Date(),
-                // dateEnd: new Date(),
-                fbillno: null,
-                fsupplyid:null,
-                bizTypeName:null,
-                fstatus:'0',
-                fheadselfp0339:null,
-                fentryselfp0362:null
-            })
-            const tableData = ref([])
-
-            const tableDataDialog = ref([])
-
-            const selectList = ref([])
-
-            const selectListDialog = ref([])
-
-            const options = ref([
-            ])
-
-            const depOptions = ref([
-                {
-                    value: '鍗楀尯杞﹂棿',
-                    label: '鍗楀尯杞﹂棿'
-                },
-                {
-                    value: '鍖楀尯杞﹂棿',
-                    label: '鍖楀尯杞﹂棿'
-                }
-            ])
-            const businessOptions = [
-                {
-                    value: '璁㈠崟濮斿',
-                    label: '璁㈠崟濮斿'
-                },
-                {
-                    value: '澶栬喘鍏ュ簱',
-                    label: '澶栬喘鍏ュ簱'
-                }
-            ]
-
-            const statusOptions = [
-                {
-                    value: '0',
-                    label: '鏈鏍�',
-                    check: true
-                },
-                {
-                    value: '2',
-                    label: '宸插鏍告湭鍏抽棴'
-                }
-            ]
-
-            const dialogVisible = ref(false)
-            const formData = ref({})
-
-            function search(){
-                currentPage.value = 1
-                page()
-            }
-
-            function page(){
-                let data = JSON.parse(JSON.stringify(tableSearchParam.value))
-                data.curr = currentPage.value
-                data.limit = pageSize.value
-                const loading = ElementPlus.ElLoading.service({
-                    lock: true,
-                    text: 'Loading',
-                    background: 'rgba(0, 0, 0, 0.7)',
+        const app = createApp({
+            setup() {
+                const currentPage = ref(1)
+                const pageSizes = ref([100, 500, 1000, 1500])
+                const pageSize = ref(100)
+                const pageTotal = ref(0)
+                const tableSearchParam = ref({
+                    dateStart: null,
+                    dateEnd: null,
+                    // dateStart:new Date(),
+                    // dateEnd: new Date(),
+                    fbillno: null,
+                    fsupplyid: null,
+                    bizTypeName: null,
+                    fstatus: '0',
+                    fheadselfp0339: null,
+                    fentryselfp0362: null
                 })
-                $.ajax({
-                    url: "http://127.0.0.1:9090/mo/poinstock/getList",
-                    headers: {
-                        'token': localStorage.getItem('token')
+                const tableData = ref([])
+
+                const tableDataDialog = ref([])
+
+                const selectList = ref([])
+
+                const selectListDialog = ref([])
+
+                const options = ref([
+                ])
+
+                const depOptions = ref([
+                    {
+                        value: '鍗楀尯杞﹂棿',
+                        label: '鍗楀尯杞﹂棿'
                     },
-                    data: data,
-                    dataType: 'json',
-                    contentType: 'application/json;charset=UTF-8',
-                    method: 'GET',
-                    success: function(res) {
-                        if (res.code == 200) {
-                            tableData.value = res.data.records
-                            pageTotal.value = res.data.total
-                        } else if (res.code === 403) {
-                            top.location.href = baseUrl + "/";
-                        } else {
-                            ElementPlus.ElMessage({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
-                    },
-                    complete: function() {
-                        loading.close()
+                    {
+                        value: '鍖楀尯杞﹂棿',
+                        label: '鍖楀尯杞﹂棿'
                     }
-                });
-            }
-
-            function selectDelete(){
-                if (selectList.value.length === 0){
-                    ElementPlus.ElMessage({
-                        message: "璇峰厛閫夋嫨",
-                        type: 'error'
-                    });
-                    return ;
-                }
-                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/poinstock/softDelete",
-                            data: JSON.stringify(selectList.value),
-                            dataType: 'json',
-                            contentType: 'application/json;charset=UTF-8',
-                            method: 'POST',
-                            success: function(res) {
-                                if (res.code == 200) {
-                                    ElementPlus.ElMessage({
-                                        message: "鍒犻櫎鎴愬姛",
-                                        type: 'success'
-                                    });
-
-                                } else if (res.code === 403) {
-                                    top.location.href = baseUrl + "/";
-                                } else {
-                                    ElementPlus.ElMessage({
-                                        message: res.msg,
-                                        type: 'error'
-                                    });
-                                }
-                            },
-                            complete: function() {
-                                page()
-                                dialogVisible.value = false
-                                loading.close();
-                            }
-                        });
-
-                    })
-            }
-
-            function formatLocalDate(date) {
-                if (!date) return '';
-                var d = new Date(date);
-                // 鐩存帴杩斿洖鏍囧噯ISO 8601鏍煎紡 (UTF-8鍏煎)
-                return d.toISOString();
-            }
-
-            function save(){
-                ElementPlus.ElMessageBox.confirm('纭畾淇濆瓨鍚�?')
-                    .then(() => {
-                        const loading = ElementPlus.ElLoading.service({
-                            lock: true,
-                            text: 'Loading',
-                            background: 'rgba(0, 0, 0, 0.7)',
-                        })
-                        const poInStockDTO = JSON.parse(JSON.stringify(formData.value));
-                        const poInStockDTOS = JSON.parse(JSON.stringify(tableDataDialog.value));
-
-                        poInStockDTO.fheadselfp0338 = formatLocalDate(poInStockDTO.fheadselfp0338);
-                        $.ajax({
-                            url:"http://127.0.0.1:9090/mo/poinstock/saveorupdate",
-                            data: JSON.stringify({
-                                poInStockDTO : poInStockDTO,
-                                poInStockDTOS: poInStockDTOS
-                            }),
-                            dataType: 'json',
-                            contentType: 'application/json;charset=UTF-8',
-                            method: 'POST',
-                            success: function(res) {
-                                if (res.code == 200) {
-                                    ElementPlus.ElMessage({
-                                        message: "淇濆瓨鎴愬姛",
-                                        type: 'success'
-                                    });
-
-                                } else if (res.code === 403) {
-                                    top.location.href = baseUrl + "/";
-                                } else {
-                                    ElementPlus.ElMessage({
-                                        message: res.msg,
-                                        type: 'error'
-                                    });
-                                }
-                            },
-                            complete: function() {
-                                page()
-                                dialogVisible.value = false
-                                loading.close();
-                            }
-                        });
-
-                    })
-            }
-
-            function handleSelectionChangeDialog(val) {
-                selectListDialog.value = val
-                console.log(selectListDialog.value);
-
-            }
-
-            function dblclick(val){
-                formData.value = JSON.parse(JSON.stringify(val));
-                getListByID(formData.value);
-                dialogVisible.value = true
-            }
-
-            function selectDeleteDialog(){
-                if (selectListDialog.value.length === 0) {
-                    ElementPlus.ElMessage({
-                        message: '璇烽�夋嫨瑕佸垹闄ょ殑琛�',
-                        type: 'warning'
-                    });
-                    return;
-                }
-                //鍦╯electListDialog涓垹闄ら�変腑鐨勮
-                selectListDialog.value.forEach((item, index) => {
-                    tableDataDialog.value.forEach((row, i) => {
-                        if (row.id === item.id) {
-                            tableDataDialog.value.splice(i, 1);
-                        }
-                    });
-                });
-
-            }
-
-            function getListByID(row){
-                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/poinstock/getbyid",
-                    data: JSON.stringify(row),
-                    dataType: 'json',
-                    contentType: 'application/json;charset=UTF-8',
-                    method: 'POST',
-                    success: function(res) {
-                        if (res.code == 200) {
-
-                            tableDataDialog.value = res.data;
-
-                        } else if (res.code === 403) {
-                            top.location.href = baseUrl + "/";
-                        } else {
-                            ElementPlus.ElMessage({
-                                message: res.msg,
-                                type: 'error'
-                            });
-                        }
+                ])
+                const businessOptions = [
+                    {
+                        value: '璁㈠崟濮斿',
+                        label: '璁㈠崟濮斿'
                     },
-                    complete: function() {
-                        loading.close();
+                    {
+                        value: '澶栬喘鍏ュ簱',
+                        label: '澶栬喘鍏ュ簱'
                     }
-                });
-            }
+                ]
 
-            function handleSizeChange(val) {
-                pageSize.value = val
-                currentPage.value = 1 // 閲嶇疆鍒扮涓�椤�
-                page()
-            }
+                const statusOptions = [
+                    {
+                        value: '0',
+                        label: '鏈鏍�',
+                        check: true
+                    },
+                    {
+                        value: '2',
+                        label: '宸插鏍告湭鍏抽棴'
+                    }
+                ]
 
-            function handleCurrentChange(val) {
-                currentPage.value = val
-                page()
-            }
-            function handleSelectionChange(val) {
-                selectList.value = val
-            }
+                const dialogVisible = ref(false)
+                const formData = ref({})
 
+                function search() {
+                    currentPage.value = 1
+                    page()
+                }
 
-            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
-                                })
+                function page() {
+                    let data = JSON.parse(JSON.stringify(tableSearchParam.value))
+                    data.curr = currentPage.value
+                    data.limit = pageSize.value
+                    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/outstock/getList",
+                        headers: {
+                            'token': localStorage.getItem('token')
+                        },
+                        data: data,
+                        dataType: 'json',
+                        contentType: 'application/json;charset=UTF-8',
+                        method: 'GET',
+                        success: function (res) {
+                            if (res.code == 200) {
+                                tableData.value = res.data.records
+                                pageTotal.value = res.data.total
+                            } else if (res.code === 403) {
+                                top.location.href = baseUrl + "/";
+                            } else {
+                                ElementPlus.ElMessage({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        },
+                        complete: function () {
+                            loading.close()
+                        }
+                    });
+                }
+
+                function selectDelete() {
+                    if (selectList.value.length === 0) {
+                        ElementPlus.ElMessage({
+                            message: "璇峰厛閫夋嫨",
+                            type: 'error'
+                        });
+                        return;
+                    }
+                    ElementPlus.ElMessageBox.confirm('纭畾鍒犻櫎鍚�?')
+                        .then(() => {
+                            const loading = ElementPlus.ElLoading.service({
+                                lock: true,
+                                text: 'Loading',
+                                background: 'rgba(0, 0, 0, 0.7)',
                             })
-                        } else {
-                            ElementPlus.ElMessage({
-                                message: res.msg,
-                                type: 'error'
+                            $.ajax({
+                                url: "http://127.0.0.1:9090/mo/outstock/softDelete",
+                                data: JSON.stringify(selectList.value),
+                                dataType: 'json',
+                                contentType: 'application/json;charset=UTF-8',
+                                method: 'POST',
+                                success: function (res) {
+                                    if (res.code == 200) {
+                                        ElementPlus.ElMessage({
+                                            message: "鍒犻櫎鎴愬姛",
+                                            type: 'success'
+                                        });
+
+                                    } else if (res.code === 403) {
+                                        top.location.href = baseUrl + "/";
+                                    } else {
+                                        ElementPlus.ElMessage({
+                                            message: res.msg,
+                                            type: 'error'
+                                        });
+                                    }
+                                },
+                                complete: function () {
+                                    page()
+                                    dialogVisible.value = false
+                                    loading.close();
+                                }
                             });
-                        }
+
+                        })
+                }
+
+                function formatLocalDate(date) {
+                    if (!date) return '';
+                    var d = new Date(date);
+                    d.setHours(d.getHours() + 8);
+                    // 鐩存帴杩斿洖鏍囧噯ISO 8601鏍煎紡 (UTF-8鍏煎)
+                    return d.toISOString();
+                }
+
+                function save() {
+                    if (!formData.value.fheadselfs0237) {
+                        ElementPlus.ElMessage({
+                            message: "璇烽�夋嫨鍙戣揣鏃ユ湡",
+                            type: 'warning'
+                        });
+                        return;
                     }
-                });
+                    ElementPlus.ElMessageBox.confirm('纭畾淇濆瓨鍚�?')
+                        .then(() => {
+                            const loading = ElementPlus.ElLoading.service({
+                                lock: true,
+                                text: 'Loading',
+                                background: 'rgba(0, 0, 0, 0.7)',
+                            })
+                            const outstockDTO = JSON.parse(JSON.stringify(formData.value));
+                            const outstockDTOS = JSON.parse(JSON.stringify(tableDataDialog.value));
+
+                            outstockDTO.fheadselfs0237 = formatLocalDate(outstockDTO.fheadselfs0237);
+                            outstockDTOS.forEach(item => {
+                                item.ffetchdate = formatLocalDate(item.ffetchdate);
+                            });
+                            $.ajax({
+                                url: "http://127.0.0.1:9090/mo/outstock/saveorupdate",
+                                data: JSON.stringify({
+                                    outStockDTO: outstockDTO,
+                                    outStockDTOS: outstockDTOS
+                                }),
+                                dataType: 'json',
+                                contentType: 'application/json;charset=UTF-8',
+                                method: 'POST',
+                                success: function (res) {
+                                    if (res.code == 200) {
+                                        ElementPlus.ElMessage({
+                                            message: "淇濆瓨鎴愬姛",
+                                            type: 'success'
+                                        });
+
+                                    } else if (res.code === 403) {
+                                        top.location.href = baseUrl + "/";
+                                    } else {
+                                        ElementPlus.ElMessage({
+                                            message: res.msg,
+                                            type: 'error'
+                                        });
+                                    }
+                                },
+                                complete: function () {
+                                    page()
+                                    dialogVisible.value = false
+                                    loading.close();
+                                }
+                            });
+
+                        })
+                }
+
+                function handleSelectionChangeDialog(val) {
+                    selectListDialog.value = val
+                    console.log(selectListDialog.value);
+
+                }
+
+                function dblclick(val) {
+                    formData.value = JSON.parse(JSON.stringify(val));
+                    getListByID(formData.value);
+                    dialogVisible.value = true
+                }
+
+                function selectDeleteDialog() {
+                    if (selectListDialog.value.length === 0) {
+                        ElementPlus.ElMessage({
+                            message: '璇烽�夋嫨瑕佸垹闄ょ殑琛�',
+                            type: 'warning'
+                        });
+                        return;
+                    }
+                    //鍦╯electListDialog涓垹闄ら�変腑鐨勮
+                    selectListDialog.value.forEach((item, index) => {
+                        tableDataDialog.value.forEach((row, i) => {
+                            if (row.id === item.id) {
+                                tableDataDialog.value.splice(i, 1);
+                            }
+                        });
+                    });
+
+                }
+
+                function getListByID(row) {
+                    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/outstock/getbyid",
+                        data: JSON.stringify(row),
+                        dataType: 'json',
+                        contentType: 'application/json;charset=UTF-8',
+                        method: 'POST',
+                        success: function (res) {
+                            if (res.code == 200) {
+
+                                tableDataDialog.value = res.data;
+
+                            } else if (res.code === 403) {
+                                top.location.href = baseUrl + "/";
+                            } else {
+                                ElementPlus.ElMessage({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        },
+                        complete: function () {
+                            loading.close();
+                        }
+                    });
+                }
+
+                function handleSizeChange(val) {
+                    pageSize.value = val
+                    currentPage.value = 1 // 閲嶇疆鍒扮涓�椤�
+                    page()
+                }
+
+                function handleCurrentChange(val) {
+                    currentPage.value = val
+                    page()
+                }
+                function handleSelectionChange(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'
+                                });
+                            }
+                        }
+                    });
+                }
+
+                function getCustomer() {
+                    $.ajax({
+                        url: "http://127.0.0.1:9090/basicinfo/customer/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.custId, label: item.custName
+                                    })
+                                })
+                            } else {
+                                ElementPlus.ElMessage({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }
+                    });
+                }
+
+                const tableHeight = ref(600)
+                const mainTable = ref(null)
+                const paginationRef = ref(null)
+
+                function calcTableHeight() {
+                    const tableEl = mainTable.value?.$el
+                    if (!tableEl) return
+                    const tableTop = tableEl.getBoundingClientRect().top
+                    const paginationH = paginationRef.value ? paginationRef.value.offsetHeight : 0
+                    const bottomPadding = 70 // 鍗$墖搴曢儴鍐呰竟璺�/澶栬竟璺濋鐣欙紝鍙寜闇�璋冩暣
+                    const available = window.innerHeight - tableTop - paginationH - bottomPadding
+                    // 缁欎釜鏈�灏忓�奸伩鍏嶈繃灏�
+                    tableHeight.value = Math.max(300, available)
+                }
+
+                onMounted(() => {
+                    page()
+                    nextTick(() => {
+                        calcTableHeight()
+                    })
+                    window.addEventListener('resize', calcTableHeight)
+                })
+                onBeforeUnmount(() => {
+                    window.removeEventListener('resize', calcTableHeight)
+                })
+                onBeforeMount(() => {
+                    getVendor()
+                    getCustomer()
+                })
+
+                return {
+                    tableHeight,
+                    mainTable,
+                    paginationRef,
+                    calcTableHeight,
+                    tableData,
+                    currentPage,
+                    pageSizes,
+                    pageSize,
+                    pageTotal,
+                    tableSearchParam,
+                    options,
+                    depOptions,
+                    businessOptions,
+                    statusOptions,
+                    dialogVisible,
+                    formData,
+                    tableDataDialog,
+                    selectListDialog,
+                    search,
+                    page,
+                    save,
+                    dblclick,
+                    selectDelete,
+                    handleSizeChange,
+                    handleCurrentChange,
+                    handleSelectionChange,
+                    selectDeleteDialog,
+                    handleSelectionChangeDialog,
+
+                }
             }
+        });
 
-            onMounted(() => {
-                page()
-            })
-            onBeforeMount(() => {
-                getVendor()
-
-            })
-
-            return {
-                tableData,
-                currentPage,
-                pageSizes,
-                pageSize,
-                pageTotal,
-                tableSearchParam,
-                options,
-                depOptions,
-                businessOptions,
-                statusOptions,
-                dialogVisible,
-                formData,
-                tableDataDialog,
-                selectListDialog,
-                search,
-                page,
-                save,
-                dblclick,
-                selectDelete,
-                handleSizeChange,
-                handleCurrentChange,
-                handleSelectionChange,
-                selectDeleteDialog,
-                handleSelectionChangeDialog,
-
-            }
+        app.use(ElementPlus, {
+            locale: zhCn.default || zhCn
+        });
+        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+            app.component(key, component)
         }
-    });
-
-    app.use(ElementPlus, {
-        locale: zhCn.default || zhCn
-    });
-    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
-        app.component(key, component)
-    }
-    app.mount('#app');
-</script>
+        app.mount('#app');
+    </script>
 
 </body>
 

--
Gitblit v1.9.1