Commit ccb5be5a authored by 黄奎's avatar 黄奎

页面修改

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