|
@@ -0,0 +1,313 @@
|
|
|
|
|
+@extends('layouts.app')
|
|
|
|
|
+@section('title')采购管理-采购-查询@endsection
|
|
|
|
|
+
|
|
|
|
|
+@section('content')
|
|
|
|
|
+ @component('procurement.procurement.menu')@endcomponent
|
|
|
|
|
+ <div class="container-fluid" id="list">
|
|
|
|
|
+ <div class="card container-fluid">
|
|
|
|
|
+ @if(Session::has('successTip'))
|
|
|
|
|
+ <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
|
|
|
|
|
+ @endif
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-4">
|
|
|
|
|
+ <div class="card">
|
|
|
|
|
+ <div class="card-body row">
|
|
|
|
|
+ <span class="fa fa-shopping-cart fa-4x offset-md-3" style="color: #4c2584"></span>
|
|
|
|
|
+ <span class="ml-3 mt-2">
|
|
|
|
|
+ <h5 class="font-weight-bold">数量</h5>
|
|
|
|
|
+ <p class="text-muted">今日收货次数</p>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-4">
|
|
|
|
|
+ <div class="card">
|
|
|
|
|
+ <div class="card-body row">
|
|
|
|
|
+ <span class="fa fa-file-o fa-4x offset-md-3" style="color: #9fcdff"></span>
|
|
|
|
|
+ <span class="ml-3 mt-2">
|
|
|
|
|
+ <h5 class="font-weight-bold">数量</h5>
|
|
|
|
|
+ <p class="text-muted">今日发起采购次数</p>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-4">
|
|
|
|
|
+ <div class="card">
|
|
|
|
|
+ <div class="card-body row">
|
|
|
|
|
+ <span class="fa fa-calendar-o fa-4x offset-md-3" style="color: #2ca02c"></span>
|
|
|
|
|
+ <span class="ml-3 mt-2">
|
|
|
|
|
+ <h5 class="font-weight-bold">数量</h5>
|
|
|
|
|
+ <p class="text-muted">今日对账金额</p>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div id="form_div" class="mt-1"></div>
|
|
|
|
|
+ <div class="row mt-2">
|
|
|
|
|
+ <span class="dropdown ml-3">
|
|
|
|
|
+ <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
|
|
|
|
|
+ :class="[checkData.length>0?'btn-dark text-light':'']"
|
|
|
|
|
+ data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
|
|
|
|
|
+ 导出Excel
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <div class="dropdown-menu">
|
|
|
|
|
+ <a class="dropdown-item" @click="{{--procurementExport(false)--}}" href="javascript:">导出勾选内容</a>
|
|
|
|
|
+ <a class="dropdown-item" @click="{{--procurementExport(true)--}}" href="javascript:">导出所有页</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span class="btn btn-sm btn-outline-info ml-2" @click="addProcurement">新增采购</span>
|
|
|
|
|
+ @can('采购管理-采购-新建')
|
|
|
|
|
+ @include('procurement.procurement._addProcurement')
|
|
|
|
|
+ @endcan
|
|
|
|
|
+ <span class="btn btn-sm btn-outline-success ml-2">新增询价</span>
|
|
|
|
|
+ <span class="btn btn-sm btn-outline-danger ml-2">新增打样</span>
|
|
|
|
|
+ <span class="btn btn-sm btn-outline-primary ml-2">重新发起</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <label for="all" id="cloneCheckAll" class="d-none">
|
|
|
|
|
+ <input id="all" type="checkbox" @click="checkAll($event)">全选
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <table class="table table-sm table-bordered text-nowrap d-none" id="headerRoll"></table>
|
|
|
|
|
+ <table class="table table-sm table-striped table-bordered table-hover text-nowrap card-body mt-2"
|
|
|
|
|
+ id="headerParent">
|
|
|
|
|
+ <tr id="header"></tr>
|
|
|
|
|
+ <tr v-for="(procurement,i) in procurements">
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input class="checkItem" type="checkbox" :value="procurement" v-model="checkData">
|
|
|
|
|
+ </td>
|
|
|
|
|
+{{-- <td class="">@{{ procurement.code }}</td>--}}
|
|
|
|
|
+{{-- <td class="text-muted">@{{ procurement.owner_name }}</td>--}}
|
|
|
|
|
+{{-- <td class="text-muted">@{{ procurement.type }}</td>--}}
|
|
|
|
|
+{{-- <td class="text-muted">@{{ procurement.company_name }}</td>--}}
|
|
|
|
|
+{{-- <td class="tooltipTarget" style="max-width: 200px;overflow:hidden">@{{ procurement.material_code }}</td>--}}
|
|
|
|
|
+{{-- <td class="text-muted">@{{ procurement.material_name }}</td>--}}
|
|
|
|
|
+{{-- <td class="text-muted">@{{ procurement.size }}</td>--}}
|
|
|
|
|
+{{-- <td class="text-muted">@{{ procurement.special }}</td>--}}
|
|
|
|
|
+{{-- <td class="text-muted">@{{ procurement.specification }}</td>--}}
|
|
|
|
|
+{{-- <td></td>--}}
|
|
|
|
|
+{{-- <td>@{{ procurement.quantity }}</td>--}}
|
|
|
|
|
+{{-- <td><span>@{{ procurement.unit_price }}</span></td>--}}
|
|
|
|
|
+{{-- <td><span></span></td>--}}
|
|
|
|
|
+{{-- <td><span></span></td>--}}
|
|
|
|
|
+{{-- <td><span>@{{ procurement.status }}</span></td>--}}
|
|
|
|
|
+{{-- <td><span>@{{ procurement.phone }}</span></td>--}}
|
|
|
|
|
+ <td class="">@{{ procurement.code }}</td>
|
|
|
|
|
+ <td v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.name }}</td>
|
|
|
|
|
+ <td class="text-muted">@{{ procurement.type }}</td>
|
|
|
|
|
+ <td v-if="procurement.owner_material.owner.customer">@{{ procurement.owner_material.owner.customer.company_name }}</td>
|
|
|
|
|
+ <td class="tooltipTarget" style="max-width: 200px;overflow:hidden" v-if="procurement.owner_material.material">@{{ procurement.owner_material.material.code }}</td>
|
|
|
|
|
+ <td class="text-muted" v-if="procurement.owner_material.material">@{{ procurement.owner_material.material.name }}</td>
|
|
|
|
|
+ <td class="text-muted" v-if="procurement.owner_material">@{{ procurement.owner_material.size }}</td>
|
|
|
|
|
+ <td class="text-muted" v-if="procurement.owner_material">@{{ procurement.owner_material.special }}</td>
|
|
|
|
|
+ <td class="text-muted" v-if="procurement.owner_material">@{{ procurement.owner_material.specification }}</td>
|
|
|
|
|
+ <td></td>
|
|
|
|
|
+ <td>@{{ procurement.quantity }}</td>
|
|
|
|
|
+ <td><span>@{{ procurement.unit_price }}</span></td>
|
|
|
|
|
+ <td><span></span></td>
|
|
|
|
|
+ <td><span></span></td>
|
|
|
|
|
+ <td><span>@{{ procurement.status }}</span></td>
|
|
|
|
|
+ <td v-if="procurement.owner_material.owner.customer">@{{ procurement.owner_material.owner.customer.phone }}</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="btn btn-sm btn-outline-danger">取消</span>
|
|
|
|
|
+ <span class="btn btn-sm btn-outline-success">发起采购</span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <div class="text-info h5 btn btn">{{$procurements->count()}}/@{{ sum }}</div>
|
|
|
|
|
+ <div>{{$procurements->appends($paginateParams)->links()}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+@endsection
|
|
|
|
|
+@section('lastScript')
|
|
|
|
|
+ <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
|
|
|
|
|
+ <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
|
|
|
|
|
+ <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
|
|
|
|
|
+ <script>
|
|
|
|
|
+ let vue = new Vue({
|
|
|
|
|
+ el: '#list',
|
|
|
|
|
+ data: {
|
|
|
|
|
+ procurements:{!! $procurements->toJson() !!}['data'],
|
|
|
|
|
+ {{--procurements: [--}}
|
|
|
|
|
+ {{-- @foreach($procurements as $procurement)--}}
|
|
|
|
|
+ {{-- {--}}
|
|
|
|
|
+ {{-- id:'{{$procurement->id}}',code:'{{$procurement->code}}',type:'{{$procurement->type}}',created_at:'{{$procurement->created_at}}',--}}
|
|
|
|
|
+ {{-- quantity:'{{$procurement->quantity}}',unit_price:'{{$procurement->unit_price}}',status:'{{$procurement->status}}',--}}
|
|
|
|
|
+ {{-- @if($procurement->ownerMaterial)--}}
|
|
|
|
|
+ {{-- owner_id:'{{$procurement->ownerMaterial->owner_id}}',size:'{{$procurement->ownerMaterial->size}}',--}}
|
|
|
|
|
+ {{-- special:'{{$procurement->ownerMaterial->special}}',specification:'{{$procurement->ownerMaterial->specification}}',@endif--}}
|
|
|
|
|
+ {{-- @if($procurement->ownerMaterial->material)--}}
|
|
|
|
|
+ {{-- material_id:'{{$procurement->ownerMaterial->material->id}}',material_code:'{{$procurement->ownerMaterial->material->code}}',--}}
|
|
|
|
|
+ {{-- material_name:'{{$procurement->ownerMaterial->material->name}}',@endif--}}
|
|
|
|
|
+ {{-- @if($procurement->ownerMaterial->owner)owner_name:'{{$procurement->ownerMaterial->owner->name}}',@endif--}}
|
|
|
|
|
+ {{-- @if($procurement->ownerMaterial->owner->customer)--}}
|
|
|
|
|
+ {{-- company_name:'{{$procurement->ownerMaterial->owner->customer->company_name}}',customer_id:'{{$procurement->ownerMaterial->owner->customer->id}}',--}}
|
|
|
|
|
+ {{-- phone:'{{$procurement->ownerMaterial->owner->customer->phone}}',@endif--}}
|
|
|
|
|
+ {{-- },--}}
|
|
|
|
|
+ {{-- @endforeach--}}
|
|
|
|
|
+ {{--],--}}
|
|
|
|
|
+ owners:[
|
|
|
|
|
+ @foreach($owners as $owner)
|
|
|
|
|
+ {
|
|
|
|
|
+ name:'{{$owner->id}}',value:'{{$owner->name}}',
|
|
|
|
|
+ ownerMaterials:[
|
|
|
|
|
+ @foreach($owner->ownerMaterials ? $owner->ownerMaterials :[] as $ownerMaterial)
|
|
|
|
|
+ {
|
|
|
|
|
+ id:'{{$ownerMaterial->id}}',material_code:'{{$ownerMaterial->material_code}}',material_name:'{{$ownerMaterial->material->name}}',
|
|
|
|
|
+ size:'{{$ownerMaterial->size}}',special:'{{$ownerMaterial->special}}',specification:'{{$ownerMaterial->specification}}',
|
|
|
|
|
+ },
|
|
|
|
|
+ @endforeach
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ @endforeach
|
|
|
|
|
+ ],
|
|
|
|
|
+ materials: [
|
|
|
|
|
+ @foreach($materials as $material)
|
|
|
|
|
+ {name:'{{$material->id}}',value:'{{$material->name}}'},
|
|
|
|
|
+ @endforeach
|
|
|
|
|
+ ],
|
|
|
|
|
+ checkData: [],
|
|
|
|
|
+ sum:{!! $procurements->total() !!},
|
|
|
|
|
+ owner_id:'{{old('owner_id')}}',
|
|
|
|
|
+ owner_material_id:'{{old('owner_material_id')}}',
|
|
|
|
|
+ material_name:'{{old('material_name')}}',
|
|
|
|
|
+ size:'{{old('size')}}',
|
|
|
|
|
+ special:'{{old('special')}}',
|
|
|
|
|
+ specification:'{{old('specification')}}',
|
|
|
|
|
+ quantity:'{{old('quantity')}}',
|
|
|
|
|
+ amount:'{{old('amount')}}',
|
|
|
|
|
+ unit_price:'{{old('unit_price')}}',
|
|
|
|
|
+ total_price:'{{old('total_price')}}',
|
|
|
|
|
+ ownerMaterials:[],
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted: function () {
|
|
|
|
|
+ $(".tooltipTarget").tooltip({'trigger': 'hover'});
|
|
|
|
|
+ $('#list').removeClass('d-none');
|
|
|
|
|
+ let data = [
|
|
|
|
|
+ [
|
|
|
|
|
+ {name: 'created_at_start', type: 'dateTime', tip: '选择显示指定日期的起始时间'},
|
|
|
|
|
+ {name: 'created_at_end', type: 'dateTime', tip: '选择显示指定日期的结束时间'},
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'owner_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的项目'],
|
|
|
|
|
+ placeholder: ['项目', '定位或多选项目'], data: this.owners
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'material_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的耗材'],
|
|
|
|
|
+ placeholder: ['耗材', '定位或多选耗材'], data: this.materials
|
|
|
|
|
+ },
|
|
|
|
|
+ {name: 'company_name', type: 'input', tip: '采购公司:可在两侧增加百分号(%)进行模糊搜索', placeholder: '采购公司'},
|
|
|
|
|
+ ],
|
|
|
|
|
+ ];
|
|
|
|
|
+ this.form = new query({
|
|
|
|
|
+ el: "#form_div",
|
|
|
|
|
+ condition: data,
|
|
|
|
|
+ });
|
|
|
|
|
+ this.form.init();
|
|
|
|
|
+ let column = [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'cloneCheckAll', customization: true, type: 'checkAll',
|
|
|
|
|
+ dom: $('#cloneCheckAll').removeClass('d-none'), neglect: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {name: 'code', value: '采购编号', neglect: true},
|
|
|
|
|
+ {name: 'owner_id', value: '项目', class: ''},
|
|
|
|
|
+ {name: 'type', value: '单据类型', class: 'text-muted'},
|
|
|
|
|
+ {name: 'company_name', value: '采购公司', class: 'text-muted'},
|
|
|
|
|
+ {name: 'material_code', value: '耗材编号', class: 'text-muted'},
|
|
|
|
|
+ {name: 'material_name', value: '耗材'},
|
|
|
|
|
+ {name: 'size', value: '尺寸大小', class: 'text-muted'},
|
|
|
|
|
+ {name: 'special', value: '特殊要求', class: 'text-muted'},
|
|
|
|
|
+ {name: 'specification', value: '材质规格', class: 'text-muted'},
|
|
|
|
|
+ {name: '附件', value: '附件', class: 'text-muted'},
|
|
|
|
|
+ {name: 'quantity', value: '采购数量', neglect: true},
|
|
|
|
|
+ {name: 'unit_price', value: '销售单价(元)', neglect: true},
|
|
|
|
|
+ {name: '', value: '送货数量', neglect: true},
|
|
|
|
|
+ {name: '', value: '销售总价(元)', neglect: true},
|
|
|
|
|
+ {name: '', value: '采购单状态', neglect: true},
|
|
|
|
|
+ {name: '', value: '联系方式', neglect: true},
|
|
|
|
|
+ {name: '', value: '操作', neglect: true},
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ let _this = this;
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ let header = new Header({
|
|
|
|
|
+ el: "#header",
|
|
|
|
|
+ column: column,
|
|
|
|
|
+ data: _this.procurements,
|
|
|
|
|
+ restorationColumn: 'id',
|
|
|
|
|
+ fixedTop: ($('#form_div').height()) + 2,
|
|
|
|
|
+ offset: 0.5,
|
|
|
|
|
+ vue: vue
|
|
|
|
|
+ });
|
|
|
|
|
+ header.init();
|
|
|
|
|
+ }, 0);
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ //全选事件
|
|
|
|
|
+ checkAll(e) {
|
|
|
|
|
+ if (e.target.checked) {
|
|
|
|
|
+ this.procurements.forEach((el, i) => {
|
|
|
|
|
+ if (this.checkData.indexOf(el) == '-1') {
|
|
|
|
|
+ this.checkData.push(el);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.checkData = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ addProcurement(){
|
|
|
|
|
+ $('#add-procurement').modal('show');
|
|
|
|
|
+ },
|
|
|
|
|
+ owner_seek:function (e) {
|
|
|
|
|
+ let _this=this;
|
|
|
|
|
+ let $val=e.target.value;
|
|
|
|
|
+ if($val===''){
|
|
|
|
|
+ _this.owner_id='';
|
|
|
|
|
+ }else{
|
|
|
|
|
+ _this.owners.forEach(function (owner) {
|
|
|
|
|
+ if (owner.value.includes($val)){
|
|
|
|
|
+ _this.owner_id=owner.name;
|
|
|
|
|
+ _this.ownerMaterials=owner.ownerMaterials;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ ownerMaterial:function () {
|
|
|
|
|
+ let _this=this;
|
|
|
|
|
+ _this.ownerMaterials.forEach(function (ownerMaterial) {
|
|
|
|
|
+ if (_this.owner_material_id===ownerMaterial.id){
|
|
|
|
|
+ _this.material_name=ownerMaterial.material_name;
|
|
|
|
|
+ _this.size=ownerMaterial.size;
|
|
|
|
|
+ _this.special=ownerMaterial.special;
|
|
|
|
|
+ _this.specification=ownerMaterial.specification;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ selectOwner:function () {
|
|
|
|
|
+ let _this=this;
|
|
|
|
|
+ _this.owners.forEach(function (owner) {
|
|
|
|
|
+ if (_this.owner_id===owner.name){
|
|
|
|
|
+ _this.ownerMaterials=owner.ownerMaterials;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ countTotalPrice:function () {
|
|
|
|
|
+ let _this=this;
|
|
|
|
|
+ if (_this.unit_price===''|| _this.amount==='')_this.total_price=null;
|
|
|
|
|
+ _this.total_price=_this.unit_price*_this.amount;
|
|
|
|
|
+ },
|
|
|
|
|
+ createProcurement(){
|
|
|
|
|
+ let _this=this;
|
|
|
|
|
+ let url = '{{url('procurement/procurement/createProcurement')}}';
|
|
|
|
|
+ let params = {owner_material_id:_this.owner_material_id,quantity:_this.quantity,amount:_this.amount,unit_price:_this.unit_price};
|
|
|
|
|
+ window.tempTip.postBasicRequest(url,params,res=>{
|
|
|
|
|
+ this.procurements.push(res);
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
|
+ $("#add-procurement").modal('hide');
|
|
|
|
|
+ return "OK";
|
|
|
|
|
+ },true);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ </script>
|
|
|
|
|
+@endsection
|