refill.task.add.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  2. <!--//zmr>v20-->
  3. <style>
  4. .layui-form-select .layui-input {
  5. padding: 13px 5px;
  6. }
  7. .layui-form-select dl {
  8. top: 29px !important;
  9. min-width: 40%!important;
  10. }
  11. .layui-form-select .layui-edge {
  12. right: 204px!important;
  13. }
  14. .layui-input {
  15. width: 41%!important;
  16. }
  17. .layui-form-select {
  18. width: 85%;
  19. }
  20. .layui-select-title {
  21. width: 100%;
  22. }
  23. .page .fixed-bar .item-title h3 {
  24. margin-top: 18px !important;
  25. margin-bottom: 10px !important;
  26. font-weight: 700 !important;
  27. }
  28. .tab-base li span {
  29. font-size: 12px !important;
  30. }
  31. </style>
  32. <div class="page">
  33. <div class="fixed-bar">
  34. <div class="item-title">
  35. <h3>对账管理</h3>
  36. <ul class="tab-base">
  37. <li><a href="index.php?act=OrderStats&op=index&type=system"><span>上游对账记录</span></a></li>
  38. <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
  39. <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
  40. <li><a href="index.php?act=OrderStats&op=refill_task"><span>任务列表</span></a></li>
  41. <li><a href="JavaScript:void(0);" class="current"><span>任务录入</span></a></li>
  42. </ul>
  43. </div>
  44. </div>
  45. <div class="fixed-empty"></div>
  46. <form id="points_form" method="post" name="form1" enctype="multipart/form-data" >
  47. <input type="hidden" name="form_submit" value="ok"/>
  48. <table class="table tb-type2 nobdb">
  49. <tbody>
  50. <tr class="noborder">
  51. <td colspan="2" class="required"><label class="validation">任务类型:</label></td>
  52. </tr>
  53. <tr class="noborder">
  54. <td class="layui-form">
  55. <select name="task_type" class="layui_in" id="task_type" lay-verify="" lay-search>
  56. <option value="">请选择</option>
  57. <?php foreach ($output['task_type'] as $key => $value){?>
  58. <option value="<?php echo $key;?>"><?php echo $value;?></option>
  59. <?php }?>
  60. </select>
  61. <td class="vatop tips"></td>
  62. </td>
  63. </tr>
  64. <tr>
  65. <td colspan="2" class="required"><label class="validation">主体类型:</label></td>
  66. </tr>
  67. <tr class="noborder">
  68. <td class="layui-form">
  69. <select name="type" class="layui_in subject" id="type" lay-verify="" lay-search lay-filter="type">
  70. <option value="">请选择</option>
  71. <?php foreach ($output['type'] as $key => $value){?>
  72. <option value="<?php echo $key;?>"><?php echo $value;?></option>
  73. <?php }?>
  74. </select>
  75. </td>
  76. <td class="vatop tips"></td>
  77. </tr>
  78. <tr>
  79. <td colspan="2" class="required"><label class="validation">主体选择:</label></td>
  80. </tr>
  81. <tr class="noborder" >
  82. <td class="layui-form">
  83. <label for="selection"></label>
  84. <select name="body" id="selection" lay-search></select>
  85. </td>
  86. <td class="vatop tips"></td>
  87. </tr>
  88. <tr>
  89. <td colspan="2" class="required"><label class="validation">任务统计条件:</label></td>
  90. </tr>
  91. <tr class="noborder" >
  92. <td style="width: 380px;" >
  93. <label for="startTime">日期区间:</label>
  94. <input style="margin-left:10px;width:120px" class="txt date" type="text"
  95. value=""
  96. id="startTime" name="query_start_time" autocomplete="off"/>
  97. <label for="endTime">~</label>
  98. <input class="txt date" type="text" value="" id="endTime"
  99. name="query_end_time" autocomplete="off" style="width:120px"/>
  100. </td>
  101. <td class="vatop tips"></td>
  102. </tr>
  103. <tr class="noborder" >
  104. <td colspan="2" class="vatop rowform">
  105. <label for="order_time_type" >日期类型:</label>
  106. </td>
  107. </tr>
  108. <tr class="noborder">
  109. <td class="layui-form">
  110. <select name="order_time_type" class="querySelect" id="order_time_type">
  111. <option value="">请选择</option>
  112. <?php foreach ($output['order_time_type'] as $key => $value) { ?>
  113. <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
  114. <?php } ?>
  115. </select>
  116. </td>
  117. <td class="vatop tips"></td>
  118. </tr>
  119. <tr class="noborder">
  120. <td colspan="2" class="vatop rowform">
  121. <label for="order_state" >订单状态:</label>
  122. </td>
  123. </tr>
  124. <tr class="noborder">
  125. <td class="layui-form">
  126. <select name="order_state" class="querySelect" id="order_state">
  127. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  128. <option value="10"><?php echo $lang['order_state_new']; ?></option>
  129. <option value="20"><?php echo $lang['order_state_pay']; ?></option>
  130. <option value="30"><?php echo $lang['order_state_send']; ?></option>
  131. <option value="40"><?php echo $lang['order_state_success']; ?></option>
  132. <option value="0"><?php echo $lang['order_state_cancel']; ?></option>
  133. </select>
  134. </td>
  135. <td class="vatop tips"></td>
  136. </tr>
  137. </tbody>
  138. <tfoot>
  139. <tr class="tfoot">
  140. <td>
  141. <a href="JavaScript:void(0);" class="btn" id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a>
  142. </td>
  143. </tr>
  144. </tfoot>
  145. </table>
  146. </form>
  147. </div>
  148. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  149. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  150. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  151. charset="utf-8"></script>
  152. <link rel="stylesheet" type="text/css"
  153. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  154. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/refill/layer.js"></script>
  155. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/layui.js"></script>
  156. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  157. <script type="text/javascript">
  158. var ji = null;
  159. $(function () {
  160. $("#voucher").change(function () {
  161. $("#textfield1").val($(this).val());
  162. });
  163. $("#submitBtn").click(function () {
  164. if ($("#points_form").valid()) {
  165. $("#points_form").submit();
  166. }
  167. });
  168. //主体选择
  169. layui.use(['form'], function () {
  170. let form = layui.form;
  171. form.on('select(type)', function (data) {
  172. let form_type = data.value;
  173. form.render('select')
  174. if (form_type === 'merchant') {
  175. $.get('index.php?act=refill_order&op=merchant_data', function(res) {
  176. res = JSON.parse(res)
  177. let html = '';
  178. res.forEach(item => {
  179. html += `<option value="${item.value}-${item.name}">${item.name}</option>`;
  180. })
  181. let select_type = `<select>${html}</select>`
  182. $('#selection').html(select_type);
  183. form.render('select')
  184. })
  185. } else if (form_type === 'provider'){
  186. $.get('index.php?act=refill_order&op=provider_data', function(res) {
  187. res = JSON.parse(res)
  188. let html = '';
  189. res.forEach(item => {
  190. html += `<option value="${item.value}-${item.name}">${item.name}</option>`;
  191. })
  192. let select_type = `<select>${html}</select>`
  193. $('#selection').html(select_type);
  194. form.render('select')
  195. })
  196. } else {
  197. $('#selection').html('');
  198. form.render('select')
  199. }
  200. })
  201. })
  202. $('#points_form').validate({
  203. errorPlacement: function (error, element) {
  204. error.appendTo(element.parent().parent().prev().find('td:first'));
  205. },
  206. rules: {
  207. type: {
  208. required: true
  209. },
  210. order_time_type: {
  211. required: true
  212. },
  213. body: {
  214. required: true
  215. },
  216. task_type: {
  217. required: true
  218. },
  219. query_start_time: {
  220. required: true
  221. }
  222. },
  223. messages: {
  224. type: {
  225. required: '未选择主体类型'
  226. },
  227. order_time_type: {
  228. required: '日期类型未选择'
  229. },
  230. body: {
  231. required: '未选择统计主体'
  232. },
  233. task_type: {
  234. required: '未选择任务类型'
  235. },
  236. query_start_time: {
  237. required: '未选择日期区间'
  238. }
  239. }
  240. });
  241. // 日期选择器
  242. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  243. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  244. let start_a = laydate.render({
  245. elem: '#startTime',
  246. type: 'datetime',
  247. trigger: 'click',
  248. done: function (value, date, endDate) {
  249. end.config.min = {
  250. year: date.year,
  251. month: date.month - 1,
  252. date: date.date,
  253. };
  254. end.config.value = {
  255. year: date.year,
  256. month: date.month - 1,
  257. date: date.date,
  258. };
  259. }
  260. });
  261. let end = laydate.render({
  262. elem: '#endTime',
  263. type: 'datetime',
  264. trigger: 'click',
  265. done: function (value, date, endDate) {
  266. start_a.config.max = {
  267. year: date.year,
  268. month: date.month - 1,
  269. date: date.date,
  270. };
  271. }
  272. });
  273. })
  274. </script>