diff --git a/supply.html b/supply.html
index a993530..395d679 100644
--- a/supply.html
+++ b/supply.html
@@ -993,52 +993,9 @@
@@ -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.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) {