开发科目管理界面
This commit is contained in:
parent
b73951ff2c
commit
1583ebf05e
@ -20,14 +20,13 @@
|
|||||||
<el-table-column></el-table-column>
|
<el-table-column></el-table-column>
|
||||||
<el-table-column width="200" label="操作" align="center">
|
<el-table-column width="200" label="操作" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button @click.native.stop="addBefore(2, scope.row)" size="mini" type="text" icon="el-icon-circle-plus-outline"
|
<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>
|
</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>
|
||||||
<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>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -38,17 +37,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- '新增父子级工程弹框' -->
|
<!-- '新增父子级工程弹框' -->
|
||||||
<el-dialog :modal-append-to-body="false" :title="title" :visible.sync="dialogVisible" width="667px" @close="close">
|
<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">
|
<div class="dialog_content">
|
||||||
<el-form ref="addEditForm" label-width="145px" size="medium" class="dialogFormBox" :rules="addEditRules" :model="workerInfo">
|
<el-form ref="addEditForm" label-width="145px" size="medium" class="dialogFormBox"
|
||||||
<el-form-item label="科目类别" prop="processName">
|
:rules="addEditRules" :model="subjectInfo">
|
||||||
<el-input v-model="parentTaskName" placeholder="请输入" :disabled="dialogType == 3 || title == '详情'"></el-input>
|
<el-form-item label="科目类别" prop="subjectName">
|
||||||
|
<el-input v-model="subjectInfo.subjectName" placeholder="请输入"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -81,8 +74,8 @@ export default {
|
|||||||
subjectName: '科目名称1',
|
subjectName: '科目名称1',
|
||||||
parentId: '0',
|
parentId: '0',
|
||||||
children: [
|
children: [
|
||||||
{ id: '4', subjectName: '子科目名称1', parentId: '1' },
|
{ id: '4', subjectName: '科目名称11', parentId: '1', children: [{id: '10', subjectName: '科目名称111', parentId: '4'}]},
|
||||||
{ id: '5', subjectName: '子科目名称2', parentId: '1' },
|
{ id: '5', subjectName: '科目名称21', parentId: '1' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -90,8 +83,8 @@ export default {
|
|||||||
subjectName: '科目名称2',
|
subjectName: '科目名称2',
|
||||||
parentId: '0',
|
parentId: '0',
|
||||||
children: [
|
children: [
|
||||||
{ id: '6', subjectName: '子科目名称1', parentId: '2' },
|
{ id: '6', subjectName: '科目名称21', parentId: '2' },
|
||||||
{ id: '7', subjectName: '子科目名称2', parentId: '2' },
|
{ id: '7', subjectName: '科目名称22', parentId: '2' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -99,8 +92,8 @@ export default {
|
|||||||
subjectName: '科目名称3',
|
subjectName: '科目名称3',
|
||||||
parentId: '0',
|
parentId: '0',
|
||||||
children: [
|
children: [
|
||||||
{ id: '8', subjectName: '子科目名称1', parentId: '3' },
|
{ id: '8', subjectName: '科目名称31', parentId: '3' },
|
||||||
{ id: '9', subjectName: '子科目名称2', parentId: '3' },
|
{ id: '9', subjectName: '科目名称32', parentId: '3' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -132,7 +125,6 @@ export default {
|
|||||||
},
|
},
|
||||||
radio: 1,
|
radio: 1,
|
||||||
uploadShow: false, //导入弹框
|
uploadShow: false, //导入弹框
|
||||||
dialogType: 1,
|
|
||||||
title: '',
|
title: '',
|
||||||
daterange: [],
|
daterange: [],
|
||||||
fileList: [], //上传文件
|
fileList: [], //上传文件
|
||||||
@ -158,7 +150,8 @@ export default {
|
|||||||
},
|
},
|
||||||
subjectInfo: {
|
subjectInfo: {
|
||||||
subjectName: '',
|
subjectName: '',
|
||||||
parentId: '0'
|
parentId: '0',
|
||||||
|
opType: ''
|
||||||
},
|
},
|
||||||
principalLsit: [], //负责人
|
principalLsit: [], //负责人
|
||||||
seedId: '',
|
seedId: '',
|
||||||
@ -265,7 +258,7 @@ export default {
|
|||||||
this.fileUrl = this.$store.state.FILEURL
|
this.fileUrl = this.$store.state.FILEURL
|
||||||
this.downUrl =
|
this.downUrl =
|
||||||
this.$http.defaults.baseURL + 'xmgl/progressTask/downloadTemplate'
|
this.$http.defaults.baseURL + 'xmgl/progressTask/downloadTemplate'
|
||||||
this.getProgressListData()
|
// this.getProgressListData()
|
||||||
// this.getCrewListData()
|
// this.getCrewListData()
|
||||||
console.log('👇')
|
console.log('👇')
|
||||||
console.log(this.listData1)
|
console.log(this.listData1)
|
||||||
@ -279,7 +272,7 @@ export default {
|
|||||||
},
|
},
|
||||||
clearObj(){
|
clearObj(){
|
||||||
this.subjectInfo.subjectName = ''
|
this.subjectInfo.subjectName = ''
|
||||||
this.subjectInfo.parentId = '0'
|
// this.subjectInfo.parentId = '0'
|
||||||
},
|
},
|
||||||
//导入确定提交
|
//导入确定提交
|
||||||
handleUploadConfirm() {
|
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) {
|
addBefore(addType, value) {
|
||||||
if (addType == 1) {
|
if (addType == 1) {
|
||||||
this.title = '新增科目类别'
|
this.title = '新增科目类别'
|
||||||
this.dialogType = 1
|
this.subjectInfo.opType = '1'
|
||||||
} else {
|
} else {
|
||||||
console.log('新增子科目类别', value)
|
console.log('新增子科目类别', value)
|
||||||
this.title = '新增子科目类别'
|
this.title = '新增子科目类别'
|
||||||
this.dialogType = 3
|
this.subjectInfo.opType = '2'
|
||||||
// this.workerInfo.parentId = value.id
|
this.subjectInfo.parentId = value.id
|
||||||
// this.parentTaskName = value.processName
|
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
// 编辑按钮
|
// 编辑按钮
|
||||||
editBefore(val) {
|
editBefore(value) {
|
||||||
this.dialogType = 2
|
this.title = '编辑科目类别'
|
||||||
this.title = '编辑分项'
|
console.log('当前点击的行', value)
|
||||||
console.log('当前点击的行', val)
|
this.subjectInfo.parentId = value.id
|
||||||
this.workerInfo = JSON.parse(JSON.stringify(val))
|
this.subjectInfo.opType = '3'
|
||||||
this.workerInfo.id = val.id
|
|
||||||
this.workerInfo.status = val.status
|
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
//编辑
|
//编辑
|
||||||
submitBtn() {
|
submitBtn() {
|
||||||
this.$refs.addEditForm.validate((valid) => {
|
this.$refs.addEditForm.validate((valid) => {
|
||||||
if (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
|
data.projectSn = this.$store.state.projectSn
|
||||||
if (this.dialogType == 1) {
|
if (data.opType === '1') {
|
||||||
rtRiskInventoryTypeAdd(data).then((res) => {
|
console.log('提交表单1', this.subjectInfo)
|
||||||
if (res.code == 200) {
|
// rtRiskInventoryTypeAdd(data).then((res) => {
|
||||||
this.$message.success(res.message)
|
// if (res.code == 200) {
|
||||||
|
// this.$message.success(res.message)
|
||||||
|
this.clearObj()
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.getProgressListData()
|
// this.getProgressListData()
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
} else if (this.dialogType == 2) {
|
} else if (data.opType === '2') {
|
||||||
data.id = this.workerInfo.id
|
console.log('提交表单2', this.subjectInfo)
|
||||||
rtRiskInventoryTypeEdit(data).then((res) => {
|
// data.id = this.workerInfo.id
|
||||||
if (res.code == 200) {
|
// rtRiskInventoryTypeEdit(data).then((res) => {
|
||||||
this.$message.success(res.message)
|
// if (res.code == 200) {
|
||||||
|
// this.$message.success(res.message)
|
||||||
|
this.clearObj()
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.getProgressListData()
|
// this.getProgressListData()
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
} else if (this.dialogType == 3) {
|
} else if (data.opType === '3') {
|
||||||
data.parentId = this.workerInfo.parentId
|
console.log('提交表单3', this.subjectInfo)
|
||||||
data.level = 2
|
// data.parentId = this.workerInfo.parentId
|
||||||
rtRiskInventoryTypeAdd(data).then((res) => {
|
// data.level = 2
|
||||||
if (res.code == 200) {
|
// rtRiskInventoryTypeAdd(data).then((res) => {
|
||||||
this.$message.success(res.message)
|
// if (res.code == 200) {
|
||||||
|
// this.$message.success(res.message)
|
||||||
|
this.clearObj()
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.getProgressListData()
|
// this.getProgressListData()
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
@ -406,15 +390,15 @@ export default {
|
|||||||
let data = {
|
let data = {
|
||||||
id: value.id,
|
id: value.id,
|
||||||
}
|
}
|
||||||
rtRiskInventoryTypeDelete(data).then((res) => {
|
// rtRiskInventoryTypeDelete(data).then((res) => {
|
||||||
if (res.code == 200) {
|
// if (res.code == 200) {
|
||||||
this.$message({
|
// this.$message({
|
||||||
type: 'success',
|
// type: 'success',
|
||||||
message: this.$t('message.quality.successfullyDelete') + '!',
|
// message: this.$t('message.quality.successfullyDelete') + '!',
|
||||||
})
|
// })
|
||||||
this.getProgressListData()
|
// this.getProgressListData()
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
},
|
},
|
||||||
@ -450,17 +434,6 @@ export default {
|
|||||||
this.pagInfo.pageNo = val
|
this.pagInfo.pageNo = val
|
||||||
this.getProgressListData()
|
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) {
|
closeDetailFn(val) {
|
||||||
this.type = val
|
this.type = val
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user