|
|
@@ -29,6 +29,28 @@
|
|
|
<td colspan="3" class="bg-light-cyanogen">账单信息</td>
|
|
|
</tr>
|
|
|
<tr class="text-nowrap" id="header"></tr>
|
|
|
+ <tr v-for="(report,i) in reports">
|
|
|
+ <td>
|
|
|
+ <label><input type="checkbox" :value="report.id" v-model="checkData"></label>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ <td>@{{ i+1 }}</td>
|
|
|
+ <td>@{{ report.ownerGroupName }}</td>
|
|
|
+ <td>@{{ report.customerName }}</td>
|
|
|
+ <td>@{{ report.ownerName }}</td>
|
|
|
+ <td>@{{ report.ownerStatus }}</td>
|
|
|
+ <td>@{{ report.ownerCreatedAt }}</td>
|
|
|
+ <td>@{{ report.ownerStorageDuration }} 天</td>
|
|
|
+ <td>@{{ report.countingMonth }}</td>
|
|
|
+ <td>@{{ report.dailyAverageOrderAmount }}</td>
|
|
|
+ <td>@{{ report.lastMonthCountingArea }}</td>
|
|
|
+ <td>@{{ report.currentMonthCountingArea }}</td>
|
|
|
+ <td>@{{ report.ownerBillReportInitialFee }}</td>
|
|
|
+ <td>@{{ report.ownerBillReportConfirmFee }}</td>
|
|
|
+ <td>@{{ report.ownerBillReportConfirmUpdatedAt }}</td>
|
|
|
+ </tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -37,25 +59,58 @@
|
|
|
@section('lastScript')
|
|
|
<script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
|
|
|
<script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
|
|
|
+ <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
|
|
|
<script>
|
|
|
let vue = new Vue({
|
|
|
el:"#container",
|
|
|
data:{
|
|
|
reports : [
|
|
|
@foreach($reports as $report)
|
|
|
- {},
|
|
|
+ {
|
|
|
+ id : "{{$report->id}}",
|
|
|
+ ownerGroupName : "{{$report->owner ? ($report->owner->userOwnerGroup ? $report->owner->userOwnerGroup->name : '') : ''}}",
|
|
|
+ customerName : "{{$report->owner ? ($report->owner->customer ? $report->owner->customer->name : '') : ''}}",
|
|
|
+ ownerName : "{{$report->owner ? $report->owner->name : ''}}",
|
|
|
+ ownerStatus : "{{$report->owner ? ($report->owner->deleted_at ? "冻结" : "激活") : ''}}",
|
|
|
+ ownerStorageDuration : "{{$report->owner ? ($report->owner->created_at ? ((new DateTime())->diff(new DateTime($report->owner->created_at))->days) : '') : ''}}",
|
|
|
+ ownerCreatedAt : "{{$report->owner ? $report->owner->created_at : ''}}",
|
|
|
+ countingMonth : "{{$report->counting_month}}",
|
|
|
+ dailyAverageOrderAmount : "{{$report->daily_average_order_amount}}",
|
|
|
+ lastMonthCountingArea : "{{$report->last_month_counting_area}}",
|
|
|
+ currentMonthCountingArea : "{{$report->current_month_counting_area}}",
|
|
|
+ ownerBillReportInitialFee : "{{$report->ownerBillReport ? $report->ownerBillReport->initial_fee : ''}}",
|
|
|
+ ownerBillReportConfirmFee : "{{$report->ownerBillReport ? $report->ownerBillReport->confirm_fee : ''}}",
|
|
|
+ ownerBillReportConfirmUpdatedAt : "{{$report->ownerBillReport ? $report->ownerBillReport->updated_at : ''}}",
|
|
|
+ },
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+
|
|
|
+ owners : [
|
|
|
+ @foreach($owners as $owner)
|
|
|
+ {name:"{{$owner->id}}",value:"{{$owner->name}}"},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ workgroup : [
|
|
|
+ @foreach($ownerGroups as $ownerGroup)
|
|
|
+ {name:"{{$ownerGroup->id}}",value:"{{$ownerGroup->name}}"},
|
|
|
@endforeach
|
|
|
],
|
|
|
- owners : [],
|
|
|
- workgroup : [],
|
|
|
- customers : [],
|
|
|
- status : [],
|
|
|
+ customers : [
|
|
|
+ @foreach($customers as $customer)
|
|
|
+ {name:"{{$customer->id}}",value:"{{$customer->name}}"},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ status : [
|
|
|
+ {name:"激活",value:"激活"},
|
|
|
+ {name:"冻结",value:"冻结"},
|
|
|
+ ],
|
|
|
checkData : [],
|
|
|
+ sum : Number("{{ $reports->total() }}"),
|
|
|
},
|
|
|
mounted(){
|
|
|
let data=[
|
|
|
[
|
|
|
- {name:'workgroup',type:'select',tip:'项目小组',placeholder: '项目小组',data:this.workgroup},
|
|
|
+ {name:'owner_group_id',type:'select',tip:'项目小组',placeholder: '项目小组',data:this.workgroup},
|
|
|
{name:'counting_month_start',type:'dateMonth',tip:'起始结算月'},
|
|
|
{name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的项目'],
|
|
|
placeholder:['项目','定位或多选项目'],data:this.owners},
|
|
|
@@ -103,22 +158,44 @@
|
|
|
header.init();
|
|
|
},0);
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ checkData:{
|
|
|
+ handler(){
|
|
|
+ if (this.checkData.length === this.reports.length){
|
|
|
+ document.querySelector('#all').checked = true;
|
|
|
+ document.querySelector('#all_temp').checked = true;
|
|
|
+ }else {
|
|
|
+ document.querySelector('#all').checked = false;
|
|
|
+ document.querySelector('#all_temp').checked = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep:true
|
|
|
+ }
|
|
|
+ },
|
|
|
methods : {
|
|
|
reportExport(isAll){
|
|
|
-
|
|
|
+ let url = '{{url('customer/project/report/export')}}';
|
|
|
+ let token='{{ csrf_token() }}';
|
|
|
+ //excelExport 定义在 js/queryForm/export.js
|
|
|
+ excelExport(isAll,this.checkData,url,this.sum,token);
|
|
|
},
|
|
|
//全选事件
|
|
|
checkAll(e){
|
|
|
if (e.target.checked){
|
|
|
+ this.checkData = [];
|
|
|
this.reports.forEach((el)=>{
|
|
|
- if (this.checkData.indexOf(el.id) === '-1'){
|
|
|
- this.checkData.push(el.id);
|
|
|
- }
|
|
|
+ this.checkData.push(el.id);
|
|
|
});
|
|
|
}else {
|
|
|
this.checkData = [];
|
|
|
}
|
|
|
},
|
|
|
+ _formatDate(str){
|
|
|
+ return new Date(Date.parse(str.replace(/-/g,"/")));
|
|
|
+ },
|
|
|
+ _diffDate(startDate, endDate){
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
</script>
|