|
@@ -59,7 +59,7 @@
|
|
<template v-if="ruleForm.id">
|
|
<template v-if="ruleForm.id">
|
|
<el-divider content-position="left">基本信息</el-divider>
|
|
<el-divider content-position="left">基本信息</el-divider>
|
|
<div style="display:flex;justify-content: flex-end;margin: 10px 0 10px 0px;">
|
|
<div style="display:flex;justify-content: flex-end;margin: 10px 0 10px 0px;">
|
|
- <el-button type="primary" size="small" @click="handleSave">保存</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="small" :loading="btnLoading" @click="handleSave">保存</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px">
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px">
|
|
@@ -71,7 +71,7 @@
|
|
<el-input v-model="ruleForm.abbreviation" placeholder="请输入名称"></el-input>
|
|
<el-input v-model="ruleForm.abbreviation" placeholder="请输入名称"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="国家" prop="country" >
|
|
<el-form-item label="国家" prop="country" >
|
|
- <el-select v-model="ruleForm.country" placeholder="请选择" filterable class="width_100">
|
|
|
|
|
|
+ <el-select v-model="ruleForm.country" @change="changeCountry" placeholder="请选择" filterable class="width_100">
|
|
<el-option v-for="(item, index) in commonData" :label="item.label" :key="index"
|
|
<el-option v-for="(item, index) in commonData" :label="item.label" :key="index"
|
|
:value="item.label"></el-option>
|
|
:value="item.label"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
@@ -113,7 +113,7 @@
|
|
</div>
|
|
</div>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="closeDialog">关 闭</el-button>
|
|
<el-button @click="closeDialog">关 闭</el-button>
|
|
- <el-button v-if="!ruleForm.id" type="primary" @click="handleSave">确认</el-button>
|
|
|
|
|
|
+ <el-button v-if="!ruleForm.id" :loading="btnLoading" type="primary" @click="handleSave">确认</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
@@ -186,13 +186,18 @@ export default {
|
|
// 地区
|
|
// 地区
|
|
areaTree: [],
|
|
areaTree: [],
|
|
/**编辑合并人及基本信息 end*/
|
|
/**编辑合并人及基本信息 end*/
|
|
-
|
|
|
|
|
|
+ btnLoading:false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ changeCountry(val){
|
|
|
|
+ if(val != '中国'){
|
|
|
|
+ this.$set(this.ruleForm,'provinceOld','')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 表格排序 等后端
|
|
// 表格排序 等后端
|
|
sortChange({ column, prop, order }) {
|
|
sortChange({ column, prop, order }) {
|
|
let obj = {
|
|
let obj = {
|
|
@@ -281,10 +286,11 @@ export default {
|
|
this.$api.delMergePerson(params).then(response => {
|
|
this.$api.delMergePerson(params).then(response => {
|
|
if (response.code == 200) {
|
|
if (response.code == 200) {
|
|
this.$message.success('删除成功')
|
|
this.$message.success('删除成功')
|
|
- this.loading = false
|
|
|
|
|
|
+ // this.loading = false
|
|
this.getList()
|
|
this.getList()
|
|
}
|
|
}
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
|
|
+ this.$message.error('删除失败')
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -312,6 +318,7 @@ export default {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.ruleForm.projectId = this.projectId
|
|
this.ruleForm.projectId = this.projectId
|
|
this.ruleForm.type = this.mergeType
|
|
this.ruleForm.type = this.mergeType
|
|
|
|
+ this.btnLoading = true
|
|
// if (this.title.indexOf('新增') != -1) {//新增
|
|
// if (this.title.indexOf('新增') != -1) {//新增
|
|
if (this.ruleForm.needMergedName && this.ruleForm.needMergedName.length == 0) {//新增
|
|
if (this.ruleForm.needMergedName && this.ruleForm.needMergedName.length == 0) {//新增
|
|
// this.ruleForm.mergedName = this.mergedName
|
|
// this.ruleForm.mergedName = this.mergedName
|
|
@@ -320,10 +327,14 @@ export default {
|
|
this.$message.success('合并成功')
|
|
this.$message.success('合并成功')
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
this.mergedList = []
|
|
this.mergedList = []
|
|
|
|
+ this.btnLoading = false
|
|
this.closeDialog()
|
|
this.closeDialog()
|
|
- this.close()
|
|
|
|
|
|
+ // this.close()
|
|
this.getList()
|
|
this.getList()
|
|
}
|
|
}
|
|
|
|
+ }).catch(error=>{
|
|
|
|
+ this.$message.error('合并失败')
|
|
|
|
+ this.btnLoading = false
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
if (this.ruleForm.needMergedName && this.ruleForm.needMergedName.length > 0) {//
|
|
if (this.ruleForm.needMergedName && this.ruleForm.needMergedName.length > 0) {//
|
|
@@ -331,21 +342,29 @@ export default {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message.success('编辑成功')
|
|
this.$message.success('编辑成功')
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
|
|
+ this.btnLoading = false
|
|
this.closeDialog()
|
|
this.closeDialog()
|
|
- this.close()
|
|
|
|
|
|
+ // this.close()
|
|
this.getList()
|
|
this.getList()
|
|
}
|
|
}
|
|
|
|
+ }).catch(error=>{
|
|
|
|
+ this.$message.error('编辑失败')
|
|
|
|
+ this.btnLoading = false
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
this.$api.updateMergePerson(this.ruleForm).then(res => {
|
|
this.$api.updateMergePerson(this.ruleForm).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message.success('编辑成功')
|
|
this.$message.success('编辑成功')
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
|
|
+ this.btnLoading = false
|
|
this.closeDialog()
|
|
this.closeDialog()
|
|
- this.close()
|
|
|
|
|
|
+ // this.close()
|
|
this.getList()
|
|
this.getList()
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ }).catch(error=>{
|
|
|
|
+ this.$message.error('编辑失败')
|
|
|
|
+ this.btnLoading = false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -520,10 +539,12 @@ export default {
|
|
projectId: this.projectId,//项目id
|
|
projectId: this.projectId,//项目id
|
|
type: this.mergeType,
|
|
type: this.mergeType,
|
|
}
|
|
}
|
|
|
|
+ this.loading = true
|
|
this.$api.getMergePerson(params).then(res => {
|
|
this.$api.getMergePerson(params).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.tableData = res.data.data
|
|
this.tableData = res.data.data
|
|
this.total = res.data.total
|
|
this.total = res.data.total
|
|
|
|
+ this.loading =false
|
|
this.refresh = false
|
|
this.refresh = false
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.refresh = true
|
|
this.refresh = true
|
|
@@ -532,6 +553,7 @@ export default {
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
this.tableData = []
|
|
this.tableData = []
|
|
this.total = 0
|
|
this.total = 0
|
|
|
|
+ this.loading =false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 关闭抽屉
|
|
// 关闭抽屉
|