column.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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="请输入名称">
  40. </div>
  41. </div>
  42. <div class="layui-inline">
  43. <div class="layui-input-inline">
  44. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  45. <i class="layui-icon layui-icon-search"></i>搜索</button>
  46. </div>
  47. </div>
  48. </div>
  49. </form>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- 中间详细信息-->
  55. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  56. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  57. </div>
  58. <!--enb-->
  59. </div>
  60. <!--列表-->
  61. <div class="layui-row layui-col-space15">
  62. <div class="layui-col-md12">
  63. <div class="layui-card">
  64. <div class="layui-card-header">材料列表</div>
  65. <div class="layui-card-body">
  66. <div class="layui-btn-container" id="container-action">
  67. <a class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('creates')}?role={$role}',{h:900,w:700})">添加材料</a>
  68. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  69. </div>
  70. <table class="layui-hide" id="List" lay-filter="List"></table>
  71. <script type="text/html" id="image">
  72. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
  73. </script>
  74. <script type="text/html" id="type">
  75. {{# if(d.type == 1){ }}
  76. 顶板
  77. {{# } else if(d.type == 2) { }}
  78. 侧板
  79. {{# } else if(d.type == 3) { }}
  80. 拉筋
  81. {{# } else if(d.type == 4) { }}
  82. 底板
  83. {{# } else if(d.type == 5) { }}
  84. 立柱
  85. {{# } else if(d.type == 6) { }}
  86. 辅拉
  87. {{# } }}
  88. </script>
  89. <script type="text/html" id="is_gc">
  90. {{# if(d.is_gc == 0){ }}
  91. 正常
  92. {{# } else if(d.is_gc == 1) { }}
  93. 大公差
  94. {{# } }}
  95. </script>
  96. <script type="text/html" id="act">
  97. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('编辑','{:Url('edits')}?id={{d.id}}',{h:900,w:700})">
  98. 编辑
  99. </button>
  100. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  101. 删除
  102. </button>
  103. </script>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <!--end-->
  109. </div>
  110. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  111. {/block}
  112. {block name="script"}
  113. <script>
  114. var role = '{$role}';
  115. layList.tableList('List', "{:Url('list')}?role="+role, function () {
  116. return [
  117. {type: 'checkbox'},
  118. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  119. {field: 'name', title: '名称', templet: '#name', align: 'center'},
  120. {field: 'number', title: '编号', align: 'center'},
  121. {field: 'type', title: '材料分类', align: 'center',templet: '#type'},
  122. {field: 'cate_name', title: '分类', align: 'center',templet: '#cate_name'},
  123. {field: 'th_name', title: '厚度', align: 'center'},
  124. {field: 'weight', title: '重量', align: 'center'},
  125. {field: 'unit_price', title: '单价', align: 'center'},
  126. {field: 'company', title: '单位', align: 'center'},
  127. // {field: 'is_gc', title: '公差',templet: '#is_gc', align: 'center'},
  128. {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
  129. ];
  130. });
  131. //查询
  132. layList.search('search',function(where){
  133. layList.reload(where,true);
  134. });
  135. //点击事件绑定
  136. layList.tool(function (event,data,obj) {
  137. switch (event) {
  138. case 'delete':
  139. var url=layList.U({c:'water.WaterMaterialScience',a:'delete',q:{id:data.id}});
  140. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  141. $eb.$swal('delete',function(){
  142. $eb.axios.get(url).then(function(res){
  143. if(res.status == 200 && res.data.code == 200) {
  144. $eb.$swal('success',res.data.msg);
  145. obj.del();
  146. location.reload();
  147. }else
  148. return Promise.reject(res.data.msg || '删除失败')
  149. }).catch(function(err){
  150. $eb.$swal('error',err);
  151. });
  152. },code)
  153. break;
  154. case 'open_image':
  155. $eb.openImage(data.image);
  156. break;
  157. case 'edit':
  158. location.href = layList.U({a:'edit',q:{id:data.id}});
  159. break;
  160. }
  161. })
  162. //改状态
  163. layList.switch('status',function (odj,value) {
  164. if(odj.elem.checked==true){
  165. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
  166. layList.msg(res.msg, function () {
  167. layList.reload();
  168. });
  169. });
  170. }else{
  171. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
  172. layList.msg(res.msg, function () {
  173. layList.reload();
  174. });
  175. });
  176. }
  177. });
  178. </script>
  179. {/block}