|
|
|
@ -81,22 +81,22 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="创建者"> |
|
|
|
<el-input v-model="customerOrg.customerOrgRd.creatorName" disabled></el-input> |
|
|
|
<el-input v-model="form.creatorName" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="7"> |
|
|
|
<el-form-item label="创建时间" style="margin-left: -5%"> |
|
|
|
<el-input :value="customerOrg.customerOrgRd.creationTime | dateFormat" disabled style="width: 90%"></el-input> |
|
|
|
<el-input :value="form.creationTime | dateFormat" disabled style="width: 90%"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="修改者" style="margin-left: -25%"> |
|
|
|
<el-input v-model="customerOrg.customerOrgRd.creatorName" disabled></el-input> |
|
|
|
<el-input v-model="form.creatorName" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="7"> |
|
|
|
<el-form-item label="修改时间" style="margin-left: -5%"> |
|
|
|
<el-input :value="customerOrg.customerOrgRd.lastModificationTime | dateFormat" disabled style="width: 90%"></el-input> |
|
|
|
<el-input :value="form.lastModificationTime | dateFormat" disabled style="width: 90%"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -141,7 +141,7 @@ |
|
|
|
|
|
|
|
import { mapState } from 'vuex' |
|
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
|
|
|
|
|
import { objCopy } from '../../utlis/proFunc' |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
|
|
|
|
@ -149,13 +149,7 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
personId:'', |
|
|
|
form: { |
|
|
|
customerOrgId:'', |
|
|
|
displayName: "", |
|
|
|
title: "", |
|
|
|
remark: "", |
|
|
|
}, |
|
|
|
|
|
|
|
form: {}, //联系人表单信息 |
|
|
|
formTitle:'新增', |
|
|
|
dialogContactPerson: false, //联系人弹窗 显示控制 |
|
|
|
|
|
|
|
@ -163,9 +157,8 @@ export default { |
|
|
|
//{ value: '',label: '所有订单状态' }, |
|
|
|
{ value: '0',label: '电话' }, |
|
|
|
{ value: '1',label: '邮箱' }, |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
contactMethod: [], //联系方式form表单数据 |
|
|
|
rules: { |
|
|
|
displayName: [ |
|
|
|
{ required: true, message: "请输入名称", trigger: "blur" }, |
|
|
|
@ -212,13 +205,23 @@ export default { |
|
|
|
//联系人 相关操作 |
|
|
|
add() { |
|
|
|
//this.$message.success("新增 addContactPerson"); |
|
|
|
if(!this.customerOrg.customerOrgId){ |
|
|
|
alert("没有体检单位信息") |
|
|
|
return |
|
|
|
} |
|
|
|
this.form = {customerOrgId:this.customerOrg.customerOrgId} |
|
|
|
this.dialogContactPerson = true |
|
|
|
this.formTitle = "新增" |
|
|
|
this.personId = '' |
|
|
|
this.customerOrg.contactMethodList = [] |
|
|
|
}, |
|
|
|
|
|
|
|
edit() { |
|
|
|
//this.$message.success("编辑 editContactPerson"); |
|
|
|
if(!this.personId || !this.customerOrg.customerOrgId){ |
|
|
|
if(!this.customerOrg.customerOrgId){ |
|
|
|
alert("没有体检单位信息") |
|
|
|
return |
|
|
|
}else if(!this.personId){ |
|
|
|
alert("请先选择要编辑的联系人") |
|
|
|
return |
|
|
|
} |
|
|
|
@ -226,39 +229,88 @@ export default { |
|
|
|
this.formTitle = "编辑" |
|
|
|
}, |
|
|
|
|
|
|
|
//删除联系人行 |
|
|
|
del() { |
|
|
|
this.$message.success("删除 delContactPerson"); |
|
|
|
//this.$message.success("删除 delContactPerson"); |
|
|
|
deletapi(`/api/app/contact-person/${this.personId}`).then( |
|
|
|
(res) => { |
|
|
|
this.getContactPersonList(this.customerOrg.customerOrgId) |
|
|
|
this.customerOrg.contactMethodList = [] |
|
|
|
this.$message.success("操作成功!"); |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//删除联系方式行 |
|
|
|
deleteRow (index){ |
|
|
|
this.customerOrg.contactMethodList.splice(index, 1) |
|
|
|
}, |
|
|
|
|
|
|
|
//联系人信息提交 |
|
|
|
submit(){ |
|
|
|
|
|
|
|
submit(){ |
|
|
|
let body = { |
|
|
|
customerOrgId:'', |
|
|
|
displayName: "", |
|
|
|
title: "", |
|
|
|
remark: "", |
|
|
|
} |
|
|
|
objCopy(this.form,body) |
|
|
|
console.log('body',body) |
|
|
|
if(this.formTitle === '新增'){ |
|
|
|
postapi('api/app/contact-person',form).then( |
|
|
|
postapi('/api/app/contact-person',body).then( |
|
|
|
(res) => { |
|
|
|
//console.log('res.data',res.data) |
|
|
|
//console.log('api/app/contact-person') |
|
|
|
this.personId = res.data.id |
|
|
|
return deletapi(`api/app/contact-method/${this.personId}`) |
|
|
|
this.formTitle = '编辑' |
|
|
|
return deletapi(`/api/app/contact-method/many/${this.personId}`) |
|
|
|
} |
|
|
|
).then( |
|
|
|
(res) => { |
|
|
|
//console.log('res.data',res.data) |
|
|
|
this.personId = res.data.id |
|
|
|
return postapi('api/app/contact-method/many',contactMethod) |
|
|
|
//console.log(`deletapi api/app/contact-method/${this.personId}`) |
|
|
|
let contactMethod = [] //联系方式form表单数据 |
|
|
|
this.customerOrg.contactMethodList.forEach((item, index) => { |
|
|
|
contactMethod.push({ |
|
|
|
contactMethodValue: item.contactMethodValue, |
|
|
|
contactMethodType: item.contactMethodType, |
|
|
|
contactPersonId: this.personId |
|
|
|
}) |
|
|
|
}); |
|
|
|
return postapi('/api/app/contact-method/many',contactMethod) |
|
|
|
} |
|
|
|
).then( |
|
|
|
(res) => { |
|
|
|
//console.log('api/app/contact-method/many') |
|
|
|
this.getContactPersonList(this.customerOrg.customerOrgId) |
|
|
|
this.$message.success("操作成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
}else{ |
|
|
|
|
|
|
|
putapi(`/api/app/contact-person/${this.personId}`,body).then( |
|
|
|
(res) => { |
|
|
|
//console.log(`/api/app/contact-person/${this.personId}`) |
|
|
|
return deletapi(`/api/app/contact-method/many/${this.personId}`) |
|
|
|
} |
|
|
|
).then( |
|
|
|
(res) => { |
|
|
|
console.log(`deletapi api/app/contact-method/${this.personId}`) |
|
|
|
let contactMethod = [] //联系方式form表单数据 |
|
|
|
this.customerOrg.contactMethodList.forEach((item, index) => { |
|
|
|
contactMethod.push({ |
|
|
|
contactMethodValue: item.contactMethodValue, |
|
|
|
contactMethodType: item.contactMethodType, |
|
|
|
contactPersonId: this.personId |
|
|
|
}) |
|
|
|
}); |
|
|
|
return postapi('/api/app/contact-method/many',contactMethod) |
|
|
|
} |
|
|
|
).then( |
|
|
|
(res) => { |
|
|
|
//console.log('api/app/contact-method/many') |
|
|
|
this.getContactPersonList(this.customerOrg.customerOrgId) |
|
|
|
this.$message.success("操作成功!"); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
@ -268,14 +320,15 @@ export default { |
|
|
|
this.customerOrg.contactMethodList.push({ |
|
|
|
contactMethodValue: "", |
|
|
|
contactMethodType: "0", |
|
|
|
contactPersonId: this.personId |
|
|
|
contactPersonId: this.personId |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
rowClick(row){ |
|
|
|
// console.log('row',row) |
|
|
|
console.log('row',row) |
|
|
|
// this.$message.success("rowClick"); |
|
|
|
this.personId = row.id |
|
|
|
this.form = row |
|
|
|
this.personId = row.id |
|
|
|
this.getContactMethodList(row.id) |
|
|
|
}, |
|
|
|
|
|
|
|
|