diff --git a/src/views/projectFront/examSystem/subjectManagement/subjectManagement.vue b/src/views/projectFront/examSystem/subjectManagement/subjectManagement.vue index 57d692e8..e64766d0 100644 --- a/src/views/projectFront/examSystem/subjectManagement/subjectManagement.vue +++ b/src/views/projectFront/examSystem/subjectManagement/subjectManagement.vue @@ -20,14 +20,13 @@ @@ -38,17 +37,11 @@ -
- - - + + +
@@ -81,8 +74,8 @@ export default { subjectName: '科目名称1', parentId: '0', children: [ - { id: '4', subjectName: '子科目名称1', parentId: '1' }, - { id: '5', subjectName: '子科目名称2', parentId: '1' }, + { id: '4', subjectName: '科目名称11', parentId: '1', children: [{id: '10', subjectName: '科目名称111', parentId: '4'}]}, + { id: '5', subjectName: '科目名称21', parentId: '1' }, ], }, { @@ -90,8 +83,8 @@ export default { subjectName: '科目名称2', parentId: '0', children: [ - { id: '6', subjectName: '子科目名称1', parentId: '2' }, - { id: '7', subjectName: '子科目名称2', parentId: '2' }, + { id: '6', subjectName: '科目名称21', parentId: '2' }, + { id: '7', subjectName: '科目名称22', parentId: '2' }, ], }, { @@ -99,8 +92,8 @@ export default { subjectName: '科目名称3', parentId: '0', children: [ - { id: '8', subjectName: '子科目名称1', parentId: '3' }, - { id: '9', subjectName: '子科目名称2', parentId: '3' }, + { id: '8', subjectName: '科目名称31', parentId: '3' }, + { id: '9', subjectName: '科目名称32', parentId: '3' }, ], }, ], @@ -132,7 +125,6 @@ export default { }, radio: 1, uploadShow: false, //导入弹框 - dialogType: 1, title: '', daterange: [], fileList: [], //上传文件 @@ -158,7 +150,8 @@ export default { }, subjectInfo: { subjectName: '', - parentId: '0' + parentId: '0', + opType: '' }, principalLsit: [], //负责人 seedId: '', @@ -265,7 +258,7 @@ export default { this.fileUrl = this.$store.state.FILEURL this.downUrl = this.$http.defaults.baseURL + 'xmgl/progressTask/downloadTemplate' - this.getProgressListData() + // this.getProgressListData() // this.getCrewListData() console.log('👇') console.log(this.listData1) @@ -279,7 +272,7 @@ export default { }, clearObj(){ this.subjectInfo.subjectName = '' - this.subjectInfo.parentId = '0' + // this.subjectInfo.parentId = '0' }, //导入确定提交 handleUploadConfirm() { @@ -314,77 +307,68 @@ export default { } }) }, - //获取选中作业类型、工序及部位 - // getCrewListData() { - // let data = { - // projectSn: this.projectSn - // } - // getWorkTickDetailText(data).then(res => { - // if (res.code == 200) { - // this.principalLsit = res.result - // console.log('获取负责人下拉', this.principalLsit) - // } else { - // this.$message.error(res.message) - // } - // }) - // }, //新增 addBefore(addType, value) { if (addType == 1) { this.title = '新增科目类别' - this.dialogType = 1 + this.subjectInfo.opType = '1' } else { console.log('新增子科目类别', value) this.title = '新增子科目类别' - this.dialogType = 3 - // this.workerInfo.parentId = value.id - // this.parentTaskName = value.processName + this.subjectInfo.opType = '2' + this.subjectInfo.parentId = value.id } this.dialogVisible = true }, // 编辑按钮 - editBefore(val) { - this.dialogType = 2 - this.title = '编辑分项' - console.log('当前点击的行', val) - this.workerInfo = JSON.parse(JSON.stringify(val)) - this.workerInfo.id = val.id - this.workerInfo.status = val.status + editBefore(value) { + this.title = '编辑科目类别' + console.log('当前点击的行', value) + this.subjectInfo.parentId = value.id + this.subjectInfo.opType = '3' this.dialogVisible = true }, //编辑 submitBtn() { this.$refs.addEditForm.validate((valid) => { if (valid) { - let data = JSON.parse(JSON.stringify(this.workerInfo)) + // let data = JSON.parse(JSON.stringify(this.workerInfo)) + // let data = JSON.parse(JSON.stringify(this.subjectInfo)) + let data = this.subjectInfo data.projectSn = this.$store.state.projectSn - if (this.dialogType == 1) { - rtRiskInventoryTypeAdd(data).then((res) => { - if (res.code == 200) { - this.$message.success(res.message) + if (data.opType === '1') { + console.log('提交表单1', this.subjectInfo) + // rtRiskInventoryTypeAdd(data).then((res) => { + // if (res.code == 200) { + // this.$message.success(res.message) + this.clearObj() this.dialogVisible = false - this.getProgressListData() - } - }) - } else if (this.dialogType == 2) { - data.id = this.workerInfo.id - rtRiskInventoryTypeEdit(data).then((res) => { - if (res.code == 200) { - this.$message.success(res.message) + // this.getProgressListData() + // } + // }) + } else if (data.opType === '2') { + console.log('提交表单2', this.subjectInfo) + // data.id = this.workerInfo.id + // rtRiskInventoryTypeEdit(data).then((res) => { + // if (res.code == 200) { + // this.$message.success(res.message) + this.clearObj() this.dialogVisible = false - this.getProgressListData() - } - }) - } else if (this.dialogType == 3) { - data.parentId = this.workerInfo.parentId - data.level = 2 - rtRiskInventoryTypeAdd(data).then((res) => { - if (res.code == 200) { - this.$message.success(res.message) + // this.getProgressListData() + // } + // }) + } else if (data.opType === '3') { + console.log('提交表单3', this.subjectInfo) + // data.parentId = this.workerInfo.parentId + // data.level = 2 + // rtRiskInventoryTypeAdd(data).then((res) => { + // if (res.code == 200) { + // this.$message.success(res.message) + this.clearObj() this.dialogVisible = false - this.getProgressListData() - } - }) + // this.getProgressListData() + // } + // }) } } else { return false @@ -406,15 +390,15 @@ export default { let data = { id: value.id, } - rtRiskInventoryTypeDelete(data).then((res) => { - if (res.code == 200) { - this.$message({ - type: 'success', - message: this.$t('message.quality.successfullyDelete') + '!', - }) - this.getProgressListData() - } - }) + // rtRiskInventoryTypeDelete(data).then((res) => { + // if (res.code == 200) { + // this.$message({ + // type: 'success', + // message: this.$t('message.quality.successfullyDelete') + '!', + // }) + // this.getProgressListData() + // } + // }) }) .catch(() => {}) }, @@ -450,17 +434,6 @@ export default { this.pagInfo.pageNo = val this.getProgressListData() }, - //--------------- - // 点击行查看详情 - showDetail(val) { - this.dialogType = 2 - this.title = '详情' - console.log('当前点击的行', val) - this.workerInfo = JSON.parse(JSON.stringify(val)) - this.workerInfo.id = val.id - this.workerInfo.status = val.status - this.dialogVisible = true - }, //关闭详请组件 closeDetailFn(val) { this.type = val