Commit 1f5076e9 authored by zs嵩's avatar zs嵩

跟进记录,报价单等优化

parent 85a20c2a
<template>
<div class="dict-selector">
<el-select
v-if="formType == 'select'"
v-model="valueSync"
:placeholder="placeholder || $t('请选择')"
:clearable="clearable"
:multiple="multiple"
:disabled="disabled"
@change="(val) => $emit('change', val)"
>
<el-option
v-for="dict in formattedList"
:key="dict.value"
:label="$l(dict, 'label')"
:value="dict.value"
/>
<el-select v-if="formType == 'select'" v-model="valueSync" filterable :placeholder="placeholder || $t('请选择')" :clearable="clearable" :multiple="multiple" :disabled="disabled" @change="(val) => $emit('change', val)">
<el-option v-for="dict in formattedList" :key="dict.value" :label="$l(dict, 'label')" :value="dict.value" />
</el-select>
<el-radio-group
v-if="formType == 'radio'"
v-model="valueSync"
:disabled="disabled"
>
<el-radio
v-for="dict in formattedList"
:label="dict.value"
:checked="valueSync === dict.value"
:key="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
<el-radio-group v-if="formType == 'radio'" v-model="valueSync" :disabled="disabled">
<el-radio v-for="dict in formattedList" :label="dict.value" :checked="valueSync === dict.value" :key="dict.value">{{ $l(dict, "label") }}</el-radio>
</el-radio-group>
<el-checkbox-group
v-if="formType == 'checkbox'"
v-model="valueSync"
:disabled="disabled"
>
<el-checkbox
v-for="dict in formattedList"
:label="dict.value"
:key="dict.value"
>{{ $l(dict, "label") }}</el-checkbox
>
<el-checkbox-group v-if="formType == 'checkbox'" v-model="valueSync" :disabled="disabled">
<el-checkbox v-for="dict in formattedList" :label="dict.value" :key="dict.value">{{ $l(dict, "label") }}</el-checkbox>
</el-checkbox-group>
</div>
</template>
......@@ -47,31 +15,29 @@
const FORMATTERS = {
string: String,
bool: function (val) {
return [false, "false", 0, "0"].indexOf(val) < 0;
return [false, "false", 0, "0"].indexOf(val) < 0
},
number: Number,
array: function (val) {
return typeof val == "string"
? val.split(",").filter((item) => item && item !== "")
: val;
},
};
return typeof val == "string" ? val.split(",").filter((item) => item && item !== "") : val
}
}
export default {
props: {
placeholder: {
type: String,
default: null,
default: null
},
type: String,
value: [String, Number, Array, Boolean],
multiple: Boolean,
formType: {
type: String,
default: "select",
default: "select"
},
formatter: {
type: [Function, String],
default: String,
default: String
},
defaultable: Boolean, // 是否默认选择第一个
disabled: Boolean,
......@@ -80,104 +46,92 @@ export default {
*/
filter: {
type: Function,
default: () => true,
default: () => true
},
clearable: Boolean,
clearable: Boolean
},
data() {
return {
valueSync: this.multiple ? [] : null,
};
valueSync: this.multiple ? [] : null
}
},
computed: {
dicts() {
return this.getList(this.type);
return this.getList(this.type)
},
dictList() {
return this.dicts.filter(this.filter);
return this.dicts.filter(this.filter)
},
formattedList() {
let arr = [];
let arr = []
this.dictList.forEach((item) => {
arr.push({
label: item.label,
labelEn: item.labelEn,
value: this.format(item.value),
cssClass: item.cssClass,
colorType: item.colorType,
});
});
return arr;
},
colorType: item.colorType
})
})
return arr
}
},
watch: {
valueSync(val) {
this.$emit("input", val);
this.$emit("input", val)
},
value(val) {
if (val != this.valueSync) this.setValueSync();
if (val != this.valueSync) this.setValueSync()
},
dictList() {
this.setDefault();
},
this.setDefault()
}
},
created() {
this.setValueSync();
this.setDefault();
this.setValueSync()
this.setDefault()
},
methods: {
format(val) {
if (val === null || val == undefined || val == "") return val;
if (val === null || val == undefined || val == "") return val
let formatter =
typeof this.formatter == "function"
? this.formatter
: FORMATTERS[this.formatter];
let formatter = typeof this.formatter == "function" ? this.formatter : FORMATTERS[this.formatter]
if (!formatter) {
console.warn("格式器无效", this.formatter);
return val;
console.warn("格式器无效", this.formatter)
return val
}
return formatter(val);
return formatter(val)
},
changeValue(val) {
this.valueSync = val;
this.valueSync = val
},
setValueSync() {
if (
this.value === null ||
this.value === undefined ||
this.value === ""
) {
return (this.valueSync = this.multiple ? [] : this.value);
if (this.value === null || this.value === undefined || this.value === "") {
return (this.valueSync = this.multiple ? [] : this.value)
}
if (this.multiple) {
let value = this.value || [];
let value = this.value || []
if (typeof this.value == "string") {
value = this.value.split(",").filter((item) => item && item != "");
value = this.value.split(",").filter((item) => item && item != "")
}
this.valueSync = value.map((item) => this.format(item));
this.valueSync = value.map((item) => this.format(item))
} else {
this.valueSync = this.format(this.value);
this.valueSync = this.format(this.value)
}
},
getList() {
return this.getDictDatas(this.type);
return this.getDictDatas(this.type)
},
setDefault() {
if (!this.defaultable) return;
if (
this.dictList.length &&
(this.valueSync === null ||
this.valueSync == undefined ||
this.valueSync == "")
) {
this.valueSync = this.multiple ? [] : this.formattedList[0].value;
if (!this.defaultable) return
if (this.dictList.length && (this.valueSync === null || this.valueSync == undefined || this.valueSync == "")) {
this.valueSync = this.multiple ? [] : this.formattedList[0].value
}
},
},
};
}
}
}
</script>
<style scoped>
.dict-selector {
......
......@@ -49,7 +49,7 @@
<el-col :span="8" v-else>
<el-form-item :label="$t('联系人')" required>
<div class="contact">
<el-input v-model="form.contactName" :value="form.customerContactsId" placeholder="" disabled />
<el-input v-model="form.contactName" placeholder="" disabled />
<img src="@/assets/svg/contacts.svg" class="phonebook" @click="ChooseContactDialog = true" />
</div>
</el-form-item>
......@@ -79,19 +79,19 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('销售阶段')" prop="followMethod">
<el-form-item :label="$t('销售阶段')" prop="saleStage">
<el-select v-model="form.saleStage" clearable :placeholder="$t('请选择')" :disabled="isView">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_SALE_STAGE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('跟进结果')" prop="followMethod">
<!-- <el-col :span="8">
<el-form-item :label="$t('跟进结果')" prop="resultType">
<el-select v-model="form.resultType" clearable :placeholder="$t('请选择')" :disabled="isView">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="24">
<el-form-item :label="$t('目的')" prop="purpose">
<el-input type="textarea" :rows="3" v-model="form.purpose" :placeholder="$t('请输入目的')" maxlength="200" show-word-limit :disabled="isView" />
......@@ -293,19 +293,31 @@ export default {
},
"form.customerId"(v) {
if (v) {
getCustomerContactsListByCustomer({
customerId: v
}).then((res) => {
this.customerContactsList = res.data
this.customerContactsList.forEach((item) => {
if (item.id === this.form.contactId) {
getCustomerContactsListByCustomer({
customerId: v
}).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
this.form.followUserId = item.customerService
}
})
if (!this.form.contactId) {
this.customerContactsList.some((item) => {
if (item.isDefault) {
this.form.contactId = item.id
this.form.customerNumber = item.customerNumber
this.form.contactName = item.name
this.form.contactPhone = "+" + item.areaCode + item.phoneNew
this.form.followUserId = item.customerService
return true
}
})
})
}
})
} else {
this.form.customerNumber = ""
}
......@@ -470,10 +482,10 @@ export default {
this.$modal.msgError(this.$t("请选择客户联系人"))
return
}
if (!this.form.resultType) {
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
......
......@@ -20,7 +20,7 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户来源')" prop="source">
<el-select v-model="form.source" :placeholder="$t('请选择客户来源')">
<el-select filterable v-model="form.source" :placeholder="$t('请选择客户来源')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
......@@ -34,7 +34,7 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')" :disabled="(customerId !== '0' && $route.name !== 'allocatedCustomerEdit') || isCustomerServiceConfirmed">
<el-select filterable v-model="form.customerService" :placeholder="$t('请选择客户经理')" :disabled="(customerId !== '0' && $route.name !== 'allocatedCustomerEdit') || isCustomerServiceConfirmed">
<el-option v-for="item in !((customerId !== '0' && $route.name !== 'allocatedCustomerEdit') || isCustomerServiceConfirmed) ? serviceUserList : allSimplList" :key="item.id" :label="item.nickname" :value="item.id" />
</el-select>
</el-form-item>
......@@ -198,7 +198,7 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('常用提货网点')" prop="pickupPoints">
<el-select multiple v-model="form.pickupPoints">
<el-select filterable multiple v-model="form.pickupPoints">
<el-option v-for="item in getNodeLists" :key="item.id" :value="item.id" :label="isChinese ? item.titleZh : item.titleEn"></el-option>
</el-select>
</el-form-item>
......@@ -206,7 +206,7 @@
<el-col :span="12">
<el-form-item :label="$t('业务国家')" prop="busiCountryIds">
<el-select multiple clearable v-model="form.busiCountryIds" :placeholder="$t('请选择')">
<el-select filterable multiple clearable v-model="form.busiCountryIds" :placeholder="$t('请选择')">
<el-option v-for="dict in countryList" :key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
</el-select>
</el-form-item>
......
This diff is collapsed.
......@@ -32,11 +32,11 @@
<el-form-item :label="$t('销售阶段')">
<dict-selector clearable :type="DICT_TYPE.CUSTOMER_FOLLOWUP_SALE_STAGE" v-model="followForm.saleStage" @input="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('跟进结果')">
<!-- <el-form-item :label="$t('跟进结果')">
<el-select clearable v-model="followForm.resultType" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item :label="$t('跟进状态')">
<el-select clearable v-model="followForm.status" :placeholder="$t('请选择')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
......@@ -76,52 +76,56 @@
</el-row>
<el-table ref="multipleTable" :data="customerFollowList" v-loading="loading" @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" fixed></el-table-column>
<el-table-column prop="number" :label="$t('编号')" align="center" fixed>
<el-table-column prop="number" :label="$t('编号')" align="center" fixed :width="120">
<template slot-scope="scope">
<a href="javascript:void(0)" @click="handleCustomerFollowLink(scope.row)" class="link-type">{{ scope.row.number }}</a>
</template>
</el-table-column>
<el-table-column prop="followType" :label="$t('跟进类型')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE, cellValue)"></el-table-column>
<el-table-column prop="offerNumber" :label="$t('报价单号')"> </el-table-column>
<el-table-column prop="followTime" :label="$t('跟进时间')" :formatter="(row, column, cellValue) => parseTime(cellValue)"></el-table-column>
<el-table-column prop="customerNumber" :label="$t('客户编号')">
<el-table-column prop="followType" :label="$t('跟进类型')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_TYPE, cellValue)" :width="120"></el-table-column>
<el-table-column prop="offerNumber" :label="$t('报价单号')" :width="120">
<template slot-scope="{ row }">
<el-link type="primary" @click.native="$router.push('/offer/detail?offerId=' + row.offerId)" v-if="row.offerNumber">{{ row.offerNumber }}</el-link>
</template>
</el-table-column>
<el-table-column prop="followTime" :label="$t('跟进时间')" :formatter="(row, column, cellValue) => parseTime(cellValue)" :width="120"></el-table-column>
<el-table-column prop="customerNumber" :label="$t('客户编号')" :width="120">
<template slot-scope="scope">
<a href="javascript:void(0)" @click="handleCustomerViewLink(scope.row)" class="link-type">{{ scope.row.customerNumber }}</a>
</template>
</el-table-column>
<el-table-column prop="contactName" :label="$t('联系人')"></el-table-column>
<el-table-column prop="contactPhone" :label="$t('联系方式')"></el-table-column>
<el-table-column prop="followUserName" :label="$t('客户经理')"></el-table-column>
<el-table-column prop="followMethod" :label="$t('跟进方式')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD, cellValue)"></el-table-column>
<el-table-column prop="purpose" :label="$t('目的')"></el-table-column>
<el-table-column prop="feedback" :label="$t('跟进情况')"></el-table-column>
<el-table-column prop="saleStage" :label="$t('销售阶段')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_SALE_STAGE, cellValue)"></el-table-column>
<el-table-column prop="resultType" :label="$t('跟进结果')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE, cellValue)"></el-table-column>
<el-table-column :label="$t('下次跟进时间')" align="center">
<el-table-column prop="contactName" :label="$t('联系人')" :width="120"></el-table-column>
<el-table-column prop="contactPhone" :label="$t('联系方式')" :width="120"></el-table-column>
<el-table-column prop="followUserName" :label="$t('客户经理')" :width="120"></el-table-column>
<el-table-column prop="followMethod" :label="$t('跟进方式')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_METHOD, cellValue)" :width="120"></el-table-column>
<el-table-column prop="purpose" :label="$t('目的')" :width="240"></el-table-column>
<el-table-column prop="feedback" :label="$t('跟进情况')" :width="240"></el-table-column>
<el-table-column prop="saleStage" :label="$t('销售阶段')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_SALE_STAGE, cellValue)" :width="120"></el-table-column>
<!-- <el-table-column prop="resultType" :label="$t('跟进结果')" :formatter="(row, column, cellValue) => getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_RESULT_TYPE, cellValue)"></el-table-column> -->
<el-table-column :label="$t('下次跟进时间')" align="center" :width="120">
<template slot-scope="scope">
{{ parseTime(scope.row.nextTime) }}
</template>
</el-table-column>
<el-table-column :label="$t('关联跟进记录')" align="center" prop="parentNumber"></el-table-column>
<el-table-column prop="nextPlan" :label="$t('下次计划')" align="center"></el-table-column>
<el-table-column :label="$t('关联跟进记录')" align="center" prop="parentNumber" :width="120"></el-table-column>
<el-table-column prop="nextPlan" :label="$t('下次计划')" align="center" :width="240"></el-table-column>
<el-table-column :label="$t('跟进状态')" align="center">
<template slot-scope="scope">
{{ getDictDataLabel(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS, scope.row.status) }}
</template>
</el-table-column>
<el-table-column prop="creatorName" :label="$t('创建人')" align="center"></el-table-column>
<el-table-column :label="$t('创建时间')" align="center">
<el-table-column prop="creatorName" :label="$t('创建人')" align="center" :width="120"></el-table-column>
<el-table-column :label="$t('创建时间')" align="center" :width="120">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime) }}
</template>
</el-table-column>
<el-table-column prop="updaterName" :label="$t('最后更新人')" align="center"></el-table-column>
<el-table-column :label="$t('最后更新时间')" align="center">
<el-table-column prop="updaterName" :label="$t('最后更新人')" align="center" :width="120"></el-table-column>
<el-table-column :label="$t('最后更新时间')" align="center" :width="120">
<template slot-scope="scope">
{{ parseTime(scope.row.updateTime) }}
</template>
</el-table-column>
<el-table-column width="150px" :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
<el-table-column :width="180" :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" v-if="!scope.row.status" @click="handleCustomerFollow(scope.row)" v-hasPermi="['ecw:customer:follow-update']">{{ $t("编辑") }} </el-button>
<el-button size="mini" type="text" icon="el-icon-collection" @click="handleCustomerFollow(scope.row, true)" v-has-permi="['ecw:customer:follow-add-plan']">{{ $t("增加计划") }} </el-button>
......
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