|
|
@@ -0,0 +1,185 @@
|
|
|
+@extends('layouts.app')
|
|
|
+@section('title','需求发布')
|
|
|
+@section('content')
|
|
|
+ @include('shared._messages')
|
|
|
+ @include('shared._error')
|
|
|
+ <div id="list" class="d-none">
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div id="form_div"></div>
|
|
|
+ <div class="form-inline" id="btn"></div>
|
|
|
+ <table class="table table-striped table-sm text-nowrap table-hover" id="table">
|
|
|
+ <tr v-for="(requirement,i) in requirements"
|
|
|
+ @click="selectTr===i+1?selectTr=0:selectTr=i+1"
|
|
|
+ :class="selectTr===i+1?'focusing' : ''">
|
|
|
+ <td><input class="checkItem" type="checkbox" :value="requirement.id"></td>
|
|
|
+ <td>@{{ i+1 }}</td>
|
|
|
+ <td>@{{ requirement.creator.name }}</td>
|
|
|
+ <td>@{{ requirement.title }}</td>
|
|
|
+ <td>@{{ requirement.content }}</td>
|
|
|
+ <td><span :class="calStatusClass(requirement.status)">@{{ requirement.status }}</span></td>
|
|
|
+ <td>@{{ requirement.began_at }}</td>
|
|
|
+ <td>@{{ requirement.finished_at }}</td>
|
|
|
+ <td>@{{ requirement.created_at }}</td>
|
|
|
+ <td>
|
|
|
+ <form v-if="requirement.status!=='已完成'" :action="targetUrl(requirement.id)" method="post"
|
|
|
+ style="display: inline-block;"
|
|
|
+ onsubmit="return confirm('您确定要删除吗?');">
|
|
|
+ {{ csrf_field() }}
|
|
|
+ {{ method_field('DELETE') }}
|
|
|
+ <button type="submit" class="btn btn-outline-danger btn-sm">
|
|
|
+ <i class="far fa-trash-alt"></i> 删
|
|
|
+ </button>
|
|
|
+ </form>
|
|
|
+ <form v-if="requirement.status==='已发布'" :action="targetUrl(requirement.id)+'/edit'" method="get"
|
|
|
+ style="display: inline-block;"
|
|
|
+ onsubmit="return">
|
|
|
+ <button type="submit" class="btn btn-outline-info btn-sm">
|
|
|
+ <i class="far fa-trash-alt"></i> 改
|
|
|
+ </button>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <button type="submit" class="btn btn-outline-info btn-sm">
|
|
|
+ <i class="far fa-trash-alt"></i> <a :href="targetUrl(requirement.id)">查</a>
|
|
|
+ </button>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <div class="text-info h5 btn btn">{{$requirements->count()}}
|
|
|
+ /{{$requirements->total()}}</div>
|
|
|
+ {{$requirements->appends($paginateParams)->links()}}
|
|
|
+ </div>
|
|
|
+ <textarea id="clipboardDiv" style="opacity:0"></textarea>
|
|
|
+ </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>{{--新版2--}}
|
|
|
+ <script>
|
|
|
+ let vue = new Vue({
|
|
|
+ el: "#list",
|
|
|
+ data: {
|
|
|
+ requirements: [@foreach($requirements as $requirement){!! $requirement !!},@endforeach],
|
|
|
+ selectTr: 0,
|
|
|
+ creators: [@foreach($canCreateRequirementUsers as $creator){
|
|
|
+ name: '{{ $creator->id }}',
|
|
|
+ value: '{{ $creator->name }}'
|
|
|
+ },@endforeach],
|
|
|
+ workers: [@foreach($canWorkRequirementUsers as $worker){
|
|
|
+ name: '{{ $worker->id }}',
|
|
|
+ value: '{{ $worker->name }}'
|
|
|
+ },@endforeach]
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ $('#list').removeClass('d-none');
|
|
|
+ let _this = this;
|
|
|
+ $(".up").slideUp();
|
|
|
+ let data = [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ name: 'creator_id',
|
|
|
+ type: 'select',
|
|
|
+ tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的状态'],
|
|
|
+ placeholder: '发布人',
|
|
|
+ data: this.creators
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'title',
|
|
|
+ type: 'input',
|
|
|
+ tip: '输入标题搜索',
|
|
|
+ placeholder: '标题'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'worker_ids',
|
|
|
+ type: 'select_multiple_select',
|
|
|
+ tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的货主'],
|
|
|
+ placeholder: ['执行人', '定位或多选'],
|
|
|
+ data: this.workers
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'began_at_start',
|
|
|
+ type: 'dateTime',
|
|
|
+ tip: '选择任务开始的起始时间'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'began_at_end',
|
|
|
+ type: 'dateTime',
|
|
|
+ tip: '选择任务开始的截止时间'
|
|
|
+ },
|
|
|
+
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {
|
|
|
+ name: 'finished_at_start',
|
|
|
+ type: 'dateTime',
|
|
|
+ tip: '选择任务完成的起始时间'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'finished_at_end',
|
|
|
+ type: 'dateTime',
|
|
|
+ tip: '选择任务完成的截止时间'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'created_at_start',
|
|
|
+ type: 'dateTime',
|
|
|
+ tip: '选择任务创建的起始时间'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'created_at_end',
|
|
|
+ type: 'dateTime',
|
|
|
+ tip: '选择任务创建的截止时间'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ _this.form = new query({
|
|
|
+ el: '#form_div',
|
|
|
+ condition: data,
|
|
|
+ });
|
|
|
+ _this.form.init();
|
|
|
+ let column = [
|
|
|
+ {name: 'index', value: '序号', neglect: true},
|
|
|
+ {name: 'creator_name', value: '创建人'},
|
|
|
+ {name: 'title', value: '标题'},
|
|
|
+ {name: 'content', value: '内容'},
|
|
|
+ {name: 'status', value: '状态'},
|
|
|
+ {name: 'began_at', value: '开始时间'},
|
|
|
+ {name: 'finished_at', value: '完成时间'},
|
|
|
+ {name: 'created_at', value: '创建时间'},
|
|
|
+ {name: 'operation', value: '操作'},
|
|
|
+ ];
|
|
|
+ new Header({
|
|
|
+ el: "table",
|
|
|
+ name: "requirements",
|
|
|
+ column: column,
|
|
|
+ data: this.requirements,
|
|
|
+ restorationColumn: 'addtime',
|
|
|
+ fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
|
|
|
+ }).init();
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ {{--edit(id) {--}}
|
|
|
+ {{-- location.href = "{{url('finance/settlementBills/ownerSundryFeeDetails')}}/" + id + "/edit";--}}
|
|
|
+ {{--},--}}
|
|
|
+ targetUrl(id) {
|
|
|
+ return "{{ url('requirements') }}/" + id;
|
|
|
+ },
|
|
|
+
|
|
|
+ calStatusClass(status) {
|
|
|
+ switch (status) {
|
|
|
+ case '已发布':
|
|
|
+ return "badge badge-info";
|
|
|
+ case '已开始':
|
|
|
+ return "badge badge-warning";
|
|
|
+ case '已完成':
|
|
|
+ return "badge badge-success";
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ filters: {},
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+@endsection
|