| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- @extends('layouts.app')
- @section('title')料箱型号@endsection
- @section('content')
- <div class="container-fluid card" id="container">
- @include("maintenance.materialBoxModel._modal")
- <div class="card-body">
- <button class="btn btn-outline-info mb-1 mr-3" @click="openModal()"><span class="fa fa-plus"></span> 新 增</button>
- <table class="table table-bordered table-striped">
- <tr>
- <th>编码</th>
- <th>说明</th>
- <th>最大商品种类</th>
- <th>操作</th>
- </tr>
- <tr v-for="model in models">
- <td>@{{ model.code }}</td>
- <td>@{{ model.description }}</td>
- <td>@{{ model.maximum_kind }}</td>
- <td>
- <button class="btn btn-sm btn-outline-primary" @click="edit(city.id)">改</button>
- <button class="btn btn-sm btn-outline-dark" @click="destroy(city)">删</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
- @endsection
- @section('lastScript')
- <script>
- new Vue({
- el:"#container",
- data:{
- models:[@foreach($models as $model)@json($model),@endforeach],
- model:{},
- errors:{},
- },
- methods:{
- openModal(model= {maximum_kind:1}){
- this.model = model;
- $("#modal").modal("show");
- },
- submitModel(){
- window.tempTip.postBasicRequest("{{url('maintenance/materialBoxModel/save')}}",this.model,res=>{
- if (!this.model.id){
- this.models.unshift(res);
- return "新增成功";
- }
- this.models.some((model,index)=>{
- if (model.id===res.id){
- this.$set(this.models,index,res);
- return true;
- }
- });
- return "修改成功";
- });
- },
- }
- });
- </script>
- @endsection
|