|
@@ -64,6 +64,10 @@ export default {
|
|
|
type: [Array],
|
|
|
default: () => [],
|
|
|
},
|
|
|
+ hangNo: {
|
|
|
+ type: [String],
|
|
|
+ default: () => '',
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
showDialog(value) {
|
|
@@ -84,9 +88,9 @@ export default {
|
|
|
remove(hangNo) {
|
|
|
const app = this
|
|
|
const param = { hangNo: hangNo }
|
|
|
- this.$confirm('此操作将删除挂单, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
+ this.$confirm(this.$t('ci-cao-zuo-jiang-shan-chu-gua-dan-shi-fou-ji-xu'), this.$t('ti-shi'), {
|
|
|
+ confirmButtonText: this.$t('que-ding'),
|
|
|
+ cancelButtonText: this.$t('qu-xiao'),
|
|
|
type: 'warning',
|
|
|
})
|
|
|
.then(() => {
|
|
@@ -94,7 +98,7 @@ export default {
|
|
|
.then((response) => {
|
|
|
if (response) {
|
|
|
Message({
|
|
|
- message: '删除挂单成功',
|
|
|
+ message: this.$t('shan-chu-gua-dan-cheng-gong'),
|
|
|
type: 'success',
|
|
|
})
|
|
|
app.getHangUpList()
|
|
@@ -107,23 +111,23 @@ export default {
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
|
- message: '已取消删除',
|
|
|
+ message: this.$t('yi-qu-xiao-shan-chu'),
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
// 执行挂单
|
|
|
- doHangUp(hangNo) {
|
|
|
+ doHangUp(hangNo, msg = this.$t('shi-fou-gua-dan')) {
|
|
|
const app = this
|
|
|
if (!app.cartList || app.cartList.length < 1) {
|
|
|
Message({
|
|
|
- message: '请先添加结算商品',
|
|
|
+ message: this.$t('qing-xian-tian-jia-jie-suan-shang-pin'),
|
|
|
type: 'error',
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
- this.$confirm('是否挂单?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
+ this.$confirm(this.$t('shi-fou-gua-dan'), this.$t('ti-shi'), {
|
|
|
+ confirmButtonText: this.$t('que-ding'),
|
|
|
+ cancelButtonText: this.$t('qu-xiao'),
|
|
|
type: 'warning',
|
|
|
})
|
|
|
.then(() => {
|
|
@@ -140,11 +144,12 @@ export default {
|
|
|
.then((response) => {
|
|
|
if (response) {
|
|
|
Message({
|
|
|
- message: '挂单成功',
|
|
|
+ message: this.$t('gua-dan-cheng-gong'),
|
|
|
type: 'success',
|
|
|
})
|
|
|
app.getHangUpList()
|
|
|
app.$emit('doHangUp')
|
|
|
+ this.$emit('closeDialog', 'hangUpDialog')
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
@@ -154,7 +159,7 @@ export default {
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
|
- message: '已取消挂单',
|
|
|
+ message: this.$t('yi-qu-xiao-gua-dan'),
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -173,6 +178,17 @@ export default {
|
|
|
},
|
|
|
// 取单
|
|
|
getHangUp(hangNo, memberInfo) {
|
|
|
+ //添加判断是否是一个桌子要更新菜品
|
|
|
+ console.log(this.hangNo, 'this.hangNo', hangNo, 'hangNo')
|
|
|
+
|
|
|
+ if (this.hangNo === hangNo) {
|
|
|
+ // this.$emit('updateHangNo')
|
|
|
+ console.log(this.hangNo, hangNo)
|
|
|
+ this.doHangUp(hangNo, this.$t('geng-xin-cai-pin'))
|
|
|
+ this.$emit('closeDialog', 'hangUpDialog')
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$emit('getHangNo', { hangNo: hangNo, memberInfo: memberInfo })
|
|
|
},
|
|
|
close() {
|