|
@@ -8,7 +8,7 @@
|
|
|
></a-tab-pane>
|
|
></a-tab-pane>
|
|
|
</a-tabs>
|
|
</a-tabs>
|
|
|
<div style="display: flex; height: calc(100vh - 350px)">
|
|
<div style="display: flex; height: calc(100vh - 350px)">
|
|
|
- <a-card style="width: 30%">
|
|
|
|
|
|
|
+ <a-card style="width: 30%;">
|
|
|
<a href="#" @click="remarkModal"> <a-icon type="edit" />整单备注</a>
|
|
<a href="#" @click="remarkModal"> <a-icon type="edit" />整单备注</a>
|
|
|
<a-icon type="user" />
|
|
<a-icon type="user" />
|
|
|
<span v-if="selectRoomOrder && selectRoomOrder.roomName">
|
|
<span v-if="selectRoomOrder && selectRoomOrder.roomName">
|
|
@@ -22,12 +22,13 @@
|
|
|
:data-source="selectGoodsList"
|
|
:data-source="selectGoodsList"
|
|
|
:row-selection="rowSelection"
|
|
:row-selection="rowSelection"
|
|
|
rowKey="id"
|
|
rowKey="id"
|
|
|
- :scroll="{ y: 560 }"
|
|
|
|
|
|
|
+ style=" overflow-y: scroll;"
|
|
|
>
|
|
>
|
|
|
<template slot="num" slot-scope="text, record, index">
|
|
<template slot="num" slot-scope="text, record, index">
|
|
|
<div>
|
|
<div>
|
|
|
<a-input-number
|
|
<a-input-number
|
|
|
v-model="record.num"
|
|
v-model="record.num"
|
|
|
|
|
+ style="width: auto; "
|
|
|
:max="record.inventory"
|
|
:max="record.inventory"
|
|
|
@change="(event) => numChange(event, index)"
|
|
@change="(event) => numChange(event, index)"
|
|
|
/>
|
|
/>
|
|
@@ -44,7 +45,10 @@
|
|
|
</span>
|
|
</span>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
<p>数量:{{ sum }}</p>
|
|
<p>数量:{{ sum }}</p>
|
|
|
- <div style="display: flex; gap: 5px; flex-flow: wrap">
|
|
|
|
|
|
|
+ <div v-if="this.posTableState === 1">
|
|
|
|
|
+ <a-button @click="placeOrder" :disabled="btnDisabled">下单</a-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-else style="display: flex; gap: 5px; flex-flow: wrap">
|
|
|
<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> -->
|
|
@@ -53,13 +57,18 @@
|
|
|
<a-button
|
|
<a-button
|
|
|
v-if="selectRoomOrder && selectRoomOrder.roomName && !btnDisabled"
|
|
v-if="selectRoomOrder && selectRoomOrder.roomName && !btnDisabled"
|
|
|
@click="handleToRoomFeePayment"
|
|
@click="handleToRoomFeePayment"
|
|
|
- >确定挂房帐</a-button
|
|
|
|
|
|
|
+ >确定挂房帐</a-button
|
|
|
>
|
|
>
|
|
|
- <a-button v-else @click="handleSelectCheckInRoomOrder"
|
|
|
|
|
- >挂房帐</a-button
|
|
|
|
|
|
|
+ <a-button
|
|
|
|
|
+ v-else
|
|
|
|
|
+ @click="handleSelectCheckInRoomOrder"
|
|
|
|
|
+ >挂房帐</a-button
|
|
|
>
|
|
>
|
|
|
- <a-button :disabled="btnDisabled" type="danger" @click="handlePayment"
|
|
|
|
|
- >结账¥{{ amount.toFixed(2) }}</a-button
|
|
|
|
|
|
|
+ <a-button
|
|
|
|
|
+ :disabled="btnDisabled"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ @click="handlePayment"
|
|
|
|
|
+ >结账¥{{ amount.toFixed(2) }}</a-button
|
|
|
>
|
|
>
|
|
|
<a-button :disabled="btnDisabled" @click="refundChange">退货</a-button>
|
|
<a-button :disabled="btnDisabled" @click="refundChange">退货</a-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -126,8 +135,9 @@
|
|
|
></a-input>
|
|
></a-input>
|
|
|
<a-input v-else placeholder="请扫描条码"></a-input>
|
|
<a-input v-else placeholder="请扫描条码"></a-input>
|
|
|
<a-button v-if="!isSaoma">查询</a-button>
|
|
<a-button v-if="!isSaoma">查询</a-button>
|
|
|
- <a-button @click="isSaoma = !isSaoma"
|
|
|
|
|
- >切换为{{ isSaoma ? "查询" : "扫码" }}模式</a-button
|
|
|
|
|
|
|
+ <a-button
|
|
|
|
|
+ @click="isSaoma = !isSaoma"
|
|
|
|
|
+ >切换为{{ isSaoma ? "查询" : "扫码" }}模式</a-button
|
|
|
>
|
|
>
|
|
|
</a-space>
|
|
</a-space>
|
|
|
</a-row>
|
|
</a-row>
|
|
@@ -174,98 +184,122 @@
|
|
|
</a-card>
|
|
</a-card>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<script>
|
|
<script>
|
|
|
// import { JeecgListMixin } from "@/mixins/JeecgListMixin";
|
|
// import { JeecgListMixin } from "@/mixins/JeecgListMixin";
|
|
|
// import PosRegionModal from "./modules/PosRegionModal";
|
|
// import PosRegionModal from "./modules/PosRegionModal";
|
|
|
-import { filterObj } from "@/utils/util";
|
|
|
|
|
-import { getAction, postAction, deleteAction } from "@/api/manage";
|
|
|
|
|
-import PaymentModal from "./modules/PaymentModal.vue";
|
|
|
|
|
-import goodsModal from "./modules/goodStock/goodsModal.vue";
|
|
|
|
|
-import PickingGoodsOrderModal from "./modules/PickingGoodsOrderModal.vue";
|
|
|
|
|
-import SelectCheckInRoomOrderModal from "./modules/SelectCheckInRoomOrderModal.vue";
|
|
|
|
|
-import { computed } from "vue";
|
|
|
|
|
-import { tree } from "@/api/good";
|
|
|
|
|
|
|
+import { filterObj } from '@/utils/util'
|
|
|
|
|
+import { getAction, postAction, deleteAction } from '@/api/manage'
|
|
|
|
|
+import PaymentModal from './modules/PaymentModal.vue'
|
|
|
|
|
+import goodsModal from './modules/goodStock/goodsModal.vue'
|
|
|
|
|
+import PickingGoodsOrderModal from './modules/PickingGoodsOrderModal.vue'
|
|
|
|
|
+import SelectCheckInRoomOrderModal from './modules/SelectCheckInRoomOrderModal.vue'
|
|
|
|
|
+import { computed } from 'vue'
|
|
|
|
|
+import { tree } from '@/api/good'
|
|
|
const columns = [
|
|
const columns = [
|
|
|
{
|
|
{
|
|
|
- title: "商品名称",
|
|
|
|
|
- dataIndex: "name",
|
|
|
|
|
|
|
+ title: '商品名称',
|
|
|
|
|
+ dataIndex: 'name',
|
|
|
|
|
+ width: '50%'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "数量",
|
|
|
|
|
- dataIndex: "num",
|
|
|
|
|
|
|
+ title: '数量',
|
|
|
|
|
+ dataIndex: 'num',
|
|
|
|
|
+ width: '25%',
|
|
|
scopedSlots: {
|
|
scopedSlots: {
|
|
|
- customRender: "num",
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ customRender: 'num'
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "售价",
|
|
|
|
|
- dataIndex: "sellingPrice",
|
|
|
|
|
- },
|
|
|
|
|
-];
|
|
|
|
|
|
|
+ title: '售价',
|
|
|
|
|
+ dataIndex: 'sellingPrice',
|
|
|
|
|
+ width: '25%',
|
|
|
|
|
+ }
|
|
|
|
|
+]
|
|
|
export default {
|
|
export default {
|
|
|
- name: "memberList",
|
|
|
|
|
|
|
+ name: 'MemberList',
|
|
|
components: {
|
|
components: {
|
|
|
PaymentModal,
|
|
PaymentModal,
|
|
|
goodsModal,
|
|
goodsModal,
|
|
|
PickingGoodsOrderModal,
|
|
PickingGoodsOrderModal,
|
|
|
- SelectCheckInRoomOrderModal,
|
|
|
|
|
|
|
+ SelectCheckInRoomOrderModal
|
|
|
|
|
+ },
|
|
|
|
|
+ props: {
|
|
|
|
|
+ tableId: {
|
|
|
|
|
+ type: String,
|
|
|
|
|
+ default: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ tableState: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ default: -1
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ tableId: function (newValue, oldValue) {
|
|
|
|
|
+ this.posTableId = this.tableId
|
|
|
|
|
+ this.posTableState = this.tableState
|
|
|
|
|
+ if (this.tableId !== '' && this.tableState === 2) {
|
|
|
|
|
+ this.getOrderByTableId(this.tableId)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ posTableId: '',
|
|
|
|
|
+ posTableState: -1,
|
|
|
|
|
+ tableState2: -1,
|
|
|
isRemarkModal: false,
|
|
isRemarkModal: false,
|
|
|
isSaoma: false,
|
|
isSaoma: false,
|
|
|
- remark: "",
|
|
|
|
|
|
|
+ remark: '',
|
|
|
columns,
|
|
columns,
|
|
|
isRefund: false,
|
|
isRefund: false,
|
|
|
- refundRemark: "",
|
|
|
|
|
|
|
+ refundRemark: '',
|
|
|
sellClear: 0,
|
|
sellClear: 0,
|
|
|
queryParam: {},
|
|
queryParam: {},
|
|
|
// 分页参数
|
|
// 分页参数
|
|
|
ipagination: {
|
|
ipagination: {
|
|
|
current: 1,
|
|
current: 1,
|
|
|
pageSize: 99999,
|
|
pageSize: 99999,
|
|
|
- pageSizeOptions: ["10", "20", "30"],
|
|
|
|
|
|
|
+ pageSizeOptions: ['10', '20', '30'],
|
|
|
showTotal: (total, range) => {
|
|
showTotal: (total, range) => {
|
|
|
- return range[0] + "-" + range[1] + " 共" + total + "条";
|
|
|
|
|
|
|
+ return range[0] + '-' + range[1] + ' 共' + total + '条'
|
|
|
},
|
|
},
|
|
|
showQuickJumper: true,
|
|
showQuickJumper: true,
|
|
|
showSizeChanger: true,
|
|
showSizeChanger: true,
|
|
|
- total: 0,
|
|
|
|
|
|
|
+ total: 0
|
|
|
},
|
|
},
|
|
|
url: {
|
|
url: {
|
|
|
- list: "/pos/posSellClearGoods/list",
|
|
|
|
|
- delete: "/pos/posSellClearGoods/delete",
|
|
|
|
|
- deleteBatch: "/pos/posSellClearGoods/deleteBatch",
|
|
|
|
|
- exportXlsUrl: "/pos/posSellClearGoods/exportXls",
|
|
|
|
|
- importExcelUrl: "pos/posSellClearGoods/importExcel",
|
|
|
|
|
|
|
+ list: '/pos/posSellClearGoods/list',
|
|
|
|
|
+ delete: '/pos/posSellClearGoods/delete',
|
|
|
|
|
+ deleteBatch: '/pos/posSellClearGoods/deleteBatch',
|
|
|
|
|
+ exportXlsUrl: '/pos/posSellClearGoods/exportXls',
|
|
|
|
|
+ importExcelUrl: 'pos/posSellClearGoods/importExcel'
|
|
|
},
|
|
},
|
|
|
dictOptions: {},
|
|
dictOptions: {},
|
|
|
superFieldList: [],
|
|
superFieldList: [],
|
|
|
selectedRowKeys: [],
|
|
selectedRowKeys: [],
|
|
|
selectedRows: [],
|
|
selectedRows: [],
|
|
|
isorter: {
|
|
isorter: {
|
|
|
- column: "createTime",
|
|
|
|
|
- order: "desc",
|
|
|
|
|
|
|
+ column: 'createTime',
|
|
|
|
|
+ order: 'desc'
|
|
|
},
|
|
},
|
|
|
treeData: [],
|
|
treeData: [],
|
|
|
selectGoods: {},
|
|
selectGoods: {},
|
|
|
posTypeList: [],
|
|
posTypeList: [],
|
|
|
- tabPosTypeId: "",
|
|
|
|
|
|
|
+ tabPosTypeId: '',
|
|
|
selectGoodsList: [],
|
|
selectGoodsList: [],
|
|
|
goodsTypeList: [],
|
|
goodsTypeList: [],
|
|
|
- tabgoodsTypeId: "1",
|
|
|
|
|
|
|
+ tabgoodsTypeId: '1',
|
|
|
dataSource: [],
|
|
dataSource: [],
|
|
|
dataSource2: [],
|
|
dataSource2: [],
|
|
|
oldSelectGoodsList: [],
|
|
oldSelectGoodsList: [],
|
|
|
selectOrderInfo: {},
|
|
selectOrderInfo: {},
|
|
|
- selectRoomOrder: {},
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ selectRoomOrder: {}
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
provide() {
|
|
provide() {
|
|
|
return {
|
|
return {
|
|
|
- treeData: computed(() => this.treeData),
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ treeData: computed(() => this.treeData)
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
rowSelection() {
|
|
rowSelection() {
|
|
@@ -273,322 +307,369 @@ export default {
|
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
|
console.log(
|
|
console.log(
|
|
|
`selectedRowKeys: ${selectedRowKeys}`,
|
|
`selectedRowKeys: ${selectedRowKeys}`,
|
|
|
- "selectedRows: ",
|
|
|
|
|
|
|
+ 'selectedRows: ',
|
|
|
selectedRows
|
|
selectedRows
|
|
|
- );
|
|
|
|
|
- this.selectedRowKeys = selectedRowKeys;
|
|
|
|
|
- this.selectedRows = selectedRows;
|
|
|
|
|
|
|
+ )
|
|
|
|
|
+ this.selectedRowKeys = selectedRowKeys
|
|
|
|
|
+ this.selectedRows = selectedRows
|
|
|
},
|
|
},
|
|
|
getCheckboxProps: (record) => ({
|
|
getCheckboxProps: (record) => ({
|
|
|
props: {
|
|
props: {
|
|
|
- disabled: record.name === "Disabled User", // Column configuration not to be checked
|
|
|
|
|
- name: record.name,
|
|
|
|
|
- },
|
|
|
|
|
- }),
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ disabled: record.name === 'Disabled User', // Column configuration not to be checked
|
|
|
|
|
+ name: record.name
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
sum() {
|
|
sum() {
|
|
|
return this.selectGoodsList.reduce(function (total, item) {
|
|
return this.selectGoodsList.reduce(function (total, item) {
|
|
|
- return total + item.num;
|
|
|
|
|
- }, 0);
|
|
|
|
|
|
|
+ return total + item.num
|
|
|
|
|
+ }, 0)
|
|
|
},
|
|
},
|
|
|
amount() {
|
|
amount() {
|
|
|
return this.selectGoodsList.reduce(function (total, item) {
|
|
return this.selectGoodsList.reduce(function (total, item) {
|
|
|
- return total + item.sellingPrice * item.num;
|
|
|
|
|
- }, 0);
|
|
|
|
|
|
|
+ return total + item.sellingPrice * item.num
|
|
|
|
|
+ }, 0)
|
|
|
},
|
|
},
|
|
|
btnDisabled() {
|
|
btnDisabled() {
|
|
|
- var res = this.selectGoodsList && this.selectGoodsList.length > 0;
|
|
|
|
|
- return !res;
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ var res = this.selectGoodsList && this.selectGoodsList.length > 0
|
|
|
|
|
+ return !res
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
this.dataSource = [
|
|
this.dataSource = [
|
|
|
{
|
|
{
|
|
|
- id: "0",
|
|
|
|
|
- },
|
|
|
|
|
- ];
|
|
|
|
|
- getAction("/pos/posType/list", {
|
|
|
|
|
|
|
+ id: '0'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ getAction('/pos/posType/list', {
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
|
- pageSize: 99,
|
|
|
|
|
|
|
+ pageSize: 99
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- this.posTypeList = res.result.records;
|
|
|
|
|
|
|
+ this.posTypeList = res.result.records
|
|
|
if (this.posTypeList && this.posTypeList.length > 0) {
|
|
if (this.posTypeList && this.posTypeList.length > 0) {
|
|
|
- this.tabPosTypeId = this.posTypeList[0].id;
|
|
|
|
|
- this.loadGoodsType();
|
|
|
|
|
|
|
+ this.tabPosTypeId = this.posTypeList[0].id
|
|
|
|
|
+ this.loadGoodsType()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- this.loadTree();
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ this.loadTree()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getOrderByTableId(tableId) {
|
|
|
|
|
+ getAction('/pos/posOrderGoods/getOrderByTableId', { tableId }).then(resp => {
|
|
|
|
|
+ if (resp.success) {
|
|
|
|
|
+ this.selectOrderInfo = resp.result
|
|
|
|
|
+ this.selectGoodsList = resp.result.posOrderGoodsDetailList
|
|
|
|
|
+ this.selectGoodsList.forEach(e => {
|
|
|
|
|
+ this.$set(e, 'sellingPrice', e.money)
|
|
|
|
|
+ this.$set(e, 'name', e.goodsName)
|
|
|
|
|
+ })
|
|
|
|
|
+ this.oldSelectGoodsList = JSON.parse(JSON.stringify(this.selectGoodsList))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning('查询订单失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
remarkModal() {
|
|
remarkModal() {
|
|
|
if (!this.selectGoodsList || this.selectGoodsList.length <= 0) {
|
|
if (!this.selectGoodsList || this.selectGoodsList.length <= 0) {
|
|
|
- this.$message.warning("请先选择商品");
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ this.$message.warning('请先选择商品')
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
- this.isRemarkModal = true;
|
|
|
|
|
|
|
+ this.isRemarkModal = true
|
|
|
},
|
|
},
|
|
|
- refundModalOk(){
|
|
|
|
|
|
|
+ refundModalOk() {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 退货
|
|
* 退货
|
|
|
*/
|
|
*/
|
|
|
- refundChange(){
|
|
|
|
|
- this.$message.warning("未下单餐品不支持退菜,请重新选择");
|
|
|
|
|
|
|
+ refundChange() {
|
|
|
|
|
+ this.$message.warning('未下单餐品不支持退菜,请重新选择')
|
|
|
return
|
|
return
|
|
|
- if(this.selectedRows.length == 0){
|
|
|
|
|
- this.$message.warning("请先选择菜品");
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ if (this.selectedRows.length == 0) {
|
|
|
|
|
+ this.$message.warning('请先选择菜品')
|
|
|
}
|
|
}
|
|
|
- this.isRefund = true;
|
|
|
|
|
|
|
+ this.isRefund = true
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
remarkModalOk() {
|
|
remarkModalOk() {
|
|
|
this.handleAdd()
|
|
this.handleAdd()
|
|
|
- this.remark = "";
|
|
|
|
|
- this.isRemarkModal = false;
|
|
|
|
|
|
|
+ this.remark = ''
|
|
|
|
|
+ this.isRemarkModal = false
|
|
|
},
|
|
},
|
|
|
onClearSelected() {
|
|
onClearSelected() {
|
|
|
- this.selectedRowKeys = [];
|
|
|
|
|
- this.selectionRows = [];
|
|
|
|
|
|
|
+ this.selectedRowKeys = []
|
|
|
|
|
+ this.selectionRows = []
|
|
|
},
|
|
},
|
|
|
loadTree() {
|
|
loadTree() {
|
|
|
- var that = this;
|
|
|
|
|
|
|
+ var that = this
|
|
|
tree().then((res) => {
|
|
tree().then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- this.treeData = res.result;
|
|
|
|
|
|
|
+ this.treeData = res.result
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
modalFormOk() {
|
|
modalFormOk() {
|
|
|
- this.selectGoodsList = [];
|
|
|
|
|
- this.selectOrderInfo = {};
|
|
|
|
|
- this.selectRoomOrder = {};
|
|
|
|
|
|
|
+ this.selectGoodsList = []
|
|
|
|
|
+ this.selectOrderInfo = {}
|
|
|
|
|
+ this.selectRoomOrder = {}
|
|
|
},
|
|
},
|
|
|
modalFormOk2(e) {
|
|
modalFormOk2(e) {
|
|
|
- console.log(e);
|
|
|
|
|
- var good = JSON.parse(JSON.stringify(e));
|
|
|
|
|
- this.$set(good, "num", 1);
|
|
|
|
|
- this.selectGoodsList.push(good);
|
|
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ var good = JSON.parse(JSON.stringify(e))
|
|
|
|
|
+ this.$set(good, 'num', 1)
|
|
|
|
|
+ this.selectGoodsList.push(good)
|
|
|
},
|
|
},
|
|
|
modalSelectCheckInRoomOrderFormOk(e) {
|
|
modalSelectCheckInRoomOrderFormOk(e) {
|
|
|
- console.log(e);
|
|
|
|
|
- this.selectRoomOrder = e;
|
|
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ this.selectRoomOrder = e
|
|
|
},
|
|
},
|
|
|
modalPickingGoodsOrderFormOk(e) {
|
|
modalPickingGoodsOrderFormOk(e) {
|
|
|
- console.log(e);
|
|
|
|
|
|
|
+ console.log(e)
|
|
|
if (e && e.orderDetailList && e.orderDetailList.length > 0) {
|
|
if (e && e.orderDetailList && e.orderDetailList.length > 0) {
|
|
|
- this.selectOrderInfo = e.orderInfo;
|
|
|
|
|
|
|
+ this.selectOrderInfo = e.orderInfo
|
|
|
e.orderDetailList.forEach((t) => {
|
|
e.orderDetailList.forEach((t) => {
|
|
|
- t.sellingPrice = t.payMoney;
|
|
|
|
|
- t.name = t.goodsName;
|
|
|
|
|
- t.id = t.goodsId;
|
|
|
|
|
- });
|
|
|
|
|
- this.selectGoodsList = e.orderDetailList;
|
|
|
|
|
|
|
+ t.sellingPrice = t.payMoney
|
|
|
|
|
+ t.name = t.goodsName
|
|
|
|
|
+ t.id = t.goodsId
|
|
|
|
|
+ })
|
|
|
|
|
+ this.selectGoodsList = e.orderDetailList
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
numChange(e, index) {
|
|
numChange(e, index) {
|
|
|
- console.log(e);
|
|
|
|
|
|
|
+ console.log(e)
|
|
|
if (e <= 0) {
|
|
if (e <= 0) {
|
|
|
- this.selectGoodsList.splice(index, 1);
|
|
|
|
|
|
|
+ this.selectGoodsList.splice(index, 1)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handleClear() {
|
|
handleClear() {
|
|
|
- this.selectGoodsList = [];
|
|
|
|
|
|
|
+ this.selectGoodsList = []
|
|
|
// this.selectOrderInfo = {};
|
|
// this.selectOrderInfo = {};
|
|
|
},
|
|
},
|
|
|
tabPosTypeChange(e) {
|
|
tabPosTypeChange(e) {
|
|
|
- this.loadGoodsType();
|
|
|
|
|
|
|
+ this.loadGoodsType()
|
|
|
},
|
|
},
|
|
|
tabGoodsTypeChange(e) {
|
|
tabGoodsTypeChange(e) {
|
|
|
- this.loadGoods();
|
|
|
|
|
|
|
+ this.loadGoods()
|
|
|
},
|
|
},
|
|
|
loadGoodsType() {
|
|
loadGoodsType() {
|
|
|
- getAction("/rooms/cesStockType/getTopTypesByPosType", {
|
|
|
|
|
- posType: this.tabPosTypeId,
|
|
|
|
|
|
|
+ getAction('/rooms/cesStockType/getTopTypesByPosType', {
|
|
|
|
|
+ posType: this.tabPosTypeId
|
|
|
}).then((res2) => {
|
|
}).then((res2) => {
|
|
|
if (res2.success) {
|
|
if (res2.success) {
|
|
|
- this.goodsTypeList = res2.result;
|
|
|
|
|
|
|
+ this.goodsTypeList = res2.result
|
|
|
if (this.goodsTypeList && this.goodsTypeList.length > 0) {
|
|
if (this.goodsTypeList && this.goodsTypeList.length > 0) {
|
|
|
- this.loadGoods();
|
|
|
|
|
|
|
+ this.loadGoods()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
loadGoods() {
|
|
loadGoods() {
|
|
|
- var ids = [];
|
|
|
|
|
- if (this.tabgoodsTypeId === "1") {
|
|
|
|
|
|
|
+ var ids = []
|
|
|
|
|
+ if (this.tabgoodsTypeId === '1') {
|
|
|
this.goodsTypeList.forEach((t) => {
|
|
this.goodsTypeList.forEach((t) => {
|
|
|
- ids.push(t.id);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ ids.push(t.id)
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
- ids.push(this.tabgoodsTypeId);
|
|
|
|
|
|
|
+ ids.push(this.tabgoodsTypeId)
|
|
|
}
|
|
}
|
|
|
this.dataSource = [
|
|
this.dataSource = [
|
|
|
{
|
|
{
|
|
|
- id: "0",
|
|
|
|
|
- },
|
|
|
|
|
- ];
|
|
|
|
|
- getAction("/pos/posSellClearGoods/list", {
|
|
|
|
|
|
|
+ id: '0'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ getAction('/pos/posSellClearGoods/list', {
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
|
pageSize: 99999,
|
|
pageSize: 99999,
|
|
|
- goodTypes: ids,
|
|
|
|
|
|
|
+ goodTypes: ids
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- this.dataSource = [...this.dataSource, ...res.result.records];
|
|
|
|
|
|
|
+ this.dataSource = [...this.dataSource, ...res.result.records]
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- getAction("/pos/posSellClearGoods/thali-list", {
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ getAction('/pos/posSellClearGoods/thali-list', {
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
|
pageSize: 99999,
|
|
pageSize: 99999,
|
|
|
- goodTypes: ids,
|
|
|
|
|
|
|
+ goodTypes: ids
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- this.dataSource2 = res.result.records;
|
|
|
|
|
|
|
+ this.dataSource2 = res.result.records
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
handleDelete() {
|
|
handleDelete() {
|
|
|
- deleteAction("/pos/posSellClearGoods/delete", {
|
|
|
|
|
- goodsId: this.selectGoods.id,
|
|
|
|
|
|
|
+ deleteAction('/pos/posSellClearGoods/delete', {
|
|
|
|
|
+ goodsId: this.selectGoods.id
|
|
|
})
|
|
})
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- this.$message.success(res.message);
|
|
|
|
|
- this.loadData();
|
|
|
|
|
- this.sellClear = 0;
|
|
|
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ this.sellClear = 0
|
|
|
} else {
|
|
} else {
|
|
|
- this.$message.warning(res.message);
|
|
|
|
|
|
|
+ this.$message.warning(res.message)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- .finally(() => {});
|
|
|
|
|
|
|
+ .finally(() => {})
|
|
|
},
|
|
},
|
|
|
handleSelectCheckInRoomOrder() {
|
|
handleSelectCheckInRoomOrder() {
|
|
|
- this.$refs.modalSelectCheckInRoomOrderModal.add();
|
|
|
|
|
- this.$refs.modalSelectCheckInRoomOrderModal.title = "选择转帐人";
|
|
|
|
|
- this.$refs.modalSelectCheckInRoomOrderModal.disableSubmit = false;
|
|
|
|
|
|
|
+ this.$refs.modalSelectCheckInRoomOrderModal.add()
|
|
|
|
|
+ this.$refs.modalSelectCheckInRoomOrderModal.title = '选择转帐人'
|
|
|
|
|
+ this.$refs.modalSelectCheckInRoomOrderModal.disableSubmit = false
|
|
|
},
|
|
},
|
|
|
handlePickingGoodsOrder() {
|
|
handlePickingGoodsOrder() {
|
|
|
- this.$refs.modalPickingGoodsOrderForm.add();
|
|
|
|
|
- this.$refs.modalPickingGoodsOrderForm.title = "取单";
|
|
|
|
|
- this.$refs.modalPickingGoodsOrderForm.disableSubmit = false;
|
|
|
|
|
|
|
+ this.$refs.modalPickingGoodsOrderForm.add()
|
|
|
|
|
+ this.$refs.modalPickingGoodsOrderForm.title = '取单'
|
|
|
|
|
+ this.$refs.modalPickingGoodsOrderForm.disableSubmit = false
|
|
|
},
|
|
},
|
|
|
handleAddTempGoods() {
|
|
handleAddTempGoods() {
|
|
|
- this.$refs.modalGoodsForm.add();
|
|
|
|
|
- this.$refs.modalGoodsForm.title = "新增菜品";
|
|
|
|
|
- this.$refs.modalGoodsForm.disableSubmit = false;
|
|
|
|
|
|
|
+ this.$refs.modalGoodsForm.add()
|
|
|
|
|
+ this.$refs.modalGoodsForm.title = '新增菜品'
|
|
|
|
|
+ this.$refs.modalGoodsForm.disableSubmit = false
|
|
|
},
|
|
},
|
|
|
handleToRoomFeePayment() {
|
|
handleToRoomFeePayment() {
|
|
|
- this.handleAdd();
|
|
|
|
|
|
|
+ let param = this.getParam()
|
|
|
|
|
+ postAction('/pos/posOrderGoods/addRoomFee', param).then(resp => {
|
|
|
|
|
+ if (resp.result === true) {
|
|
|
|
|
+ this.$message.success('挂账成功')
|
|
|
|
|
+ this.modalFormOk()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning('挂账失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
handlePayment() {
|
|
handlePayment() {
|
|
|
- this.handleAdd((e) => {
|
|
|
|
|
- var amount = this.oldSelectGoodsList.reduce(function (total, item) {
|
|
|
|
|
- return total + item.sellingPrice * item.num;
|
|
|
|
|
- }, 0);
|
|
|
|
|
- this.$refs.modalPaymentForm.edit({
|
|
|
|
|
- billAmount: amount,
|
|
|
|
|
- deposit: 0,
|
|
|
|
|
- roomFee: amount,
|
|
|
|
|
- subjectType: 5,
|
|
|
|
|
- feeType: 2,
|
|
|
|
|
- preferentialType: 1,
|
|
|
|
|
- couponFirstAmount: 0,
|
|
|
|
|
- discount: 9,
|
|
|
|
|
- orderCode: e,
|
|
|
|
|
- });
|
|
|
|
|
- this.$refs.modalPaymentForm.title = "POS结账";
|
|
|
|
|
- this.$refs.modalPaymentForm.disableSubmit = false;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ console.log(this.posTableId)
|
|
|
|
|
+ if (this.posTableId === '') {
|
|
|
|
|
+ this.handleAdd((e) => {
|
|
|
|
|
+ this.settleAccounts(e)
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+
|
|
|
|
|
+ this.settleAccounts(this.selectOrderInfo.code)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ settleAccounts(orderCode) {
|
|
|
|
|
+ console.log(orderCode)
|
|
|
|
|
+ debugger
|
|
|
|
|
+ var amount = this.oldSelectGoodsList.reduce(function (total, item) {
|
|
|
|
|
+ return total + item.sellingPrice * item.num
|
|
|
|
|
+ }, 0)
|
|
|
|
|
+ this.$refs.modalPaymentForm.edit({
|
|
|
|
|
+ billAmount: amount,
|
|
|
|
|
+ deposit: 0,
|
|
|
|
|
+ roomFee: amount,
|
|
|
|
|
+ subjectType: 5,
|
|
|
|
|
+ feeType: 2,
|
|
|
|
|
+ preferentialType: 1,
|
|
|
|
|
+ couponFirstAmount: 0,
|
|
|
|
|
+ discount: 9,
|
|
|
|
|
+ orderCode: orderCode
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$refs.modalPaymentForm.title = 'POS结账'
|
|
|
|
|
+ this.$refs.modalPaymentForm.disableSubmit = false
|
|
|
|
|
+ },
|
|
|
|
|
+ placeOrder() {
|
|
|
|
|
+ this.handleAdd()
|
|
|
},
|
|
},
|
|
|
handleAdd(callback) {
|
|
handleAdd(callback) {
|
|
|
|
|
+ debugger
|
|
|
if (!this.selectGoodsList || this.selectGoodsList.length <= 0) {
|
|
if (!this.selectGoodsList || this.selectGoodsList.length <= 0) {
|
|
|
- this.$message.warning("请先选择商品");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- var _info = JSON.parse(localStorage.getItem("storeInfo"));
|
|
|
|
|
- var model = {
|
|
|
|
|
- goodsId: this.selectGoods.id,
|
|
|
|
|
- };
|
|
|
|
|
- if (_info) {
|
|
|
|
|
- model.hotelId = _info.id;
|
|
|
|
|
- }
|
|
|
|
|
- model.id = this.selectOrderInfo.id;
|
|
|
|
|
- model.toRoomFeeOrderId = this.selectRoomOrder.livingOrderId;
|
|
|
|
|
- model.posType = this.tabPosTypeId;
|
|
|
|
|
- if (this.remark) {
|
|
|
|
|
- model.remarks = this.remark;
|
|
|
|
|
|
|
+ this.$message.warning('请先选择商品')
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
- var posOrderGoodsDetailList = [];
|
|
|
|
|
- this.selectGoodsList.forEach((t) => {
|
|
|
|
|
- posOrderGoodsDetailList.push({
|
|
|
|
|
- goodsId: t.id,
|
|
|
|
|
- num: t.num,
|
|
|
|
|
- money: t.sellingPrice,
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- model.posOrderGoodsDetailList = posOrderGoodsDetailList;
|
|
|
|
|
- postAction("/pos/posOrderGoods/add", model)
|
|
|
|
|
|
|
+ let param = this.getParam()
|
|
|
|
|
+ postAction('/pos/posOrderGoods/add', param)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- this.$message.success(res.message);
|
|
|
|
|
|
|
+ this.$message.success(res.message)
|
|
|
this.oldSelectGoodsList = JSON.parse(
|
|
this.oldSelectGoodsList = JSON.parse(
|
|
|
JSON.stringify(this.selectGoodsList)
|
|
JSON.stringify(this.selectGoodsList)
|
|
|
- );
|
|
|
|
|
|
|
+ )
|
|
|
// this.selectGoodsList = [];
|
|
// this.selectGoodsList = [];
|
|
|
// this.selectOrderInfo = {};
|
|
// this.selectOrderInfo = {};
|
|
|
// this.selectRoomOrder = {};
|
|
// this.selectRoomOrder = {};
|
|
|
- this.loadGoods();
|
|
|
|
|
|
|
+ this.loadGoods()
|
|
|
|
|
+ if (this.posTableId !== '' || this.posTableId !== null){
|
|
|
|
|
+ this.$emit('reTable')
|
|
|
|
|
+ }
|
|
|
if (callback) {
|
|
if (callback) {
|
|
|
- callback(res.result.code);
|
|
|
|
|
|
|
+ callback(res.result.code)
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- this.$message.warning(res.message);
|
|
|
|
|
|
|
+ this.$message.warning(res.message)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- .finally(() => {});
|
|
|
|
|
|
|
+ .finally(() => {})
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getParam() {
|
|
|
|
|
+ var _info = JSON.parse(localStorage.getItem('storeInfo'))
|
|
|
|
|
+ var model = {
|
|
|
|
|
+ goodsId: this.selectGoods.id,
|
|
|
|
|
+ posTableId: this.posTableId
|
|
|
|
|
+ }
|
|
|
|
|
+ if (_info) {
|
|
|
|
|
+ model.hotelId = _info.id
|
|
|
|
|
+ }
|
|
|
|
|
+ model.id = this.selectOrderInfo.id
|
|
|
|
|
+ model.toRoomFeeOrderId = this.selectRoomOrder.livingOrderId
|
|
|
|
|
+ model.posType = this.tabPosTypeId
|
|
|
|
|
+ if (this.remark) {
|
|
|
|
|
+ model.remarks = this.remark
|
|
|
|
|
+ }
|
|
|
|
|
+ var posOrderGoodsDetailList = []
|
|
|
|
|
+ this.selectGoodsList.forEach((t) => {
|
|
|
|
|
+ posOrderGoodsDetailList.push({
|
|
|
|
|
+ goodsId: t.id,
|
|
|
|
|
+ num: t.num,
|
|
|
|
|
+ money: t.sellingPrice
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ model.posOrderGoodsDetailList = posOrderGoodsDetailList
|
|
|
|
|
+ return model
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
itemClick(row) {
|
|
itemClick(row) {
|
|
|
- console.log(row);
|
|
|
|
|
- if (row.id == "0") {
|
|
|
|
|
- this.handleAddTempGoods();
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ console.log(row)
|
|
|
|
|
+ if (row.id == '0') {
|
|
|
|
|
+ this.handleAddTempGoods()
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
if (row.isSellClear) {
|
|
if (row.isSellClear) {
|
|
|
- this.$message.warning("选择的商品已沽清");
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ this.$message.warning('选择的商品已沽清')
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
- var good = JSON.parse(JSON.stringify(row));
|
|
|
|
|
- this.$set(good, "num", 1);
|
|
|
|
|
- var find = this.selectGoodsList.find((t) => t.id === row.id);
|
|
|
|
|
|
|
+ var good = JSON.parse(JSON.stringify(row))
|
|
|
|
|
+ this.$set(good, 'num', 1)
|
|
|
|
|
+ var find = this.selectGoodsList.find((t) => t.id === row.id)
|
|
|
if (find) {
|
|
if (find) {
|
|
|
if (find.inventory > find.num) {
|
|
if (find.inventory > find.num) {
|
|
|
- find.num++;
|
|
|
|
|
|
|
+ find.num++
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- this.selectGoodsList.push(good);
|
|
|
|
|
|
|
+ this.selectGoodsList.push(good)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
itemClick2(row) {
|
|
itemClick2(row) {
|
|
|
- console.log(row);
|
|
|
|
|
- var good = JSON.parse(JSON.stringify(row));
|
|
|
|
|
- this.$set(good, "num", 1);
|
|
|
|
|
- this.$set(good, "sellingPrice", good.price);
|
|
|
|
|
- var find = this.selectGoodsList.find((t) => t.id === row.id);
|
|
|
|
|
|
|
+ console.log(row)
|
|
|
|
|
+ var good = JSON.parse(JSON.stringify(row))
|
|
|
|
|
+ this.$set(good, 'num', 1)
|
|
|
|
|
+ this.$set(good, 'sellingPrice', good.price)
|
|
|
|
|
+ var find = this.selectGoodsList.find((t) => t.id === row.id)
|
|
|
if (find) {
|
|
if (find) {
|
|
|
- find.num++;
|
|
|
|
|
|
|
+ find.num++
|
|
|
} else {
|
|
} else {
|
|
|
- this.selectGoodsList.push(good);
|
|
|
|
|
|
|
+ this.selectGoodsList.push(good)
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
@import "~@assets/less/common.less";
|
|
@import "~@assets/less/common.less";
|
|
|
|
|
|