| | |
| | | <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 |
| | |
| | | </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){ |
| | | if(val){ |
| | | watch: { |
| | | "editSalesLeadConfig.visible"(val) { |
| | | if (val) { |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | 'editSalesLeadConfig.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.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") |
| | | res.data.member.map((item) => { |
| | | if (item.username == username) { |
| | | this.$set(this.editConfig.infomation, "member_id", item.id) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | |
| | | // 保存 |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | this.validateFormNumber() |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | | let params = { |
| | | city_id: this.editConfig.infomation.city_id || 0, |
| | | contact_name: this.editConfig.infomation.contact_name || "", |
| | |
| | | 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, |
| | | codeRule:this.codeRule, |
| | | codeStandID: this.editConfig.infomation.ID |
| | | } |
| | | console.log(params) |
| | | if (this.editConfig.title === "新建") { |
| | | getAddSalesLeads(params).then((res) => { |
| | | console.log(res) |
| | |
| | | }, |
| | | // 选择省份 |
| | | selProvinceChange(val) { |
| | | this.cityOptions=[] |
| | | if(val){ |
| | | this.cityOptions = [] |
| | | if (val) { |
| | | this.getCityList(val, "sel") |
| | | } |
| | | }, |
| | |
| | | await getCityList({ province_id: val }).then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | this.cityOptions = res.data.list?res.data.list:[] |
| | | this.cityOptions = res.data.list ? res.data.list : [] |
| | | if (value === "sel") { |
| | | this.editConfig.infomation.city_id = "" |
| | | } |
| | |
| | | .common-select { |
| | | display: flex; |
| | | .common-select-sel { |
| | | width:100%; |
| | | width: 100%; |
| | | } |
| | | .common-select-btn { |
| | | margin-left: 5px; |
| | |
| | | height: 30px; |
| | | justify-content: center; |
| | | align-items: center; |
| | | cursor:pointer; |
| | | cursor: pointer; |
| | | color: #6166d3; |
| | | } |
| | | } |