Browse Source

冰排加释冷中

AaronBruin 2 months ago
parent
commit
30594932d2

+ 1 - 1
manifest.json

@@ -3,7 +3,7 @@
     "appid" : "__UNI__49186F9",
     "description" : "",
     "versionName" : "1.2.0",
-    "versionCode" : 121,
+    "versionCode" : 124,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 3 - 0
pages/homePage.vue

@@ -201,6 +201,9 @@
 			if (token) {
 				if (userInfo) {
 					this.iceRaftManage = userInfo.dept.iceRaftManage
+					if(this.iceRaftManage){
+						this.content = '退出登录后将无法查看冰排、保温箱,重新登录后即可查看'
+					}
 					this.userInfo = userInfo
 				} else {
 					this.getUserInfo()

+ 57 - 9
pages/order/Incubator.vue

@@ -26,9 +26,14 @@
 		<view class="card_incubator" v-if="orderList.length > 0">
 			<view :class="iceColdFlag ? 'item_bator' : 'item_bator_cold'" v-for="(item,index) in orderList" :key="index"
 				@click.stop="selectIncubator(item)">
-				<view style="display: flex;align-items: center;margin-bottom: 10rpx;">
-					<span class="iconfont icon-incubator" :class="iceColdFlag ? 'imagebwx' : 'imagebwx_cold'"></span>
-					<view>{{item.name}}</view>
+				<view class="space_between">
+					<view style="display: flex;align-items: center;margin-bottom: 10rpx;">
+						<span class="iconfont icon-incubator"
+							:class="iceColdFlag ? 'imagebwx' : 'imagebwx_cold'"></span>
+						<view>{{item.name}}</view>
+					</view>
+					<view class="card_precooling" :style="{color: filterColor(item.useStatus)}">
+						{{matchingType(item.useStatus)}}</view>
 				</view>
 				<view class="floe_card" v-if="item.ice_raft.length > 0 && iceColdFlag">
 					<view class="card_ice_list">
@@ -55,14 +60,13 @@
 					</view>
 					<view class="card_ice_list"></view>
 				</view>
-				<view class="btn_printil markd10">
+				<view class="btn_printil markd10" v-if="detailsFlag">
 					<view style="flex: 1;margin-right: 10rpx;"
 						v-if="item.ice_raft.length > 0 && getIceState(item.ice_raft)"
 						@click.stop="endCooling(item.ice_raft)">
 						<u-button size="small" type="warning" text="结束释冷"></u-button>
 					</view>
-					<view style="flex: 1;" v-if="item.useStatus && item.useStatus == '1'"
-						@click.stop="endOfUseil(item)">
+					<view style="flex: 1;" v-if="item.useStatus && item.useStatus == 2" @click.stop="endOfUseil(item)">
 						<u-button size="small" type="error" text="结束使用"></u-button>
 					</view>
 				</view>
@@ -106,6 +110,15 @@
 				selectedList: [],
 				isCoolerInfo: {},
 				searchShow: true,
+				usageStatus: [{
+					bgcolor: '#2979ff',
+					label: '预冷中',
+					value: 1,
+				}, {
+					bgcolor: '#67C23A',
+					label: '使用中',
+					value: 2,
+				}]
 			}
 		},
 		onReachBottom() {
@@ -120,7 +133,6 @@
 		},
 		mounted() {
 			var userInfo = this.$cache.getCache('userInfo')
-			console.log(userInfo, 356)
 			this.isCoolerInfo = userInfo.dept
 			this.getIncubator()
 		},
@@ -154,7 +166,6 @@
 						this.Total = res.data.count
 						if (this.loadingMore == true && data) {
 							this.orderList = this.orderList.concat(data);
-							// console.log(this.orderList, 245)
 						}
 						this.getRecord()
 						if (data.length < this.pageSize) {
@@ -173,7 +184,6 @@
 			},
 			// 保温箱预冷
 			coolingRelease() {
-				console.log(this.selectedList, 24)
 				if (this.selectedList.length > 0) {
 					let arrID = this.selectedList.map(item => item.toString())
 					this.$api.post('/api/cooler-box/coolerboxstarttime', {
@@ -181,6 +191,13 @@
 					}).then(res => {
 						if (res.code == 200) {
 							uni.$u.toast('操作成功')
+							this.searchChange()
+							this.orderList.forEach(item => {
+								item.whetherFlag = false
+							})
+							this.selectedList = []
+						} else {
+							uni.$u.toast(res.msg)
 						}
 					})
 				} else {
@@ -319,6 +336,31 @@
 					return ''
 				}
 			},
+			matchingType(type) {
+				let list = this.usageStatus
+				let name = ''
+				if (list) {
+					list.forEach(item => {
+						if (type === item.value) {
+							name = item.label
+						}
+					})
+				}
+				return name
+			},
+			// tag颜色获取
+			filterColor(type) {
+				let list = this.usageStatus
+				let color = ''
+				if (list) {
+					list.forEach(item => {
+						if (type === item.value) {
+							color = item.bgcolor
+						}
+					})
+				}
+				return color
+			},
 			navbarHeight() {
 				let systemInfo = uni.getSystemInfoSync();
 				/* (750 / systemInfo.windowWidth) */
@@ -537,4 +579,10 @@
 		padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
 		padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
 	}
+
+	.card_precooling {
+		color: #19be6b;
+		font-size: 30rpx;
+		flex: none;
+	}
 </style>

+ 6 - 2
pages/order/addIceRaft.vue

@@ -25,7 +25,9 @@
 					status: '正常',
 					freezeClaim: [],
 					suitableForCold: null,
+					forColdTime: null,
 					iceColdAddress: '',
+					sort: null,
 				},
 				rules: {
 					code: [{
@@ -84,7 +86,7 @@
 						},
 						trigger: ['blur', 'change']
 					}],
-					coolingRequirement: [{
+					forColdTime: [{
 						required: false,
 						message: '请输入释冷要求',
 						trigger: ['blur', 'change']
@@ -138,7 +140,7 @@
 				this.list = iceRaftRulesil()
 			} else {
 				var arrIce = iceRaftRulesil()
-				this.list = removePointById(arrIce, ['suitableForCold', 'iceColdAddress'])
+				this.list = removePointById(arrIce, ['suitableForCold', 'forColdTime', 'iceColdAddress'])
 			}
 
 			function removePointById(arr1, arr2) {
@@ -186,8 +188,10 @@
 						label: this.recipientsModel.label,
 						freezeClaim: this.recipientsModel.freezeClaim,
 						iceColdAddress: this.recipientsModel.iceColdAddress,
+						forColdTime:  Number(this.recipientsModel.forColdTime),
 						suitableForCold: Number(this.recipientsModel.suitableForCold),
 						status: null,
+						sort: Number(this.recipientsModel.sort),
 					}
 					if (this.recipientsModel.status == '正常') {
 						params.status = '2'

+ 89 - 16
pages/order/freezer.vue

@@ -11,18 +11,23 @@
 				</view>
 			</view>
 			<view class="card_tab_freezer">
-				<view :style="{width:isIceInfo.isIceReleaseCold ? '50%':'100%'}">
-					<u-subsection :list="iceStateList" :current="current" @change="sectionChange"></u-subsection>
+				<view :style="{width:isIceInfo.isIceReleaseCold ? '260px':'100%'}">
+					<view class="card_subsection">
+						<view :class="item.id == current ? 'activate_subsection' : 'item_subsection'"
+							v-for="(item,index) in iceStateList" :key="index" @click="sectionChange(item)">
+							{{item.title}}
+						</view>
+					</view>
 				</view>
 				<view class="select_freezer" v-if="isIceInfo.isIceReleaseCold">
-					<view style="display: flex;align-items: center;margin-right: 10rpx;">
-						<view class="title_num blue_color">总数:{{Total}}</view>
-						<view class="title_num green_color">已选:{{selectedList.length}}</view>
-					</view>
 					<view style="display: flex;align-items: center;">
 						<view class="select_title blue_color" @click="checkAll">全选</view>
 						<view class="select_title orange_color" @click="Inverse">反选</view>
 					</view>
+					<view style="display: flex;align-items: center;margin-bottom: 10rpx;">
+						<view class="title_num blue_color">总数:{{Total}}</view>
+						<view class="title_num green_color">已选:{{selectedList.length}}</view>
+					</view>
 				</view>
 			</view>
 		</u-sticky>
@@ -30,7 +35,7 @@
 			<view class="card_item_iceraft" v-for="(item,index) in list" :key="index" @click="choiceIce(item)">
 				<view class="top_title space_between">
 					<view class="title_Icecode">编号: {{item.code}}</view>
-					<view :style="{color: filterColor(item.iceRaftRecord.status)}">
+					<view style="font-size: 30rpx;" :style="{color: filterColor(item.iceRaftRecord.status)}">
 						{{matchingType(item.iceRaftRecord.status)}}
 					</view>
 				</view>
@@ -80,16 +85,43 @@
 				headline: '',
 				list: [],
 				typeList: [{
-					bgcolor: '#fa3534',
+					bgcolor: '#2979ff',
 					label: '冷冻中',
 					value: '1',
 				}, {
-					bgcolor: '#67C23A',
+					bgcolor: '#19be6b',
 					label: '待使用',
 					value: '2',
+				}, {
+					bgcolor: '#ff9900',
+					label: '释冷中',
+					value: '5',
 				}],
 				iceState: null,
-				iceStateList: ['全部', '冷冻中', '待使用'],
+				iceStateList: [],
+				icelist: [{
+					id: 0,
+					title: '全部',
+				}, {
+					id: 1,
+					title: '冷冻中',
+				}, {
+					id: 2,
+					title: '待使用',
+				}],
+				icelistil: [{
+					id: 0,
+					title: '全部',
+				}, {
+					id: 1,
+					title: '冷冻中',
+				}, {
+					id: 2,
+					title: '待使用',
+				}, {
+					id: 5,
+					title: '释冷中',
+				}],
 				current: 0,
 				PageIndex: 1,
 				PageSize: 15,
@@ -116,6 +148,11 @@
 		mounted() {
 			var userInfo = this.$cache.getCache('userInfo')
 			this.isIceInfo = userInfo.dept
+			if (this.isIceInfo.isIceReleaseCold) {
+				this.iceStateList = this.icelistil
+			} else {
+				this.iceStateList = this.icelist
+			}
 			this.getIceraftList()
 		},
 		methods: {
@@ -227,7 +264,13 @@
 							this.PageIndex = 1
 							this.loadingMore = true
 							this.list = []
+							this.list.forEach(item => {
+								item.whetherFlag = false
+							})
+							this.selectedList = []
 							this.getIceraftList()
+						} else {
+							uni.$u.toast(res.msg)
 						}
 					})
 				} else {
@@ -297,12 +340,12 @@
 				})
 				return arrList.toString()
 			},
-			sectionChange(index) {
-				this.current = index
-				if (index == 0) {
+			sectionChange(event) {
+				this.current = event.id
+				if (event.id == 0) {
 					this.iceState = null
 				} else {
-					this.iceState = String(index)
+					this.iceState = String(event.id)
 				}
 				this.searchChange()
 			},
@@ -344,7 +387,7 @@
 	.select_freezer {
 		display: flex;
 		align-items: flex-end;
-		// flex-direction: column;
+		flex-direction: column;
 	}
 
 	.title_num {
@@ -450,8 +493,38 @@
 		border-top: 1rpx solid #E4E7ED;
 	}
 
-	.env_padding {
+	c .env_padding {
 		padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
 		padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
 	}
+
+	.card_subsection {
+		display: flex;
+		align-items: center;
+		background-color: rgb(238, 238, 239);
+		padding: 8rpx;
+		border-radius: 6rpx;
+	}
+
+	.item_subsection {
+		flex: 1;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		font-size: 24rpx;
+		padding: 10rpx 0rpx;
+	}
+
+	.activate_subsection {
+		flex: 1;
+		display: flex;
+		padding: 10rpx 0rpx;
+		border-radius: 6rpx;
+		justify-content: center;
+		align-items: center;
+		font-size: 24rpx;
+		font-weight: bold;
+		background-color: #fff;
+		color: #2979ff;
+	}
 </style>

+ 11 - 1
pages/order/iceRaft.vue

@@ -128,12 +128,22 @@
 					status: value.status,
 					freezeClaim: value.freezeClaim,
 					suitableForCold: value.suitableForCold,
+					forColdTime: String(value.forColdTime),
 					iceColdAddress: value.iceColdAddress,
+					sort: value.sort,
+				}
+				if (!arr.suitableForCold) {
+					arr.suitableForCold = ''
+				}
+				if (arr.forColdTime == '0') {
+					arr.forColdTime = ''
+				}
+				if (!arr.sort) {
+					arr.sort = ''
 				}
 				uni.navigateTo({
 					url: '/pages/order/addIceRaft?list=' + JSON.stringify(arr)
 				});
-				console.log(value, '详情')
 			},
 			// 冷冻要求
 			getFreeze(event) {

+ 1 - 1
pages/order/waybill.js

@@ -147,7 +147,7 @@ export const iceRaftRulesil = () => {
 		required: false,
 		unit: '℃',
 	}, {
-		field: 'coolingRequirement',
+		field: 'forColdTime',
 		label: '释冷要求',
 		placeholder: '请输入释冷要求',
 		type: 'input',