refill.task.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <style>
  2. th label {
  3. display: inline-block;
  4. width: 60px;
  5. margin-left: 10px;
  6. }
  7. .page .fixed-bar .item-title h3 {
  8. margin-top: 18px !important;
  9. margin-bottom: 10px !important;
  10. font-weight: 700 !important;
  11. }
  12. .tab-base li span {
  13. font-size: 12px !important;
  14. }
  15. .query_ors {
  16. width: 125px;
  17. }
  18. th label {
  19. display: inline-block;
  20. width: 60px;
  21. }
  22. .lineLi {
  23. min-width: 150px;
  24. font-size: 12px;
  25. color: #000;
  26. }
  27. #prompt ul .noLineLi {
  28. background: none;
  29. }
  30. #prompt div {
  31. display: inline-block;
  32. background: none
  33. }
  34. #prompt ul .lineLi {
  35. color: #000;
  36. }
  37. #selest_nc {
  38. width: 220px
  39. }
  40. tbody {
  41. font-size: 12px;
  42. }
  43. .layui-form-select .layui-input {
  44. padding: 13px 5px;
  45. }
  46. .selection .layui-form-selected dl {
  47. display: flex !important;
  48. flex-wrap: wrap !important;
  49. }
  50. .selection .layui-form-select dl {
  51. top: 29px !important;
  52. min-width: 883% !important;
  53. max-height: 280px !important;
  54. padding: 14px 0 !important;
  55. left: 0 !important;
  56. }
  57. .layui-form-select {
  58. width: 45%;
  59. }
  60. .layui-select-title {
  61. width: 104%;
  62. }
  63. .selection .layui-form-select .layui-input {
  64. padding-left: 11px;
  65. }
  66. .page .fixed-bar .item-title h3 {
  67. margin-top: 18px !important;
  68. margin-bottom: 10px !important;
  69. font-weight: 700 !important;
  70. }
  71. .tab-base li span {
  72. font-size: 12px !important;
  73. }
  74. .layui-form-select .layui-input {
  75. height: 26px;
  76. }
  77. input::placeholder {
  78. color: #333;
  79. }
  80. .xm-tips {
  81. color: #333 !important;
  82. font-size: 12px;
  83. }
  84. .layui-form-select dl dd.layui-this {
  85. display: none;
  86. }
  87. .layui-form-select dl dd {
  88. cursor: pointer;
  89. width: 130px;
  90. }
  91. .tb-type1 td select {
  92. width: 201px;
  93. }
  94. .tb-type1 td input[type="text"],
  95. .tb-type1 td select {
  96. margin-right: 4px;
  97. margin-left: 0;
  98. width: 195px;
  99. }
  100. .layui-form-select .layui-edge {
  101. right: -91px !important;
  102. }
  103. .type .layui-form-select dl {
  104. top: 29px !important;
  105. width: 214% !important;
  106. }
  107. </style>
  108. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  109. <div class="page">
  110. <div class="fixed-bar">
  111. <div class="item-title">
  112. <h3>对账管理</h3>
  113. <ul class="tab-base">
  114. <li><a href="index.php?act=OrderStats&op=index&type=system"><span>上游对账记录</span></a></li>
  115. <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
  116. <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
  117. <li><a href="JavaScript:void(0);" class="current"><span>任务列表</span></a></li>
  118. <li><a href="index.php?act=OrderStats&op=task_add"><span>任务录入</span></a></li>
  119. </ul>
  120. </div>
  121. </div>
  122. <div class="fixed-empty"></div>
  123. <form method="get" action="index.php" name="formSearch" id="formSearch">
  124. <input type="hidden" name="act" value="orderstats"/>
  125. <input type="hidden" name="op" value="refill_task"/>
  126. <table class="tb-type1 noborder search">
  127. <tr>
  128. <th><label>主体类型</label></th>
  129. <td class="layui-form type">
  130. <select name="type" id="type" lay-filter="type">
  131. <option value="">请选择</option>
  132. <?php foreach ($output['type'] as $key => $value){?>
  133. <option value="<?php echo $key;?>" <?php if($_GET['type'] === $key) { echo 'selected'; }?>><?php echo $value;?></option>
  134. <?php }?>
  135. </select>
  136. </td>
  137. <th><label>主体选择</label></th>
  138. <td class="layui-form selection">
  139. <select name="cid" id="cid" lay-filter="cid" lay-search></select>
  140. </td>
  141. <td>
  142. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  143. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  144. </a>
  145. </td>
  146. </tr>
  147. </table>
  148. </form>
  149. <table class="table tb-type2 nobdb">
  150. <thead>
  151. <tr class="thead">
  152. <th class="align-center">编号</th>
  153. <th class="align-center">任务ID</th>
  154. <th class="align-center">任务类型</th>
  155. <th class="align-center">主体类型</th>
  156. <th class="align-center">主体ID</th>
  157. <th class="align-center">主体名称</th>
  158. <th class="align-center">任务条件</th>
  159. <th class="align-center">任务状态</th>
  160. <th class="align-center">生成日期</th>
  161. <th class="align-center">处理日期</th>
  162. <th class="align-center">完成日期</th>
  163. <th class="align-center">处理结果</th>
  164. </tr>
  165. </thead>
  166. <tbody id="tbody">
  167. <?php if (count($output['list']) > 0) { ?>
  168. <?php
  169. foreach ($output['list'] as $key => $value) { ?>
  170. <tr class="hover trFlex">
  171. <td class="align-center"><?php echo $key + 1; ?></td>
  172. <td class="align-center"><?php echo $value['task_id']; ?></td>
  173. <td class="align-center"><?php echo $output['task_type'][$value['task_type']]; ?></td>
  174. <td class="align-center"><?php echo $output['type'][$value['type']]; ?></td>
  175. <td class="align-center"><?php echo $value['cid']; ?></td>
  176. <td class="align-center"><?php echo $value['cname']; ?></td>
  177. <td class="align-center">
  178. <p>统计日期类型:<?php echo $output['order_time_type'][$value['condition']['order_time_type']];?></p>
  179. <p>
  180. 统计日期范围:<?php echo date("Y-m-d H:i:s", $value['condition']['start_unixtime'])?>
  181. <?php if (!empty($value['condition']['end_unixtime'])) {
  182. echo '~' . date("Y-m-d H:i:s", $value['condition']['end_unixtime']);
  183. }
  184. ?>
  185. </p>
  186. <p>订单状态:
  187. <?php if ($value['condition']['order_state'] === '') {
  188. echo '/';
  189. } else {
  190. echo orderState($value['condition']);
  191. }
  192. ?>
  193. </p>
  194. </td>
  195. <td class="align-center"><?php echo $output['task_state'][$value['task_state']]; ?></td>
  196. <td class="align-center"><?php echo $value['add_time'] ? date('Y-m-d H:i:s', $value['add_time']) : '/'; ?></td>
  197. <td class="align-center"><?php echo $value['dispose_time'] ? date('Y-m-d H:i:s', $value['dispose_time']) : '/'; ?></td>
  198. <td class="align-center"><?php echo $value['finish_time'] ? date('Y-m-d H:i:s', $value['finish_time']) : '/'; ?></td>
  199. <td class="align-center">
  200. <?php if($value['task_state'] == 3 && !empty($value['task_result'])){?>
  201. <a target="_blank" href="<?php echo UPLOAD_SITE_URL . '/' . ATTACH_TASK . DS . $value['task_result']; ?>">下载</a>
  202. <?php }?>
  203. </td>
  204. </tr>
  205. <?php } ?>
  206. <?php } else { ?>
  207. <tr class="no_data">
  208. <td colspan="11"><?php echo $lang['nc_no_record']; ?></td>
  209. </tr>
  210. <?php } ?>
  211. </tbody>
  212. <tfoot>
  213. <tr class="tfoot">
  214. <td colspan="11" id="dataFuncs">
  215. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  216. </td>
  217. </tr>
  218. </tfoot>
  219. </table>
  220. <!-- 预警提示 -->
  221. <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
  222. </div>
  223. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  224. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  225. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  226. charset="utf-8"></script>
  227. <link rel="stylesheet" type="text/css"
  228. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  229. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  230. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  231. <script type="text/javascript">
  232. $(function () {
  233. $('#ncsubmit').click(function () {
  234. $('#formSearch').submit();
  235. });
  236. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  237. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  238. // 日期选择器
  239. laydate.render({
  240. elem: '#startTime',
  241. type: 'datetime'
  242. });
  243. laydate.render({
  244. elem: '#endTime',
  245. type: 'datetime'
  246. });
  247. // 表格hover时背景
  248. $('.trFlex').each(function () {
  249. $(this).hover(function () {
  250. $(this)[0].style.backgroundColor = '#cbe9f3'
  251. }, function () {
  252. $(this)[0].style.backgroundColor = '#fff'
  253. })
  254. })
  255. // 供方名称颜色
  256. $('.textColor').each(function () {
  257. let color = $(this).attr('data-color')
  258. if (color == '1') {
  259. $(this).css('color', 'green')
  260. } else {
  261. $(this).css('color', 'red')
  262. }
  263. })
  264. let selectValue = ''
  265. let selectRes = {}
  266. let selectNew = $("#cid").next().find("input")
  267. for (let i = 0; i < selectRes.length; i++) {
  268. if (selectRes[i].value == selectValue) {
  269. console.log(selectValue, 12333);
  270. $(selectNew).val(selectRes[i].value)
  271. selectRes[i].selected = true
  272. }
  273. }
  274. //主体选择
  275. layui.use(['form'], function () {
  276. let form = layui.form;
  277. let default_type = $('select[name="type"]').val();
  278. if (default_type === 'merchant') {
  279. $.get('index.php?act=refill_order&op=merchant_data', function(res) {
  280. res = JSON.parse(res)
  281. let html = '';
  282. res.forEach(item => {
  283. html += `<option value="${item.value}">${item.name}</option>`;
  284. })
  285. let select_type = `<select>${html}</select>`
  286. $('#cid').html(select_type);
  287. form.render('select')
  288. })
  289. } else if (default_type === 'provider'){
  290. $.get('index.php?act=refill_order&op=provider_data', function(res) {
  291. res = JSON.parse(res)
  292. let html = '';
  293. res.forEach(item => {
  294. html += `<option value="${item.value}">${item.name}</option>`;
  295. })
  296. let select_type = `<select>${html}</select>`
  297. $('#cid').html(select_type);
  298. form.render('select')
  299. })
  300. } else {
  301. $('#cid').html('');
  302. form.render('select')
  303. }
  304. form.on('select(type)', function (data) {
  305. let form_type = data.value;
  306. selectValue = data.value
  307. form.render('select')
  308. if (form_type === 'merchant') {
  309. $.get('index.php?act=refill_order&op=merchant_data', function(res) {
  310. res = JSON.parse(res)
  311. let html = '';
  312. res.forEach(item => {
  313. html += `<option value="${item.value}">${item.name}</option>`;
  314. })
  315. let select_type = `<select>${html}</select>`
  316. $('#cid').html(select_type);
  317. form.render('select')
  318. })
  319. } else if (form_type === 'provider'){
  320. $.get('index.php?act=refill_order&op=provider_data', function(res) {
  321. res = JSON.parse(res)
  322. selectRes = res
  323. let html = '';
  324. res.forEach(item => {
  325. html += `<option value="${item.value}">${item.name}</option>`;
  326. })
  327. let select_type = `<select>${html}</select>`
  328. $('#cid').html(select_type);
  329. form.on('select(cid)', function (data) {
  330. let form_type = data.value;
  331. console.log('xuang',form_type);
  332. $("#cid dl").find("dd[lay-value=" +form_type+"]").attr("selected",true);
  333. form.render('select')
  334. })
  335. form.render('select')
  336. })
  337. } else {
  338. $('#cid').html('');
  339. form.render('select')
  340. }
  341. })
  342. })
  343. });
  344. </script>