| | |
| | | <el-input |
| | | v-if=" |
| | | editConfig.title == '编辑' || |
| | | (editConfig.title == '新建' && |
| | | codenumer && |
| | | (explain != '' || isIdDisabled)) |
| | | (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" |
| | | <span v-else-if="editConfig.title == '新建'" style="color: #f56c6c" |
| | | >请优先配置编码规范 <el-button type="text" @click="numberClick"> 配置规范 </el-button></span |
| | | > |
| | | <!-- <WordInput |
| | |
| | | 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){ |
| | | 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.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) |
| | | const params = this.saveParams() |
| | | console.log(params) |
| | | if (this.editConfig.title === "新建") { |
| | | getAddClient(params).then((res) => { |
| | | console.log(res) |
| | |
| | | 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 |
| | | }, |