盘点 库存功能

This commit is contained in:
老叶
2022-03-07 14:03:40 +08:00
parent fb054fa2b6
commit 99c96c34b6
16 changed files with 396 additions and 25 deletions
+2 -1
View File
@@ -39,7 +39,8 @@
"pages/siyutong/activityDetail/index",
"pages/siyutong/activityRanking/index",
"pages/inventory/detail/index",
"pages/inventory/list/index"
"pages/inventory/list/index",
"pages/inventory/warning/index"
],
"echarts": [
{
+4 -1
View File
@@ -1,4 +1,4 @@
const env = "d";
const env = "p";
const version = 1,
@@ -124,6 +124,9 @@ api = {
appInventoryLists:'app/inventory/lists', //盘点记录
appInventory:'app/inventory', //盘点详情 /盘点上传图片
appInventoryRemind:'app/inventory/remind', //盘点提醒
appGoodsRemind:'app/goods/remind', //库存提醒/预警
appGoodsLists:'app/goods/lists', //库存列表
+14
View File
@@ -797,4 +797,18 @@ apiQuery.getAppInventoryRemind = function (params) {
})
}
//库存提醒/预警
apiQuery.getAppGoodsRemind = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appGoodsRemind, 2, params, "GET", resolve, reject)
})
}
//库存列表
apiQuery.getAppGoodsLists = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appGoodsLists, 2, params, "GET", resolve, reject)
})
}
export default apiQuery;
+1 -1
View File
@@ -23,7 +23,7 @@ Page({
},
onShow: function () {
},
//获取订单详情
+84
View File
@@ -3,11 +3,19 @@ const app = getApp()
Page({
data: {
imgUrl: _.config.imgUrl,
isShowReport:false,//是否显示调拨盘点弹框
},
onLoad: function (options) {
this.getUserInfo()
},
onShow: function () {
this.setData({
isShowReport:false,//是否显示调拨盘点弹框
remindMsg:[],
});
this.getAppTransferRemind()
this.getAppInventoryRemind()
this.getAppGoodsRemind()
},
//获取用户信息
getUserInfo(){
@@ -18,6 +26,62 @@ Page({
});
},
//调拨提醒
getAppTransferRemind(){
_.apiQuery.getAppTransferRemind().then(res => {
if(res.data.total>0){
let remindMsg = this.data.remindMsg
remindMsg.push({
title:'调拨提醒',
content:'您有新的车辆调拨,需要您进行确认操作。',
img:'https://qs.haodian.cn/wechat_app/lichebao/allot/car.gif?v=220224',
btn:{
title:'前往操作',
url:'/pages/allot/list/index',
},
})
this.setData({
remindMsg,
isShowReport:true,
})
}
});
},
//盘点提醒
getAppInventoryRemind(){
_.apiQuery.getAppInventoryRemind().then(res => {
if(res.data.total>0){
let remindMsg = this.data.remindMsg
remindMsg.push({
title:'盘点提醒',
content:'您有新的车辆盘点,需要您进行确认操作。',
img:'https://qs.haodian.cn/wechat_app/lichebao/inventory/animation.gif',
btn:{
title:'前往操作',
url:'/pages/inventory/list/index',
},
})
this.setData({
remindMsg,
isShowReport:true,
})
}
});
},
//库存提醒/预警
getAppGoodsRemind(){
let params = {};
params['type'] = 1;
_.apiQuery.getAppGoodsRemind(params).then(res => {
this.setData({
stock:res.data,
})
wx.stopPullDownRefresh()
});
},
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
@@ -25,4 +89,24 @@ Page({
}
},
//显示隐藏调拨盘点弹窗
optShowReport(e){
this.setData({
isShowReport:!this.data.isShowReport,
})
},
//退出登录
logout(){
wx.clearStorage()
wx.reLaunch({
url: '/pages/login/index'
})
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
this.getAppGoodsRemind()
},
})
+1 -1
View File
@@ -1,5 +1,5 @@
{
"navigationBarTitleText": "调拨",
"enablePullDownRefresh": true,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#1a1c26",
"backgroundColor": "#ffffff",
+52 -7
View File
@@ -1,15 +1,60 @@
<view class="container">
<view class='pt160 text-center'>
<image class='img-130x130 ulib-r750' mode="aspectFill" src='{{imgUrl}}/login/logo.jpg?v=220223'></image>
<view class='mt10 font-32 color-fff'>Hi~,欢迎回到狸车宝!</view>
<view class="mt10 font-64 color-fff">{{userInfo.uname}}</view>
<view class="inline-block bg-fff mt10 pl15 pr15 font-22 ulib-r750">{{userInfo.biz_name}}</view>
<view class='mt20 font-32 color-fff'>{{userInfo.uname}},欢迎回到狸车宝!</view>
<!-- <view class="mt10 font-64 color-fff">{{userInfo.uname}}</view> -->
<view class="mt20">
<view class="inline-block bg-fff mt10 pt10 pb10 pl30 pr30 font-32 ulib-r750">{{userInfo.biz_name}}</view>
</view>
<view class="mt20">
<view class="inline-block pt10 pb10 pl30 pr30 font-24 color-fff ulib-r750" bindtap="logout">
<i class="iconfont icon-tuichu mr10"></i>退出
</view>
</view>
</view>
<view class="fixed left-0 bottom-0 right-0 bg-fff pt200 pb20 pl100 pr100">
<view class="absolute left-0 right-0 ml30 mr30 pt30 pb30 pl15 pr15 bg-fff box-shadow-000-10-10 fn-flex ulib-r10" style="top:-150rpx;">
</view>
<view class="fixed left-0 bottom-0 right-0 bg-fff pt200 pb20 pl100 pr100">
<!-- <button class="wp100 btn-36afa2 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" bindtap="pushLink" data-url="/pages/allot/list/index"><text class="iconfont icon-zengjia mr10"></text>新增调拨</button> -->
</view>
<view class="fixed left-0 bottom-0 right-0 pl30 pr30 pb50">
<view class="relative ml15 mr15 mb30 pt20 pb20 pl30 pr200 ulib-r750 font-24 color-fff" style="background-image:linear-gradient(45deg, #30cfbd, #2cbf8b);" bindtap="pushLink" data-url="/pages/inventory/warning/index" wx:if="{{stock.show==1}}">
<view class="text-left">{{stock.inventory.title}}</view>
<view class="absolute right-0 box-middle mr25 mb10">
<!-- <text class="text-middle">{{stock.inventory.value}}</text> -->
<i class="iconfont icon-gengduo ml5 text-middle"></i>
</view>
</view>
<view class="pt30 pb30 pl15 pr15 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="fn-flex">
<view class="fn-flex-item ml15 mr15" bindtap="pushLink" data-url="/pages/allot/list/index?tabs_id=1&type=1&title=调拨发车"><image class='img-300x230' mode="aspectFill" src='{{imgUrl}}/allot/tip-1.png'></image></view>
<view class="fn-flex-item ml15 mr15" bindtap="pushLink" data-url="/pages/allot/list/index?tabs_id=1&type=2&title=调拨收车"><image class='img-300x230' mode="aspectFill" src='{{imgUrl}}/allot/tip-2.png'></image></view>
</view>
<!-- <button class="wp100 btn-36afa2 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" bindtap="pushLink" data-url="/pages/allot/list/index"><text class="iconfont icon-zengjia mr10"></text>新增调拨</button> -->
</view>
</view>
</view>
<!-- 调拨提醒 盘点提醒 -->
<lcb-msg isShow="{{isShowReport}}">
<view slot="content">
<swiper class='wp100' style="height:550rpx;" autoplay circular bindchange="bannerChange">
<swiper-item class="relative" wx:for="{{remindMsg}}" wx:key="index">
<view class="pt40 pl40 pr40">
<view class="font-36 text-center">{{item.title}}</view>
<view class="mt10 font-22 text-center color-999">{{item.content}}</view>
</view>
<view class="mt20 pl40 pr40 pb40">
<image class='wp100 ulib-r10' src='{{item.img}}' mode='widthFix'></image>
</view>
<view class="fn-flex pl60 pr60 pb50 text-center font-32 color-666">
<button bindtap="optShowReport" class="fn-flex-item mr20 bds-2-36afa2 btn-no-bg wp100 font-28 color-36afa2 ulib-r750">取消</button>
<button bindtap="pushLink" data-url="{{item.btn.url}}" class="fn-flex-item ml20 btn-36afa2 wp100 font-28 color-fff ulib-r750" hover-class="btn-36afa2-hover">{{item.btn.title}}</button>
</view>
</swiper-item>
</swiper>
<view class="absolute left-0 right-0 bottom-0 pb20 text-center" style='height:30rpx' wx:if="{{remindMsg.length > 1}}">
<block wx:for-items="{{remindMsg}}" wx:for-index="j" wx:key='j'>
<view class="inline-block indicator-pin {{banneractive==j?'active':''}}"></view>
</block>
</view>
</view>
</lcb-msg>
+65 -11
View File
@@ -39,12 +39,37 @@ Page({
ecPie:{},
isShowNotice:false,//是否显示通知
stopNotice:false,//是否不再显示通知
isShowReport:false,
isShowReport:false,//是否显示调拨盘点弹框
isShowProfile:true,//是否显示授权用户信息按钮
isShowGoods:false,//是否显示库存预警
banneractive: 0,
banneractive2: 0,
remindTab:[],
remindMsg:[],
banneractive3: 0,
remindTab:[],//调拨盘点入口
remindMsg:[],//调拨盘点弹框
// inventory:[
// {
// title:'车库存天数已超过20天,请尽快销售,以免造成损失!',
// name:'哪吒V',
// num:'AWR20210833232221',
// tip:'已库存:66天',
// img:'https://img.liche.cn/liche/2021/11/5438e63bb9c4963d/c5b5e20b2ecf285a.png'
// },
// {
// title:'车库存天数已超过20天,请尽快销售,以免造成损失!',
// name:'哪吒V',
// num:'AWR20210833232221',
// tip:'已库存:66天',
// img:'https://img.liche.cn/liche/2021/11/5438e63bb9c4963d/c5b5e20b2ecf285a.png'
// },
// {
// title:'车库存天数已超过20天,请尽快销售,以免造成损失!',
// name:'哪吒V',
// num:'AWR20210833232221',
// tip:'已库存:66天',
// img:'https://img.liche.cn/liche/2021/11/5438e63bb9c4963d/c5b5e20b2ecf285a.png'
// },
// ],
},
onLoad(options) {
@@ -76,11 +101,15 @@ Page({
this.setData({
remindTab:[],
remindMsg:[],
isShowReport:false,//是否显示调拨盘点弹框
isShowGoods:false,
});
this.getAppUserCal()
this.getHoursTip()
this.getAppTransferRemind()
this.getAppInventoryRemind()
this.getAppGoodsRemind()
},
//生命周期函数--监听页面卸载
@@ -143,10 +172,7 @@ Page({
remindMsg,
isShowReport:true,
isShowNotice:false,
})
}else{
this.setData({
isShowReport:false,
isShowGoods:false,
})
}
});
@@ -179,11 +205,24 @@ Page({
remindMsg,
isShowReport:true,
isShowNotice:false,
isShowGoods:false,
})
}else{
}
});
},
//库存提醒/预警
getAppGoodsRemind(){
_.apiQuery.getAppGoodsRemind().then(res => {
this.setData({
inventory:res.data.inventory,
warning:res.data.warning,
})
if(app.getStorageByKey("showGoodsData")!=new Date().getDate()&&res.data.warning.list&&res.data.warning.list.length>0){
this.setData({
isShowReport:false,
isShowGoods:true,
})
app.setStorage('showGoodsData', new Date().getDate())
}
});
},
@@ -339,12 +378,18 @@ Page({
}
},
//显示短信弹框
//显示隐藏调拨盘点弹窗
optShowReport(e){
this.setData({
isShowReport:!this.data.isShowReport,
})
},
//显示隐藏库存预警弹窗
optShowGoods(e){
this.setData({
isShowGoods:!this.data.isShowGoods,
})
},
//开发中
development(){
@@ -355,7 +400,7 @@ Page({
})
},
//banner轮播点
//调拨盘点轮播点
bannerChange: function (e) {
this.setData({
banneractive:e.detail.current,
@@ -367,18 +412,27 @@ Page({
banneractive2:e.detail.current,
});
},
//库存预警轮播点
bannerChange3: function (e) {
this.setData({
banneractive3:e.detail.current,
});
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
this.setData({
remindTab:[],
remindMsg:[],
isShowReport:false,//是否显示调拨盘点弹框
isShowGoods:false,
});
this.getAppUserCal()
this.getAppStatisticsHcust()
this.getAppStatisticsHorder()
this.getAppTransferRemind()
this.getAppInventoryRemind()
this.getAppGoodsRemind()
},
})
+45 -3
View File
@@ -15,7 +15,7 @@
</view>
</view>
</view>
<view class="mb30 pt40 pb40 pl20 pr20 bg-fff box-shadow-000-10-10 ulib-r10 fn-flex text-center font-22 color-666" wx:if="{{userInfo.group_id == 4}}">
<view class="mb30 pt40 pb40 pl20 pr20 bg-fff box-shadow-000-10-10 ulib-r10 fn-flex text-center font-22 color-666" wx:if="{{1 == 0}}">
<view class="fn-flex-item" bindtap="pushLink" data-url="/pages/storeInfo/index">
<image class='img-50x50' mode="aspectFill" src='{{imgUrl}}index/icon-tab-1.png' lazy-load="{{true}}"></image>
<view>店铺概况</view>
@@ -58,7 +58,16 @@
</view>
</view>
<view class="inner30 pt40">
<view class="font-36">客户代办事项</view>
<view class="relative pt20 pb20 pl30 pr200 ulib-r750 font-24 color-fff" style="background-image:linear-gradient(45deg, {{inventory.color1}}, {{inventory.color2}});" bindtap="pushLink" data-url="/pages/inventory/warning/index">
<view class="text-left">{{inventory.title}}</view>
<view class="absolute right-0 box-middle mr25 mb10">
<text class="text-middle">{{inventory.value}}</text>
<i class="iconfont icon-gengduo ml5 text-middle"></i>
</view>
</view>
<view class="mt20 font-36">客户代办事项</view>
<view class="fn-flex pt20 pb20 color-fff">
<view class="fn-flex-item relative mr15 pt25 pb25 pl110 bg-1c89fd-8058fe ulib-r10" bindtap="pushLink" data-url="/pages/customer/filterList/index?iscall=0&title=未联系潜客" >
<i class="absolute left-0 box-middle ml35 iconfont icon-qianke font-60"></i>
@@ -173,7 +182,7 @@
</view>
</lcb-msg>
<!-- 调拨提醒 -->
<!-- 调拨提醒 盘点提醒 -->
<lcb-msg isShow="{{isShowReport}}">
<view slot="content">
<swiper class='wp100' style="height:550rpx;" autoplay circular bindchange="bannerChange">
@@ -197,4 +206,37 @@
</block>
</view>
</view>
</lcb-msg>
<!-- 库存提醒 -->
<lcb-msg isShow="{{!isShowReport&&isShowGoods}}">
<view slot="content" class="inner40" style="width:550rpx;">
<view class="text-center font-36">{{warning.title}}</view>
<view class="mt10 text-center font-22 color-f9394d">{{warning.note}}</view>
<view class="relative">
<swiper class='wp100' style="height:420rpx;" autoplay circular bindchange="bannerChange3">
<swiper-item class="relative" wx:for="{{warning.list}}" wx:key="index">
<view class="mt40 fn-clear">
<view class="fn-fl">
<view class="font-36">{{item.title}}</view>
<view class="mt10 font-22 color-666">{{item.vin}}</view>
</view>
<view class="fn-fr pt5 pb5 pl20 pr20 bg-f9394d font-22 color-fff ulib-r750">{{item.days}}</view>
</view>
<view class="mt10 pb10">
<image class='wp100' src='{{item.img}}' mode='widthFix'></image>
</view>
</swiper-item>
</swiper>
<view class="absolute left-0 right-0 bottom-0 pb20 text-center" style='height:30rpx' wx:if="{{warning.list.length > 1}}">
<block wx:for-items="{{warning.list}}" wx:for-index="j" wx:key='j'>
<view class="inline-block indicator-pin {{banneractive3==j?'active':''}}"></view>
</block>
</view>
</view>
<view class="fn-flex pl60 pr60 pb20 text-center font-32 color-666">
<button bindtap="optShowGoods" class="fn-flex-item mr20 bds-2-36afa2 btn-no-bg wp100 font-28 color-36afa2 ulib-r750">取消</button>
<button bindtap="pushLink" data-url="/pages/inventory/warning/index" class="fn-flex-item ml20 btn-36afa2 wp100 font-28 color-fff ulib-r750" hover-class="btn-36afa2-hover">点击查看</button>
</view>
</view>
</lcb-msg>
+5
View File
@@ -7,6 +7,7 @@ Page({
car_img:[],//请上传运输单
id:'',//查看id
mileage:'',//里程数
note:'',//备注
},
onLoad: function (options) {
for (let key in options) {
@@ -33,6 +34,7 @@ Page({
info:res.data,
car_img:res.data.car_img,
mileage:res.data.mileage?res.data.mileage:'',
note:res.data.note?res.data.note:'',
})
wx.stopPullDownRefresh()
@@ -123,6 +125,9 @@ Page({
params['id'] = that.data.id;
params['car_img'] = that.data.car_img;
params['mileage'] = that.data.mileage;
if(that.data.note){
params['note'] = that.data.note;
}
_.apiQuery.postAppInventory(params).then(res => {
let pages = getCurrentPages();
+6
View File
@@ -3,6 +3,9 @@
<view class="relative bg-fff ulib-r10 box-shadow-000-10-10">
<view class="inner40">
<view class="font-40">{{info.biz_name}}</view>
<view class="mt10 pb10">
<image class='wp100' src='{{info.car_cor_img}}' mode='widthFix'></image>
</view>
<block wx:for="{{info.other_data}}" wx:key='i'>
<view class="mt25 fn-clear font-28 color-666">
<view class="fn-fl">{{item.title}}</view>
@@ -44,6 +47,9 @@
<input class="wp100 pl20 pr20 bds-1-eb font-28 ulib-r10" placeholder-class="color-ccc" placeholder="请填写里程数" type="digit" style="height:70rpx;" model:value='{{mileage}}'/>
<view class="absolute box-middle right-0 pr40 font-26 color-666">km</view>
</view>
<view class="relative mt30 pl40 pr40">
<textarea class="wp100 inner20 bds-1-eb font-28 ulib-r10" placeholder-class="color-ccc" placeholder="请填写备注" type="text" style="height:120rpx;" model:value='{{note}}' />
</view>
<view class="mt40 pl40 pr40">
<button disabled="{{submitFlag}}" bindtap="postAppInventory" class="btn-36afa2 wp100 pt10 pb10 font-28 color-fff ulib-r750" hover-class="btn-36afa2-hover">确定</button>
</view>
+3
View File
@@ -44,6 +44,9 @@
<block wx:for='{{list}}' wx:key='index'>
<view class="inner40 relative ulib-r10 box-shadow-000-10-10 mb30 overflowhidden" bindtap="pushLink" data-url="/pages/inventory/detail/index?id={{item.id}}">
<view class="font-40" wx:if="{{item.biz_name}}">{{item.biz_name}}</view>
<view class="mt10 pb10">
<image class='wp100' src='{{item.car_cor_img}}' mode='widthFix'></image>
</view>
<block wx:for="{{item.other_data}}" wx:for-index='key' wx:for-item='it' wx:key='i'>
<view class="mt25 fn-clear font-28">
<view class="fn-fl color-333">{{it.title}}</view>
+86
View File
@@ -0,0 +1,86 @@
import _ from '../../../commons/js/commons'
const app = getApp()
Page({
data: {
list: [],//库存列表
pageNo: 1,
noData: false,
end: false,
load: true,
loading: false,
},
onLoad: function (options) {
for (let key in options) {
this.setData({
[key]: options[key]
})
}
if(this.data.title){
wx.setNavigationBarTitle({
title:this.data.title,
})
}
this.getAppGoodsLists()
},
//获取库存列表
getAppGoodsLists() {
this.setData({
load: false,
loading: true,
})
let params = {};
params['page'] = this.data.pageNo;
params['size'] = 10;
_.apiQuery.getAppGoodsLists(params).then(res => {
this.setData({
flag: this.data.flag - 1
})
this.setData({
pageNo: this.data.pageNo + 1,
list: this.data.list.concat(res.data.list),
load: true,
loading: false,
})
if (res.data.total == 0) {
this.setData({
noData: true
})
} else if (this.data.list.length == res.data.total) {
this.setData({
end: true
})
}
wx.stopPullDownRefresh()
});
},
//推送链接
pushLink(e){
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh(){
this.setData({
list: [],
pageNo: 1,
noData: false,
end: false,
load: true,
loading: false,
})
this.getAppGoodsLists()
},
//页面上拉触底事件的处理函数
onReachBottom(){
if (this.data.noData || this.data.end||!this.data.load) return;
this.getAppGoodsLists()
},
})
+6
View File
@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "库存列表",
"usingComponents": {
}
}
+22
View File
@@ -0,0 +1,22 @@
<view class="container">
<view class="mt30 pl30 pr30">
<block wx:for='{{list}}' wx:key='index'>
<view class="inner40 relative ulib-r10 box-shadow-000-10-10 mb30 overflowhidden">
<view class="font-40" wx:if="{{item.title}}">{{item.title}}</view>
<view class="mt10 pb10">
<image class='wp100' src='{{item.car_cor_img}}' mode='widthFix'></image>
</view>
<block wx:for="{{item.other_data}}" wx:for-index='key' wx:for-item='it' wx:key='i'>
<view class="mt25 fn-clear font-28">
<view class="fn-fl color-333">{{it.title}}</view>
<view class="fn-fr wp60 text-nowrap text-right color-666" style="{{it.color?'color:'+it.color:''}}">{{it.value}}</view>
</view>
</block>
</view>
</block>
<lcb-listmore isLoading='{{loading}}' isEnd='{{list.length>5&&end}}' isNoData='{{noData}}'></lcb-listmore>
</view>
</view>
View File