修复 用章类型

This commit is contained in:
王思川 2024-06-16 19:34:15 +08:00
parent 10e3ec0af3
commit b053cdba0f
2 changed files with 40 additions and 1 deletions

View File

@ -141,3 +141,38 @@
}
});
</script>
<script type="text/javascript">
$(document).ready(function () {
// 动态生成id_seal_type的select选项
var sealTypeOptions = [
{ value: '公章', text: '公章' },
{ value: '法人章', text: '法人章' },
{ value: '合同章', text: '合同章' },
{ value: '财务章', text: '财务章' },
{ value: '其他', text: '其他' }
];
var $sealTypeSelect = $('<select>', {
class: 'form-control',
id: 'id_seal_type',
name: 'seal_type'
});
$.each(sealTypeOptions, function (index, option) {
$sealTypeSelect.append($('<option>', {
value: option.value,
text: option.text
}));
});
// 替换现有的#id_seal_type元素
$('#id_seal_type').replaceWith($sealTypeSelect);
// 如果需要在选择时执行某些操作,可以添加监听器
$('#id_seal_type').change(function() {
var selectedSealType = $(this).val();
console.log('选择的用印类型是:' + selectedSealType);
// 在这里添加其他需要的处理逻辑
});
});
</script>

View File

@ -118,6 +118,10 @@
data-id="{{ item|get_pk_value }}"
data-bs-toggle="modal"
data-bs-target="#addEditModal">编辑</a>
<a href="#" class="edit-btn" style="color: red"
data-id="{{ item|get_pk_value }}"
data-bs-toggle="modal"
data-bs-target="#addEditModal">删除</a>
</td>
</tr>
{% empty %}