part_whereused.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {% extends "BOM/layout.html" %}
  2. {% load static %}
  3. {% block script %}
  4. <script src="{% static 'axios.min.js' %}"></script>
  5. <script src="{% static 'qs.js' %}"></script>
  6. <script src="{% static 'react.production.min.js' %}"></script>
  7. <script src="{% static 'react-dom.production.min.js' %}"></script>
  8. <script src="{% static 'babel.min.js' %}"></script>
  9. {% endblock script %}
  10. {% block body %}
  11. <div id="main" class="container-fluid">
  12. <form method="post">
  13. {% csrf_token %}
  14. <div class="mb-3 mt-3">
  15. <label for="part_number" class="form-label">料号:</label>
  16. <input type="text" class="form-control" id="part_number" placeholder="输入料号" name="part_number" maxlength="16" onblur="contentCheck()"/>
  17. </div>
  18. <div class="mb-3 mt-3">
  19. <label for="description" class="form-label"><input class="form-check-input" type="checkbox" name="include_EOL_parts">包含停用的料号</label>
  20. </div>
  21. <div id="form-button-area">
  22. <button type="submit" name="search" value="create" id="search" class="btn btn-primary" >搜索</button>
  23. <a href="/home/">返回</a>
  24. </div>
  25. </form>
  26. </div>
  27. <script>
  28. function contentCheck(){
  29. console.log("contentCheck start")
  30. var part_number = document.getElementById("part_number").value.trim()
  31. if (part_number.length == 0){
  32. console.log("contentCheck fail")
  33. document.getElementById("search").setAttribute("disabled","disabled")
  34. }else{
  35. console.log("contentCheck pass")
  36. document.getElementById("search").removeAttribute("disabled")
  37. }
  38. }
  39. </script>
  40. <style type="text/css">
  41. #main {
  42. display: inline-flex;
  43. justify-content: center;
  44. }
  45. form {
  46. justify-content: center;
  47. margin: 50px;
  48. width: inherit;
  49. }
  50. #form-button-area {
  51. display: flex;
  52. justify-content: space-around;
  53. margin-top: 10px;
  54. }
  55. div.attachmentList {
  56. display: flex;
  57. justify-content: space-around;
  58. }
  59. div.supplier_search {
  60. display: flex;
  61. justify-content: flex-start;
  62. }
  63. .card {
  64. margin-bottom: 10px;
  65. width: 100%;
  66. }
  67. .BOM-qty {
  68. width: 100px;
  69. }
  70. </style>
  71. {% endblock body %}