Commit 06ce1b0d authored by dcy's avatar dcy

佣金修改

parent ac11d887
......@@ -53,7 +53,7 @@
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button></div>
<div style="flex: 1; text-align: right;">
<router-link :to="'/customerCommissionInfo/'+ 0 ">
<el-button>佣金设置</el-button>
<el-button type="primary">佣金设置</el-button>
</router-link>
</div>
</div>
......@@ -119,7 +119,7 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑</el-button>
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑</el-button>-->
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
......
<template>
<el-select v-if="options" v-model="selectVal" placeholder="请选择">
<el-option v-if="allShow" label="全部" :value='0'></el-option>
<el-option
v-for="item in options"
:key="item[valueKey]"
......@@ -26,6 +27,10 @@ export default {
type:String,
default: 'value',
},
allShow:{
type:Boolean,
default:false
}
},
data(){
return{
......
......@@ -6,43 +6,47 @@
<el-row>
<el-col :span="5">
<el-form-item label="客户名称" prop="customerId">
<el-select
v-model="customerForm.name"
filterable
placeholder="请输入关键词"
@change="changefn">
<el-option
v-for="item in customeList"
:key="item.id"
:value="item.id.toString()"
:label="item.name"
>
{{ item.number }}|{{ item.name }}|{{ item.defaultContactPhone }}
</el-option>
</el-select>
<div style="display: flex">
<el-input placeholder="请输入选择客户" v-model="customerName"></el-input>
<img style="width: 40px;height: 40px;margin-left: 40px;" src="@/assets/images/phonebook.png" class="phonebook" @click="customerNameShow= true" />
</div>
<!-- <el-select-->
<!-- v-model="customerForm.name"-->
<!-- filterable-->
<!-- placeholder="请输入关键词"-->
<!-- @change="changefn">-->
<!-- <el-option-->
<!-- v-for="item in customeList"-->
<!-- :key="item.id"-->
<!-- :value="item.id.toString()"-->
<!-- :label="item.name"-->
<!-- >-->
<!-- {{ item.number }}|{{ item.name }}|{{ item.defaultContactPhone }}-->
<!-- </el-option>-->
<!-- </el-select>-->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<el-form-item label="运输方式" prop="transportId">
<div>
<custom-selectors-dictionary v-model="form.transportId" :options="getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE)"></custom-selectors-dictionary>
<custom-selectors-dictionary :all-show="true" v-model="form.transportId" :options="getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE)"></custom-selectors-dictionary>
</div>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="始发地" prop="departureId">
<div>
<custom-selectors-dictionary label-key="titleZh" value-key="id" v-model="form.departureId"
<custom-selectors-dictionary :all-show="true" label-key="titleZh" value-key="id" v-model="form.departureId"
:options="exportCityList"></custom-selectors-dictionary>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<el-form-item label="目的地" prop="objectiveId">
<div>
<custom-selectors-dictionary label-key="titleZh" value-key="id" v-model="form.objectiveId"
<custom-selectors-dictionary :all-show="true" label-key="titleZh" value-key="id" v-model="form.objectiveId"
:options="importCityList"></custom-selectors-dictionary>
</div>
</el-form-item>
......@@ -50,7 +54,7 @@
<el-col :span="5">
<el-form-item label="报关方式" prop="customsType">
<div>
<custom-selectors-dictionary v-model="form.customsType"
<custom-selectors-dictionary :all-show="true" v-model="form.customsType"
:options="getDictDatas(DICT_TYPE.SHIPPING_DECLARATION_TYPE)"></custom-selectors-dictionary>
</div>
</el-form-item>
......@@ -58,7 +62,7 @@
<el-col :span="5">
<el-form-item label="备案" prop="approval">
<div>
<custom-selectors-dictionary v-model="form.approval"
<custom-selectors-dictionary :all-show="true" v-model="form.approval"
:options="getDictDatas(DICT_TYPE.COMMISSION_PRODUCT_APPROVAL)"></custom-selectors-dictionary>
</div>
</el-form-item>
......@@ -109,7 +113,7 @@
<el-form-item label="商品类型" v-for="(item,index) in darkServantAndProductForm" :key="index">
<div class="shanping-type">
<div class="tool">
<custom-selectors-dictionary v-model="item.productType" :options="commodity" label-key="titleZh"
<custom-selectors-dictionary :all-show="true" v-model="item.productType" :options="productAttrList" label-key="titleZh"
value-key="id"></custom-selectors-dictionary>
</div>
<div class="box">
......@@ -117,7 +121,7 @@
商品特性
</div>
<div class="custom">
<custom-selectors-dictionary v-model="item.productAttr" label-key="attrName" value-key="id"
<custom-selectors-dictionary :all-show="true" v-model="item.productAttr" label-key="attrName" value-key="id"
:options="commodityType"></custom-selectors-dictionary>
</div>
</div>
......@@ -229,6 +233,7 @@
</el-row>
</el-card>
</el-form>
<choose-contact-dialog v-if="customerNameShow" @choose="onContactChoose" @close="customerNameShow = false" />
</div>
</template>
......@@ -244,16 +249,20 @@ import {getTradeCityList} from "@/api/ecw/region";
import RoutersSelector from "@/components/RoutersSelector"
import CustomersSelector from "@/components/CustomersSelector";
import {getUnitList} from "@/api/ecw/unit";
import ChooseContactDialog from '@/components/ChooseContactDialog'
import {getProductTypeList} from "@/api/ecw/productType";
export default {
name: "CustomerCommissionInfo",
components: {
customSelectorsDictionary,
RoutersSelector,
CustomersSelector
CustomersSelector,
ChooseContactDialog
},
data() {
return {
customerName:undefined,
customerNameShow:false,
value: '',
isSubmit:false,
getDictDatas,
......@@ -262,20 +271,20 @@ export default {
tradeCityList: [],
// 表单参数
form: {
approval: undefined,// 产品备案
approval: 0,// 产品备案
customerCommissionInfoBaseVOList: [],// 佣金详情
customerId: undefined,//客户id
customsType: undefined,//报关类别:我司全代:1,自单代报:2,混合报关:3
customsType: 0,//报关类别:我司全代:1,自单代报:2,混合报关:3
darkReturnType: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_DARK_TYPE)[0].value),// 暗佣类型 1产品2达标
departureId: undefined,// 始发地id
objectiveId: undefined,//目的地id
transportId:undefined,//运输方式
departureId: 0,// 始发地id
objectiveId: 0 ,//目的地id
transportId:0,//运输方式
type: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_TYPE)[1].value),// 佣金类型
},
//明佣
mingServantFrom: [
{
refund: 0,
refund: 1,
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),
refundUnit:undefined,
}
......@@ -283,9 +292,9 @@ export default {
//暗佣金+产品
darkServantAndProductForm: [
{
productType:undefined,//商品类型
productAttr: undefined,//暗佣 产品属性
darkCommission: 0,//暗佣 佣金
productType:0,//商品类型
productAttr: 0,//暗佣 产品属性
darkCommission: 1,//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkUnit:undefined,// 暗佣 单位
}
......@@ -293,10 +302,10 @@ export default {
//暗佣+达标返佣
darkServantAndRebateForm: [
{
amount: 0,// 暗佣-满减金额
amount: 1,// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountUnit:undefined,// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refund: 1,//暗佣-满之后返还金额
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundUnit:undefined,//暗佣-满之后返还金额的单位
}
......@@ -304,10 +313,10 @@ export default {
//暗佣+明金
mingServantAnddarkServant: [
{
refund: 0,// 暗佣+明佣 上调金额
refund: 1,// 暗佣+明佣 上调金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣+明佣 上调对应的货币
refundUnit: undefined,//暗佣+明佣 上调对应的单位
darkAdjustCommission: 0,//暗佣+明佣 上调金额
darkAdjustCommission: 1,//暗佣+明佣 上调金额
darkAdjustCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣+明佣 上调对应的货币
darkAdjustUnit:undefined,//暗佣+明佣 上调对应的单位
}
......@@ -326,8 +335,8 @@ export default {
},
customerShow: true,
id:undefined,//佣金id
weightList:[]
weightList:[],
productAttrList:[]
};
},
computed:{
......@@ -339,37 +348,41 @@ export default {
},
},
created() {
getProductTypeList().then(response => {
console.log(response.data,'response.data')
this.productAttrList = response.data
})
//重量单位
getUnitList().then(r =>{
if(r.code === 0){
this.weightList = r.data
this.$set(this.mingServantFrom,0, {
refund: 0,
refund: 1,
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),
refundUnit: parseInt(this.weightList[0].id),})
this.$set(this.darkServantAndProductForm, 0,
{
productType: undefined,//商品类型
productAttr: undefined,//暗佣 产品属性
darkCommission: 0,//暗佣 佣金
productType: 0,//商品类型
productAttr: 0,//暗佣 产品属性
darkCommission: 1,//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkUnit: parseInt(this.weightList[0].id),// 暗佣 单位
})
this.$set(this.darkServantAndRebateForm, 0,
{
amount: 0,// 暗佣-满减金额
amount: 1,// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountUnit:parseInt (this.weightList[0].id),// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refund: 1,//暗佣-满之后返还金额
refundCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundUnit:parseInt(this.weightList[0].id),//暗佣-满之后返还金额的单位
})
this.$set(this.mingServantAnddarkServant, 0,
{
refund: 0,// 暗佣+明佣 上调金额
refund: 1,// 暗佣+明佣 上调金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣+明佣 上调对应的货币
refundUnit: parseInt(this.weightList[0].id),//暗佣+明佣 上调对应的单位
darkAdjustCommission: 0,//暗佣+明佣 上调金额
darkAdjustCommission: 1,//暗佣+明佣 上调金额
darkAdjustCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣+明佣 上调对应的货币
darkAdjustUnit:parseInt(this.weightList[0].id),//暗佣+明佣 上调对应的单位
})
......@@ -453,10 +466,10 @@ export default {
approval: undefined,
customerCommissionInfoBaseVOList: [],
customerId: undefined,//客户id
customsType: undefined,//报关类别:我司全代:1,自单代报:2,混合报关:3
customsType: '',//报关类别:我司全代:1,自单代报:2,混合报关:3
darkReturnType: this.getDictDatas(this.DICT_TYPE.COMMISSION_DARK_TYPE)[0].value,// 暗佣类型 1产品2达标
departureId: undefined,// 始发地id
objectiveId: undefined,// 运输方式
departureId: '',// 始发地id
objectiveId: '',// 运输方式
type: this.getDictDatas(this.DICT_TYPE.COMMISSION_TYPE)[1].value,// 佣金类型
};
this.resetForm("form");
......@@ -465,18 +478,18 @@ export default {
addToFn(val){
if(val === 1){
this.darkServantAndProductForm.push({
productType:this.commodity[0].id,//商品类型
productAttr: this.commodityType[0].id,//暗佣 产品属性
darkCommission: 0,//暗佣 佣金
productType:0,//商品类型
productAttr:0,//暗佣 产品属性
darkCommission: 1,//暗佣 佣金
darkCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣 货币
darkUnit:this.darkServantAndProductForm[0].darkUnit,// 暗佣 单位
})
}else {
this.darkServantAndRebateForm.push( {
amount: 0,// 暗佣-满减金额
amount: 1,// 暗佣-满减金额
amountCurrency:parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),// 暗佣-满减金额对应货币
amountUnit: parseInt(this.weightList[0].id),// 暗佣-满减金额对应单位,
refund: 0,//暗佣-满之后返还金额
refund: 1,//暗佣-满之后返还金额
refundCurrency: parseInt(this.getDictDatas(this.DICT_TYPE.COMMISSION_CURRENCY_TYPE)[0].value),//暗佣-满之后返还金额的货币
refundUnit: this.darkServantAndRebateForm[0].refundUnit,//暗佣-满之后返还金额的单位
})
......@@ -488,21 +501,25 @@ export default {
this.isSubmit = true;
if(!valid)return
if (this.form.type == 1) {
if(Number(this.mingServantFrom[0].refund) <= 0 || isNaN(Number(this.mingServantFrom[0].refund))) return this.$message.warning('请输入大于0的金额')
this.form.customerCommissionInfoBaseVOList = this.mingServantFrom
} else if (this.form.type == 2) {
if (this.form.darkReturnType == 1) {
if(this.darkServantAndProductForm.some(i => i.darkCommission <= 0 || isNaN(i.darkCommission))) return this.$message.warning('请输入大于0的金额')
this.form.customerCommissionInfoBaseVOList = this.darkServantAndProductForm
} else {
if(this.darkServantAndRebateForm.some(i => i.amount <= 0 || i.refund <=0)) return this.$message.warning('请输入大于0的金额')
this.form.customerCommissionInfoBaseVOList = this.darkServantAndRebateForm
}
} else if (this.form.type == 3) {
if(this.mingServantAnddarkServant[0].darkAdjustCommission <= 0 || this.mingServantAnddarkServant[0].refund <= 0 ) return this.$message.warning('请输入大于0的金额')
this.form.customerCommissionInfoBaseVOList = this.mingServantAnddarkServant
}
if(this.$route.params.dictId == 0){
createCommission(this.form).then(r =>{
console.log('添加',r)
if(r.code == 0){
this.$message('添加成功!');
this.$message.success('添加成功!');
this.$router.go(-1)
}
})
......@@ -513,10 +530,9 @@ export default {
}
p.customerCommissionInfoBaseVOList.forEach(item => {item.commissionId = this.$route.params.dictId})
updateCustomerCommissionInfo(p).then(r=>{
console.log('更新',r)
if(r.code == 0){
this.$router.go(-1)
this.$message('修改成功!');
this.$message.success('修改成功!');
}
})
}
......@@ -529,7 +545,7 @@ export default {
if (res.code === 0) {
this.commodityType = res.data;
if(this.$route.params.dictId == 0 || (this.form.type == 2 && this.form.darkReturnType != 1)){
this.darkServantAndProductForm.forEach(item =>{item.productAttr = this.commodityType[0].id})
this.darkServantAndProductForm.forEach(item =>{item.productAttr = 0})
}
}
})
......@@ -539,9 +555,15 @@ export default {
commodityList().then(res => {
this.commodity = res.data
if(this.$route.params.dictId == 0 || (this.form.type == 2 && this.form.darkReturnType != 1)){
this.darkServantAndProductForm.forEach(item=>{item.productType =this.commodity[0].id})
this.darkServantAndProductForm.forEach(item=>{item.productType = 0})
}
})
},
onContactChoose(val){
this.customerNameShow = false;
this.customerName = val.customerName;
this.form.customerId = val.customerId;
}
},
watch:{
......@@ -554,7 +576,7 @@ export default {
deep:true,
},
'form.transportId':function (val){
if(!this.weightList) return
if(this.weightList.length === 0 || !val) return
if((val == 1 || val == 2)){
let index = this.weightList.findIndex(item => item.id == 7);
this.mingServantFrom.forEach(item =>{
......
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