| | |
| | | </el-option> |
| | | </el-select> |
| | | <!-- @click="editDropdownBox" --> |
| | | <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-option> |
| | | </el-select> |
| | | <!-- @click="editDropdownBox" --> |
| | | <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-option> |
| | | </el-select> |
| | | <!-- @click="editDropdownBox" --> |
| | | <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-option> |
| | | </el-select> |
| | | <!-- @click="editDropdownBox" --> |
| | | <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> |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="可能性(%)" prop="possibilities"> |
| | | <el-form-item label="可能性(%)" prop="possibilities_id"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.possibilities" |
| | | v-model="editConfig.infomation.possibilities_id" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | <!-- @click="editDropdownBox" --> |
| | | <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> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预算绝对值" prop="budget"> |
| | | <el-input v-model="editConfig.infomation.budget"></el-input> |
| | | <el-input-number |
| | | v-model="editConfig.infomation.budget" |
| | | placeholder="请输入" |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | | style="width: 25%; margin-right: 5px" |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计成交日期" prop="expected_time"> |
| | | <el-date-picker v-model="editConfig.infomation.expected_time" type="date" placeholder="选择日期"> |
| | | <el-date-picker |
| | | v-model="editConfig.infomation.expected_time" |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计合同金额" prop="projected_amount"> |
| | | <el-input v-model="editConfig.infomation.projected_amount"></el-input> |
| | | <el-input-number |
| | | v-model="editConfig.infomation.projected_amount" |
| | | placeholder="请输入" |
| | | :min="0" |
| | | :controls="false" |
| | | style="width: 100%; margin-right: 5px" |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-option> |
| | | </el-select> |
| | | <!-- @click="editDropdownBox" --> |
| | | <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-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 2 }" |
| | | v-model="editConfig.infomation.advantage" |
| | | v-model="editConfig.infomation.advantages" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | 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-col> --> |
| | | <el-col :span="20"> |
| | | <el-form-item label="详细地址" prop="detail_address"> |
| | | <el-input |
| | |
| | | import { getAddSaleChance, getUpdateSaleChance } from "@/api/sales/salesOpportunity" |
| | | import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog" |
| | | import { getCityList } from "@/api/common/address" |
| | | export default { |
| | | name: "AddSalesOpportunityDialog", |
| | | props: { |
| | |
| | | dialogWidth: "80%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | number: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | name: [{ required: true, message: "请选择", trigger: "change" }], |
| | | member_id: [{ required: true, message: "请选择", trigger: "change" }], |
| | | sale_stage_id: [{ required: true, message: "请选择", trigger: "change" }], |
| | | currency: [{ required: true, message: "请选择", trigger: "change" }], |
| | | expected_time: [{ required: true, message: "请选择", trigger: "change" }], |
| | | projected_amount: [{ required: true, message: "请选择", trigger: "change" }] |
| | | number: [{ required: true, message: "请输入销售机会编号", trigger: "blur" }], |
| | | name: [{ required: true, message: "请输入机会名称", trigger: "blur" }], |
| | | member_id: [{ required: true, message: "请选择销售负责人", trigger: "change" }], |
| | | sale_stage_id: [{ required: true, message: "请选择销售阶段", trigger: "change" }], |
| | | currency: [{ required: true, message: "请选择币种", trigger: "change" }], |
| | | expected_time: [{ required: true, message: "请选择预计成交日期", trigger: "change" }], |
| | | projected_amount: [{ required: true, message: "请输入预计合同金额", trigger: "blur" }] |
| | | }, |
| | | businessSourceOptions: [], |
| | | memberOptions: [], |
| | |
| | | saleStageOptions: [], // 销售阶段 |
| | | oldCustomerMarketOptions: [], // 老客户营销 |
| | | possibleOptions: [], // 可能性 |
| | | currencyOptions: [], // 币种 |
| | | currencyOptions: [{ id: 1, name: "人民币" }], // 币种 |
| | | currentStateOptions: [], // 当前状态 |
| | | countryOptions: [], // 国家 |
| | | countryOptions: [{ id: 1, name: "中国" }], // 国家 |
| | | provinceOptions: [], // 省份 |
| | | cityOptions: [], // 城市 |
| | | regionOptions: [], // 区域 |
| | |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.$store.dispatch("geContact") |
| | | if (this.editConfig.title !== "新建" && this.editConfig.infomation.province_id !== 0) { |
| | | this.getCityList(this.editConfig.infomation.province_id, "edit") |
| | | } |
| | | this.getCommonData() |
| | | }, |
| | | methods: { |
| | | 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) => { |
| | | // 缺 可能性 币种 当前状态 |
| | | this.memberOptions = res.data.member |
| | | this.businessSourceOptions = res.data.sales_source |
| | | this.businessTypeOptions = res.data.sale_type |
| | | this.oldCustomerMarketOptions = res.data.regular_customers |
| | | this.saleStageOptions = res.data.sale_stage |
| | | this.countryOptions = res.data.country |
| | | this.provinceOptions = res.data.province |
| | | this.cityOptions = res.data.city |
| | | this.regionOptions = res.data.region |
| | | this.possibleOptions = res.data.possibility |
| | | this.currencyOptions = res.data.currency |
| | | // this.currencyOptions = res.data.currency |
| | | this.currentStateOptions = res.data.status |
| | | }) |
| | | .catch((err) => { |
| | |
| | | const params = this.saveParams() |
| | | console.log(params) |
| | | if (this.editConfig.title === "新建") { |
| | | getAddSaleChance(params) |
| | | .then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | message: "添加成功", |
| | | type: "success" |
| | | }) |
| | | if (this.editConfig.title === "新建" && this.editConfig.infomation.client_name) { |
| | | this.$parent.handleClose() |
| | | } else { |
| | | this.$parent.getData() |
| | | } |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | }) |
| | | getAddSaleChance(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getData() |
| | | // } |
| | | } |
| | | }) |
| | | } else { |
| | | getUpdateSaleChance(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) |
| | | }) |
| | | getUpdateSaleChance(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") |
| | |
| | | budget: data.budget || 0, |
| | | capital_budget: data.capital_budget || "", |
| | | city_id: data.city_id || 0, |
| | | client_id: parseInt(this.clientId), |
| | | client_id: this.clientId || 0, |
| | | competitors: data.competitors || "", |
| | | contact_id: parseInt(this.contactId), |
| | | contact_id: this.contactId || 0, |
| | | country_id: data.country_id || 0, |
| | | currency: data.currency || 0, |
| | | disadvantages: data.disadvantages || "", |
| | |
| | | number: data.number || "", |
| | | opportunities: data.opportunities || "", |
| | | pain_points: data.pain_points || "", |
| | | possibilities: data.possibilities || 0, |
| | | possibilities: data.possibilities_id || 0, |
| | | process: data.process || "", |
| | | projected_amount: parseInt(data.projected_amount) || 0, |
| | | projected_amount: data.projected_amount || 0, |
| | | province_id: data.province_id || 0, |
| | | region_id: data.region_id || 0, |
| | | regular_customers_id: data.regular_customers_id || 0, |
| | |
| | | // 添加附件 |
| | | addAnnexClick() {}, |
| | | // 设置允许上传文件格式 |
| | | setFormatClick() {} |
| | | setFormatClick() {}, |
| | | // 选择省份 |
| | | selProvinceChange(val) { |
| | | this.getCityList(val, "sel") |
| | | }, |
| | | 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 (value === "sel") { |
| | | this.editConfig.infomation.city_id = "" |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | height: 55px; |
| | | line-height: 55px; |
| | | } |
| | | .el-input__inner { |
| | | text-align: left; |
| | | } |
| | | } |
| | | } |
| | | </style> |