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() { data() {
return { return {
isEdited: false, // isEdited: false, //
curStore: null, //
curStore: {}, //
cartListFinal: [], // cartListFinal: [], //
totalPrice: 0, // totalPrice: 0, //
cartConfirmText: "收款出库", // || cartConfirmText: "收款出库", // ||
@ -162,6 +162,11 @@
if (item) { if (item) {
switch (type) { switch (type) {
case "add": { case "add": {
//
if (item.erp_goods_sale_total + 1 > item.stock_num) {
util.showNone("库存就这么多了!");
return;
}
item.erp_goods_sale_total += 1; item.erp_goods_sale_total += 1;
} break; } break;
case "sub": { case "sub": {

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

@ -220,8 +220,12 @@ export default {
// //
searchTrigger() { searchTrigger() {
let data = {
curStore: this.curStore,
};
uni.navigateTo({ 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) { switch (type) {
case "add": { 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; this.cartList[i].erp_goods_sale_total += 1;
for (let i = 0; i < mainItems.length; ++i) { for (let i = 0; i < mainItems.length; ++i) {
mainItems[i].erp_goods_sale_total += 1; mainItems[i].erp_goods_sale_total += 1;
@ -490,6 +500,11 @@ export default {
if (goodsItem) { if (goodsItem) {
switch (type) { switch (type) {
case "add": { case "add": {
//
if (goodsItem.erp_goods_sale_total + 1 > goodsItem.stock_num) {
util.showNone("库存就这么多了!");
return;
}
goodsItem.erp_goods_sale_total += 1; goodsItem.erp_goods_sale_total += 1;
} break; } break;
case "sub": { case "sub": {
@ -537,14 +552,13 @@ export default {
// //
getGoodsInfo() { getGoodsInfo() {
let _this = this; let _this = this;
_this.goodsInfo = []; _this.goodsInfo = [];
// let categoryName = "";
retailServer.get({ retailServer.get({
url: retailApi.assistantListErpGoodsCateAndGoods, url: retailApi.assistantListErpGoodsCateAndGoods,
data: { data: {
// brand_id: _this.indexData.brand.id, // brand_id: _this.indexData.brand.id,
stadium_id: _this.curStore.id,
}, },
isDefaultGet: false, isDefaultGet: false,
failMsg: '加载物品数据失败!' failMsg: '加载物品数据失败!'
@ -579,6 +593,7 @@ export default {
_this.goodsInfo.push(res.data.data.list[i]); _this.goodsInfo.push(res.data.data.list[i]);
} }
_this.cartList = []; //
_this.totalCount = 0; _this.totalCount = 0;
_this.totalPrice = 0; _this.totalPrice = 0;
_this.goodsInfo[1].style = _this.categoryBtnStyle.click; _this.goodsInfo[1].style = _this.categoryBtnStyle.click;
@ -626,9 +641,10 @@ export default {
let _this = this; let _this = this;
let curStoreList = _this.curStoreList; let curStoreList = _this.curStoreList;
_this.curStore = curStoreList[e.detail.value] || {}; _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 { return {
searchText: "", // searchText: "", //
historyList: [], // historyList: [], //
curStore: {}, //
} }
}, },
onLoad() {
onLoad(option) {
this.getSearchHistory(); // this.getSearchHistory(); //
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
}, },
methods: { methods: {
// //
@ -103,7 +107,8 @@
retailServer.get({ retailServer.get({
url: retailApi.assistantListErpGoodsCateAndGoods, url: retailApi.assistantListErpGoodsCateAndGoods,
data: { data: {
assistant_key: text
assistant_key: text,
stadium_id: _this.curStore.id,
}, },
isDefaultGet: false, isDefaultGet: false,
failMsg: '搜索失败!' failMsg: '搜索失败!'

Loading…
Cancel
Save