Browse Source

update

voice
张家华 4 years ago
parent
commit
6b72b3bf5f
  1. 2
      src/pages/index/index.vue
  2. 12
      src/subpackage/retail/pages/confirm_goods/confirm_goods.vue
  3. 43
      src/subpackage/retail/pages/index/index.vue
  4. 36
      src/subpackage/retail/pages/search/search.vue

2
src/pages/index/index.vue

@ -115,7 +115,7 @@
id: 7, id: 7,
name: '商品零售', name: '商品零售',
path: '/subpackage/retail/pages/index/index', path: '/subpackage/retail/pages/index/index',
serverKey: 1011 //
serverKey: 1010 //
} }
]; ];

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

@ -109,11 +109,7 @@
} }
if (!data.length) { if (!data.length) {
uni.showToast({
title: "暂无商品数量!",
icon: "none"
});
util.showNone("暂无商品数量!");
return; return;
} }
@ -124,12 +120,18 @@
store_id: _this.curStore.id, store_id: _this.curStore.id,
goods_data: data, goods_data: data,
}, },
isDefaultGet: false,
failMsg: '出库失败!' failMsg: '出库失败!'
}).then(res => { }).then(res => {
if (res.data.code == 0) {
util.hideLoad(); util.hideLoad();
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}); });
}
else {
util.showNone(res.data.message || '操作失败!');
}
}); });
}, },

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

@ -7,6 +7,7 @@
range-key="name" range-key="name"
:range="curStoreList" :range="curStoreList"
value="0" value="0"
:disabled="storeListDisabled"
> >
<view class="header-store-selecter"> <view class="header-store-selecter">
<image class="header-store-selecter-left-img" mode="aspectFit" src="/static/images/icon/retail/home.png"></image> <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> <image mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input <input
type="text" type="text"
placeholder="请输入商品名称"
placeholder="请输入商品名称、sku"
disabled disabled
/> />
</view> </view>
@ -106,6 +107,7 @@ export default {
// curStoreList: [{ id: '', name: ''}], // // curStoreList: [{ id: '', name: ''}], //
indexData: {}, // indexData: {}, //
curStoreList: [], // curStoreList: [], //
storeListDisabled: false, //
curStore: {}, // curStore: {}, //
goodsInfo: [], // goodsInfo: [], //
mainHeight: "0rpx", // mainHeight: "0rpx", //
@ -317,10 +319,7 @@ export default {
}); });
} }
else { else {
uni.showToast({
title: "购物车无数据!",
icon: "none"
});
util.showNone("购物车无数据!");
} }
}, },
@ -547,8 +546,10 @@ export default {
data: { data: {
// brand_id: _this.indexData.brand.id, // brand_id: _this.indexData.brand.id,
}, },
isDefaultGet: false,
failMsg: '加载物品数据失败!' failMsg: '加载物品数据失败!'
}).then(res => { }).then(res => {
if (res.data.code == 0) {
_this.goodsInfo.push({ _this.goodsInfo.push({
isCateShow: false, isCateShow: false,
isShow: false, isShow: false,
@ -563,20 +564,19 @@ export default {
goods_list: [], goods_list: [],
}); });
console.log(res);
for (let i = 0; i < res.list.length; ++i) {
if (res.list[i].cate.erp_goods_cate_name == "热销") {
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 _this.categoryIndex = 2; // 2
} }
if (!res.list[i].goods_list) {
res.list[i].goods_list = [];
if (!res.data.data.list[i].goods_list) {
res.data.data.list[i].goods_list = [];
} }
res.list[i].isCateShow = true;
res.list[i].isShow = false;
res.list[i].style = _this.categoryBtnStyle.default;
_this.goodsInfo.push(res.list[i]);
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]);
} }
_this.totalCount = 0; _this.totalCount = 0;
@ -586,6 +586,11 @@ export default {
_this.categoryGoTop(); // _this.categoryGoTop(); //
util.hideLoad(); util.hideLoad();
}
else {
util.hideLoad();
util.showNone(res.data.message || '操作失败!');
}
}); });
}, },
@ -599,12 +604,20 @@ export default {
data: { data: {
// brand_id: _this.indexData.brand.id // brand_id: _this.indexData.brand.id
}, },
isDefaultGet: false,
failMsg: '加载店铺失败!' failMsg: '加载店铺失败!'
}).then(res => { }).then(res => {
let _list = res.list || [];
if (res.data.code == 0) {
let _list = res.data.data.list || [];
_this.curStoreList = [..._this.curStoreList, ..._list]; _this.curStoreList = [..._this.curStoreList, ..._list];
_this.curStore = _this.curStoreList[0] || {}; _this.curStore = _this.curStoreList[0] || {};
_this.storeListDisabled = _this.curStoreList.length > 1 ? false : true;
_this.getGoodsInfo(); // _this.getGoodsInfo(); //
}
else {
util.hideLoad();
util.showNone(res.data.message || '操作失败!');
}
}); });
}, },

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

@ -5,7 +5,7 @@
<image mode="aspectFit" src="/static/images/icon/retail/search.png"></image> <image mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input <input
type="text" type="text"
placeholder="请输入商品名称"
placeholder="请输入商品名称、sku"
v-model="searchText" v-model="searchText"
focus="true" focus="true"
/> />
@ -45,11 +45,7 @@
// //
searchHistoryDelete() { searchHistoryDelete() {
if (this.historyList.length <= 0) { if (this.historyList.length <= 0) {
uni.showToast({
title: "暂无历史数据!",
icon: "none"
})
util.showNone("暂无历史数据!");
return; return;
} }
@ -83,11 +79,7 @@
// //
searchTrigger(text, type) { searchTrigger(text, type) {
if (!text) { if (!text) {
uni.showToast({
title: "请输入商品名称!",
icon: "none"
});
util.showNone("请输入商品名称、sku");
return; return;
} }
@ -113,27 +105,26 @@
data: { data: {
assistant_key: text assistant_key: text
}, },
isDefaultGet: false,
failMsg: '搜索失败!' failMsg: '搜索失败!'
}).then(res => { }).then(res => {
if (res.data.code == 0) {
let mark = false; let mark = false;
for (let i = 0; i < res.list.length; ++i) {
if (res.list[i].goods_list) {
for (let i = 0; i < res.data.data.list.length; ++i) {
if (res.data.data.list[i].goods_list) {
mark = true; mark = true;
} }
} }
// //
if (!mark) { if (!mark) {
uni.showToast({
title: "暂无数据",
icon: "none"
});
util.showNone("暂无数据");
return; return;
} }
uni.setStorage({ uni.setStorage({
key: "searchData", key: "searchData",
data: res.list,
data: res.data.data.list,
success: function() { success: function() {
util.hideLoad(); util.hideLoad();
@ -143,12 +134,13 @@
}); });
}, },
fail: function(err) { fail: function(err) {
uni.showToast({
title: "搜索失败",
icon: "none"
});
util.showNone("搜索失败");
}, },
}); });
}
else {
util.showNone(res.data.message || '操作失败!');
}
}); });
}, },

Loading…
Cancel
Save