Commit ccb5be5a authored by 黄奎's avatar 黄奎

页面修改

parent d62d22e2
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
padding: 5px 10px; padding: 5px 10px;
align-items: center; align-items: center;
} }
</style> </style>
<!--订单操作--> <!--订单操作-->
...@@ -20,14 +21,15 @@ ...@@ -20,14 +21,15 @@
</div> </div>
</div> </div>
<div style="padding:20px 15px;"> <div style="padding:20px 15px;">
<q-input filled stack-label maxlength="100" :dense="false" @keyup.native="checkInteger(OrderMsg,'GuestNum')" v-model="OrderMsg.GuestNum" <q-input filled stack-label maxlength="100" :dense="false" @keyup.native="checkInteger(OrderMsg,'GuestNum')"
@input="countPrice" class="col-12" label="人数" :rules="[val => !!val || '请填写人数']" v-model="OrderMsg.GuestNum" @input="countPrice" class="col-12" label="人数" :rules="[val => !!val || '请填写人数']"
:disable="modityOrderType==2" /> :disable="modityOrderType==2" />
<template v-if="isChaBan==1"> <template v-if="isChaBan==1">
<q-select filled option-value="CourseId" option-label="CourseName" ref="CourseId" <q-select filled option-value="CourseId" option-label="CourseName" ref="CourseId" v-model="OrderMsg.CourseId"
v-model="OrderMsg.CourseId" :options="CourseList" emit-value map-options class="q-pb-lg" :rules="[val => !!val || '请选择课程']" label="选择课程" :options="CourseList" emit-value map-options class="q-pb-lg" :rules="[val => !!val || '请选择课程']" label="选择课程"
@input="changePrice" /> @input="changePrice" />
<q-input filled stack-label :dense="false" v-model="OrderMsg.StartClassHours" @keyup.native="checkInteger(OrderMsg,'StartClassHours')" ref="StartClassHours" @blur="countPrice" <q-input filled stack-label :dense="false" v-model="OrderMsg.StartClassHours"
@keyup.native="checkInteger(OrderMsg,'StartClassHours')" ref="StartClassHours" @blur="countPrice"
class="col-12" label="起始课时" :rules="[val => !!val || '请填起始课时']" /> class="col-12" label="起始课时" :rules="[val => !!val || '请填起始课时']" />
</template> </template>
<template v-if="modityOrderType==1"> <template v-if="modityOrderType==1">
...@@ -43,10 +45,10 @@ ...@@ -43,10 +45,10 @@
<template v-if="modityOrderType==3"> <template v-if="modityOrderType==3">
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" @blur="countPrice" class="col-12" <q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" @blur="countPrice" class="col-12"
label="成交单价" :rules="[val => !!val || '请填成交单价']" /> label="成交单价" :rules="[val => !!val || '请填成交单价']" />
<q-input filled stack-label v-if="OrderMsg.OrderType==1" :dense="false" maxlength="10"
@keyup.native="checkPrice(OrderMsg,'PreferPrice')" v-model="OrderMsg.PreferPrice" class="col-12 q-pb-lg"
label="应收" />
</template> </template>
<q-input filled stack-label :disable="modityOrderType!=3" :dense="false" maxlength="10"
@keyup.native="checkPrice(OrderMsg,'PreferPrice')" v-model="OrderMsg.PreferPrice" class="col-12 q-pb-lg"
label="应收" />
<q-select :disable="modityOrderType==2" standout="bg-primary text-white" option-value="Id" option-label="Name" <q-select :disable="modityOrderType==2" standout="bg-primary text-white" option-value="Id" option-label="Name"
v-model="OrderMsg.OrderSource" :options="SourceEnumList" emit-value map-options class="q-pb-lg" v-model="OrderMsg.OrderSource" :options="SourceEnumList" emit-value map-options class="q-pb-lg"
label="客人来源" /> label="客人来源" />
...@@ -152,7 +154,7 @@ ...@@ -152,7 +154,7 @@
EmployeeList: [], //员工列表 EmployeeList: [], //员工列表
AllemployeeList: [], //所有员工列表 AllemployeeList: [], //所有员工列表
CourseList: [], //课程列表 CourseList: [], //课程列表
choiceObj:{} courseObj: {} //选择的课程
} }
}, },
created() { created() {
...@@ -194,14 +196,14 @@ ...@@ -194,14 +196,14 @@
//选择课程切换价格 //选择课程切换价格
changePrice() { changePrice() {
let temp = this.CourseList.find(x => x.CourseId == this.OrderMsg.CourseId); let temp = this.CourseList.find(x => x.CourseId == this.OrderMsg.CourseId);
console.log(temp,'temp');
this.choiceObj = temp;
if (temp) { if (temp) {
this.OrderMsg.Unit_Price = temp.SellPrice; this.OrderMsg.Unit_Price = temp.SellPrice;
this.UnitPrice = temp.SellPrice; this.UnitPrice = temp.SellPrice;
this.courseObj = temp;
} else { } else {
this.OrderMsg.Unit_Price = 0; this.OrderMsg.Unit_Price = 0;
this.UnitPrice = 0; this.UnitPrice = 0;
this.courseObj = {};
} }
this.countPrice(); this.countPrice();
}, },
...@@ -324,24 +326,39 @@ ...@@ -324,24 +326,39 @@
unit_price = Number(this.OrderMsg.Unit_Price); unit_price = Number(this.OrderMsg.Unit_Price);
} }
//计算应收价格 //计算应收价格
if (this.OrderMsg.IsChaBan == 1) {
this.OrderMsg.PreferPrice = Number(guestNum * unit_price).toFixed(2); var newPreferPrice = 0;
if (this.courseObj) {
newPreferPrice = this.courseObj.SellPrice / this.courseObj.ClassHours * (this.courseObj.ClassHours - this
.courseObj.StartClassHours)
}
this.OrderMsg.PreferPrice = Number(newPreferPrice).toFixed(2);
} else {
this.OrderMsg.PreferPrice = Number(guestNum * unit_price).toFixed(2);
}
if (this.OrderMsg.OrderType == 2) { if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OldPreferPrice = Number(guestNum * unit_price).toFixed(2); this.OrderMsg.OldPreferPrice = Number(guestNum * unit_price).toFixed(2);
} }
}, },
//修改订单 //修改订单
saveOrderInfo() { saveOrderInfo() {
if (this.OrderMsg.OrderType == 1) { //计算应收价格
if (this.OrderMsg.IsChaBan == 1) {
if (this.modityOrderType == 1 || this.modityOrderType == 2) {
var newPreferPrice = this.courseObj.SellPrice / this.courseObj.ClassHours * (this.courseObj.ClassHours -
this.courseObj.StartClassHours) - this.OrderMsg.LessPrice;
this.OrderMsg.PreferPrice = Number(newPreferPrice).toFixed(2);
}
} else {
if (this.modityOrderType == 1 || this.modityOrderType == 2) { if (this.modityOrderType == 1 || this.modityOrderType == 2) {
this.OrderMsg.PreferPrice = (this.OrderMsg.GuestNum * this.OrderMsg.Unit_Price) - this.OrderMsg.LessPrice; this.OrderMsg.PreferPrice = (this.OrderMsg.GuestNum * this.OrderMsg.Unit_Price) - this.OrderMsg.LessPrice;
} }
} }
if(this.isChaBan==1){ if (this.isChaBan == 1) {
this.$refs.CourseId.validate(); this.$refs.CourseId.validate();
this.$refs.StartClassHours.validate(); this.$refs.StartClassHours.validate();
if(this.$refs.CourseId.hasError||this.$refs.StartClassHours.hasError){ if (this.$refs.CourseId.hasError || this.$refs.StartClassHours.hasError) {
return; return;
} }
} }
setClassOrder(this.OrderMsg).then(res => { setClassOrder(this.OrderMsg).then(res => {
......
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