| | |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="308px" |
| | | label-width="130px" |
| | | size="mini" |
| | | > |
| | | <!-- 信息 --> |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户名称" prop="name"> |
| | | <el-input v-model="editConfig.infomation.name"></el-input> |
| | | <el-form-item label="销售线索编号" prop="number"> |
| | | <WordInput |
| | | v-if="codenumer && (explain != '' || isIdDisabled)&&method == 0" |
| | | :codenumer="codenumer" |
| | | :sum="sum" |
| | | :disabled="this.editConfig.title !== '新建' || isIdDisabled" |
| | | :inputValue="inputValue" |
| | | @codeList="codeList" |
| | | /> |
| | | <span v-else-if="method == 0" style="color: #f56c6c" |
| | | >请优先配置编码规范 |
| | | <el-button type="text" @click="numberClick"> |
| | | 配置规范 |
| | | </el-button |
| | | ></span |
| | | > |
| | | <span v-else>自动生成</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售线索编号" prop="number"> |
| | | <el-input v-model="editConfig.infomation.number"></el-input> |
| | | <el-form-item label="意向客户名称" prop="name"> |
| | | <el-input v-model="editConfig.infomation.name" style="width: 100%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- </el-row> |
| | | <el-row> --> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系人姓名" prop="contact_name"> |
| | | <el-input v-model="editConfig.infomation.contact_name"></el-input> |
| | |
| | | <el-input v-model="editConfig.infomation.contact_position"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- </el-row> |
| | | <el-row> --> |
| | | <el-col :span="12"> |
| | | <el-form-item label="手机号码" prop="contact_phone"> |
| | | <el-input v-model="editConfig.infomation.contact_phone"></el-input> |
| | | <el-input |
| | | v-model="editConfig.infomation.contact_phone" |
| | | maxlength="11" |
| | | show-word-limit |
| | | oninput="value=value.replace(/[^\d]/g,'')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="商机状态" prop="businessStatus"> |
| | | <el-form-item label="线索状态" prop="businessStatus"> |
| | | <span>{{ editConfig.infomation.businessStatus }}</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="商机来源" prop="sales_sources_id"> |
| | | <el-form-item label="线索来源" prop="sales_sources_id"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.sales_sources_id" |
| | |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <div class="common-select-btn" @click="editDropdownBox"> |
| | | <!-- <div class="common-select-btn" @click="editDropdownBox"> |
| | | <i class="el-icon-setting"></i> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="负责人" prop="member_id"> |
| | | <el-select v-model="editConfig.infomation.member_id" placeholder="请选择" size="mini"> |
| | | <el-option v-for="item in ownerOptions" :key="item.id" :label="item.username" :value="item.id"> |
| | | <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> |
| | | </el-form-item> |
| | |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | disabled |
| | | > |
| | | <el-option v-for="item in countryOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <div class="common-select-btn"><i class="el-icon-setting"></i></div> |
| | | <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> --> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | @change="selProvinceChange" |
| | | > |
| | | <el-option v-for="item in provinceOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <div class="common-select-btn"><i class="el-icon-setting"></i></div> |
| | | <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> --> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | :disabled="cityOptions.length <= 0 ? true : false" |
| | | > |
| | | <el-option v-for="item in cityOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <div class="common-select-btn"><i class="el-icon-setting"></i></div> |
| | | <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> --> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <!-- <el-col :span="12"> |
| | | <el-form-item label="区域" prop="region_id"> |
| | | <div class="common-select"> |
| | | <el-select |
| | |
| | | <div class="common-select-btn"><i class="el-icon-setting"></i></div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | </el-col> --> |
| | | <!-- </el-row> --> |
| | | <!-- <el-row> --> |
| | | <el-col :span="24"> |
| | | <el-form-item label="地址" prop="address"> |
| | | <el-form-item label="详细地址" prop="detail_address"> |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 2, maxRows: 4 }" |
| | | placeholder="请输入内容" |
| | | v-model="editConfig.infomation.address" |
| | | v-model="editConfig.infomation.detail_address" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog" |
| | | import { getAddSalesLeads, getUpdateSalesLeads } from "@/api/client/salesLead" |
| | | import { getAllData } from "@/api/client/client" |
| | | |
| | | import { getCityList } from "@/api/common/address" |
| | | import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"; |
| | | export default { |
| | | name: "AddSalesLeadDialog", |
| | | mixins: [codeMixin], |
| | | props: { |
| | | editSalesLeadConfig: { |
| | | type: Object, |
| | |
| | | return { |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: { |
| | | name: "", |
| | | number: "LEA50", |
| | | contact_name: "", |
| | | contact_position: "", |
| | | contact_phone: "", |
| | | businessStatus: "", |
| | | sales_sources_id: "", |
| | | member_id: "", |
| | | country_id: "", |
| | | province_id: "", |
| | | city_id: "", |
| | | region_id: "", |
| | | address: "", |
| | | desc: "", |
| | | id: "" |
| | | } |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | components: { EditDropdownDialog }, |
| | | computed: { |
| | | searchCommonHeight() { |
| | | return this.$refs.searchCommonView.offsetHeight |
| | | } |
| | | }, |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | dialogWidth: "80%", |
| | | dialogWidth: "50%", |
| | | editConfig: this.editSalesLeadConfig, |
| | | rules: { |
| | | name: [{ required: true, message: "请输入客户名称", trigger: "blur" }], |
| | | number: [{ required: true, message: "请输入销售线索编号", trigger: "blur" }], |
| | | businessStatus: [{ required: true, message: "请输入商机状态", trigger: "blur" }], |
| | | sales_sources_id: [{ required: true, message: "请选择商机来源", trigger: "change" }] |
| | | name: [{ required: true, message: "请输入客户名称", trigger: ["change",'blur' ]}], |
| | | number: [{ required: true, message: "请输入销售线索编号", 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' ] }, |
| | | { |
| | | 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' ] |
| | | } |
| | | ] |
| | | }, |
| | | businessSourceOptions: [], |
| | | ownerOptions: [ |
| | | { value: "1", label: "BOSS" }, |
| | | { value: "2", label: "Mia" }, |
| | | { value: "3", label: "财务" }, |
| | | { value: "4", label: "市场" }, |
| | | { value: "5", label: "系统管理员" }, |
| | | { value: "6", label: "销售" }, |
| | | { value: "7", label: "销售总监" } |
| | | ], |
| | | countryOptions: [], // 国家 |
| | | memberOptions: [], |
| | | countryOptions: [{ id: 1, name: "中国" }], // 国家 |
| | | provinceOptions: [], // 省份 |
| | | cityOptions: [], // 城市 |
| | | regionOptions: [], // 区域 |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | if (this.editConfig.title !== "新建" && this.editConfig.infomation.province_id != 0) { |
| | | this.getCityList(this.editConfig.infomation.province_id, "edit") |
| | | } |
| | | this.getCommonData() |
| | | this.formInfo(); |
| | | }, |
| | | mounted() {}, |
| | | 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; |
| | | } |
| | | this.getRCodeStandardList(); |
| | | }, |
| | | getCommonData() { |
| | | this.editConfig.infomation.country_id = 1 |
| | | this.editConfig.infomation.province_id = |
| | | this.editConfig.infomation.province_id === 0 ? "" : this.editConfig.infomation.province_id |
| | | this.editConfig.infomation.city_id = |
| | | this.editConfig.infomation.city_id === 0 ? "" : this.editConfig.infomation.city_id |
| | | getAllData() |
| | | .then((res) => { |
| | | console.log(res) |
| | | this.businessSourceOptions = res.data.sales_source |
| | | this.countryOptions = res.data.country |
| | | // this.countryOptions = res.data.country |
| | | this.provinceOptions = res.data.province |
| | | this.cityOptions = res.data.city |
| | | this.regionOptions = res.data.region |
| | | this.memberOptions = res.data.member |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | |
| | | // 保存 |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | this.validateFormNumber() |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | | let params = { |
| | |
| | | number: this.editConfig.infomation.number || "", |
| | | province_id: this.editConfig.infomation.province_id || 0, |
| | | region_id: this.editConfig.infomation.region_id || 0, |
| | | sales_sources_id: this.editConfig.infomation.sales_sources_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, |
| | | } |
| | | console.log(params) |
| | | if (this.editConfig.title === "新建") { |
| | | getAddSalesLeads(params) |
| | | .then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | message: "添加成功", |
| | | type: "success" |
| | | }) |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | }) |
| | | getAddSalesLeads(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } else { |
| | | getUpdateSalesLeads(params) |
| | | .then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | message: "编辑成功", |
| | | type: "success" |
| | | }) |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | }) |
| | | getUpdateSalesLeads(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("编辑成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | console.log("error submit") |
| | |
| | | }, |
| | | // 编辑下拉框 |
| | | editDropdownBox() { |
| | | console.log("aaa") |
| | | this.editDropdownConfig.editVisible = true |
| | | this.editDropdownConfig.title = "商机来源" |
| | | }, |
| | | // 手机号输入 |
| | | confirmPhone(value) { |
| | | const inputValue = value.replace(/[^\d*]/g, "") |
| | | this.editConfig.infomation.contact_phone = inputValue |
| | | }, |
| | | // 选择省份 |
| | | selProvinceChange(val) { |
| | | this.cityOptions=[] |
| | | if(val){ |
| | | this.getCityList(val, "sel") |
| | | } |
| | | }, |
| | | async getCityList(val, value) { |
| | | await getCityList({ province_id: val }).then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | this.cityOptions = res.data.list?res.data.list:[] |
| | | if (value === "sel") { |
| | | this.editConfig.infomation.city_id = "" |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | .common-select { |
| | | display: flex; |
| | | .common-select-sel { |
| | | width: 270px; |
| | | width:100%; |
| | | } |
| | | .common-select-btn { |
| | | margin-left: 5px; |
| | |
| | | height: 30px; |
| | | justify-content: center; |
| | | align-items: center; |
| | | cursor:pointer; |
| | | color: #6166d3; |
| | | } |
| | | } |