refill.task.php 15 KB

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