123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <!--<div class="ibox-title">-->
- <!--<h5>{$meta_title}</h5>-->
- <!--<div class="ibox-tools">-->
- <!--<a class="toback" href="{:url('show')}">-->
- <!--返回上一页-->
- <!--</a>-->
- <!--</div>-->
- <!--</div>-->
- <div class="ibox-content">
- <form method="post" action="{:url('add')}" class="form-horizontal">
- <input type="hidden" name="type" value="1">
- <div class="form-group">
- <label class="col-sm-2 control-label">入库人<span class="text-danger">*</span></label>
- <div class="col-sm-8">
- <input type="text" class="form-control" name="name" value="{$info.title|default=''}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">联系电话<span class="text-danger">*</span></label>
- <div class="col-sm-8">
- <input type="text" class="form-control" name="phone" value="{$info.unit|default=''}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">备注</label>
- <div class="col-sm-8">
- <textarea name="remark" class="form-control" id="remark" cols="30" rows="5">{$info.remark|default=''}</textarea>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">选择物品<span class="text-danger">*</span></label>
- <div class="col-sm-8">
- <a url="{:url('CompanyGoods/selectGoods')}" href="javascript:;" data-title="选择物品" onclick="layer_open(this,0)" class="btn btn-primary">选择物品</a>
- <table class="table table-striped table-bordered">
- <thead>
- <tr>
- <th style="width: 120px">单价</th>
- <th style="width: 120px">数量</th>
- <th>名称</th>
- <th>品牌</th>
- <th>规格</th>
- <th>类型</th>
- <th>购买时间</th>
- </tr>
- </thead>
- <tbody class="layer-photos" id="layer-photos">
- </tbody>
- </table>
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <div class="col-sm-6 col-sm-offset-2">
- <button class="btn btn-primary ajax-post" data-layer_c="1" target-form="form-horizontal" type="submit">确 定</button>
- <button class="btn cancel-btn btn-default" type="button">取 消</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
- <script>
- laydate.render({
- elem: '#buy_time',
- trigger: 'click' ,
- theme:'#148d8f'
- });
- $(document).ready(function(){
- formSetValue("enable", {$info.enable|default=1});
- localStorage.removeItem("mateapply");
- localStorage.removeItem("mateapplyids");
- });
- var lists = [];
- function formatList() {
- var str = '';
- let ids = [];
- for (let o in lists){
- ids.push(lists[o].id);
- str += '<tr>';
- str += '<td><input type="number" class="form-control input-sm" name="goods['+lists[o].id+'][price]"></td>';
- str += '<td><input type="number" class="form-control input-sm" name="goods['+lists[o].id+'][nums]"></td>';
- str += '<td>'+lists[o].title+'</td>';
- str += '<td>'+lists[o].brand+'</td>';
- str += '<td>'+lists[o].spec+'</td>';
- str += '<td>'+lists[o].type+'</td>';
- str += '<td>'+lists[o].buy_time+'</td>';
- str += '</tr>';
- }
- $('#layer-photos').html(str);
- if(ids.length > 0){
- localStorage.setItem("mateapply", JSON.stringify(lists));
- localStorage.setItem("mateapplyids", JSON.stringify(ids));
- }else{
- localStorage.removeItem("mateapply");
- localStorage.removeItem("mateapplyids");
- }
- console.log(keyword);
- }
- function lastSave() {
- var name = $("input[name=name]").val();
- var phone = $("input[name=phone]").val();
- var remark = $("#remark").val();
- if(!name){
- var n = '入库人';
- layer.msg('请填写'+n);
- return;
- }
- if(!phone){
- layer.msg('请输入联系电话');
- return;
- }
- items = document.getElementsByClassName("ids");
- data = [];
- for(x in items){
- if(items[x].checked)
- data.push(items[x].value);
- }
- if(data.length <=0){
- layer.msg('请选择商品');
- return;
- }
- var url = 'lastSave?name='+name+'&phone='+phone+'&ids='+data.join(',')+'&remark='+remark;
- layer.open({
- type: 2,
- shade: 0.8,
- title: '{$meta_title}',
- area: ['800px', '90%'],
- fix: false, //不固定
- maxmin: true,
- content: url,
- skin: 'layer-ext-moon',
- end : function() {
- window.location.href="{:url('show')}";
- }
- });
- }
- </script>
- {/block}
|