Browse Source

零售列表调整

voice
张家华 4 years ago
parent
commit
a27123878c
  1. 7
      src/subpackage/retail/pages/confirm_goods/confirm_goods.vue
  2. 28
      src/subpackage/retail/pages/index/index.vue
  3. 9
      src/subpackage/retail/pages/search/search.vue

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

@ -52,7 +52,7 @@
data() {
return {
isEdited: false, //
curStore: null, //
curStore: {}, //
cartListFinal: [], //
totalPrice: 0, //
cartConfirmText: "收款出库", // ||
@ -162,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": {

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

@ -220,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))}`
});
},
@ -260,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;
@ -490,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": {
@ -537,14 +552,13 @@ 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: '加载物品数据失败!'
@ -579,6 +593,7 @@ export default {
_this.goodsInfo.push(res.data.data.list[i]);
}
_this.cartList = []; //
_this.totalCount = 0;
_this.totalPrice = 0;
_this.goodsInfo[1].style = _this.categoryBtnStyle.click;
@ -626,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(); //
});
},
}
}

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

@ -36,10 +36,14 @@
return {
searchText: "", //
historyList: [], //
curStore: {}, //
}
},
onLoad() {
onLoad(option) {
this.getSearchHistory(); //
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
},
methods: {
//
@ -103,7 +107,8 @@
retailServer.get({
url: retailApi.assistantListErpGoodsCateAndGoods,
data: {
assistant_key: text
assistant_key: text,
stadium_id: _this.curStore.id,
},
isDefaultGet: false,
failMsg: '搜索失败!'

Loading…
Cancel
Save