| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户编号" prop="number"> |
| | | <WordInput |
| | | <el-input |
| | | v-if=" |
| | | editConfig.title == '编辑' || |
| | | (editConfig.title == '新建' && codenumer && (explain != '' || isIdDisabled)) |
| | | " |
| | | :disabled="editConfig.title == '编辑'" |
| | | v-model="editConfig.infomation.number" |
| | | placeholder="请输入编码" |
| | | > |
| | | </el-input> |
| | | <span v-else-if="editConfig.title == '新建'" style="color: #f56c6c" |
| | | >请优先配置编码规范 <el-button type="text" @click="numberClick"> 配置规范 </el-button></span |
| | | > |
| | | <!-- <WordInput |
| | | v-if="codenumer && (explain != '' || isIdDisabled)&&method == 0" |
| | | :codenumer="codenumer" |
| | | :sum="sum" |
| | |
| | | </el-button |
| | | ></span |
| | | > |
| | | <span v-else>自动生成</span> |
| | | <span v-else>自动生成</span> --> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <script> |
| | | import { getAllData, getAddClient, getUpdateClient, checkNameClient } from "@/api/client/client" |
| | | import { getCityList } from "@/api/common/address" |
| | | import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"; |
| | | import codeMixin from "@/components/makepager/mixin/codeMixin" |
| | | export default { |
| | | name: "AddClientManageDialog", |
| | | mixins: [codeMixin], |
| | |
| | | dialogWidth: "50%", |
| | | editConfig: this.editClientManageConfig, |
| | | rules: { |
| | | number: [{ required: true, message: "请输入客户编号", trigger: "blur" }], |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }], |
| | | name: [ |
| | | { required: true, message: "请输入客户名称", trigger: "blur" }, |
| | | { required: true, message: "请输入客户名称", trigger: ["change", "blur"] }, |
| | | { |
| | | validator: this.checkNameClient, |
| | | trigger: "blur" |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ], |
| | | client_status_id: [{ required: true, message: "请选择客户状态", trigger: "change" }], |
| | | member_id: [{ required: true, message: "请选择销售负责人", trigger: "change" }], |
| | | approvalOpinion: [{ required: true, message: "请输入审批意见", trigger: "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: false, message: "", trigger: "blur" }, |
| | | { len: 11, message: "长度在11个字符", trigger: "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: "blur" |
| | | trigger: ["change", "blur"] |
| | | } |
| | | ], |
| | | contact_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:{ |
| | | 'editClientManageConfig.visible'(val){ |
| | | if(val){ |
| | | watch: { |
| | | "editClientManageConfig.visible"(val) { |
| | | if (val) { |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | 'editClientManageConfig.infomation.codeStandID'(){ |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | methods: { |
| | | formInfo(){ |
| | | this.objCode.type='客户编码' |
| | | this.objCode.codeStandID = '' |
| | | if(this.editConfig.infomation.codeStandID){ |
| | | this.objCode.codeStandID = this.editConfig.infomation.codeStandID; |
| | | formInfo() { |
| | | this.objCode.type = "客户编码" |
| | | this.objCode.codeStandID = "" |
| | | if (this.editConfig.infomation.codeStandID) { |
| | | this.objCode.codeStandID = this.editConfig.infomation.codeStandID |
| | | } |
| | | this.getRCodeStandardList(); |
| | | }, |
| | | this.getRCodeStandardList() |
| | | }, |
| | | getCommonData() { |
| | | this.editConfig.infomation.country_id = 1 |
| | | this.editConfig.infomation.province_id = |
| | |
| | | getAllData() |
| | | .then((res) => { |
| | | this.memberOptions = res.data.member |
| | | // 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.$set(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 |
| | |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | | const params = this.saveParams() |
| | | console.log(params) |
| | | if (this.editConfig.title === "新建") { |
| | | getAddClient(params).then((res) => { |
| | | console.log(res) |
| | |
| | | this.$parent.handleClose() |
| | | } else { |
| | | this.$parent.getData() |
| | | } |
| | | if (this.editConfig.isResh) { |
| | | this.$emit("reshData") |
| | | } |
| | | } |
| | | }) |
| | |
| | | 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, |
| | | codeRule:this.codeRule, |
| | | codeStandID: data.ID |
| | | } |
| | | return params |
| | | }, |
| | |
| | | async getCityList(val, value) { |
| | | await getCityList({ province_id: val }).then((res) => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.cityOptions = res.data.data.list |
| | | if (res.code === 200) { |
| | | this.cityOptions = res.data.list |
| | | if (value === "sel") { |
| | | this.editConfig.infomation.city_id = "" |
| | | } |