diff --git a/commons/goodsData.js b/commons/goodsData.js new file mode 100644 index 0000000..3fa480a --- /dev/null +++ b/commons/goodsData.js @@ -0,0 +1,74 @@ +import dayjs from "dayjs"; +export const $types = [{ + title: "计量商品", + desc: '单价购买', + value: 'normal' + }, + { + title: "多规格", + desc: '多种不同规格', + value: 'sku' + }, + { + title: "套餐组合", + desc: '选择多种组合', + value: 'group' + }, + { + title: "称重商品", + desc: '按重量售卖', + value: 'weight' + }, + { + title: "时价商品", + desc: '收银端可更改价格', + value: 'currentPrice' + } +] + +// 商品默认sku +export const $defaultSku = { + salePrice: '', + memberPrice: '', + costPrice: '', + originPrice: '', + // stockNumber: '', + firstShared: '', + suit: 1, + barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`, +} + + +// 库存记录筛选类型 +export const $invoicingType = [{ + text: '全部', + value: '' + }, + { + text: '供应商入库', + value: 'purveyor' + }, + { + text: '供应商退货', + value: 'reject' + }, + { + text: '其他入库', + value: 'purchase' + }, + { + text: '其他出库', + value: 'other-out' + } +] + +// 页面常用数据 +export const $pageData = { + query: { + page: 0, + size: 10 + }, + totalElements: 0, + list: [], + hasAjax: false, +} \ No newline at end of file diff --git a/commons/table-status.js b/commons/table-status.js index 67c3a53..4d53960 100644 --- a/commons/table-status.js +++ b/commons/table-status.js @@ -30,5 +30,9 @@ export const $status = { cleaning: { label: "待清台", type: "#FAAD14", - } + }, + unbind: { + label: "未绑定", + type: "rgb(221,221,221)", + } } \ No newline at end of file diff --git a/http/yskApi/http.js b/http/yskApi/http.js index cfb63d3..ea92bfb 100644 --- a/http/yskApi/http.js +++ b/http/yskApi/http.js @@ -15,6 +15,7 @@ import { } from '@/commons/utils/encryptUtil.js' import infoBox from "@/commons/utils/infoBox.js" import go from '@/commons/utils/go.js'; +import { reject } from 'lodash'; // 测试服 let baseUrl = 'https://admintestpapi.sxczgkj.cn' @@ -127,8 +128,9 @@ function commonsProcess(showLoading, httpReqCallback) { }).catch(res => { if(res.status==401){ storageManage.token(null, true) - infoBox.showErrorToast('请登录').then(() => { - go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH) + infoBox.showErrorToast(res.message||'请登录').then(() => { + uni.redirectTo({url: '/pages/login/index'}) + reject() }) } // if(res.status==400){ @@ -138,9 +140,7 @@ function commonsProcess(showLoading, httpReqCallback) { // }) // } if(res.status==500){ - storageManage.token(null, true) - infoBox.showErrorToast('请登录').then(() => { - go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH) + infoBox.showErrorToast(res.message||'服务器异常').then(() => { }) } // if(res&&res.msg){ diff --git a/http/yskApi/table.js b/http/yskApi/table.js index 07d6d2b..796f756 100644 --- a/http/yskApi/table.js +++ b/http/yskApi/table.js @@ -1,6 +1,6 @@ // 桌台管理 import http from './http.js' -const request=http.request +const request = http.request import $API from '@/http/classApi.js' import appConfig from '@/config/appConfig.js' import { @@ -9,9 +9,9 @@ import { import infoBox from '@/commons/utils/infoBox.js' /* 台桌区域 */ -export const $tableArea=new $API('/api/tbShopArea',http.req) +export const $tableArea = new $API('/api/tbShopArea', http.req) /* 台桌 */ -export const $table=new $API('/api/tbShopTable',http.req) +export const $table = new $API('/api/tbShopTable', http.req) /* 绑定 */ // export const $bind=new $API('/api/tbShopTable/bind',http.req) export function $bind(data) { @@ -23,4 +23,28 @@ export function $bind(data) { ...data } }); +} +//获取台桌详情状态 +export function $returnTableDetail(data) { + return request({ + url: '/api/tbShopTable/state', + method: "get", + params: { + shopId: uni.getStorageSync('shopId'), + ...data + } + }); +} + + +// 选择台桌 +export function $choseTable(data) { + return request({ + url: '/api/place/choseTable', + method: "put", + data: { + shopId: uni.getStorageSync('shopId'), + ...data + } + }); } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 41fb573..19e7f8b 100644 --- a/manifest.json +++ b/manifest.json @@ -130,7 +130,7 @@ "quickapp" : {}, /* 快应用特有相关 */ "mp-weixin" : { - "appid" : "wxcbff1cfb27c1066c", + "appid" : "wxcf0fe8cdba153fd6", "setting" : { "urlCheck" : false, "minified" : true, diff --git a/pageProduct/add-Product/add-Product-9-19-back.vue b/pageProduct/add-Product/add-Product-9-19-back.vue index b638e16..adae269 100644 --- a/pageProduct/add-Product/add-Product-9-19-back.vue +++ b/pageProduct/add-Product/add-Product-9-19-back.vue @@ -930,7 +930,7 @@ import { $types, $defaultSku - } from '../goodsData.js' + } from '@/commons/goodsData.js' import { $getProductDetail, $tbShopCategory, diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue index 7ed6956..e08499a 100644 --- a/pageProduct/add-Product/add-Product.vue +++ b/pageProduct/add-Product/add-Product.vue @@ -546,7 +546,7 @@ import { $types, $defaultSku - } from '../goodsData.js' + } from '@/commons/goodsData.js' import { $getProductDetail, $tbShopCategory, diff --git a/pageProduct/add-specifications/choose-specifications.vue b/pageProduct/add-specifications/choose-specifications.vue index cea6292..e1fa0d1 100644 --- a/pageProduct/add-specifications/choose-specifications.vue +++ b/pageProduct/add-specifications/choose-specifications.vue @@ -183,8 +183,9 @@ import go from '@/commons/utils/go.js'; import color from '@/commons/color.js'; import { + $types, $defaultSku - } from '../goodsData.js' + } from '@/commons/goodsData.js' import { $productSpec } from '@/http/yskApi/goods.js'; diff --git a/pageProduct/invoicing-check/invoicing-check.vue b/pageProduct/invoicing-check/invoicing-check.vue index 1d5b2bf..7670be8 100644 --- a/pageProduct/invoicing-check/invoicing-check.vue +++ b/pageProduct/invoicing-check/invoicing-check.vue @@ -78,7 +78,8 @@ import listItem from './components/list-item'; import { $pageData - } from '../goodsData.js' + } from '@/commons/goodsData.js' + import { computed, reactive, diff --git a/pageProduct/invoicing-list/invoicing-list.vue b/pageProduct/invoicing-list/invoicing-list.vue index da5f838..7783ad1 100644 --- a/pageProduct/invoicing-list/invoicing-list.vue +++ b/pageProduct/invoicing-list/invoicing-list.vue @@ -93,8 +93,9 @@ $getProductDetail, $getProductStockDetail,$getProductStockDetailSum } from '@/http/yskApi/goods.js' - import {$invoicingType} from '../goodsData.js' - + import { + $invoicingType + } from '@/commons/goodsData.js' const search = reactive({ keyword: '', show: false diff --git a/pageProduct/util.js b/pageProduct/util.js index 86005cd..eff220a 100644 --- a/pageProduct/util.js +++ b/pageProduct/util.js @@ -1,6 +1,6 @@ import { $types -} from '@/pageProduct/goodsData.js' +} from '@/commons/goodsData.js' export function returnSkuSnap(goods) { const selectSpec = typeof goods.selectSpec === 'string' ? JSON.parse(goods.selectSpec) : goods.selectSpec let result = selectSpec.map(v => { diff --git a/pageTable/index/index.vue b/pageTable/index/index.vue index 5831443..340597d 100644 --- a/pageTable/index/index.vue +++ b/pageTable/index/index.vue @@ -22,7 +22,7 @@ - 取消 + 取消 @@ -34,7 +34,7 @@ - {{item.label}} @@ -54,11 +54,18 @@ - - - - - + + + + @@ -239,12 +246,16 @@ function searchConfirm() { hideSearch() - filterTableList() + query.page=1; + getTable() // tables.list = tables.originList.filter((v) => // v.name.includes(search.keyword.trim()) // ); } - + function clearSearch(){ + search.keyword='' + hideSearch() + } function hideSearch() { search.show = false maskHide() @@ -372,10 +383,17 @@ mask.value.close() } - const query = { - page: 0, + const query = reactive({ + page: 1, size: 10, - areaId: 0 + areaId: 0, + totalElements:0 + }) + // 页数改变事件 + function pageChange(page) { + console.log(page); + query.page = page + getTable() } const tables = reactive({ hasAjax: false, @@ -392,12 +410,14 @@ query.areaId = item.id } async function getTable() { + let state=status.list[status.active].key + state=state?(state=='all'?'':state):'' const { - content - } = await $table.get(query) + content,total + } = await $table.get({...query,name:search.keyword,state}) tables.hasAjax = true - tables.originList = content - filterTableList() + query.totalElements=total||0 + tables.list = content } const areaMap = ref({}) async function getArea() { @@ -415,28 +435,19 @@ } watch(() => tables.area.sel, (newval) => { console.log(newval); - query.page = 0 + query.page = 1 getTable() }) watch(() => status.active, (newval) => { - query.page = 0 + query.page = 1 // if (newval === 0) { // return tables.list = tables.originList // } // tables.list = tables.originList.filter((v) => { // return v.status == status.list[status.active].key // }); - filterTableList() + getTable() }) - - function filterTableList() { - tables.list = tables.originList.filter((v) => { - console.log(status.list[status.active].key); - return (status.active == 0 ? true : v.status == status.list[status.active].key) && ( - v.name.includes(search.keyword.trim()) - ) - }); - } watch(() => times.active, (newval) => { setTimer() }) diff --git a/pages/login/index.vue b/pages/login/index.vue index e07ac31..0c14671 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -239,14 +239,10 @@ }) // #ifdef H5 - // vdata.formData.username = '15699991111' - // vdata.formData.pwd = '123456' - vdata.formData.username = '' - vdata.formData.pwd = '' + vdata.formData.username = '17792050546' + vdata.formData.pwd = 'sy666888' // #endif // #ifdef MP-WEIXIN - vdata.formData.username = '' - vdata.formData.pwd = '' // vdata.formData.username = '15699991111' // vdata.formData.pwd = 'qwer1234' // #endif diff --git a/pagesCreateOrder/choose-table/choose-table.vue b/pagesCreateOrder/choose-table/choose-table.vue index 3389dda..34c7d28 100644 --- a/pagesCreateOrder/choose-table/choose-table.vue +++ b/pagesCreateOrder/choose-table/choose-table.vue @@ -4,7 +4,7 @@ + v-model="searchValue"> - - + + + + + @@ -65,9 +107,14 @@ padding: 0 6rpx; border-radius: 8rpx; font-size: 24rpx; + &.yitui { background-color: rgb(188, 188, 188); color: #fff; } } + .price-min-width{ + min-width: 100rpx; + text-align: right; + } \ No newline at end of file diff --git a/pagesOrder/detail/components/list.vue b/pagesOrder/detail/components/list.vue index a18357e..7499ef6 100644 --- a/pagesOrder/detail/components/list.vue +++ b/pagesOrder/detail/components/list.vue @@ -53,7 +53,7 @@ -