|
|
@@ -0,0 +1,112 @@
|
|
|
+@extends('layouts.app')
|
|
|
+
|
|
|
+@section('title','系统配置')
|
|
|
+
|
|
|
+@section('content')
|
|
|
+ <nav class="nav2">
|
|
|
+ @component('maintenance.menu')@endcomponent
|
|
|
+ </nav>
|
|
|
+
|
|
|
+ <div class="container-fluid d-none" id="configuration">
|
|
|
+ <div class="card">
|
|
|
+ @include('maintenance.configuration._create')
|
|
|
+ @include('maintenance.configuration._edit')
|
|
|
+ <div class="card-body">
|
|
|
+ <div class="row pull-left m-1">
|
|
|
+ <button class="btn btn-outline-info mb-1 mr-3" @click="store"><span class="fa fa-plus"></span> 新 增</button>
|
|
|
+ </div>
|
|
|
+ @include('maintenance.configuration._table')
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+@endsection
|
|
|
+
|
|
|
+@section('lastScript')
|
|
|
+ <script>
|
|
|
+ let vue = new Vue({
|
|
|
+ el:"#configuration",
|
|
|
+ data:{
|
|
|
+ configurations:{!! $configurations->toJson() !!}['data'],
|
|
|
+ addConfiguration:{},
|
|
|
+ editConfiguration:{},
|
|
|
+ index:'',
|
|
|
+ filterOwners:'',
|
|
|
+ filterMaterials:'',
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ $('#configuration').removeClass('d-none');
|
|
|
+ this.filterOwners = JSON.parse(JSON.stringify(this.owners));
|
|
|
+ this.filterMaterials = JSON.parse(JSON.stringify(this.materials));
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ destroy(id,index){
|
|
|
+ if (!confirm('是否删除当前项目耗材')) return;
|
|
|
+ axios.delete('{{url('apiLocal/configuration')}}/'+id).then(res=>{
|
|
|
+ if(res.data.success){
|
|
|
+ tempTip.setIndex(100);
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.showSuccess('删除成功');
|
|
|
+ this.$delete(this.configurations,index);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show(res.data.message);
|
|
|
+ }).catch(err=>{
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show('删除当前项目耗材失败:'+err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ edit(configuration,i){
|
|
|
+ this.editConfiguration = configuration;
|
|
|
+ this.index = i;
|
|
|
+ $('#edit-configuration').modal('show');
|
|
|
+ },
|
|
|
+ update(){
|
|
|
+ let url = '{{url('apiLocal/configuration/update')}}';
|
|
|
+ let params = this.editConfiguration;
|
|
|
+ window.tempTip.postBasicRequest(url,params,res=>{
|
|
|
+ this.$set(this.configurations,this.index,res);
|
|
|
+ this.index = null;
|
|
|
+ this.editConfiguration = {};
|
|
|
+ $("#edit-configuration").modal('hide');
|
|
|
+ return "修改完成";
|
|
|
+ },true);
|
|
|
+ },
|
|
|
+ store(){
|
|
|
+ $('#add-configuration').modal('show');
|
|
|
+ },
|
|
|
+ create(){
|
|
|
+ let url = '{{url('apiLocal/configuration/store')}}';
|
|
|
+ let params = this.addConfiguration;
|
|
|
+ window.tempTip.postBasicRequest(url,params,res=>{
|
|
|
+ this.$set(this.configurations,this.configurations.length,res);
|
|
|
+ this.addConfiguration = {};
|
|
|
+ $("#add-configuration").modal('hide');
|
|
|
+ return "OK";
|
|
|
+ },true);
|
|
|
+ },
|
|
|
+ filterMaterial(e){
|
|
|
+ let value = $(e.target).val();
|
|
|
+ console.log(value);
|
|
|
+ if(value==='' || value===null)this.filterMaterials = this.materials;
|
|
|
+ else {
|
|
|
+ this.filterMaterials = this.materials.filter(function(item){
|
|
|
+ return item.code.indexOf(value) !== -1;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ filterOwner(e){
|
|
|
+ let value = $(e.target).val();
|
|
|
+ if(value==='' || value===null)this.filterMaterials = this.materials;
|
|
|
+ else {
|
|
|
+ this.filterOwners = this.owners.filter(function(item){
|
|
|
+ return item.name.indexOf(value) !== -1;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+@endsection
|
|
|
+
|