Browse Source

Merge branch 'iteration' of https://git.ouxuan.net/APP/ox_zhiNengZhuShou into iteration

voice
郑锦全 4 years ago
parent
commit
3cee378484
  1. 7
      src/pages/employee/manage/manage.vue
  2. BIN
      src/static/images/icon/index/tab_10.png
  3. BIN
      src/static/images/icon/index/tab_2.png
  4. BIN
      src/static/images/icon/index/tab_3.png
  5. BIN
      src/static/images/icon/index/tab_4.png
  6. BIN
      src/static/images/icon/index/tab_5.png
  7. BIN
      src/static/images/icon/index/tab_6.png
  8. BIN
      src/static/images/icon/index/tab_7.png
  9. BIN
      src/static/images/icon/index/tab_8.png
  10. BIN
      src/static/images/icon/index/tab_9.png
  11. 2
      src/store/index.js
  12. 27
      src/subpackage/retail/pages/confirm_goods/confirm_goods.vue
  13. 125
      src/subpackage/retail/pages/index/index.vue
  14. 85
      src/subpackage/retail/pages/search/search.vue

7
src/pages/employee/manage/manage.vue

@ -59,7 +59,7 @@
<view class="ei-author">
<view>权限</view>
<view>
<view class="tag-active" v-if="k.extension.permission.menu.length == 10">全部权限</view>
<view class="tag-active" v-if="k.extension.permission.menu.length == permissionArr.length">全部权限</view>
<view v-else v-for="e in k.extension.permission.menu" :key="e">{{permissionObj[e] || ''}}</view>
</view>
</view>
@ -83,10 +83,11 @@
import { API } from '../../../js/api';
import { servers } from '../../../js/server';
import util from '../../../utils/util'
import { mapState } from 'vuex';
import { mapState, mapGetters } from 'vuex';
export default {
computed: {
...mapState([ 'permissionObj', 'brandInfo' ]),
...mapGetters([ 'permissionArr' ]),
...mapState([ 'permissionObj', 'brandInfo', ]),
isFilter(){
let { filterInfo } = this;
return !!filterInfo.meun || !!filterInfo.store

BIN
src/static/images/icon/index/tab_10.png

Before

Width: 52  |  Height: 52  |  Size: 470 B

After

Width: 52  |  Height: 52  |  Size: 402 B

BIN
src/static/images/icon/index/tab_2.png

Before

Width: 52  |  Height: 52  |  Size: 477 B

After

Width: 52  |  Height: 52  |  Size: 177 B

BIN
src/static/images/icon/index/tab_3.png

Before

Width: 52  |  Height: 52  |  Size: 177 B

After

Width: 52  |  Height: 52  |  Size: 698 B

BIN
src/static/images/icon/index/tab_4.png

Before

Width: 52  |  Height: 52  |  Size: 696 B

After

Width: 52  |  Height: 52  |  Size: 683 B

BIN
src/static/images/icon/index/tab_5.png

Before

Width: 52  |  Height: 52  |  Size: 402 B

After

Width: 52  |  Height: 52  |  Size: 740 B

BIN
src/static/images/icon/index/tab_6.png

Before

Width: 52  |  Height: 52  |  Size: 698 B

After

Width: 52  |  Height: 52  |  Size: 396 B

BIN
src/static/images/icon/index/tab_7.png

Before

Width: 52  |  Height: 52  |  Size: 683 B

After

Width: 52  |  Height: 52  |  Size: 470 B

BIN
src/static/images/icon/index/tab_8.png

Before

Width: 52  |  Height: 52  |  Size: 740 B

After

Width: 52  |  Height: 52  |  Size: 477 B

BIN
src/static/images/icon/index/tab_9.png

Before

Width: 52  |  Height: 52  |  Size: 396 B

After

Width: 52  |  Height: 52  |  Size: 696 B

2
src/store/index.js

@ -27,6 +27,7 @@ export default new Vuex.Store({
'1008': '查询核销',
'1009': '场地管理',
'1010': '设备管理',
'1011': '商品零售',
},
// 场地占用提交页面信息
@ -48,6 +49,7 @@ export default new Vuex.Store({
name: _obj[key],
})
}
console.warn(_arr.length)
return _arr;
}
}

27
src/subpackage/retail/pages/confirm_goods/confirm_goods.vue

@ -52,7 +52,7 @@
data() {
return {
isEdited: false, //
curStore: null, //
curStore: {}, //
cartListFinal: [], //
totalPrice: 0, //
cartConfirmText: "收款出库", // ||
@ -109,11 +109,7 @@
}
if (!data.length) {
uni.showToast({
title: "暂无商品数量!",
icon: "none"
});
util.showNone("暂无商品数量!");
return;
}
@ -124,12 +120,18 @@
store_id: _this.curStore.id,
goods_data: data,
},
isDefaultGet: false,
failMsg: '出库失败!'
}).then(res => {
util.hideLoad();
uni.navigateBack({
delta: 1
});
if (res.data.code == 0) {
util.hideLoad();
uni.navigateBack({
delta: 1
});
}
else {
util.showNone(res.data.message || '操作失败!');
}
});
},
@ -160,6 +162,11 @@
if (item) {
switch (type) {
case "add": {
//
if (item.erp_goods_sale_total + 1 > item.stock_num) {
util.showNone("库存就这么多了!");
return;
}
item.erp_goods_sale_total += 1;
} break;
case "sub": {

125
src/subpackage/retail/pages/index/index.vue

@ -7,6 +7,7 @@
range-key="name"
:range="curStoreList"
value="0"
:disabled="storeListDisabled"
>
<view class="header-store-selecter">
<image class="header-store-selecter-left-img" mode="aspectFit" src="/static/images/icon/retail/home.png"></image>
@ -20,7 +21,7 @@
<image mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input
type="text"
placeholder="请输入商品名称"
placeholder="请输入商品名称、sku"
disabled
/>
</view>
@ -106,6 +107,7 @@ export default {
// curStoreList: [{ id: '', name: ''}], //
indexData: {}, //
curStoreList: [], //
storeListDisabled: false, //
curStore: {}, //
goodsInfo: [], //
mainHeight: "0rpx", //
@ -218,8 +220,12 @@ export default {
//
searchTrigger() {
let data = {
curStore: this.curStore,
};
uni.navigateTo({
url: '/subpackage/retail/pages/search/search'
url: `/subpackage/retail/pages/search/search?data=${encodeURIComponent(JSON.stringify(data))}`
});
},
@ -258,6 +264,12 @@ export default {
switch (type) {
case "add": {
//
if (this.cartList[i].erp_goods_sale_total + 1 > this.cartList[i].stock_num) {
util.showNone("库存就这么多了!");
return;
}
this.cartList[i].erp_goods_sale_total += 1;
for (let i = 0; i < mainItems.length; ++i) {
mainItems[i].erp_goods_sale_total += 1;
@ -317,10 +329,7 @@ export default {
});
}
else {
uni.showToast({
title: "购物车无数据!",
icon: "none"
});
util.showNone("购物车无数据!");
}
},
@ -491,6 +500,11 @@ export default {
if (goodsItem) {
switch (type) {
case "add": {
//
if (goodsItem.erp_goods_sale_total + 1 > goodsItem.stock_num) {
util.showNone("库存就这么多了!");
return;
}
goodsItem.erp_goods_sale_total += 1;
} break;
case "sub": {
@ -538,54 +552,60 @@ export default {
//
getGoodsInfo() {
let _this = this;
_this.goodsInfo = [];
// let categoryName = "";
retailServer.get({
url: retailApi.assistantListErpGoodsCateAndGoods,
data: {
// brand_id: _this.indexData.brand.id,
stadium_id: _this.curStore.id,
},
isDefaultGet: false,
failMsg: '加载物品数据失败!'
}).then(res => {
_this.goodsInfo.push({
isCateShow: false,
isShow: false,
style: _this.categoryBtnStyle.default,
cate: {
created_at: "",
erp_goods_cate_brandid: -1,
erp_goods_cate_name: "搜索",
id: -1,
update_at: "",
},
goods_list: [],
});
console.log(res);
for (let i = 0; i < res.list.length; ++i) {
if (res.list[i].cate.erp_goods_cate_name == "热销") {
_this.categoryIndex = 2; // 2
}
if (res.data.code == 0) {
_this.goodsInfo.push({
isCateShow: false,
isShow: false,
style: _this.categoryBtnStyle.default,
cate: {
created_at: "",
erp_goods_cate_brandid: -1,
erp_goods_cate_name: "搜索",
id: -1,
update_at: "",
},
goods_list: [],
});
if (!res.list[i].goods_list) {
res.list[i].goods_list = [];
for (let i = 0; i < res.data.data.list.length; ++i) {
if (res.data.data.list[i].cate.erp_goods_cate_name == "热销") {
_this.categoryIndex = 2; // 2
}
if (!res.data.data.list[i].goods_list) {
res.data.data.list[i].goods_list = [];
}
res.data.data.list[i].isCateShow = true;
res.data.data.list[i].isShow = false;
res.data.data.list[i].style = _this.categoryBtnStyle.default;
_this.goodsInfo.push(res.data.data.list[i]);
}
res.list[i].isCateShow = true;
res.list[i].isShow = false;
res.list[i].style = _this.categoryBtnStyle.default;
_this.goodsInfo.push(res.list[i]);
_this.cartList = []; //
_this.totalCount = 0;
_this.totalPrice = 0;
_this.goodsInfo[1].style = _this.categoryBtnStyle.click;
_this.goodsInfo[1].isShow = true;
_this.categoryGoTop(); //
util.hideLoad();
}
else {
util.hideLoad();
util.showNone(res.data.message || '操作失败!');
}
_this.totalCount = 0;
_this.totalPrice = 0;
_this.goodsInfo[1].style = _this.categoryBtnStyle.click;
_this.goodsInfo[1].isShow = true;
_this.categoryGoTop(); //
util.hideLoad();
});
},
@ -599,12 +619,20 @@ export default {
data: {
// brand_id: _this.indexData.brand.id
},
isDefaultGet: false,
failMsg: '加载店铺失败!'
}).then(res => {
let _list = res.list || [];
_this.curStoreList = [..._this.curStoreList, ..._list];
_this.curStore = _this.curStoreList[0] || {};
_this.getGoodsInfo(); //
if (res.data.code == 0) {
let _list = res.data.data.list || [];
_this.curStoreList = [..._this.curStoreList, ..._list];
_this.curStore = _this.curStoreList[0] || {};
_this.storeListDisabled = _this.curStoreList.length > 1 ? false : true;
_this.getGoodsInfo(); //
}
else {
util.hideLoad();
util.showNone(res.data.message || '操作失败!');
}
});
},
@ -613,9 +641,10 @@ export default {
let _this = this;
let curStoreList = _this.curStoreList;
_this.curStore = curStoreList[e.detail.value] || {};
// _this.$nextTick(function() {
// _this.getGoodsInfo(); //
// });
_this.$nextTick(function() {
util.showLoad();
_this.getGoodsInfo(); //
});
},
}
}

85
src/subpackage/retail/pages/search/search.vue

@ -5,7 +5,7 @@
<image mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input
type="text"
placeholder="请输入商品名称"
placeholder="请输入商品名称、sku"
v-model="searchText"
focus="true"
/>
@ -36,20 +36,20 @@
return {
searchText: "", //
historyList: [], //
curStore: {}, //
}
},
onLoad() {
onLoad(option) {
this.getSearchHistory(); //
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
},
methods: {
//
searchHistoryDelete() {
if (this.historyList.length <= 0) {
uni.showToast({
title: "暂无历史数据!",
icon: "none"
})
util.showNone("暂无历史数据!");
return;
}
@ -83,11 +83,7 @@
//
searchTrigger(text, type) {
if (!text) {
uni.showToast({
title: "请输入商品名称!",
icon: "none"
});
util.showNone("请输入商品名称、sku");
return;
}
@ -111,44 +107,45 @@
retailServer.get({
url: retailApi.assistantListErpGoodsCateAndGoods,
data: {
assistant_key: text
assistant_key: text,
stadium_id: _this.curStore.id,
},
isDefaultGet: false,
failMsg: '搜索失败!'
}).then(res => {
let mark = false;
for (let i = 0; i < res.list.length; ++i) {
if (res.list[i].goods_list) {
mark = true;
if (res.data.code == 0) {
let mark = false;
for (let i = 0; i < res.data.data.list.length; ++i) {
if (res.data.data.list[i].goods_list) {
mark = true;
}
}
}
//
if (!mark) {
uni.showToast({
title: "暂无数据",
icon: "none"
//
if (!mark) {
util.showNone("暂无数据");
return;
}
uni.setStorage({
key: "searchData",
data: res.data.data.list,
success: function() {
util.hideLoad();
//
uni.navigateBack({
delta: 1
});
},
fail: function(err) {
util.showNone("搜索失败");
},
});
return;
}
uni.setStorage({
key: "searchData",
data: res.list,
success: function() {
util.hideLoad();
//
uni.navigateBack({
delta: 1
});
},
fail: function(err) {
uni.showToast({
title: "搜索失败",
icon: "none"
});
},
});
else {
util.showNone(res.data.message || '操作失败!');
}
});
},

Loading…
Cancel
Save