|
@@ -8,13 +8,20 @@
|
|
|
<el-form-item label="相关房源">
|
|
|
<select-house ref="selectHouse" :ids="form.projectItemTargetRoomIds"></select-house>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="租客类型">
|
|
|
+ <el-form-item label="关联合同" v-if="type == 3">
|
|
|
+ <el-select v-model="form.contractId" placeholder="请选择关联合同" @change="changeContract">
|
|
|
+ <el-option :label="item.code" :value="item.id" v-for="(item,index) in contractList"
|
|
|
+ :key="index">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="租客类型" v-if="type != 3">
|
|
|
<el-select v-model="form.tenantType" placeholder="请选择租客类型" @change="changeTenantType">
|
|
|
<el-option label="企业" :value="1"></el-option>
|
|
|
<el-option label="客户" :value="2"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="企业" v-if="form.tenantType === 1" prop="merchantId"
|
|
|
+ <el-form-item label="企业" v-if="form.tenantType === 1 && type != 3" prop="merchantId"
|
|
|
:rules="[{required: true, message: '请选择企业'}]">
|
|
|
<el-select v-model="form.merchantId" placeholder="请选择企业">
|
|
|
<el-option :label="item.name" :value="item.id" v-for="(item,index) in merchantList"
|
|
@@ -22,7 +29,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="客户" v-else-if="form.tenantType === 2" prop="clientId"
|
|
|
+ <el-form-item label="客户" v-else-if="form.tenantType === 2 && type != 3" prop="clientId"
|
|
|
:rules="[{required: true, message: '请选择客户'}]">
|
|
|
<el-select v-model="form.clientId" placeholder="请选择客户">
|
|
|
<el-option :label="item.name" :value="item.id" v-for="(item,index) in clientList" :key="index">
|
|
@@ -32,21 +39,21 @@
|
|
|
<el-form-item label="跟进人" prop="followUpPerson" :rules="[{required: true, message: '请输入跟进人'}]">
|
|
|
<el-input type="text" v-model="form.followUpPerson" placeholder="请输入跟进人"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="联系方式" prop="followUpPersonPhone">
|
|
|
+ <el-form-item label="联系方式" prop="followUpPersonPhone" v-if="type != 3">
|
|
|
<el-input type="number" v-model="form.followUpPersonPhone" placeholder="请输入联系方式"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="服务方式" prop="workWay" :rules="[{required: true, message: '请选择服务方式'}]">
|
|
|
+ <el-form-item label="服务方式" prop="workWay" :rules="[{required: true, message: '请选择服务方式'}]"
|
|
|
+ v-if="type != 3">
|
|
|
<el-select v-model="form.workWay" placeholder="请选择服务方式">
|
|
|
- <el-option :label="item.name" :value="item.id" v-for="(item,index) in $field.field.workWay"
|
|
|
- :key="item.id">
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="(item,index) in workWay" :key="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="摘要" class="hui-textarea">
|
|
|
+ <el-form-item label="摘要" class="hui-textarea" v-if="type != 3">
|
|
|
<el-input type="textarea" v-model="form.compendious" placeholder="请输入摘要" resize="none">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="上传图片" class="hui-textarea">
|
|
|
+ <el-form-item label="上传图片" class="hui-textarea" v-if="type != 3">
|
|
|
<upload ref="upload" :list="responsibility" type="insert"></upload>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="自定义字段" class="hui-textarea">
|
|
@@ -73,9 +80,13 @@
|
|
|
import {
|
|
|
getCustomerListByPage
|
|
|
} from '@/httpApi/crm'
|
|
|
+ import {
|
|
|
+ getContractListByPage
|
|
|
+ } from '@/httpApi/contract'
|
|
|
import upload from '@/components/common/upload'
|
|
|
import selectHouse from '@/components/common/selectHouse';
|
|
|
import customData from '@/components/common/customData'
|
|
|
+
|
|
|
export default {
|
|
|
props: ['isUpdate', 'detailId', 'type'],
|
|
|
data() {
|
|
@@ -88,16 +99,23 @@
|
|
|
clientId: '',
|
|
|
followUpPerson: '',
|
|
|
followUpPersonPhone: '',
|
|
|
- workWay: ''
|
|
|
+ workWay: '',
|
|
|
+ contractId: '',
|
|
|
+ contractCode: ''
|
|
|
},
|
|
|
responsibility: [],
|
|
|
merchantList: [],
|
|
|
clientList: [],
|
|
|
- customList: []
|
|
|
+ customList: [],
|
|
|
+ workWay: [],
|
|
|
+ contractList: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.form['userId'] = this.$store.getters.user.userId;
|
|
|
+ if (this.type != 3) {
|
|
|
+ this.workWay = this.type === 1 ? this.$field.field.serviceWorkWay : this.$field.field.clearWorkWay;
|
|
|
+ }
|
|
|
if (!this.isUpdate) {
|
|
|
this.form['organizationId'] = this.$store.getters.organization.id;
|
|
|
this.form['projectId'] = this.$store.getters.project.id;
|
|
@@ -112,14 +130,33 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- this.merchant();
|
|
|
- this.client();
|
|
|
+ if (this.type === 3) {
|
|
|
+ getContractListByPage({
|
|
|
+ currPage: 1,
|
|
|
+ pageSize: 100,
|
|
|
+ organizationId: this.$store.getters.organization.id,
|
|
|
+ projectId: this.$store.getters.project.id,
|
|
|
+ status: 2
|
|
|
+ }).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.contractList = res.data.dataList;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.merchant();
|
|
|
+ this.client();
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
changeTenantType() {
|
|
|
this.form.merchantId = '';
|
|
|
this.form.clientId = '';
|
|
|
},
|
|
|
+ changeContract() {
|
|
|
+ let data = this.contractList.find(node => node.id == this.form.contractId);
|
|
|
+ this.form.contractCode = data.code;
|
|
|
+ },
|
|
|
merchant() {
|
|
|
getOrganizationList({
|
|
|
organizationId: this.$store.getters.organization.id,
|
|
@@ -146,7 +183,7 @@
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
let postData = JSON.parse(JSON.stringify(this.form));
|
|
|
- postData['attachment'] = JSON.stringify(this.$refs.upload.fileList);
|
|
|
+ if (this.$refs.upload) postData['attachment'] = JSON.stringify(this.$refs.upload.fileList);
|
|
|
postData['data'] = JSON.stringify(this.$refs.customData.listData);
|
|
|
postData['projectItemTargetRoomIds'] = this.$refs.selectHouse.selectNodeId;
|
|
|
if (this.isUpdate) {
|