Kirin 3 年之前
父节点
当前提交
1165706ec6
共有 1 个文件被更改,包括 86 次插入61 次删除
  1. 86 61
      app/admin/view/company/goods/bill.php

+ 86 - 61
app/admin/view/company/goods/bill.php

@@ -2,7 +2,7 @@
 {block name="content"}
 <div class="layui-fluid" style="background: #fff;margin-top: -10px;">
 
-    <div class="layui-row layui-col-space15"  id="app">
+    <div class="layui-row layui-col-space15" id="app">
         <div class="layui-col-md12">
             <div class="layui-card">
                 <div class="layui-card-body">
@@ -36,13 +36,15 @@
                                 <label class="layui-form-label">商品条型码</label>
                                 <div class="layui-input-block">
                                     <input type="text" name="key" class="layui-input" placeholder="条型码">
-                          
+
                                 </div>
                             </div>
                             <div class="layui-inline">
                                 <div class="layui-input-inline">
-                                    <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
-                                        <i class="layui-icon layui-icon-search"></i>搜索</button>
+                                    <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search"
+                                            lay-filter="search">
+                                        <i class="layui-icon layui-icon-search"></i>搜索
+                                    </button>
                                 </div>
                             </div>
                         </div>
@@ -52,7 +54,9 @@
             </div>
         </div>
         <div class="layui-btn-group conrelTable">
-            <button class="layui-btn layui-btn-sm layui-btn-normal" type="button" data-type="set_group"><i class="fa fa-check-circle-o" ></i>批量审核</button>
+            <button class="layui-btn layui-btn-sm layui-btn-normal" type="button" data-type="set_group"><i
+                        class="fa fa-check-circle-o"></i>批量审核
+            </button>
         </div>
         <!--商品列表-->
         <div class="layui-col-md12">
@@ -67,11 +71,15 @@
                     <!--商品名称-->
                     <script type="text/html" id="store_name">
                         <h4>{{d.store_name}}</h4>
-                        <p>价格:<font color="red">{{d.price}}</font> </p>
+                        <p>价格:<font color="red">{{d.price}}</font></p>
+                    </script>
+                    <script type="text/html" id="in_stock">
+                        {{d.type}}{{d.in_stock}}
                     </script>
                     <!--操作-->
                     <script type="text/html" id="act">
-                        <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span class="caret"></span></button>
+                        <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
+                                    class="caret"></span></button>
                         <ul class="layui-nav-child layui-anim layui-anim-upbit">
                             <li>
                                 <a href="javascript:void(0);" lay-event='auth'>
@@ -91,20 +99,20 @@
     //实例化form
     layList.form.render();
     //加载列表
-    layList.tableList('List',"{:Url('bill_lst')}",function (){
-        var join=new Array();
-        join=[
-                    {type:'checkbox'},
-                    {field: 'id', title: 'ID', sort: true,event:'id',width:'6%'},
-                    {field: 'store', title: '门店',width:'10%'},
-                    {field: 'image', title: '商品图片',templet:'#image',width:'10%'},
-                    {field: 'store_name', title: '商品名称',templet:'#store_name'},
-                    {field: 'in_stock', title: '入库',width:'8%'},
-                    {field: 'add_time', title: '入库时间',width:'8%'},
-                    {field: 'status', title: '状态',templet:"#checkboxstatus",width:'8%'},
-                    {field: 'right', title: '操作',align:'center',toolbar:'#act',width:'14%'},
-                ];
-        
+    layList.tableList('List', "{:Url('bill_lst')}", function () {
+        var join = new Array();
+        join = [
+            {type: 'checkbox'},
+            {field: 'id', title: 'ID', sort: true, event: 'id', width: '6%'},
+            {field: 'store', title: '门店', width: '10%'},
+            {field: 'image', title: '商品图片', templet: '#image', width: '10%'},
+            {field: 'store_name', title: '商品名称', templet: '#store_name'},
+            {field: 'in_stock', title: '入库', width: '8%', templet: '#in_stock'},
+            {field: 'add_time', title: '入库时间', width: '8%'},
+            {field: 'status', title: '状态', templet: "#checkboxstatus", width: '8%'},
+            {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '14%'},
+        ];
+
         return join;
     })
 
@@ -113,61 +121,71 @@
     $(document).click(function (e) {
         $('.layui-nav-child').hide();
     })
-    function dropdown(that){
+
+    function dropdown(that) {
         var oEvent = arguments.callee.caller.arguments[0] || event;
         oEvent.stopPropagation();
         var offset = $(that).offset();
-        var top=offset.top-$(window).scrollTop();
+        var top = offset.top - $(window).scrollTop();
         var index = $(that).parents('tr').data('index');
         $('.layui-nav-child').each(function (key) {
             if (key != index) {
                 $(this).hide();
             }
         })
-        if($(document).height() < top+$(that).next('ul').height()){
+        if ($(document).height() < top + $(that).next('ul').height()) {
             $(that).next('ul').css({
                 'padding': 10,
-                'top': - ($(that).parent('td').height() / 2 + $(that).height() + $(that).next('ul').height()/2),
+                'top': -($(that).parent('td').height() / 2 + $(that).height() + $(that).next('ul').height() / 2),
                 'min-width': 'inherit',
                 'position': 'absolute'
             }).toggle();
-        }else{
+        } else {
             $(that).next('ul').css({
                 'padding': 10,
-                'top':$(that).parent('td').height() / 2 + $(that).height(),
+                'top': $(that).parent('td').height() / 2 + $(that).height(),
                 'min-width': 'inherit',
                 'position': 'absolute'
             }).toggle();
         }
     }
+
     //快速编辑
     layList.edit(function (obj) {
-        var id=obj.data.id,value=obj.value;
+        var id = obj.data.id, value = obj.value;
         switch (obj.field) {
             case 'price':
-                action.set_product('price',id,value);
+                action.set_product('price', id, value);
                 break;
             case 'stock':
-                action.set_product('stock',id,value);
+                action.set_product('stock', id, value);
                 break;
             case 'sort':
-                action.set_product('sort',id,value);
+                action.set_product('sort', id, value);
                 break;
             case 'ficti':
-                action.set_product('ficti',id,value);
+                action.set_product('ficti', id, value);
                 break;
         }
     });
     //上下加商品
-    layList.switch('is_show',function (odj,value) {
-        if(odj.elem.checked==true){
-            layList.baseGet(layList.Url({c:'store.store_product',a:'set_show',p:{is_show:1,id:value}}),function (res) {
+    layList.switch('is_show', function (odj, value) {
+        if (odj.elem.checked == true) {
+            layList.baseGet(layList.Url({
+                c: 'store.store_product',
+                a: 'set_show',
+                p: {is_show: 1, id: value}
+            }), function (res) {
                 layList.msg(res.msg, function () {
                     layList.reload();
                 });
             });
-        }else{
-            layList.baseGet(layList.Url({c:'store.store_product',a:'set_show',p:{is_show:0,id:value}}),function (res) {
+        } else {
+            layList.baseGet(layList.Url({
+                c: 'store.store_product',
+                a: 'set_show',
+                p: {is_show: 0, id: value}
+            }), function (res) {
                 layList.msg(res.msg, function () {
                     layList.reload();
                 });
@@ -175,11 +193,11 @@
         }
     });
     //点击事件绑定
-    layList.tool(function (event,data,obj) {
+    layList.tool(function (event, data, obj) {
         switch (event) {
 
             case 'auth':
-                $eb.createModalFrame('编辑',layList.Url({a:'audit',p:{id:data.id}}));
+                $eb.createModalFrame('编辑', layList.Url({a: 'audit', p: {id: data.id}}));
                 break;
 
         }
@@ -187,57 +205,64 @@
     //排序
     layList.sort(function (obj) {
         var type = obj.type;
-        switch (obj.field){
+        switch (obj.field) {
             case 'id':
-                layList.reload({order: layList.order(type,'id')},true,null,obj);
+                layList.reload({order: layList.order(type, 'id')}, true, null, obj);
                 break;
             case 'sales':
-                layList.reload({order: layList.order(type,'sales')},true,null,obj);
+                layList.reload({order: layList.order(type, 'sales')}, true, null, obj);
                 break;
         }
     });
     //查询
-    layList.search('search',function(where){
-        layList.reload(where,true);
+    layList.search('search', function (where) {
+        layList.reload(where, true);
     });
     //自定义方法
-    var action={
-        set_product:function(field,id,value){
-            layList.baseGet(layList.Url({c:'store.store_product',a:'set_product',q:{field:field,id:id,value:value}}),function (res) {
+    var action = {
+        set_product: function (field, id, value) {
+            layList.baseGet(layList.Url({
+                c: 'store.store_product',
+                a: 'set_product',
+                q: {field: field, id: id, value: value}
+            }), function (res) {
                 layList.msg(res.msg);
             });
         },
-        show:function(){
-            var ids=layList.getCheckData().getIds('id');
-            if(ids.length){
-                layList.basePost(layList.Url({c:'store.store_product',a:'product_show'}),{ids:ids},function (res) {
+        show: function () {
+            var ids = layList.getCheckData().getIds('id');
+            if (ids.length) {
+                layList.basePost(layList.Url({
+                    c: 'store.store_product',
+                    a: 'product_show'
+                }), {ids: ids}, function (res) {
                     layList.msg(res.msg);
                     layList.reload();
                 });
-            }else{
+            } else {
                 layList.msg('请选择要上架的商品');
             }
         },
-        "set_group":function () {
-            var ids=layList.getCheckData().getIds('id');
-            if(ids.length){
+        "set_group": function () {
+            var ids = layList.getCheckData().getIds('id');
+            if (ids.length) {
                 var str = ids.join(',');
-                $eb.createModalFrame('批量设置分组',layList.Url({a:'batch_audit',p:{id:str}}),{w:500,h:300});
-            }else{
+                $eb.createModalFrame('批量设置分组', layList.Url({a: 'batch_audit', p: {id: str}}), {w: 500, h: 300});
+            } else {
                 layList.msg('请选择要批量设置分组的会员');
             }
         }
     };
     //多选事件绑定
     $('.layui-btn-container').find('button').each(function () {
-        var type=$(this).data('type');
-        $(this).on('click',function(){
+        var type = $(this).data('type');
+        $(this).on('click', function () {
             action[type] && action[type]();
         })
     });
     $('.conrelTable').find('button').each(function () {
-        var type=$(this).data('type');
-        $(this).on('click',function () {
+        var type = $(this).data('type');
+        $(this).on('click', function () {
             action[type] && action[type]();
         })
     })