Prechádzať zdrojové kódy

添加运输反馈数量标识

wangchao 3 rokov pred
rodič
commit
3d484be8be
1 zmenil súbory, kde vykonal 62 pridanie a 13 odobranie
  1. 62 13
      pages/erp/index.vue

+ 62 - 13
pages/erp/index.vue

@@ -39,10 +39,12 @@
 			<view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']" v-if="isShowBtn">
 				<view class="cu-item" v-for="(item,index) in gridList1" :key="index" @click="gridClick(item, index)"
 					v-if="index<gridCol*2">
-					<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
+					<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]" class="ys-item">
+						<view class="ys-number" v-if="index==0&&ysSNumber!=0||index==1&&ysFNumber!=0">
+							{{index==0?ysSNumber:ysFNumber}}
+						</view>
 						<image :src="item.src" class="sign"></image>
 					</view>
-
 					<text>{{item.name}}</text>
 				</view>
 			</view>
@@ -67,6 +69,8 @@
 		},
 		data() {
 			return {
+				ysSNumber: '',
+				ysFNumber: '',
 				isShowAlert1: false,
 				content1: '您尚未登录,是否立即登录?',
 				show0: false,
@@ -209,7 +213,6 @@
 		},
 		onShow() {
 			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
-				console.log("checkSession", res)
 				if (res.data.data == "INVALID") {
 					this.isShowAlert1 = true;
 					// uni.showModal({
@@ -243,6 +246,27 @@
 					this.init(res.data.data[0].compId)
 				}
 			})
+			// 发货执行中
+			this.$api.doRequest('get', '/tranProcessInfo/selectTranProcessInfo', {
+				feedbackFlag: 1,
+				currentPage: 1,
+				pageSize: 1
+			}).then(res => {
+				if (res.data.code == 200) {
+
+					this.ysFNumber = res.data.data.total
+				}
+			})
+			// 收货执行中
+			this.$api.doRequest('get', '/tranProcessInfo/selectTranProcessInfo', {
+				feedbackFlag: 4,
+				currentPage: 1,
+				pageSize: 1
+			}).then(res => {
+				if (res.data.code == 200) {
+					this.ysSNumber = res.data.data.total
+				}
+			})
 		},
 		methods: {
 
@@ -323,16 +347,14 @@
 				this.init(this.compList[e[0]].compId)
 			},
 			init(compId) {
-				console.log(this.userInfo)
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelfApp', {
 					compId: compId,
 				}).then(res => {
 					if (res.data.data.length != 0) {
-						console.log('res', res.data.data)
 						let _showData = uni.getStorageSync("erpSelectWarehous")
 						let _showCWData = uni.getStorageSync("erpSelectWarehousCW")
 						this.allWarehouse = res.data.data
-						this.warehouseList = res.data.data;
+						this.warehouseList = res.data.data
 						this.isShowBtn = true
 						if (_showData) {
 							this.warehouseName = _showData.warehouseName
@@ -350,11 +372,14 @@
 							this.warehouseList = res.data.data;
 							this.compId = res.data.data[0].compId
 							this.agent = res.data.data[0].agent
-							this.binNumber = res.data.data[0].positionInfos[0].binNumber
 							this.warehouseCWList = res.data.data[0].positionInfos
+							this.binNumber = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
+								.binNumber : '暂无'
 							this.warehouseId = res.data.data[0].id
-							this.baseId = res.data.data[0].positionInfos[0].baseId
-							this.positionId = res.data.data[0].positionInfos[0].id
+							this.baseId = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
+								.baseId : ''
+							this.positionId = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
+								.id : ''
 							this.personCharge = res.data.data[0].personCharge
 						}
 
@@ -379,10 +404,10 @@
 				this.warehouseCWchange([0])
 			},
 			warehouseCWchange(e) {
-				this.binNumber = this.warehouseCWList[e[0]].binNumber
-				this.baseId = this.warehouseCWList[e[0]].baseId
-				this.positionId = this.warehouseCWList[e[0]].id
-				uni.setStorageSync('erpSelectWarehousCW', this.warehouseCWList[e[0]])
+				this.binNumber = this.warehouseCWList ? this.warehouseCWList[e[0]].binNumber : '暂无'
+				this.baseId = this.warehouseCWList ? this.warehouseCWList[e[0]].baseId : ''
+				this.positionId = this.warehouseCWList ? this.warehouseCWList[e[0]].id : ''
+				uni.setStorageSync('erpSelectWarehousCW', this.warehouseCWList ? this.warehouseCWList[e[0]] : '')
 			}
 
 		}
@@ -510,4 +535,28 @@
 		background: red;
 		color: red;
 	}
+
+	.ys-item {
+		position: relative;
+
+		.ys-number {
+			color: #fff;
+			border: 1px solid #fff;
+			background-color: #FF6600;
+			display: inline-block;
+			padding: .25em .25em;
+			position: absolute;
+			font-size: 9px;
+			font-weight: 700;
+			line-height: 1;
+			text-align: center;
+			white-space: nowrap;
+			vertical-align: top;
+			right: 20px;
+			top: -5px;
+			z-index: 2;
+			border-radius: 50%;
+			width: 40rpx;
+		}
+	}
 </style>