修复登记借出按钮并更新前端缓存版本
This commit is contained in:
Vendored
+9
-2
@@ -1548,7 +1548,8 @@
|
||||
loadCenter();
|
||||
}));
|
||||
$('#center-new').addEventListener('click', () => openActivityForm(null, 'center'));
|
||||
$('#center-new-loan').addEventListener('click', () => centerForm('登记借出',
|
||||
function openLoanForm() {
|
||||
centerForm('登记借出',
|
||||
`<p class="muted">这里只保存借出记录,不占用库存,也不要求物品已加入库存清单。借出理由全员可见,联系方式仅本人可见。</p>
|
||||
<label>借出物品<input name="item_name" required maxlength="100" placeholder="例如:投影仪、音箱" /></label>
|
||||
<label>数量<input name="quantity" type="number" min="1" max="100000" value="1" required /></label>
|
||||
@@ -1559,7 +1560,13 @@
|
||||
quantity: Number(f.quantity.value),
|
||||
reason: f.reason.value,
|
||||
contact: f.contact.value,
|
||||
}})));
|
||||
}}));
|
||||
}
|
||||
document.addEventListener('click', event => {
|
||||
const button = event.target.closest('#center-new-loan');
|
||||
if (!button || button.disabled) return;
|
||||
openLoanForm();
|
||||
});
|
||||
for (const id of ['center-q', 'center-item-q']) $('#' + id).addEventListener('input', debounce(loadCenter, 300));
|
||||
for (const id of ['center-from', 'center-to', 'center-loan-status']) $('#' + id).addEventListener('change', loadCenter);
|
||||
$('#center-refresh').addEventListener('click', loadCenter);
|
||||
|
||||
Reference in New Issue
Block a user