|
|
@@ -13,12 +13,29 @@
|
|
|
<headerTitle title="基本信息"></headerTitle>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
+
|
|
|
+ <el-form-item
|
|
|
+ label="询价方名称"
|
|
|
+ prop="contactName"
|
|
|
+ style="margin-bottom: 22px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.contactName"
|
|
|
+ @click.native="handParent"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item
|
|
|
label="关联商机"
|
|
|
prop="opportunityId"
|
|
|
style="margin-bottom: 22px"
|
|
|
>
|
|
|
- <el-select v-model="form.opportunityId" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-select
|
|
|
+ v-model="form.opportunityId"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in businessList"
|
|
|
:key="item.id"
|
|
|
@@ -28,26 +45,14 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="询价方名称"
|
|
|
- prop="contactName"
|
|
|
- style="margin-bottom: 22px"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.contactName"
|
|
|
- @click.native="handParent"
|
|
|
- placeholder="请输入"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
<el-form-item
|
|
|
label="询价方联系人"
|
|
|
prop="contactLinkName"
|
|
|
style="margin-bottom: 22px"
|
|
|
>
|
|
|
<el-select
|
|
|
- v-model="form.contactLinkName" style="width: 100%;"
|
|
|
+ v-model="form.contactLinkName"
|
|
|
+ style="width: 100%"
|
|
|
placeholder="请选择"
|
|
|
@change="onchangeLink"
|
|
|
@focus="selectFocus"
|
|
|
@@ -122,7 +127,22 @@
|
|
|
prop="quoteName"
|
|
|
style="margin-bottom: 22px"
|
|
|
>
|
|
|
- <el-input clearable v-model="form.quoteName" placeholder="请输入" />
|
|
|
+ <el-input v-if="enterprisePage.length <=1" clearable v-model="form.quoteName" placeholder="请输入" />
|
|
|
+ <el-select
|
|
|
+ v-if="enterprisePage.length > 1"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.quoteName"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="getEnterprise()"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in enterprisePage"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.name"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
|
|
@@ -262,6 +282,7 @@
|
|
|
submit
|
|
|
} from '@/api/saleManage/quotation';
|
|
|
import { getTableList } from '@/api/saleManage/businessOpportunity';
|
|
|
+ import { enterprisePage } from '@/api/contractManage/contractBook';
|
|
|
import { getcontactlink } from '@/api/saleManage/businessFollow';
|
|
|
import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
|
|
|
import { copyObj } from '@/utils/util';
|
|
|
@@ -324,10 +345,9 @@
|
|
|
tableLinkData: [],
|
|
|
businessList: [], //商机列表
|
|
|
rules: {
|
|
|
-
|
|
|
- opportunityId: [
|
|
|
- { required: true, message: '请选择关联商机', trigger: 'change' }
|
|
|
- ],
|
|
|
+ // opportunityId: [
|
|
|
+ // { required: true, message: '请选择关联商机', trigger: 'change' }
|
|
|
+ // ],
|
|
|
contactName: [
|
|
|
{ required: true, message: '请选择客户', trigger: 'change' }
|
|
|
],
|
|
|
@@ -391,9 +411,13 @@
|
|
|
// 组织机构树形结构数据
|
|
|
groupTreeData: [],
|
|
|
// 组织机构平铺数据
|
|
|
- groupData: []
|
|
|
+ groupData: [],
|
|
|
+ enterprisePage: []
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getEnterprisePage();
|
|
|
+ },
|
|
|
|
|
|
methods: {
|
|
|
//获取详情
|
|
|
@@ -496,14 +520,38 @@
|
|
|
this.title = type === 'add' ? '新增' : '修改';
|
|
|
this.row = row;
|
|
|
this.visible = true;
|
|
|
+ if (this.enterprisePage.length == 0) {
|
|
|
+ await this.getEnterprisePage();
|
|
|
+ }
|
|
|
if (type == 'add') {
|
|
|
this.isUpdate = false;
|
|
|
+ if (this.enterprisePage.length > 0) {
|
|
|
+ this.form.quoteName = this.enterprisePage[0].name;
|
|
|
+ this.form.quoteTel = this.enterprisePage[0].tel;
|
|
|
+ this.form.quoteAddress = this.enterprisePage[0].address;
|
|
|
+ }
|
|
|
} else {
|
|
|
this.isUpdate = true;
|
|
|
this.getDetailData(row.id);
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ getEnterprisePage() {
|
|
|
+ enterprisePage({
|
|
|
+ pageNum: 1,
|
|
|
+ size: 100
|
|
|
+ }).then((res) => {
|
|
|
+ this.enterprisePage = [];
|
|
|
+ this.enterprisePage.push(...res.list);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getEnterprise() {
|
|
|
+ let data = this.enterprisePage.find(
|
|
|
+ (item) => item.name == this.form.quoteName
|
|
|
+ );
|
|
|
+ this.form.quoteName = data.name;
|
|
|
+ this.form.quoteTel = data.tel;
|
|
|
+ this.form.quoteAddress = data.address;
|
|
|
+ },
|
|
|
salesmanChange(val, info) {
|
|
|
this.otherForm.salesmanName = info.name;
|
|
|
},
|