|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <el-dialog title="新建" :visible.sync="dialogVisible" :before-close="handleClose" v-if="tool.checkAuth($route.name,'read')">
|
|
|
+ <el-dialog :title="editTarget ? '编辑' : '新建'" :visible.sync="dialogVisible" :before-close="handleClose" v-if="tool.checkAuth($route.name,'read')">
|
|
|
<el-row :gutter="30">
|
|
|
<el-form ref="formInfo" :model="param.content" :rules="rules" label-width="102px" label-position="left">
|
|
|
<el-col :span="12">
|
|
@@ -61,7 +61,7 @@ export default {
|
|
|
"phonenumber": "",
|
|
|
"position": "",
|
|
|
"email":"",
|
|
|
- "remarks": "备注",
|
|
|
+ "remarks": "",
|
|
|
"roleids":[]
|
|
|
}
|
|
|
},
|
|
@@ -93,13 +93,38 @@ export default {
|
|
|
watch: {
|
|
|
editTarget: {
|
|
|
handler(val) {
|
|
|
- this.$refs.formInfo.clearValidate()
|
|
|
- this.param.content.name = val.name
|
|
|
- this.param.content.position = val.position
|
|
|
- this.param.content.phonenumber = val.phonenumber
|
|
|
- this.param.content.roleids = val.roleids ? val.roleids.map((item) => item) : []
|
|
|
- this.param.content.sa_agent_hrid = val.sa_agent_hrid
|
|
|
- this.param.content.email = val.email
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.formInfo.clearValidate()
|
|
|
+ this.param.content.name = val.name
|
|
|
+ this.param.content.position = val.position
|
|
|
+ this.param.content.phonenumber = val.phonenumber
|
|
|
+ this.param.content.roleids = val.roleids ? val.roleids.map((item) => item) : []
|
|
|
+ this.param.content.sa_agent_hrid = val.sa_agent_hrid
|
|
|
+ this.param.content.email = val.email
|
|
|
+ })
|
|
|
+ console.log(this.param);
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dialogVisible: {
|
|
|
+ handler(val) {
|
|
|
+ if(!val) {
|
|
|
+ this.param = {
|
|
|
+ "classname": "sale.team.team",
|
|
|
+ "method": "insertormodify_team",
|
|
|
+ "content": {
|
|
|
+ "sa_agent_hrid": 0,
|
|
|
+ "name": "",
|
|
|
+ "phonenumber": "",
|
|
|
+ "position": "",
|
|
|
+ "email":"",
|
|
|
+ "remarks": "",
|
|
|
+ "roleids":[]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.param);
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|