Commit 46cd44ca authored by zhengyi's avatar zhengyi

提交结果时,除了附件和上级跟进单为非必填,其他都是必填

parent 539abda5
......@@ -173,7 +173,7 @@
<script>
import { addCustomerFollow, editCustomerFollow, getFollowupNewNumber } from "@/api/ecw/customerFollow"
import { getCustomerContactsSelect } from "@/api/ecw/customerContacts"
import { getOfferPage, getOfferNumber } from "@/api/ecw/offer"
import {getOfferPage, getOfferNumber, getOffer} from "@/api/ecw/offer"
import { DICT_TYPE, getDictDataLabel } from "@/utils/dict"
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import { listAllSimpl, listServiceUser, listSimpleUsers } from "@/api/system/user"
......@@ -259,8 +259,24 @@ export default {
watch: {
"form.offerId"(v) {
if (v) {
getOfferNumber(v).then((r) => {
this.form.offerNumber = r.data
getOffer(v).then((r) => {
let offer = r.data
// 选择了报价单后,需要将报价单中的客户及客户联系人信息回显
this.form.offerNumber = offer.number
this.form.customerId = offer.relationId
this.form.contactId = offer.relation === 1 ? offer.consignorId : offer.consigneeId
getCustomerContactsListByCustomer({
customerId: this.form.customerId
}).then((res) => {
this.customerContactsList = res.data
this.customerContactsList.forEach((item) =>{
if (item.id === this.form.contactId){
this.form.customerNumber = item.customerNumber
this.form.contactName = item.name
this.form.contactPhone = "+" + item.areaCode + item.phoneNew
}
})
})
})
} else {
this.form.offerNumber = ""
......@@ -406,7 +422,7 @@ export default {
this.$modal.msgError(this.$t("请选择跟进方式"))
return
}
if (!this.form.offerId && this.form.followType == 2) {
if (this.form.followType === 2 && !this.form.offerId) {
this.$modal.msgError(this.$t("请选择报价单"))
return
}
......@@ -414,6 +430,35 @@ export default {
if (status === 0) {
this.saveSubmitData(status)
} else {
// 提交结果时,除了附件和上级跟进单为非必填,其他都是必填
if (!this.form.customerId) {
this.$modal.msgError(this.$t("请选择客户"))
return
}
if (!this.form.contactId) {
this.$modal.msgError(this.$t("请选择客户联系人"))
return
}
if (!this.form.resultType) {
this.$modal.msgError(this.$t("请选择跟进结果"))
return
}
if (!this.form.purpose) {
this.$modal.msgError(this.$t("请选择跟进目的"))
return
}
if (!this.form.feedback) {
this.$modal.msgError(this.$t("请选择跟进情况"))
return
}
if (!this.form.nextTime) {
this.$modal.msgError(this.$t("请选择下次跟进时间"))
return
}
if (!this.form.nextPlan) {
this.$modal.msgError(this.$t("请填写下一步计划"))
return
}
this.$confirm(this.$t("提交后无法修改"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
......
......@@ -237,7 +237,6 @@ export default {
let obj = {}
obj.customerId = this.customerId || null
obj.offerId = this.offerId || null
console.log("时间", this.followFormTmp)
obj.beginCreateTime = this.followFormTmp.createTime[0]
obj.endCreateTime = this.followFormTmp.createTime[1]
obj.beginNextTime = this.followFormTmp.nextTime[0]
......
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