Browse Source

update

voice
张家华 4 years ago
parent
commit
6b72b3bf5f
  1. 2
      src/pages/index/index.vue
  2. 20
      src/subpackage/retail/pages/confirm_goods/confirm_goods.vue
  3. 95
      src/subpackage/retail/pages/index/index.vue
  4. 74
      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 //
} }
]; ];

20
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 => {
util.hideLoad();
uni.navigateBack({
delta: 1
});
if (res.data.code == 0) {
util.hideLoad();
uni.navigateBack({
delta: 1
});
}
else {
util.showNone(res.data.message || '操作失败!');
}
}); });
}, },

95
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,45 +546,51 @@ export default {
data: { data: {
// brand_id: _this.indexData.brand.id, // brand_id: _this.indexData.brand.id,
}, },
isDefaultGet: false,
failMsg: '加载物品数据失败!' failMsg: '加载物品数据失败!'
}).then(res => { }).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: [],
});
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: [],
});
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
}
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.data.list[i].goods_list) {
res.data.data.list[i].goods_list = [];
}
if (!res.list[i].goods_list) {
res.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.totalCount = 0;
_this.totalPrice = 0;
_this.goodsInfo[1].style = _this.categoryBtnStyle.click;
_this.goodsInfo[1].isShow = true;
_this.categoryGoTop(); //
_this.totalCount = 0;
_this.totalPrice = 0;
_this.goodsInfo[1].style = _this.categoryBtnStyle.click;
_this.goodsInfo[1].isShow = true;
_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 || [];
_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 || '操作失败!');
}
}); });
}, },

74
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,42 +105,42 @@
data: { data: {
assistant_key: text assistant_key: text
}, },
isDefaultGet: false,
failMsg: '搜索失败!' failMsg: '搜索失败!'
}).then(res => { }).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"
});
return;
}
//
if (!mark) {
util.showNone("暂无数据");
return;
}
uni.setStorage({
key: "searchData",
data: res.list,
success: function() {
util.hideLoad();
uni.setStorage({
key: "searchData",
data: res.data.data.list,
success: function() {
util.hideLoad();
//
uni.navigateBack({
delta: 1
});
},
fail: function(err) {
uni.showToast({
title: "搜索失败",
icon: "none"
});
},
});
//
uni.navigateBack({
delta: 1
});
},
fail: function(err) {
util.showNone("搜索失败");
},
});
}
else {
util.showNone(res.data.message || '操作失败!');
}
}); });
}, },

Loading…
Cancel
Save