Commit 27025faa authored by youjie's avatar youjie

no message

parent 5c7f9ca2
<style scoped>
.commonOrderForm {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
overflow: auto;
height: 600px;
border-top: 3px solid #38425d;
background-color: #ffffff;
padding: 10px 10px 0;
width: 100%;padding:20px 20px 10px 80px;
}
.title {
border-left: 3px solid #e95252;
text-indent: 15px;
height: 16px;
font-family: "PingFangSc-Fine";
font-size: 16px;
margin-bottom: 20px;
line-height: 14px;
color: #000;
}
</style>
<template>
<div>
<el-form :model="addMsg" ref="addMsg" label-position="right" :rules="rules" label-width="90px">
<el-form-item label="小费" prop="TipMoney">
<div style="display: flex;">
<el-input v-model="addMsg.TipMoney" placeholder="请输入小费">
</el-input>
<div style="padding: 0 8px ;display: flex;width: 100px;margin-left: 10px;">
<p>{{TipObj.guestNum}}</p>
</div>
</div>
</el-form-item>
</el-form>
<p class="">
<span class="fr">
<input type="button" class="hollowFixedBtn" :value="$t('pub.cancelBtn')" @click="cancelSubmit()" />
<input type="button" class="normalBtn" value="保存" @click="submitForm('addMsg')" />
</span>
</p>
</div>
</template>
<script>
export default {
props: ['TipObj'],
data() {
return {
addMsg: {
OrderId: 0,
TipMoney: 0
},
rules: {
TipMoney: [{
required: true,
message: "请输入小费",
trigger: "blur",
}],
},
};
},
methods: {
//提交表单验证
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.saveOrder();
} else {
return false;
}
});
},
saveOrder() {
this.apipost('sellorder_post_SetOrderTipMoney',
this.addMsg,
(res) => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.$refs["addMsg"].resetFields();
this.clearMsg();
//调用父组件方法
this.$emit("success");
} else {
this.Error(res.data.message);
}
},
);
},
//关闭窗口
cancelSubmit() {
this.clearMsg();
this.$emit("close");
},
//清空表单信息
clearMsg() {
this.addMsg = {
OrderId: 0,
TipMoney: 0
}
}
},
mounted() {
this.addMsg.OrderId = this.TipObj.OrderId
this.addMsg.TipMoney = Number(this.TipObj.TipMoney)
},
watch: {
TipObj:{
handler(oldValue, newVal){
this.addMsg.OrderId = oldValue.OrderId
this.addMsg.TipMoney = Number(oldValue.TipMoney)
},
deep: true,
immediate: true
},
}
};
</script>
\ No newline at end of file
This diff is collapsed.
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