Commit 8ac818a1 authored by 黄奎's avatar 黄奎

餐厅新增重复验证

parent d4a3dec4
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
<ul> <ul>
<li> <li>
<template v-if="IsOperation != 1"> <template v-if="IsOperation != 1">
<input type="button" class="fr normalBtn mb30" value="保存" @click="saveList(1)" /> <input type="button" class="fr normalBtn mb30" value="保存" @click="saveList(1)" :disabled="IsDisabled" />
<input type="button" class="fr normalBtn mb30" value="保存草稿" @click="saveList(0)" /> <input type="button" class="fr normalBtn mb30" value="保存草稿" @click="saveList(0)" :disabled="IsDisabled" />
</template> </template>
<template v-else> <template v-else>
<span style="color:red;font-size:14px;">已制单,不能在修改!</span> <span style="color:red;font-size:14px;">已制单,不能在修改!</span>
<input v-if="CurrentUserInfo.EmployeeId==615" type="button" class="fr normalBtn mb30" value="保存" @click="saveList(1)" /> <input v-if="CurrentUserInfo.EmployeeId==615" type="button" class="fr normalBtn mb30" value="保存"
@click="saveList(1)" />
</template> </template>
</li> </li>
</ul> </ul>
...@@ -193,7 +194,9 @@ ...@@ -193,7 +194,9 @@
loading: false, loading: false,
IsOperation: '', IsOperation: '',
//当前登录人信息 //当前登录人信息
CurrentUserInfo:{}, CurrentUserInfo: {},
//是否禁用按钮
IsDisabled: false,
}; };
}, },
methods: { methods: {
...@@ -281,6 +284,7 @@ ...@@ -281,6 +284,7 @@
obj.TotalPrice = totalPrice.toFixed(2); obj.TotalPrice = totalPrice.toFixed(2);
}, },
saveList(type) { saveList(type) {
this.IsDisabled = true;
if (type == 0) { if (type == 0) {
this.list.forEach(item => { this.list.forEach(item => {
item.DiningSummaryList.forEach(insideItem => { item.DiningSummaryList.forEach(insideItem => {
...@@ -313,7 +317,9 @@ ...@@ -313,7 +317,9 @@
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.$message.success(res.data.message); this.$message.success(res.data.message);
this.getList(); this.getList();
this.IsDisabled = false;
} else { } else {
this.IsDisabled = false;
this.$message.error(res.data.message); this.$message.error(res.data.message);
} }
}, err => {}) }, err => {})
......
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