From 3f46a1fe62e792a6741ec301d38f865b38c03200 Mon Sep 17 00:00:00 2001 From: Trae AI Date: Wed, 31 Dec 2025 12:25:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=8F=90=E4=BA=A4=2002f1fba:?= =?UTF-8?q?=20=E6=9B=B4=E6=96=B0=E8=B4=A7=E6=BA=90=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=8A=9F=E8=83=BD=E5=92=8C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply.html | 238 +++------------------------------------------------- 1 file changed, 13 insertions(+), 225 deletions(-) diff --git a/supply.html b/supply.html index a993530..395d679 100644 --- a/supply.html +++ b/supply.html @@ -993,52 +993,9 @@
暂无已上架的货源
-
- - - -
-
-
-

选择产品包装

- -
- -
-
- -
-
- -
-
- - -
-
-
-

选择产品包装

- -
- -
-
- -
-
-
-
+
@@ -1163,15 +1120,6 @@
- -
- -
- 请选择产品包装 - - -
-
@@ -1509,16 +1457,6 @@
- -
- -
- 请选择产品包装 - - -
-
-
@@ -2030,145 +1968,6 @@ } hideSpecSelectModal(); } - - // 产品包装相关变量 - const allProductingOptions = ['1*360枚新包装', '1*360枚旧包新拖', '1*360枚旧包旧拖', '1*420枚新包装', '1*480枚新包装', '30枚蛋托散装', '360枚散托']; - let filteredProductingOptions = []; - let selectedProducting = ''; - - // 显示产品包装选择弹窗 - function showProductingSelectModal() { - const productingSelectModal = document.getElementById('productingSelectModal'); - productingSelectModal.classList.add('active'); - // 重置搜索输入 - document.getElementById('productingSearchInput').value = ''; - filteredProductingOptions = [...allProductingOptions]; - generateProductingOptions(); - } - - // 隐藏产品包装选择弹窗 - function hideProductingSelectModal() { - const productingSelectModal = document.getElementById('productingSelectModal'); - productingSelectModal.classList.remove('active'); - } - - // 生成产品包装选项 - function generateProductingOptions() { - const productingOptionsList = document.getElementById('productingOptionsList'); - productingOptionsList.innerHTML = ''; - - filteredProductingOptions.forEach(producting => { - const option = document.createElement('div'); - option.className = 'select-item'; - option.textContent = producting; - option.onclick = () => { - // 移除所有选项的选中状态 - document.querySelectorAll('.select-item').forEach(item => { - item.classList.remove('selected'); - }); - // 添加当前选项的选中状态 - option.classList.add('selected'); - selectedProducting = producting; - }; - option.ondblclick = () => { - // 双击直接确认选择 - document.getElementById('productingDisplayText').textContent = producting; - document.getElementById('productingValue').value = producting; - hideProductingSelectModal(); - }; - productingOptionsList.appendChild(option); - }); - } - - // 过滤产品包装选项 - function filterProductingOptions() { - const searchInput = document.getElementById('productingSearchInput'); - const searchKeyword = searchInput.value.toLowerCase(); - - filteredProductingOptions = allProductingOptions.filter(producting => { - return producting.toLowerCase().includes(searchKeyword); - }); - - generateProductingOptions(); - } - - // 确认产品包装选择 - function confirmProductingSelection() { - if (selectedProducting) { - document.getElementById('productingDisplayText').textContent = selectedProducting; - document.getElementById('productingValue').value = selectedProducting; - } - hideProductingSelectModal(); - } - - // 编辑产品包装相关变量 - let editFilteredProductingOptions = []; - let editSelectedProducting = ''; - - // 显示编辑产品包装选择弹窗 - function showEditProductingSelectModal() { - const editProductingSelectModal = document.getElementById('editProductingSelectModal'); - editProductingSelectModal.classList.add('active'); - // 重置搜索输入 - document.getElementById('editProductingSearchInput').value = ''; - editFilteredProductingOptions = [...allProductingOptions]; - generateEditProductingOptions(); - } - - // 隐藏编辑产品包装选择弹窗 - function hideEditProductingSelectModal() { - const editProductingSelectModal = document.getElementById('editProductingSelectModal'); - editProductingSelectModal.classList.remove('active'); - } - - // 生成编辑产品包装选项 - function generateEditProductingOptions() { - const editProductingOptionsList = document.getElementById('editProductingOptionsList'); - editProductingOptionsList.innerHTML = ''; - - editFilteredProductingOptions.forEach(producting => { - const option = document.createElement('div'); - option.className = 'select-item'; - option.textContent = producting; - option.onclick = () => { - // 移除所有选项的选中状态 - document.querySelectorAll('.select-item').forEach(item => { - item.classList.remove('selected'); - }); - // 添加当前选项的选中状态 - option.classList.add('selected'); - editSelectedProducting = producting; - }; - option.ondblclick = () => { - // 双击直接确认选择 - document.getElementById('editProductingDisplayText').textContent = producting; - document.getElementById('editProductingValue').value = producting; - hideEditProductingSelectModal(); - }; - editProductingOptionsList.appendChild(option); - }); - } - - // 过滤编辑产品包装选项 - function filterEditProductingOptions() { - const searchInput = document.getElementById('editProductingSearchInput'); - const searchKeyword = searchInput.value.toLowerCase(); - - editFilteredProductingOptions = allProductingOptions.filter(producting => { - return producting.toLowerCase().includes(searchKeyword); - }); - - generateEditProductingOptions(); - } - - // 确认编辑产品包装选择 - function confirmEditProductingSelection() { - if (editSelectedProducting) { - document.getElementById('editProductingDisplayText').textContent = editSelectedProducting; - document.getElementById('editProductingValue').value = editSelectedProducting; - } - hideEditProductingSelectModal(); - } // 显示货源类型选择弹窗 function showSourceTypeSelectModal() { @@ -3489,7 +3288,7 @@
货源状态: ${supply.supplyStatus || '未设置'}
货源描述: ${supply.description || '无'}
件数: ${supply.quantity || '0'}件
- +
斤重: ${supply.grossWeight || ''}斤
地区: ${supply.region || '未设置'}
价格: ¥${supply.price || '0'}
创建时间: ${formatDate(supply.created_at)}
@@ -3640,7 +3439,7 @@ const productName = document.getElementById('productName'); const price = document.getElementById('price'); const quantity = document.getElementById('quantity'); - const grossWeight = null; // 斤重功能已隐藏 + const grossWeight = document.getElementById('grossWeight'); const yolk = document.getElementById('yolk'); const specValue = document.getElementById('specValue'); const supplyStatus = document.getElementById('supplyStatus'); @@ -3655,7 +3454,7 @@ if (productName) productName.value = formData.productName || ''; if (price) price.value = formData.price || ''; if (quantity) quantity.value = formData.quantity || ''; - // 斤重功能已隐藏 + if (grossWeight) grossWeight.value = formData.grossWeight || ''; if (yolk) yolk.value = formData.yolk || ''; if (specValue) specValue.value = formData.specification || ''; if (supplyStatus) supplyStatus.value = formData.supplyStatus || ''; @@ -3871,7 +3670,7 @@ // 设置表单自动保存 function setupAutoSave() { // 为所有输入字段添加输入事件监听 - const formFields = ['productName', 'price', 'quantity', 'grossWeight', 'yolk', 'specValue', 'supplyStatus', 'description', 'regionValue', 'contactId', 'sourceType', 'productingValue']; + const formFields = ['productName', 'price', 'quantity', 'grossWeight', 'yolk', 'specValue', 'supplyStatus', 'description', 'regionValue', 'contactId', 'sourceType']; formFields.forEach(fieldId => { const element = document.getElementById(fieldId); @@ -3901,8 +3700,7 @@ 'sourceTypeDisplayText', 'productNameDisplayText', 'yolkDisplayText', - 'contactIdDisplayText', - 'productingDisplayText' + 'contactIdDisplayText' ]; customDisplays.forEach(displayId => { @@ -3942,7 +3740,7 @@ const productName = document.getElementById('productName'); const price = document.getElementById('price'); const quantity = document.getElementById('quantity'); - const grossWeight = null; // 斤重功能已隐藏 + const grossWeight = document.getElementById('grossWeight'); const yolk = document.getElementById('yolk'); const specValue = document.getElementById('specValue'); const supplyStatus = document.getElementById('supplyStatus'); @@ -3958,8 +3756,6 @@ const yolkDisplayText = document.getElementById('yolkDisplayText'); const contactIdDisplayText = document.getElementById('contactIdDisplayText'); const categoryDisplayText = document.getElementById('categoryDisplayText'); - const productingValue = document.getElementById('productingValue'); - const productingDisplayText = document.getElementById('productingDisplayText'); // 确保所有字段都是安全获取的 const formData = { @@ -3967,7 +3763,7 @@ category: category ? category.value : '', price: price ? price.value : '', quantity: quantity ? quantity.value : '', - grossWeight: '', // 斤重功能已隐藏 + grossWeight: grossWeight ? grossWeight.value : '', yolk: yolk ? yolk.value : '', specification: specValue ? specValue.value : '', specificationDisplay: specDisplayText ? specDisplayText.textContent : '请选择规格', @@ -3977,8 +3773,6 @@ region: regionValue ? regionValue.value : '', regionDisplay: regionDisplayText ? regionDisplayText.textContent : '请选择地区', contactId: contactId ? contactId.value : '', - producting: productingValue ? productingValue.value : '', - productingDisplay: productingDisplayText ? productingDisplayText.textContent : '请选择产品包装', // 保存其他自定义下拉框显示文本 sourceTypeDisplay: sourceTypeDisplayText ? sourceTypeDisplayText.textContent : '请选择货源类型', productNameDisplay: productNameDisplayText ? productNameDisplayText.textContent : '请选择商品名称', @@ -4028,7 +3822,7 @@ category: document.getElementById('category').value, price: document.getElementById('price').value, quantity: document.getElementById('quantity').value, - grossWeight: '', // 斤重功能已隐藏 + grossWeight: document.getElementById('grossWeight').value, yolk: document.getElementById('yolk').value, specification: document.getElementById('specValue').value, supplyStatus: document.getElementById('supplyStatus').value, @@ -4036,7 +3830,6 @@ description: document.getElementById('description').value, region: document.getElementById('regionValue').value, contactId: document.getElementById('contactId').value, - producting: document.getElementById('productingValue').value, imageUrls: supplyData.uploadedImages, sellerId: userInfo.userId // 添加当前登录用户的userId作为sellerId }; @@ -4587,11 +4380,7 @@ document.getElementById('editRegionValue').value = supply.region || ''; document.getElementById('editPrice').value = supply.price || ''; document.getElementById('editQuantity').value = supply.quantity || ''; - // 斤重功能已隐藏 - - // 产品包装 - document.getElementById('editProductingDisplayText').textContent = supply.producting || '请选择产品包装'; - document.getElementById('editProductingValue').value = supply.producting || ''; + document.getElementById('editGrossWeight').value = supply.grossWeight || ''; // 显示商品图片 const editUploadImages = document.getElementById('editUploadImages'); @@ -5256,15 +5045,14 @@ category: document.getElementById('editCategory').value, price: document.getElementById('editPrice').value, quantity: document.getElementById('editQuantity').value, - grossWeight: '', // 斤重功能已隐藏 + grossWeight: document.getElementById('editGrossWeight').value, yolk: document.getElementById('editYolk').value, specification: document.getElementById('editSpecValue').value, supplyStatus: document.getElementById('editSupplyStatus').value, description: document.getElementById('editDescription').value, region: document.getElementById('editRegionValue').value, - contactId: document.getElementById('editContactId').value, - producting: document.getElementById('editProductingValue').value - }; + contactId: document.getElementById('editContactId').value + }; // 验证表单 if (!formData.productName) {