| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- <extend name="$_admin_public_layout"/>
- <extend name="$_admin_public_layout"/>
- <block name="style">
- <link rel="stylesheet" href="__PUBLIC__/libs/layui/css/layui.css" media="all">
- <link rel="stylesheet" href="__PUBLIC__/libs/css/page.css" media="all">
- </block>
- <block name="script">
- <script src="__PUBLIC__/libs/guide/bootstrap-tour.js"></script>
- <script src="__PUBLIC__/libs/guide/guide.js?_t=2016121401"></script>
- </block>
- <block name="main">
- <!-- <fieldset name="meta_title" class="layui-elem-field layui-field-title" style="margin-top: 20px;">-->
- <!-- <legend>{$meta_title}</legend>-->
- <!-- </fieldset>-->
- <div style="margin-left: 30px;">
- <button class="layui-btn layui-btn-fluid layui-btn-radius large-add">增加产品</button>
- <!-- <button class="layui-btn layui-btn-radius layui-btn-warm large-edit">修改</button>-->
- <button class="layui-btn layui-btn-radius layui-btn-danger large-del">删除产品</button>
- <!-- <button class="layui-btn layui-btn-fluid layui-btn-radius large-print">打印</button>-->
- <!-- <button class="layui-btn layui-btn-fluid layui-btn-radius large-export">导出</button>-->
- <div class="bg">
- <!-- <form action="" autocomplete="off" method="GET" >-->
- <input type="text" name="keyword" value="<?php echo isset($search)?$search:'';?>" placeholder="请输入名称或者编码" class="easyui-textbox serch" style="width:250px;height:35px;">
- <select name="classification" id="classification" style="width:250px;height:35px;">
- <option value="03">============选择=============</option>
- <volist name="product_classification" id="val">
- <if condition="$classification eq $val['code']">
- <option value="{$val.code}" selected>{$val.code}-{$val.name}</option>
- <else />
- <option value="{$val.code}">{$val.code}-{$val.name}</option>
- </if>
- </volist>
- </select>
- <!-- <button type="submit" class="layui-btn layui-btn-radius layui-btn-normal submit" >立即搜索</button>-->
- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="searchBthFun()">查询</a>
- <!-- </form>-->
- </div>
- </div>
- <div class="builder-table">
- <!-- 列表 -->
- <table class="layui-table">
- <colgroup>
- <col width="150">
- <col width="200">
- <col>
- </colgroup>
- <thead>
- <tr>
- <th><input class="qut" id="checkAll" type="checkbox" /></th>
- <th>ID</th>
- <th>名称</th>
- <th>编码</th>
- <th>规格</th>
- </tr>
- </thead>
- <notempty name="page">
- <tfoot>
- <tr><td colspan="14"><div class="pages">{$page}</div></td></tr>
- </tfoot>
- </notempty>
- <tbody>
- <empty name="list">
- <tr><td colspan="14">亲,暂时还没数据</td></tr>
- <else/>
- <volist name="list" id="v">
- <tr>
- <td >
- <input type="checkbox" name="id[]" value="{$v.id}">
- </td>
- <td class="update" data-id = {$v.id}>{$v.id}</td>
- <td>{$v.product_name}</td>
- <td >{$v.product_code}</td>
- <td >{$v.product_size}</td>
- </tr>
- </volist>
- </empty>
- </tbody>
- </table>
- <notempty name="bach_page">
- <ul class="pagination">{$task_page}</ul>
- </notempty>
- <h1 style="color: red">已选中产品列表</h1>
- <!--下面是已选择生产产品表格-->
- <table class="layui-table">
- <colgroup>
- <col width="150">
- <col width="200">
- <col>
- </colgroup>
- <thead>
- <tr>
- <th></th>
- <th>ID</th>
- <th>名称</th>
- <th>编码</th>
- <th>规格</th>
- </tr>
- </thead>
- <tbody>
- <empty name="list">
- <tr><td colspan="14">亲,暂时还没数据</td></tr>
- <else/>
- <volist name="data" id="vol">
- <tr>
- <td> <input type="checkbox" name="id[]" value="{$vol.id}" checked></td>
- <td class="update" data-id = {$vol.id}>{$vol.id}</td>
- <td>{$vol.product_name}</td>
- <td>{$vol.product_code}</td>
- <td>{$vol.product_size}</td>
- </tr>
- </volist>
- </empty>
- </tbody>
- </table>
- </div>
- <script src="__PUBLIC__/libs/layui/layui.js"></script>
- <script src="__PUBLIC__/libs/jquery/2.x/jquery.js"></script>
- <script>
- <if condition="C('ismobile') eq 1">width=$('.container').width() * 0.9;<else/>width=800;</if>
- layui.use('form', function(){
- var form = layui.form;
- });
- function searchBthFun(){
- var keyword = $('.serch').val();
- var classification = $("#classification option:selected").val();
- window.location.href = 'index.php?s=/Admin/Qcode/product/keyword/'+keyword+'/classification/'+classification;
- }
- $('.large-add').click(function(){
- $this = $('input[type=checkbox]:checked');
- $len = $this .length;
- if($len==0){
- layer.msg('请选择一个选项');
- return false;
- }else{
- var Id = '';
- $.each($('input:checkbox:checked'),function(){
- Id = Id+','+$(this).val();
- });
- Id = Id.slice(1);
- $.ajax({
- url: "{:U('Qcode/updateProduct')}",
- type: 'POST',
- data: {
- id:Id,
- status:1,
- },
- timeout: 5000,//1秒
- dataType: 'json',
- success: function (data) {
- layer.msg(data.msg);
- parent.location.reload();
- },
- error:function(data){
- layer.msg(data.msg);
- // location.reload();
- }
- });
- }
- });
- $('.large-del').click(function(){
- $this = $('input[type=checkbox]:checked');
- $len = $this .length;
- if($len==0){
- $.ajax({
- url: "{:U('Qcode/updateProduct')}",
- type: 'POST',
- data: {
- id:'',
- status:2,
- },
- timeout: 5000,//1秒
- dataType: 'json',
- success: function (data) {
- layer.msg(data.msg);
- parent.location.reload();
- },
- error:function(data){
- layer.msg(data.msg);
- // location.reload();
- }
- });
- }else{
- var Id = '';
- $.each($('input:checkbox:checked'),function(){
- Id = Id+','+$(this).val();
- });
- Id = Id.slice(1);
- $.ajax({
- url: "{:U('Qcode/updateProduct')}",
- type: 'POST',
- data: {
- id:Id,
- status:2,
- },
- timeout: 5000,//1秒
- dataType: 'json',
- success: function (data) {
- layer.msg(data.msg);
- parent.location.reload();
- },
- error:function(data){
- layer.msg(data.msg);
- // location.reload();
- }
- });
- }
- })
- // //全选与反选
- // $("#checkAll").click(function () {
- // $("[name=prIds]:checkbox").prop('checked', this.checked);
- // });
- //
- // $("[name=prIds]:checkbox").click(function () {
- // var flag = true;
- // $("[name=prIds]:checkbox").each(function () {
- // if (!this.checked) {
- // flag = false;
- // }
- // });
- // $("#checkAll").prop('checked', flag);
- // });
- //
- // //批量处理
- // var $items = $("[name=prIds]:checkbox:checked");
- // if ($items.length == 0) {
- // alert("请选择");
- // return;
- // }
- </script>
- </block>
|