| | |
| | | append-to-body |
| | | custom-class="iframe-dialog" |
| | | > |
| | | <el-form |
| | | <el-form v-if="refreshFlag" |
| | | ref="form" |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="308px" |
| | | label-width="208px" |
| | | size="mini" |
| | | style="height: 60vh; overflow-x: hidden" |
| | | > |
| | |
| | | <div class="basic-info-title">机会基本信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="销售机会编号" prop="number">--> |
| | | <!-- <el-input v-model="editConfig.infomation.number"></el-input>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售机会编号" prop="number"> |
| | | <WordInput |
| | | v-if="codenumer && (explain != '' || isIdDisabled)&&method == 0" |
| | | :codenumer="codenumer" |
| | | :sum="sum" |
| | | :disabled="editConfig.infomation.id || 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>{{editConfig.title==='新建'? '自动生成': editConfig.infomation.number}}</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户名称" prop="client_name"> |
| | | <el-form-item label="客户名称" prop="client_name" ref="clientName"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.client_name" |
| | |
| | | <div class="common-select-btn" @click="selClientClick('client')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient('client')"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | <div |
| | | v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0" |
| | | class="common-select-btn" |
| | | @click="clearupClient('client')" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </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> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <div class="common-select-btn" @click="selClientClick('contact')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient('contact')"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | <div |
| | | v-if="editConfig.infomation.contact_name && editConfig.infomation.contact_name.length > 0" |
| | | class="common-select-btn" |
| | | @click="clearupClient('contact')" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | v-model="editConfig.infomation.member_id" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 63%" |
| | | style="width: 100%" |
| | | > |
| | | <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> |
| | | </el-option> |
| | |
| | | <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" |
| | |
| | | v-model="editConfig.infomation.currency" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 63%" |
| | | style="width: 100%" |
| | | > |
| | | <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | |
| | | </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: 100%" |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | v-model="editConfig.infomation.expected_time" |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | style="width: 100%" |
| | | placeholder="选择日期" |
| | | > |
| | | </el-date-picker> |
| | |
| | | <div class="basic-info-title">商机七要素(5W2P)</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-col> |
| | | <el-form-item label="客户需求或痛点(why)" prop="pain_points"> |
| | | <el-input |
| | | type="textarea" |
| | | style="width: 100%" |
| | | :autosize="{ minRows: 2 }" |
| | | v-model="editConfig.infomation.pain_points" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-col> |
| | | <el-form-item label="是否已经立项(plan)" prop="whether_established"> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-col> |
| | | <el-form-item label="资金预算是多少(plan)" prop="capital_budget"> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-col> |
| | | <el-form-item label="关键决策人是谁(who)" prop="key_maker"> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-col> |
| | | <el-form-item label="关键决策因素有哪些(what)" prop="key_factors"> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-col> |
| | | <el-form-item label="决策流程是怎样的(what)" prop="process"> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-col> |
| | | <el-form-item label="竞争对手提供的方案(what)" prop="solutions"> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 2 }" |
| | | v-model="editConfig.infomation.advantage" |
| | | v-model="editConfig.infomation.advantages" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> --> |
| | | <el-col :span="20"> |
| | | <el-col> |
| | | <el-form-item label="详细地址" prop="detail_address"> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | <div class="basic-info-title">备注信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-col> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog" |
| | | import { getCityList } from "@/api/common/address" |
| | | import WordInput from "@/components/wordInput.vue"; |
| | | import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"; |
| | | export default { |
| | | name: "AddSalesOpportunityDialog", |
| | | mixins:[codeMixin], |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | |
| | | } |
| | | } |
| | | }, |
| | | components: { SelectClientDialog, SelectContactDialog }, |
| | | components: {WordInput, SelectClientDialog, SelectContactDialog }, |
| | | computed: { |
| | | searchCommonHeight() { |
| | | return this.$refs.searchCommonView.offsetHeight |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "80%", |
| | | refreshFlag:true, |
| | | dialogWidth: "50%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | 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" }] |
| | | projected_amount: [{ required: true, message: "请输入预计合同金额", trigger: "blur" }], |
| | | client_name: [{ required: true, message: "请选择客户", trigger: "change" }], |
| | | }, |
| | | businessSourceOptions: [], |
| | | memberOptions: [], |
| | |
| | | }, |
| | | restaurants: [], |
| | | clientId: this.editCommonConfig.infomation.client_id, |
| | | contactId: this.editCommonConfig.infomation.contact_id |
| | | contactId: this.editCommonConfig.infomation.contact_id, |
| | | objCode: { name: "", page: 0, pageSize: 0, type: "销售机会编码",codeStandID:'' }, |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getCityList(this.editConfig.infomation.province_id, "edit") |
| | | } |
| | | this.getCommonData() |
| | | this.formInfo(); |
| | | }, |
| | | watch:{ |
| | | 'editConfig.visible'(val){ |
| | | if(val){ |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | 'editConfig.infomation.codeStandID'(){ |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | methods: { |
| | | formInfo(){ |
| | | 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 = |
| | |
| | | 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() |
| | | } |
| | | this.$message.success("添加成功") |
| | | this.$parent.getData() |
| | | // } |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | message: "编辑成功", |
| | | type: "success" |
| | | }) |
| | | this.$message.success("编辑成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | |
| | | 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: data.projected_amount || 0, |
| | | province_id: data.province_id || 0, |
| | |
| | | whether_established: data.whether_established || "", |
| | | |
| | | remark: data.remark || "", |
| | | detail_address: data.detail_address || "" |
| | | detail_address: data.detail_address || "", |
| | | |
| | | codeStandID:data.ID, |
| | | codeRule:this.codeRule, |
| | | } |
| | | return params |
| | | }, |
| | |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.clientId = row.id |
| | | } |
| | | this.refresh() |
| | | }, |
| | | /** |
| | | * 强制刷新form组件 |
| | | * 外部更改表单值不会触发表单校验,导致即使有值夜被表单校验阻塞住 |
| | | */ |
| | | refresh(){ |
| | | this.refreshFlag=false |
| | | requestAnimationFrame(()=>{ |
| | | this.refreshFlag=true |
| | | }) |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient(value) { |
| | |
| | | this.editConfig.infomation.contact_name = "" |
| | | this.contactId = 0 |
| | | } |
| | | this.refresh() |
| | | }, |
| | | // 添加附件 |
| | | addAnnexClick() {}, |
| | |
| | | } |
| | | .common-select { |
| | | .common-select-sel { |
| | | width: 270px; |
| | | flex: 1; |
| | | } |
| | | } |
| | | .custom-name{ |
| | | .el-autocomplete{ |
| | | flex: 1; |
| | | } |
| | | } |
| | | } |