index.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. {/block}
  4. {block name="content"}
  5. <style>
  6. .btn-outline{
  7. border:none;
  8. }
  9. .btn-outline:hover{
  10. background-color: #0e9aef;
  11. color: #fff;
  12. }
  13. .layui-form-item .layui-btn {
  14. margin-top: 5px;
  15. margin-right: 10px;
  16. }
  17. .layui-btn-primary{
  18. margin-right: 10px;
  19. margin-left: 0!important;
  20. }
  21. label{
  22. margin-bottom: 0!important;
  23. margin-top: 4px;
  24. }
  25. </style>
  26. <div class="layui-fluid">
  27. <div class="layui-row layui-col-space15" id="app">
  28. <!--搜索条件-->
  29. <div class="layui-col-md12">
  30. <div class="layui-card">
  31. <div class="layui-card-header">搜索条件</div>
  32. <div class="layui-card-body">
  33. <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside" lay-arrow="none" style="background:none">
  34. <form class="layui-form layui-form-pane" action="">
  35. <div class="layui-form-item">
  36. <div class="layui-col-lg12">
  37. <label class="layui-form-label" style="top: -5.5px;">搜索条件</label>
  38. <div class="layui-input-inline">
  39. <input type="text" id="name" name="name" class="layui-input" placeholder="请输入用户昵称,uid">
  40. </div>
  41. <div class="layui-input-inline">
  42. <input type="text" id="rece" name="rece" class="layui-input" placeholder="请输入接单员昵称,uid">
  43. </div>
  44. <div class="layui-input-inline">
  45. <input type="text" id="order_id" name="order_id" class="layui-input" placeholder="订单号">
  46. </div>
  47. <div class="layui-inline">
  48. <label class="layui-form-label" style="top: -4.5px">类型</label>
  49. <div class="layui-input-block">
  50. <select name="type" id="type">
  51. <option value="">全部</option>
  52. <option value="1">陪诊</option>
  53. <option value="2">代办</option>
  54. </select>
  55. </div>
  56. </div>
  57. <!-- <div class="layui-inline">-->
  58. <!-- <label class="layui-form-label" style="top: -4.5px">支付方式</label>-->
  59. <!-- <div class="layui-input-block">-->
  60. <!-- <select name="pay_type">-->
  61. <!-- <option value="">全部</option>-->
  62. <!-- <option value="1">余额</option>-->
  63. <!-- <option value="2">微信</option>-->
  64. <!-- <option value="3">支付宝</option>-->
  65. <!-- </select>-->
  66. <!-- </div>-->
  67. <!-- </div>-->
  68. </div>
  69. <div class="layui-col-lg12" id="app1">
  70. <div class="layui-col-lg12">
  71. <label class="layui-form-label">创建时间:</label>
  72. <div class="layui-input-block" data-type="data" v-cloak="">
  73. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList"
  74. @click="setData(item)"
  75. :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}
  76. </button>
  77. <button class="layui-btn layui-btn-sm" type="button" ref="time"
  78. @click="setData({value:'zd',is_zd:true})"
  79. :class="{'layui-btn-primary':where.data!='zd'}">自定义
  80. </button>
  81. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary"
  82. v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}
  83. </button>
  84. </div>
  85. </div>
  86. <div class="layui-inline">
  87. <button @click="excel" type="button"
  88. class="layui-btn layui-btn-warm layui-btn-sm export" type="button">
  89. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出
  90. </button>
  91. </div>
  92. </div>
  93. <div class="layui-inline">
  94. <div class="layui-input-inline">
  95. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  96. <i class="layui-icon layui-icon-search"></i>搜索</button>
  97. </div>
  98. </div>
  99. </div>
  100. </form>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <!-- 中间详细信息-->
  106. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  107. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  108. </div>
  109. <!--enb-->
  110. </div>
  111. <!--列表-->
  112. <div class="layui-row layui-col-space15">
  113. <div class="layui-col-md12">
  114. <div class="layui-card">
  115. <div class="layui-card-header">陪诊代办</div>
  116. <div class="layui-card-body">
  117. <div class="layui-btn-container" id="container-action">
  118. <a class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}',{h:500,w:650})">添加</a>
  119. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  120. </div>
  121. <table class="layui-hide" id="List" lay-filter="List"></table>
  122. <script type="text/html" id="nickname">
  123. {{d.nickname}}/{{d.uid}}
  124. </script>
  125. <script type="text/html" id="re">
  126. {{d.nickname}}/{{d.uid}}
  127. </script>
  128. <script type="text/html" id="act">
  129. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
  130. class="caret"></span></button>
  131. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  132. <li>
  133. <a href="javascript:void(0);" lay-event='wc'>
  134. <i class="fa fa-file-text"></i> 完成
  135. </a>
  136. </li>
  137. <li>
  138. <a href="javascript:void(0);" lay-event='delete'>
  139. <i class="fa fa-edit"></i> 删除
  140. </a>
  141. </li>
  142. {{# if(d.status == '待退款' && d.refund_status == 0){ }}
  143. <li>
  144. <a href="javascript:void(0);" onclick="$eb.createModalFrame('编辑','{:Url('refund')}?id={{d.id}}',{h:950,w:800})">
  145. <i class="fa fa-edit"></i> 退款
  146. </a>
  147. </li>
  148. {{# } ;}}
  149. </ul>
  150. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('编辑','{:Url('info')}?id={{d.id}}',{h:950,w:800})">
  151. 详情
  152. </button>
  153. </script>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <!--end-->
  159. </div>
  160. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  161. {/block}
  162. {block name="script"}
  163. <script>
  164. layList.form.render();
  165. layList.tableList('List', "{:Url('list')}", function () {
  166. return [
  167. {type: 'checkbox'},
  168. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  169. {field: 'nickname', title: '用户', templet: '#nickname', align: 'center'},
  170. {field: 'order_id', title: '订单号', align: 'center'},
  171. {field: 'cate', title: '服务', align: 'center'},
  172. {field: 'type', title: '类型', align: 'center'},
  173. {field: 'ot_price', title: '订单金额', align: 'center'},
  174. {field: 'pay_price', title: '实际支付', align: 'center'},
  175. {field: 'commission', title: '佣金', align: 'center'},
  176. {field: 'paid', title: '支付状态', align: 'center'},
  177. {field: 'pay_type', title: '支付方式', align: 'center'},
  178. {field: 're_nickname', title: '接单员', templet: '#re', align: 'center'},
  179. {field: 'status', title: '状态', align: 'center'},
  180. {field: 'create_time', title: '时间', align: 'center', width: '8%'},
  181. {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
  182. ];
  183. });
  184. //查询
  185. layList.search('search',function(where){
  186. layList.reload(where,true);
  187. });
  188. layList.switch('is_show',function (odj,value) {
  189. if(odj.elem.checked==true){
  190. layList.baseGet(layList.Url({a:'set_show',p:{is_show:1,id:value}}),function (res) {
  191. layList.msg(res.msg);
  192. });
  193. }else{
  194. layList.baseGet(layList.Url({a:'set_show',p:{is_show:0,id:value}}),function (res) {
  195. layList.msg(res.msg);
  196. });
  197. }
  198. });
  199. //点击事件绑定
  200. layList.tool(function (event,data,obj) {
  201. switch (event) {
  202. case 'delete':
  203. var url=layList.U({c:'diagnosis.diagnosis_order',a:'delete',q:{id:data.id}});
  204. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  205. $eb.$swal('delete',function(){
  206. $eb.axios.get(url).then(function(res){
  207. if(res.status == 200 && res.data.code == 200) {
  208. $eb.$swal('success',res.data.msg);
  209. obj.del();
  210. location.reload();
  211. }else
  212. return Promise.reject(res.data.msg || '删除失败')
  213. }).catch(function(err){
  214. $eb.$swal('error',err);
  215. });
  216. },code)
  217. break;
  218. case 'wc':
  219. var url=layList.U({c:'diagnosis.diagnosis_order',a:'wc',q:{id:data.id}});
  220. var code = {title:"操作提示",text:"确定完成吗?",type:'info',confirm:'是的'};
  221. $eb.$swal('delete',function(){
  222. $eb.axios.get(url).then(function(res){
  223. if(res.status == 200 && res.data.code == 200) {
  224. $eb.$swal('success',res.data.msg);
  225. location.reload();
  226. }else
  227. return Promise.reject(res.data.msg || '失败')
  228. }).catch(function(err){
  229. $eb.$swal('error',err);
  230. });
  231. },code)
  232. break;
  233. case 'open_image':
  234. $eb.openImage(data.image);
  235. break;
  236. case 'edit':
  237. location.href = layList.U({a:'edit',q:{id:data.id}});
  238. break;
  239. }
  240. })
  241. function dropdown(that) {
  242. var oEvent = arguments.callee.caller.arguments[0] || event;
  243. oEvent.stopPropagation();
  244. var offset = $(that).offset();
  245. var top = offset.top - $(window).scrollTop();
  246. var index = $(that).parents('tr').data('index');
  247. $('.layui-nav-child').each(function (key) {
  248. if (key != index) {
  249. $(this).hide();
  250. }
  251. })
  252. if ($(document).height() < top + $(that).next('ul').height()) {
  253. $(that).next('ul').css({
  254. 'padding': 10,
  255. 'top': -($(that).parents('td').height() / 2 + $(that).height() + $(that).next('ul').height() / 2),
  256. 'min-width': 'inherit',
  257. 'position': 'absolute'
  258. }).toggle();
  259. } else {
  260. $(that).next('ul').css({
  261. 'padding': 10,
  262. 'top': $(that).parents('td').height() / 2 + $(that).height(),
  263. 'min-width': 'inherit',
  264. 'position': 'absolute'
  265. }).toggle();
  266. }
  267. }
  268. //改状态
  269. layList.switch('status',function (odj,value) {
  270. if(odj.elem.checked==true){
  271. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
  272. layList.msg(res.msg, function () {
  273. layList.reload();
  274. });
  275. });
  276. }else{
  277. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
  278. layList.msg(res.msg, function () {
  279. layList.reload();
  280. });
  281. });
  282. }
  283. });
  284. require(['vue'], function (Vue) {
  285. new Vue({
  286. el: "#app1",
  287. data: {
  288. badge: [],
  289. dataList: [
  290. {name: '全部', value: ''},
  291. {name: '今天', value: 'today'},
  292. {name: '昨天', value: 'yesterday'},
  293. {name: '最近7天', value: 'lately7'},
  294. {name: '最近30天', value: 'lately30'},
  295. {name: '本月', value: 'month'},
  296. {name: '本年', value: 'year'},
  297. ],
  298. where: {
  299. data: '',
  300. status: status,
  301. type: '',
  302. pay_type: '',
  303. excel: 0,
  304. },
  305. showtime: false,
  306. },
  307. watch: {
  308. 'where.status': function () {
  309. this.where.excel = 0;
  310. this.getBadge();
  311. layList.reload(this.where, true);
  312. },
  313. 'where.data': function () {
  314. this.where.excel = 0;
  315. this.getBadge();
  316. layList.reload(this.where, true);
  317. },
  318. 'where.type': function () {
  319. this.where.excel = 0;
  320. this.getBadge();
  321. layList.reload(this.where, true);
  322. },
  323. 'where.pay_type': function () {
  324. this.where.excel = 0;
  325. this.getBadge();
  326. layList.reload(this.where, true);
  327. }
  328. },
  329. methods: {
  330. setData: function (item) {
  331. var that = this;
  332. if (item.is_zd == true) {
  333. that.showtime = true;
  334. this.where.data = this.$refs.date_time.innerText;
  335. } else {
  336. this.showtime = false;
  337. this.where.data = item.value;
  338. }
  339. },
  340. getBadge: function () {
  341. var that = this;
  342. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  343. that.badge = rem.data;
  344. });
  345. },
  346. search: function () {
  347. this.where.excel = 0;
  348. this.getBadge();
  349. layList.reload(this.where, true);
  350. },
  351. refresh: function () {
  352. layList.reload();
  353. this.getBadge();
  354. },
  355. excel: function () {
  356. var name = $('#name').val();
  357. var order_id = $('#order_id').val();
  358. var rece = $('#rece').val();
  359. var type = $('#type').val();
  360. this.where['name'] = name;
  361. this.where['order_id'] = order_id;
  362. this.where['rece'] = rece;
  363. this.where['type'] = type;
  364. this.where.excel = 1;
  365. location.href = layList.Url({c: 'diagnosis.diagnosis_order', a: 'list', q: this.where});
  366. this.where.excel = 0;
  367. }
  368. },
  369. mounted: function () {
  370. var that = this;
  371. that.getBadge();
  372. window.formReload = this.search;
  373. layList.laydate.render({
  374. elem: this.$refs.date_time,
  375. trigger: 'click',
  376. eventElem: this.$refs.time,
  377. range: true,
  378. change: function (value) {
  379. that.where.data = value;
  380. }
  381. });
  382. }
  383. })
  384. });
  385. </script>
  386. {/block}