feat:增加项目审核状态

This commit is contained in:
lixg
2022-11-22 20:43:02 +08:00
parent ed3d2f4627
commit 66fc7c8c13
10 changed files with 600 additions and 540 deletions

View File

@@ -307,6 +307,10 @@
@change="classificationChange4"
placeholder="请选择培训分类"
:disabled="viewDetail ? true : false"
:fieldNames="{
label: 'dictName',
value: 'dictCode',
}"
/>
</div>
</div>
@@ -420,153 +424,17 @@ export default {
const store = useStore();
// 编辑页面跳转过来时候,自动填充表格
const routers = useRoute();
const isEdit = ref(false);
let peojectID = "";
console.log("store.state.orgtreeList", store.state.orgtreeList);
if (routers.query.projectId) {
storage.set("projectAddId", routers.query.projectId);
isEdit.value = true;
peojectID = routers.query.projectId;
// 需要编辑
api
.getProjectDetail({ projectId: routers.query.projectId })
.then((res) => {
if (res.status == 200 && res.data.code == 200) {
let info = res.data.data.projectInfo;
console.log(info);
// projectName classifySelect imageUrl * classifySelect1 * remark checked classifySelect3 classifySelect4 changeChecked1 *
projectName.value = info.name;
state.classifySelect = classifyList.value[1]; // info.category
imageUrl.value = info.picUrl;
let start = toDate(info.beginTime / 1000, "YYYY/MM/DD");
let end = toDate(info.endTime / 1000, "YYYY/MM/DD");
state.rangevalue = [
dayjs(start, "YYYY/MM/DD"),
dayjs(end, "YYYY/MM/DD"),
];
let manageName = info.manager.split(",");
let manageValue = info.managerId.split(",");
let optionsManage = [];
for (let i = 0; i < manageName.length; i++) {
let obj = {
label: manageName[i],
value: manageValue[i],
};
optionsManage.push(obj);
}
console.log(optionsManage);
state.classifySelect1 = optionsManage;
state.classifySelect2 =
classifyList2.value[info.sourceBelongId - 1];
remark.value = info.remark;
state.checked = info.boeFlag ? info.boeFlag : false;
state.classifySelect3 = classifyList3.value[info.level];
state.classifySelect4 = classifyList4.value[info.systemId - 1];
state.checked1 = info.boeFlag ? info.boeFlag : false;
// fileList1.value = info.attach.split(",");
projectType = 1;
picUrl = info.picUrl;
beginTime = Number(info.beginTime / 1000);
endTime = Number(info.endTime / 1000);
manager = info.manager;
managerId = info.managerId;
sourceBelongIdC = Number(info.sourceBelongId);
courseSyncFlag = info.courseSyncFlag;
levels = info.level;
systemid = info.systemId;
boeFlag = info.boeFlag;
}
})
.catch((err) => {
console.log(err);
});
} else {
if (storage.get("projectAddId")) {
isEdit.value = true;
peojectID = storage.get("projectAddId");
// 需要编辑
api
.getProjectDetail({ projectId: storage.get("projectAddId") })
.then((res) => {
if (res.status == 200 && res.data.code == 200) {
let info = res.data.data.projectInfo;
console.log("我是从本地存储获取的id", info);
projectName.value = info.name;
state.classifySelect = classifyList.value[1]; // info.category
imageUrl.value = info.picUrl;
let start = toDate(info.beginTime / 1000, "YYYY/MM/DD");
let end = toDate(info.endTime / 1000, "YYYY/MM/DD");
state.rangevalue = [
dayjs(start, "YYYY/MM/DD"),
dayjs(end, "YYYY/MM/DD"),
];
let manageName = info.manager.split(",");
let manageValue = info.managerId.split(",");
let optionsManage = [];
for (let i = 0; i < manageName.length; i++) {
let obj = {
label: manageName[i],
value: manageValue[i],
};
optionsManage.push(obj);
}
console.log(optionsManage);
state.classifySelect1 = optionsManage;
state.classifySelect2 =
classifyList2.value[info.sourceBelongId - 1];
remark.value = info.remark;
state.checked = info.boeFlag ? info.boeFlag : false;
state.classifySelect3 = classifyList3.value[info.level];
state.classifySelect4 = classifyList4.value[info.systemId - 1];
state.checked1 = info.boeFlag ? info.boeFlag : false;
projectType = 1;
picUrl = info.picUrl;
beginTime = Number(info.beginTime / 1000);
endTime = Number(info.endTime / 1000);
manager = info.manager;
managerId = info.managerId;
sourceBelongIdC = Number(info.sourceBelongId);
courseSyncFlag = info.courseSyncFlag;
levels = info.level;
systemid = info.systemId;
boeFlag = info.boeFlag;
}
})
.catch((err) => {
console.log(err);
});
}
}
const backPage = () => {
storage.remove("projectAddId");
setTimeout(() => {
router.push({
path: "/projectmanage",
});
}, 400);
};
const router = useRouter();
const state = reactive({
classifySelect: null,
classifySelectId: null,
checked: false,
checked1: false,
valueE: null,
valueE1: null,
valueE2: null,
classifySelect1: [],
classifySelect2: null,
classifySelect3: [],
classifySelect4: [],
rangevalue: [],
classifySelect: null, //分类选择信息
projectType: null, //分类选择的id
checked: false, //同步学习记录
checked1: false, //BOEU实施
classifySelect1: [], //选中项目经理名称数组
classifySelect2: null, //选中的资源归属信息
classifySelect3: null, //选中的项目级别信息
classifySelect4: null, //选中的培训分类信息
rangevalue: [], //项目时间
currentPage: 1, //当前页
tableDataTotal: -1, //模版列表总数
@@ -574,10 +442,21 @@ export default {
totalPages: 0, //总页数
viewDetail: routers.query.viewDetail ? routers.query.viewDetail : null,
});
const projectName = ref("");
//分类
//分类列表
const classifyList = ref([]);
//项目封面
const imageUrl = ref("");
// 项目级别
const classifyList3 = ref([
// { value: 1, label: "集团级" },
]);
// 培训分类
const classifyList4 = ref([
// { value: 1, label: "集团级" },
]);
//获取分类、封面图、项目级别、培训分类-----------字典配置-------------------------------
const getDictList = (param) => {
let obj = {
pageNo: 1,
@@ -595,11 +474,15 @@ export default {
if (param === "projectPic") {
if (res.data.data.rows.length > 0) {
imageUrl.value = res.data.data.rows[0].dictValue;
picUrl = res.data.data.rows[0].dictValue;
}
}
if (param === "projectLevel") {
classifyList3.value = res.data.data.rows;
}
if (param === "projectSys") {
classifyList4.value = res.data.data.rows;
}
}
})
.catch((err) => {
@@ -609,11 +492,164 @@ export default {
getDictList("projectClass");
getDictList("projectPic");
getDictList("projectLevel");
getDictList("projectSys");
//获取分类、封面图、项目级别、培训分类---------------字典配置---------------------------
let projectType = "";
const isEdit = ref(false);
let peojectID = ""; //项目id
console.log("store.state.orgtreeList", store.state.orgtreeList);
const editProject = () => {
if (routers.query.projectId) {
storage.set("projectAddId", routers.query.projectId);
isEdit.value = true;
peojectID = routers.query.projectId;
// 需要编辑
api
.getProjectDetail({ projectId: routers.query.projectId })
.then((res) => {
if (res.status == 200 && res.data.code == 200) {
let info = res.data.data.projectInfo;
console.log(
"classifyList.value.find(item=>item.dictCode===info.category)",
classifyList.value.find((item) => {
if (item.dictCode == 11) {
return item.dictName;
}
// return item.dictName;
}),
classifyList.value,
info.category
);
console.log(info);
// projectName classifySelect imageUrl * classifySelect1 * remark checked classifySelect3 classifySelect4 changeChecked1 *
projectName.value = info.name; //项目名称
// state.classifySelect =classifyList.value.find(item=>item.dictCode===info.category) ; // info.category 项目分类
state.projectType = 1; //分类选择的id
imageUrl.value = info.picUrl; //封面图
let start = toDate(info.beginTime / 1000, "YYYY/MM/DD"); //开始时间
let end = toDate(info.endTime / 1000, "YYYY/MM/DD"); //结束时间
state.rangevalue = [
dayjs(start, "YYYY/MM/DD"),
dayjs(end, "YYYY/MM/DD"),
];
let manageName = info.manager.split(","); //项目经理
let manageValue = info.managerId.split(","); //项目经理id数组
let optionsManage = [];
for (let i = 0; i < manageName.length; i++) {
let obj = {
label: manageName[i],
value: manageValue[i],
};
optionsManage.push(obj);
}
console.log(optionsManage);
state.classifySelect1 = optionsManage;
state.classifySelect2 =
classifyList2.value[info.sourceBelongId - 1];
remark.value = info.remark;
state.checked = info.boeFlag ? info.boeFlag : false;
state.classifySelect3 = classifyList3.value[info.level];
state.classifySelect4 = classifyList4.value[info.systemId - 1];
state.checked1 = info.boeFlag ? info.boeFlag : false;
// fileList1.value = info.attach.split(",");
picUrl = info.picUrl;
beginTime = Number(info.beginTime / 1000);
endTime = Number(info.endTime / 1000);
manager = info.manager;
managerId = info.managerId;
sourceBelongIdC = Number(info.sourceBelongId);
courseSyncFlag = info.courseSyncFlag;
levels = info.level;
systemid = info.systemId;
boeFlag = info.boeFlag;
}
})
.catch((err) => {
console.log(err);
});
} else {
if (storage.get("projectAddId")) {
isEdit.value = true;
peojectID = storage.get("projectAddId");
// 需要编辑
api
.getProjectDetail({ projectId: storage.get("projectAddId") })
.then((res) => {
if (res.status == 200 && res.data.code == 200) {
let info = res.data.data.projectInfo;
console.log("我是从本地存储获取的id", info);
projectName.value = info.name;
state.classifySelect = classifyList.value[1]; // info.category 分类选择的信息
state.projectType = 1; //分类选择的id
imageUrl.value = info.picUrl;
let start = toDate(info.beginTime / 1000, "YYYY/MM/DD");
let end = toDate(info.endTime / 1000, "YYYY/MM/DD");
state.rangevalue = [
dayjs(start, "YYYY/MM/DD"),
dayjs(end, "YYYY/MM/DD"),
];
let manageName = info.manager.split(",");
let manageValue = info.managerId.split(",");
let optionsManage = [];
for (let i = 0; i < manageName.length; i++) {
let obj = {
label: manageName[i],
value: manageValue[i],
};
optionsManage.push(obj);
}
console.log(optionsManage);
state.classifySelect1 = optionsManage;
state.classifySelect2 =
classifyList2.value[info.sourceBelongId - 1];
remark.value = info.remark;
state.checked = info.boeFlag ? info.boeFlag : false;
state.classifySelect3 = classifyList3.value[info.level];
state.classifySelect4 = classifyList4.value[info.systemId - 1];
state.checked1 = info.boeFlag ? info.boeFlag : false;
picUrl = info.picUrl;
beginTime = Number(info.beginTime / 1000);
endTime = Number(info.endTime / 1000);
manager = info.manager;
managerId = info.managerId;
sourceBelongIdC = Number(info.sourceBelongId);
courseSyncFlag = info.courseSyncFlag;
levels = info.level;
systemid = info.systemId;
boeFlag = info.boeFlag;
}
})
.catch((err) => {
console.log(err);
});
}
}
};
editProject();
const backPage = () => {
storage.remove("projectAddId");
setTimeout(() => {
router.push({
path: "/projectmanage",
});
}, 400);
};
const projectName = ref(""); //项目名称
//选择分类
const classificationChange = (value) => {
console.log(`selected ${value}`);
projectType = value;
state.projectType = value; //分类选择的id
};
function getBase64(img, callback) {
@@ -625,8 +661,8 @@ export default {
const fileList = ref([]);
const fileList1 = ref([]);
const loading = ref(false);
const imageUrl = ref("");
let picUrl = "";
let picUrl = ""; //项目封面
const handleChange = (info) => {
if (info.file.status === "uploading") {
@@ -727,7 +763,6 @@ export default {
beginTime = new Date(dateString[0]).getTime() / 1000;
endTime = new Date(dateString[1]).getTime() / 1000;
};
// 项目经理 后续接口调用
const classifyList1 = ref([
{ value: 1, label: "李俊国" },
@@ -735,6 +770,7 @@ export default {
{ value: 3, label: "刘孟君" },
]);
//选择处理项目经理
let manager = "";
let managerId = "";
const classificationChange1 = (key, options) => {
@@ -774,28 +810,14 @@ export default {
sourceBelongIdC = key;
};
// 项目级别
const classifyList3 = ref([
// { value: 1, label: "集团级" },
// { value: 2, label: "组织级" },
// { value: 3, label: "现地级" },
// { value: 4, label: "部门级" },
]);
//选择项目级别
let levels = "";
const classificationChange3 = (key) => {
console.log(`selected ${key}`, classifyList3);
levels = key;
};
// 培训分类
const classifyList4 = ref([
{ value: 1, label: "集团级" },
{ value: 2, label: "组织级" },
{ value: 3, label: "现地级" },
{ value: 4, label: "部门级" },
]);
//选择培训分类
let systemid = "";
const classificationChange4 = (key) => {
console.log(`selected ${key}`, classifyList4);
@@ -824,7 +846,9 @@ export default {
console.log(info);
// projectName classifySelect imageUrl * classifySelect1 * remark checked classifySelect3 classifySelect4 changeChecked1 *
projectName.value = info.name;
state.classifySelect = classifyList.value[1]; // info.category
state.classifySelect = classifyList.value[1]; // info.category 分类选择的信息
state.projectType = 1; //分类选择的id
imageUrl.value = info.picUrl;
let start = toDate(info.beginTime / 1000, "YYYY/MM/DD");
@@ -855,7 +879,6 @@ export default {
state.checked1 = info.boeFlag ? info.boeFlag : false;
// fileList1.value = info.attach.split(",");
projectType = 1;
picUrl = info.picUrl;
beginTime = Number(info.beginTime / 1000);
endTime = Number(info.endTime / 1000);
@@ -924,19 +947,22 @@ export default {
// 项目说明
const remark = ref("");
//同步学习记录------------------------------------
let courseSyncFlag = 0;
const changeChecked = () => {
console.log(state.checked);
state.checked ? (state.checked = false) : (state.checked = true);
courseSyncFlag = state.checked ? 1 : 0;
};
//同步学习记录------------------------------------
//BOEU实施--------------------------------------
let boeFlag = 0;
const changeChecked1 = () => {
console.log(state.checked1);
state.checked1 ? (state.checked1 = false) : (state.checked1 = true);
boeFlag = state.checked1 ? 1 : 0;
};
//BOEU实施--------------------------------------
const removeFile = (file) => {
const index = fileList1.value.indexOf(file);
@@ -980,7 +1006,7 @@ export default {
let obj = {
projectId: Number(peojectID),
name: projectName["value"],
category: projectType,
category: state.projectType, //分类选择的id
picUrl: picUrl,
beginTime: beginTime,
endTime: endTime,
@@ -1037,7 +1063,7 @@ export default {
} else {
let obj = {
name: projectName["value"],
category: projectType,
category: state.projectType, //分类选择的id
picUrl: picUrl,
beginTime: beginTime,
endTime: endTime,