|
@@ -14,7 +14,7 @@
|
|
|
v-model="formSearch.orgId"
|
|
|
placeholder="请选择"
|
|
|
clearable
|
|
|
- @change="searchExamList(formSearch.orgId);"
|
|
|
+ @change="loadExamList(formSearch.orgId);"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in orgList"
|
|
@@ -47,7 +47,8 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
remote
|
|
|
- :remote-method="searchPmList"
|
|
|
+ :disabled="curUserRole.isPM"
|
|
|
+ :remote-method="loadPmList"
|
|
|
>
|
|
|
<el-option label="请选择" value=""></el-option>
|
|
|
<el-option
|
|
@@ -66,7 +67,8 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
remote
|
|
|
- :remote-method="searchSupplierList"
|
|
|
+ :disabled="curUserRole.isSupplier"
|
|
|
+ :remote-method="loadSupplierList"
|
|
|
>
|
|
|
<el-option label="请选择" value=""></el-option>
|
|
|
<el-option
|
|
@@ -327,6 +329,7 @@
|
|
|
import { CORE_API, PRINT_API } from "@/constants/constants";
|
|
|
import { userRole } from "../constants/constants.js";
|
|
|
import { mapState } from "vuex";
|
|
|
+import { checkEmptyStr, checkEmptyNumber, formatGMT } from "../utils/common.js";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -565,7 +568,7 @@ export default {
|
|
|
searchRecords() {
|
|
|
/* 查询记录列表 */
|
|
|
let orgId = this.formSearch.orgId;
|
|
|
- if (this.isEmptyNumber(orgId)) {
|
|
|
+ if (checkEmptyNumber(orgId)) {
|
|
|
this.$notify({
|
|
|
message: "请选择学校!",
|
|
|
type: "warning"
|
|
@@ -574,7 +577,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
let examId = this.formSearch.examId;
|
|
|
- if (this.isEmptyNumber(examId)) {
|
|
|
+ if (checkEmptyNumber(examId)) {
|
|
|
this.$notify({
|
|
|
message: "请选择考试!",
|
|
|
type: "warning"
|
|
@@ -596,29 +599,51 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
- searchExamList(orgId) {
|
|
|
+ selectDefault() {
|
|
|
+ if (this.orgList.length > 0) {
|
|
|
+ let firstOrgId = this.orgList[0].orgId;
|
|
|
+ this.formSearch.orgId = firstOrgId;
|
|
|
+ this.loadExamList(firstOrgId);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ loadOrgList() {
|
|
|
+ /* 查询学校列表 */
|
|
|
+ let url = PRINT_API + "/printing/project/org/list";
|
|
|
+ this.$http.post(url).then(
|
|
|
+ response => {
|
|
|
+ this.orgList = response.data;
|
|
|
+ this.selectDefault();
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ loadExamList(orgId) {
|
|
|
/* 查询考试列表 */
|
|
|
this.formSearch.examId = "";
|
|
|
this.examList = [];
|
|
|
this.tableData = [];
|
|
|
- if (!this.isEmptyNumber(orgId)) {
|
|
|
- let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
|
|
|
- this.$http.post(url).then(response => {
|
|
|
- this.examList = response.data;
|
|
|
- if (this.examList.length > 0) {
|
|
|
- this.formSearch.examId = this.examList[0].examId;
|
|
|
- this.searchRecords();
|
|
|
- }
|
|
|
- });
|
|
|
+ if (checkEmptyNumber(orgId)) {
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
+ let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
|
|
|
+ this.$http.post(url).then(response => {
|
|
|
+ this.examList = response.data;
|
|
|
+ if (this.examList.length > 0) {
|
|
|
+ this.formSearch.examId = this.examList[0].examId;
|
|
|
+ this.searchRecords();
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- searchPmList(query) {
|
|
|
+ loadPmList(query) {
|
|
|
/* 查询项目经理列表 */
|
|
|
this.pmList = [];
|
|
|
let url =
|
|
|
CORE_API + "/user/query?rootOrgCode=qmth&roleCode=PRINT_PROJECT_LEADER";
|
|
|
|
|
|
- if (!this.isEmptyStr(query)) {
|
|
|
+ if (!checkEmptyStr(query)) {
|
|
|
url += "&name=" + query;
|
|
|
}
|
|
|
|
|
@@ -626,13 +651,13 @@ export default {
|
|
|
this.pmList = response.data;
|
|
|
});
|
|
|
},
|
|
|
- searchSupplierList(query) {
|
|
|
+ loadSupplierList(query) {
|
|
|
/* 查询印刷供应商列表 */
|
|
|
this.supplierList = [];
|
|
|
let url =
|
|
|
CORE_API + "/user/query?rootOrgCode=qmth-print&roleCode=PRINT_SUPPLIER";
|
|
|
|
|
|
- if (!this.isEmptyStr(query)) {
|
|
|
+ if (!checkEmptyStr(query)) {
|
|
|
url += "&name=" + query;
|
|
|
}
|
|
|
|
|
@@ -640,6 +665,39 @@ export default {
|
|
|
this.supplierList = response.data;
|
|
|
});
|
|
|
},
|
|
|
+ loadPmInfo(loginUser) {
|
|
|
+ this.pmList = [];
|
|
|
+ this.pmList.push({ id: loginUser.userId, name: loginUser.displayName });
|
|
|
+ },
|
|
|
+ loadSupplierInfo(loginUser) {
|
|
|
+ this.supplierList = [];
|
|
|
+ this.supplierList.push({
|
|
|
+ id: loginUser.userId,
|
|
|
+ name: loginUser.displayName
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectPmName(key) {
|
|
|
+ /* 处理项目经理名称 */
|
|
|
+ if (checkEmptyNumber(key)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let obj = {};
|
|
|
+ obj = this.pmList.find(function(item) {
|
|
|
+ return item.id === key;
|
|
|
+ });
|
|
|
+ this.projectSettingForm.pmName = obj.name;
|
|
|
+ },
|
|
|
+ selectSupplierName(key) {
|
|
|
+ /* 处理供应商名称 */
|
|
|
+ if (checkEmptyNumber(key)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let obj = {};
|
|
|
+ obj = this.supplierList.find(function(item) {
|
|
|
+ return item.id === key;
|
|
|
+ });
|
|
|
+ this.projectSettingForm.supplierName = obj.name;
|
|
|
+ },
|
|
|
gotoProjectStatistic(row) {
|
|
|
/* 查看项目统计 */
|
|
|
let url = "/print/project/statistic/" + row.orgId + "/" + row.examId;
|
|
@@ -655,22 +713,22 @@ export default {
|
|
|
|
|
|
this.selectSupplierName(this.projectSettingForm.supplierId);
|
|
|
|
|
|
- this.projectSettingForm.prepareStartTime = this.formatDateStr(
|
|
|
+ this.projectSettingForm.prepareStartTime = formatGMT(
|
|
|
this.projectSettingForm.prepareStartTime
|
|
|
);
|
|
|
- this.projectSettingForm.prepareEndTime = this.formatDateStr(
|
|
|
+ this.projectSettingForm.prepareEndTime = formatGMT(
|
|
|
this.projectSettingForm.prepareEndTime
|
|
|
);
|
|
|
- this.projectSettingForm.printStartTime = this.formatDateStr(
|
|
|
+ this.projectSettingForm.printStartTime = formatGMT(
|
|
|
this.projectSettingForm.printStartTime
|
|
|
);
|
|
|
- this.projectSettingForm.printEndTime = this.formatDateStr(
|
|
|
+ this.projectSettingForm.printEndTime = formatGMT(
|
|
|
this.projectSettingForm.printEndTime
|
|
|
);
|
|
|
- this.projectSettingForm.mailStartTime = this.formatDateStr(
|
|
|
+ this.projectSettingForm.mailStartTime = formatGMT(
|
|
|
this.projectSettingForm.mailStartTime
|
|
|
);
|
|
|
- this.projectSettingForm.mailEndTime = this.formatDateStr(
|
|
|
+ this.projectSettingForm.mailEndTime = formatGMT(
|
|
|
this.projectSettingForm.mailEndTime
|
|
|
);
|
|
|
|
|
@@ -704,72 +762,30 @@ export default {
|
|
|
this.projectSettingForm.pmName = row.pmName;
|
|
|
this.projectSettingForm.supplierId = row.supplierId;
|
|
|
this.projectSettingForm.supplierName = row.supplierName;
|
|
|
-
|
|
|
- if (row.prepareStartTime) {
|
|
|
- this.projectSettingForm.prepareStartTime = new Date(
|
|
|
- row.prepareStartTime
|
|
|
- );
|
|
|
- } else {
|
|
|
- this.projectSettingForm.prepareStartTime = "";
|
|
|
- }
|
|
|
- if (row.prepareEndTime) {
|
|
|
- this.projectSettingForm.prepareEndTime = new Date(row.prepareEndTime);
|
|
|
- } else {
|
|
|
- this.projectSettingForm.prepareEndTime = "";
|
|
|
- }
|
|
|
- if (row.printStartTime) {
|
|
|
- this.projectSettingForm.printStartTime = new Date(row.printStartTime);
|
|
|
- } else {
|
|
|
- this.projectSettingForm.printStartTime = "";
|
|
|
- }
|
|
|
- if (row.printEndTime) {
|
|
|
- this.projectSettingForm.printEndTime = new Date(row.printEndTime);
|
|
|
- } else {
|
|
|
- this.projectSettingForm.printEndTime = "";
|
|
|
- }
|
|
|
- if (row.mailStartTime) {
|
|
|
- this.projectSettingForm.mailStartTime = new Date(row.mailStartTime);
|
|
|
- } else {
|
|
|
- this.projectSettingForm.mailStartTime = "";
|
|
|
- }
|
|
|
- if (row.mailEndTime) {
|
|
|
- this.projectSettingForm.mailEndTime = new Date(row.mailEndTime);
|
|
|
- } else {
|
|
|
- this.projectSettingForm.mailEndTime = "";
|
|
|
- }
|
|
|
+ this.projectSettingForm.prepareStartTime = this.settingDate(
|
|
|
+ row.prepareStartTime
|
|
|
+ );
|
|
|
+ this.projectSettingForm.prepareEndTime = this.settingDate(
|
|
|
+ row.prepareEndTime
|
|
|
+ );
|
|
|
+ this.projectSettingForm.printStartTime = this.settingDate(
|
|
|
+ row.printStartTime
|
|
|
+ );
|
|
|
+ this.projectSettingForm.printEndTime = this.settingDate(row.printEndTime);
|
|
|
+ this.projectSettingForm.mailStartTime = this.settingDate(
|
|
|
+ row.mailStartTime
|
|
|
+ );
|
|
|
+ this.projectSettingForm.mailEndTime = this.settingDate(row.mailEndTime);
|
|
|
},
|
|
|
closeProjectSettingDialog() {
|
|
|
/* 关闭项目设置弹窗 */
|
|
|
this.projectSettingDialog = false;
|
|
|
},
|
|
|
- selectPmName(key) {
|
|
|
- /* 处理项目经理名称 */
|
|
|
- if (this.isEmptyNumber(key)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- let obj = {};
|
|
|
- obj = this.pmList.find(function(item) {
|
|
|
- return item.id === key;
|
|
|
- });
|
|
|
- this.projectSettingForm.pmName = obj.name;
|
|
|
- },
|
|
|
- selectSupplierName(key) {
|
|
|
- /* 处理供应商名称 */
|
|
|
- if (this.isEmptyNumber(key)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- let obj = {};
|
|
|
- obj = this.supplierList.find(function(item) {
|
|
|
- return item.id === key;
|
|
|
- });
|
|
|
- this.projectSettingForm.supplierName = obj.name;
|
|
|
- },
|
|
|
- selectDefault() {
|
|
|
- if (this.orgList.length > 0) {
|
|
|
- let firstOrgId = this.orgList[0].orgId;
|
|
|
- this.formSearch.orgId = firstOrgId;
|
|
|
- this.searchExamList(firstOrgId);
|
|
|
+ settingDate(dateStr) {
|
|
|
+ if (dateStr) {
|
|
|
+ return new Date(dateStr);
|
|
|
}
|
|
|
+ return "";
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -782,14 +798,16 @@ export default {
|
|
|
|
|
|
if (this.curUserRole.isSuperLeader) {
|
|
|
this.hasPermit = true;
|
|
|
- this.searchPmList();
|
|
|
- this.searchSupplierList();
|
|
|
+ this.loadPmList();
|
|
|
+ this.loadSupplierList();
|
|
|
} else if (this.curUserRole.isPM) {
|
|
|
- this.hasPermit = true;
|
|
|
+ this.hasPermit = false;
|
|
|
this.loadPmInfo(this.user);
|
|
|
+ this.formSearch.pmId = this.user.userId;
|
|
|
} else if (this.curUserRole.isSupplier) {
|
|
|
this.hasPermit = false;
|
|
|
this.loadSupplierInfo(this.user);
|
|
|
+ this.formSearch.supplierId = this.user.userId;
|
|
|
} else {
|
|
|
this.hasPermit = false;
|
|
|
}
|