pharmacistsEdit.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('编辑')" />
  5. </head>
  6. <body>
  7. <div class="ui-layout-center">
  8. <form id="form-SSpglJfspProductinfo-edit" class="customize-search-form">
  9. <div class="customize-form-group-container">
  10. <input type="hidden" id="id" name="id" th:value="${id}">
  11. <div class="customize-form-group-container">
  12. <div class="customize-form-group-container">
  13. <div class="customize-form-group">
  14. <label id="shys">审核药师:</label>
  15. <label id="task">跟进人姓名:</label>
  16. <input name="pharmacistName" placeholder="请输入审核药师" id="pharmacistName" th:value="${pharmacistName}" class="styled-input" type="text">
  17. </div>
  18. <div class="customize-form-group" id="pwd">
  19. <label >审核密码:</label>
  20. <input name="reviewPassword" placeholder="请输入审核密码" id="reviewPassword" th:value="${reviewPassword}" class="styled-input" type="text">
  21. </div>
  22. <div class="customize-form-group" id="ssjh">
  23. <label >手机号:</label>
  24. <input name="phone" placeholder="请输入手机号" id="phone" class="styled-input" th:value="${phone}" type="number" maxlength="11">
  25. </div>
  26. <div class="customize-form-group">
  27. <label>角色:</label>
  28. <select name="position" id="position" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_roles')}" required>
  29. <option value="">请选择</option>
  30. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${position}==${dict.dictValue}"></option>
  31. </select>
  32. </div>
  33. <div class="customize-form-group" id="default_follow_upId" >
  34. <label>是否默认为任务跟进人:</label>
  35. <select name="default_follow_up" id="default_follow_up" class="styled-input" th:with="type=${@dict.getType('sys_select_yes_no')}" required>
  36. <option value="">请选择</option>
  37. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${default_follow_up}==${dict.dictValue}"></option>
  38. </select>
  39. </div>
  40. <div class="customize-form-group">
  41. <label>所属门店:</label>
  42. <input name="storeName" placeholder="请输入所属门店" id="storeName" th:value="${storeName}" class="styled-input" type="text" readonly>
  43. </div>
  44. <div class="customize-form-group" id="statusDIv">
  45. <label>在职状态:</label>
  46. <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_job_status')}" required>
  47. <option value="">请选择</option>
  48. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${status}==${dict.dictValue}"></option>
  49. </select>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </form>
  55. </div>
  56. <div class="main-content">
  57. <div class="col-sm-offset-5 col-sm-10">
  58. </div>
  59. </div>
  60. <th:block th:include="include :: footer" />
  61. </body>
  62. </html>
  63. <script th:inline="javascript">
  64. var positionFlag=false;
  65. //初始化加载
  66. $(document).ready(function() {
  67. var id = $("#id").val();
  68. var position = $("#position").val();
  69. var ssjh = $("#ssjh").val();
  70. var pwd = $("#pwd").val();
  71. var task = $("#task").val();
  72. var shys = $("#shys").val();
  73. if(position=="审核药师"){
  74. positionFlag=false;
  75. $("#ssjh").hide();
  76. $("#task").hide();
  77. $("#default_follow_upId").hide();
  78. // $("#statusDIv").hide();
  79. }else if(position=="任务跟进人"){
  80. var selectedValue = $('#default_follow_up').val();
  81. if (selectedValue === '1') {
  82. positionFlag=true;
  83. }
  84. $("#pwd").hide();
  85. $("#shys").hide();
  86. }else {
  87. positionFlag=false;
  88. $("#ssjh").hide();
  89. $("#task").hide();
  90. $("#default_follow_upId").hide();
  91. }
  92. });
  93. function edit() {
  94. var data = $("#form-SSpglJfspProductinfo-edit").serializeArray();
  95. $.ajax({
  96. cache : true,
  97. type : "POST",
  98. url : ctx + "gxhpz/pharmacists/pharmacistsEdit",
  99. data : data,
  100. async : false,
  101. error : function(request) {
  102. $.modal.alertError("系统错误");
  103. },
  104. success : function(data) {
  105. $.operate.successCallback(data);
  106. }
  107. });
  108. }
  109. function submitHandler() {
  110. if ($.validate.form()) {
  111. if(positionFlag){
  112. var selectedValue = $('#default_follow_up').val();
  113. if (selectedValue === '1') {
  114. $.modal.confirm("设置该用户为默认任务跟进人,将替换已有的的默认任务跟进人", function() {
  115. edit();
  116. });
  117. } else {
  118. edit();
  119. }
  120. }else {
  121. edit();
  122. }
  123. }
  124. }
  125. </script>