|
@@ -68,6 +68,7 @@
|
|
|
import mainApi from '~api/static/plan.js'
|
|
|
import {getObjValue,getArrValue} from "js-fast-way"
|
|
|
import { getdepartmentList,getuserList} from "~api/other";
|
|
|
+ import {getDiffYear} from "~uti/tools";
|
|
|
|
|
|
onMounted(()=>{
|
|
|
getDepartmentDict()
|
|
@@ -89,12 +90,21 @@
|
|
|
])
|
|
|
//搜索
|
|
|
const searchClick = () => {
|
|
|
- searchForm.value.current = 1;
|
|
|
+
|
|
|
console.log(searchForm.value)
|
|
|
|
|
|
let start=searchForm.value.start
|
|
|
let end=searchForm.value.end
|
|
|
- console.log(end-start);
|
|
|
+ let year=getDiffYear(start,end)
|
|
|
+ if(year>=1){
|
|
|
+ window.$message.warning('选择间隔日期不能超过一年')
|
|
|
+ }else{
|
|
|
+ getImageData()
|
|
|
+ planFinishedRatio()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//重置
|
|
@@ -102,6 +112,8 @@ const resetClick = () => {
|
|
|
searchForm.value = {
|
|
|
deptId:null,userId:null
|
|
|
}
|
|
|
+ getImageData()
|
|
|
+ planFinishedRatio()
|
|
|
}
|
|
|
//计划统计图
|
|
|
const planDatas = ref([])
|
|
@@ -124,7 +136,9 @@ const slegend=ref( ['风险暂停计划', '正常计划',])
|
|
|
|
|
|
//项目图表数据
|
|
|
const getImageData = async () => {
|
|
|
- const {error, code, data} = await mainApi.MonthOfYearPlanOverview2()
|
|
|
+ const {error, code, data} = await mainApi.MonthOfYearPlanOverview2(
|
|
|
+ { ...searchForm.value}
|
|
|
+ )
|
|
|
//判断状态
|
|
|
if (!error && code === 200) {
|
|
|
planDatas.value=data['dataList']
|
|
@@ -138,7 +152,9 @@ const getImageData = async () => {
|
|
|
}
|
|
|
//任务完成率
|
|
|
const planFinishedRatio = async () => {
|
|
|
- const {error, code, data} = await mainApi.planFinishedRatio()
|
|
|
+ const {error, code, data} = await mainApi.planFinishedRatio(
|
|
|
+ { ...searchForm.value}
|
|
|
+ )
|
|
|
//判断状态
|
|
|
if (!error && code === 200) {
|
|
|
let image=getObjValue(data)
|