|
@@ -6,9 +6,10 @@
|
|
|
v-model="queryParams.weekData"
|
|
|
type="week"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
- format="yyyy 第 WW 周"
|
|
|
+ :format="weekValue"
|
|
|
:picker-options="{'firstDayOfWeek': 6}"
|
|
|
placeholder="选择周"
|
|
|
+ @change="handleWeekChange"
|
|
|
:clearable="false"/>
|
|
|
<el-button style="margin-left: 10px;" type="primary" icon="el-icon-search" size="mini" @click="getList">{{ $t('common.search') }}
|
|
|
</el-button>
|
|
@@ -24,14 +25,14 @@
|
|
|
<h2>{{ data.areaCountStatisticsTitle }}</h2>
|
|
|
<el-table :data="getBody(data.areaCountStatistics, 2)" :summary-method="() => getWeekCountSummaries()" :show-summary="true" v-loading="loading"
|
|
|
:height="300" class="page-table" element-loading-text="loading..." :header-cell-style="{'background-color':'#F4F6F8','border-right':'1px solid #dfdcdc','color':'#92A2B5'}" border>
|
|
|
- <Column v-for="(label, index) in getHeader(data.areaCountStatistics)" :label="label" :prop="index" :fixed="index === 0? 'left' : false"/>
|
|
|
+ <Column v-for="(label, index) in getHeader(data.areaCountStatistics)" :label="label" :prop="String(index)" :fixed="index === 0? 'left' : false"/>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<h2>{{ data.monthCountStatisticsTitle }}</h2>
|
|
|
<el-table :data="getBody(data.monthCountStatistics)" :summary-method="() => getFooter(data.monthCountStatistics)" :show-summary="true" v-loading="loading"
|
|
|
:height="300" class="page-table" element-loading-text="loading..." :header-cell-style="{'background-color':'#F4F6F8','border-right':'1px solid #dfdcdc','color':'#92A2B5'}" border>
|
|
|
- <Column v-for="(label, index) in getHeader(data.monthCountStatistics)" :label="label" :prop="index" :fixed="index === 0? 'left' : false"/>
|
|
|
+ <Column v-for="(label, index) in getHeader(data.monthCountStatistics)" :label="label" :prop="String(index)" :fixed="index === 0? 'left' : false"/>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -41,14 +42,14 @@
|
|
|
<h2>{{ data.weekCountStatisticsTitle }}</h2>
|
|
|
<el-table :data="getBody(data.weekCountStatistics)" :summary-method="() => getFooter(data.weekCountStatistics)" :show-summary="true" v-loading="loading"
|
|
|
:height="300" class="page-table" element-loading-text="loading..." :header-cell-style="{'background-color':'#F4F6F8','border-right':'1px solid #dfdcdc','color':'#92A2B5'}" border>
|
|
|
- <Column v-for="(label, index) in getHeader(data.weekCountStatistics)" :label="label" :prop="index" :fixed="index === 0? 'left' : false"/>
|
|
|
+ <Column v-for="(label, index) in getHeader(data.weekCountStatistics)" :label="label" :prop="String(index)" :fixed="index === 0? 'left' : false"/>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<h2>{{ data.signingAreaColStatisticsTitle }}</h2>
|
|
|
<el-table :data="getBody(data.signingAreaColStatistics)" :summary-method="() => getFooter(data.signingAreaColStatistics)" :show-summary="true" v-loading="loading"
|
|
|
:height="300" class="page-table" element-loading-text="loading..." :header-cell-style="{'background-color':'#F4F6F8','border-right':'1px solid #dfdcdc','color':'#92A2B5'}" border>
|
|
|
- <Column v-for="(label, index) in getHeader(data.signingAreaColStatistics)" :label="label" :prop="index" :fixed="index === 0? 'left' : false"/>
|
|
|
+ <Column v-for="(label, index) in getHeader(data.signingAreaColStatistics)" :label="label" :prop="String(index)" :fixed="index === 0? 'left' : false"/>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -58,14 +59,14 @@
|
|
|
<h2>{{ data.productionAreaColStatisticsTitle }}</h2>
|
|
|
<el-table :data="getBody(data.productionAreaColStatistics)" :summary-method="() => getFooter(data.productionAreaColStatistics)" :show-summary="true" v-loading="loading"
|
|
|
:height="300" class="page-table" element-loading-text="loading..." :header-cell-style="{'background-color':'#F4F6F8','border-right':'1px solid #dfdcdc','color':'#92A2B5'}" border>
|
|
|
- <Column v-for="(label, index) in getHeader(data.productionAreaColStatistics)" :label="label" :prop="index" :fixed="index === 0? 'left' : false"/>
|
|
|
+ <Column v-for="(label, index) in getHeader(data.productionAreaColStatistics)" :label="label" :prop="String(index)" :fixed="index === 0? 'left' : false"/>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<h2>{{ data.deliveryMonthColStatisticsTitle }}</h2>
|
|
|
<el-table :data="getBody(data.deliveryMonthColStatistics)" :summary-method="() => getFooter(data.deliveryMonthColStatistics)" :show-summary="true" v-loading="loading"
|
|
|
:height="300" class="page-table" element-loading-text="loading..." :header-cell-style="{'background-color':'#F4F6F8','border-right':'1px solid #dfdcdc','color':'#92A2B5'}" border>
|
|
|
- <Column v-for="(label, index) in getHeader(data.deliveryMonthColStatistics)" :label="label" :prop="index" :fixed="index === 0? 'left' : false"/>
|
|
|
+ <Column v-for="(label, index) in getHeader(data.deliveryMonthColStatistics)" :label="label" :prop="String(index)" :fixed="index === 0? 'left' : false"/>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -75,7 +76,7 @@
|
|
|
<h2>{{ data.productionMonthColStatisticsTitle }}</h2>
|
|
|
<el-table :data="getBody(data.productionMonthColStatistics)" :summary-method="() => getFooter(data.productionMonthColStatistics)" :show-summary="true" v-loading="loading"
|
|
|
:height="300" class="page-table" element-loading-text="loading..." :header-cell-style="{'background-color':'#F4F6F8','border-right':'1px solid #dfdcdc','color':'#92A2B5'}" border>
|
|
|
- <Column v-for="(label, index) in getHeader(data.productionMonthColStatistics)" :label="label" :prop="index" :fixed="index === 0? 'left' : false"/>
|
|
|
+ <Column v-for="(label, index) in getHeader(data.productionMonthColStatistics)" :label="label" :prop="String(index)" :fixed="index === 0? 'left' : false"/>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -88,6 +89,11 @@
|
|
|
import {contractSigningStatistic} from "@/api/contract/contract.js";
|
|
|
import moment from "moment";
|
|
|
|
|
|
+moment.updateLocale('en', { week: {
|
|
|
+ dow: 6, // First day of week is Saturday
|
|
|
+ doy: 12 // First week of year must contain 1 January (7 + 6 - 1)
|
|
|
+}})
|
|
|
+
|
|
|
export default {
|
|
|
name: "ContractSigningStatistic",
|
|
|
data() {
|
|
@@ -109,6 +115,15 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.handleWeekChange(moment().startOf('week').format('YYYY-MM-DD'))
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ weekValue(){
|
|
|
+ const currentDate = moment(this.queryParams.weekData).locale('en')
|
|
|
+ const weekYear = currentDate.weekYear();
|
|
|
+ const weekNumber = currentDate.week();
|
|
|
+ return `${weekYear} 第 ${weekNumber} 周`
|
|
|
+ }
|
|
|
},
|
|
|
methods:{
|
|
|
handleWeekChange(val){
|
|
@@ -116,7 +131,6 @@ export default {
|
|
|
this.queryParams.weekData = date.format('YYYY-MM-DD')
|
|
|
this.queryParams.beginTime = date.add(-1, 'days').format('YYYY-MM-DD')
|
|
|
this.queryParams.endTime = date.add(6, 'days').format('YYYY-MM-DD')
|
|
|
- this.getList()
|
|
|
},
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -145,7 +159,10 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
getHeader(list){
|
|
|
- return list[0] || []
|
|
|
+ if (!list || list.length < 3) {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ return list[0]
|
|
|
},
|
|
|
getBody(list, footerOffset = 1){
|
|
|
if (!list || list.length < 3) {
|
|
@@ -154,7 +171,7 @@ export default {
|
|
|
return list.slice(1, list.length - footerOffset)
|
|
|
},
|
|
|
getFooter(list, footerOffset = 1){
|
|
|
- if (!list || list.length === 0) {
|
|
|
+ if (!list || list.length < 3) {
|
|
|
return []
|
|
|
}
|
|
|
return list[list.length - 1] || []
|