|
@@ -175,10 +175,7 @@ export default {
|
|
// 弹窗的title
|
|
// 弹窗的title
|
|
mergeTitle: '',
|
|
mergeTitle: '',
|
|
// 基本信息的数据
|
|
// 基本信息的数据
|
|
- ruleForm: {
|
|
|
|
- needMergedName: [],
|
|
|
|
- mergedName: [],
|
|
|
|
- },
|
|
|
|
|
|
+ ruleForm: {},
|
|
ruleFormTableData:[],
|
|
ruleFormTableData:[],
|
|
// 校验
|
|
// 校验
|
|
rules: {
|
|
rules: {
|
|
@@ -218,37 +215,41 @@ export default {
|
|
// 移除合并人员
|
|
// 移除合并人员
|
|
handleDelete(scope) {
|
|
handleDelete(scope) {
|
|
var row = scope.row
|
|
var row = scope.row
|
|
- if(!row.sign){
|
|
|
|
- this.ruleFormTableData.splice(scope.$index, 1)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let params = {
|
|
|
|
- projectId: this.projectId,
|
|
|
|
- name: this.ruleForm.name,
|
|
|
|
- delName: row.name,
|
|
|
|
- type: this.mergeType,
|
|
|
|
|
|
+ this.ruleFormTableData.splice(scope.$index, 1)
|
|
|
|
+ if(row.sign){
|
|
|
|
+ if(!this.ruleForm.delMergePersonDTOS){
|
|
|
|
+ this.ruleForm.delMergePersonDTOS = []
|
|
|
|
+ }
|
|
|
|
+ this.ruleForm.delMergePersonDTOS.push(row)
|
|
}
|
|
}
|
|
- this.$confirm('此操作将删除该人员, 是否继续?', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- this.$api.delMergedName(params).then(res => {
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- this.$message.success('移除人员成功')
|
|
|
|
- // this.$emit('close')
|
|
|
|
- this.hasChange = true
|
|
|
|
- let index = this.ruleForm.mergedName.indexOf(row.name)
|
|
|
|
- if (index != -1) {
|
|
|
|
- this.ruleFormTableData.splice(scope.$index, 1)
|
|
|
|
- this.ruleForm.mergedName.splice(index, 1)
|
|
|
|
- }
|
|
|
|
- // this.getMerge(this.ruleForm)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.$message.info('已取消操作');
|
|
|
|
- });
|
|
|
|
|
|
+
|
|
|
|
+ // let params = {
|
|
|
|
+ // projectId: this.projectId,
|
|
|
|
+ // name: this.ruleForm.name,
|
|
|
|
+ // delName: row.name,
|
|
|
|
+ // type: this.mergeType,
|
|
|
|
+ // }
|
|
|
|
+ // this.$confirm('此操作将删除该人员, 是否继续?', '提示', {
|
|
|
|
+ // confirmButtonText: '确定',
|
|
|
|
+ // cancelButtonText: '取消',
|
|
|
|
+ // type: 'warning'
|
|
|
|
+ // }).then(() => {
|
|
|
|
+ // this.$api.delMergedName(params).then(res => {
|
|
|
|
+ // if (res.code == 200) {
|
|
|
|
+ // this.$message.success('移除人员成功')
|
|
|
|
+ // // this.$emit('close')
|
|
|
|
+ // this.hasChange = true
|
|
|
|
+ // let index = this.ruleForm.mergedName.indexOf(row.name)
|
|
|
|
+ // if (index != -1) {
|
|
|
|
+ // this.ruleFormTableData.splice(scope.$index, 1)
|
|
|
|
+ // this.ruleForm.mergedName.splice(index, 1)
|
|
|
|
+ // }
|
|
|
|
+ // // this.getMerge(this.ruleForm)
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // }).catch(() => {
|
|
|
|
+ // this.$message.info('已取消操作');
|
|
|
|
+ // });
|
|
|
|
|
|
},
|
|
},
|
|
// 查询合并的数据
|
|
// 查询合并的数据
|
|
@@ -317,10 +318,7 @@ export default {
|
|
this.visible = false
|
|
this.visible = false
|
|
},
|
|
},
|
|
clearRuleForm(){
|
|
clearRuleForm(){
|
|
- this.ruleForm = {
|
|
|
|
- needMergedName: [],
|
|
|
|
- mergedName: [],
|
|
|
|
- }
|
|
|
|
|
|
+ this.ruleForm = {}
|
|
this.$set(this, 'mergedList', [])
|
|
this.$set(this, 'mergedList', [])
|
|
this.refresh = false
|
|
this.refresh = false
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -356,42 +354,49 @@ export default {
|
|
this.ruleForm.projectId = this.projectId
|
|
this.ruleForm.projectId = this.projectId
|
|
this.ruleForm.type = this.mergeType
|
|
this.ruleForm.type = this.mergeType
|
|
this.btnLoading = true
|
|
this.btnLoading = true
|
|
- var api = ''
|
|
|
|
|
|
+ var api = 'commonMerge'
|
|
var message = {
|
|
var message = {
|
|
success:'',
|
|
success:'',
|
|
error:''
|
|
error:''
|
|
}
|
|
}
|
|
|
|
|
|
- if(this.mergedList.length>0){
|
|
|
|
- for(var i =0;i<this.mergedList.length;i++){
|
|
|
|
- var item = this.mergedList[i]
|
|
|
|
- if(item.mergeId){
|
|
|
|
- this.ruleForm.needMergedName.push(item.name)
|
|
|
|
- }else{
|
|
|
|
- this.ruleForm.mergedName.push(item.name)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // if(this.ruleFormTableData.length>0){
|
|
|
|
+ // for(var i =0;i<this.ruleFormTableData.length;i++){
|
|
|
|
+ // var item = this.ruleFormTableData[i]
|
|
|
|
+ // if(item.mergeId){
|
|
|
|
+ // this.ruleForm.needMergedName.push(item.name)
|
|
|
|
+ // }else{
|
|
|
|
+ // this.ruleForm.mergedName.push(item.name)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ this.ruleForm.mergePersonDTOS = this.ruleFormTableData.filter(item=>{
|
|
|
|
+ return !item.sign
|
|
|
|
+ })
|
|
if(this.ruleForm.id){//编辑
|
|
if(this.ruleForm.id){//编辑
|
|
- api = 'updateMergePerson'
|
|
|
|
|
|
+ // api = 'updateMergePerson'
|
|
message = {
|
|
message = {
|
|
success:'编辑成功',
|
|
success:'编辑成功',
|
|
error:'编辑失败'
|
|
error:'编辑失败'
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- if (this.ruleForm.needMergedName && this.ruleForm.needMergedName.length == 0) {//新增
|
|
|
|
- api = 'mergePerson'
|
|
|
|
- message = {
|
|
|
|
- success:'合并成功',
|
|
|
|
- error:'合并失败'
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- api = 'mergePersonAgain'
|
|
|
|
- message = {
|
|
|
|
- success:'合并成功',
|
|
|
|
- error:'合并失败'
|
|
|
|
- }
|
|
|
|
|
|
+ message = {
|
|
|
|
+ success:'合并成功',
|
|
|
|
+ error:'合并失败'
|
|
}
|
|
}
|
|
|
|
+ // if (this.ruleForm.needMergedName && this.ruleForm.needMergedName.length == 0) {//新增
|
|
|
|
+ // api = 'mergePerson'
|
|
|
|
+ // message = {
|
|
|
|
+ // success:'合并成功',
|
|
|
|
+ // error:'合并失败'
|
|
|
|
+ // }
|
|
|
|
+ // } else {
|
|
|
|
+ // api = 'mergePersonAgain'
|
|
|
|
+ // message = {
|
|
|
|
+ // success:'合并成功',
|
|
|
|
+ // error:'合并失败'
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
this.$api[api](this.ruleForm).then(res => {
|
|
this.$api[api](this.ruleForm).then(res => {
|
|
@@ -431,8 +436,11 @@ export default {
|
|
}
|
|
}
|
|
this.mergeTitle = '合并'
|
|
this.mergeTitle = '合并'
|
|
var mergedData = this.mergedList[this.mergedList.length-1]
|
|
var mergedData = this.mergedList[this.mergedList.length-1]
|
|
- for (let k in mergedData) {
|
|
|
|
- this.$set(this.ruleForm, [k], mergedData[k])
|
|
|
|
|
|
+ // for (let k in mergedData) {
|
|
|
|
+ // this.$set(this.ruleForm, [k], mergedData[k])
|
|
|
|
+ // }
|
|
|
|
+ this.ruleForm = {
|
|
|
|
+ ...mergedData
|
|
}
|
|
}
|
|
this.getShowProvince()
|
|
this.getShowProvince()
|
|
this.ruleForm.id = null
|
|
this.ruleForm.id = null
|