|
|
@@ -51,7 +51,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="履职周期">
|
|
|
<el-select
|
|
|
- v-model="queryParams.planCycle"
|
|
|
+ v-model="queryParams.executeCycle"
|
|
|
placeHolder="请选择履职周期"
|
|
|
clearable
|
|
|
@change="changeType($event)"
|
|
|
@@ -82,7 +82,7 @@
|
|
|
class="searchTitle"
|
|
|
label="计划时间"
|
|
|
v-if="
|
|
|
- queryParams.executeCycle == 1 || queryParams.executeCycle == 0
|
|
|
+ queryParams.executeCycle == 1 || queryParams.executeCycle == 2 || queryParams.executeCycle == null
|
|
|
"
|
|
|
>
|
|
|
<DataRangePicker
|
|
|
@@ -95,7 +95,7 @@
|
|
|
<el-form-item
|
|
|
class="searchTitle"
|
|
|
label="计划时间"
|
|
|
- v-if="queryParams.executeCycle == 2"
|
|
|
+ v-if="queryParams.executeCycle == 3"
|
|
|
>
|
|
|
<!-- :format='weekStart+" 到 "+weekEnd+ 第WW周' format=" yyyy 第 WW 周"-->
|
|
|
<el-date-picker
|
|
|
@@ -114,7 +114,7 @@
|
|
|
<el-form-item
|
|
|
class="searchTitle"
|
|
|
label="计划时间"
|
|
|
- v-if="queryParams.executeCycle == 3"
|
|
|
+ v-if="queryParams.executeCycle == 4"
|
|
|
>
|
|
|
<el-date-picker
|
|
|
v-model="monthRange"
|
|
|
@@ -133,7 +133,7 @@
|
|
|
<el-form-item
|
|
|
class="searchTitle"
|
|
|
label="计划时间"
|
|
|
- v-if="queryParams.executeCycle == 4"
|
|
|
+ v-if="queryParams.executeCycle == 5"
|
|
|
>
|
|
|
<el-date-picker
|
|
|
:clearable="timeClearable"
|
|
|
@@ -177,7 +177,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="计划时间" v-if="queryParams.executeCycle == 5">
|
|
|
+ <el-form-item label="计划时间" v-if="queryParams.executeCycle == 6">
|
|
|
<el-date-picker
|
|
|
:clearable="timeClearable"
|
|
|
type="year"
|
|
|
@@ -223,7 +223,7 @@
|
|
|
<el-form-item
|
|
|
class="searchTitle"
|
|
|
label="计划时间"
|
|
|
- v-if="queryParams.executeCycle == 6"
|
|
|
+ v-if="queryParams.executeCycle == 7"
|
|
|
>
|
|
|
<el-date-picker
|
|
|
:clearable="timeClearable"
|
|
|
@@ -280,8 +280,7 @@
|
|
|
</el-row>
|
|
|
<el-table v-loading="loading" :data="pageData">
|
|
|
<el-table-column
|
|
|
- prop="order"
|
|
|
- label="序号"
|
|
|
+ type="index"
|
|
|
min-width="4%"
|
|
|
v-if="columns[0].visible"
|
|
|
>
|
|
|
@@ -368,7 +367,9 @@
|
|
|
v-if="columns[9].visible"
|
|
|
>
|
|
|
<template slot-scope="r">
|
|
|
- {{ getLabel(dict.type.resumtipn_status, r.row.status) }}
|
|
|
+ <label :style="statusStyle(r.row.status)">
|
|
|
+ {{ getLabel(dict.type.resumption_status, r.row.status) }}</label
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" min-width="13%">
|
|
|
@@ -419,43 +420,43 @@ export default {
|
|
|
dicts: ["plan_cycle", "resumption_status"],
|
|
|
components: { DialogDetail, DialogScanRecord, DataRangePicker, OrgTree },
|
|
|
data() {
|
|
|
- const { params, query } = this.$route;
|
|
|
+ // const { params, query } = this.$route;
|
|
|
let sDate = new Date();
|
|
|
let eDate = new Date();
|
|
|
- if (query.startDate != undefined) {
|
|
|
- sDate = new Date(query.startDate);
|
|
|
- }
|
|
|
- if (query.endDate != undefined) {
|
|
|
- eDate = new Date(query.endDate);
|
|
|
- }
|
|
|
- let tempType = 0;
|
|
|
- let tempOrgId = 1;
|
|
|
- let tempRole = null;
|
|
|
- let tempstatus = null;
|
|
|
- if (query.executeCycle != undefined) tempType = query.executeCycle;
|
|
|
- if (query.orgId != undefined) tempOrgId = parseInt(query.orgId);
|
|
|
- else {
|
|
|
- if (
|
|
|
- this.loginUser != undefined &&
|
|
|
- this.loginUser.org != undefined &&
|
|
|
- this.loginUser.org.id != undefined
|
|
|
- )
|
|
|
- tempOrgId = parseInt(this.loginUser.org.id);
|
|
|
- }
|
|
|
- if (query.executeRole != undefined && query.executeRole != "all")
|
|
|
- tempRole = query.executeRole;
|
|
|
- if (query.status != undefined && query.status != "all")
|
|
|
- tempstatus = query.status;
|
|
|
+ // if (query.startDate != undefined) {
|
|
|
+ // sDate = new Date(query.startDate);
|
|
|
+ // }
|
|
|
+ // if (query.endDate != undefined) {
|
|
|
+ // eDate = new Date(query.endDate);
|
|
|
+ // }
|
|
|
+ // let tempType = 1;
|
|
|
+ // let tempOrgId = 1;
|
|
|
+ // let tempRole = null;
|
|
|
+ // let tempstatus = null;
|
|
|
+ // if (query.executeCycle != undefined) tempType = query.executeCycle;
|
|
|
+ // if (query.orgId != undefined) tempOrgId = parseInt(query.orgId);
|
|
|
+ // else {
|
|
|
+ // if (
|
|
|
+ // this.loginUser != undefined &&
|
|
|
+ // this.loginUser.org != undefined &&
|
|
|
+ // this.loginUser.org.id != undefined
|
|
|
+ // )
|
|
|
+ // tempOrgId = parseInt(this.loginUser.org.id);
|
|
|
+ // }
|
|
|
+ // if (query.executeRole != undefined && query.executeRole != "all")
|
|
|
+ // tempRole = query.executeRole;
|
|
|
+ // if (query.status != undefined && query.status != "all")
|
|
|
+ // tempstatus = query.status;
|
|
|
|
|
|
let temphalfyearE = 1;
|
|
|
let temphalfyearS = 1;
|
|
|
let tempquarterE = 1;
|
|
|
let tempquarterS = 1;
|
|
|
|
|
|
- if (query.halfyearE != undefined) temphalfyearE = parseInt(query.halfyearE);
|
|
|
- if (query.halfyearS != undefined) temphalfyearS = parseInt(query.halfyearS);
|
|
|
- if (query.quarterE != undefined) tempquarterE = parseInt(query.quarterE);
|
|
|
- if (query.quarterS != undefined) tempquarterS = parseInt(query.quarterS);
|
|
|
+ // if (query.halfyearE != undefined) temphalfyearE = parseInt(query.halfyearE);
|
|
|
+ // if (query.halfyearS != undefined) temphalfyearS = parseInt(query.halfyearS);
|
|
|
+ // if (query.quarterE != undefined) tempquarterE = parseInt(query.quarterE);
|
|
|
+ // if (query.quarterS != undefined) tempquarterS = parseInt(query.quarterS);
|
|
|
return {
|
|
|
loading: false,
|
|
|
showSearch: true,
|
|
|
@@ -464,8 +465,6 @@ export default {
|
|
|
options: [],
|
|
|
roleList: [],
|
|
|
planList: [],
|
|
|
- roleVal: tempRole == null ? "all" : tempRole,
|
|
|
- statusVal: tempstatus == null ? "all" : tempstatus,
|
|
|
yearS: sDate,
|
|
|
yearE: eDate,
|
|
|
halfyearE: temphalfyearE,
|
|
|
@@ -497,12 +496,12 @@ export default {
|
|
|
{ key: "4", value: 4, text: "第四季度" },
|
|
|
],
|
|
|
queryParams: {
|
|
|
- executeCycle: tempType,
|
|
|
+ executeCycle: "1",
|
|
|
checkSub: false,
|
|
|
- orgId: tempOrgId,
|
|
|
+ orgId: null,
|
|
|
range: [sDate, eDate],
|
|
|
- executeRole: tempRole,
|
|
|
- status: tempstatus,
|
|
|
+ executeRole: null,
|
|
|
+ status: null,
|
|
|
planId: null,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
@@ -525,30 +524,25 @@ export default {
|
|
|
},
|
|
|
props: {},
|
|
|
watch: {
|
|
|
- org: {
|
|
|
- deep: true,
|
|
|
- immediate: true,
|
|
|
- handler(nOrg) {
|
|
|
- if (nOrg.id) {
|
|
|
- this.queryParams.orgId = nOrg.id;
|
|
|
- } else {
|
|
|
- this.queryParams.orgId = this.loginUser.org.id;
|
|
|
- }
|
|
|
- this.roleVal = "all";
|
|
|
- this.planVal = -1;
|
|
|
- this.loadRoles(this.queryParams.orgId);
|
|
|
- },
|
|
|
- },
|
|
|
+ // org: {
|
|
|
+ // deep: true,
|
|
|
+ // immediate: true,
|
|
|
+ // handler(nOrg) {
|
|
|
+ // if (nOrg.id) {
|
|
|
+ // this.queryParams.orgId = nOrg.id;
|
|
|
+ // } else {
|
|
|
+ // this.queryParams.orgId = this.loginUser.org.id;
|
|
|
+ // }
|
|
|
+ // this.roleVal = "all";
|
|
|
+ // this.planVal = -1;
|
|
|
+ // this.loadRoles(this.queryParams.orgId);
|
|
|
+ // },
|
|
|
+ // },
|
|
|
statusVal(value) {
|
|
|
if (value == undefined) return;
|
|
|
if (value == "all") this.queryParams.status = null;
|
|
|
else this.queryParams.status = value;
|
|
|
},
|
|
|
- roleVal(value) {
|
|
|
- if (value == undefined) return;
|
|
|
- if (value == "all") this.queryParams.executeRole = null;
|
|
|
- else this.queryParams.executeRole = value;
|
|
|
- },
|
|
|
planVal(value) {
|
|
|
if (value == undefined) return;
|
|
|
if (value == -1) this.queryParams.planId = null;
|
|
|
@@ -624,7 +618,7 @@ export default {
|
|
|
getLabel,
|
|
|
toName(row) {
|
|
|
// const ymd = row.ymd;
|
|
|
- const ymd = this.$moment(row.ymdDate);
|
|
|
+ const ymd = new Date(row.ymdDate);
|
|
|
switch (row.executeCycle) {
|
|
|
case 0:
|
|
|
return `${ymd.year}年${ymd.month}月${ymd.day}日-${row.formTypeText}`;
|
|
|
@@ -666,15 +660,20 @@ export default {
|
|
|
getDefaultKey(key) {
|
|
|
this.queryParams.orgId = key;
|
|
|
this.getList();
|
|
|
+ this.loadRoles(key);
|
|
|
+ this.loadPlanList();
|
|
|
},
|
|
|
//单选框状态改变
|
|
|
checkChange(state) {
|
|
|
this.queryParams.checkSub = state;
|
|
|
+
|
|
|
this.getList();
|
|
|
},
|
|
|
// 节点单击事件
|
|
|
clickTreeNode(data) {
|
|
|
this.queryParams.orgId = data.id;
|
|
|
+ this.loadPlanList();
|
|
|
+ this.loadRoles();
|
|
|
this.getList();
|
|
|
},
|
|
|
resetQuery() {
|
|
|
@@ -688,7 +687,7 @@ export default {
|
|
|
this.loading = true;
|
|
|
console.log("this.queryParams", this.queryParams);
|
|
|
api
|
|
|
- .list(this.queryParams)
|
|
|
+ .page(this.queryParams)
|
|
|
.then((r) => {
|
|
|
this.pageData = r.rows;
|
|
|
this.total = r.total;
|
|
|
@@ -698,11 +697,29 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ loadRoles() {
|
|
|
+ api
|
|
|
+ .getRoles({
|
|
|
+ orgId: this.queryParams.orgId,
|
|
|
+ planCycle: Number(this.queryParams.executeCycle),
|
|
|
+ })
|
|
|
+ .then((r) => (this.roleList = r.data));
|
|
|
+ },
|
|
|
+
|
|
|
+ loadPlanList() {
|
|
|
+ api
|
|
|
+ .getPlans({
|
|
|
+ orgId: this.queryParams.orgId,
|
|
|
+ // checkSub: this.queryParams.checkSub,
|
|
|
+ })
|
|
|
+ .then((r) => {
|
|
|
+ this.planList = r.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
async changeType(selectValue) {
|
|
|
// console.log("selectValue",selectValue.target.value)
|
|
|
- this.roleVal = "all";
|
|
|
- this.planVal = -1;
|
|
|
- this.queryParams.executeCycle = Number(selectValue.target.value);
|
|
|
+ // this.planVal = -1;
|
|
|
+ this.queryParams.executeCycle = selectValue;
|
|
|
|
|
|
let nowDate = new Date();
|
|
|
let nowMonth = nowDate.getMonth();
|
|
|
@@ -727,40 +744,24 @@ export default {
|
|
|
this.halfyearS = 2;
|
|
|
this.halfyearE = 2;
|
|
|
}
|
|
|
- // 0每日;1每周;2每月;3每季度;4每半年;5每年
|
|
|
- if (this.queryParams.executeCycle == 1) {
|
|
|
- if (!this.week) this.week = this.$moment();
|
|
|
- var date = this.$moment(this.week).isoWeekday(1);
|
|
|
- this.weekStart = date.weekday(1).format("YYYY-MM-DD");
|
|
|
- this.weekEnd = date.weekday(7).format("YYYY-MM-DD");
|
|
|
+ // 1每小时;2每天.......;3每月;4每季度;4每半年;5每年
|
|
|
+ if (this.queryParams.executeCycle == 3) {
|
|
|
+ if (!this.week) this.week = new Date();
|
|
|
+
|
|
|
+ let oneDayLong = 24*60*60*1000
|
|
|
+ let c_day = this.week.getDay()
|
|
|
+ let monday=this.week-(c_day==0?6:(c_day-1))*oneDayLong;
|
|
|
+ let sunday=this.week+(c_day==0?0:(7-c_day))*oneDayLong;
|
|
|
+
|
|
|
+ this.weekStart =`${monday.getYear()}-${monday.getMonth()}-${monday.getDate()}`;
|
|
|
+ this.weekEnd = `${sunday.getYear()}-${sunday.getMonth()}-${sunday.getDate()}`;
|
|
|
// this.weekChanged();
|
|
|
}
|
|
|
this.resetRangeParam();
|
|
|
},
|
|
|
|
|
|
- loadRoles(orgId) {
|
|
|
- let tempOrgId = orgId ? orgId : this.loginUser.org.id;
|
|
|
- api
|
|
|
- .getRoles({
|
|
|
- orgId: tempOrgId,
|
|
|
- type: Number(this.queryParams.executeCycle),
|
|
|
- })
|
|
|
- .then((r) => (this.roleList = r.data));
|
|
|
- },
|
|
|
-
|
|
|
- loadPlanList() {
|
|
|
- api
|
|
|
- .getPlans({
|
|
|
- orgId: this.queryParams.orgId,
|
|
|
- checkSub: this.queryParams.checkSub,
|
|
|
- })
|
|
|
- .then((r) => {
|
|
|
- this.planList = r.data;
|
|
|
- });
|
|
|
-
|
|
|
- this.planList = planresult;
|
|
|
- },
|
|
|
weekChanged() {
|
|
|
+
|
|
|
var date = this.$moment(this.week).isoWeekday(1);
|
|
|
this.weekStart = date.weekday(1).format("YYYY-MM-DD");
|
|
|
this.weekEnd = date.weekday(7).format("YYYY-MM-DD");
|
|
|
@@ -769,7 +770,7 @@ export default {
|
|
|
monthChanged() {
|
|
|
this.resetRangeParam();
|
|
|
},
|
|
|
- async resetRangeParam() {
|
|
|
+ async resetRangeParam() {
|
|
|
if (this.queryParams.executeCycle == 3) {
|
|
|
let yearSval = this.yearS.getFullYear();
|
|
|
let yearEval = this.yearE.getFullYear();
|
|
|
@@ -806,7 +807,7 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- this.queryParams.range = [this.$moment(sQDate), this.$moment(eQData)];
|
|
|
+ this.queryParams.range = [new Date(sQDate), new Date(eQData)];
|
|
|
} else if (this.queryParams.executeCycle == 4) {
|
|
|
let yearSval = this.yearS.getFullYear();
|
|
|
let yearEval = this.yearE.getFullYear();
|
|
|
@@ -830,14 +831,14 @@ export default {
|
|
|
eHData += "12-31";
|
|
|
break;
|
|
|
}
|
|
|
- this.queryParams.range = [this.$moment(sHDate), this.$moment(eHData)];
|
|
|
+ this.queryParams.range = [new Date(sHDate), new Date(eHData)];
|
|
|
} else if (this.queryParams.executeCycle == 5) {
|
|
|
let yearSval = this.yearS.getFullYear();
|
|
|
let yearEval = this.yearE.getFullYear();
|
|
|
let sYDate = yearSval + "-01-01";
|
|
|
let eYData = yearEval + "-12-31";
|
|
|
|
|
|
- this.queryParams.range = [this.$moment(sYDate), this.$moment(eYData)];
|
|
|
+ this.queryParams.range = [new Date(sYDate), new Date(eYData)];
|
|
|
} else if (this.queryParams.executeCycle == 2) {
|
|
|
if (!this.monthRange || this.monthRange.length != 2) {
|
|
|
this.queryParams.range = null;
|
|
|
@@ -949,12 +950,12 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- this.queryParams.range = [this.$moment(sMDate), this.$moment(eMData)];
|
|
|
+ this.queryParams.range = [new Date(sMDate), new Date(eMData)];
|
|
|
}
|
|
|
} else if (this.queryParams.executeCycle == 1) {
|
|
|
this.queryParams.range = [
|
|
|
- this.$moment(this.weekStart),
|
|
|
- this.$moment(this.weekEnd),
|
|
|
+ new Date(this.weekStart),
|
|
|
+ new Date(this.weekEnd),
|
|
|
];
|
|
|
} else if (
|
|
|
this.queryParams.executeCycle === 0 ||
|
|
|
@@ -963,19 +964,33 @@ export default {
|
|
|
this.queryParams.range = this.$dateRange.before(0);
|
|
|
}
|
|
|
},
|
|
|
- },
|
|
|
- async mounted() {
|
|
|
- const { params, query } = this.$route;
|
|
|
- if (this.loginUser && this.loginUser.org && this.loginUser.org.id) {
|
|
|
- if (query == undefined || query.orgId == undefined) {
|
|
|
- this.queryParams.orgId = this.loginUser.org.id;
|
|
|
+ statusStyle(status) {
|
|
|
+ let color = "";
|
|
|
+ switch (status) {
|
|
|
+ case "1":
|
|
|
+ color = "#BFBFBF";
|
|
|
+ case "2":
|
|
|
+ color = "1890FF";
|
|
|
+ case "3":
|
|
|
+ color = "52C41A";
|
|
|
+ case "4":
|
|
|
+ color = "F5222D";
|
|
|
}
|
|
|
- }
|
|
|
- this.loadRoles(this.queryParams.orgId);
|
|
|
- await this.loadtypes();
|
|
|
- this.loadPlanList();
|
|
|
|
|
|
- await this.refresh();
|
|
|
+ return "list-style-type:disc;color:" + color;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ async mounted() {
|
|
|
+ // const { params, query } = this.$route;
|
|
|
+ // if (this.loginUser && this.loginUser.org && this.loginUser.org.id) {
|
|
|
+ // if (query == undefined || query.orgId == undefined) {
|
|
|
+ // this.queryParams.orgId = this.loginUser.org.id;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.loadRoles(this.queryParams.orgId);
|
|
|
+ // await this.loadtypes();
|
|
|
+ // this.loadPlanList();
|
|
|
+ // await this.refresh();
|
|
|
},
|
|
|
};
|
|
|
</script>
|