更换正式环境,测试修改
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
|
||||
<view class="input-wrapper">
|
||||
<view class="input-main">
|
||||
<view class="u-flex u-p-r-30 u-font-28" @click="showstatusToggle">
|
||||
<text class="u-m-r-10 u-line-1" :class="{'color-main':status.active!=0}"
|
||||
style="max-width: 100rpx;">{{status.list[status.active].label }}</text>
|
||||
<view class="u-flex u-p-r-30 u-font-28" @click="pageData.statusShow = !pageData.statusShow">
|
||||
<text class="u-m-r-10 u-line-1 " :class="{'color-main':pageData.query.status!=''}"
|
||||
style="max-width: 100rpx;">{{pageData.statusName }}</text>
|
||||
<up-icon name="arrow-down" size="16"></up-icon>
|
||||
</view>
|
||||
<uni-easyinput clearable class='jeepay-search' :inputBorder="false"
|
||||
@@ -26,20 +26,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{height:status.show?statusHeight:0}" class="tranistion status overflow-hide">
|
||||
<view @tap="changestatusActive(index,item)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||
v-for="(item,index) in status.list" :key="index">
|
||||
<view>{{item.label}}</view>
|
||||
<uni-icons v-if="status.active===index" type="checkmarkempty" :color="$utils.ColorMain"></uni-icons>
|
||||
</view>
|
||||
<view :style="{height: status.bottomHeight+'px'}"></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</up-sticky>
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="list u-p-30">
|
||||
<view class="my-bg-main table-type u-flex border-r-12 color-fff ">
|
||||
@@ -74,38 +62,25 @@
|
||||
<view class="color-999 u-p-30 u-text-center border-bottom">桌号:{{actionSheet.title}}</view>
|
||||
</template>
|
||||
</my-action-sheet>
|
||||
<my-mask ref="mask" @close="hideType"></my-mask>
|
||||
<up-picker :show="pageData.statusShow" :columns="pageData.statusList" keyName="label" @cancel="pageData.statusShow=false" @confirm="confirmStatus" ></up-picker>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onLoad, onReady, onShow, } from '@dcloudio/uni-app';
|
||||
import { ref, reactive, computed, watch } from 'vue';
|
||||
|
||||
import { objToArrary } from '@/commons/utils/returrn-data.js'
|
||||
import { $status } from '@/commons/table-status.js'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import myMask from '@/components/my-components/my-mask'
|
||||
import addTable from './components/add-table'
|
||||
import myActionSheet from '@/components/my-components/my-action-sheet';
|
||||
import tableItem from './components/table-item'
|
||||
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
||||
import { getShopTable, shopTableBind, shopTableClear } from '@/http/api/table.js'
|
||||
import { getShopArea } from '@/http/api/area.js'
|
||||
import { printOrder } from '@/http/api/order.js'
|
||||
|
||||
const statusList = objToArrary($status)
|
||||
statusList.unshift({
|
||||
key: '',
|
||||
label: '全部'
|
||||
})
|
||||
const status = reactive({
|
||||
list: statusList,
|
||||
active: 0,
|
||||
show: false,
|
||||
bottomHeight: 14
|
||||
})
|
||||
import { getHistoryOrder } from '@/http/api/order.js'
|
||||
|
||||
const pageData = reactive({
|
||||
statusShow: false,
|
||||
hasAjax: false,
|
||||
areaMap: {},
|
||||
query: {
|
||||
@@ -116,34 +91,30 @@
|
||||
name: '',
|
||||
},
|
||||
totalElements:0,
|
||||
statusList: [[{
|
||||
key: '',
|
||||
label: '全部'
|
||||
},...uni.$utils.objToArrary($status)]],
|
||||
statusName: '全部',
|
||||
tabList: [],
|
||||
area: {
|
||||
list: [],
|
||||
sel: ''
|
||||
}
|
||||
})
|
||||
const search = reactive({
|
||||
show: false
|
||||
},
|
||||
orderInfo: null,
|
||||
})
|
||||
|
||||
const refMoreSheet = ref(null)
|
||||
const actionSheet = reactive({
|
||||
list: ['结账', '清台', '增减菜', '换台', '打印订单', '历史订单','绑定码牌'],
|
||||
title: '',
|
||||
selTable: ''
|
||||
})
|
||||
|
||||
const statusHeight = computed(() => {
|
||||
return 30 * status.list.length + status.bottomHeight + 'px'
|
||||
})
|
||||
|
||||
watch(() => pageData.area.sel, (newval) => {
|
||||
pageData.query.page = 1
|
||||
getTable()
|
||||
})
|
||||
watch(() => status.active, (newval) => {
|
||||
pageData.query.page = 1
|
||||
getTable()
|
||||
})
|
||||
|
||||
onShow(opt => {
|
||||
getData()
|
||||
@@ -175,6 +146,17 @@
|
||||
}, {})
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型选择
|
||||
* @param {Object} e
|
||||
*/
|
||||
function confirmStatus(e){
|
||||
pageData.statusShow = false
|
||||
pageData.query.status = e.value[0].key
|
||||
pageData.statusName = e.value[0].label
|
||||
getTable()
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域选择确定
|
||||
* @param {Object} item
|
||||
@@ -192,6 +174,11 @@
|
||||
actionSheet.title = table.name
|
||||
actionSheet.selTable = table
|
||||
refMoreSheet.value.open()
|
||||
if( actionSheet.selTable.orderId ){
|
||||
getHistoryOrder({orderId: actionSheet.selTable.orderId}).then(res=>{
|
||||
pageData.orderInfo = res
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,8 +226,9 @@
|
||||
//打印订单
|
||||
if (!item.orderId) {
|
||||
return uni.$utils.showToast('该桌台暂无要打印的订单!')
|
||||
}
|
||||
let res = await printOrder( {id: actionSheet.selTable.orderId } )
|
||||
}
|
||||
|
||||
let res = await printOrder( {id: actionSheet.selTable.orderId, type: pageData.orderInfo.status == 'unpaid' ? 1 : 0 } )
|
||||
return
|
||||
}
|
||||
if (index == 6) {
|
||||
@@ -313,61 +301,14 @@
|
||||
* 搜索
|
||||
*/
|
||||
function searchConfirm() {
|
||||
search.show = false
|
||||
pageData.query.page = 1;
|
||||
maskHide()
|
||||
getTable()
|
||||
}
|
||||
|
||||
const times = reactive({
|
||||
list: [10, 15, 20, 30],
|
||||
active: 0,
|
||||
show: false,
|
||||
bottomHeight: 14
|
||||
})
|
||||
|
||||
function hideType() {
|
||||
status.show = false
|
||||
search.show = false
|
||||
times.show = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开类型
|
||||
* 页数改变事件
|
||||
* @param {Object} page
|
||||
*/
|
||||
function showstatusToggle() {
|
||||
status.show = !status.show
|
||||
search.show = false
|
||||
times.show = false
|
||||
if (status.show) {
|
||||
maskShow()
|
||||
} else {
|
||||
maskHide()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型选择
|
||||
* @param {Object} i
|
||||
*/
|
||||
function changestatusActive(i) {
|
||||
status.active = i
|
||||
status.show = false
|
||||
pageData.query.status = status.list[i].key
|
||||
mask.value.toggle()
|
||||
}
|
||||
|
||||
const mask = ref(null)
|
||||
|
||||
function maskShow() {
|
||||
mask.value.open()
|
||||
}
|
||||
|
||||
function maskHide() {
|
||||
mask.value.close()
|
||||
}
|
||||
|
||||
// 页数改变事件
|
||||
function pageChange(page) {
|
||||
pageData.query.page = page
|
||||
getTable()
|
||||
|
||||
Reference in New Issue
Block a user