Commit 1dec6dce authored by 余金瑶's avatar 余金瑶

客户列表操作设置按钮

parent 65c81e67
......@@ -528,6 +528,14 @@ export function changeCustomerDefaultBilling(data){
})
}
export function customerSettingButton(data){
return request({
url:'ecw/customer/change-customer-arrival-confirm',
method:'put',
data
})
}
export function addCompetitor(data){
return request({
url:'customer/competitor/create',
......
......@@ -41,8 +41,8 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('联系人')" required>
<el-select v-model="form.contactName" clearable :placeholder="$t('请选择')" :disabled="isView">
<el-option v-for="(item, index) in customerContactsList" :key="index" :label="item.name" :value="item.name">
<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>
......@@ -97,7 +97,7 @@
<el-form-item :label="$t('下一步计划')" prop="nextPlan">
<el-input type="textarea" :rows="3" v-model="form.nextPlan" :placeholder="$t('请输入下一步计划')" maxlength="500" show-word-limit :disabled="isView" />
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder">
<el-select v-model="form.creatorName" disabled :placeholder="$t('请选择')">
......@@ -281,7 +281,9 @@ export default {
reset() {
this.form = {
attatchment: undefined,
contactId: undefined,
contactName: undefined,
contactPhone: undefined,
customerId: this.customerId,
feedback: undefined,
followMethod: undefined,
......@@ -313,6 +315,20 @@ export default {
}
}
},
changeContactUser(val) {
if (val) {
for(const item of this.customerContactsList) {
if (item.id == val) {
this.form.contactName = item.name
// this.form.contactPhone = `+${item.areaCode}${item.phoneNew}`
break
}
}
} else {
this.form.contactName = null
this.form.contactPhone = null
}
},
customerFollowSubmit(status) {
console.log(this.form)
this.$refs["customerFollowForm"].validate(valid => {
......
......@@ -130,7 +130,7 @@ export default {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
this.getOfferList()
},
/** 重置按钮操作 */
resetQuery() {
......
<template>
<el-dialog append-to-body :title="$t('设置')" :visible.sync="dialogVisible" width="900px">
<el-form ref="form" :model="form" label-width="150px">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('是否显示提单价格')" prop="isShowTidanPrice">
<el-switch v-model="form.isShowTidanPrice"></el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
<el-switch
v-model="form.arrivalConfirm"
:active-value="1"
:inactive-value="0"
/>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item :label="$t('重货标准')" prop="weightUnit">
<el-switch v-model="showZhong" />
<el-input
v-model="form.weightUnit"
:placeholder="$t('请输入重货标准')"
v-show="showZhong"
>
<template slot="append">kg/cbm</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" v-show="showZhong">
<el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showZhong1"></el-switch>
<customer-line-table
v-if="showZhong1"
:warehouse-list="warehouseList"
:import-city-list="importCityList"
v-model="zhongLines"
:zhong-pao-type="1"
></customer-line-table>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item :label="$t('泡货标准')" prop="lightUnit">
<el-switch v-model="showPao" />
<el-input
v-model="form.lightUnit"
:placeholder="$t('请输入泡货标准')"
v-show="showPao"
>
<template slot="append">kg/cbm</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" v-show="showPao">
<el-form-item :label="$t('指定线路')" prop="line">
<el-switch v-model="showPao1"></el-switch>
<customer-line-table
v-if="showPao1"
:warehouse-list="warehouseList"
:import-city-list="importCityList"
v-model="paoLines"
:zhong-pao-type="2"
></customer-line-table>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('控货无收货人')">
<el-switch v-model="form.noConsignee" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('默认付款')">
<el-switch v-model="form.defaultPay" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('默认开票')">
<el-switch v-model="form.defaultBilling" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="warning" @click="handleClose">{{$t('关 闭')}}</el-button>
<el-button type="primary" @click="handerSubmit">{{$t('保 存')}}</el-button>
</div>
</el-dialog>
</template>
<script>
import CustomerLineTable from "@/components/CustomerLineTable";
import { getWarehouseList } from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region";
import { getZhongPaoBest, getZhongPaoPage } from "@/api/ecw/zhongPao";
import { getCustomer, getCustomerLines, customerSettingButton } from "@/api/ecw/customer";
export default {
name: "CustomerSetting",
components: {
CustomerLineTable
},
data() {
return {
dialogVisible: false,
form: {
isShowTidanPrice: false,
arrivalConfirm: 0,
weightUnit: null,
lightUnit: null,
customerLines: [],
noConsignee: false,
defaultPay: false,
defaultBilling: false
},
showZhong: false,
showZhong1: false,
showPao: false,
showPao1: false,
warehouseList: [],
zhongLines: [],
warehouseList: [], // 仓库列表
importCityList: [], // 进口地址
zhongLines: [],
paoLines: [],
}
},
created() {
getWarehouseList().then((r) => {
this.warehouseList = r.data;
});
getTradeCityList({ type: 1 }).then((r) => {
this.importCityList = r.data.filter((item) => item.type === "1");
});
},
methods: {
getZhongPao() {
getZhongPaoBest({
customerId: this.customerId,
// departureId: this.departureId,
// objectiveId: this.objectiveId
}).then((r) => {
if (!this.form.weightUnit) this.form.weightUnit = r.data.zhongEdge;
if (!this.form.lightUnit) this.form.lightUnit = r.data.paoEdge;
});
},
init(id) {
this.customerId = id
getCustomer(this.customerId).then((response) => {
const row = response.data
this.form = {
customerId: row.id,
isShowTidanPrice: row.isShowTidanPrice,
arrivalConfirm: row.arrivalConfirm,
weightUnit: row.weightUnit,
lightUnit: row.lightUnit,
customerLines: [],
noConsignee: row.noConsignee,
defaultPay: row.defaultPay,
defaultBilling: row.defaultBilling
}
// 打开重泡货开关
if (this.form.weightUnit) {
this.showZhong = true;
}
if (this.form.lightUnit) {
this.showPao = true;
}
getCustomerLines(this.customerId).then((res) => {
this.zhongLines = res.data.filter((item) => item.zhongPaoType == 1);
this.paoLines = res.data.filter((item) => item.zhongPaoType == 2);
if (this.zhongLines.length) this.showZhong1 = true;
if (this.paoLines.length) this.showPao1 = true;
});
this.getZhongPao()
})
},
handleClose() {
this.resetForm("form")
this.dialogVisible = false
},
handerSubmit() {
this.$refs["form"].validate((valid, err) => {
// 重货标准和泡货标准,未打开就不传,提交前清空一下
if (!this.showZhong) {
this.form.weightUnit = null;
this.zhongLines = [];
}
if (!this.showZhong1) {
this.zhongLines = [];
}
if (!this.showPao) {
this.form.lightUnit = null;
this.paoLines = [];
}
if (!this.showPao1) {
this.paoLines = [];
}
this.updateCustomerLines();
// 检查路线是否启用了但是没选择目的仓
let errors = 0;
this.form.customerLines.forEach((line) => {
if (!line.objectiveIds || line.objectiveIds == "") {
errors++;
}
});
if (errors) {
return this.$message.error("有两条路线未选择目的地");
}
customerSettingButton(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("操作成功"));
this.dialogVisible = false;
const obj = { path: "/customer/customer" };
this.$emit('refresh')
});
});
},
updateCustomerLines() {
let zhongLines = [],
paoLines = [];
if (this.zhongLines.length > 0) {
zhongLines = this.zhongLines;
}
if (this.paoLines.length > 0) {
paoLines = this.paoLines;
}
this.form.customerLines = [...zhongLines, ...paoLines];
},
}
}
</script>
......@@ -888,6 +888,14 @@
@click="quote(scope.row)"
>{{ $t("报价") }}</el-button
>
<el-button
v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]"
size="mini"
type="text"
icon="el-icon-user"
@click="handleSetting(scope.row)"
>{{ $t("设置") }}</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -1390,6 +1398,10 @@
ref="potentialCustom"
@change="getList"
></add-potential-custom>
<customer-setting
ref="customerSetting"
@refresh="getList"
/>
<!--业绩类型 -->
<el-dialog title="业绩类型" :visible.sync="dialogVisible" width="30%">
<div>
......@@ -1451,7 +1463,7 @@ import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue";
import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
import CustomerSetting from "./components/customerSetting.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import { getCustomerSelect } from "@/api/ecw/customer";
import { getProductTypeList } from "@/api/ecw/productType";
......@@ -1467,7 +1479,8 @@ export default {
CustomerFollowList,
customerComplaints,
transferCustomer,
AreaCodeSelector
AreaCodeSelector,
CustomerSetting
},
data() {
return {
......@@ -2120,6 +2133,12 @@ export default {
return null
}
},
handleSetting(row) {
this.$refs['customerSetting'].dialogVisible = true
this.$nextTick(_ => {
this.$refs['customerSetting'].init(row.id)
})
},
getBusiCountryNames(ids) {
if (ids) {
const idsArr = ids.split(',')
......
......@@ -12,7 +12,7 @@
<el-button v-has-permi="['ecw:customer:query-delete']" type="danger" size="small" @click="deleteCustomerFn()">{{$t('删除')}}</el-button>
</div>
</div>
<el-card style="margin-top: 15px;">
<el-descriptions :title="$t('基本')" :column="3" border>
<template slot="extra">
......@@ -480,6 +480,7 @@
<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>
<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>
......
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