Commit 5b7d46b4 authored by yujinyao's avatar yujinyao

客户信息添加主要竞争对象下拉框

parent cc649a65
...@@ -519,3 +519,18 @@ export function changeCustomerNoConsignee(data){ ...@@ -519,3 +519,18 @@ export function changeCustomerNoConsignee(data){
data data
}) })
} }
export function addCompetitor(data){
return request({
url:'customer/competitor/create',
method:'post',
data
})
}
export function competitorListAll(){
return request({
url:'customer/competitor/listAll',
method:'get'
})
}
\ No newline at end of file
...@@ -4681,6 +4681,8 @@ ...@@ -4681,6 +4681,8 @@
"默认付款": "Default payment", "默认付款": "Default payment",
"默认开票": "Default Billing", "默认开票": "Default Billing",
"请选择业务国家": "Please select customer operating country", "请选择业务国家": "Please select customer operating country",
"请选择主要竞争对手": "Please select customer major competitors",
"请重新选择主要竞争对手": "Please again select customer major competitors",
"装柜/出仓时间": "Loading/Exit Time", "装柜/出仓时间": "Loading/Exit Time",
"卸柜/到仓时间": "Unloading/Arrival Time", "卸柜/到仓时间": "Unloading/Arrival Time",
"提货率": "Delivery rate", "提货率": "Delivery rate",
......
...@@ -313,6 +313,8 @@ ...@@ -313,6 +313,8 @@
"默认付款": "默认付款", "默认付款": "默认付款",
"默认开票": "默认开票", "默认开票": "默认开票",
"请选择业务国家": "请选择业务国家", "请选择业务国家": "请选择业务国家",
"请选择主要竞争对手": "请选择主要竞争对手",
"请重新选择主要竞争对手": "请重新选择主要竞争对手",
"装柜/出仓时间": "装柜/出仓时间", "装柜/出仓时间": "装柜/出仓时间",
"卸柜/到仓时间": "卸柜/到仓时间", "卸柜/到仓时间": "卸柜/到仓时间",
"提货率": "提货率", "提货率": "提货率",
...@@ -320,5 +322,7 @@ ...@@ -320,5 +322,7 @@
"发货评估": "发货评估", "发货评估": "发货评估",
"财务资料": "财务资料", "财务资料": "财务资料",
"特殊设置": "特殊设置", "特殊设置": "特殊设置",
"已卸柜/已到仓时间": "已卸柜/已到仓时间" "已卸柜/已到仓时间": "已卸柜/已到仓时间",
"动态": "动态",
"增值服务": "增值服务"
} }
...@@ -480,10 +480,24 @@ ...@@ -480,10 +480,24 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('主要竞争对手')" prop="competitorId"> <el-form-item :label="$t('主要竞争对手')" prop="competitorIds">
<el-input <el-select
v-model="form.competitorId" clearable
v-model="form.competitorIds"
:placeholder="$t('请选择')"
@change="changeCompetitor"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
<el-option
:label="$t('其他')"
:value="0"
/> />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -1110,6 +1124,8 @@ import { ...@@ -1110,6 +1124,8 @@ import {
getCustomerLines, getCustomerLines,
fillupCustomeInfo, fillupCustomeInfo,
getServiceNetwork, getServiceNetwork,
addCompetitor,
competitorListAll
} from "@/api/ecw/customer"; } from "@/api/ecw/customer";
import { getNodeList } from "@/api/ecw/node"; import { getNodeList } from "@/api/ecw/node";
import { getProductTypeList } from "@/api/ecw/productType"; import { getProductTypeList } from "@/api/ecw/productType";
...@@ -1226,6 +1242,7 @@ export default { ...@@ -1226,6 +1242,7 @@ export default {
getCountryListAll().then((r) => { getCountryListAll().then((r) => {
this.countryList = r.data; this.countryList = r.data;
}); });
this.getCompetitorList()
}, },
data() { data() {
return { return {
...@@ -1297,6 +1314,13 @@ export default { ...@@ -1297,6 +1314,13 @@ export default {
trigger: "change", trigger: "change",
}, },
], ],
competitorIds: [
{
required: true,
message: this.$t("请选择主要竞争对手"),
trigger: "change",
},
],
}, },
contactRules: { contactRules: {
name: [ name: [
...@@ -1345,6 +1369,7 @@ export default { ...@@ -1345,6 +1369,7 @@ export default {
showShippingFlag: true, showShippingFlag: true,
showSettingFlag: true, showSettingFlag: true,
showFinanceFlag: true, showFinanceFlag: true,
competitorList: [],
}; };
}, },
...@@ -1505,6 +1530,10 @@ export default { ...@@ -1505,6 +1530,10 @@ export default {
this.$modal.msgError(this.$t("至少填写一个联系人信息")); this.$modal.msgError(this.$t("至少填写一个联系人信息"));
return; return;
} }
if (this.form.competitorIds == 0) {
this.$modal.msgError(this.$t("请重新选择主要竞争对手"));
return;
}
// 重货标准和泡货标准,未打开就不传,提交前清空一下 // 重货标准和泡货标准,未打开就不传,提交前清空一下
if (!this.showZhong) { if (!this.showZhong) {
...@@ -1654,8 +1683,8 @@ export default { ...@@ -1654,8 +1683,8 @@ export default {
updater: this.$store.getters.userId,// 更新人 updater: this.$store.getters.userId,// 更新人
updateTime: undefined,// 更新时间 updateTime: undefined,// 更新时间
roles: undefined,// 客户角色 roles: undefined,// 客户角色
busiCountryIds: [],// 业务国家 busiCountryIds: undefined,// 业务国家
competitorId: undefined,// 主要竞争对手 competitorIds: undefined,// 主要竞争对手
weightYearly: undefined,// 年度发货量 weightYearly: undefined,// 年度发货量
numYearly: undefined,// 年度发货次数 numYearly: undefined,// 年度发货次数
noConsignee: false,// 控制无收货人 noConsignee: false,// 控制无收货人
...@@ -1681,7 +1710,8 @@ export default { ...@@ -1681,7 +1710,8 @@ export default {
roles: response.data.roles? response.data.roles.split(",") : [], roles: response.data.roles? response.data.roles.split(",") : [],
pickupPoints: this.stringArrToNumberArr(response.data.pickupPoints), pickupPoints: this.stringArrToNumberArr(response.data.pickupPoints),
productIds: this.stringArrToNumberArr(response.data.productIds), productIds: this.stringArrToNumberArr(response.data.productIds),
busiCountryIds: this.stringArrToNumberArr(response.data.busiCountryIds) busiCountryIds: this.stringArrToNumberArr(response.data.busiCountryIds),
competitorIds: Number(response.data.competitorIds)
}; };
if (this.form.productType) { if (this.form.productType) {
console.log("1231", this.form.productType); console.log("1231", this.form.productType);
...@@ -1753,6 +1783,27 @@ export default { ...@@ -1753,6 +1783,27 @@ export default {
if (!this.form.lightUnit) this.form.lightUnit = r.data.paoEdge; if (!this.form.lightUnit) this.form.lightUnit = r.data.paoEdge;
}); });
}, },
getCompetitorList() {
competitorListAll().then((r) => {
this.competitorList = r.data;
})
},
changeCompetitor(val) {
if (val == 0) {
this.$prompt("请输入主要竞争对手", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
}).then((data) => {
console.log(data)
addCompetitor({
name: data.value
}).then(_ => {
this.$message.success('添加成功!')
this.getCompetitorList()
})
})
}
}
}, },
computed: { computed: {
isChinese() { isChinese() {
......
...@@ -472,7 +472,7 @@ ...@@ -472,7 +472,7 @@
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('主营类别')">{{ $l(customer,'productTypeName') }}</el-descriptions-item> <el-descriptions-item :label="$t('主营类别')">{{ $l(customer,'productTypeName') }}</el-descriptions-item>
<el-descriptions-item :label="$t('年度发货量')">{{ customer.weightYearly }}</el-descriptions-item> <el-descriptions-item :label="$t('年度发货量')">{{ customer.weightYearly }}</el-descriptions-item>
<el-descriptions-item :label="$t('主要竞争对手')">{{ customer.competitorId }}</el-descriptions-item> <el-descriptions-item :label="$t('主要竞争对手')">{{ customer.competitorNames }}</el-descriptions-item>
<el-descriptions-item :label="$t('年度发货次数')">{{ customer.numYearly }}</el-descriptions-item> <el-descriptions-item :label="$t('年度发货次数')">{{ customer.numYearly }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-tab-pane> </el-tab-pane>
......
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