| xqd
@@ -10,59 +10,61 @@
|
|
|
if(!$data && session('_old_input')){
|
|
|
$data = session("_old_input");
|
|
|
}
|
|
|
- ?>
|
|
|
- <div class="wrapper wrapper-content animated fadeInRight">
|
|
|
- <div class="row">
|
|
|
- <div class="col-sm-12">
|
|
|
- <div class="ibox float-e-margins">
|
|
|
- <div class="ibox-title">
|
|
|
- <h5>产品列表</h5>
|
|
|
- <div class="ibox-tools">
|
|
|
- <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
|
|
|
- </a>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="ibox-content">
|
|
|
- @if(role('Album/Product/index'))
|
|
|
- <div class="row">
|
|
|
- <div class="col-sm-3 pull-right">
|
|
|
- <a href="{{ U('Album/Product/index')}}" class="btn btn-sm btn-primary pull-right">返回列表</a>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- @endif
|
|
|
-
|
|
|
- <div class="row">
|
|
|
- <div class="col-lg-10">
|
|
|
- <form name="form_product" id="form-validation" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post" onsubmit="return checkLevel()">
|
|
|
-
|
|
|
-
|
|
|
- <div class="form-group">
|
|
|
-
|
|
|
- <label class="control-label col-sm-3">产品名称</label>
|
|
|
-
|
|
|
- <div class="col-sm-9">
|
|
|
- <input id="data_store_id" name="data[name]" class="form-control" value="{{ $data['name'] or ''}}" required="" aria-required="true" placeholder="">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
|
|
|
- <label class="control-label col-sm-3">分类</label>
|
|
|
+?>
|
|
|
+<div class="wrapper wrapper-content animated fadeInRight">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-12">
|
|
|
+ <div class="ibox float-e-margins">
|
|
|
+ <div class="ibox-title">
|
|
|
+ <h5>产品列表</h5>
|
|
|
+ <div class="ibox-tools">
|
|
|
+ <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="ibox-content">
|
|
|
+ @if(role('Album/Product/index'))
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-3 pull-right">
|
|
|
+ <a href="{{ U('Album/Product/index')}}" class="btn btn-sm btn-primary pull-right">返回列表</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-lg-10">
|
|
|
+ <form name="form_product" id="form-validation" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post" onsubmit="return checkLevel()">
|
|
|
+
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+
|
|
|
+ <label class="control-label col-sm-3">产品名称</label>
|
|
|
+
|
|
|
+ <div class="col-sm-9">
|
|
|
+ <input id="data_store_id" name="data[name]" class="form-control" value="{{ $data['name'] or ''}}" required="" aria-required="true" placeholder="">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+
|
|
|
+ <label class="control-label col-sm-3">分类</label>
|
|
|
+
|
|
|
+ <div class="col-sm-3">
|
|
|
+ <select id="data_parent_id" class="form-control" name="data[cat_id]" >
|
|
|
+ @if(isset($cat))
|
|
|
+ @foreach($cat as $key=>$val)
|
|
|
+ <option value="{{$val->id}}" @if($val['id'] == (isset($data['cat_id'])? $data['cat_id']:''))selected @endif>{{$val->name}}</option>
|
|
|
+ @endforeach
|
|
|
+ @endif
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ {{--<div class="col-sm-3" id="app">
|
|
|
+ <select name="data[cat_id]" id="data_cat_id" class="form-control" required="" aria-required="true">
|
|
|
+ <option v-for="item in list.data" :value="item.id">@{{ item.name }}</option>
|
|
|
+ </select>
|
|
|
+ </div>--}}
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="col-sm-3">
|
|
|
- <select id="data_parent_id" class="form-control" onchange="getLevelSecondCategory()">
|
|
|
- @if(isset($cat))
|
|
|
- @foreach($cat as $key=>$val)
|
|
|
- <option value="{{$val->id}}" @if($val['id'] == (isset($parent['id'])? $parent['id']:''))selected @endif>{{$val->name}}</option>
|
|
|
- @endforeach
|
|
|
- @endif
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="col-sm-3" id="app">
|
|
|
- <select name="data[cat_id]" id="data_cat_id" class="form-control" required="" aria-required="true">
|
|
|
- <option v-for="item in list.data" :value="item.id">@{{ item.name }}</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="control-label col-sm-3">默认价格</label>
|
| xqd
@@ -174,26 +176,46 @@
|
|
|
</div>
|
|
|
<!-- /.row -->
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <script src="/base/js/vue.js"></script>
|
|
|
- <link href="/base/css/plugins/toastr/toastr.min.css" rel="stylesheet">
|
|
|
- <script src="/base/js/plugins/toastr/toastr.min.js"></script>
|
|
|
- <script>
|
|
|
- toastr.options.positionClass = 'toast-bottom-center';
|
|
|
- toastr.options.timeOut = '4000';
|
|
|
-
|
|
|
- var level = new Vue({
|
|
|
- el:"#app",
|
|
|
- data:{
|
|
|
- list:{
|
|
|
- data:[
|
|
|
- {'id':0,'name':'请先选择一级类目'},
|
|
|
- ],
|
|
|
- },
|
|
|
- // num:0
|
|
|
+
|
|
|
+ <!-- /.row -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<script src="/base/js/vue.js"></script>
|
|
|
+<link href="/base/css/plugins/toastr/toastr.min.css" rel="stylesheet">
|
|
|
+<script src="/base/js/plugins/toastr/toastr.min.js"></script>
|
|
|
+<script>
|
|
|
+ toastr.options.positionClass = 'toast-bottom-center';
|
|
|
+ toastr.options.timeOut = '4000';
|
|
|
+
|
|
|
+ /* var level = new Vue({
|
|
|
+ el:"#app",
|
|
|
+ data:{
|
|
|
+ list:{
|
|
|
+ data:[
|
|
|
+ {'id':0,'name':'请先选择一级类目'},
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ // num:0
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ changeData:function (e) {
|
|
|
+ Vue.set(this.list,'data',e)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ function getLevelSecondCategory(){
|
|
|
+ var first = $('#data_parent_id').val();
|
|
|
+ $.ajax({
|
|
|
+ url: "{{ U('Album/Product/getSecondCategory') }}",
|
|
|
+ method: 'POST',
|
|
|
+ data: {
|
|
|
+ 'cat_id':first,
|
|
|
+ '_token':"{{ csrf_token() }}"
|
|
|
+
|
|
|
},
|
|
|
methods:{
|
|
|
changeData:function (e) {
|
| xqd
@@ -224,7 +246,7 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
- getLevelSecondCategory();
|
|
|
+ getLevelSecondCategory();*/
|
|
|
|
|
|
|
|
|
function checkLevel(){
|