|
@@ -9,8 +9,8 @@
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
:append-to-body="true"
|
|
:append-to-body="true"
|
|
|
:maxable="true"
|
|
:maxable="true"
|
|
|
- :resizable="true"
|
|
|
|
|
- width="60%"
|
|
|
|
|
|
|
+ :resizable="true"
|
|
|
|
|
+ width="50%"
|
|
|
>
|
|
>
|
|
|
<el-form
|
|
<el-form
|
|
|
label-width="100px"
|
|
label-width="100px"
|
|
@@ -24,8 +24,8 @@
|
|
|
v-model="form.linkId"
|
|
v-model="form.linkId"
|
|
|
multiple
|
|
multiple
|
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
|
- style="width: 300px"
|
|
|
|
|
@change="onchangeLink"
|
|
@change="onchangeLink"
|
|
|
|
|
+ style="width: 100%"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in linkNameOptions"
|
|
v-for="item in linkNameOptions"
|
|
@@ -36,13 +36,32 @@
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="商机名称" prop="opportunityId">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ clearable
|
|
|
|
|
+ v-model="form.opportunityId"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ @change="onchangeOpportunity"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in opportunityList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
<el-form-item label="跟进时间" prop="followupTime">
|
|
<el-form-item label="跟进时间" prop="followupTime">
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
v-model="form.followupTime"
|
|
v-model="form.followupTime"
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="结束时间"
|
|
placeholder="结束时间"
|
|
|
type="datetime"
|
|
type="datetime"
|
|
|
- style="width: 200px"
|
|
|
|
|
|
|
+ style="width: 100%"
|
|
|
class="filter-item"
|
|
class="filter-item"
|
|
|
></el-date-picker>
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -82,15 +101,15 @@
|
|
|
:showLib="false"
|
|
:showLib="false"
|
|
|
:limit="5"
|
|
:limit="5"
|
|
|
/> -->
|
|
/> -->
|
|
|
- <fileMain v-model="form.files" ></fileMain>
|
|
|
|
|
-
|
|
|
|
|
- </el-form-item
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <fileMain v-model="form.files"></fileMain>
|
|
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button size="small" @click="handleClose">关 闭</el-button>
|
|
<el-button size="small" @click="handleClose">关 闭</el-button>
|
|
|
- <el-button size="small" @click="sumbit" type="primary" v-click-once>确 认</el-button>
|
|
|
|
|
|
|
+ <el-button size="small" @click="sumbit" type="primary" v-click-once
|
|
|
|
|
+ >确 认</el-button
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
</ele-modal>
|
|
</ele-modal>
|
|
|
</div>
|
|
</div>
|
|
@@ -101,15 +120,16 @@
|
|
|
import { deepClone } from '@/utils/index';
|
|
import { deepClone } from '@/utils/index';
|
|
|
// import fileMain from '@/components/upload/fileUpload';
|
|
// import fileMain from '@/components/upload/fileUpload';
|
|
|
|
|
|
|
|
- import {
|
|
|
|
|
|
|
+ import { getTableList } from '@/api/saleManage/businessOpportunity';
|
|
|
|
|
|
|
|
|
|
+ import {
|
|
|
UpdateInformation,
|
|
UpdateInformation,
|
|
|
addInformation,
|
|
addInformation,
|
|
|
getcontactlink
|
|
getcontactlink
|
|
|
} from '@/api/saleManage/businessFollow';
|
|
} from '@/api/saleManage/businessFollow';
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
mixins: [dictMixins],
|
|
|
- components:{
|
|
|
|
|
|
|
+ components: {
|
|
|
// fileUpload
|
|
// fileUpload
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
@@ -123,8 +143,7 @@
|
|
|
nextPlan: '',
|
|
nextPlan: '',
|
|
|
opportunityId: '',
|
|
opportunityId: '',
|
|
|
stageCode: '',
|
|
stageCode: '',
|
|
|
- files: [],
|
|
|
|
|
-
|
|
|
|
|
|
|
+ files: []
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
@@ -137,6 +156,9 @@
|
|
|
formDef,
|
|
formDef,
|
|
|
form: copyObj(formDef),
|
|
form: copyObj(formDef),
|
|
|
rules: {
|
|
rules: {
|
|
|
|
|
+ linkId: [
|
|
|
|
|
+ { required: true, message: '选择客户联系人', trigger: 'change' }
|
|
|
|
|
+ ],
|
|
|
content: [
|
|
content: [
|
|
|
{ required: true, message: '请输入跟进内容', trigger: 'blur' }
|
|
{ required: true, message: '请输入跟进内容', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
@@ -146,7 +168,7 @@
|
|
|
stageCode: [
|
|
stageCode: [
|
|
|
{ required: true, message: '请选择跟进阶段', trigger: 'change' }
|
|
{ required: true, message: '请选择跟进阶段', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
linkName: [
|
|
linkName: [
|
|
|
{
|
|
{
|
|
|
required: true,
|
|
required: true,
|
|
@@ -159,13 +181,16 @@
|
|
|
// 提交状态
|
|
// 提交状态
|
|
|
loading: false,
|
|
loading: false,
|
|
|
// 是否是修改
|
|
// 是否是修改
|
|
|
- isUpdate: false
|
|
|
|
|
|
|
+ isUpdate: false,
|
|
|
|
|
+ opportunityList: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {},
|
|
created() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
//更改弹框状态
|
|
//更改弹框状态
|
|
|
async open(type, row, currentDetail) {
|
|
async open(type, row, currentDetail) {
|
|
|
|
|
+ console.log(row, currentDetail);
|
|
|
|
|
+
|
|
|
this.title = type === 'add' ? '新增' : '修改';
|
|
this.title = type === 'add' ? '新增' : '修改';
|
|
|
this.currentDetail = currentDetail;
|
|
this.currentDetail = currentDetail;
|
|
|
this.row = copyObj(row);
|
|
this.row = copyObj(row);
|
|
@@ -175,11 +200,25 @@
|
|
|
this.isUpdate = false;
|
|
this.isUpdate = false;
|
|
|
} else {
|
|
} else {
|
|
|
this.isUpdate = true;
|
|
this.isUpdate = true;
|
|
|
- this.row.linkId = this.row.linkId&&this.row.linkId.split(',') || [];
|
|
|
|
|
- this.form = this.row
|
|
|
|
|
|
|
+ this.row.linkId =
|
|
|
|
|
+ (this.row.linkId && this.row.linkId.split(',')) || [];
|
|
|
|
|
+ this.form = this.row;
|
|
|
|
|
+ this.getOpportunityList();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ async getOpportunityList() {
|
|
|
|
|
+ let res = await getTableList({
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ size: 10,
|
|
|
|
|
+ contactId: this.row.contactId
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+
|
|
|
|
|
+ this.opportunityList = res.list;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
//表单验证
|
|
//表单验证
|
|
|
getValidate() {
|
|
getValidate() {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
@@ -216,6 +255,17 @@
|
|
|
this.form.linkName = selectedLabels;
|
|
this.form.linkName = selectedLabels;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ onchangeOpportunity(value) {
|
|
|
|
|
+ if (!value) {
|
|
|
|
|
+ this.form.opportunityName = '';
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.form.opportunityName = this.opportunityList.find(
|
|
|
|
|
+ (item) => item.id === value
|
|
|
|
|
+ )?.name;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
//保存
|
|
//保存
|
|
|
async sumbit() {
|
|
async sumbit() {
|
|
|
try {
|
|
try {
|
|
@@ -228,14 +278,16 @@
|
|
|
}
|
|
}
|
|
|
let _stageName = this.getDictValue('商机阶段', this.form.stageCode);
|
|
let _stageName = this.getDictValue('商机阶段', this.form.stageCode);
|
|
|
let params = deepClone(this.form);
|
|
let params = deepClone(this.form);
|
|
|
- let { contactId, id } = this.currentDetail;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ let { contactId } = this.currentDetail;
|
|
|
params = Object.assign({}, params, {
|
|
params = Object.assign({}, params, {
|
|
|
contactId: contactId,
|
|
contactId: contactId,
|
|
|
- opportunityId: id,
|
|
|
|
|
linkId: params?.linkId?.join(',') || '',
|
|
linkId: params?.linkId?.join(',') || '',
|
|
|
stageName: _stageName,
|
|
stageName: _stageName,
|
|
|
files: this.form.files || []
|
|
files: this.form.files || []
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ console.log(params);
|
|
|
if (this.isUpdate) {
|
|
if (this.isUpdate) {
|
|
|
UpdateInformation(params)
|
|
UpdateInformation(params)
|
|
|
.then((res) => {
|
|
.then((res) => {
|