Commit b364af1d authored by zs嵩's avatar zs嵩

新增跟进记录 联系人选择

parent dd6f07e0
......@@ -32,13 +32,22 @@
<el-date-picker v-model="form.followTime" clearable type="datetime" :placeholder="$t('请选择')" :disabled="isView" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="12" v-if="customerId">
<el-form-item :label="$t('联系人')" required>
<el-select v-model="form.contactId" clearable :placeholder="$t('请选择')" :disabled="isView" @change="changeContactUser">
<el-option v-for="(item, index) in customerContactsList" :key="index" :label="item.name" :value="item.id"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-else>
<el-form-item :label="$t('联系人')" required>
<div class="contact">
<el-input :value="form.contactName" placeholder="" disabled />
<img src="@/assets/svg/contacts.svg" class="phonebook" @click="ChooseContactDialog = true" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('联系方式')">
<el-input v-model="form.contactPhone" disabled />
......@@ -136,9 +145,22 @@
<el-button type="success" @click="customerFollowSubmit(1)">{{ $t("提交结果") }}</el-button>
</div>
</el-dialog>
<choose-contact-dialog v-if="ChooseContactDialog" :type="2" @choose="changeAllContactUser" @close="ChooseContactDialog = false" />
</div>
</template>
<style lang="scss" scoped>
.contact {
display: flex;
align-items: center;
justify-content: center;
img.phonebook {
width: 30px;
height: 30px;
margin-left: 10px;
cursor: pointer;
}
}
</style>
<script>
import { createCustomerFollow, getCustomerFollowPage, getCustomerFollowPage2, addCustomerFollow, getCustomerFollowList, editCustomerFollow, getFollowupNewNumber } from "@/api/ecw/customerFollow"
import { getCustomerContactsSelect } from "@/api/ecw/customerContacts"
......@@ -149,7 +171,7 @@ import { listAllSimpl, listServiceUser, listSimpleUsers } from "@/api/system/use
import { parseTime } from "@/utils/ruoyi"
import FileUpload from "@/components/FileUpload/fileUpload"
import { formatDate } from "@/utils/index"
import { log } from "util"
import ChooseContactDialog from "@/components/ChooseContactDialog"
export default {
/**
* 客户跟进
......@@ -165,10 +187,12 @@ export default {
customerService: Number
},
components: {
ChooseContactDialog,
FileUpload
},
data() {
return {
ChooseContactDialog: false,
fileType: ["doc", "xls", "ppt", "txt", "pdf", "png", "jpg", "jpeg"],
DICT_TYPE,
getDictDataLabel,
......@@ -240,6 +264,36 @@ export default {
})
}
},
changeAllContactUser(item) {
console.log(item)
if (item) {
this.form.contactName = item.contactsName
this.form.customerId = item.customerId
this.form.contactPhone = "+" + item.areaCode + item.phoneNew
if (item.customerNumber) this.form.customerNumber = item.customerNumber
} else {
this.form.contactName = null
this.form.contactPhone = null
}
this.ChooseContactDialog = false
},
changeContactUser(val) {
if (val) {
for (const item of this.customerContactsList) {
if (item.id == val) {
this.form.contactName = item.name
this.form.customerId = item.customerId
this.form.contactPhone = "+" + item.areaCode + item.phoneNew
if (item.customerNumber) this.form.customerNumber = item.customerNumber
break
}
}
} else {
this.form.contactName = null
this.form.contactPhone = null
}
},
getOfferList() {
getOfferPage(this.queryParams).then((response) => {
this.offerList = response.data.list
......@@ -292,22 +346,6 @@ export default {
}
}
},
changeContactUser(val) {
if (val) {
for (const item of this.customerContactsList) {
if (item.id == val) {
this.form.contactName = item.name
this.form.customerId = item.customerId
this.form.contactPhone = "+" + item.areaCode + item.phoneNew
if (item.customerNumber) this.form.customerNumber = item.customerNumber
break
}
}
} else {
this.form.contactName = null
this.form.contactPhone = null
}
},
customerFollowSubmit(status) {
console.log(this.form)
this.$refs["customerFollowForm"].validate((valid) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment