Browse Source

首页开发

liangbowen 10 months ago
parent
commit
f152b8a570

+ 20 - 23
package.json

@@ -1,23 +1,20 @@
-{
-    "id": "dumenghanfeng-monitorScanCode",
-    "name": "PDA广播模式下监听扫描组件",
-    "version": "1.0.0",
-    "description": "改插件为基于uniAPP所开发的使用在PDA上面,对PDA扫描头部的监听,可以在PDA扫码后获取到对应的数据;该插件仅限于PDA扫描模式为广播模式;目前仅在安卓系统测试;使用的是重新加载组件的方式实现",
-    "keywords": [
-        "PDA,方便,快捷"
-    ],
-    "dcloudext": {
-        "category": [
-            "前端组件",
-            "通用组件"
-        ]
-    },
-    "dependencies": {
-<<<<<<< HEAD
-        "js-sha1": "^0.7.0",
-=======
-        "@dcloudio/uni-helper-json": "^1.0.13",
->>>>>>> master
-        "md5": "^2.3.0"
-    }
-}
+{
+	"id": "dumenghanfeng-monitorScanCode",
+	"name": "PDA广播模式下监听扫描组件",
+	"version": "1.0.0",
+	"description": "改插件为基于uniAPP所开发的使用在PDA上面,对PDA扫描头部的监听,可以在PDA扫码后获取到对应的数据;该插件仅限于PDA扫描模式为广播模式;目前仅在安卓系统测试;使用的是重新加载组件的方式实现",
+	"keywords": [
+		"PDA,方便,快捷"
+	],
+	"dcloudext": {
+		"category": [
+			"前端组件",
+			"通用组件"
+		]
+	},
+	"dependencies": {
+		"js-sha1": "^0.7.0",
+		"@dcloudio/uni-helper-json": "^1.0.13",
+		"md5": "^2.3.0"
+	}
+}

+ 13 - 7
pages.json

@@ -1,6 +1,18 @@
 {
 	"pages": [
-		//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		{
+			"path": "pages/home/home",
+			"style": {
+				"navigationBarTitleText": "首页"
+			}
+		},
+		{
+			"path": "pages/grounding/grounding",
+			"style": {
+				"navigationBarTitleText": "上架确认"
+			}
+		},
 		{
 			"path": "pages/query/query",
 			"style": {
@@ -14,12 +26,6 @@
 			}
 		},
 		{
-			"path": "pages/home/home",
-			"style": {
-				"navigationBarTitleText": "首页"
-			}
-		},
-		{
 			"path": "pages/groundetials/groundetials",
 			"style": {
 				"navigationBarTitleText": "验收"

+ 369 - 28
pages/home/home.vue

@@ -4,16 +4,91 @@
 			<view class="title-bac">
 				<view class="roomt">
 					<span class="rom-spn">当前所在仓库</span>
-					<span class="quit-spn"></span>
+					<span class="quit-spn" @click.stop="loginOff()"></span>
 				</view>
 				<view class="rom-set">
 					<view class="park"></view>
-					<view class="houseName">{{houseName}}</view>
+					<view class="houseName">
+						<uni-data-picker popup-title="请选择仓库" :localdata="houseData" @change="onchange">
+							<span class='romtitle'>{{houseSelectData.houseName}}</span>
+						</uni-data-picker>
+					</view>
 					<view class="down"></view>
 				</view>
+				<view class="section-view">
+					<view class="user-cont">
+						<span class="user-spn">欢迎</span>
+						<span class="user-spn spnr">{{userData.userName}}</span>
+					</view>
+					<view class="sec-data">
+						<view class="sec-item" v-for="(item,index) in romDetData" :key="index">
+							<span class="item-spn spnVal">{{item.value}}</span>
+							<span class="item-spn">{{item.name}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="app-view">
+					<view class="app-item">
+						<view class="app-title">
+							商品检索
+						</view>
+						<view class="app-item-mut">
+							<view class="app-item-spn">
+								商品所在位置及属性信息查询
+							</view>
+							<view class="app-item-img">
+
+							</view>
+						</view>
+					</view>
+					<view class="app-item">
+						<view class="app-title">
+							库存盘点
+						</view>
+						<view class="app-item-mut">
+							<view class="app-item-spn">
+								多种方式盘点核对库内商品
+							</view>
+							<view class="app-item-img">
+
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="message-view">
+					<view class="all-message">
+						全部消息 >>
+					</view>
+					<view>
+						<view class="message-item" v-for="(item,index) in messageData" :key="index">
+							<span>{{item.text}}</span>
+							<span>详情 >></span>
+						</view>
+					</view>
+				</view>
+				<view class="all-app">
+					<view class="all-title">
+						全部应用
+					</view>
+					<view class="all-app-view">
+						<view class="app-view-item" v-for="(item,index) in appData" :key="index">
+							<view class="app-item-img" :style="{background: item.bgColor}" @click.stop="appView(item)">
+								<view class="app-item-svg" :style="{'background':`url(${item.iconUrl})`}">
+
+								</view>
+							</view>
+							<view class="app-item-text">
+								{{item.name}}
+							</view>
+						</view>
+					</view>
+				</view>
 			</view>
 		</view>
-
+		<uni-popup ref="message" type="dialog">
+			<uni-popup-dialog type="warn" cancelText="取消" confirmText="确定" content="确定退出当前账号?" @confirm="dialogConfirm"
+				@close="dialogClose"></uni-popup-dialog>
+		</uni-popup>
 	</view>
 </template>
 
@@ -27,42 +102,71 @@
 		mapActions
 	} from 'vuex';
 	export default {
-		components: {
-
-		},
+		components: {},
 		mounted() {
-			// this.getDataList({
-			// 	type: "NotOut"
-			// });
+			this.getHouseData();
 		},
 		computed: {
-			...mapState(['groundData'])
+			...mapState(['houseData', 'houseSelectData', 'userData'])
 		},
 		data() {
 			return {
 				listData: listData,
-				houseName: "一号仓库",
+				messageData: [{
+					text: '通知:您有新的出库单【出库单号】待确认,请注意及时确认。'
+				}, {
+					text: '通知:您有新的出库单【出库单号】待确认,请注意及时确认。'
+				}],
+				romDetData: [{
+						name: "待验收",
+						value: 23,
+					},
+					{
+						name: "待上架",
+						value: 23,
+					},
+					{
+						name: "待出库",
+						value: 23,
+					},
+					{
+						name: "待配送",
+						value: 23,
+					}
+				],
 				appData: [{
-						iconUrl: "../../static/shangjia.png",
-						name: "上架确认",
-						bgColor: "#6163AF",
+						iconUrl: "../../static/yanshou.svg",
+						name: "验收",
+						bgColor: "#F4CE98",
+						path: "/pages/groundetials/groundetials"
+					},
+					{
+						iconUrl: "../../static/shangjia.svg",
+						name: "上架",
+						bgColor: "#7DCEFF",
 						path: "/pages/grounding/grounding"
 					},
 					{
-						iconUrl: "../../static/jianhuo.png",
-						name: "出库拣货",
-						bgColor: "#3789EA",
-						path: "/pages/outbound/outbound"
+						iconUrl: "../../static/peisong.svg",
+						name: "配送",
+						bgColor: "#FFB298",
+						path: "/pages/grounding/grounding"
 					},
 					{
-						iconUrl: "../../static/pandian.png",
-						name: "库存盘点",
+						iconUrl: "../../static/jianhuo.svg",
+						name: "拣货",
 						bgColor: "#2CE4BF",
 						path: "/pages/Inventory/Inventory"
 					},
 					{
-						iconUrl: "../../static/jiansuo.png",
-						name: "商品检索",
+						iconUrl: "../../static/pandian.svg",
+						name: "盘点",
+						bgColor: "#2CE4BF",
+						path: "/pages/Inventory/Inventory"
+					},
+					{
+						iconUrl: "../../static/jiansuo.svg",
+						name: "检索",
 						bgColor: "#FFB867",
 						path: "/pages/query/query"
 					},
@@ -78,8 +182,40 @@
 		onLoad() {
 
 		},
+		mounted() {
+			this.getHouseData()
+		},
 		methods: {
-			...mapActions(['getGroundData']),
+			...mapActions(['getHouseData']),
+			...mapMutations(['setHouseName']),
+			//跳转页面
+			appView(item) {
+				uni.navigateTo({
+					url: item.path,
+					success: function(res) {}
+				});
+			},
+			//退出当前账号
+			dialogConfirm() {
+				uni.redirectTo({
+					url: '/pages/login/index',
+					success: function(res) {}
+				});
+				uni.removeStorageSync('token')
+			},
+			dialogClose() {
+				this.$refs.message.close();
+			},
+			//退出确认
+			loginOff() {
+				this.$refs.message.open();
+			},
+			onchange(e) {
+				this.setHouseName({
+					houseName: e.detail.value[0].text,
+					houseId: e.detail.value[0].value
+				})
+			},
 			//跳转更多页面
 			moreView() {
 				uni.navigateTo({
@@ -105,6 +241,7 @@
 		width: 100%;
 		height: 100%;
 		overflow-y: auto;
+		background-color: #F5F5F5;
 
 		.home-title {
 			width: 100%;
@@ -144,7 +281,7 @@
 				.rom-set {
 					width: 100%;
 					height: 50rpx;
-					display: flex;
+					display: flex;
 					align-items: center;
 
 					.park {
@@ -158,16 +295,220 @@
 						color: rgba(255, 255, 255, 0.9);
 						font-size: 36rpx;
 						text-align: left;
-						font-family: OPPOSans-medium;
-						margin-left:20rpx;
+						font-family: OPPOSans-medium;
+						margin-left: 20rpx;
+
+						.romtitle {
+							font-size: 36rpx;
+							font-family: OPPOSans-medium;
+						}
 					}
 
 					.down {
 						width: 40rpx;
 						height: 40rpx;
 						background: url('../../static/down.svg');
-						background-size: 100% 100%;
-						margin-left:20rpx;
+						background-size: 100% 100%;
+						margin-left: 20rpx;
+					}
+				}
+
+				.section-view {
+					width: 97%;
+					margin: 70rpx auto 40rpx auto;
+					height: 270rpx;
+					background-color: rgba(255, 255, 255, 1);
+					box-shadow: -2rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.4);
+					border-radius: 20rpx;
+					padding: 20rpx;
+					box-sizing: border-box;
+
+					.user-cont {
+						width: 100%;
+						height: 50rpx;
+
+						.user-spn {
+							color: rgba(0, 0, 0, 0.8);
+							font-size: 36rpx;
+							font-family: AlibabaPuHui-medium;
+						}
+
+						.spnr {
+							margin-left: 20rpx;
+							font-size: 35rpx;
+							font-family: AlibabaPuHui-medium;
+						}
+					}
+
+					.sec-data {
+						width: 100%;
+						height: 110rpx;
+						display: flex;
+						justify-content: space-around;
+						margin-top: 60rpx;
+
+						.sec-item {
+							width: 130rpx;
+							height: 100%;
+							display: flex;
+							flex-direction: column;
+							align-items: center;
+							justify-content: space-between;
+
+							.item-spn {
+								font-size: 32rpx;
+								font-family: PingFangSC-bold;
+							}
+
+							.spnVal {
+								color: rgba(7, 190, 167, 1);
+							}
+						}
+					}
+				}
+
+				.app-view {
+					width: 100%;
+					height: 200rpx;
+					display: flex;
+					justify-content: space-between;
+
+					.app-item {
+						width: 48%;
+						height: 100%;
+						border-radius: 16rpx;
+						background-color: rgba(255, 255, 255, 1);
+						border: 2rpx solid rgba(187, 187, 187, 0.5);
+						padding: 20rpx;
+						box-sizing: border-box;
+
+						.app-title {
+							font-size: 32rpx;
+							font-family: SourceHanSansSC-bold;
+							color: rgba(0, 0, 0, 1);
+						}
+
+						.app-item-mut {
+							width: 100%;
+							height: 120rpx;
+							display: flex;
+							justify-content: space-between;
+							align-items: center;
+
+							.app-item-spn {
+								color: rgba(154, 154, 154, 0.8);
+								font-size: 20rpx;
+								font-family: AlibabaPuHui-medium;
+								width: 140rpx;
+								height: 50rpx;
+							}
+
+							.app-item-img {
+								width: 140rpx;
+								height: 106.68rpx;
+								background: url('../../static/queryData.svg');
+								background-size: 100% 100%;
+							}
+						}
+					}
+				}
+
+				.message-view {
+					width: 100%;
+					height: 200rpx;
+					margin-top: 20rpx;
+					position: relative;
+					padding-top: 20rpx;
+
+					.all-message {
+						position: absolute;
+						right: 0rpx;
+						top: 5rpx;
+						width: 117rpx;
+						height: 20rpx;
+						color: rgba(1, 169, 146, 1);
+						font-size: 20rpx;
+						font-family: AlibabaPuHui-regular;
+						display: flex;
+						align-items: center;
+					}
+
+					.message-item {
+						margin-top: 20rpx;
+						width: 100%;
+						height: 50rpx;
+						border-radius: 25rpx;
+						display: flex;
+						justify-content: space-between;
+						align-items: center;
+						padding: 0 20rpx;
+						box-sizing: border-box;
+						color: rgba(0, 0, 0, 0.8);
+						font-size: 20rpx;
+						text-align: left;
+						font-family: AlibabaPuHui-regular;
+						background-color: rgba(255, 255, 255, 1);
+						box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.4);
+					}
+				}
+
+				.all-app {
+					width: 100%;
+
+					.all-title {
+						width: 100%;
+						height: 46rpx;
+						color: rgba(0, 0, 0, 0.8);
+						font-size: 32rpx;
+						text-align: left;
+						font-family: AlibabaPuHui-bold;
+					}
+
+					.all-app-view {
+						margin-top: 20rpx;
+						width: 100%;
+						height: auto;
+						background-color: #fff;
+						border-radius: 20rpx;
+						display: flex;
+						flex-wrap: wrap;
+						align-content: flex-start;
+						padding-bottom: 50rpx;
+
+						.app-view-item {
+							width: 24%;
+							margin-left: 7rpx;
+							height: 150rpx;
+							display: flex;
+							flex-direction: column;
+							align-items: center;
+							margin-top: 20rpx;
+							margin-bottom: 20rpx;
+							justify-content: space-between;
+
+							.app-item-img {
+								width: 102rpx;
+								height: 102rpx;
+								border-radius: 20rpx;
+								display: flex;
+								align-items: center;
+								justify-content: center;
+
+								.app-item-svg {
+									width: 80rpx;
+									height: 80rpx;
+								}
+							}
+
+							.app-item-text {
+								width: 100%;
+								height: 34rpx;
+								color: rgba(0, 0, 0, 0.8);
+								font-size: 28rpx;
+								text-align: center;
+								font-family: AlibabaPuHui-bold;
+							}
+						}
 					}
 				}
 			}

+ 12 - 2
pages/login/index.vue

@@ -13,6 +13,9 @@
 <script>
 	import loginPassword from '@/components/ay-login/login-password.vue';
 	import backImage from '@/static/home.png';
+	import {
+		mapActions
+	} from 'vuex';
 	export default {
 		components: {
 			loginPassword
@@ -26,12 +29,17 @@
 		onLoad() {
 
 		},
+		mounted() {
+
+		},
 		methods: {
+			...mapActions(['getUserData']),
 			loginFun(data) {
 				uni.navigateTo({
 					url: '/pages/home/home',
 					success: function(res) {}
-				});
+				});
+				let that=this;
 				this.$http('common.login', data, '登录中', true).then((res) => {
 					if (res.success == true) {
 						uni.setStorageSync('token', res.data.token);
@@ -41,7 +49,9 @@
 							success: function() {
 								uni.navigateTo({
 									url: '/pages/home/home',
-									success: function(res) {}
+									success: function(res) {
+										that.getUserData();
+									}
 								});
 							}
 						}, );

+ 14 - 8
request/api.js

@@ -8,11 +8,17 @@ export default {
 		},
 	},
 	home: {
-		getData: {
-			url: "/SPDapi/IN_STOCK_M",
+		//获取仓库数据
+		getRoomData: {
+			url: "/web/stroom/select",
 			auth: true,
 			method: "POST",
 		},
+		getUserData: {
+			url: "/web/lgin/getUserRoleInfo",
+			auth: true,
+			method: "GET",
+		},
 	},
 	//上架
 	groundDetails: {
@@ -41,12 +47,12 @@ export default {
 			url: "/SPDapi/OUT_STOCK_M_MX",
 			auth: true,
 			method: "POST",
-		},
-		//  获取明细数据
-		detailsContData:{
-			url: "/SPDapi/OUT_STOCK_D",
-			auth: true,
-			method: "POST",
+		},
+		//  获取明细数据
+		detailsContData: {
+			url: "/SPDapi/OUT_STOCK_D",
+			auth: true,
+			method: "POST",
 		}
 	}
 

+ 0 - 4
request/request.js

@@ -4,11 +4,7 @@ export default class Request {
 	constructor() {
 		// 默认配置
 		this.config = {
-<<<<<<< HEAD
 			baseUrl: baseurl,
-=======
-			baseUrl: '/web',
->>>>>>> master
 			header: {
 				'content-type': 'application/json;charset=UTF-8',
 				"Accept": "application/json;charset=UTF-8"

File diff suppressed because it is too large
+ 6 - 0
static/jianhuo.svg


File diff suppressed because it is too large
+ 6 - 0
static/jiansuo.svg


File diff suppressed because it is too large
+ 6 - 0
static/pandian.svg


File diff suppressed because it is too large
+ 6 - 0
static/peisong.svg


File diff suppressed because it is too large
+ 6 - 0
static/queryData.svg


File diff suppressed because it is too large
+ 6 - 0
static/shangjia.svg


File diff suppressed because it is too large
+ 6 - 0
static/yanshou.svg


+ 42 - 9
store/modules/home.js

@@ -1,23 +1,56 @@
 import http from '@/request/index.js';
 export const state = {
-	groundData: [], //查询待上架和已上架数据
+	houseData: [], //库房数据
+	houseSelectData: {
+		houseName: "",
+		houseId: ""
+	},
+	userData: {}
 };
 export const mutations = {
-	setGroundData(state, data) {
-		state.groundData = data
+	setHouseData(state, data) {
+		state.houseData = data
+	},
+	setHouseName(state, data) {
+		state.houseSelectData = data
+	},
+	setUserData(state, data) {
+		state.userData = data
 	},
 }
 export const actions = {
-	getGroundData({
+	getHouseData({
+		commit,
+		rootState
+	}, data) {
+		return new Promise((resolve, reject) => {
+			http('home.getRoomData', data, '加载中').then(res => {
+				if (res.success == true) {
+					res.data.length > 0 && res.data.forEach((item) => {
+						item['text'] = item.stroomName;
+						item['value'] = item.id;
+					})
+					commit('setHouseName', {
+						houseName: res.data[0].stroomName,
+						houseId: res.data[0].id
+					});
+					commit('setHouseData', res.data);
+				} else {
+					commit('setHouseData', []);
+				}
+			}).catch(e => {
+				reject(e)
+			})
+		})
+	},
+	getUserData({
 		commit,
 		rootState
 	}, data) {
 		return new Promise((resolve, reject) => {
-			http('home.getData', data, '加载中').then(res => {
-				if (res.code == "0" && res.success == "true") {
-					commit('setGroundData', res.data);
-				}else{
-					commit('setGroundData', []); 
+			http('home.getUserData', data, '加载中').then(res => {
+				if (res.success == true) {
+					commit('setUserData', res.data.userContext);
 				}
 			}).catch(e => {
 				reject(e)

+ 1 - 9
vue.config.js

@@ -3,21 +3,13 @@ const baseurl = require("./env.js");
 module.exports = {
 	devServer: {
 		proxy: {
-<<<<<<< HEAD
 			[baseurl]: {
 				target: 'http://192.168.0.246:8601',
 				changeOrigin: true,
 				pathRewrite: {
 					["^" + baseurl]: ""
-=======
-			'/web': {
-				target: 'http://192.168.0.246:8601',
-				changeOrigin: true,
-				pathRewrite: {
-					'^/web': '/'
->>>>>>> master
-				}
 			}
 		},
 	}
+},
 }