开发科目管理界面
This commit is contained in:
parent
b73951ff2c
commit
1583ebf05e
@ -20,14 +20,13 @@
|
||||
<el-table-column></el-table-column>
|
||||
<el-table-column width="200" label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click.native.stop="addBefore(2, scope.row)" size="mini" type="text" icon="el-icon-circle-plus-outline"
|
||||
v-if="scope.row.parentId == '0'">
|
||||
<el-button @click.native.stop="addBefore(2, scope.row)" size="mini" type="text" icon="el-icon-circle-plus-outline">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click.native.stop="editBefore(scope.row)" v-if="scope.row.parentId == '0'">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click.native.stop="editBefore(scope.row)" >
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" class="delete-btn" icon="el-icon-delete" @click.native.stop="deleteBefore(scope.row) " v-if="scope.row.parentId == '0'">
|
||||
<el-button size="mini" type="text" class="delete-btn" icon="el-icon-delete" @click.native.stop="deleteBefore(scope.row) ">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@ -38,17 +37,11 @@
|
||||
</div>
|
||||
<!-- '新增父子级工程弹框' -->
|
||||
<el-dialog :modal-append-to-body="false" :title="title" :visible.sync="dialogVisible" width="667px" @close="close">
|
||||
<!-- <div class="dialog_content">
|
||||
<el-form ref="addEditForm" label-width="145px" size="medium" class="dialogFormBox" :rules="addEditRules" :model="workerInfo">
|
||||
<el-form-item label="工序名称" prop="processName" v-if="dialogType == 3">
|
||||
<el-input v-model="parentTaskName" placeholder="请输入" :disabled="dialogType == 3 || title == '详情'"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div> -->
|
||||
<div class="dialog_content">
|
||||
<el-form ref="addEditForm" label-width="145px" size="medium" class="dialogFormBox" :rules="addEditRules" :model="workerInfo">
|
||||
<el-form-item label="科目类别" prop="processName">
|
||||
<el-input v-model="parentTaskName" placeholder="请输入" :disabled="dialogType == 3 || title == '详情'"></el-input>
|
||||
<el-form ref="addEditForm" label-width="145px" size="medium" class="dialogFormBox"
|
||||
:rules="addEditRules" :model="subjectInfo">
|
||||
<el-form-item label="科目类别" prop="subjectName">
|
||||
<el-input v-model="subjectInfo.subjectName" placeholder="请输入"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user