From ffeda1528cb303dee5f73e0a16ab4a21b2fcbe26 Mon Sep 17 00:00:00 2001
From: chen.lin <1442464845@qq.com>
Date: 星期二, 27 一月 2026 15:45:21 +0800
Subject: [PATCH] ERP生产管理-生成收料通知单-增加按钮重新同步 -对应前端

---
 src/main/webapp/views/erpReceiving/erpReceiving.html |   92 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 92 insertions(+), 0 deletions(-)

diff --git a/src/main/webapp/views/erpReceiving/erpReceiving.html b/src/main/webapp/views/erpReceiving/erpReceiving.html
index 1f52585..75b08f2 100644
--- a/src/main/webapp/views/erpReceiving/erpReceiving.html
+++ b/src/main/webapp/views/erpReceiving/erpReceiving.html
@@ -47,6 +47,9 @@
                 <el-form-item label="">
                     <el-button type="primary" @click="caneltongbureturn">鎾ら攢閫�鏂�</el-button>
                 </el-form-item>
+                <el-form-item label="">
+                    <el-button type="primary" @click="retongbu">閲嶆柊鍚屾</el-button>
+                </el-form-item>
             </el-form>
             <el-table :data="tableData" border style="width: 100%" row-key="finterid"
                 @selection-change="handleSelectionChange" max-height="650">
@@ -86,6 +89,21 @@
 
 
         </el-card>
+        
+        <!-- 閲嶆柊鍚屾鏁伴噺杈撳叆寮圭獥 -->
+        <el-dialog v-model="retongbuDialogVisible" title="閲嶆柊鍚屾" width="400px">
+            <el-form :model="retongbuForm" label-width="100px">
+                <el-form-item label="鏁伴噺">
+                    <el-input-number v-model="retongbuForm.fauxqty" :min="0" :precision="0" style="width: 100%"></el-input-number>
+                </el-form-item>
+            </el-form>
+            <template #footer>
+                <span class="dialog-footer">
+                    <el-button @click="retongbuDialogVisible = false">鍙栨秷</el-button>
+                    <el-button type="primary" @click="submitRetongbu">鎻愪氦</el-button>
+                </span>
+            </template>
+        </el-dialog>
     </div>
 
     <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
@@ -128,6 +146,10 @@
                 ]
 
                 const selectList = ref([])
+                const retongbuDialogVisible = ref(false)
+                const retongbuForm = ref({
+                    fauxqty: 0
+                })
 
                 function page() {
                     let data = JSON.parse(JSON.stringify(tableSearchParam.value))
@@ -357,6 +379,72 @@
                     });
                 }
 
+                function retongbu() {
+                    if (selectList.value.length === 0) {
+                        ElementPlus.ElMessage({
+                            message: "璇峰厛閫夋嫨",
+                            type: 'error'
+                        });
+                        return;
+                    }
+                    // 榛樿鏁伴噺涓虹涓�涓�変腑椤圭殑褰撳墠鏁伴噺
+                    if (selectList.value.length > 0 && selectList.value[0].fauxqty) {
+                        retongbuForm.value.fauxqty = selectList.value[0].fauxqty;
+                    } else {
+                        retongbuForm.value.fauxqty = 0;
+                    }
+                    retongbuDialogVisible.value = true;
+                }
+
+                function submitRetongbu() {
+                    if (!retongbuForm.value.fauxqty || retongbuForm.value.fauxqty <= 0) {
+                        ElementPlus.ElMessage({
+                            message: "璇疯緭鍏ユ湁鏁堢殑鏁伴噺",
+                            type: 'error'
+                        });
+                        return;
+                    }
+                    retongbuDialogVisible.value = false;
+                    const loading = ElementPlus.ElLoading.service({
+                        lock: true,
+                        text: 'Loading',
+                        background: 'rgba(0, 0, 0, 0.7)',
+                    })
+                    // 鏇存柊閫変腑椤圭殑鏁伴噺
+                    const dataList = selectList.value.map(item => {
+                        const newItem = JSON.parse(JSON.stringify(item));
+                        newItem.fauxqty = retongbuForm.value.fauxqty;
+                        return newItem;
+                    });
+                    $.ajax({
+                        url: "http://127.0.0.1:8133/mo/materialreceive/retongbu",
+                        headers: {
+                            'token': localStorage.getItem('token')
+                        },
+                        data: JSON.stringify(dataList),
+                        dataType: 'json',
+                        contentType: 'application/json;charset=UTF-8',
+                        method: 'POST',
+                        success: function (res) {
+                            loading.close();
+                            if (res.code == 200) {
+                                ElementPlus.ElMessage({
+                                    message: "閲嶆柊鍚屾瀹屾垚",
+                                    type: 'success'
+                                });
+                                page()
+                            } else if (res.code === 403) {
+                                top.location.href = baseUrl + "/";
+                            } else {
+                                ElementPlus.ElMessage({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }
+                    });
+                }
+
                 function handleSizeChange(val) {
                     pageSize.value = val
                     currentPage.value = 1 // 閲嶇疆鍒扮涓�椤�
@@ -385,11 +473,15 @@
                     tableSearchParam,
                     defaultTime,
                     options,
+                    retongbuDialogVisible,
+                    retongbuForm,
                     page,
                     tongbu,
                     caneltongbu1,
                     tongbureturn,
                     caneltongbureturn,
+                    retongbu,
+                    submitRetongbu,
                     handleSizeChange,
                     handleCurrentChange,
                     handleSelectionChange

--
Gitblit v1.9.1