refill.task.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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. </ul>
  119. </div>
  120. </div>
  121. <!-- <div class="fixed-empty"></div>-->
  122. <!-- <form method="get" action="index.php" name="formSearch" id="formSearch">-->
  123. <!-- <input type="hidden" name="act" value="orderstats"/>-->
  124. <!-- <input type="hidden" name="op" value="refill_task"/>-->
  125. <!-- <input type="hidden" name="cid_type" value=""/>-->
  126. <!-- <input type="hidden" name="default_cid_type" value="--><?php //echo $_GET['cid_type']; ?><!--"/>-->
  127. <!-- <table class="tb-type1 noborder search">-->
  128. <!-- <tr>-->
  129. <!-- <th><label>主体类型</label></th>-->
  130. <!-- <td class="layui-form type">-->
  131. <!-- <select name="type" id="type" lay-filter="type">-->
  132. <!-- <option value="">请选择</option>-->
  133. <!-- --><?php //foreach ($output['type'] as $key => $value){?>
  134. <!-- <option value="--><?php //echo $key;?><!--" --><?php //if($_GET['type'] === $key) { echo 'selected'; }?><!-->--><?php //echo $value;?><!--</option>-->
  135. <!-- --><?php //}?>
  136. <!-- </select>-->
  137. <!-- </td>-->
  138. <!-- <th><label>主体选择</label></th>-->
  139. <!-- <td class="layui-form selection">-->
  140. <!-- <select name="cid" id="cid" lay-filter="cid" lay-search></select>-->
  141. <!-- </td>-->
  142. <!-- <td>-->
  143. <!-- <a href="javascript:void(0);" id="ncsubmit" class="btn-search "-->
  144. <!-- title="--><?php //echo $lang['nc_query']; ?><!--">&nbsp;-->
  145. <!-- </a>-->
  146. <!-- </td>-->
  147. <!-- </tr>-->
  148. <!-- </table>-->
  149. <!-- </form>-->
  150. <table class="table tb-type2 nobdb">
  151. <thead>
  152. <tr class="thead">
  153. <th class="align-center">编号</th>
  154. <th class="align-center">任务ID</th>
  155. <th class="align-center">任务类型</th>
  156. <!-- <th class="align-center">任务条件</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. </tr>
  164. </thead>
  165. <tbody id="tbody">
  166. <?php if (count($output['list']) > 0) { ?>
  167. <?php
  168. foreach ($output['list'] as $key => $value) { ?>
  169. <tr class="hover trFlex">
  170. <td class="align-center"><?php echo $key + 1; ?></td>
  171. <td class="align-center"><?php echo $value['task_id']; ?></td>
  172. <td class="align-center"><?php echo $output['task_type'][$value['type']]; ?></td>
  173. <!-- <td class="align-center">-->
  174. <!-- --><?php //if(!empty($value['condition']['refill_order.order_time'])) { ?>
  175. <!-- <p>统计日期范围:-->
  176. <!-- --><?php //echo date("Y-m-d H:i:s", $value['condition']['refill_order.order_time'][0][1]) ?? '/';?>
  177. <!-- ~--><?php //echo date("Y-m-d H:i:s", $value['condition']['refill_order.order_time'][1][1]) ?? '/';?>
  178. <!-- --><?php //}?>
  179. <!---->
  180. <!-- <p>订单状态:-->
  181. <!-- --><?php //if ($value['condition']['order_state'] === '') {
  182. // echo '/';
  183. // } else {
  184. // echo orderState($value['condition']);
  185. // }
  186. // ?>
  187. <!-- </p>-->
  188. <!-- </td>-->
  189. <td class="align-center"><?php echo $output['task_state'][$value['state']]; ?></td>
  190. <td class="align-center"><?php echo $value['add_time'] ? date('Y-m-d H:i:s', $value['add_time']) : '/'; ?></td>
  191. <td class="align-center"><?php echo $value['act_time'] ? date('Y-m-d H:i:s', $value['act_time']) : '/'; ?></td>
  192. <td class="align-center"><?php echo $value['finish_time'] ? date('Y-m-d H:i:s', $value['finish_time']) : '/'; ?></td>
  193. <td class="align-center">
  194. <?php if($value['state'] == 3 && !empty($value['result'])){?>
  195. <?php if($value['result_state'] == 1){ ?>
  196. <a target="_blank" href="<?php echo UPLOAD_SITE_URL . '/' . ATTACH_TASK . DS . $value['result']; ?>">下载</a>
  197. <?php }else{
  198. echo $value['result'];
  199. }?>
  200. <?php }?>
  201. </td>
  202. <td class="align-center">
  203. <a href="index.php?act=OrderStats&op=task_del&task_id=<?php echo $value['task_id'] ?>">删除</a>
  204. </td>
  205. </tr>
  206. <?php } ?>
  207. <?php } else { ?>
  208. <tr class="no_data">
  209. <td colspan="13"><?php echo $lang['nc_no_record']; ?></td>
  210. </tr>
  211. <?php } ?>
  212. </tbody>
  213. <tfoot>
  214. <tr class="tfoot">
  215. <td colspan="13" id="dataFuncs">
  216. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  217. </td>
  218. </tr>
  219. </tfoot>
  220. </table>
  221. <!-- 预警提示 -->
  222. <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
  223. </div>
  224. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  225. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  226. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  227. charset="utf-8"></script>
  228. <link rel="stylesheet" type="text/css"
  229. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  230. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  231. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  232. <script type="text/javascript">
  233. let selectValue = ''
  234. let Interface
  235. let default_type = '<?php echo $_GET['type'];?>';
  236. // console.log(default_type, 'type');
  237. let default_cid_m = '<?php echo $_GET['cid'];?>';
  238. // console.log(default_cid_m);
  239. $(function () {
  240. $('#ncsubmit').click(function () {
  241. $('input[name="cid_type"]').val(selectValue);
  242. $('#formSearch').submit();
  243. });
  244. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  245. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  246. // 日期选择器
  247. laydate.render({
  248. elem: '#startTime',
  249. type: 'datetime'
  250. });
  251. laydate.render({
  252. elem: '#endTime',
  253. type: 'datetime'
  254. });
  255. // 表格hover时背景
  256. $('.trFlex').each(function () {
  257. $(this).hover(function () {
  258. $(this)[0].style.backgroundColor = '#cbe9f3'
  259. }, function () {
  260. $(this)[0].style.backgroundColor = '#fff'
  261. })
  262. })
  263. // 供方名称颜色
  264. $('.textColor').each(function () {
  265. let color = $(this).attr('data-color')
  266. if (color == '1') {
  267. $(this).css('color', 'green')
  268. } else {
  269. $(this).css('color', 'red')
  270. }
  271. })
  272. //主体选择
  273. layui.use(['form'], function () {
  274. let form = layui.form;
  275. let default_type = $('select[name="type"]').val();
  276. if (default_type === 'merchant') {
  277. $.get('index.php?act=refill_order&op=merchant_data', function(res) {
  278. res = JSON.parse(res)
  279. let html = '';
  280. res.forEach(item => {
  281. html += `<option value="${item.value}">${item.name}</option>`;
  282. })
  283. let select_type = `<select>${html}</select>`
  284. $('#cid').html(select_type);
  285. form.render('select')
  286. })
  287. } else if (default_type === 'provider'){
  288. $.get('index.php?act=refill_order&op=provider_data', function(res) {
  289. selectRes = JSON.parse(res)
  290. let html = '';
  291. selectRes.forEach(item => {
  292. html += `<option value="${item.value}">${item.name}</option>`;
  293. })
  294. let select_type = `<select>${html}</select>`
  295. $('#cid').html(select_type);
  296. let default_cid_type = $('input[name="default_cid_type"]').val()
  297. console.log(default_cid_type, '隐藏');
  298. if (default_cid_type) {
  299. for (let i = 0; i < selectRes.length; i++) {
  300. // let html = '';
  301. if(selectRes[i].value == default_cid_type) {
  302. console.log(selectRes[i].value, '接口的valie');
  303. selectRes[i].selected = true
  304. // html = `<option value="${selectRes[i].value }">${selectRes[i].name }</option>`;
  305. // let select_type = `<select>${html}</select>`
  306. // electRes[i].selected = true
  307. // var select = 'dd[lay-value=' + selectRes[i].value + ']';// 设置value
  308. // $("#cid").find("option[value="+selectRes[i].value+"]").prop("selected",true);
  309. // let as = $('#cid').siblings("div.layui-form-select").find('dl').find(select).click()
  310. form.render('select')
  311. }
  312. }
  313. }
  314. form.render('select')
  315. })
  316. form.on('select(cid)', function (data) {
  317. let form_type = data.value;
  318. selectValue = data.value
  319. form.render('select')
  320. })
  321. } else {
  322. $('#cid').html('');
  323. form.render('select')
  324. }
  325. form.on('select(type)', function (data) {
  326. let form_type = data.value;
  327. form.render('select')
  328. if (form_type === 'merchant') {
  329. $.get('index.php?act=refill_order&op=merchant_data', function(res) {
  330. res = JSON.parse(res)
  331. let html = '';
  332. res.forEach(item => {
  333. html += `<option value="${item.value}">${item.name}</option>`;
  334. })
  335. let select_type = `<select>${html}</select>`
  336. $('#cid').html(select_type);
  337. form.render('select')
  338. })
  339. } else if (form_type === 'provider'){
  340. $.get('index.php?act=refill_order&op=provider_data', function(res) {
  341. res = JSON.parse(res)
  342. let html = '';
  343. res.forEach(item => {
  344. html += `<option value="${item.value}">${item.name}</option>`;
  345. })
  346. let select_type = `<select>${html}</select>`
  347. $('#cid').html(select_type);
  348. form.render('select')
  349. })
  350. form.on('select(cid)', function (data) {
  351. let form_type = data.value;
  352. selectValue = data.value
  353. form.render('select')
  354. })
  355. } else {
  356. $('#cid').html('');
  357. form.render('select')
  358. }
  359. })
  360. })
  361. });
  362. </script>