Commit cdb7493b authored by dcy's avatar dcy

佣金设置3

parent b5358ce3
......@@ -32,9 +32,15 @@ export default {
selectVal:''
}
},
mounted() {
this.selectVal = this.value;
},
watch:{
selectVal(val){
this.$emit('input',val)
},
value(val){
this.selectVal = val;
}
}
}
......
<template>
<div class="app-container">
<el-form :inline="true">
<el-form :rules="rules" :model="form" ref="form" :inline="true" >
<el-row>
<el-col :span="24">
<el-form-item label="客户名称">
<el-form-item label="客户名称" prop="customerId">
<el-select
v-model="customerForm.name"
filterable
......@@ -25,31 +25,31 @@
</el-row>
<el-row>
<el-col :span="5">
<el-form-item label="运输方式">
<el-form-item label="运输方式" prop="transportId">
<div style="width: 130px;">
<custom-selectors-dictionary v-model="form.objectiveId"
<custom-selectors-dictionary v-model="form.transportId"
:options="getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE)"></custom-selectors-dictionary>
</div>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="始发地">
<el-col :span="5">
<el-form-item label="始发地" prop="departureId">
<div style="width: 130px;">
<custom-selectors-dictionary v-model="value"
:options="getDictDatas(DICT_TYPE.COUNTRY)"></custom-selectors-dictionary>
<custom-selectors-dictionary label-key="titleZh" value-key="id" v-model="form.departureId"
:options="exportCityList"></custom-selectors-dictionary>
</div>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="目的地">
<el-col :span="5">
<el-form-item label="目的地" prop="objectiveId">
<div style="width: 130px;">
<custom-selectors-dictionary v-model="value"
:options="getDictDatas(DICT_TYPE.COUNTRY)"></custom-selectors-dictionary>
<custom-selectors-dictionary label-key="titleZh" value-key="id" v-model="form.objectiveId"
:options="importCityList"></custom-selectors-dictionary>
</div>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="报关方式">
<el-form-item label="报关方式" prop="customsType">
<div style="width: 130px;">
<custom-selectors-dictionary v-model="form.customsType"
:options="getDictDatas(DICT_TYPE.SHIPPING_DECLARATION_TYPE)"></custom-selectors-dictionary>
......@@ -57,7 +57,7 @@
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="备案">
<el-form-item label="备案" prop="approval">
<div style="width: 130px;">
<custom-selectors-dictionary v-model="form.approval"
:options="getDictDatas(DICT_TYPE.COMMISSION_PRODUCT_APPROVAL)"></custom-selectors-dictionary>
......@@ -93,7 +93,7 @@
<div class="label">佣金</div>
<div class="content">
<div>
<el-input v-model="mingServantFrom[0].refund" placeholder="placeholder"></el-input>
<el-input v-model="mingServantFrom[0].refund"></el-input>
</div>
<div>
<custom-selectors-dictionary v-model="mingServantFrom[0].refundCurrency"
......@@ -144,7 +144,7 @@
</el-form-item>
</el-form>
<div class="column" v-if="form.type == 2 && form.darkReturnType == 2">
<div v-for="(item,index) in darkServantAndRebateForm" :key="index">
<div style="margin-bottom: 10px" v-for="(item,index) in darkServantAndRebateForm" :key="index">
<div class="label">
佣金:
</div>
......@@ -176,7 +176,7 @@
:options="getDictDatas(DICT_TYPE.COMMISSION_UNIT)"></custom-selectors-dictionary>
</div>
</div>
<el-button @click="addToFn(2)" v-if="darkServantAndRebateForm.length -1 === index">添加</el-button>
<el-button @click="addToFn(2)" v-show="darkServantAndRebateForm.length -1 === index">添加</el-button>
</div>
</div>
<div class="mingServantAndDarkServant" v-if="form.type == 3">
......@@ -240,11 +240,13 @@ import {
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import customSelectorsDictionary from "./customSelectorsDictionary"
import {getTradeCityList} from "@/api/ecw/region";
import RoutersSelector from "@/components/RoutersSelector"
export default {
name: "CustomerCommissionInfo",
components: {
customSelectorsDictionary,
RoutersSelector
},
data() {
return {
......@@ -261,47 +263,48 @@ export default {
customsType: undefined,//报关类别:我司全代:1,自单代报:2,混合报关:3
darkReturnType: this.getDictDatas(this.DICT_TYPE.COMMISSION_DARK_TYPE)[0].value,// 暗佣类型 1产品2达标
departureId: undefined,// 始发地id
objectiveId: undefined,// 运输方式
objectiveId: undefined,//目的地id
transportId:undefined,//运输方式
type: this.getDictDatas(this.DICT_TYPE.COMMISSION_TYPE)[1].value,// 佣金类型
},
//明佣
mingServantFrom: [
{
refund: undefined,
refundCurrency: undefined,
refundUnit: undefined,
refund: 0,
refundCurrency:this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,
refundUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,
}
],
//暗佣金+产品
darkServantAndProductForm: [
{
productType: undefined,//商品类型
productType:undefined,//商品类型
productAttr: undefined,//暗佣 产品属性
darkCommission: undefined,//暗佣 佣金
darkCurrency: undefined,// 暗佣 货币
darkUnit: undefined,// 暗佣 单位
darkCommission: 0,//暗佣 佣金
darkCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣 货币
darkUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,// 暗佣 单位
}
],
//暗佣+产品达标
//暗佣+达标返佣
darkServantAndRebateForm: [
{
amount: undefined,// 暗佣-满减金额
amountCurrency: undefined,// 暗佣-满减金额对应货币
amountUnit: undefined,// 暗佣-满减金额对应单位,
refund: undefined,//暗佣-满之后返还金额
refundCurrency: undefined,//暗佣-满之后返还金额的货币
refundUnit: undefined,//暗佣-满之后返还金额的单位
amount: 0,// 暗佣-满减金额
amountCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣-满减金额对应货币
amountUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refundCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,//暗佣-满之后返还金额的货币
refundUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,//暗佣-满之后返还金额的单位
}
],
//暗佣+明金
mingServantAnddarkServant: [
{
refund: undefined,// 暗佣+明佣 上调金额
refundCurrency: undefined,// 暗佣+明佣 上调对应的货币
refundUnit: undefined,//暗佣+明佣 上调对应的单位
darkAdjustCommission: undefined,//暗佣+明佣 上调金额
darkAdjustCurrency: undefined,//暗佣+明佣 上调对应的货币
darkAdjustUnit: undefined,//暗佣+明佣 上调对应的单位
refund: 0,// 暗佣+明佣 上调金额
refundCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣+明佣 上调对应的货币
refundUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,//暗佣+明佣 上调对应的单位
darkAdjustCommission: 0,//暗佣+明佣 上调金额
darkAdjustCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,//暗佣+明佣 上调对应的货币
darkAdjustUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,//暗佣+明佣 上调对应的单位
}
],
customerForm: {
......@@ -314,17 +317,33 @@ export default {
commodity: [],
// 表单校验
rules: {
commissionId: [{required: true, message: "佣金表id不能为空", trigger: "blur"}],
customerId: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
departureId: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
transportId: [{required: true, message: "运输方式不能为空", trigger: "blur"}],
objectiveId: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
customsType: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
approval: [{required: true, message: "客户名称不能为空", trigger: "blur"}],
},
customerShow: true
};
},
computed:{
importCityList(){
return this.tradeCityList.filter(item => item.type == 1)
},
exportCityList(){
return this.tradeCityList.filter(item => item.type == 2)
},
},
created() {
this.getItemType();
console.log(this.getDictDatas(this.DICT_TYPE.COMMISSION_TYPE),'123');
commodityList().then(res => {
console.log(res, 'res');
this.commodity = res.data
this.darkServantAndProductForm.forEach(item=>{item.productType =this.commodity[0].id})
})
getTradeCityList().then(res => {
this.tradeCityList = res.data
})
},
methods: {
......@@ -363,26 +382,28 @@ export default {
addToFn(val){
if(val === 1){
this.darkServantAndProductForm.push( {
amount: undefined,// 暗佣-满减金额
amountCurrency: undefined,// 暗佣-满减金额对应货币
amountUnit: undefined,// 暗佣-满减金额对应单位,
refund: undefined,//暗佣-满之后返还金额
refundCurrency: undefined,//暗佣-满之后返还金额的货币
refundUnit: undefined,//暗佣-满之后返还金额的单位
productType:this.commodity[0].id,//商品类型
productAttr: this.commodityType[0].id,//暗佣 产品属性
darkCommission: 0,//暗佣 佣金
darkCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣 货币
darkUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,// 暗佣 单位
})
}else {
this.darkServantAndRebateForm.push( {
amount: undefined,// 暗佣-满减金额
amountCurrency: undefined,// 暗佣-满减金额对应货币
amountUnit: undefined,// 暗佣-满减金额对应单位,
refund: undefined,//暗佣-满之后返还金额
refundCurrency: undefined,//暗佣-满之后返还金额的货币
refundUnit: undefined,//暗佣-满之后返还金额的单位
amount: 0,// 暗佣-满减金额
amountCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,// 暗佣-满减金额对应货币
amountUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refundCurrency: this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value,//暗佣-满之后返还金额的货币
refundUnit: this.getDictDatas(this.DICT_TYPE.COMMISSION_UNIT)[0].value,//暗佣-满之后返还金额的单位
})
}
},
/** 提交按钮 */
submitForm() {
this.$refs.form.validate ((valid)=>{
if(!valid)return
console.log(valid,'1234')
if (this.form.type == 1) {
this.form.customerCommissionInfoBaseVOList = this.mingServantFrom
} else if (this.form.type == 2) {
......@@ -394,16 +415,17 @@ export default {
} else if (this.form.type == 3) {
this.form.customerCommissionInfoBaseVOList = this.mingServantAnddarkServant
}
console.log(this.form)
createCommission(this.form).then(r =>{
console.log(r)
})
})
},
// 商品类型
getItemType() {
itemTypeListApi().then(res => {
if (res.code === 0) {
this.commodityType = res.data;
this.darkServantAndProductForm.forEach(item =>{item.productAttr = this.commodityType[0].id})
}
})
},
......@@ -484,6 +506,7 @@ export default {
font-size: 14px;
color: #606266;
font-weight: 700;
text-align: left;
}
.custom {
......@@ -499,12 +522,13 @@ export default {
align-items: center;
.label {
width: 50px;
width: 26px;
white-space: nowrap;
vertical-align: middle;
font-size: 14px;
color: #606266;
font-weight: 700;
width: 100px;
}
}
......
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