|
@@ -16,7 +16,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
- <div class="inline-16">
|
|
|
+ <div class="inline-16" style="margin-top:0px;margin-bottom: 20px">
|
|
|
<el-button-group>
|
|
|
<el-button size="small" :type="dataParam.content.dateType==1?'primary':''" @click="dataChange(1)" >近一年</el-button>
|
|
|
<el-button size="small" :type="dataParam.content.dateType==2?'primary':''" @click="dataChange(2)">近九个月</el-button>
|
|
@@ -24,6 +24,20 @@
|
|
|
<el-button size="small" :type="dataParam.content.dateType==4?'primary':''" @click="dataChange(4)">近三个月</el-button>
|
|
|
</el-button-group>
|
|
|
</div>
|
|
|
+ <div class="inline-16" style="margin-top:0px;margin-bottom: 20px">
|
|
|
+ <el-date-picker
|
|
|
+ size="small"
|
|
|
+ v-model="dateSelect"
|
|
|
+ @change="dateChange"
|
|
|
+ type="daterange"
|
|
|
+ :clearable="false"
|
|
|
+ format="yyyy-MM-dd"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
<div>
|
|
|
<el-row>
|
|
|
<el-col :xs="15" :sm="15" :md="15" :lg="15" :xl="14">
|
|
@@ -203,6 +217,7 @@ export default {
|
|
|
'dateType':1,
|
|
|
"where": {
|
|
|
"begindate": "",
|
|
|
+ "begdate":"",
|
|
|
"enddate":"",
|
|
|
"departmentid":""
|
|
|
}
|
|
@@ -216,9 +231,14 @@ export default {
|
|
|
"type": '',
|
|
|
"dataid": '',
|
|
|
"dateType": '',
|
|
|
- "sa_projstagemagid":''
|
|
|
+ "sa_projstagemagid":'',
|
|
|
+ "where": {
|
|
|
+ "begdate":"",
|
|
|
+ "enddate":"",
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ dateSelect:[]
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -303,6 +323,60 @@ export default {
|
|
|
},
|
|
|
dataChange(val){
|
|
|
this.dataParam.content.dateType = val
|
|
|
+ this.projectParam.content.dateType = val
|
|
|
+ if (val == '1'){
|
|
|
+ let currentDate = new Date(); // 获取当前日期
|
|
|
+ let startDate = new Date(currentDate.getFullYear() - 1, currentDate.getMonth(), currentDate.getDate() + 1); // 计算起始日期
|
|
|
+ let endDate = currentDate; // 结束日期为当前日期
|
|
|
+ this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
|
|
|
+ }else if (val == '2'){
|
|
|
+ let currentDate = new Date(); // 获取当前日期
|
|
|
+ let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 8, currentDate.getDate() + 1); // 计算起始日期
|
|
|
+ let endDate = currentDate; // 结束日期为当前日期
|
|
|
+ this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
|
|
|
+ }else if (val == '3'){
|
|
|
+ let currentDate = new Date(); // 获取当前日期
|
|
|
+ let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 5, currentDate.getDate() + 1); // 计算起始日期
|
|
|
+ let endDate = currentDate; // 结束日期为当前日期
|
|
|
+ this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
|
|
|
+ }else if (val == '4'){
|
|
|
+ let currentDate = new Date(); // 获取当前日期
|
|
|
+ let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 2, currentDate.getDate() + 1); // 计算起始日期
|
|
|
+ let endDate = currentDate; // 结束日期为当前日期
|
|
|
+ this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
|
|
|
+ }
|
|
|
+ this.getProportionOfFileModel()
|
|
|
+ },
|
|
|
+ dateSet(val){
|
|
|
+ if (val == '1'){
|
|
|
+ let currentDate = new Date(); // 获取当前日期
|
|
|
+ let startDate = new Date(currentDate.getFullYear() - 1, currentDate.getMonth(), currentDate.getDate() + 1); // 计算起始日期
|
|
|
+ let endDate = currentDate; // 结束日期为当前日期
|
|
|
+ this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
|
|
|
+ }else if (val == '2'){
|
|
|
+ let currentDate = new Date(); // 获取当前日期
|
|
|
+ let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 9, currentDate.getDate() + 1); // 计算起始日期
|
|
|
+ let endDate = currentDate; // 结束日期为当前日期
|
|
|
+ this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
|
|
|
+ }else if (val == '3'){
|
|
|
+ let currentDate = new Date(); // 获取当前日期
|
|
|
+ let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 6, currentDate.getDate() + 1); // 计算起始日期
|
|
|
+ let endDate = currentDate; // 结束日期为当前日期
|
|
|
+ this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
|
|
|
+ }else if (val == '4'){
|
|
|
+ let currentDate = new Date(); // 获取当前日期
|
|
|
+ let startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 3, currentDate.getDate() + 1); // 计算起始日期
|
|
|
+ let endDate = currentDate; // 结束日期为当前日期
|
|
|
+ this.dateSelect = [startDate.toISOString().split('T')[0],endDate.toISOString().split('T')[0]]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dateChange(){
|
|
|
+ this.dataParam.content.dateType = 0
|
|
|
+ this.dataParam.content.where.begdate = this.dateSelect[0]
|
|
|
+ this.dataParam.content.where.enddate = this.dateSelect[1]
|
|
|
+ this.projectParam.content.dateType = 0
|
|
|
+ this.projectParam.content.where.begdate = this.dateSelect[0]
|
|
|
+ this.projectParam.content.where.enddate = this.dateSelect[1]
|
|
|
this.getProportionOfFileModel()
|
|
|
},
|
|
|
renderPie() {
|
|
@@ -689,7 +763,7 @@ export default {
|
|
|
async getProjectList(){
|
|
|
this.projectParam.content.type = this.dataParam.content.type
|
|
|
this.projectParam.content.dataid = this.dataParam.content.dataid
|
|
|
- this.projectParam.content.dateType = this.dataParam.content.dateType
|
|
|
+ /*this.projectParam.content.dateType = this.dataParam.content.dateType*/
|
|
|
this.projectParam.content.sa_projstagemagid = this.sa_projstagemagid
|
|
|
const res = await this.$api.requested(this.projectParam)
|
|
|
this.projectList = res.data
|
|
@@ -709,6 +783,7 @@ export default {
|
|
|
mounted () {
|
|
|
/* this.renderPie()*/
|
|
|
this.departmentrtment()
|
|
|
+ this.dateSet(1)
|
|
|
},
|
|
|
created() {
|
|
|
this.tablecols = this.tool.tabelCol(this.$route.name).projectTable.tablecols
|