| | |
| | | <el-input |
| | | v-if=" |
| | | editConfig.title == '编辑' || |
| | | (editConfig.title == '新建' && |
| | | codenumer && |
| | | (explain != '' || isIdDisabled)) |
| | | (editConfig.title == '新建' && codenumer && (explain != '' || isIdDisabled)) |
| | | " |
| | | :disabled="editConfig.title == '编辑'" |
| | | v-model="editConfig.infomation.number" |
| | |
| | | dialogWidth: "50%", |
| | | editConfig: this.editClientManageConfig, |
| | | rules: { |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["change",'blur' ]}], |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }], |
| | | name: [ |
| | | { required: true, message: "请输入客户名称", trigger: ["change",'blur' ] }, |
| | | { required: true, message: "请输入客户名称", trigger: ["change", "blur"] }, |
| | | { |
| | | validator: this.checkNameClient, |
| | | trigger: ["change",'blur' ] |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ], |
| | | client_status_id: [{ required: true, message: "请选择客户状态", trigger: ["change",'blur' ] }], |
| | | member_id: [{ required: false, message: "请选择销售负责人", trigger: ["change",'blur' ] }], |
| | | approvalOpinion: [{ required: true, message: "请输入审批意见", trigger: ["change",'blur' ] }], |
| | | contact_name: [{ required: true, message: "请输入联系人姓名", trigger: ["change",'blur' ] }], |
| | | client_status_id: [{ required: true, message: "请选择客户状态", trigger: ["change", "blur"] }], |
| | | member_id: [{ required: false, message: "请选择销售负责人", trigger: ["change", "blur"] }], |
| | | approvalOpinion: [{ required: true, message: "请输入审批意见", trigger: ["change", "blur"] }], |
| | | contact_name: [{ required: true, message: "请输入联系人姓名", trigger: ["change", "blur"] }], |
| | | contact_phone: [ |
| | | { required: true, message: "请输入联系人手机", trigger:["change",'blur' ] }, |
| | | { len: 11, message: "长度在11个字符", trigger: ["change",'blur' ] }, |
| | | { required: true, message: "请输入联系人手机", trigger: ["change", "blur"] }, |
| | | { len: 11, message: "长度在11个字符", trigger: ["change", "blur"] }, |
| | | { |
| | | pattern: /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/, |
| | | message: "请输入正确的手机号", |
| | | trigger: ["change",'blur' ] |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ], |
| | | contact_email: [ |
| | | { required: false, message: "", trigger: ["change",'blur' ] }, |
| | | { required: false, message: "", trigger: ["change", "blur"] }, |
| | | { |
| | | pattern: /^[a-zA-Z0-9_\\.]+@[a-zA-Z0-9-]+[\\.a-zA-Z]+$/, |
| | | message: "请输入正确的邮箱格式", |
| | | trigger: ["change",'blur' ] |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ] |
| | | }, |
| | |
| | | this.getCityList(this.editConfig.infomation.province_id, "edit") |
| | | } |
| | | this.getCommonData() |
| | | this.formInfo(); |
| | | this.formInfo() |
| | | }, |
| | | watch:{ |
| | | 'editClientManageConfig.visible'(val){ |
| | | "editClientManageConfig.visible"(val) { |
| | | if(val){ |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | formInfo(){ |
| | | this.objCode.type='客户编码' |
| | | this.objCode.codeStandID = '' |
| | | this.objCode.type = "客户编码" |
| | | this.objCode.codeStandID = "" |
| | | if(this.editConfig.infomation.codeStandID){ |
| | | this.objCode.codeStandID = this.editConfig.infomation.codeStandID; |
| | | this.objCode.codeStandID = this.editConfig.infomation.codeStandID |
| | | } |
| | | this.getRCodeStandardList(); |
| | | this.getRCodeStandardList() |
| | | }, |
| | | getCommonData() { |
| | | this.editConfig.infomation.country_id = 1 |
| | |
| | | getAllData() |
| | | .then((res) => { |
| | | this.memberOptions = res.data.member |
| | | this.$set(this.editConfig.infomation,'member_id',this.editConfig.infomation.member_id) |
| | | // this.$set(this.editConfig.infomation,'member_id',this.editConfig.infomation.member_id) |
| | | if (this.editConfig.title === "新建") { |
| | | let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") |
| | | this.memberOptions.map((item) => { |
| | | if (item.username == username) { |
| | | this.editConfig.infomation.member_id = item.id |
| | | } |
| | | }) |
| | | } |
| | | this.clientSourceOptions = res.data.client_origin |
| | | this.clientStatusOptions = res.data.client_status |
| | | this.importantLevelOptions = res.data.client_level |
| | |
| | | }, |
| | | // 保存 |
| | | saveClick(formName) { |
| | | |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | |
| | | service_member_id: data.service_member_id || 0, |
| | | sales_leads_id: data.sales_leads_id || 0, |
| | | contact_id: data.contact_id || 0, |
| | | codeStandID:data.ID, |
| | | codeStandID: data.ID |
| | | } |
| | | return params |
| | | }, |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" style='height:47px;'> |
| | | <el-col :span="12" style="height: 47px"> |
| | | <el-form-item v-if="isUnflod" label="首要联系人" prop="is_first"> |
| | | <el-switch v-model="editConfig.infomation.is_first" active-color="#2E68DB" inactive-color="#AEB9CA"> |
| | | </el-switch> |
| | |
| | | dialogWidth: "50%", |
| | | editConfig: this.editContactsConfig, |
| | | rules: { |
| | | name: [{ required: true, message: "请输入联系人姓名", trigger: ["change",'blur'] }], |
| | | number: [{ required: true, message: "请输入", trigger: ["change",'blur'] }], |
| | | client_name: [{ required: true, message: "请选择客户名称", trigger: ["change",'blur'] }], |
| | | member_id: [{ required: true, message: "请选择", trigger: ["change",'blur'] }], |
| | | name: [{ required: true, message: "请输入联系人姓名", trigger: ["change", "blur"] }], |
| | | number: [{ required: true, message: "请输入", trigger: ["change", "blur"] }], |
| | | client_name: [{ required: true, message: "请选择客户名称", trigger: ["change", "blur"] }], |
| | | member_id: [{ required: true, validator: this.validateMemberId, trigger: ["change", "blur"] }], |
| | | phone: [ |
| | | { required: false, message: "请输入手机号", trigger: ["change",'blur'] }, |
| | | { len: 11, message: "长度在11个字符", trigger: ["change",'blur'] }, |
| | | { required: false, message: "请输入手机号", trigger: ["change", "blur"] }, |
| | | { len: 11, message: "长度在11个字符", trigger: ["change", "blur"] }, |
| | | { |
| | | pattern: /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/, |
| | | message: "请输入正确的手机号", |
| | | trigger: ["change",'blur'] |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ], |
| | | email: [ |
| | | { required: false, message: "", trigger: ["change",'blur'] }, |
| | | { required: false, message: "", trigger: ["change", "blur"] }, |
| | | { |
| | | pattern: /^[a-zA-Z0-9_\\.]+@[a-zA-Z0-9-]+[\\.a-zA-Z]+$/, |
| | | message: "请输入正确的邮箱格式", |
| | | trigger: ["change",'blur'] |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ] |
| | | }, |
| | |
| | | "editContactsConfig.visible"(val) { |
| | | if (val) { |
| | | // this.formInfo() |
| | | console.log("11111") |
| | | } |
| | | }, |
| | | "editContactsConfig.infomation.codeStandID"() { |
| | |
| | | this.editConfig.infomation.city_id = |
| | | this.editConfig.infomation.city_id === 0 ? "" : this.editConfig.infomation.city_id |
| | | getAllData().then((res) => { |
| | | console.log(res) |
| | | this.memberOptions = res.data.member |
| | | if (this.editConfig.title === "新建") { |
| | | let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") |
| | | this.memberOptions.map((item) => { |
| | | if (item.username == username) { |
| | | this.editConfig.infomation.member_id = item.id |
| | | } |
| | | }) |
| | | } |
| | | this.provinceOptions = res.data.province |
| | | }) |
| | | }, |
| | |
| | | position: data.position || "", |
| | | province_id: data.province_id || 0, |
| | | region_id: data.region_id || 0, |
| | | wechat: data.wechat || "", |
| | | wechat: data.wechat || "" |
| | | // codeStandID: data.ID, |
| | | } |
| | | return params |
| | |
| | | selClient(row) { |
| | | console.log(row) |
| | | this.clientId = row.id |
| | | this.$set( this.editConfig.infomation,'client_name',row.name) |
| | | this.$set(this.editConfig.infomation, "client_name", row.name) |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient() { |
| | | console.log(this.editConfig.infomation.client_name,'sssssssss') |
| | | console.log(this.editConfig.infomation.client_name, "sssssssss") |
| | | // if (this.editConfig.infomation.client_name !== "") { |
| | | this.clientId = null |
| | | this.$set(this.editConfig.infomation,'client_name','') |
| | | this.$set(this.editConfig.infomation, "client_name", "") |
| | | // } |
| | | }, |
| | | // 添加附件 |
| | |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 销售负责人自定义校验规则 |
| | | validateMemberId(rule, value, callback) { |
| | | console.log(this.editConfig.infomation.member_id, "销售负责人自定义校验规则") |
| | | if (this.editConfig.infomation?.member_id > 0) { |
| | | callback() |
| | | } else { |
| | | callback(new Error("请输入销售负责人")) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | editConfig: this.editContactsConfig, |
| | | rules: { |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }], |
| | | member_id: [{ required: true, message: "请选择负责人", trigger: "change" }], |
| | | member_id: [{ required: true, validator: this.validateMemberId, trigger: "change" }], |
| | | record: [{ required: true, message: "请输入跟进记录", trigger: "blur" }], |
| | | client_name: [{ required: true, validator: this.checkClient, trigger: "change" }], |
| | | contact_name: [{ required: true, message: "请选择联系人姓名", trigger: "change" }], |
| | |
| | | console.log(res) |
| | | this.clientStatusOptions = res.data.client_status |
| | | this.memberOptions = res.data.member |
| | | if (this.editContactsConfig.title === "新建") { |
| | | let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") |
| | | this.memberOptions.map((item) => { |
| | | if (item.username == username) { |
| | | this.editConfig.infomation.member_id = item.id |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // this.dataProcess() |
| | | }) |
| | | }, |
| | |
| | | } |
| | | }, |
| | | // 阻止可点击事件 |
| | | stopClick() {} |
| | | stopClick() {}, |
| | | // 销售负责人自定义校验规则 |
| | | validateMemberId(rule, value, callback) { |
| | | console.log(this.editConfig.infomation.member_id, "销售负责人自定义校验规则") |
| | | if (this.editConfig.infomation?.member_id > 0) { |
| | | callback() |
| | | } else { |
| | | callback(new Error("请输入负责人")) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-input |
| | | v-if=" |
| | | editConfig.title == '编辑' || |
| | | (editConfig.title == '新建' && |
| | | codenumer && |
| | | (explain != '' || isIdDisabled)) |
| | | (editConfig.title == '新建' && codenumer && (explain != '' || isIdDisabled)) |
| | | " |
| | | :disabled="editConfig.title == '编辑'" |
| | | v-model="editConfig.infomation.number" |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="负责人" prop="member_id"> |
| | | <el-select v-model="editConfig.infomation.member_id" placeholder="请选择" style="width: 100%" size="mini"> |
| | | <el-select |
| | | v-model="editConfig.infomation.member_id" |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | size="mini" |
| | | > |
| | | <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | dialogWidth: "50%", |
| | | editConfig: this.editSalesLeadConfig, |
| | | rules: { |
| | | name: [{ required: true, message: "请输入客户名称", trigger: ["change",'blur' ]}], |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["change",'blur' ] }], |
| | | businessStatus: [{ required: true, message: "请输入线索状态", trigger: ["change",'blur' ] }], |
| | | sales_sources_id: [{ required: true, message: "请选择线索来源", trigger: ["change",'blur' ] }], |
| | | name: [{ required: true, message: "请输入客户名称", trigger: ["change", "blur"] }], |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }], |
| | | businessStatus: [{ required: true, message: "请输入线索状态", trigger: ["change", "blur"] }], |
| | | sales_sources_id: [{ required: true, message: "请选择线索来源", trigger: ["change", "blur"] }], |
| | | contact_phone: [ |
| | | { required: true, message: "请输入手机号码", trigger: ["change",'blur' ] }, |
| | | { len: 11, message: "长度在11个字符", trigger: ["change",'blur' ] }, |
| | | { required: true, message: "请输入手机号码", trigger: ["change", "blur"] }, |
| | | { len: 11, message: "长度在11个字符", trigger: ["change", "blur"] }, |
| | | { |
| | | pattern: /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/, |
| | | message: "请输入正确的手机号", |
| | | trigger: ["change",'blur' ] |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ] |
| | | }, |
| | |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | } |
| | | }, |
| | | defaultMemberId: 0 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getCityList(this.editConfig.infomation.province_id, "edit") |
| | | } |
| | | this.getCommonData() |
| | | this.formInfo(); |
| | | this.formInfo() |
| | | }, |
| | | mounted() {}, |
| | | watch:{ |
| | | 'editSalesLeadConfig.visible'(val){ |
| | | "editSalesLeadConfig.visible"(val) { |
| | | if(val){ |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | formInfo(){ |
| | | this.objCode.type='销售线索编码' |
| | | this.objCode.codeStandID = '' |
| | | this.objCode.type = "销售线索编码" |
| | | this.objCode.codeStandID = "" |
| | | if(this.editConfig.infomation.codeStandID){ |
| | | this.objCode.codeStandID = this.editConfig.infomation.codeStandID; |
| | | this.objCode.codeStandID = this.editConfig.infomation.codeStandID |
| | | } |
| | | this.getRCodeStandardList(); |
| | | this.getRCodeStandardList() |
| | | }, |
| | | getCommonData() { |
| | | this.editConfig.infomation.country_id = 1 |
| | |
| | | this.provinceOptions = res.data.province |
| | | this.regionOptions = res.data.region |
| | | this.memberOptions = res.data.member |
| | | if (this.editConfig.title === "新建") { |
| | | let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") |
| | | this.memberOptions.map((item) => { |
| | | if (item.username == username) { |
| | | this.editConfig.infomation.member_id = item.id |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | |
| | | region_id: this.editConfig.infomation.region_id || 0, |
| | | sales_sources_id: this.editConfig.infomation.sales_sources_id || 0, |
| | | detail_address: this.editConfig.infomation.detail_address || "", |
| | | codeStandID:this.editConfig.infomation.ID, |
| | | codeStandID: this.editConfig.infomation.ID |
| | | } |
| | | if (this.editConfig.title === "新建") { |
| | | getAddSalesLeads(params).then((res) => { |