divide.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>分配客户</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport"
  9. content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  10. <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  11. <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  12. <link rel="stylesheet" type="text/css" href="../../layuiadmin/style/formSelects-v4.css"/>
  13. <style>
  14. .input {
  15. border-radius: 2px;
  16. height: 38px;
  17. border-width: 1px;
  18. border-color: lightgray;
  19. border-style: solid;
  20. background-color: white;
  21. padding-left: 3px;
  22. }
  23. </style>
  24. </head>
  25. <body>
  26. <div class="layui-fluid">
  27. <div class="layui-row layui-col-space15">
  28. <div class="layui-card">
  29. <div class="layui-card-body" pad15>
  30. <form class="layui-form" action="" lay-filter="component-form-element">
  31. <div class="layui-row layui-col-space10 layui-form-item">
  32. <div>
  33. <label class="layui-form-label"><font color='red' size="4">*</font>选择人员:</label>
  34. <div class="layui-input-block">
  35. <select lay-verify="required" name="source" id="id_source">
  36. <option value="">请选择人员</option>
  37. <option value="1">小红</option>
  38. <option value="2">小芳</option>
  39. <option value="3">小绿</option>
  40. </select>
  41. </div>
  42. </div>
  43. <button id="id_save" class="layui-btn" lay-submit lay-filter="component-form-element"
  44. style="display: none">保存
  45. </button>
  46. </div>
  47. </form>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <script src="../../layuiadmin/layui/layui.js"></script>
  53. <script>
  54. layui.link('../../../layuiadmin/style/autocomplete.css');
  55. layui.config({
  56. base: '../../../layuiadmin/' //静态资源所在路径
  57. , autocomplete: 'autocomplete'
  58. }).extend({
  59. index: 'lib/index',
  60. formSelects: 'formSelects-v4'
  61. }).use(['index', 'form', 'autocomplete', 'formSelects'], function () {
  62. var $ = layui.$
  63. , admin = layui.admin
  64. , formSelects = layui.formSelects
  65. , form = layui.form
  66. var id = layui.view.getParameterByName('id');
  67. console.log(id, "oppppp");
  68. // admin.req({
  69. // url: '/customer/dict/',
  70. // done: function (res) {
  71. // var data_source = res.data.source;
  72. // var source_node = $('#id_source');
  73. // for (var i in data_source) {
  74. // var pid = data_source[i].id;
  75. // var name = data_source[i].name;
  76. // source_node.append("<option value='" + pid + "'>" + name + "</option>");
  77. // }
  78. // var data_project = res.data.project;
  79. // let tempData = [];
  80. // if(data_project && data_project.length > 0){
  81. // tempData = data_project.map(item=>{
  82. // if(id && editdata['project']){
  83. // if(typeof editdata['project'] === 'number'){
  84. // editdata['project'] = [editdata['project']]
  85. // }
  86. // editdata['project'].forEach(item1=>{
  87. // if(item.id === item1){
  88. // item.selected = 'selected'
  89. // }else{
  90. // item.selected = ''
  91. // }
  92. // })
  93. // }
  94. // return {value: item.id, name: item.name, selected: item.selected }
  95. // });
  96. // }
  97. // formSelects.data('selectProject', 'local', {
  98. // arr: tempData
  99. // });
  100. // form.val("component-form-element", editdata);
  101. // }
  102. // });
  103. //form.render(null, 'component-form-element');
  104. form.on('submit(component-form-element)', function (data) {
  105. // if (id) {
  106. // var url = '/customer/report_customer/' + id + '/';
  107. // var type = 'put';
  108. // } else {
  109. // url = '/customer/report_customer/';
  110. // type = 'post'
  111. // }
  112. var submitData = data.field;
  113. // admin.req({
  114. // url: url
  115. // , data: data.field
  116. // , type: type
  117. // , done: function (res) {
  118. parent.layui.onSubmitChild();
  119. // }
  120. // });
  121. return false;
  122. });
  123. parent.layui.submitChild = function () {
  124. $("#id_save").click();
  125. };
  126. });
  127. </script>
  128. </body>
  129. </html>