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/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..b821fc9 100644 --- a/pageTable/index/index.vue +++ b/pageTable/index/index.vue @@ -54,11 +54,18 @@ - - - - - + + + + @@ -372,10 +379,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, @@ -393,9 +407,10 @@ } async function getTable() { const { - content + content,total } = await $table.get(query) tables.hasAjax = true + query.totalElements=total||0 tables.originList = content filterTableList() } @@ -415,11 +430,11 @@ } 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 // } 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/index/index.vue b/pagesCreateOrder/index/index.vue index 81897ff..4127e57 100644 --- a/pagesCreateOrder/index/index.vue +++ b/pagesCreateOrder/index/index.vue @@ -333,9 +333,9 @@ } //加入购物车 function addCart(par) { - if (!data.table.tableId) { - return infoBox.showToast('请先选择桌台!') - } + // if (!data.table.tableId) { + // return infoBox.showToast('请先选择桌台!') + // } const submitPar = { masterId: data.masterId, tableId: data.table.tableId,