|
@@ -249,18 +249,35 @@ export default {
|
|
|
//获取客户信息
|
|
|
getAdminClientList() {
|
|
|
this.$api.getAdminClientList(this.client.queryParams).then(response => {
|
|
|
- this.clientList.push(...response.data.records)
|
|
|
- this.client.queryParams.total = response.data.total
|
|
|
+ if(response.code == 200){
|
|
|
+ if(this.clientId){
|
|
|
+ var index = response.data.records.findIndex(item=>{
|
|
|
+ return item.id == this.clientId
|
|
|
+ })
|
|
|
+ if(index!=-1){
|
|
|
+ this.clientList.shift()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.clientList.push(...response.data.records)
|
|
|
+ this.client.queryParams.total = response.data.total
|
|
|
+ }
|
|
|
}).catch(error => {
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
//打开弹窗,判断是编辑还是添加,同时判断是批量添加还是添加单个事件(type==1是单个,type==2是批量)
|
|
|
- open(data, type) {
|
|
|
- this.getAdminClientList()
|
|
|
+ async open(data, type) {
|
|
|
this.type = type
|
|
|
- if (data) {
|
|
|
+ if (data && data.id) {
|
|
|
this.title = '编辑事件'
|
|
|
+ if(data.clientId){
|
|
|
+ this.clientList.push(
|
|
|
+ {
|
|
|
+ id:clientId,
|
|
|
+ name:data.clientName
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
this.$set(this.formData, 0, data)
|
|
|
} else {
|
|
|
if (this.type == 1) {
|
|
@@ -273,21 +290,23 @@ export default {
|
|
|
name: '',
|
|
|
eventDate: '',
|
|
|
description: '',
|
|
|
- scenarioId: '',
|
|
|
+ clientId:'',
|
|
|
+ scenarioId: data.scenarioId,
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
- console.log(this.formData);
|
|
|
+ this.getAdminClientList()
|
|
|
this.dialogVisible = true
|
|
|
},
|
|
|
//关闭弹窗
|
|
|
handleClose() {
|
|
|
if (this.type == '1') {
|
|
|
- // this.$refs.select.blur()
|
|
|
- // this.$refs.select2.blur()
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
}
|
|
|
this.files = []
|
|
|
+ this.client.queryParams.name = null
|
|
|
+ this.client.queryParams.current = 1
|
|
|
+ this.clientList = [];
|
|
|
this.loading = false
|
|
|
this.dialogVisible = false
|
|
|
},
|