| | |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="120px" |
| | | label-width="110px" |
| | | size="mini" |
| | | > |
| | | <!-- 信息 --> |
| | |
| | | <div v-if="isUnflod" class="basic-info-title">基本信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12" v-if="isUnflod"> |
| | | <!-- <el-col :span="12" v-if="isUnflod"> |
| | | <el-form-item label="联系人编号" prop="number"> |
| | | <WordInput |
| | | v-if="codenumer && (explain != '' || isIdDisabled) && method == 0" |
| | |
| | | > |
| | | <span v-else>自动生成</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系人姓名" prop="name"> |
| | | <el-input v-model="editConfig.infomation.name"></el-input> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <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> |
| | |
| | | import { getAllData } from "@/api/client/client" |
| | | import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | import { getCityList } from "@/api/common/address" |
| | | import codeMixin from "@/views/client/followupRecords/mixin/codeMixin" |
| | | import codeMixin from "@/components/makepager/mixin/codeMixin" |
| | | export default { |
| | | name: "AddContactsDialog", |
| | | mixins: [codeMixin], |
| | |
| | | dialogWidth: "50%", |
| | | editConfig: this.editContactsConfig, |
| | | rules: { |
| | | name: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | number: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | client_name: [{ required: true, message: "请选择客户名称", trigger: "blur" }], |
| | | member_id: [{ required: true, message: "请选择", trigger: "change" }], |
| | | 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: "blur" }, |
| | | { len: 11, message: "长度在11个字符", trigger: "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: "blur" |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ], |
| | | email: [ |
| | | { required: false, message: "", trigger: "blur" }, |
| | | { required: false, message: "", trigger: ["change", "blur"] }, |
| | | { |
| | | pattern: /^[a-zA-Z0-9_\\.]+@[a-zA-Z0-9-]+[\\.a-zA-Z]+$/, |
| | | message: "请输入正确的邮箱格式", |
| | | trigger: "blur" |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ] |
| | | }, |
| | |
| | | this.getCityList(this.editConfig.infomation.province_id, "edit") |
| | | } |
| | | this.getCommonData() |
| | | this.formInfo() |
| | | // this.formInfo() |
| | | }, |
| | | watch: { |
| | | "editContactsConfig.visible"(val) { |
| | | if (val) { |
| | | this.formInfo() |
| | | // this.formInfo() |
| | | console.log("11111") |
| | | } |
| | | }, |
| | | "editContactsConfig.infomation.codeStandID"() { |
| | | this.formInfo() |
| | | // this.formInfo() |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | 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.$set(this.editConfig.infomation, "member_id", item.id) |
| | | } |
| | | }) |
| | | } |
| | | this.provinceOptions = res.data.province |
| | | }) |
| | | }, |
| | |
| | | is_first: data.is_first || false, |
| | | member_id: data.member_id || 0, |
| | | name: data.name || "", |
| | | number: data.number || "", |
| | | // number: data.number || "", |
| | | phone: data.phone || "", |
| | | position: data.position || "", |
| | | province_id: data.province_id || 0, |
| | | region_id: data.region_id || 0, |
| | | wechat: data.wechat || "", |
| | | codeStandID: data.ID, |
| | | codeRule: this.codeRule |
| | | wechat: data.wechat || "" |
| | | // codeStandID: data.ID, |
| | | } |
| | | return params |
| | | }, |
| | |
| | | }, |
| | | selClient(row) { |
| | | console.log(row) |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.clientId = row.id |
| | | this.$set(this.editConfig.infomation, "client_name", row.name) |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient() { |
| | | console.log("sssssssss") |
| | | console.log(this.editConfig.infomation.client_name) |
| | | console.log(this.editConfig.infomation.client_name, "sssssssss") |
| | | // if (this.editConfig.infomation.client_name !== "") { |
| | | this.editConfig.infomation.client_name = "" |
| | | this.clientId = 0 |
| | | this.clientId = null |
| | | this.$set(this.editConfig.infomation, "client_name", "") |
| | | // } |
| | | }, |
| | | // 添加附件 |
| | |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 销售负责人自定义校验规则 |
| | | validateMemberId(rule, value, callback) { |
| | | if (this.editConfig.infomation?.member_id > 0) { |
| | | callback() |
| | | } else { |
| | | callback(new Error("请输入销售负责人")) |
| | | } |
| | | } |
| | | } |
| | | } |