|
@@ -41,9 +41,10 @@
|
|
|
<a-button @click="handleClear" :disabled="btnDisabled">清空</a-button>
|
|
<a-button @click="handleClear" :disabled="btnDisabled">清空</a-button>
|
|
|
<!-- <a-button @click="handleAdd" :disabled="btnDisabled">备注</a-button> -->
|
|
<!-- <a-button @click="handleAdd" :disabled="btnDisabled">备注</a-button> -->
|
|
|
<a-button :disabled="btnDisabled">退货</a-button>
|
|
<a-button :disabled="btnDisabled">退货</a-button>
|
|
|
- <a-button @click="handleAdd">挂单</a-button>
|
|
|
|
|
|
|
+ <a-button v-if="!btnDisabled" @click="handleAdd">挂单</a-button>
|
|
|
|
|
+ <a-button v-else @click="handleAdd">取单</a-button>
|
|
|
<a-button>挂房帐</a-button>
|
|
<a-button>挂房帐</a-button>
|
|
|
- <a-button type="danger" @click="handlePayment"
|
|
|
|
|
|
|
+ <a-button :disabled="btnDisabled" type="danger" @click="handlePayment"
|
|
|
>结账¥{{ amount.toFixed(2) }}</a-button
|
|
>结账¥{{ amount.toFixed(2) }}</a-button
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
@@ -88,6 +89,7 @@
|
|
|
</a-card>
|
|
</a-card>
|
|
|
</div>
|
|
</div>
|
|
|
<payment-modal ref="modalPaymentForm" @ok="modalFormOk"></payment-modal>
|
|
<payment-modal ref="modalPaymentForm" @ok="modalFormOk"></payment-modal>
|
|
|
|
|
+ <goods-modal ref="modalGoodsForm" @ok="modalFormOk"></goods-modal>
|
|
|
</a-card>
|
|
</a-card>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -97,6 +99,9 @@
|
|
|
import { filterObj } from "@/utils/util";
|
|
import { filterObj } from "@/utils/util";
|
|
|
import { getAction, postAction, deleteAction } from "@/api/manage";
|
|
import { getAction, postAction, deleteAction } from "@/api/manage";
|
|
|
import PaymentModal from "./modules/PaymentModal.vue";
|
|
import PaymentModal from "./modules/PaymentModal.vue";
|
|
|
|
|
+import goodsModal from "./modules/goodStock/goodsModal.vue";
|
|
|
|
|
+import { computed } from "vue";
|
|
|
|
|
+import { tree } from "@/api/good";
|
|
|
const columns = [
|
|
const columns = [
|
|
|
{
|
|
{
|
|
|
title: "商品名称",
|
|
title: "商品名称",
|
|
@@ -116,6 +121,7 @@ export default {
|
|
|
name: "memberList",
|
|
name: "memberList",
|
|
|
components: {
|
|
components: {
|
|
|
PaymentModal,
|
|
PaymentModal,
|
|
|
|
|
+ goodsModal,
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -159,6 +165,11 @@ export default {
|
|
|
oldSelectGoodsList: [],
|
|
oldSelectGoodsList: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ provide() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ treeData: computed(() => this.treeData),
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
computed: {
|
|
computed: {
|
|
|
sum() {
|
|
sum() {
|
|
|
return this.selectGoodsList.reduce(function (total, item) {
|
|
return this.selectGoodsList.reduce(function (total, item) {
|
|
@@ -186,8 +197,17 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ this.loadTree()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ loadTree() {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ tree().then((res) => {
|
|
|
|
|
+ if (res.success) {
|
|
|
|
|
+ this.treeData = res.result;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
modalFormOk() {},
|
|
modalFormOk() {},
|
|
|
numChange(e, index) {
|
|
numChange(e, index) {
|
|
|
console.log(e);
|
|
console.log(e);
|
|
@@ -251,10 +271,15 @@ export default {
|
|
|
})
|
|
})
|
|
|
.finally(() => {});
|
|
.finally(() => {});
|
|
|
},
|
|
},
|
|
|
|
|
+ handleAddTempGoods() {
|
|
|
|
|
+ this.$refs.modalGoodsForm.add();
|
|
|
|
|
+ this.$refs.modalGoodsForm.title = "新增菜品";
|
|
|
|
|
+ this.$refs.modalGoodsForm.disableSubmit = false;
|
|
|
|
|
+ },
|
|
|
handlePayment() {
|
|
handlePayment() {
|
|
|
this.handleAdd((e) => {
|
|
this.handleAdd((e) => {
|
|
|
var amount = this.oldSelectGoodsList.reduce(function (total, item) {
|
|
var amount = this.oldSelectGoodsList.reduce(function (total, item) {
|
|
|
- return total + item.sellingPrice;
|
|
|
|
|
|
|
+ return total + item.sellingPrice * item.num;
|
|
|
}, 0);
|
|
}, 0);
|
|
|
this.$refs.modalPaymentForm.edit({
|
|
this.$refs.modalPaymentForm.edit({
|
|
|
billAmount: amount,
|
|
billAmount: amount,
|
|
@@ -265,9 +290,9 @@ export default {
|
|
|
preferentialType: 1,
|
|
preferentialType: 1,
|
|
|
couponFirstAmount: 0,
|
|
couponFirstAmount: 0,
|
|
|
discount: 9,
|
|
discount: 9,
|
|
|
- orderId: e,
|
|
|
|
|
|
|
+ orderCode: e,
|
|
|
});
|
|
});
|
|
|
- this.$refs.modalPaymentForm.title = "POS结账" + e;
|
|
|
|
|
|
|
+ this.$refs.modalPaymentForm.title = "POS结账";
|
|
|
this.$refs.modalPaymentForm.disableSubmit = false;
|
|
this.$refs.modalPaymentForm.disableSubmit = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -311,6 +336,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
itemClick(row) {
|
|
itemClick(row) {
|
|
|
console.log(row);
|
|
console.log(row);
|
|
|
|
|
+ if (row.id == "0") {
|
|
|
|
|
+ this.handleAddTempGoods();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (row.isSellClear) {
|
|
if (row.isSellClear) {
|
|
|
this.$message.warning("选择的商品已沽清");
|
|
this.$message.warning("选择的商品已沽清");
|
|
|
return;
|
|
return;
|