AaronBruin 6 hours ago
parent
commit
9dc15638c8

+ 6 - 6
.env.js

@@ -1,10 +1,10 @@
 const UNI_APP = {
-	// APP_DEV_URL: 'https://colddelivery.coldbaozhida.com/cold_delivery',
-	// APP_PROD_URL: 'https://colddelivery.coldbaozhida.com/cold_delivery',
-	// APP_LINK_URL: 'https://colddelivery.coldbaozhida.com',
-	APP_DEV_URL: 'http://colddeliverytest.coldbaozhida.com:9090/cold_delivery', //测试
-	APP_PROD_URL: 'http://colddeliverytest.coldbaozhida.com:9090/cold_delivery', //测试
-	APP_LINK_URL: 'http://colddeliverytest.coldbaozhida.com:9090/cold_delivery', //测试
+	APP_DEV_URL: 'https://colddelivery.coldbaozhida.com/cold_delivery',
+	APP_PROD_URL: 'https://colddelivery.coldbaozhida.com/cold_delivery',
+	APP_LINK_URL: 'https://colddelivery.coldbaozhida.com',
+	// APP_DEV_URL: 'http://colddeliverytest.coldbaozhida.com:9090/cold_delivery', //测试
+	// APP_PROD_URL: 'http://colddeliverytest.coldbaozhida.com:9090/cold_delivery', //测试
+	// APP_LINK_URL: 'http://colddeliverytest.coldbaozhida.com:9090/cold_delivery', //测试
 	// APP_DEV_URL: 'http://192.168.11.15:6280', //本地
 	// APP_PROD_URL: 'http://192.168.11.15:6280', //本地
 	// APP_LINK_URL: 'http://192.168.11.15:6280', //本地

+ 1 - 1
App.vue

@@ -2,7 +2,7 @@
 	import {
 		checkUpdateApp
 	} from './common/downApp.js';
-	// 冷链送药移动端
+	// 冷链送药移动端-冰排
 	export default {
 		onLaunch: function() {
 			// console.log('App Launch')

+ 5 - 1
components/x-form.vue

@@ -337,7 +337,11 @@
 			sweep(field, flag) {
 				if (flag) {
 					if (!this.addloading && field == "drugBarCode") {
-						this.$emit('getSweep', this.model[field])
+						if (this.model[field]) {
+							this.$emit('getSweep', this.model[field])
+						} else {
+							uni.$u.toast('请先输入药品条形码')
+						}
 					}
 				} else {
 					// 允许从相机和相册扫码

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "冷链送药",
     "appid" : "__UNI__49186F9",
     "description" : "",
-    "versionName" : "1.2.3",
-    "versionCode" : 126,
+    "versionName" : "1.2.5",
+    "versionCode" : 200,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 1 - 0
pages/homePage.vue

@@ -3,6 +3,7 @@
 		<u-navbar placeholder bgColor="#a9e3f1" leftIcon="" @rightClick="rightClick">
 			<view class="u-nav-slot" slot="left">
 				<view v-if="userInfo.dept">{{userInfo.dept.appName}}<span v-if="userInfo.dept.appName">-</span></view>智慧冰排管理系统
+				<!-- <view v-if="userInfo.dept">{{userInfo.dept.appName}}<span v-if="userInfo.dept.appName">-</span></view>美克医疗-智慧冰排管理系统 -->
 			</view>
 			<view class="u-nav-slot" slot="right">
 				<u-icon name="list-dot" size="30" color="#fff"></u-icon>

+ 1 - 0
pages/login.vue

@@ -6,6 +6,7 @@
 			<view class="card_head_logo">
 				<image class="mine_image" src="../static/logo.png" mode=""></image>
 				<view class="welcome_title">欢迎登录智配送App</view>
+				<!-- <view class="welcome_title">欢迎登录美克医疗-智配送App</view> -->
 			</view>
 			<u--form labelPosition="left" :model="formList" :rules="rules" ref="uForm">
 				<u-form-item label="账号" prop="username" labelWidth="50" borderBottom ref="item1">

+ 8 - 2
pages/order/addAddress.vue

@@ -30,11 +30,17 @@
 						message: '请输入姓名',
 						trigger: ['blur', 'change']
 					},
-					phone: {
+					phone: [{
 						required: true,
 						message: '请输入电话',
 						trigger: ['blur', 'change']
-					},
+					}, {
+						validator: (rule, value, callback) => {
+							return uni.$u.test.mobile(value);
+						},
+						message: '请输入正确手机号码',
+						trigger: ['change', 'blur'],
+					}],
 					address: {
 						required: true,
 						message: '请输入地址',

+ 1 - 1
pages/order/addIceRaft.vue

@@ -175,7 +175,7 @@
 						freezeClaim: this.recipientsModel.freezeClaim,
 						iceColdAddress: this.recipientsModel.iceColdAddress,
 						forColdTime: Number(this.recipientsModel.forColdTime),
-						suitableForCold: Number(this.recipientsModel.suitableForCold),
+						suitableForCold: this.recipientsModel.suitableForCold,
 						status: null,
 						sort: Number(this.recipientsModel.sort),
 					}

+ 8 - 2
pages/order/addWaybill.vue

@@ -87,11 +87,17 @@
 						message: '请输入姓名',
 						trigger: ['blur', 'change']
 					},
-					phone: {
+					phone: [{
 						required: true,
 						message: '请输入电话',
 						trigger: ['blur', 'change']
-					},
+					}, {
+						validator: (rule, value, callback) => {
+							return uni.$u.test.mobile(value);
+						},
+						message: '请输入正确手机号码',
+						trigger: ['change', 'blur'],
+					}],
 					address: {
 						required: true,
 						message: '请输入地址',

+ 177 - 33
pages/order/delivery.vue

@@ -58,6 +58,18 @@
 					<view class="title_nape">删除</view>
 				</view> -->
 			</view>
+			<view class="box_serial_number" v-if="iceRaftData.length > 0">
+				<view class="card_frequency_title">选择冰排</view>
+				<view class="card_ice_code">
+					<view class="item_coding" v-for="(item,index) in iceRaftData" :key="index" @click="selectIce(item)">
+						<view style="display: flex;align-items: center;">
+							<span class="iconfont icon-bingpaiguanli iceIcon"></span>
+							<view class="title_coding">{{item.value}}</view>
+						</view>
+						<view class="checked" v-if="item.flag"></view>
+					</view>
+				</view>
+			</view>
 			<view class="card_frequency">
 				<view class="card_high space_between">
 					<view class="card_frequency_title">已录入冰排编号</view>
@@ -65,7 +77,10 @@
 				</view>
 				<view style="width: 100%;" v-if="list.length > 0">
 					<view class="item_coding" v-for="(item,index) in list" :key="index">
-						<view class="title_coding">{{item}}</view>
+						<view style="display: flex;align-items: center;">
+							<span class="iconfont icon-bingpaiguanli iceIcon"></span>
+							<view class="title_coding">{{item}}</view>
+						</view>
 						<u-icon name="close-circle-fill" color="#c0c4cc" size="20"
 							@click="removeWaybill(item)"></u-icon>
 					</view>
@@ -109,6 +124,8 @@
 				title: '是否继续出库?',
 				content: '',
 				userInfo: {},
+
+				iceRaftData: []
 			}
 		},
 		onUnload() {
@@ -120,6 +137,7 @@
 			this.selectiveType = receive.id
 			if (receive.id == 'enter') {
 				this.typeFlag = true
+				this.getNotStoredIce()
 			} else {
 				this.typeFlag = false
 			}
@@ -130,6 +148,8 @@
 				if (incubator.id != this.incubator.id) {
 					this.incubator.id = incubator.id
 					this.incubator.name = incubator.name
+					this.list = []
+					this.getAvailable(incubator.id)
 				}
 			}
 			let freezer = uni.getStorageSync('freezerValue')
@@ -143,6 +163,42 @@
 			this.userInfo = userInfo
 		},
 		methods: {
+			// 获取未入库冰排
+			getNotStoredIce() {
+				this.$api.get('/api/ice-raft/GetCoolerIceRaft').then(res => {
+					if (res.code == 200) {
+						let iceArr = res.data
+						let iceData = []
+						iceArr.forEach(item => {
+							let arrValue = {
+								flag: false,
+								value: item.code
+							}
+							iceData.push(arrValue)
+						})
+						this.iceRaftData = iceData
+					}
+				})
+			},
+			// 获取保温箱可使用冰排
+			getAvailable(id) {
+				this.$api.post('/api/ice-raft/GetCoolerBoxBindCieRaft', {
+					id: String(id),
+				}).then(res => {
+					if (res.code == 200) {
+						let iceArr = res.data
+						let iceData = []
+						iceArr.forEach(item => {
+							let arrValue = {
+								flag: false,
+								value: item
+							}
+							iceData.push(arrValue)
+						})
+						this.iceRaftData = iceData
+					}
+				})
+			},
 			focus(flag) {
 				this.typeFlag = flag
 				if (flag) {
@@ -167,34 +223,44 @@
 					});
 					if (this.typeFlag) {
 						// 入库
-						this.$api.post('/api/ice-raft/in-storage', {
-							code: this.list,
-							iceLockerId: this.coldCupboard.id,
-							freezeClaim: Number(this.freezingDuration),
-						}).then(res => {
-							if (res.code == 200) {
-								this.list = []
-								this.freezingDuration = ''
-								this.frequencyCoding = ''
-								this.coldCupboard.id = null
-								this.coldCupboard.name = ''
-								uni.showToast({
-									icon: 'none',
-									title: res.msg,
-									duration: 3000
-								});
-							} else {
-								uni.showToast({
-									icon: 'none',
-									title: res.msg,
-									duration: 3000
-								});
-							}
+						if (this.coldCupboard.id) {
+							this.$api.post('/api/ice-raft/in-storage', {
+								code: this.list,
+								iceLockerId: this.coldCupboard.id,
+								freezeClaim: Number(this.freezingDuration),
+							}).then(res => {
+								if (res.code == 200) {
+									this.list = []
+									this.freezingDuration = ''
+									this.frequencyCoding = ''
+									this.coldCupboard.id = null
+									this.coldCupboard.name = ''
+									uni.showToast({
+										icon: 'none',
+										title: res.msg,
+										duration: 3000
+									});
+									this.getNotStoredIce()
+								} else {
+									uni.showToast({
+										icon: 'none',
+										title: res.msg,
+										duration: 3000
+									});
+								}
+								this.loading = false
+								this.getIncubator()
+							}).catch(() => {
+								uni.hideLoading();
+							})
+						} else {
 							this.loading = false
-							this.getIncubator()
-						}).catch(() => {
-							uni.hideLoading();
-						})
+							uni.showToast({
+								icon: 'none',
+								title: '请选择入库冷冻柜',
+								duration: 3000
+							});
+						}
 					} else {
 						this.loading = false
 						this.$api.post('/api/ice-raft/isoutstorage', {
@@ -246,8 +312,10 @@
 						this.list = []
 						// this.suitableForCold = null
 						this.frequencyCoding = ''
-						this.incubator.id = null
-						this.incubator.name = ''
+						// this.incubator.id = null
+						// this.incubator.name = ''
+						this.list = []
+						this.getAvailable(this.incubator.id)
 						uni.showToast({
 							icon: 'none',
 							title: res.msg,
@@ -296,7 +364,7 @@
 					// scanType: ['qrCode'],
 					autoZoom: false,
 					success: (res) => {
-						console.log(res);
+						// console.log(res);
 						if (res.result) {
 							let url = res.result;
 							this.frequencyCoding = url
@@ -334,6 +402,9 @@
 							this.list.push(this.frequencyCoding)
 							this.list = this.uniqueArray(this.list)
 							this.frequencyCoding = ''
+							this.iceRaftData.forEach(item => {
+								item.flag = this.list.includes(item.value)
+							})
 						} else {
 							uni.showToast({
 								icon: 'none',
@@ -344,6 +415,22 @@
 					})
 				}
 			},
+			// 选择冰排
+			selectIce(value) {
+				this.iceRaftData.forEach(item => {
+					if (item.value == value.value) {
+						if (item.flag) {
+							item.flag = false
+							let arr = this.list.filter(item1 => item1 !== value.value);
+							this.list = arr
+						} else {
+							item.flag = true
+							this.list.push(item.value)
+							this.list = this.uniqueArray(this.list)
+						}
+					}
+				})
+			},
 			// 去重
 			uniqueArray(arr) {
 				return [...new Set(arr)];
@@ -359,6 +446,10 @@
 				function deleteElementById(arr, key) {
 					return arr.filter((item) => item !== key);
 				}
+
+				this.iceRaftData.forEach(item => {
+					item.flag = this.list.includes(item.value)
+				})
 			},
 		}
 	}
@@ -433,6 +524,21 @@
 		margin-top: 20rpx;
 	}
 
+	.box_serial_number {
+		display: flex;
+		flex-direction: column;
+	}
+
+	.card_ice_code {
+		padding: 10rpx 0rpx;
+		max-height: 25vh;
+		overflow-y: auto;
+	}
+
+	.item_code_box {
+		padding: 10rpx 0rpx;
+	}
+
 	.card_frequency {
 		display: flex;
 		flex-wrap: wrap;
@@ -447,6 +553,8 @@
 
 		span {
 			color: red;
+			margin-left: 5rpx;
+			font-size: 32rpx;
 		}
 	}
 
@@ -455,15 +563,51 @@
 		justify-content: space-between;
 		align-items: center;
 		width: 100%;
-		margin-top: 10px;
+		// margin-top: 10px;
 		padding: 25rpx 0rpx;
-		border-bottom: 2rpx solid #dfdfdf;
+		border-bottom: 2rpx solid #E4E7ED;
+	}
+
+	.iceIcon {
+		color: #19be6b;
+		margin-right: 10rpx;
+		font-size: 36rpx;
 	}
 
 	.title_coding {
 		font-size: 30rpx;
 	}
 
+	.checked {
+		position: relative;
+		width: 40rpx;
+		height: 40rpx;
+	}
+
+	.checked::after {
+		content: "";
+		background-color: #19be6b;
+		width: 20rpx;
+		height: 4rpx;
+		position: absolute;
+		top: 30rpx;
+		left: 0rpx;
+		transform: rotate(30deg);
+		border-radius: 8rpx;
+	}
+
+	.checked::before {
+		content: "";
+		background-color: #19be6b;
+		width: 30rpx;
+		height: 4rpx;
+		position: absolute;
+		top: 22rpx;
+		left: 12rpx;
+		transform: rotate(-50deg);
+		border-radius: 8rpx;
+	}
+
 	.card_empty {
 		width: 100%;
 		margin-top: 50rpx;

+ 29 - 29
pages/order/dispatching.vue

@@ -180,35 +180,35 @@
 			// 确定
 			confirm() {
 				if (this.userInfo.dept) {
-					if (!this.userInfo.dept.isOutStorage) {
-						const arr = []
-						arr.push(this.waybillId)
-						this.$api.post('/api/waybill/delivery', {
-							waybillIds: arr,
-							deliveryId: Number(this.deliveryId),
-							coolerBoxId: this.incubator.id,
-							iceRaftCode: this.iceList,
-							tamperProofLabel: this.goodsModel.tamperProofLabel,
-							tamperProofLabelImg: this.goodsModel.tamperProofLabelImg,
-							status: 4,
-						}).then(res => {
-							if (res.code == 200) {
-								uni.$u.toast('操作成功')
-								uni.$emit('send', '成功');
-								uni.navigateBack({
-									delta: 1
-								});
-							} else if (res.code == 2000) {
-								let arrTitle = res.data
-								let title = ' ,请将冰排' + arrTitle.toString() + '重新入库'
-								uni.$u.toast(res.msg + title)
-							} else {
-								uni.$u.toast(res.msg)
-							}
-						})
-					} else {
-						uni.$u.toast('冰排暂未到达冷冻要求')
-					}
+					// if (!this.userInfo.dept.isOutStorage) {
+					const arr = []
+					arr.push(this.waybillId)
+					this.$api.post('/api/waybill/delivery', {
+						waybillIds: arr,
+						deliveryId: Number(this.deliveryId),
+						coolerBoxId: this.incubator.id,
+						iceRaftCode: this.iceList,
+						tamperProofLabel: this.goodsModel.tamperProofLabel,
+						tamperProofLabelImg: this.goodsModel.tamperProofLabelImg,
+						status: 4,
+					}).then(res => {
+						if (res.code == 200) {
+							uni.$u.toast('操作成功')
+							uni.$emit('send', '成功');
+							uni.navigateBack({
+								delta: 1
+							});
+						} else if (res.code == 2000) {
+							let arrTitle = res.data
+							let title = ' ,请将冰排' + arrTitle.toString() + '重新入库'
+							uni.$u.toast(res.msg + title)
+						} else {
+							uni.$u.toast(res.msg)
+						}
+					})
+					// } else {
+					// 	uni.$u.toast('冰排暂未到达冷冻要求')
+					// }
 				} else {
 					uni.$u.toast('当前账户无公司信息')
 				}

+ 14 - 2
pages/order/distributionOrder.vue

@@ -39,11 +39,17 @@
 						message: '请输入姓名',
 						trigger: ['blur', 'change']
 					},
-					phone: {
+					phone: [{
 						required: true,
 						message: '请输入电话',
 						trigger: ['blur', 'change']
-					},
+					}, {
+						validator: (rule, value, callback) => {
+							return uni.$u.test.mobile(value);
+						},
+						message: '请输入正确手机号码',
+						trigger: ['change', 'blur'],
+					}],
 					address: {
 						required: false,
 						message: '请输入地址',
@@ -104,6 +110,9 @@
 							waybillNo: this.waybillNo,
 							prescription: this.goodsModel.prescription,
 						}
+						uni.showLoading({
+							mask: true
+						});
 						this.$api.post('/api/waybill/assignment', params).then(res => {
 							if (res.code == 200) {
 								if (this.allocationSuccess) {
@@ -117,7 +126,10 @@
 										delta: 2
 									});
 								}
+							} else {
+								uni.$u.toast(res.msg)
 							}
+							uni.hideLoading();
 						})
 					} else {
 						uni.$u.toast('请扫描分配药品条形码')