Commit 07360c3e authored by zhengke's avatar zhengke

增加修改提成

parent 4d191789
...@@ -239,3 +239,15 @@ export function getClassOrderForDetail(data) { ...@@ -239,3 +239,15 @@ export function getClassOrderForDetail(data) {
data data
}) })
} }
/**
* 修改提成和额外金额
*
*/
export function UpdateOrderCommission(data) {
return request({
url: '/order/UpdateOrderCommission',
method: 'post',
data
})
}
\ No newline at end of file
<!--修改-提成和额外金额-->
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 400px;max-width:500px;padding:0 20px;">
<q-card-section>
<div class="text-h6">{{commonTitle}}</div>
</q-card-section>
<template v-if="type==1">
<q-input filled stack-label :dense="false" v-model="msg.CommissionMoney" ref="CommissionMoney"
class="col-6 q-pb-lg" label="提成金额" :rules="[val => !!val || '请填写提成金额']" />
</template>
<template v-if="type==2">
<q-input filled stack-label :dense="false" v-model="msg.ExtraRewardMoney" ref="ExtraRewardMoney"
class="col-6 q-pb-lg" label="额外奖励" :rules="[val => !!val || '请填写额外奖励']" />
<q-input filled stack-label :dense="false" v-model="msg.ExtraDeductMoney" ref="ExtraDeductMoney"
class="col-6 q-pb-lg" label="额外扣除" :rules="[val => !!val || '请填写额外扣除']" />
</template>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeRemarkForm" />
<q-btn label="保存" color="accent" class="q-px-md" style="font-weight:400 !important" @click="saveMoney" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
UpdateOrderCommission,
} from '../../api/sale/sale'
export default {
props: {
data: {
type: Object,
default: null,
},
type: {
type: Number,
default: 0,
}
},
data() {
return {
persistent: true,
commonTitle: '',
msg: {
OrderId: 0, //订单id
Type: 1, //类型 1提成 2额外金额
CommissionMoney: '', //提成金额
ExtraRewardMoney: 0, //额外奖励
ExtraDeductMoney: 0 //额外扣除
}
}
},
created() {},
mounted() {
this.msg.OrderId = this.data.OrderId;
this.msg.Type = this.type;
if (this.type == 1) {
this.commonTitle = '修改提成'
this.msg.CommissionMoney = this.data.CommissionMoney;
}
if(this.type==2){
this.commonTitle = '修改额外奖励'
this.msg.CommissionMoney = 0;
this.msg.ExtraRewardMoney = this.data.ExtraRewardMoney;
this.msg.ExtraDeductMoney = this.data.ExtraDeductMoney;
}
},
methods: {
//关闭弹窗
closeRemarkForm() {
this.persistent = false;
this.$emit('close');
},
//保存修改
saveMoney() {
if (this.type == 1) {
if (this.msg.CommissionMoney == '') {
this.$q.notify({
icon: 'negative',
color: 'accent',
timeout: 2000,
message: '请填写提成金额',
position: 'top'
})
return
}
}
if(this.type == 2){
if (this.msg.ExtraRewardMoney == '') {
this.$q.notify({
icon: 'negative',
color: 'accent',
timeout: 2000,
message: '请填写额外奖励',
position: 'top'
})
return
}
if (this.msg.ExtraDeductMoney == '') {
this.$q.notify({
icon: 'negative',
color: 'accent',
timeout: 2000,
message: '请填写额外扣除',
position: 'top'
})
return
}
}
UpdateOrderCommission(this.msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '修改成功!',
position: 'top'
})
}
this.$emit('success');
})
}
}
}
</script>
...@@ -28,6 +28,13 @@ ...@@ -28,6 +28,13 @@
<div style="margin-top: 30px;margin-bottom: 10px">班级</div> <div style="margin-top: 30px;margin-bottom: 10px">班级</div>
<div style="font-weight: bold;color:#2961FE;cursor:pointer;" @click="getClassInfo(item)">{{item.ClassName}}</div> <div style="font-weight: bold;color:#2961FE;cursor:pointer;" @click="getClassInfo(item)">{{item.ClassName}}</div>
</template> </template>
<template v-if="!isShowClass&&item.IsCommissionGive==1">
<div style="margin-top:30px;">提成:{{item.CommissionMoney}}</div>
</template>
<template v-if="!isShowClass">
<div style="margin-top:30px;" v-if="item.ExtraRewardMoney>0">额外奖励:{{item.ExtraRewardMoney}}</div>
<div style="margin-top:10px;" v-if="item.ExtraDeductMoney>0">额外扣除:{{item.ExtraDeductMoney}}</div>
</template>
</td> </td>
<td style="border:none">{{item.GuestNum}}人</td> <td style="border:none">{{item.GuestNum}}人</td>
<td style="border:none">{{item.Class_Price.toFixed(2)}}</td> <td style="border:none">{{item.Class_Price.toFixed(2)}}</td>
...@@ -53,37 +60,50 @@ ...@@ -53,37 +60,50 @@
<q-item-label>学生名单</q-item-label> <q-item-label>学生名单</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup> <q-item clickable v-close-popup v-if="isShowClass">
<q-item-section @click="transferOrder(item)"> <q-item-section @click="transferOrder(item)">
<q-item-label>转交订单</q-item-label> <q-item-label>转交订单</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup> <q-item clickable v-close-popup v-if="isShowClass">
<q-item-section @click="editOrderRemark(item,1)"> <q-item-section @click="editOrderRemark(item,1)">
<q-item-label>销售备注</q-item-label> <q-item-label>销售备注</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup> <q-item clickable v-close-popup v-if="!isShowClass">
<q-item-section @click="editOrderRemark(item,2)"> <q-item-section @click="editOrderRemark(item,2)">
<q-item-label>教务备注</q-item-label> <q-item-label>教务备注</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup> <q-item clickable v-close-popup v-if="!isShowClass">
<q-item-section @click="editOrderRemark(item,3)"> <q-item-section @click="editOrderRemark(item,3)">
<q-item-label>校长备注</q-item-label> <q-item-label>校长备注</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup> <q-item clickable v-close-popup v-if="!isShowClass">
<q-item-section @click="editOrderRemark(item,4)"> <q-item-section @click="editOrderRemark(item,4)">
<q-item-label>经理备注</q-item-label> <q-item-label>总经理备注</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup v-if="!isShowClass&&item.IsCommissionGive==1">
<q-item-section @click="upDateMoney(item,1)">
<q-item-label>修改提成</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup v-if="!isShowClass">
<q-item-section @click="upDateMoney(item,2)">
<q-item-label>额外奖励</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup> <q-item clickable v-close-popup>
<q-item-section @click="CancelOrder(item)"> <q-item-section @click="CancelOrder(item)">
<q-item-label>取消</q-item-label> <q-item-label>取消订单</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup> <q-item clickable v-close-popup v-close-popup v-if="isShowClass">
<q-item-section> <q-item-section>
<q-item-label @click="showBackClassForm(item)">退课</q-item-label> <q-item-label @click="showBackClassForm(item)">退课</q-item-label>
</q-item-section> </q-item-section>
...@@ -447,6 +467,8 @@ ...@@ -447,6 +467,8 @@
<!--退课申请--> <!--退课申请-->
<backclass-form v-if="isShowBackClassForm" :save-obj="orderObj" @close="closeBackClassForm" <backclass-form v-if="isShowBackClassForm" :save-obj="orderObj" @close="closeBackClassForm"
@success="refreshClassOrder"></backclass-form> @success="refreshClassOrder"></backclass-form>
<!-- 修改提成和额外奖励 -->
<money-form v-if="isShowMoney" :data="moneyObj" :type="CommonType" @close="closeMoneyForm" @success="refreshMoney"></money-form>
</div> </div>
</template> </template>
...@@ -455,6 +477,8 @@ ...@@ -455,6 +477,8 @@
import orderremarkForm from '../sale/orderremark-form' //订单备注 import orderremarkForm from '../sale/orderremark-form' //订单备注
import transOrderForm from '../sale/transOrder-form' //转交订单 import transOrderForm from '../sale/transOrder-form' //转交订单
import backclassForm from '../sale/backclass-form' //退课申请 import backclassForm from '../sale/backclass-form' //退课申请
import moneyForm from '../sale/money-form' //修改提成和额外奖励
import { import {
cancelClassOrder, //取消订单 cancelClassOrder, //取消订单
} from '../../api/sale/sale' } from '../../api/sale/sale'
...@@ -468,7 +492,8 @@ ...@@ -468,7 +492,8 @@
transOrderForm, transOrderForm,
myOrderForm, myOrderForm,
classinfoForm, classinfoForm,
backclassForm backclassForm,
moneyForm
}, },
props: { props: {
//正常订单 //正常订单
...@@ -498,11 +523,14 @@ ...@@ -498,11 +523,14 @@
myorderObjOption: {}, //详情的数据 myorderObjOption: {}, //详情的数据
classObjOption: null, classObjOption: null,
isShowClassInfo: false, //是否显示课程信息 isShowClassInfo: false, //是否显示课程信息
isShowMoney:false, //是否显示修改提成和额外奖励
moneyObj:{},
CommonType:-1 //用于判断是修改提成还是额外奖励
} }
}, },
created() {}, created() {
},
mounted() { mounted() {
}, },
methods: { methods: {
//显示退课申请 //显示退课申请
...@@ -603,6 +631,16 @@ ...@@ -603,6 +631,16 @@
//调用父页面成功方法 //调用父页面成功方法
this.$emit('success'); this.$emit('success');
}, },
//关闭修改提成和额外奖励
closeMoneyForm() {
this.moneyObj = {};
this.isShowMoney = false;
},
//修改提成和额外奖励后刷新
refreshMoney(){
this.isShowMoney=false;
this.$emit('success');
},
//取消订单 //取消订单
CancelOrder(item) { CancelOrder(item) {
let that = this let that = this
...@@ -668,6 +706,12 @@ ...@@ -668,6 +706,12 @@
refreshClass() { refreshClass() {
}, },
//修改提成-奖励
upDateMoney(item,type){
this.moneyObj = item;
this.CommonType = type;
this.isShowMoney = true;
}
} }
} }
......
...@@ -1742,12 +1742,12 @@ ...@@ -1742,12 +1742,12 @@
getSchoolPage(this.schoolMsg).then(res => { getSchoolPage(this.schoolMsg).then(res => {
let data = res.Data.PageData; let data = res.Data.PageData;
let Status = false; let Status = false;
if (this.$route.query.companyID !== '-1' && this.$route.query.companyID !== undefined&& this.$route.query.companyID !== 'undefined') { // if (this.$route.query.companyID !== '-1' && this.$route.query.companyID !== undefined&& this.$route.query.companyID !== 'undefined') {
Status = true; // Status = true;
data.forEach(x => { // data.forEach(x => {
x.disabled = true; // x.disabled = true;
}) // })
} // }
if (this.orderObj && this.orderObj.companyIDList && this.orderObj.companyIDList.length > 0) { if (this.orderObj && this.orderObj.companyIDList && this.orderObj.companyIDList.length > 0) {
Status = true; Status = true;
this.orderObj.companyIDList.forEach(x => { this.orderObj.companyIDList.forEach(x => {
...@@ -1789,7 +1789,6 @@ ...@@ -1789,7 +1789,6 @@
this.msg.RB_BranchName = x.SName; this.msg.RB_BranchName = x.SName;
} }
}) })
}).catch(() => { }).catch(() => {
}) })
......
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