Commit 06ce1b0d authored by dcy's avatar dcy

佣金修改

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