Commit 43047461 authored by 黄奎's avatar 黄奎

页面修改

parent abcab161
......@@ -9,9 +9,10 @@
</div>
<div style="padding:20px 15px;">
<q-input filled stack-label maxlength="100" :dense="false" v-model="OrderMsg.GuestNum" type="number"
@input="peopleNumber" class="col-12" label="人数" :rules="[val => !!val || '请填写人数']" />
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price" :disable="UPrice==true?false:true"
@blur="priceNumber" class="col-12" label="成交单价" :rules="[val => !!val || '请填成交单价']" />
@input="countPrice" class="col-12" label="人数" :rules="[val => !!val || '请填写人数']" />
<q-input filled stack-label :dense="false" v-model="OrderMsg.Unit_Price"
:disable="IsShowUpPrice==true?false:true" @blur="countPrice" class="col-12" label="成交单价"
:rules="[val => !!val || '请填成交单价']" />
<q-toggle v-model="IsShowUpPrice" label="高于定价收生" class="q-mb-md" />
<q-select standout="bg-primary text-white" option-value="Id" option-label="Name" v-model="OrderMsg.OrderSource"
......@@ -132,15 +133,15 @@
computed: mapState({
//是否有查看合同权限
isHaveModify(state) {
if (state.user.userInfo && state.user.userInfo.ActionMenuList && state.user.userInfo.ActionMenuList.length >
0) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "E_ModifyStudyOrderPrice") {
return x;
}
});
return action && action.FunctionCode;
}
// if (state.user.userInfo && state.user.userInfo.ActionMenuList && state.user.userInfo.ActionMenuList.length >
// 0) {
// let action = state.user.userInfo.ActionMenuList.find(x => {
// if (x.FunctionCode == "E_ModifyStudyOrderPrice") {
// return x;
// }
// });
// return action && action.FunctionCode;
// }
return false;
}
}),
......@@ -149,6 +150,8 @@
this.getEmployee();
},
mounted() {
console.log("saveObj", this.saveObj);
console.log("orderType", this.orderType);
this.initData()
},
methods: {
......@@ -199,7 +202,8 @@
this.OrderMsg.SourceId = this.saveObj.SourceId;
}
}
this.IsShowEditOrder = true;
this.countPrice();
this.IsShowEditOrder = true;
}
},
//筛选员工
......@@ -246,69 +250,21 @@
}
})
},
//人数改变
peopleNumber(val) {
if (val == '') {
this.OrderMsg.GuestNum = 1
//计算价格
countPrice() {
var guestNum = 0;
var unit_price = 0;
if (this.OrderMsg.GuestNum && this.OrderMsg.GuestNum > 0) {
guestNum = Number(this.OrderMsg.GuestNum);
}
this.OrderMsg.Unit_Price = this.countPrice(this.OrderMsg.GuestNum)
this.$forceUpdate()
this.UnitPrice = this.OrderMsg.Unit_Price
},
priceNumber(val) { //大于的时候赋值
if (this.OrderMsg.Unit_Price < this.UnitPrice) {
this.OrderMsg.Unit_Price = this.UnitPrice
if (this.OrderMsg.Unit_Price && this.OrderMsg.Unit_Price > 0) {
unit_price = Number(this.OrderMsg.Unit_Price);
}
},
//计算价格
countPrice(num) {
let array = [];
if (this.StepPriceList && this.StepPriceList.length) {
this.StepPriceList.forEach(x => {
let obj = {
PersionNum: x.PersionNum,
PersionPrice: x.PersionPrice,
}
array.push(obj)
})
let fz = false
let a = 0;
array.forEach(x => {
if (x.PersionNum == num) {
fz = true;
a = x.PersionPrice
}
})
if (fz == false) {
array.push({
PersionNum: num
})
array.sort(this.getSortFun('asc', 'PersionNum')); //升序排序
var idx;
for (var i = 0; i < array.length; i++) {
if (array[i].PersionNum == num) {
idx = i;
}
}
idx = Math.max(0, idx - 1);
if (array[idx].PersionPrice) {
return array[idx].PersionPrice;
} else {
return this.OrderMsg.Class_Price;
}
} else {
return a;
}
} else {
return this.OrderMsg.Class_Price;
this.OrderMsg.PreferPrice = Number(guestNum * unit_price).toFixed(2);
if (this.OrderMsg.OrderType == 2) {
this.OrderMsg.OldPreferPrice = Number(guestNum * unit_price).toFixed(2);
}
},
getSortFun(order, sortBy) {
var ordAlpah = (order == 'asc') ? '>' : '<';
var sortFun = new Function('a', 'b', 'return a.' + sortBy + ordAlpah + 'b.' + sortBy + '?1:-1');
return sortFun;
},
//修改订单
saveOrderInfo() {
this.OrderMsg.PreferPrice = (this.OrderMsg.GuestNum * this.OrderMsg.Unit_Price) - this.OrderMsg.LessPrice;
......@@ -318,7 +274,7 @@
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '修改成功!',
message: '操作成功!',
position: 'top'
})
//调用父页面成功方法
......
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