1f5db7473c
- 新增order.php工厂下单表页面 - 实现数据自动保存到localStorage功能 - 添加导出CSV功能 - 防止页面意外刷新丢失数据
1900 lines
86 KiB
PHP
1900 lines
86 KiB
PHP
<script>
|
|
|
|
</script>
|
|
<body link="blue" vlink="purple">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="903" style="border-collapse:
|
|
collapse;table-layout:fixed;width:677pt" id="tb_<?php echo $counter; ?>" sheetName="<?php echo htmlspecialchars($item['no']); ?>">
|
|
<colgroup>
|
|
<col width="72" span="2" style="width:54pt">
|
|
<col width="93" style="width:69.75pt">
|
|
<col width="74" span="9" style="width:55.5pt">
|
|
</colgroup>
|
|
<tbody>
|
|
<tr height="18" style="height:13.5pt" id="r0">
|
|
<td height="16" class="x69" width="72" style="height:12pt;width:54pt;">序号</td>
|
|
<td class="x69" width="72" style="width:54pt;">货号</td>
|
|
<td rowspan="2" height="35" class="x70" width="93" style="border-right:1px solid windowtext;border-bottom:1px solid windowtext;height:26.25pt;width:69.75pt;">店铺/客户</td>
|
|
<td colspan="8" class="x70" width="592" style="border-right:1px solid windowtext;border-bottom:1px solid windowtext;">尺码明细</td>
|
|
<td class="x69" width="74" style="width:55.5pt;">合计</td>
|
|
</tr>
|
|
<tr height="19" style="height:14.25pt" id="r1">
|
|
<td rowspan="11" height="197" class="x71" style="border-right:1px solid windowtext;border-bottom:1px solid windowtext;height:147.75pt;"><?php echo $counter; ?></td>
|
|
<td rowspan="5" height="89" class="x70" style="border-right:1px solid windowtext;border-bottom:1px solid windowtext;height:66.75pt;"><?php echo htmlspecialchars($item['no']); ?></td>
|
|
<td class="x69">33</td>
|
|
<td class="x69">34</td>
|
|
<td class="x69">35</td>
|
|
<td class="x69">36</td>
|
|
<td class="x69">37</td>
|
|
<td class="x69">38</td>
|
|
<td class="x69">39</td>
|
|
<td class="x69">40</td>
|
|
<td class="x69"></td>
|
|
</tr>
|
|
<tr height="18" style="height:13.5pt" id="r2_<?php echo $counter; ?>">
|
|
<td class="x69">已在途订量</td>
|
|
<td class="x69"><input type="number" name="in_transit_33" value="0" min="0" style="width: 50px; border: 2px solid #4CAF50; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="in_transit_34" value="0" min="0" style="width: 50px; border: 2px solid #4CAF50; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="in_transit_35" value="0" min="0" style="width: 50px; border: 2px solid #4CAF50; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="in_transit_36" value="0" min="0" style="width: 50px; border: 2px solid #4CAF50; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="in_transit_37" value="0" min="0" style="width: 50px; border: 2px solid #4CAF50; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="in_transit_38" value="0" min="0" style="width: 50px; border: 2px solid #4CAF50; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="in_transit_39" value="0" min="0" style="width: 50px; border: 2px solid #4CAF50; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="in_transit_40" value="0" min="0" style="width: 50px; border: 2px solid #4CAF50; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69" x:fmla="=SUM(D3:K3)" id="current_row_total2_<?php echo $counter; ?>">
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputsR2 = document.querySelectorAll('#r2_<?php echo $counter; ?> input[type="number"]');
|
|
let sumR2 = 0;
|
|
inputsR2.forEach(input => {
|
|
sumR2 += parseInt(input.value) || 0;
|
|
});
|
|
|
|
document.getElementById('current_row_total2_<?php echo $counter; ?>').textContent = sumR2;
|
|
|
|
inputsR2.forEach(input => {
|
|
input.addEventListener('change', () => {
|
|
let newSum = 0;
|
|
inputsR2.forEach(input => {
|
|
newSum += parseInt(input.value) || 0;
|
|
});
|
|
document.getElementById('current_row_total2_<?php echo $counter; ?>').textContent = newSum;
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</td>
|
|
</tr>
|
|
<tr height="18" style="height:13.5pt" id="r3">
|
|
<td class="x69">批发订量</td>
|
|
<td class="x69"><?php echo isset($pf_order_row['c33']) ? $pf_order_row['c33'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($pf_order_row['c34']) ? $pf_order_row['c34'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($pf_order_row['c35']) ? $pf_order_row['c35'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($pf_order_row['c36']) ? $pf_order_row['c36'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($pf_order_row['c37']) ? $pf_order_row['c37'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($pf_order_row['c38']) ? $pf_order_row['c38'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($pf_order_row['c39']) ? $pf_order_row['c39'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($pf_order_row['c40']) ? $pf_order_row['c40'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($pf_order_row['num']) ? $pf_order_row['num'] : 0; ?></td>
|
|
</tr>
|
|
<tr height="18" style="height:13.5pt" id="r4">
|
|
<td class="x69">店铺订量</td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c33']) ? $shop_order_row['c33'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c34']) ? $shop_order_row['c34'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c35']) ? $shop_order_row['c35'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c36']) ? $shop_order_row['c36'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c37']) ? $shop_order_row['c37'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c38']) ? $shop_order_row['c38'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c39']) ? $shop_order_row['c39'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c40']) ? $shop_order_row['c40'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['num']) ? $shop_order_row['num'] : 0; ?></td>
|
|
</tr>
|
|
<tr height="18" style="height:13.5pt" id="r5">
|
|
<td class="x69">在途订量</td>
|
|
<td class="x69" id="in_transit_33_display_<?php echo $counter; ?>">0</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputR2_33 = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_33"]');
|
|
const displayCell = document.getElementById('in_transit_33_display_<?php echo $counter; ?>');
|
|
|
|
// 初始化显示值
|
|
displayCell.textContent = inputR2_33.value;
|
|
|
|
// 监听输入框变化事件,实时更新显示值
|
|
inputR2_33.addEventListener('change', () => {
|
|
displayCell.textContent = inputR2_33.value;
|
|
});
|
|
});
|
|
</script>
|
|
<td class="x69" id="in_transit_34_display_<?php echo $counter; ?>">0</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputR2_34 = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_34"]');
|
|
const displayCell = document.getElementById('in_transit_34_display_<?php echo $counter; ?>');
|
|
|
|
// 初始化显示值
|
|
displayCell.textContent = inputR2_34.value;
|
|
|
|
// 监听输入框变化事件,实时更新显示值
|
|
inputR2_34.addEventListener('change', () => {
|
|
displayCell.textContent = inputR2_34.value;
|
|
});
|
|
});
|
|
</script>
|
|
<td class="x69" id="in_transit_35_display_<?php echo $counter; ?>">0</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputR2_35 = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_35"]');
|
|
const displayCell = document.getElementById('in_transit_35_display_<?php echo $counter; ?>');
|
|
|
|
// 初始化显示值
|
|
displayCell.textContent = inputR2_35.value;
|
|
|
|
// 监听输入框变化事件,实时更新显示值
|
|
inputR2_35.addEventListener('change', () => {
|
|
displayCell.textContent = inputR2_35.value;
|
|
});
|
|
});
|
|
</script>
|
|
<td class="x69" id="in_transit_36_display_<?php echo $counter; ?>">0</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputR2_36 = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_36"]');
|
|
const displayCell = document.getElementById('in_transit_36_display_<?php echo $counter; ?>');
|
|
|
|
// 初始化显示值
|
|
displayCell.textContent = inputR2_36.value;
|
|
|
|
// 监听输入框变化事件,实时更新显示值
|
|
inputR2_36.addEventListener('change', () => {
|
|
displayCell.textContent = inputR2_36.value;
|
|
});
|
|
});
|
|
</script>
|
|
<td class="x69" id="in_transit_37_display_<?php echo $counter; ?>">0</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputR2_37 = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_37"]');
|
|
const displayCell = document.getElementById('in_transit_37_display_<?php echo $counter; ?>');
|
|
|
|
// 初始化显示值
|
|
displayCell.textContent = inputR2_37.value;
|
|
|
|
// 监听输入框变化事件,实时更新显示值
|
|
inputR2_37.addEventListener('change', () => {
|
|
displayCell.textContent = inputR2_37.value;
|
|
});
|
|
});
|
|
</script>
|
|
<td class="x69" id="in_transit_38_display_<?php echo $counter; ?>">0</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputR2_38 = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_38"]');
|
|
const displayCell = document.getElementById('in_transit_38_display_<?php echo $counter; ?>');
|
|
|
|
// 初始化显示值
|
|
displayCell.textContent = inputR2_38.value;
|
|
|
|
// 监听输入框变化事件,实时更新显示值
|
|
inputR2_38.addEventListener('change', () => {
|
|
displayCell.textContent = inputR2_38.value;
|
|
});
|
|
});
|
|
</script>
|
|
<td class="x69" id="in_transit_39_display_<?php echo $counter; ?>">0</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputR2_39 = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_39"]');
|
|
const displayCell = document.getElementById('in_transit_39_display_<?php echo $counter; ?>');
|
|
|
|
// 初始化显示值
|
|
displayCell.textContent = inputR2_39.value;
|
|
|
|
// 监听输入框变化事件,实时更新显示值
|
|
inputR2_39.addEventListener('change', () => {
|
|
displayCell.textContent = inputR2_39.value;
|
|
});
|
|
});
|
|
</script>
|
|
<td class="x69" id="in_transit_40_display_<?php echo $counter; ?>">0</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputR2_40 = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_40"]');
|
|
const displayCell = document.getElementById('in_transit_40_display_<?php echo $counter; ?>');
|
|
|
|
// 初始化显示值
|
|
displayCell.textContent = inputR2_40.value;
|
|
|
|
// 监听输入框变化事件,实时更新显示值
|
|
inputR2_40.addEventListener('change', () => {
|
|
displayCell.textContent = inputR2_40.value;
|
|
});
|
|
});
|
|
</script>
|
|
<!-- 直接使用前面计算并显示合计的单元格的 id 获取值 -->
|
|
<td class="x69" id="in_transit_total_display_<?php echo $counter; ?>">
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 定义当前行在途订量输入框的选择器
|
|
const inputSelector = '#r2_<?php echo $counter; ?> input[type="number"]';
|
|
// 获取所有相关输入框元素
|
|
const inputs = document.querySelectorAll(inputSelector);
|
|
// 获取用于显示合计的单元格元素
|
|
const totalCell = document.getElementById('in_transit_total_display_<?php echo $counter; ?>');
|
|
|
|
// 定义计算合计的函数
|
|
function calculateSum() {
|
|
let sum = 0;
|
|
// 遍历所有输入框,累加其值
|
|
inputs.forEach(input => {
|
|
sum += parseInt(input.value) || 0;
|
|
});
|
|
// 将计算得到的合计值显示在单元格中
|
|
totalCell.textContent = sum;
|
|
}
|
|
|
|
// 页面加载完成后立即计算一次合计
|
|
calculateSum();
|
|
|
|
// 为每个输入框添加 change 事件监听器,输入值变化时重新计算合计
|
|
inputs.forEach(input => {
|
|
input.addEventListener('change', calculateSum);
|
|
});
|
|
});
|
|
</script>
|
|
</td>
|
|
<tr height="18" style="height:13.5pt" id="r6">
|
|
<td class="x69">商品图片</td>
|
|
<td class="x69">客户订量</td>
|
|
<td class="x69" x:fmla="=D4"><?php echo isset($pf_order_row['c33']) ? $pf_order_row['c33'] : 0; ?></td>
|
|
<td class="x69" x:fmla="=D4"><?php echo isset($pf_order_row['c34']) ? $pf_order_row['c34'] : 0; ?></td>
|
|
<td class="x69" x:fmla="=D4"><?php echo isset($pf_order_row['c35']) ? $pf_order_row['c35'] : 0; ?></td>
|
|
<td class="x69" x:fmla="=D4"><?php echo isset($pf_order_row['c36']) ? $pf_order_row['c36'] : 0; ?></td>
|
|
<td class="x69" x:fmla="=D4"><?php echo isset($pf_order_row['c37']) ? $pf_order_row['c37'] : 0; ?></td>
|
|
<td class="x69" x:fmla="=D4"><?php echo isset($pf_order_row['c38']) ? $pf_order_row['c38'] : 0; ?></td>
|
|
<td class="x69" x:fmla="=D4"><?php echo isset($pf_order_row['c39']) ? $pf_order_row['c39'] : 0; ?></td>
|
|
<td class="x69" x:fmla="=D4"><?php echo isset($pf_order_row['c40']) ? $pf_order_row['c40'] : 0; ?></td>
|
|
<td class="x69" x:fmla="=D4"><?php echo isset($pf_order_row['num']) ? $pf_order_row['num'] : 0; ?></td>
|
|
</tr>
|
|
<tr height="18" style="height:13.5pt" id="r7">
|
|
<td rowspan="5" height="88" class="x70" style="border-right:1px solid windowtext;border-bottom:1px solid windowtext;height:66pt;"><img src="<?php echo get_kh_picture_dhd($item['no'], '', $item['color']); ?>" width="70" height="70" /></td>
|
|
<td class="x69">店铺合计</td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c33']) ? $shop_order_row['c33'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c34']) ? $shop_order_row['c34'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c35']) ? $shop_order_row['c35'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c36']) ? $shop_order_row['c36'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c37']) ? $shop_order_row['c37'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c38']) ? $shop_order_row['c38'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c39']) ? $shop_order_row['c39'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['c40']) ? $shop_order_row['c40'] : 0; ?></td>
|
|
<td class="x69"><?php echo isset($shop_order_row['num']) ? $shop_order_row['num'] : 0; ?></td>
|
|
</tr>
|
|
<tr height="18" style="height:13.5pt" id="r9_<?php echo $counter; ?>">
|
|
<td class="x69">总部备量</td>
|
|
<td class="x69"><input type="number" name="headquarters_stock_33" value="0" min="0" style="width: 50px; border: 2px solid #2196F3; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="headquarters_stock_34" value="0" min="0" style="width: 50px; border: 2px solid #2196F3; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="headquarters_stock_35" value="0" min="0" style="width: 50px; border: 2px solid #2196F3; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="headquarters_stock_36" value="0" min="0" style="width: 50px; border: 2px solid #2196F3; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="headquarters_stock_37" value="0" min="0" style="width: 50px; border: 2px solid #2196F3; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="headquarters_stock_38" value="0" min="0" style="width: 50px; border: 2px solid #2196F3; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="headquarters_stock_39" value="0" min="0" style="width: 50px; border: 2px solid #2196F3; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69"><input type="number" name="headquarters_stock_40" value="0" min="0" style="width: 50px; border: 2px solid #2196F3; padding: 3px; background-color: #f8f8f8;"></td>
|
|
<td class="x69" x:fmla="=SUM(D3:K3)" id="current_row_total9_<?php echo $counter; ?>">
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const inputsR9 = document.querySelectorAll('#r9_<?php echo $counter; ?> input[type="number"]');
|
|
let sumR9 = 0;
|
|
inputsR9.forEach(input => {
|
|
sumR9 += parseInt(input.value) || 0;
|
|
});
|
|
|
|
document.getElementById('current_row_total9_<?php echo $counter; ?>').textContent = sumR9;
|
|
|
|
inputsR9.forEach(input => {
|
|
input.addEventListener('change', () => {
|
|
let newSum = 0;
|
|
inputsR9.forEach(input => {
|
|
newSum += parseInt(input.value) || 0;
|
|
});
|
|
document.getElementById('current_row_total9_<?php echo $counter; ?>').textContent = newSum;
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</td>
|
|
</tr>
|
|
<tr height="18" style="height:13.5pt" id="r10">
|
|
<td class="x69">总订货量</td>
|
|
|
|
<!-- 该值等于批发订量加店铺订量加总部备量减去已在途订量 -->
|
|
<td class="x69" x:fmla="=D4+D5+D9-D3" id="total_order_33_<?php echo $counter; ?>">
|
|
<?php
|
|
// 计算批发订量
|
|
$wholesale_order = isset($pf_order_row['c33']) ? $pf_order_row['c33'] : 0;
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c33']) ? $shop_order_row['c33'] : 0;
|
|
// 初始总部备量设为 0
|
|
$headquarters_stock = 0;
|
|
// 初始已在途订量设为 0
|
|
$in_transit_order = 0;
|
|
// 计算总订货量
|
|
$total_order = $wholesale_order + $shop_order + $headquarters_stock - $in_transit_order;
|
|
echo $total_order;
|
|
?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_33"]');
|
|
// 获取已在途订量输入框
|
|
const inTransitOrderInput = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_33"]');
|
|
// 获取显示总订货量的单元格
|
|
const totalOrderCell = document.getElementById('total_order_33_<?php echo $counter; ?>');
|
|
|
|
// 定义更新总订货量的函数
|
|
function updateTotalOrder() {
|
|
// 获取批发订量,从 PHP 输出的初始值获取
|
|
const wholesaleOrder = <?php echo $wholesale_order; ?>;
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 获取已在途订量输入框的值
|
|
const inTransitOrder = parseInt(inTransitOrderInput.value) || 0;
|
|
// 计算总订货量
|
|
const newTotalOrder = wholesaleOrder + shopOrder + headquartersStock - inTransitOrder;
|
|
// 更新总订货量显示
|
|
totalOrderCell.textContent = newTotalOrder;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次总订货量
|
|
updateTotalOrder();
|
|
|
|
// 为总部备量输入框添加 change 事件监听器
|
|
headquartersStockInput.addEventListener('change', updateTotalOrder);
|
|
// 为已在途订量输入框添加 change 事件监听器
|
|
inTransitOrderInput.addEventListener('change', updateTotalOrder);
|
|
});
|
|
</script>
|
|
</td>
|
|
<td class="x69" x:fmla="=D4+D5+D9-D3" id="total_order_34_<?php echo $counter; ?>">
|
|
<?php
|
|
// 计算批发订量
|
|
$wholesale_order = isset($pf_order_row['c34']) ? $pf_order_row['c34'] : 0;
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c34']) ? $shop_order_row['c34'] : 0;
|
|
// 初始总部备量设为 0
|
|
$headquarters_stock = 0;
|
|
// 初始已在途订量设为 0
|
|
$in_transit_order = 0;
|
|
// 计算总订货量
|
|
$total_order = $wholesale_order + $shop_order + $headquarters_stock - $in_transit_order;
|
|
echo $total_order;
|
|
?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_34"]');
|
|
// 获取已在途订量输入框
|
|
const inTransitOrderInput = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_34"]');
|
|
// 获取显示总订货量的单元格
|
|
const totalOrderCell = document.getElementById('total_order_34_<?php echo $counter; ?>');
|
|
|
|
// 定义更新总订货量的函数
|
|
function updateTotalOrder() {
|
|
// 获取批发订量,从 PHP 输出的初始值获取
|
|
const wholesaleOrder = <?php echo $wholesale_order; ?>;
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 获取已在途订量输入框的值
|
|
const inTransitOrder = parseInt(inTransitOrderInput.value) || 0;
|
|
// 计算总订货量
|
|
const newTotalOrder = wholesaleOrder + shopOrder + headquartersStock - inTransitOrder;
|
|
// 更新总订货量显示
|
|
totalOrderCell.textContent = newTotalOrder;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次总订货量
|
|
updateTotalOrder();
|
|
|
|
// 为总部备量输入框添加 change 事件监听器
|
|
headquartersStockInput.addEventListener('change', updateTotalOrder);
|
|
// 为已在途订量输入框添加 change 事件监听器
|
|
inTransitOrderInput.addEventListener('change', updateTotalOrder);
|
|
});
|
|
</script>
|
|
</td>
|
|
<td class="x69" x:fmla="=D4+D5+D9-D3" id="total_order_35_<?php echo $counter; ?>">
|
|
<?php
|
|
// 计算批发订量
|
|
$wholesale_order = isset($pf_order_row['c35']) ? $pf_order_row['c35'] : 0;
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c35']) ? $shop_order_row['c35'] : 0;
|
|
// 初始总部备量设为 0
|
|
$headquarters_stock = 0;
|
|
// 初始已在途订量设为 0
|
|
$in_transit_order = 0;
|
|
// 计算总订货量
|
|
$total_order = $wholesale_order + $shop_order + $headquarters_stock - $in_transit_order;
|
|
echo $total_order;
|
|
?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_35"]');
|
|
// 获取已在途订量输入框
|
|
const inTransitOrderInput = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_35"]');
|
|
// 获取显示总订货量的单元格
|
|
const totalOrderCell = document.getElementById('total_order_35_<?php echo $counter; ?>');
|
|
|
|
// 定义更新总订货量的函数
|
|
function updateTotalOrder() {
|
|
// 获取批发订量,从 PHP 输出的初始值获取
|
|
const wholesaleOrder = <?php echo $wholesale_order; ?>;
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 获取已在途订量输入框的值
|
|
const inTransitOrder = parseInt(inTransitOrderInput.value) || 0;
|
|
// 计算总订货量
|
|
const newTotalOrder = wholesaleOrder + shopOrder + headquartersStock - inTransitOrder;
|
|
// 更新总订货量显示
|
|
totalOrderCell.textContent = newTotalOrder;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次总订货量
|
|
updateTotalOrder();
|
|
|
|
// 为总部备量输入框添加 change 事件监听器
|
|
headquartersStockInput.addEventListener('change', updateTotalOrder);
|
|
// 为已在途订量输入框添加 change 事件监听器
|
|
inTransitOrderInput.addEventListener('change', updateTotalOrder);
|
|
});
|
|
</script>
|
|
</td>
|
|
<td class="x69" x:fmla="=D4+D5+D9-D3" id="total_order_36_<?php echo $counter; ?>">
|
|
<?php
|
|
// 计算批发订量
|
|
$wholesale_order = isset($pf_order_row['c36']) ? $pf_order_row['c36'] : 0;
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c36']) ? $shop_order_row['c36'] : 0;
|
|
// 初始总部备量设为 0
|
|
$headquarters_stock = 0;
|
|
// 初始已在途订量设为 0
|
|
$in_transit_order = 0;
|
|
// 计算总订货量
|
|
$total_order = $wholesale_order + $shop_order + $headquarters_stock - $in_transit_order;
|
|
echo $total_order;
|
|
?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_36"]');
|
|
// 获取已在途订量输入框
|
|
const inTransitOrderInput = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_36"]');
|
|
// 获取显示总订货量的单元格
|
|
const totalOrderCell = document.getElementById('total_order_36_<?php echo $counter; ?>');
|
|
|
|
// 定义更新总订货量的函数
|
|
function updateTotalOrder() {
|
|
// 获取批发订量,从 PHP 输出的初始值获取
|
|
const wholesaleOrder = <?php echo $wholesale_order; ?>;
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 获取已在途订量输入框的值
|
|
const inTransitOrder = parseInt(inTransitOrderInput.value) || 0;
|
|
// 计算总订货量
|
|
const newTotalOrder = wholesaleOrder + shopOrder + headquartersStock - inTransitOrder;
|
|
// 更新总订货量显示
|
|
totalOrderCell.textContent = newTotalOrder;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次总订货量
|
|
updateTotalOrder();
|
|
|
|
// 为总部备量输入框添加 change 事件监听器
|
|
headquartersStockInput.addEventListener('change', updateTotalOrder);
|
|
// 为已在途订量输入框添加 change 事件监听器
|
|
inTransitOrderInput.addEventListener('change', updateTotalOrder);
|
|
});
|
|
</script>
|
|
</td>
|
|
<td class="x69" x:fmla="=D4+D5+D9-D3" id="total_order_37_<?php echo $counter; ?>">
|
|
<?php
|
|
// 计算批发订量
|
|
$wholesale_order = isset($pf_order_row['c37']) ? $pf_order_row['c37'] : 0;
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c37']) ? $shop_order_row['c37'] : 0;
|
|
// 初始总部备量设为 0
|
|
$headquarters_stock = 0;
|
|
// 初始已在途订量设为 0
|
|
$in_transit_order = 0;
|
|
// 计算总订货量
|
|
$total_order = $wholesale_order + $shop_order + $headquarters_stock - $in_transit_order;
|
|
echo $total_order;
|
|
?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_37"]');
|
|
// 获取已在途订量输入框
|
|
const inTransitOrderInput = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_37"]');
|
|
// 获取显示总订货量的单元格
|
|
const totalOrderCell = document.getElementById('total_order_37_<?php echo $counter; ?>');
|
|
|
|
// 定义更新总订货量的函数
|
|
function updateTotalOrder() {
|
|
// 获取批发订量,从 PHP 输出的初始值获取
|
|
const wholesaleOrder = <?php echo $wholesale_order; ?>;
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 获取已在途订量输入框的值
|
|
const inTransitOrder = parseInt(inTransitOrderInput.value) || 0;
|
|
// 计算总订货量
|
|
const newTotalOrder = wholesaleOrder + shopOrder + headquartersStock - inTransitOrder;
|
|
// 更新总订货量显示
|
|
totalOrderCell.textContent = newTotalOrder;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次总订货量
|
|
updateTotalOrder();
|
|
|
|
// 为总部备量输入框添加 change 事件监听器
|
|
headquartersStockInput.addEventListener('change', updateTotalOrder);
|
|
// 为已在途订量输入框添加 change 事件监听器
|
|
inTransitOrderInput.addEventListener('change', updateTotalOrder);
|
|
});
|
|
</script>
|
|
</td>
|
|
<td class="x69" x:fmla="=D4+D5+D9-D3" id="total_order_38_<?php echo $counter; ?>">
|
|
<?php
|
|
// 计算批发订量
|
|
$wholesale_order = isset($pf_order_row['c38']) ? $pf_order_row['c38'] : 0;
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c38']) ? $shop_order_row['c38'] : 0;
|
|
// 初始总部备量设为 0
|
|
$headquarters_stock = 0;
|
|
// 初始已在途订量设为 0
|
|
$in_transit_order = 0;
|
|
// 计算总订货量
|
|
$total_order = $wholesale_order + $shop_order + $headquarters_stock - $in_transit_order;
|
|
echo $total_order;
|
|
?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_38"]');
|
|
// 获取已在途订量输入框
|
|
const inTransitOrderInput = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_38"]');
|
|
// 获取显示总订货量的单元格
|
|
const totalOrderCell = document.getElementById('total_order_38_<?php echo $counter; ?>');
|
|
|
|
// 定义更新总订货量的函数
|
|
function updateTotalOrder() {
|
|
// 获取批发订量,从 PHP 输出的初始值获取
|
|
const wholesaleOrder = <?php echo $wholesale_order; ?>;
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 获取已在途订量输入框的值
|
|
const inTransitOrder = parseInt(inTransitOrderInput.value) || 0;
|
|
// 计算总订货量
|
|
const newTotalOrder = wholesaleOrder + shopOrder + headquartersStock - inTransitOrder;
|
|
// 更新总订货量显示
|
|
totalOrderCell.textContent = newTotalOrder;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次总订货量
|
|
updateTotalOrder();
|
|
|
|
// 为总部备量输入框添加 change 事件监听器
|
|
headquartersStockInput.addEventListener('change', updateTotalOrder);
|
|
// 为已在途订量输入框添加 change 事件监听器
|
|
inTransitOrderInput.addEventListener('change', updateTotalOrder);
|
|
});
|
|
</script>
|
|
</td>
|
|
<td class="x69" x:fmla="=D4+D5+D9-D3" id="total_order_39_<?php echo $counter; ?>">
|
|
<?php
|
|
// 计算批发订量
|
|
$wholesale_order = isset($pf_order_row['c39']) ? $pf_order_row['c39'] : 0;
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c39']) ? $shop_order_row['c39'] : 0;
|
|
// 初始总部备量设为 0
|
|
$headquarters_stock = 0;
|
|
// 初始已在途订量设为 0
|
|
$in_transit_order = 0;
|
|
// 计算总订货量
|
|
$total_order = $wholesale_order + $shop_order + $headquarters_stock - $in_transit_order;
|
|
echo $total_order;
|
|
?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_39"]');
|
|
// 获取已在途订量输入框
|
|
const inTransitOrderInput = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_39"]');
|
|
// 获取显示总订货量的单元格
|
|
const totalOrderCell = document.getElementById('total_order_39_<?php echo $counter; ?>');
|
|
|
|
// 定义更新总订货量的函数
|
|
function updateTotalOrder() {
|
|
// 获取批发订量,从 PHP 输出的初始值获取
|
|
const wholesaleOrder = <?php echo $wholesale_order; ?>;
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 获取已在途订量输入框的值
|
|
const inTransitOrder = parseInt(inTransitOrderInput.value) || 0;
|
|
// 计算总订货量
|
|
const newTotalOrder = wholesaleOrder + shopOrder + headquartersStock - inTransitOrder;
|
|
// 更新总订货量显示
|
|
totalOrderCell.textContent = newTotalOrder;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次总订货量
|
|
updateTotalOrder();
|
|
|
|
// 为总部备量输入框添加 change 事件监听器
|
|
headquartersStockInput.addEventListener('change', updateTotalOrder);
|
|
// 为已在途订量输入框添加 change 事件监听器
|
|
inTransitOrderInput.addEventListener('change', updateTotalOrder);
|
|
});
|
|
</script>
|
|
</td>
|
|
<td class="x69" x:fmla="=D4+D5+D9-D3" id="total_order_40_<?php echo $counter; ?>">
|
|
<?php
|
|
// 计算批发订量
|
|
$wholesale_order = isset($pf_order_row['c40']) ? $pf_order_row['c40'] : 0;
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c40']) ? $shop_order_row['c40'] : 0;
|
|
// 初始总部备量设为 0
|
|
$headquarters_stock = 0;
|
|
// 初始已在途订量设为 0
|
|
$in_transit_order = 0;
|
|
// 计算总订货量
|
|
$total_order = $wholesale_order + $shop_order + $headquarters_stock - $in_transit_order;
|
|
echo $total_order;
|
|
?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_40"]');
|
|
// 获取已在途订量输入框
|
|
const inTransitOrderInput = document.querySelector('#r2_<?php echo $counter; ?> input[name="in_transit_40"]');
|
|
// 获取显示总订货量的单元格
|
|
const totalOrderCell = document.getElementById('total_order_40_<?php echo $counter; ?>');
|
|
|
|
// 定义更新总订货量的函数
|
|
function updateTotalOrder() {
|
|
// 获取批发订量,从 PHP 输出的初始值获取
|
|
const wholesaleOrder = <?php echo $wholesale_order; ?>;
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 获取已在途订量输入框的值
|
|
const inTransitOrder = parseInt(inTransitOrderInput.value) || 0;
|
|
// 计算总订货量
|
|
const newTotalOrder = wholesaleOrder + shopOrder + headquartersStock - inTransitOrder;
|
|
// 更新总订货量显示
|
|
totalOrderCell.textContent = newTotalOrder;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次总订货量
|
|
updateTotalOrder();
|
|
|
|
// 为总部备量输入框添加 change 事件监听器
|
|
headquartersStockInput.addEventListener('change', updateTotalOrder);
|
|
// 为已在途订量输入框添加 change 事件监听器
|
|
inTransitOrderInput.addEventListener('change', updateTotalOrder);
|
|
});
|
|
</script>
|
|
</td>
|
|
<?php
|
|
// 直接获取批发订量合计和店铺订量合计
|
|
$wholesaleTotal = isset($pf_order_row['num']) ? $pf_order_row['num'] : 0;
|
|
$shopTotal = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSum = $wholesaleTotal + $shopTotal;
|
|
?>
|
|
<td class="x69" x:fmla="=SUM(D10:K10)" id="current_row_total10_<?php echo $counter; ?>">
|
|
<?php echo $totalSum; ?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total10_${currentCounter}`);
|
|
|
|
const calculateTotal = () => {
|
|
// 直接获取批发订量合计和店铺订量合计
|
|
const wholesaleTotal = <?php echo $wholesaleTotal; ?>;
|
|
const shopTotal = <?php echo $shopTotal; ?>;
|
|
let total = wholesaleTotal + shopTotal;
|
|
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const inTransitInput = document.querySelector(`#r2_${currentCounter} input[name="in_transit_${size}"]`);
|
|
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
const inTransitQty = inTransitInput ? parseInt(inTransitInput.value) || 0 : 0;
|
|
|
|
total += headquartersQty - inTransitQty;
|
|
});
|
|
|
|
totalSumCell.textContent = total;
|
|
};
|
|
|
|
calculateTotal();
|
|
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const inTransitInput = document.querySelector(`#r2_${currentCounter} input[name="in_transit_${size}"]`);
|
|
|
|
if (headquartersInput) headquartersInput.addEventListener('change', calculateTotal);
|
|
if (inTransitInput) inTransitInput.addEventListener('change', calculateTotal);
|
|
});
|
|
});
|
|
</script>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr height="18" style="height:13.5pt" id="r11">
|
|
<td class="x69">店铺+备量</td>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c33']) ? $shop_order_row['c33'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
?>
|
|
<td class="x69" x:fmla="=D8+D9" id="shop_and_headquarters_total_33_<?php echo $counter; ?>"><?php echo $total; ?></td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_33"]');
|
|
// 获取显示该值的单元格,通过 ID 选择更准确
|
|
const cell = document.getElementById('shop_and_headquarters_total_33_<?php echo $counter; ?>');
|
|
|
|
// 定义更新该值的函数
|
|
function updateValue() {
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 计算店铺订量加总部备量
|
|
const newValue = shopOrder + headquartersStock;
|
|
// 更新单元格的值
|
|
cell.textContent = newValue;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次该值
|
|
updateValue();
|
|
|
|
// 为总部备量输入框添加 input 事件监听器,实现实时更新
|
|
headquartersStockInput.addEventListener('input', updateValue);
|
|
// 同时保留 change 事件监听器,确保兼容性
|
|
headquartersStockInput.addEventListener('change', updateValue);
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c34']) ? $shop_order_row['c34'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
?>
|
|
<td class="x69" x:fmla="=D8+D9" id="shop_and_headquarters_total_34_<?php echo $counter; ?>"><?php echo $total; ?></td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_34"]');
|
|
// 获取显示该值的单元格,通过 ID 选择更准确
|
|
const cell = document.getElementById('shop_and_headquarters_total_34_<?php echo $counter; ?>');
|
|
|
|
// 定义更新该值的函数
|
|
function updateValue() {
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 计算店铺订量加总部备量
|
|
const newValue = shopOrder + headquartersStock;
|
|
// 更新单元格的值
|
|
cell.textContent = newValue;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次该值
|
|
updateValue();
|
|
|
|
// 为总部备量输入框添加 input 事件监听器,实现实时更新
|
|
headquartersStockInput.addEventListener('input', updateValue);
|
|
// 同时保留 change 事件监听器,确保兼容性
|
|
headquartersStockInput.addEventListener('change', updateValue);
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c35']) ? $shop_order_row['c35'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
?>
|
|
<td class="x69" x:fmla="=D8+D9" id="shop_and_headquarters_total_35_<?php echo $counter; ?>"><?php echo $total; ?></td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_35"]');
|
|
// 获取显示该值的单元格,通过 ID 选择更准确
|
|
const cell = document.getElementById('shop_and_headquarters_total_35_<?php echo $counter; ?>');
|
|
|
|
// 定义更新该值的函数
|
|
function updateValue() {
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 计算店铺订量加总部备量
|
|
const newValue = shopOrder + headquartersStock;
|
|
// 更新单元格的值
|
|
cell.textContent = newValue;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次该值
|
|
updateValue();
|
|
|
|
// 为总部备量输入框添加 input 事件监听器,实现实时更新
|
|
headquartersStockInput.addEventListener('input', updateValue);
|
|
// 同时保留 change 事件监听器,确保兼容性
|
|
headquartersStockInput.addEventListener('change', updateValue);
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c36']) ? $shop_order_row['c36'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
?>
|
|
<td class="x69" x:fmla="=D8+D9" id="shop_and_headquarters_total_36_<?php echo $counter; ?>"><?php echo $total; ?></td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_36"]');
|
|
// 获取显示该值的单元格,通过 ID 选择更准确
|
|
const cell = document.getElementById('shop_and_headquarters_total_36_<?php echo $counter; ?>');
|
|
|
|
// 定义更新该值的函数
|
|
function updateValue() {
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 计算店铺订量加总部备量
|
|
const newValue = shopOrder + headquartersStock;
|
|
// 更新单元格的值
|
|
cell.textContent = newValue;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次该值
|
|
updateValue();
|
|
|
|
// 为总部备量输入框添加 input 事件监听器,实现实时更新
|
|
headquartersStockInput.addEventListener('input', updateValue);
|
|
// 同时保留 change 事件监听器,确保兼容性
|
|
headquartersStockInput.addEventListener('change', updateValue);
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c37']) ? $shop_order_row['c37'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
?>
|
|
<td class="x69" x:fmla="=D8+D9" id="shop_and_headquarters_total_37_<?php echo $counter; ?>"><?php echo $total; ?></td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_37"]');
|
|
// 获取显示该值的单元格,通过 ID 选择更准确
|
|
const cell = document.getElementById('shop_and_headquarters_total_37_<?php echo $counter; ?>');
|
|
|
|
// 定义更新该值的函数
|
|
function updateValue() {
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 计算店铺订量加总部备量
|
|
const newValue = shopOrder + headquartersStock;
|
|
// 更新单元格的值
|
|
cell.textContent = newValue;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次该值
|
|
updateValue();
|
|
|
|
// 为总部备量输入框添加 input 事件监听器,实现实时更新
|
|
headquartersStockInput.addEventListener('input', updateValue);
|
|
// 同时保留 change 事件监听器,确保兼容性
|
|
headquartersStockInput.addEventListener('change', updateValue);
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c38']) ? $shop_order_row['c38'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
?>
|
|
<td class="x69" x:fmla="=D8+D9" id="shop_and_headquarters_total_38_<?php echo $counter; ?>"><?php echo $total; ?></td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_38"]');
|
|
// 获取显示该值的单元格,通过 ID 选择更准确
|
|
const cell = document.getElementById('shop_and_headquarters_total_38_<?php echo $counter; ?>');
|
|
|
|
// 定义更新该值的函数
|
|
function updateValue() {
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 计算店铺订量加总部备量
|
|
const newValue = shopOrder + headquartersStock;
|
|
// 更新单元格的值
|
|
cell.textContent = newValue;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次该值
|
|
updateValue();
|
|
|
|
// 为总部备量输入框添加 input 事件监听器,实现实时更新
|
|
headquartersStockInput.addEventListener('input', updateValue);
|
|
// 同时保留 change 事件监听器,确保兼容性
|
|
headquartersStockInput.addEventListener('change', updateValue);
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c39']) ? $shop_order_row['c39'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
?>
|
|
<td class="x69" x:fmla="=D8+D9" id="shop_and_headquarters_total_39_<?php echo $counter; ?>"><?php echo $total; ?></td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_39"]');
|
|
// 获取显示该值的单元格,通过 ID 选择更准确
|
|
const cell = document.getElementById('shop_and_headquarters_total_39_<?php echo $counter; ?>');
|
|
|
|
// 定义更新该值的函数
|
|
function updateValue() {
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 计算店铺订量加总部备量
|
|
const newValue = shopOrder + headquartersStock;
|
|
// 更新单元格的值
|
|
cell.textContent = newValue;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次该值
|
|
updateValue();
|
|
|
|
// 为总部备量输入框添加 input 事件监听器,实现实时更新
|
|
headquartersStockInput.addEventListener('input', updateValue);
|
|
// 同时保留 change 事件监听器,确保兼容性
|
|
headquartersStockInput.addEventListener('change', updateValue);
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c40']) ? $shop_order_row['c40'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
?>
|
|
<td class="x69" x:fmla="=D8+D9" id="shop_and_headquarters_total_40_<?php echo $counter; ?>"><?php echo $total; ?></td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 获取总部备量输入框
|
|
const headquartersStockInput = document.querySelector('#r9_<?php echo $counter; ?> input[name="headquarters_stock_40"]');
|
|
// 获取显示该值的单元格,通过 ID 选择更准确
|
|
const cell = document.getElementById('shop_and_headquarters_total_40_<?php echo $counter; ?>');
|
|
|
|
// 定义更新该值的函数
|
|
function updateValue() {
|
|
// 获取店铺订量,从 PHP 输出的初始值获取
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
// 获取总部备量输入框的值
|
|
const headquartersStock = parseInt(headquartersStockInput.value) || 0;
|
|
// 计算店铺订量加总部备量
|
|
const newValue = shopOrder + headquartersStock;
|
|
// 更新单元格的值
|
|
cell.textContent = newValue;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次该值
|
|
updateValue();
|
|
|
|
// 为总部备量输入框添加 input 事件监听器,实现实时更新
|
|
headquartersStockInput.addEventListener('input', updateValue);
|
|
// 同时保留 change 事件监听器,确保兼容性
|
|
headquartersStockInput.addEventListener('change', updateValue);
|
|
});
|
|
</script>
|
|
<?php
|
|
// 直接获取店铺订量合计
|
|
|
|
$shopTotal = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSum = $shopTotal;
|
|
?>
|
|
<td class="x69" x:fmla="=SUM(D10:K10)" id="current_row_total11_<?php echo $counter; ?>">
|
|
<?php echo $totalSum; ?>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total11_${currentCounter}`);
|
|
|
|
const calculateTotal = () => {
|
|
// 直接获取店铺订量合计
|
|
|
|
const shopTotal = <?php echo $shopTotal; ?>;
|
|
let total = shopTotal;
|
|
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
|
|
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
|
|
|
|
total += headquartersQty ;
|
|
});
|
|
|
|
totalSumCell.textContent = total;
|
|
};
|
|
|
|
calculateTotal();
|
|
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
|
|
|
|
if (headquartersInput) headquartersInput.addEventListener('change', calculateTotal);
|
|
|
|
});
|
|
});
|
|
</script>
|
|
</td>
|
|
</tr>
|
|
<tr height="18" style="height:13.5pt" id="r12">
|
|
<td class="x69">店备比例</td>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c33']) ? $shop_order_row['c33'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
// 直接获取店铺订量合计
|
|
$shopTotaldb = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSumdb = $shopTotaldb;
|
|
|
|
// 生成唯一的 ID 用于标识结果单元格
|
|
$cell_id = 'dynamic_result_33_' . $counter;
|
|
?>
|
|
<td class="x69" align="center" id="<?php echo $cell_id; ?>">
|
|
<?php
|
|
// 初始计算结果,这里将分母改为店铺订量加上总部备量的初始值(假设初始为 0)
|
|
$total_sum = $totalSumdb;
|
|
if ($total_sum === 0) {
|
|
$result = '#DIV/0!';
|
|
} else {
|
|
$result = $total / $total_sum;
|
|
// 转换为百分比并显示两位小数
|
|
$result = number_format($result * 100, 2) . '%';
|
|
}
|
|
echo $result;
|
|
?>
|
|
</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const resultCell = document.getElementById('<?php echo $cell_id; ?>');
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
|
|
// 定义更新结果的函数
|
|
function updateResult() {
|
|
let headquartersStockTotal = 0;
|
|
let headquartersStock33 = 0;
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const qty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
if (size === 33) {
|
|
headquartersStock33 = qty;
|
|
}
|
|
headquartersStockTotal += qty;
|
|
});
|
|
|
|
const total = shopOrder + headquartersStock33;
|
|
const totalSum = shopTotaldb + headquartersStockTotal;
|
|
let result;
|
|
if (totalSum === 0) {
|
|
result = '#DIV/0!';
|
|
} else {
|
|
// 转换为百分比并显示两位小数
|
|
result = ((total / totalSum) * 100).toFixed(2) + '%';
|
|
}
|
|
// 更新单元格的值
|
|
resultCell.textContent = result;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次结果
|
|
updateResult();
|
|
|
|
// 为所有总部备量输入框添加 input 和 change 事件监听器
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', updateResult);
|
|
headquartersInput.addEventListener('change', updateResult);
|
|
}
|
|
});
|
|
});
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total11_${currentCounter}`);
|
|
const calculateTotal = () => {
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
let total = shopTotaldb;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
total += headquartersQty ;
|
|
});
|
|
totalSumCell.textContent = total;
|
|
};
|
|
calculateTotal();
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', calculateTotal);
|
|
headquartersInput.addEventListener('change', calculateTotal);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c34']) ? $shop_order_row['c34'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
// 直接获取店铺订量合计
|
|
$shopTotaldb = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSumdb = $shopTotaldb;
|
|
|
|
// 生成唯一的 ID 用于标识结果单元格
|
|
$cell_id = 'dynamic_result_34_' . $counter;
|
|
?>
|
|
<td class="x69" align="center" id="<?php echo $cell_id; ?>">
|
|
<?php
|
|
// 初始计算结果,这里将分母改为店铺订量加上总部备量的初始值(假设初始为 0)
|
|
$total_sum = $totalSumdb;
|
|
if ($total_sum === 0) {
|
|
$result = '#DIV/0!';
|
|
} else {
|
|
$result = $total / $total_sum;
|
|
// 转换为百分比并显示两位小数
|
|
$result = number_format($result * 100, 2) . '%';
|
|
}
|
|
echo $result;
|
|
?>
|
|
</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const resultCell = document.getElementById('<?php echo $cell_id; ?>');
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
|
|
// 定义更新结果的函数
|
|
function updateResult() {
|
|
let headquartersStockTotal = 0;
|
|
let headquartersStock34 = 0;
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const qty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
if (size === 34) {
|
|
headquartersStock34 = qty;
|
|
}
|
|
headquartersStockTotal += qty;
|
|
});
|
|
const total = shopOrder + headquartersStock34;
|
|
const totalSum = shopTotaldb + headquartersStockTotal;
|
|
let result;
|
|
if (totalSum === 0) {
|
|
result = '#DIV/0!';
|
|
} else {
|
|
// 转换为百分比并显示两位小数
|
|
result = ((total / totalSum) * 100).toFixed(2) + '%';
|
|
}
|
|
// 更新单元格的值
|
|
resultCell.textContent = result;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次结果
|
|
updateResult();
|
|
|
|
// 为所有总部备量输入框添加 input 和 change 事件监听器
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', updateResult);
|
|
headquartersInput.addEventListener('change', updateResult);
|
|
}
|
|
});
|
|
});
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total11_${currentCounter}`);
|
|
const calculateTotal = () => {
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
let total = shopTotaldb;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
total += headquartersQty ;
|
|
});
|
|
totalSumCell.textContent = total;
|
|
};
|
|
calculateTotal();
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', calculateTotal);
|
|
headquartersInput.addEventListener('change', calculateTotal);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c35']) ? $shop_order_row['c35'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
// 直接获取店铺订量合计
|
|
$shopTotaldb = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSumdb = $shopTotaldb;
|
|
|
|
// 生成唯一的 ID 用于标识结果单元格
|
|
$cell_id = 'dynamic_result_35_' . $counter;
|
|
?>
|
|
<td class="x69" align="center" id="<?php echo $cell_id; ?>">
|
|
<?php
|
|
// 初始计算结果,这里将分母改为店铺订量加上总部备量的初始值(假设初始为 0)
|
|
$total_sum = $totalSumdb;
|
|
if ($total_sum === 0) {
|
|
$result = '#DIV/0!';
|
|
} else {
|
|
$result = $total / $total_sum;
|
|
// 转换为百分比并显示两位小数
|
|
$result = number_format($result * 100, 2) . '%';
|
|
}
|
|
echo $result;
|
|
?>
|
|
</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const resultCell = document.getElementById('<?php echo $cell_id; ?>');
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
|
|
// 定义更新结果的函数
|
|
function updateResult() {
|
|
let headquartersStockTotal = 0;
|
|
let headquartersStock35 = 0;
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const qty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
if (size === 35) {
|
|
headquartersStock35 = qty;
|
|
}
|
|
headquartersStockTotal += qty;
|
|
});
|
|
|
|
const total = shopOrder + headquartersStock35;
|
|
const totalSum = shopTotaldb + headquartersStockTotal;
|
|
let result;
|
|
if (totalSum === 0) {
|
|
result = '#DIV/0!';
|
|
} else {
|
|
// 转换为百分比并显示两位小数
|
|
result = ((total / totalSum) * 100).toFixed(2) + '%';
|
|
}
|
|
// 更新单元格的值
|
|
resultCell.textContent = result;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次结果
|
|
updateResult();
|
|
|
|
// 为所有总部备量输入框添加 input 和 change 事件监听器
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', updateResult);
|
|
headquartersInput.addEventListener('change', updateResult);
|
|
}
|
|
});
|
|
});
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total11_${currentCounter}`);
|
|
const calculateTotal = () => {
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
let total = shopTotaldb;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
total += headquartersQty ;
|
|
});
|
|
totalSumCell.textContent = total;
|
|
};
|
|
calculateTotal();
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', calculateTotal);
|
|
headquartersInput.addEventListener('change', calculateTotal);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c36']) ? $shop_order_row['c36'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
// 直接获取店铺订量合计
|
|
$shopTotaldb = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSumdb = $shopTotaldb;
|
|
|
|
// 生成唯一的 ID 用于标识结果单元格
|
|
$cell_id = 'dynamic_result_36_' . $counter;
|
|
?>
|
|
<td class="x69" align="center" id="<?php echo $cell_id; ?>">
|
|
<?php
|
|
// 初始计算结果,这里将分母改为店铺订量加上总部备量的初始值(假设初始为 0)
|
|
$total_sum = $totalSumdb;
|
|
if ($total_sum === 0) {
|
|
$result = '#DIV/0!';
|
|
} else {
|
|
$result = $total / $total_sum;
|
|
// 转换为百分比并显示两位小数
|
|
$result = number_format($result * 100, 2) . '%';
|
|
}
|
|
echo $result;
|
|
?>
|
|
</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const resultCell = document.getElementById('<?php echo $cell_id; ?>');
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
|
|
// 定义更新结果的函数
|
|
function updateResult() {
|
|
let headquartersStockTotal = 0;
|
|
let headquartersStock36 = 0;
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const qty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
if (size === 36) {
|
|
headquartersStock36 = qty;
|
|
}
|
|
headquartersStockTotal += qty;
|
|
});
|
|
|
|
const total = shopOrder + headquartersStock36;
|
|
const totalSum = shopTotaldb + headquartersStockTotal;
|
|
let result;
|
|
if (totalSum === 0) {
|
|
result = '#DIV/0!';
|
|
} else {
|
|
// 转换为百分比并显示两位小数
|
|
result = ((total / totalSum) * 100).toFixed(2) + '%';
|
|
}
|
|
// 更新单元格的值
|
|
resultCell.textContent = result;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次结果
|
|
updateResult();
|
|
|
|
// 为所有总部备量输入框添加 input 和 change 事件监听器
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', updateResult);
|
|
headquartersInput.addEventListener('change', updateResult);
|
|
}
|
|
});
|
|
});
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total11_${currentCounter}`);
|
|
const calculateTotal = () => {
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
let total = shopTotaldb;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
total += headquartersQty ;
|
|
});
|
|
totalSumCell.textContent = total;
|
|
};
|
|
calculateTotal();
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', calculateTotal);
|
|
headquartersInput.addEventListener('change', calculateTotal);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c37']) ? $shop_order_row['c37'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
// 直接获取店铺订量合计
|
|
$shopTotaldb = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSumdb = $shopTotaldb;
|
|
|
|
// 生成唯一的 ID 用于标识结果单元格
|
|
$cell_id = 'dynamic_result_37_' . $counter;
|
|
?>
|
|
<td class="x69" align="center" id="<?php echo $cell_id; ?>">
|
|
<?php
|
|
// 初始计算结果,这里将分母改为店铺订量加上总部备量的初始值(假设初始为 0)
|
|
$total_sum = $totalSumdb;
|
|
if ($total_sum === 0) {
|
|
$result = '#DIV/0!';
|
|
} else {
|
|
$result = $total / $total_sum;
|
|
// 转换为百分比并显示两位小数
|
|
$result = number_format($result * 100, 2) . '%';
|
|
}
|
|
echo $result;
|
|
?>
|
|
</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const resultCell = document.getElementById('<?php echo $cell_id; ?>');
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
|
|
// 定义更新结果的函数
|
|
function updateResult() {
|
|
let headquartersStockTotal = 0;
|
|
let headquartersStock37 = 0;
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const qty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
if (size === 37) {
|
|
headquartersStock37 = qty;
|
|
}
|
|
headquartersStockTotal += qty;
|
|
});
|
|
|
|
const total = shopOrder + headquartersStock37;
|
|
const totalSum = shopTotaldb + headquartersStockTotal;
|
|
let result;
|
|
if (totalSum === 0) {
|
|
result = '#DIV/0!';
|
|
} else {
|
|
// 转换为百分比并显示两位小数
|
|
result = ((total / totalSum) * 100).toFixed(2) + '%';
|
|
}
|
|
// 更新单元格的值
|
|
resultCell.textContent = result;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次结果
|
|
updateResult();
|
|
|
|
// 为所有总部备量输入框添加 input 和 change 事件监听器
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', updateResult);
|
|
headquartersInput.addEventListener('change', updateResult);
|
|
}
|
|
});
|
|
});
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total11_${currentCounter}`);
|
|
const calculateTotal = () => {
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
let total = shopTotaldb;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
total += headquartersQty ;
|
|
});
|
|
totalSumCell.textContent = total;
|
|
};
|
|
calculateTotal();
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', calculateTotal);
|
|
headquartersInput.addEventListener('change', calculateTotal);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c38']) ? $shop_order_row['c38'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
// 直接获取店铺订量合计
|
|
$shopTotaldb = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSumdb = $shopTotaldb;
|
|
|
|
// 生成唯一的 ID 用于标识结果单元格
|
|
$cell_id = 'dynamic_result_38_' . $counter;
|
|
?>
|
|
<td class="x69" align="center" id="<?php echo $cell_id; ?>">
|
|
<?php
|
|
// 初始计算结果,这里将分母改为店铺订量加上总部备量的初始值(假设初始为 0)
|
|
$total_sum = $totalSumdb;
|
|
if ($total_sum === 0) {
|
|
$result = '#DIV/0!';
|
|
} else {
|
|
$result = $total / $total_sum;
|
|
// 转换为百分比并显示两位小数
|
|
$result = number_format($result * 100, 2) . '%';
|
|
}
|
|
echo $result;
|
|
?>
|
|
</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const resultCell = document.getElementById('<?php echo $cell_id; ?>');
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
|
|
// 定义更新结果的函数
|
|
function updateResult() {
|
|
let headquartersStockTotal = 0;
|
|
let headquartersStock38 = 0;
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const qty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
if (size === 38) {
|
|
headquartersStock38 = qty;
|
|
}
|
|
headquartersStockTotal += qty;
|
|
});
|
|
|
|
const total = shopOrder + headquartersStock38;
|
|
const totalSum = shopTotaldb + headquartersStockTotal;
|
|
let result;
|
|
if (totalSum === 0) {
|
|
result = '#DIV/0!';
|
|
} else {
|
|
// 转换为百分比并显示两位小数
|
|
result = ((total / totalSum) * 100).toFixed(2) + '%';
|
|
}
|
|
// 更新单元格的值
|
|
resultCell.textContent = result;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次结果
|
|
updateResult();
|
|
|
|
// 为所有总部备量输入框添加 input 和 change 事件监听器
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', updateResult);
|
|
headquartersInput.addEventListener('change', updateResult);
|
|
}
|
|
});
|
|
});
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total11_${currentCounter}`);
|
|
const calculateTotal = () => {
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
let total = shopTotaldb;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
total += headquartersQty ;
|
|
});
|
|
totalSumCell.textContent = total;
|
|
};
|
|
calculateTotal();
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', calculateTotal);
|
|
headquartersInput.addEventListener('change', calculateTotal);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c39']) ? $shop_order_row['c39'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
// 直接获取店铺订量合计
|
|
$shopTotaldb = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSumdb = $shopTotaldb;
|
|
|
|
// 生成唯一的 ID 用于标识结果单元格
|
|
$cell_id = 'dynamic_result_39_' . $counter;
|
|
?>
|
|
<td class="x69" align="center" id="<?php echo $cell_id; ?>">
|
|
<?php
|
|
// 初始计算结果,这里将分母改为店铺订量加上总部备量的初始值(假设初始为 0)
|
|
$total_sum = $totalSumdb;
|
|
if ($total_sum === 0) {
|
|
$result = '#DIV/0!';
|
|
} else {
|
|
$result = $total / $total_sum;
|
|
// 转换为百分比并显示两位小数
|
|
$result = number_format($result * 100, 2) . '%';
|
|
}
|
|
echo $result;
|
|
?>
|
|
</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const resultCell = document.getElementById('<?php echo $cell_id; ?>');
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
|
|
// 定义更新结果的函数
|
|
function updateResult() {
|
|
let headquartersStockTotal = 0;
|
|
let headquartersStock39 = 0;
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const qty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
if (size === 39) {
|
|
headquartersStock39 = qty;
|
|
}
|
|
headquartersStockTotal += qty;
|
|
});
|
|
|
|
const total = shopOrder + headquartersStock39;
|
|
const totalSum = shopTotaldb + headquartersStockTotal;
|
|
let result;
|
|
if (totalSum === 0) {
|
|
result = '#DIV/0!';
|
|
} else {
|
|
// 转换为百分比并显示两位小数
|
|
result = ((total / totalSum) * 100).toFixed(2) + '%';
|
|
}
|
|
// 更新单元格的值
|
|
resultCell.textContent = result;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次结果
|
|
updateResult();
|
|
|
|
// 为所有总部备量输入框添加 input 和 change 事件监听器
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', updateResult);
|
|
headquartersInput.addEventListener('change', updateResult);
|
|
}
|
|
});
|
|
});
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total11_${currentCounter}`);
|
|
const calculateTotal = () => {
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
let total = shopTotaldb;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
total += headquartersQty ;
|
|
});
|
|
totalSumCell.textContent = total;
|
|
};
|
|
calculateTotal();
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', calculateTotal);
|
|
headquartersInput.addEventListener('change', calculateTotal);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<?php
|
|
// 计算店铺订量
|
|
$shop_order = isset($shop_order_row['c40']) ? $shop_order_row['c40'] : 0;
|
|
// 获取总部备量输入框的值,由于此时可能未加载页面,先初始化为 0
|
|
$headquarters_stock = 0;
|
|
// 计算店铺订量加总部备量
|
|
$total = $shop_order + $headquarters_stock;
|
|
// 直接获取店铺订量合计
|
|
$shopTotaldb = isset($shop_order_row['num']) ? $shop_order_row['num'] : 0;
|
|
$totalSumdb = $shopTotaldb;
|
|
|
|
// 生成唯一的 ID 用于标识结果单元格
|
|
$cell_id = 'dynamic_result_40_' . $counter;
|
|
?>
|
|
<td class="x69" align="center" id="<?php echo $cell_id; ?>">
|
|
<?php
|
|
// 初始计算结果,这里将分母改为店铺订量加上总部备量的初始值(假设初始为 0)
|
|
$total_sum = $totalSumdb;
|
|
if ($total_sum === 0) {
|
|
$result = '#DIV/0!';
|
|
} else {
|
|
$result = $total / $total_sum;
|
|
// 转换为百分比并显示两位小数
|
|
$result = number_format($result * 100, 2) . '%';
|
|
}
|
|
echo $result;
|
|
?>
|
|
</td>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const resultCell = document.getElementById('<?php echo $cell_id; ?>');
|
|
const shopOrder = <?php echo $shop_order; ?>;
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
|
|
// 定义更新结果的函数
|
|
function updateResult() {
|
|
let headquartersStockTotal = 0;
|
|
let headquartersStock40 = 0;
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const qty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
if (size === 40) {
|
|
headquartersStock40 = qty;
|
|
}
|
|
headquartersStockTotal += qty;
|
|
});
|
|
|
|
const total = shopOrder + headquartersStock40;
|
|
const totalSum = shopTotaldb + headquartersStockTotal;
|
|
let result;
|
|
if (totalSum === 0) {
|
|
result = '#DIV/0!';
|
|
} else {
|
|
// 转换为百分比并显示两位小数
|
|
result = ((total / totalSum) * 100).toFixed(2) + '%';
|
|
}
|
|
// 更新单元格的值
|
|
resultCell.textContent = result;
|
|
}
|
|
|
|
// 页面加载完成后立即更新一次结果
|
|
updateResult();
|
|
|
|
// 为所有总部备量输入框添加 input 和 change 事件监听器
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', updateResult);
|
|
headquartersInput.addEventListener('change', updateResult);
|
|
}
|
|
});
|
|
});
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const currentCounter = <?php echo $counter; ?>;
|
|
const totalSumCell = document.getElementById(`current_row_total11_${currentCounter}`);
|
|
const calculateTotal = () => {
|
|
const shopTotaldb = <?php echo $shopTotaldb; ?>;
|
|
let total = shopTotaldb;
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
const headquartersQty = headquartersInput ? parseInt(headquartersInput.value) || 0 : 0;
|
|
total += headquartersQty ;
|
|
});
|
|
totalSumCell.textContent = total;
|
|
};
|
|
calculateTotal();
|
|
const sizes = Array.from({length: 8}, (_, i) => i + 33);
|
|
sizes.forEach(size => {
|
|
const headquartersInput = document.querySelector(`#r9_${currentCounter} input[name="headquarters_stock_${size}"]`);
|
|
if (headquartersInput) {
|
|
headquartersInput.addEventListener('input', calculateTotal);
|
|
headquartersInput.addEventListener('change', calculateTotal);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<td class="x69" x:fmla="=SUM(D11:K11)" id="current_row_total12">100%</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<br />
|