Ver Fonte

最新版本1.1.9

AaronBruin há 4 meses atrás
pai
commit
e5a8a8ce26

+ 9 - 6
.env.js

@@ -1,10 +1,13 @@
 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://182.43.247.65:6280', //测试
-	APP_PROD_URL: 'http://182.43.247.65:6280', //测试
-	APP_LINK_URL: 'http://182.43.247.65:6280', //测试
+	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://182.43.247.65:6280', //测试
+	// APP_PROD_URL: 'http://182.43.247.65:6280', //测试
+	// APP_LINK_URL: 'http://182.43.247.65:6280', //测试
+	// 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', //本地
 
 	AES_KEY: "675I3123J3Toq10L",
 	AES_IV: "AdC01PoIU3LnSh10",

+ 57 - 46
common/index.scss

@@ -44,6 +44,12 @@ page{
 	padding-top: constant(safe-area-inset-top);
 	padding-top: env(safe-area-inset-top);
 }
+
+.safeBottom{
+	padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
+	padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
+}
+
 .up_and_down{
 	display: flex;
 	flex-direction: column;
@@ -57,56 +63,61 @@ page{
 	color: #333;
 }
 
-	.btn_print {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		right: 0;
-		background-color: #fff;
-		padding: 20rpx;
-		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.1);
+.btn_print {
+	position: fixed;
+	bottom: 0;
+	left: 0;
+	right: 0;
+	background-color: #fff;
+	padding: 20rpx;
+	box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.1);
+	padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
+	padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
+	.u-button{
+		margin-bottom: 20rpx;
 	}
+}
 .wx_card {
-		position: fixed;
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		bottom: 50rpx;
-		left: 0rpx;
-		right: 0rpx;
-		margin-bottom: 50rpx;
-	}
+	position: fixed;
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	bottom: 50rpx;
+	left: 0rpx;
+	right: 0rpx;
+	margin-bottom: 50rpx;
+}
 
-	.card_btn_wx {
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		width: 70rpx;
-		height: 70rpx;
-		border-radius: 50%;
-	}
+.card_btn_wx {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 70rpx;
+	height: 70rpx;
+	border-radius: 50%;
+}
 
 	// 伪元素1rpx边框
-	.frame {
-		position: relative; //重要
-	}
+.frame {
+	position: relative; //重要
+}
 
-	.frame::after {
-		position: absolute;
-		content: '';
-		border: 2rpx solid #b4b3b1;
-		border-radius: 50%;
-		width: 200%;
-		height: 200%;
-		top: 0;
-		left: 0;
-		transform: scale(0.5);
-		transform-origin: 0 0;
-		pointer-events: none;
-		/* 使伪元素不会阻止鼠标事件 */
-	}
+.frame::after {
+	position: absolute;
+	content: '';
+	border: 2rpx solid #b4b3b1;
+	border-radius: 50%;
+	width: 200%;
+	height: 200%;
+	top: 0;
+	left: 0;
+	transform: scale(0.5);
+	transform-origin: 0 0;
+	pointer-events: none;
+	/* 使伪元素不会阻止鼠标事件 */
+}
 
-	.title_login_wx {
-		font-size: 26rpx;
-		margin-top: 12rpx;
-	}
+.title_login_wx {
+	font-size: 26rpx;
+	margin-top: 12rpx;
+}

+ 1 - 0
components/waybill.js

@@ -11,5 +11,6 @@ export const formRules = () => {
 		placeholder: '请上传防拆标签图片',
 		type: 'upload',
 		required: false,
+		fileList1: [],
 	}]
 }

+ 300 - 63
components/x-form.vue

@@ -6,9 +6,9 @@
 				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
 					v-if="item.type == 'input' && customerName(item)">
 					<view class="card_form_item">
-						<u-input v-model="model[`${item.field}`]" :disabled="item.disabled ? true : false"
-							:placeholder="item.placeholder"></u-input>
-						<view class="card_sweep" v-if="item.field == 'tamperProofLabel' || item.field == 'code'"
+						<u-input v-model="model[`${item.field}`]" :clearable="item.clearable"
+							:disabled="item.disabled ? true : false" :placeholder="item.placeholder"></u-input>
+						<view class="card_sweep" v-if="['tamperProofLabel','code','drugBarCode'].includes(item.field)"
 							@click="sweep(item.field)">
 							<u-icon name="scan" size="18px"></u-icon>
 							<span>扫一扫</span>
@@ -16,6 +16,24 @@
 					</view>
 				</u-form-item>
 				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
+					v-else-if="item.type == 'drugBarCode'">
+					<view class="card_form_item">
+						<u-input v-model="model[`${item.field}`]" :clearable="item.clearable"
+							:disabled="item.disabled ? true : false" :placeholder="item.placeholder">
+							<template slot="suffix">
+								<u-icon name="scan" size="24" @click="sweep(item.field)"></u-icon>
+							</template>
+						</u-input>
+						<view class="add_cardil">
+							<u-button class="custom-style" :loading="addloading" icon="plus"
+								@click="sweep(item.field,true)"></u-button>
+						</view>
+						<!-- <view class="add_card center_in">
+							<u-icon name="plus" size="18"></u-icon>
+						</view> -->
+					</view>
+				</u-form-item>
+				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
 					v-else-if="item.type == 'select'">
 					<view class="card_form_item">
 						<u-input :placeholder="item.placeholder" suffixIcon="arrow-down"
@@ -25,7 +43,12 @@
 				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
 					v-else-if="item.type == 'selectiveSearch'">
 					<view class="card_form_item">
-						<view class="card_search_gray frame" @click="changeil(item)">
+						<view class="card_search_gray frame" @click="changeil(item)" v-if="item.field == 'freezeClaim'">
+							<span v-if="model[`${item.field}`].length">{{getTimeName(model[`${item.field}`])}}</span>
+							<span class="title_gray" v-else>{{item.placeholder}}</span>
+							<u-icon name="arrow-down" color="#c8c9cc" size="18"></u-icon>
+						</view>
+						<view class="card_search_gray frame" @click="changeil(item)" v-else>
 							<span v-if="model[`${item.field}`]">{{model[`${item.field}`]}}</span>
 							<span class="title_gray" v-else>{{item.placeholder}}</span>
 							<u-icon name="arrow-down" color="#c8c9cc" size="18"></u-icon>
@@ -47,16 +70,50 @@
 					</view>
 				</u-form-item>
 				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
+					v-else-if="item.type == 'switch'">
+					<view class="card_form_item">
+						<u-switch v-model="model[`${item.field}`]" inactiveColor="#ff4949" activeColor="#13ce66"
+							size="20"></u-switch>
+					</view>
+				</u-form-item>
+				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
 					v-else-if="item.type == 'upload' && !item.visible">
 					<view class="card_form_item">
-						<u-upload :fileList="fileList1" name="1" multiple :maxCount="10" @afterRead="afterRead"
-							@delete="deletePic"></u-upload>
+						<u-upload :fileList="item.fileList1" name="1" multiple :maxCount="10"
+							@afterRead="afterRead($event, item)" @delete="deletePic($event, item)"></u-upload>
 					</view>
 				</u-form-item>
+				<div class="card_drug_list" v-else-if="item.type == 'divider' && productData.length > 0">
+					<x-productList :list="productData"></x-productList>
+				</div>
 			</view>
 		</u-form>
 		<u-picker :defaultIndex="findIndex(model[fieldType], columns[0])" :show="show" :columns="columns"
 			keyName="label" @confirm="confirm($event, fieldType)" @cancel="cancel"></u-picker>
+		<!-- 冷冻要求选择 -->
+		<u-popup :show="freezeShow" @close="close">
+			<view>
+				<view class="space_between" style="height: 84rpx;">
+					<view class="tittle_freeze gray_font" @click="freezeCancel">取消</view>
+					<view class="tittle_freeze blue_font" @click="freezeConfirm">确定</view>
+				</view>
+				<view class="freeze_content">
+					<view class="card_selected_list">
+						<view class="hint_freeze" v-if="selectedData.length == 0">请选择冷冻要求</view>
+						<view v-for="(item,index) in selectedData" :key="index">
+							<u-tag :text="getTagName(item)" closable plain @close="closeFreeze(item)"></u-tag>
+						</view>
+					</view>
+					<view class="fontsize_freeze" v-for="(item,index) in freezeList" :key="index"
+						@click="freezeSelect(item)">
+						<view>{{item.label}}</view>
+						<view v-if="item.flag">
+							<u-icon name="checkmark" color="#2979ff" size="22"></u-icon>
+						</view>
+					</view>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -83,6 +140,19 @@
 					return {}
 				}
 			},
+			productData: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			// 添加药品加载
+			addloading: {
+				type: Boolean,
+				default () {
+					return false
+				}
+			},
 		},
 		data() {
 			return {
@@ -90,6 +160,9 @@
 				columns: [],
 				fieldType: '',
 				fileList1: [],
+				freezeShow: false,
+				freezeList: [],
+				selectedData: [],
 			}
 		},
 		// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
@@ -121,13 +194,27 @@
 			},
 			// 选择弹窗滚动
 			changeil(value) {
-				if (value.field == "status" || value.field == "freezeClaim") {
+				if (value.field == "status") {
 					this.columns = []
 					this.fieldType = value.field
 					this.show = true
 					this.$nextTick(() => {
 						this.columns.push(value.options)
 					})
+				} else if (value.field == "freezeClaim") {
+					this.freezeList = value.options
+					this.freezeList.forEach(item => {
+						item.flag = false
+					})
+					this.model.freezeClaim.forEach(event => {
+						this.freezeList.filter(item1 => {
+							if (item1.value == event) {
+								item1.flag = true
+							}
+						})
+					})
+					this.freezeShow = true
+					this.getSelected()
 				} else {
 					this.$emit('selector', value)
 				}
@@ -147,50 +234,67 @@
 				}
 				return [list.findIndex((item) => (item.label === code || item.label === code))]
 			},
-
 			// 新增图片
-			async afterRead(event) {
-				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
-				let lists = [].concat(event.file)
-				let fileListLen = this[`fileList${event.name}`].length
-				lists.map((item) => {
-					this[`fileList${event.name}`].push({
-						...item,
-						status: 'uploading',
-						message: '上传中'
-					})
-				})
-				uni.showLoading({
-					title: '上传中',
-					mask: true,
-				})
-				for (let i = 0; i < lists.length; i++) {
-					const result = await this.uploadFilePromise(lists[i].url)
-					let item = this[`fileList${event.name}`][fileListLen]
-					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
-						status: 'success',
-						message: '',
-						url: result
-					}))
-					fileListLen++
-				}
-				var arr = []
-				this.fileList1.forEach(item1 => {
-					arr.push(item1.url)
+			async afterRead(event, each) {
+				this.list.forEach(async item1 => {
+					if (item1.field == each.field) {
+						// item1.fileList1 = this.fileList1
+						// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+						let lists = [].concat(event.file)
+						let fileListLen = item1.fileList1.length
+						lists.map((item) => {
+							item1.fileList1.push({
+								...item,
+								status: 'uploading',
+								message: '上传中'
+							})
+						})
+						uni.showLoading({
+							title: '上传中',
+							mask: true,
+						})
+						for (let i = 0; i < lists.length; i++) {
+							const result = await this.uploadFilePromise(lists[i].url)
+							let item = item1.fileList1[fileListLen]
+							item1.fileList1.splice(fileListLen, 1, Object.assign(item, {
+								status: 'success',
+								message: '',
+								url: result
+							}))
+							fileListLen++
+						}
+						var arr = []
+						item1.fileList1.forEach(item1 => {
+							arr.push(item1.url)
+						})
+						uni.hideLoading();
+						if (each.field == 'prescription') {
+							this.model[each.field] = arr
+							this.$refs.uForm.validateField(each.field)
+						} else {
+							this.model[each.field] = arr.join()
+							this.$refs.uForm.validateField(each.field)
+						}
+					}
 				})
-				uni.hideLoading();
-				this.model.tamperProofLabelImg = arr.join()
-				this.$refs.uForm.validateField('tamperProofLabelImg')
 			},
 			// 删除图片
-			deletePic(event) {
-				this[`fileList${event.name}`].splice(event.index, 1)
-				var arr = []
-				this.fileList1.forEach(item1 => {
-					arr.push(item1.url)
+			deletePic(event, each) {
+				this.list.forEach(async item1 => {
+					if (item1.field == each.field) {
+						item1.fileList1.splice(event.index, 1)
+						var arr = []
+						item1.fileList1.forEach(item1 => {
+							arr.push(item1.url)
+						})
+						uni.hideLoading();
+						if (each.field == 'prescription') {
+							this.model[each.field] = arr
+						} else {
+							this.model[each.field] = arr.join()
+						}
+					}
 				})
-				uni.hideLoading();
-				this.model.tamperProofLabelImg = arr.join()
 			},
 			uploadFilePromise(url) {
 				return new Promise((resolve, reject) => {
@@ -216,24 +320,31 @@
 				})
 			},
 			// 扫一扫
-			sweep(field) {
-				// 允许从相机和相册扫码
-				uni.scanCode({
-					scanType: ['barCode', 'qrCode'],
-					autoZoom: false,
-					success: (res) => {
-						if (res.result) {
-							let url = res.result;
-							this.model[field] = url
-						} else {
-							console.log('请重新扫描');
-							return false;
-						}
-					},
-					fail: (res) => {
-						console.log('未识别到二维码1');
+			sweep(field, flag) {
+				if (flag) {
+					if (!this.addloading) {
+						this.$emit('getSweep', this.model[field])
 					}
-				})
+				} else {
+					// 允许从相机和相册扫码
+					uni.scanCode({
+						scanType: ['barCode', 'qrCode'],
+						autoZoom: false,
+						success: (res) => {
+							if (res.result) {
+								let url = res.result;
+								this.$emit('getSweep', url)
+								this.model[field] = url
+							} else {
+								console.log('请重新扫描');
+								return false;
+							}
+						},
+						fail: (res) => {
+							console.log('未识别到二维码1');
+						}
+					})
+				}
 			},
 			//子组件校验,传递到父组件
 			async validateForm() {
@@ -244,6 +355,70 @@
 					flag = false
 				})
 				return flag
+			},
+			// 选择冷冻时间
+			freezeSelect(event) {
+				this.freezeList.forEach(item => {
+					if (item.value == event.value) {
+						if (item.flag) {
+							item.flag = false
+						} else {
+							item.flag = true
+						}
+					}
+				})
+				this.getSelected()
+				this.$forceUpdate()
+			},
+			// 获取已选
+			getSelected() {
+				var arr = []
+				this.freezeList.forEach(item => {
+					if (item.flag) {
+						arr.push(item.value)
+					}
+				})
+				this.selectedData = arr
+			},
+			// 获取选择名称
+			getTagName(event) {
+				let name
+				this.freezeList.forEach(item => {
+					if (event == item.value) {
+						name = item.label
+					}
+				})
+				return name
+			},
+			// 数组展示
+			getTimeName(event) {
+				var arr = event.join(' , ')
+				return arr
+			},
+			// 删除选择项
+			closeFreeze(event) {
+				this.freezeList.forEach(item => {
+					if (item.value == event) {
+						item.flag = false
+					}
+				})
+				this.selectedData = this.selectedData.filter(item => item !== event);
+			},
+			// 单个表单验证
+			formValidation(event) {
+				this.$refs['uForm'].validateField(event)
+			},
+			// 取消
+			freezeCancel() {
+				this.freezeShow = false
+			},
+			// 确定
+			freezeConfirm() {
+				this.model.freezeClaim = this.selectedData
+				this.freezeShow = false
+			},
+			close() {
+				this.freezeShow = false
 			}
 		},
 	}
@@ -288,6 +463,14 @@
 		color: #c8c9cc;
 	}
 
+	.gray_font {
+		color: #c8c9cc;
+	}
+
+	.blue_font {
+		color: #3c9cff;
+	}
+
 	// 伪元素1rpx边框
 	.frame {
 		position: relative; //重要
@@ -307,4 +490,58 @@
 		pointer-events: none;
 		/* 使伪元素不会阻止鼠标事件 */
 	}
+
+	.card_drug_list {
+		border-radius: 10rpx;
+		border-top: 1px solid #f4f4f5;
+		// box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .12),
+	}
+
+	.tittle_freeze {
+		padding: 0px 30rpx;
+	}
+
+	.freeze_content {
+		position: relative;
+		padding: 100rpx 0rpx;
+	}
+
+	.card_selected_list {
+		position: absolute;
+		top: 20rpx;
+		left: 0;
+		right: 0;
+		border-bottom: 1rpx solid #f4f4f5;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		padding-bottom: 20rpx;
+	}
+
+	.hint_freeze {
+		color: #909399;
+		font-size: 30rpx;
+	}
+
+	.fontsize_freeze {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: 20rpx 30rpx;
+		height: 50rpx;
+	}
+
+	.add_card {
+		margin-left: 10rpx;
+		width: 40rpx;
+		height: 46rpx;
+		border-radius: 8rpx;
+		padding: 6px 9px;
+		border: 1px solid #dadbde;
+	}
+
+	.add_cardil {
+		display: flex;
+		margin-left: 10rpx;
+	}
 </style>

+ 52 - 1
components/x-orderManagement.vue

@@ -25,7 +25,7 @@
 					<u-button size="small" type="success" text="去配送"></u-button>
 				</view>
 			</view>
-			<view style="display: flex;" v-if="item.status == 4">
+			<view style="display: flex;" v-if="item.status == 4 && !item.is_secondary_distribution">
 				<view class="btn_printil markd10" @click.stop="rejection(item)">
 					<u-button size="small" type="error" text="拒收"></u-button>
 				</view>
@@ -33,6 +33,14 @@
 					<u-button size="small" type="primary" text="签收"></u-button>
 				</view>
 			</view>
+			<view style="display: flex;" v-else-if="item.status == 4 && item.is_secondary_distribution">
+				<view class="btn_printil markd10" @click.stop="finished(item)">
+					<u-button size="small" type="success" text="已完成"></u-button>
+				</view>
+				<view class="btn_printil markd10" @click.stop="distributionOrder(item)">
+					<u-button size="small" type="primary" text="分配订单"></u-button>
+				</view>
+			</view>
 		</view>
 		<u-popup :show="signForShow" mode="center" round="6" closeable :closeOnClickOverlay="false" @close="close">
 			<view class="center_in title_sign">{{signRejection}}</view>
@@ -81,6 +89,9 @@
 					@click="modifiedTamper()"></u-button>
 			</view>
 		</u-popup>
+		<!-- 确定完成 -->
+		<u-modal :show="logoutShow" showCancelButton :title="title" :content='content' @cancel="cancel"
+			@confirm="definiteCompletion"></u-modal>
 	</view>
 </template>
 
@@ -157,6 +168,11 @@
 				modePayment: null,
 				statePayment: null,
 				remarksSettled: '',
+
+				logoutShow: false,
+				title: '确定完成该订单?',
+				content: '确定完成后将无法分配运单,重新下单后即可分配',
+				orderId: null,
 			}
 		},
 		mounted() {
@@ -217,6 +233,17 @@
 				this.rejectionFlag = false
 				this.signRejection = '签收'
 			},
+			// 已完成
+			finished(event) {
+				this.orderId = event.id
+				this.logoutShow = true
+			},
+			// 分配订单
+			distributionOrder(event) {
+				uni.navigateTo({
+					url: '/pages/order/distributionOrder?flag=true&waybillNo=' + event.waybillNo
+				});
+			},
 			// 确定签收/拒收
 			confirm() {
 				let params = {
@@ -337,6 +364,8 @@
 					return '已送达'
 				} else if (value == 6) {
 					return '已拒收'
+				} else if (value == 8) {
+					return '已取消'
 				}
 			},
 			// 运单文字颜色
@@ -349,6 +378,8 @@
 					return '#1cc723'
 				} else if (value == 6) {
 					return '#fe880e'
+				} else if (value == 8) {
+					return '#fa3534'
 				}
 			},
 			// 新增图片
@@ -419,6 +450,26 @@
 					});
 				})
 			},
+			// 确定完成订单
+			definiteCompletion() {
+				this.$api.put('/api/waybill/update-status', {
+					id: [this.orderId],
+					status: 5,
+				}).then(res => {
+					if (res.code == 200) {
+						uni.$u.toast('操作成功')
+						this.$emit('definiteCompletion')
+					} else {
+						uni.$u.toast(res.msg)
+					}
+					this.logoutShow = false
+				})
+				console.log('确定完成订单')
+			},
+			// 取消
+			cancel() {
+				this.logoutShow = false
+			},
 			close() {
 				this.signForShow = false
 				this.modePayment = null

+ 102 - 0
components/x-productList.vue

@@ -0,0 +1,102 @@
+<template>
+	<!-- 商品信息 -->
+	<view class="product_card">
+		<view class="item_product" v-for="(item,index) in list" :key="index">
+			<view>
+				<view class="names_goods">{{item.physic_name}}</view>
+				<view class="tag_goods_card">
+					<u-tag size="mini" :text="item.physic_type_desc" plain plainFill shape="circle"></u-tag>
+				</view>
+				<view class="title_goods">包装规格:{{item.pkg_spec_crit}}</view>
+				<view class="title_goods">生产厂家:<span>{{item.ent_name}}</span></view>
+			</view>
+			<!-- <image class="goods_image" :src="item.medicinePicture" mode=""></image> -->
+			<view style="position: absolute;top: 0;right: 0;">
+				<view class="card_allot" v-if="item.isAssignment"></view>
+				<view class="card_title_allot">已分配</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'x-productList',
+		props: {
+			list: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+		},
+		data() {
+			return {
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.product_card {
+		border-radius: 10rpx;
+		overflow: hidden;
+		background-color: #fff;
+	}
+
+	.item_product {
+		position: relative;
+		display: flex;
+		overflow: hidden;
+		padding: 30rpx 20rpx 20rpx 20rpx;
+		border-bottom: 1px solid #f4f4f5;
+		// border-top: 1px solid #f4f4f5;
+	}
+
+	.card_allot {
+		position: absolute;
+		top: 0;
+		right: 0;
+		border-top: 90rpx solid #67C23A;
+		border-left: 90rpx solid transparent;
+	}
+
+	.card_title_allot {
+		color: #fff;
+		width: 80rpx;
+		text-align: center;
+		transform: rotate(45deg);
+		position: absolute;
+		right: -10rpx;
+		top: 16rpx;
+		font-size: 22rpx;
+	}
+
+	// .item_product:last-child {
+	// 	border-bottom: unset;
+	// }
+
+	.goods_image {
+		flex: none;
+		width: 180rpx;
+		height: 150rpx;
+		border-radius: 10rpx;
+	}
+
+	.names_goods {
+		font-size: 34rpx;
+		font-weight: bold;
+	}
+
+	.tag_goods_card {
+		display: flex;
+		padding-top: 10rpx;
+	}
+
+	.title_goods {
+		color: #606266;
+		font-size: 30rpx;
+		padding-top: 10rpx;
+	}
+</style>

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "冷链送药",
     "appid" : "__UNI__49186F9",
     "description" : "",
-    "versionName" : "1.1.5",
-    "versionCode" : 115,
+    "versionName" : "1.1.9",
+    "versionCode" : 119,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 5 - 0
pages.json

@@ -129,6 +129,11 @@
 		"style": {
 			"navigationStyle": "custom"
 		}
+	}, {
+		"path": "pages/order/distributionOrder",
+		"style": {
+			"navigationStyle": "custom"
+		}
 	}],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 19 - 5
pages/home/IceManagement.vue

@@ -34,7 +34,7 @@
 					{{item.iceRaftRecord.coolerBox.name}}
 				</view>
 				<view class="title_itemIce" v-if="item.iceRaftRecord.status != ''">冷冻要求:
-					<span>{{item.iceRaftRecord.freezeClaim}}h</span>
+					<span>{{getFreeze(item.iceRaftRecord.freezeClaim)}}</span>
 				</view>
 				<view class="title_itemIce" v-if="item.iceRaftRecord.status != ''">冷冻时间:
 					<span>{{formatMinutes(item.iceRaftRecord.freezeDuration)}}</span>
@@ -56,25 +56,29 @@
 			return {
 				list: [],
 				typeList: [{
-					bgcolor: '#ff9900',
+					bgcolor: '#606266',
 					label: '未入库',
 					value: '',
 				}, {
-					bgcolor: '#fa3534',
+					bgcolor: '#409EFF',
 					label: '冷冻中',
 					value: '1',
 				}, {
-					bgcolor: '#67C23A',
+					bgcolor: '#E6A23C',
 					label: '待使用',
 					value: '2',
 				}, {
-					bgcolor: '#409EFF',
+					bgcolor: '#67C23A',
 					label: '使用中',
 					value: '3',
 				}, {
 					bgcolor: '#909399',
 					label: '已结束',
 					value: '4',
+				}, {
+					bgcolor: '#ff9900',
+					label: '释冷中',
+					value: '4',
 				}],
 				PageIndex: 1,
 				PageSize: 15,
@@ -124,6 +128,16 @@
 					}
 				})
 			},
+			// 冷冻要求
+			getFreeze(event) {
+				let title = event
+				let arrList = []
+				title.forEach(item => {
+					let arr = '≥' + item + 'h'
+					arrList.push(arr)
+				})
+				return arrList.toString()
+			},
 			matchingType(type) {
 				let list = this.typeList
 				let name = ''

+ 15 - 6
pages/homePage.vue

@@ -50,9 +50,9 @@
 						<span class="iconfont image_cr icon-bingpairuku"></span>
 						<span class="title_bpzs">冰排入库</span>
 					</view>
-					<view class="bpcrk_card" @click="getOperate('out','冰排出库')">
+					<view class="bpcrk_card" @click="getOperate('out','冰排装箱')">
 						<span class="iconfont image_cr icon-bingpaichuku"></span>
-						<span class="title_bpzs">冰排出库</span>
+						<span class="title_bpzs">冰排装箱</span>
 					</view>
 				</view>
 			</view>
@@ -180,9 +180,16 @@
 			var token = this.$cache.getToken()
 			this.token = token
 			var userInfo = this.$cache.getCache('userInfo')
-			if (userInfo) {
-				this.userInfo = userInfo
+			if (token) {
+				if (userInfo) {
+					this.userInfo = userInfo
+				} else {
+					this.userInfo = {}
+				}
 			} else {
+				uni.redirectTo({
+					url: '/pages/login'
+				})
 				this.userInfo = {}
 			}
 		},
@@ -193,8 +200,10 @@
 			getUserInfo() {
 				this.$api.get('/api/user/profile').then(res => {
 					if (res.code == 200) {
-						this.userInfo = res.data.user
-						this.$cache.setCache('userInfo', this.userInfo)
+						if (this.token) {
+							this.userInfo = res.data.user
+							this.$cache.setCache('userInfo', this.userInfo)
+						}
 					} else {
 						this.$cache.removeToken()
 						this.$cache.removeCache('userInfo')

+ 90 - 14
pages/order/Incubator.vue

@@ -18,12 +18,15 @@
 						<view class="select_title orange_color" @click="Inverse">反选</view>
 					</view>
 				</view>
+				<view @click="endOfUse">
+					<u-button size="small" type="error" text="结束使用"></u-button>
+				</view>
 			</view>
 		</u-sticky>
 		<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;">
+				<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>
@@ -37,27 +40,37 @@
 									<view class="ice_code">{{item1.code}}</view>
 								</view>
 							</view>
-							<view style="display: flex;align-items: center;">
+							<view style="display: flex;flex-direction: column;">
 								<view class="title_cryophilic" style="margin-right: 5rpx;">
 									释冷温度:<span v-if="item1.iceRaftRecord">{{item1.iceRaftRecord.suitableForCold || 0}}℃
 									</span></view>
-								<view class="title_cryophilic">释冷时间:<span>≥{{item1.suitableForColdTime}}min</span>
+								<view class="title_cryophilic">
+									冷冻时间:<span>{{formatMinutes(item1.iceRaftRecord.freezeDuration)}}</span>
 								</view>
 							</view>
 							<view class="title_cryophilic" v-if="item1.iceRaftRecord">
 								出库时间:{{item1.iceRaftRecord.outStorageTime}}</view>
 						</view>
-						<view class="card_ice_item" style="border: unset;flex: 1;padding: 0rpx;margin: 0rpx;"></view>
+						<view class="card_ice_item" style="border: unset;"></view>
 					</view>
 					<view class="card_ice_list"></view>
 				</view>
-				<view class="btn_printil markd10" 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 class="btn_printil markd10">
+					<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)">
+						<u-button size="small" type="error" text="结束使用"></u-button>
+					</view>
 				</view>
 				<view class="position-triangle" v-if="item.whetherFlag">
 					<span>已选</span>
 				</view>
+				<!-- <view class="position-inuse center_in" v-if="item.monitorStatus == 1">
+					<span>使用中</span>
+				</view> -->
 			</view>
 			<view style="width: 100%;">
 				<u-loadmore lineColor="#ffffff" :status="loadStatus" :key="Math.random()" />
@@ -169,9 +182,43 @@
 						}
 					})
 				} else {
-					uni.$u.toast('请先选择释冷冰排')
+					uni.$u.toast('请先选择保温箱')
 				}
 			},
+			// 结束使用
+			endOfUse() {
+				if (this.selectedList.length > 0) {
+					let arrID = this.selectedList.map(item => item.toString())
+					this.$api.put('/api/cooler-box/coolerBoxEndUse', {
+						id: arrID,
+					}).then(res => {
+						if (res.code == 200) {
+							uni.$u.toast('操作成功')
+							this.currentPage = 1
+							this.orderList = []
+							this.loadingMore = true
+							this.getIncubator()
+						}
+					})
+				} else {
+					uni.$u.toast('请先选择保温箱')
+				}
+			},
+			// 结束使用单个
+			endOfUseil(event) {
+				let incubatorId = String(event.id)
+				this.$api.put('/api/cooler-box/coolerBoxEndUse', {
+					id: [incubatorId],
+				}).then(res => {
+					if (res.code == 200) {
+						uni.$u.toast('操作成功')
+						this.currentPage = 1
+						this.orderList = []
+						this.loadingMore = true
+						this.getIncubator()
+					}
+				})
+			},
 			// 判断冰排是否选择
 			getRecord() {
 				this.orderList.forEach(item => {
@@ -250,16 +297,26 @@
 			// 保温箱下所有冰排释冷状态
 			getIceState(event) {
 				let arrList = event
-				let bol = true
+				let bol = false
 				// isSuitableForCold 0 未释冷 1 已释冷
 				for (let i = 0; i < arrList.length; i++) {
-					if (arrList[i].iceRaftRecord.isSuitableForCold == 1) {
-						bol = false
+					if (arrList[i].iceRaftRecord.isSuitableForCold === 0) {
+						bol = true
 						break //减少循环次数
 					}
 				}
 				return bol
 			},
+			// 总分钟格式化
+			formatMinutes(totalMinutes) {
+				if (totalMinutes) {
+					const hours = Math.floor(totalMinutes / 60); // 计算小时
+					const minutes = totalMinutes % 60; // 计算分钟(余数)
+					return `${hours}h${minutes}m`;
+				} else {
+					return ''
+				}
+			},
 			navbarHeight() {
 				let systemInfo = uni.getSystemInfoSync();
 				/* (750 / systemInfo.windowWidth) */
@@ -384,6 +441,19 @@
 		top: 50%;
 	}
 
+	.position-inuse {
+		position: absolute;
+		bottom: 0;
+		top: 10rpx;
+		right: 15rpx;
+		width: 100rpx;
+		height: 40rpx;
+		font-size: 24rpx;
+		border-radius: 6rpx;
+		color: #E4E7ED;
+		background-color: #19be6b;
+	}
+
 	.imagebwx {
 		color: #2b85e4;
 		font-size: 60rpx;
@@ -397,7 +467,7 @@
 	}
 
 	.floe_card {
-		padding: 15rpx 0rpx;
+		// padding: 15rpx 0rpx;
 		display: flex;
 		flex-direction: column;
 	}
@@ -406,14 +476,20 @@
 		display: flex;
 		flex-direction: row;
 		flex-wrap: wrap;
+		// justify-content: space-around;
 		justify-content: space-between;
 	}
 
+	.btn_printil {
+		display: flex;
+		align-items: center;
+	}
+
 	.card_ice_item {
 		flex: none;
-		margin: 0rpx 10rpx;
+		width: calc(50% - 20rpx);
+		padding: 10rpx 7rpx;
 		margin-bottom: 10rpx;
-		padding: 6rpx 10rpx;
 		border-radius: 6rpx;
 		border: 1rpx solid #e7e6e4;
 	}

+ 1 - 1
pages/order/addAddress.vue

@@ -4,7 +4,7 @@
 		<u-navbar :title="headline" autoBack placeholder></u-navbar>
 		<x-form ref="recipients" :list="list" :model="recipientsModel" :rules="rules"></x-form>
 		<view class="btn_print" @click="addAddress()">
-			<u-button type="primary" text="确定" shape="circle"></u-button>
+			<u-button type="primary" text="确定"></u-button>
 		</view>
 	</view>
 </template>

+ 4 - 4
pages/order/addIceRaft.vue

@@ -23,7 +23,7 @@
 					code: '',
 					label: '',
 					status: '',
-					freezeClaim: '',
+					freezeClaim: [],
 					suitableForCold: null,
 					iceColdAddress: '',
 				},
@@ -44,6 +44,7 @@
 						trigger: ['blur', 'change']
 					},
 					freezeClaim: {
+						type: 'array',
 						required: true,
 						message: '请输入冷冻要求',
 						trigger: ['blur', 'change']
@@ -68,7 +69,6 @@
 		onShow() {
 			var userInfo = this.$cache.getCache('userInfo')
 			this.isIceInfo = userInfo.dept
-			console.log(this.isIceInfo.isIceReleaseCold,25)
 			if (this.isIceInfo.isIceReleaseCold) {
 				this.list = iceRaftRulesil()
 			} else {
@@ -95,7 +95,7 @@
 					this.$nextTick(() => {
 						this.headline = '编辑冰排'
 						this.recipientsModel = arrValue
-						this.recipientsModel.freezeClaim = String(arrValue.freezeClaim)
+						this.recipientsModel.freezeClaim = arrValue.freezeClaim
 						this.recipientsModel.suitableForCold = String(arrValue.suitableForCold)
 						if (arrValue.status == '2') {
 							this.recipientsModel.status = '正常'
@@ -117,7 +117,7 @@
 					let params = {
 						codeList: [],
 						label: this.recipientsModel.label,
-						freezeClaim: Number(this.recipientsModel.freezeClaim),
+						freezeClaim: this.recipientsModel.freezeClaim,
 						iceColdAddress: this.recipientsModel.iceColdAddress,
 						suitableForCold: Number(this.recipientsModel.suitableForCold),
 						status: null,

+ 109 - 52
pages/order/addWaybill.vue

@@ -10,8 +10,9 @@
 			</view>
 		</view>
 		<x-form ref="recipients" :list="list" :model="recipientsModel" :rules="rules"></x-form>
-		<x-form ref="goods" :list="goodsList" :model="goodsModel" :rules="goodsRules" @selector="selector"></x-form>
-		<view style="width: 100%;height: 150rpx;"></view>
+		<x-form ref="goods" :list="goodsList" :model="goodsModel" :rules="goodsRules" :productData="productData"
+			:addloading="addloading" @selector="selector" @getSweep="getSweep"></x-form>
+		<view class="safeBottom" style="width: 100%;height: 150rpx;"></view>
 		<view class="btn_print" @click="printWaybill">
 			<u-button type="primary" :text="headline"></u-button>
 		</view>
@@ -70,11 +71,14 @@
 				goodsModel: {
 					reCheckId: '',
 					reCheckName: '',
+					is_secondary_distribution: false,
 					deliveryId: '',
 					deliveryName: '',
+					drugBarCode: '',
 					tamperProofLabel: '',
 					tamperProofLabelImg: '',
 					remark: '',
+					prescription: [],
 				},
 				rules: {
 					name: {
@@ -105,12 +109,12 @@
 						trigger: ['blur', 'change']
 					},
 					tamperProofLabel: {
-						required: true,
+						required: false,
 						message: '请输入防拆标签码',
 						trigger: ['blur', 'change']
 					},
 					tamperProofLabelImg: {
-						required: true,
+						required: false,
 						message: '请上传防拆标签图片',
 						trigger: ['blur', 'change']
 					},
@@ -118,6 +122,7 @@
 				list: pickupRulesil(),
 				courierList: printList(),
 				goodsList: formRules(),
+				productData: [],
 				userInfo: {},
 				headline: '添加运单',
 				type: 1,
@@ -133,6 +138,7 @@
 				courierHeadline: '选择配送员',
 				textEmpty: '暂无配送员',
 				selectiveType: '',
+				addloading: false,
 			}
 		},
 		onUnload() {
@@ -143,9 +149,9 @@
 			let address = uni.getStorageSync('selectAddress')
 			if (address) {
 				if (this.operationType == 'sender') {
-					this.$nextTick(() => {
-						this.$refs['sender'].validateForm();
-					})
+					// this.$nextTick(() => {
+					// 	this.$refs['sender'].validateForm();
+					// })
 					this.senderModel = address
 					this.saveSenderAddress = false
 				} else {
@@ -193,48 +199,55 @@
 			this.userInfo = userInfo
 		},
 		methods: {
-			// tianjia运单
+			// 添加运单
 			async printWaybill() {
 				let flag1 = await this.$refs['recipients'].validateForm();
 				let flag2 = await this.$refs['goods'].validateForm();
 				if (flag1 && flag2) {
-					let params = {
-						consigneeAddressName: this.recipientsModel.name,
-						consigneeAddressPhone: this.recipientsModel.phone,
-						consigneeAddressDetails: this.recipientsModel.address,
-						saveConsigneeAddress: this.saveConsigneeAddress,
-						...this.goodsModel,
-					}
-					uni.showLoading();
-					if (this.type == 1) {
-						// 添加运单
-						this.$api.post('/api/waybill', params).then(res => {
-							if (res.code == 200) {
-								uni.redirectTo({
-									url: '/pages/order/index'
-								});
-							} else {
-								uni.$u.toast(res.msg)
-							}
-							uni.hideLoading();
-						}).catch(() => {
-							uni.hideLoading();
-						})
+					if (this.productData.length > 0) {
+						let params = {
+							is_phone: true,
+							consigneeAddressName: this.recipientsModel.name,
+							consigneeAddressPhone: this.recipientsModel.phone,
+							consigneeAddressDetails: this.recipientsModel.address,
+							saveConsigneeAddress: this.saveConsigneeAddress,
+							drugs: this.productData,
+							...this.goodsModel,
+						}
+						delete params.drugBarCode
+						uni.showLoading();
+						if (this.type == 1) {
+							// 添加运单
+							this.$api.post('/api/waybill', params).then(res => {
+								if (res.code == 200) {
+									uni.redirectTo({
+										url: '/pages/order/index'
+									});
+								} else {
+									uni.$u.toast(res.msg)
+								}
+								uni.hideLoading();
+							}).catch(() => {
+								uni.hideLoading();
+							})
+						} else {
+							// 修改运单
+							this.$api.put('/api/waybill', params).then(res => {
+								if (res.code == 200) {
+									// uni.$u.toast(res.msg)
+									uni.redirectTo({
+										url: '/pages/order/index'
+									});
+								} else {
+									uni.$u.toast('修改失败')
+								}
+								uni.hideLoading();
+							}).catch(() => {
+								uni.hideLoading();
+							})
+						}
 					} else {
-						// 修改运单
-						this.$api.put('/api/waybill', params).then(res => {
-							if (res.code == 200) {
-								// uni.$u.toast(res.msg)
-								uni.redirectTo({
-									url: '/pages/order/index'
-								});
-							} else {
-								uni.$u.toast('修改失败')
-							}
-							uni.hideLoading();
-						}).catch(() => {
-							uni.hideLoading();
-						})
+						uni.$u.toast('请扫码添加商品')
 					}
 				} else {
 					uni.$u.toast('请先完善表单')
@@ -271,6 +284,55 @@
 				}
 				this.courierShow = true
 			},
+			// 获取药品信息码上放心
+			getSweep(event) {
+				let idExists = this.productData.some(obj => obj.code === event);
+				if (!idExists) {
+					this.addloading = true
+					uni.request({
+						url: 'https://public.coldbaozhida.com/Ali_msfx/codedetail', //仅为示例,并非真实接口地址。
+						method: 'GET',
+						header: {
+							'content-type': 'application/x-www-form-urlencoded', // 默认值
+						},
+						data: {
+							code: event,
+						},
+						success: (res) => {
+							if (res.data.status == 200) {
+								let arr = JSON.parse(res.data.data)
+								if (arr.result.models.length > 0) {
+									let drugList = {
+										code: '',
+										physic_name: '',
+										physic_type_desc: '',
+										pkg_spec_crit: '',
+										ent_name: '',
+									}
+									drugList.code = arr.result.models[0].code
+									drugList.physic_name = arr.result.models[0].drug_ent_base_d_t_o.physic_name
+									drugList.physic_type_desc = arr.result.models[0].drug_ent_base_d_t_o
+										.physic_type_desc
+									drugList.pkg_spec_crit = arr.result.models[0].drug_ent_base_d_t_o
+										.pkg_spec_crit
+									drugList.ent_name = arr.result.models[0].p_user_ent_d_t_o.ent_name
+									this.productData.push(drugList)
+									this.productData = this.uniqueArray(this.productData)
+								} else {
+									uni.$u.toast('该商品不存在')
+								}
+								this.addloading = false
+							}
+						}
+					});
+				} else {
+					uni.$u.toast('该商品已存在')
+				}
+			},
+			// 去重
+			uniqueArray(arr) {
+				return [...new Set(arr)];
+			},
 			// 获取配送员
 			getDelivery(field) {
 				if (field == 'deliveryName') {
@@ -320,9 +382,11 @@
 				if (this.selectiveType == 'deliveryName') {
 					this.goodsModel.deliveryId = value.id
 					this.goodsModel.deliveryName = value.nickName
+					this.$refs['goods'].formValidation('deliveryName')
 				} else if (this.selectiveType == 'reCheckName') {
 					this.goodsModel.reCheckId = value.id
 					this.goodsModel.reCheckName = value.nickName
+					this.$refs['goods'].formValidation('reCheckName')
 				}
 				this.courierShow = false
 			},
@@ -330,7 +394,7 @@
 			loadMore() {
 				if (this.incubatorMore) {
 					this.Pagination++
-					this.getDelivery()
+					this.getDelivery(this.selectiveType)
 				}
 			},
 			// 搜索配送员
@@ -357,13 +421,6 @@
 		padding: 20rpx;
 	}
 
-	.title_waybill1 {
-		position: relative;
-		margin: 20rpx;
-		border-bottom: 1rpx;
-		padding-bottom: 20rpx;
-	}
-
 	.card_Address {
 		position: relative;
 	}

+ 3 - 3
pages/order/addressBook.vue

@@ -37,9 +37,9 @@
 		<view style="margin-top: 20%;" v-else>
 			<u-empty mode="address" text="暂无地址"></u-empty>
 		</view>
-		<view style="width: 100%;height: 150rpx;"></view>
+		<view  class="safeBottom" style="width: 100%;height: 150rpx;"></view>
 		<view class="btn_print" @click="addAddress(pickUpFlag)">
-			<u-button type="primary" text="新增地址" shape="circle"></u-button>
+			<u-button type="primary" text="新增地址"></u-button>
 		</view>
 		<u-modal :show="modalShow" showCancelButton :content='reminder' @confirm="confirm"
 			@cancel="modalShow = false"></u-modal>
@@ -261,7 +261,7 @@
 	.title_name {
 		font-weight: 600;
 		font-size: 32rpx;
-		margin-left: 10rpx;
+		margin-right: 10rpx;
 	}
 
 	.keepRight {

+ 49 - 2
pages/order/delivery.vue

@@ -73,9 +73,11 @@
 			</view>
 			<view style="width: 100%;height: 120rpx;"></view>
 			<view class="card_btn">
-				<u-button style="margin-bottom: 20rpx;" type="primary" @click="submit">提交</u-button>
+				<u-button style="margin-bottom: 20rpx;" type="primary" :loading="loading" @click="submit">提交</u-button>
 			</view>
 		</view>
+		<u-modal :show="logoutShow" showCancelButton :title="title" :content='content' @cancel="cancel"
+			@confirm="confirm"></u-modal>
 	</view>
 </template>
 
@@ -84,6 +86,7 @@
 	export default {
 		data() {
 			return {
+				loading: false,
 				frequencyCoding: '',
 				navTitle: '',
 				selectiveType: '',
@@ -102,6 +105,10 @@
 					id: null,
 					name: '',
 				},
+				logoutShow: false,
+				title: '是否继续出库?',
+				content: '',
+				userInfo: {},
 			}
 		},
 		onUnload() {
@@ -111,6 +118,11 @@
 		onLoad(receive) {
 			this.navTitle = receive.title
 			this.selectiveType = receive.id
+			if (receive.id == 'enter') {
+				this.typeFlag = true
+			} else {
+				this.typeFlag = false
+			}
 		},
 		onShow() {
 			let incubator = uni.getStorageSync('incubatorValue')
@@ -127,6 +139,8 @@
 					this.coldCupboard.name = freezer.name
 				}
 			}
+			var userInfo = this.$cache.getCache('userInfo')
+			this.userInfo = userInfo
 		},
 		methods: {
 			focus(flag) {
@@ -147,6 +161,7 @@
 			async submit() {
 				await this.getEntering()
 				if (this.list.length > 0) {
+					this.loading = true
 					if (this.typeFlag) {
 						// 入库
 						this.$api.post('/api/ice-raft/in-storage', {
@@ -172,8 +187,33 @@
 									duration: 3000
 								});
 							}
+							this.loading = false
 						})
 					} else {
+						this.loading = false
+						this.$api.post('/api/ice-raft/isoutstorage', {
+							code: this.list,
+						}).then(res => {
+							if (res.code == 200) {
+								this.content = res.msg
+								this.logoutShow = true
+							} else if (res.code == 1201) {
+								this.confirm()
+							} else {
+								uni.$u.toast(res.msg)
+							}
+						})
+					}
+				} else {
+					uni.$u.toast('请先录入冰排编号')
+				}
+			},
+			// 确定
+			confirm() {
+				this.logoutShow = false
+				if (this.userInfo.dept) {
+					if (!this.userInfo.dept.isOutStorage) {
+						this.loading = true
 						// 出库
 						this.$api.post('/api/ice-raft/out-storage', {
 							code: this.list,
@@ -198,12 +238,19 @@
 									duration: 3000
 								});
 							}
+							this.loading = false
 						})
+					} else {
+						uni.$u.toast('冰排暂未到达冷冻要求')
 					}
 				} else {
-					uni.$u.toast('请先录入冰排编号')
+					uni.$u.toast('当前账户无公司信息')
 				}
 			},
+			// 取消
+			cancel() {
+				this.logoutShow = false
+			},
 			// 扫码录入
 			async getEntering() {
 				if (this.frequencyCoding) {

+ 58 - 22
pages/order/dispatching.vue

@@ -49,9 +49,11 @@
 			<view class="title_fake" style="margin-left: 20rpx;">防拆标签</view>
 			<x-form ref="goods" :list="goodsList" :model="goodsModel" :rules="goodsRules"></x-form>
 		</view>
-		<view class="btn_confirm_ching center_in">
-			<u-button style="margin: 0rpx 30rpx;" type="primary" text="确定" @click="confirm()"></u-button>
+		<view class="btn_print" @click="getDispatching()">
+			<u-button type="primary" :loading="loading" text="确定"></u-button>
 		</view>
+		<u-modal :show="logoutShow" showCancelButton :title="title" :content='content' @cancel="cancel"
+			@confirm="confirm"></u-modal>
 	</view>
 </template>
 
@@ -88,6 +90,11 @@
 				scrollTop: null,
 				waybillId: null,
 				deliveryId: null,
+				loading: false,
+				logoutShow: false,
+				title: '是否继续出库配送?',
+				content: '',
+				userInfo: {},
 			}
 		},
 		onUnload() {
@@ -127,6 +134,8 @@
 					this.getIceList(incubator.id)
 				}
 			}
+			var userInfo = this.$cache.getCache('userInfo')
+			this.userInfo = userInfo
 		},
 		methods: {
 			getempty() {
@@ -137,32 +146,19 @@
 				uni.removeStorageSync('incubatorValue');
 			},
 			// 确定配送
-			async confirm() {
+			async getDispatching() {
 				if (this.incubator.id) {
 					if (this.iceList.length > 0) {
 						let flag2 = await this.$refs['goods'].validateForm();
 						if (flag2) {
-							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,
+							this.$api.post('/api/ice-raft/isoutstorage', {
+								code: this.iceList,
 							}).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)
+									this.content = res.msg
+									this.logoutShow = true
+								} else if (res.code == 1201) {
+									this.confirm()
 								} else {
 									uni.$u.toast(res.msg)
 								}
@@ -175,6 +171,46 @@
 					uni.$u.toast('请先选择保温箱')
 				}
 			},
+			// 确定
+			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('冰排暂未到达冷冻要求')
+					}
+				} else {
+					uni.$u.toast('当前账户无公司信息')
+				}
+			},
+			// 取消
+			cancel() {
+				this.logoutShow = false
+			},
 			// 获取保温箱存在冰排
 			getIceList(iceId) {
 				this.$api.get('/api/ice-raft/cooler-box', {

+ 215 - 0
pages/order/distributionOrder.vue

@@ -0,0 +1,215 @@
+<template>
+	<!-- 分配订单 -->
+	<view>
+		<u-navbar title="分配订单" autoBack placeholder></u-navbar>
+		<view class="space_between card_Address">
+			<view class="title_waybill">收件人:</view>
+			<view class="card_flex_il" @click="addressBook('consignee')">
+				<u-icon name="order" size="22"></u-icon>
+				<view class="title_sou">收件人簿</view>
+			</view>
+		</view>
+		<x-form ref="recipients" :list="list" :model="recipientsModel" :rules="rules"></x-form>
+		<x-form ref="goods" :list="goodsList" :model="goodsModel" :rules="goodsRules" :addloading="addloading"
+			:productData="productData" @getSweep="getSweep"></x-form>
+		<view class="safeBottom" style="width: 100%;height: 180rpx;"></view>
+		<view class="btn_print" @click="printWaybill">
+			<u-button type="primary" text="确定"></u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		allocationRulesil,
+		allocationList
+	} from "./waybill.js";
+	export default {
+		data() {
+			return {
+				list: allocationRulesil(),
+				recipientsModel: {
+					name: '',
+					phone: '',
+					address: '',
+				},
+				rules: {
+					name: {
+						required: false,
+						message: '请输入姓名',
+						trigger: ['blur', 'change']
+					},
+					phone: {
+						required: true,
+						message: '请输入电话',
+						trigger: ['blur', 'change']
+					},
+					address: {
+						required: false,
+						message: '请输入地址',
+						trigger: ['blur', 'change']
+					},
+				},
+				goodsModel: {
+					drugBarCode: '',
+					prescription: [],
+				},
+				productData: [],
+				goodsRules: {},
+				goodsList: allocationList(),
+				addloading: false,
+				allocationSuccess: false,
+				waybillNo: '',
+			}
+		},
+		onUnload() {
+			// console.log('页面销毁')
+			uni.removeStorageSync('selectAddress')
+		},
+		onLoad(option) {
+			if (option.flag == 'true') {
+				this.allocationSuccess = true
+			}
+			this.waybillNo = option.waybillNo
+		},
+		onShow() {
+			let address = uni.getStorageSync('selectAddress')
+			if (address) {
+				this.$nextTick(() => {
+					this.$refs['recipients'].validateForm();
+				})
+				this.recipientsModel = address
+				this.saveConsigneeAddress = false
+			}
+		},
+		methods: {
+			// 选择类型
+			addressBook(type) {
+				this.operationType = type
+				uni.navigateTo({
+					url: '/pages/order/addressBook?type=' + type
+				});
+			},
+			// 确定分配订单
+			async printWaybill() {
+				let flag1 = await this.$refs['recipients'].validateForm();
+				if (flag1) {
+					if (this.productData.length > 0) {
+						let params = {
+							consigneeAddressName: this.recipientsModel.name,
+							consigneeAddressPhone: this.recipientsModel.phone,
+							consigneeAddressDetails: this.recipientsModel.address,
+							drugs: this.productData,
+							waybillNo: this.waybillNo,
+							prescription: this.goodsModel.prescription,
+						}
+						this.$api.post('/api/waybill/assignment', params).then(res => {
+							if (res.code == 200) {
+								uni.$emit('success', '成功');
+								if (this.allocationSuccess) {
+									uni.navigateBack({
+										delta: 1
+									});
+								} else {
+									uni.navigateBack({
+										delta: 2
+									});
+								}
+							}
+						})
+					} else {
+						uni.$u.toast('请扫描分配药品条形码')
+					}
+				}
+			},
+			// 获取药品信息码上放心
+			getSweep(event) {
+				let idExists = this.productData.some(obj => obj.code === event);
+				if (!idExists) {
+					this.addloading = true
+					uni.request({
+						url: 'https://public.coldbaozhida.com/Ali_msfx/codedetail', //仅为示例,并非真实接口地址。
+						method: 'GET',
+						header: {
+							'content-type': 'application/x-www-form-urlencoded', // 默认值
+						},
+						data: {
+							code: event,
+						},
+						success: (res) => {
+							if (res.data.status == 200) {
+								let arr = JSON.parse(res.data.data)
+								if (arr.result.models.length > 0) {
+									let drugList = {
+										code: '',
+										physic_name: '',
+										physic_type_desc: '',
+										pkg_spec_crit: '',
+										ent_name: '',
+									}
+									drugList.code = arr.result.models[0].code
+									drugList.physic_name = arr.result.models[0].drug_ent_base_d_t_o.physic_name
+									drugList.physic_type_desc = arr.result.models[0].drug_ent_base_d_t_o
+										.physic_type_desc
+									drugList.pkg_spec_crit = arr.result.models[0].drug_ent_base_d_t_o
+										.pkg_spec_crit
+									drugList.ent_name = arr.result.models[0].p_user_ent_d_t_o.ent_name
+									this.productData.push(drugList)
+									this.productData = this.uniqueArray(this.productData)
+								} else {
+									uni.$u.toast('该商品不存在')
+								}
+							}
+							this.addloading = false
+						}
+					});
+				} else {
+					uni.$u.toast('该商品已存在')
+				}
+			},
+			// 去重
+			uniqueArray(arr) {
+				return [...new Set(arr)];
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff !important;
+	}
+
+	.card_Address {
+		position: relative;
+	}
+
+	.card_flex_il {
+		display: flex;
+		align-items: center;
+		padding: 20rpx;
+	}
+
+	.title_waybill {
+		font-size: 32rpx;
+		padding: 20rpx;
+	}
+
+	.title_sou {
+		font-size: 32rpx;
+	}
+
+	.card_Address:before {
+		content: " ";
+		position: absolute;
+		left: 0;
+		bottom: 0;
+		width: 100%;
+		height: 1px;
+		border-top: 1px solid #e7e6e4;
+		-webkit-transform-origin: 0 0;
+		transform-origin: 0 0;
+		-webkit-transform: scaleY(0.5);
+		transform: scaleY(0.5);
+	}
+</style>

+ 15 - 1
pages/order/freezer.vue

@@ -50,7 +50,7 @@
 					{{item.iceRaftRecord.coolerBox.name}}
 				</view>
 				<view class="title_itemIce" v-if="item.iceRaftRecord.status != ''">冷冻要求:
-					<span>{{item.iceRaftRecord.freezeClaim}}h</span>
+					<span>{{getFreeze(item.iceRaftRecord.freezeClaim)}}</span>
 				</view>
 				<view class="title_itemIce" v-if="item.iceRaftRecord.status != ''">冷冻时间:
 					<span>{{formatMinutes(item.iceRaftRecord.freezeDuration)}}</span>
@@ -224,6 +224,10 @@
 					}).then(res => {
 						if (res.code == 200) {
 							uni.$u.toast('操作成功')
+							this.PageIndex = 1
+							this.loadingMore = true
+							this.list = []
+							this.getIceraftList()
 						}
 					})
 				} else {
@@ -283,6 +287,16 @@
 					}
 				})
 			},
+			// 冷冻要求
+			getFreeze(event) {
+				let title = event
+				let arrList = []
+				title.forEach(item => {
+					let arr = '≥' + item + 'h'
+					arrList.push(arr)
+				})
+				return arrList.toString()
+			},
 			sectionChange(index) {
 				this.current = index
 				if (index == 0) {

+ 3 - 1
pages/order/humiture.vue

@@ -77,7 +77,9 @@
 						if (item.collapseil) {
 							item.collapseil = false
 						} else {
-							this.$refs.humiture[index].getlist(item.deviceSensorList[0].T_id)
+							if (item.deviceSensorList) {
+								this.$refs.humiture[index].getlist(item.deviceSensorList[0].T_id)
+							}
 							item.collapseil = true
 						}
 					}

+ 14 - 4
pages/order/iceRaft.vue

@@ -25,10 +25,10 @@
 					</view>
 					<view class="card_Cooling_release" style="display: flex;flex-direction: column;">
 						<view style="display: flex;align-items: center;margin-top: 5rpx;">
-							<view class="title_ice1">冷冻要求:{{item.freezeClaim}}h</view>
-							<view class="cooling_release_title" v-if="isIceInfo.isIceReleaseCold">释冷温度:
-								<span>{{item.suitableForCold}}℃</span>
-							</view>
+							<view class="title_ice1">冷冻要求:{{getFreeze(item.freezeClaim)}}</view>
+						</view>
+						<view class="cooling_release_title" v-if="isIceInfo.isIceReleaseCold">释冷温度:
+							<span>{{item.suitableForCold}}℃</span>
 						</view>
 						<view class="cooling_release_title" v-if="isIceInfo.isIceReleaseCold">释冷地点:
 							{{item.iceColdAddress}}
@@ -134,6 +134,16 @@
 				});
 				console.log(value, '详情')
 			},
+			// 冷冻要求
+			getFreeze(event) {
+			  let title = event
+			  let arrList = []
+			  title.forEach(item => {
+			    let arr = '≥' + item + 'h'
+			    arrList.push(arr)
+			  })
+			  return arrList.toString()
+			},
 			geticeState(event) {
 				let title = ''
 				if (event == '2') {

+ 33 - 12
pages/order/index.vue

@@ -14,7 +14,8 @@
 		</view>
 		<view class="card_order_mangement" v-if="orderList.length > 0">
 			<x-orderManagement ref="order" :orderList="orderList" @sendOrders="sendOrders"
-				@operateSuccessfully="operateSuccessfully" @proofRenewal="proofRenewal" :key="Math.random()"></x-orderManagement>
+				@operateSuccessfully="operateSuccessfully" @proofRenewal="proofRenewal"
+				@definiteCompletion="operateSuccessfully" :key="keyId"></x-orderManagement>
 			<view style="width: 50%;">
 				<u-loadmore :status="loadStatus" :key="Math.random()" />
 				<!-- <u-divider v-if="loadingMore" :text="loading"></u-divider> -->
@@ -118,6 +119,7 @@
 				loadStatus: 'loadmore', //loading 、nomore
 				keyId: 0,
 				waybillId: null,
+				classifyId: null,
 			}
 		},
 		onUnload() {
@@ -125,11 +127,29 @@
 			this.getempty()
 		},
 		onShow() {
+			uni.$on('success', (data) => {
+				uni.$off('success')
+				this.currentPage = 1
+				this.orderList = []
+				this.$nextTick(() => {
+					this.getList()
+				})
+			})
 			let incubator = uni.getStorageSync('incubatorValue')
 			if (incubator) {
 				this.incubator.id = incubator.id
 				this.incubator.name = incubator.name
 			}
+			uni.$on('send', (data) => {
+				// try {
+				// } catch (error) {}
+				uni.$off('send')
+				this.currentPage = 1
+				this.orderList = []
+				this.$nextTick(() => {
+					this.getList()
+				})
+			})
 		},
 		onReachBottom() {
 			if (!this.loadingMore) {
@@ -144,14 +164,6 @@
 				}
 				this.getUpload(data)
 			})
-			uni.$on('send', (data) => {
-				// try {
-				// } catch (error) {}
-				uni.$off('send')
-				this.currentPage = 1
-				this.orderList = []
-				this.getList()
-			})
 			if (value.current) {
 				this.current = Number(value.current)
 			}
@@ -159,12 +171,14 @@
 			// console.log(userInfo, 25)
 			this.userInfo = userInfo
 			this.tableList = this.list
-			let statusType = ''
+			let statusType = null
 			if (this.current != 0 || this.current) {
 				statusType = this.tableList[this.current].id
 			}
 			this.status = statusType
-			this.getList()
+			this.$nextTick(() => {
+				this.getList()
+			})
 		},
 		methods: {
 			openCenter() {
@@ -188,12 +202,17 @@
 			},
 			// 获取司机和仓管运单列表
 			getList() {
+				uni.showLoading({
+					title: '加载中',
+					mask: true, // 是否显示透明蒙层,防止触摸穿透
+				})
 				this.loadStatus = 'loading'
 				this.loadingMore = true;
 				this.$api.get('/api/waybill', {
 					page: this.currentPage,
 					pageSize: this.pageSize,
 					status: this.status,
+					assignment_status: 2,
 				}).then(res => {
 					if (res.code == 200) {
 						const data = res.data.list
@@ -211,8 +230,10 @@
 							this.currentPage++
 						}
 					}
+					uni.hideLoading();
 					this.$forceUpdate()
 				}).catch(() => {
+					uni.hideLoading();
 					this.loadingMore = true
 					this.loadStatus = 'nomore'
 				})
@@ -232,7 +253,6 @@
 			},
 			// 重新获取列表
 			operateSuccessfully() {
-				console.log(111)
 				this.currentPage = 1
 				this.orderList = []
 				this.getList()
@@ -310,6 +330,7 @@
 				this.orderList = []
 				if (row) {
 					this.status = row.id
+					this.classifyId = row.id
 				}
 				this.getList()
 				this.getempty()

+ 4 - 1
pages/order/logisticsDetails.nvue

@@ -3,7 +3,8 @@
 	<view class="card_logist">
 		<view class="map_card">
 			<map style="width: 100%;" :style="{height:windowHeight * 2 + 'rpx'}" :latitude="latitude"
-				:longitude="longitude" :enable-3D="true" :scale="scale" :polyline="polylineList" :markers="markers" :v-if="showmap">
+				:longitude="longitude" :enable-3D="true" :scale="scale" :polyline="polylineList" :markers="markers"
+				:v-if="showmap">
 			</map>
 		</view>
 		<view class="card_logistics">
@@ -117,6 +118,8 @@
 								let yonTitle = ''
 								if (item.coolerBox.id) {
 									yonTitle = item.coolerBox.name
+								} else {
+									yonTitle = '运单号' + item.waybillNo
 								}
 								item.text = item.address + '【' + yonTitle + '】' + '  ' + '您的货物' +
 									arr

+ 69 - 23
pages/order/orderDetails.vue

@@ -10,13 +10,24 @@
 				<span class="card_state"
 					:style="{color:getState(orderList.status)}">{{orderStatus(orderList.status)}}</span>
 			</view>
+			<view class="title_delivery" v-if="productData && productData.length > 0">商品信息:</view>
+			<x-productList :list="productData"></x-productList>
+			<view class="card_prescription" v-if="orderList.prescription && orderList.prescription.length > 0">
+				<span>处方:</span>
+				<view style="display: flex;align-items: center;flex-wrap: wrap;">
+					<view style="margin-top: 10rpx;margin-right: 20rpx;" v-for="(item,index) in orderList.prescription" :key="index">
+						<u-image radius="4" :showLoading="true" :src="item" width="100px" height="80px"
+							@click="getUrl(item)"></u-image>
+					</view>
+				</view>
+			</view>
 			<view class="title_delivery">收件人:</view>
 			<x-orderCard :list="consigneeList"></x-orderCard>
-			<view class="title_delivery">配送人:</view>
-			<x-orderCard :list="delivererList" :deliverer="false"></x-orderCard>
+			<view class="title_delivery" v-if="userInfo.type != 3">配送人:</view>
+			<x-orderCard :list="delivererList" :deliverer="false" v-if="userInfo.type != 3"></x-orderCard>
 			<view class="title_delivery">复核人:</view>
 			<x-orderCard :list="senderList" :deliverer="false"></x-orderCard>
-			<view class="card_humiture">
+			<view class="card_humiture" v-if="orderList.status != 3">
 				<view class="title_claim" v-if="orderList.coolerBox.id">
 					<span>保温箱:</span>
 					<view style="width: auto;">
@@ -29,21 +40,13 @@
 						<u-tag :text="item1" plain size="mini"></u-tag>
 					</view>
 				</view>
-				<!-- <view class="card_ice_list" v-if="orderList.iceRaftCode">
-					<view class="card_ice_item" v-for="(item1,index1) in orderList.iceRaftCode">
-						<view style="display: flex;align-items: center;">
-							<span class="iconfont icon-bingpaiguanli icon_ice"></span>
-							<view class="ice_title">冰排12</view>
-						</view>
-						<view class="ice_code">{{item1}}</view>
-					</view>
-				</view> -->
 				<view class="card_anti_dismantle" v-if="orderList.tamperProofLabelImg">
 					<span>防拆标签图片:</span>
 					<view style="display: flex;">
 						<view style="margin-right: 20rpx;" v-for="(item,index) in getimagetamper(orderList)"
 							:key="index">
-							<u-image radius="4" :showLoading="true" :src="item" width="80px" height="80px"></u-image>
+							<u-image radius="4" :showLoading="true" :src="item" width="80px" height="80px"
+								@click="getUrl(item)"></u-image>
 						</view>
 					</view>
 				</view>
@@ -55,7 +58,7 @@
 				</view>
 				<view class="title_claim"><span>备注:</span>{{orderList.remark}}</view>
 			</view>
-			<view class="card_examine" v-if="orderList.status != 1">
+			<view class="card_examine" v-if="orderList.status != 3">
 				<view class="examine_title center_in">
 					<view class="line_back" @click="logistics">查看物流详情</view>
 				</view>
@@ -69,15 +72,16 @@
 					<view class="order_item_title">{{item.title}}</view>
 				</view>
 			</view>
-			<!-- <view v-if="orderList.status != 1">
-				<view class="line_back" style="margin-top: 40rpx;" @click="logistics">查看物流详情</view>
-				<view class="line_back" @click="goHumiture">查看温湿度</view>
-			</view> -->
-			<view style="width: 100%;height: 80rpx;"></view>
+			<view class="safeBottom" style="width: 100%;height: 180rpx;"></view>
+		</view>
+		<view class="btn_distribute" v-if="orderList.status == 4 && orderList.is_secondary_distribution">
+			<u-button style="margin-bottom: 20rpx;" type="primary" @click="coolingRelease">分配订单</u-button>
 		</view>
-		<!-- <view class="btn_print" v-if="type == 'details' && orderList.status == 2 || orderList.status == 3">
-			<u-button type="primary" text="打印条码"></u-button>
-		</view> -->
+		<u-overlay :show="overlayShow" @click="overlayShow = false">
+			<view class="center_in" style="width: 100%;height: 100%;">
+				<image style="width: 100%;height: auto;" :src="overlayURL" mode="widthFix"></image>
+			</view>
+		</u-overlay>
 	</view>
 </template>
 
@@ -111,6 +115,9 @@
 					url: '',
 				}],
 				userInfo: {},
+				productData: [],
+				overlayShow: false,
+				overlayURL: '',
 			}
 		},
 		onLoad(value) {
@@ -121,6 +128,7 @@
 		onShow() {
 			var orderList = this.$cache.getCache('orderDetails')
 			this.orderList = orderList
+			this.productData = orderList.drugs
 			this.senderList.name = orderList.reCheck.nickName
 			this.senderList.phone = orderList.reCheck.phone
 			this.consigneeList.name = orderList.consigneeAddressName
@@ -136,6 +144,18 @@
 			}
 		},
 		methods: {
+			// 查看图片
+			getUrl(event) {
+				console.log(event, 98)
+				this.overlayURL = event
+				this.overlayShow = true
+			},
+			// 分配订单
+			coolingRelease() {
+				uni.navigateTo({
+					url: '/pages/order/distributionOrder?waybillNo=' + this.orderList.waybillNo
+				});
+			},
 			// 物流详情
 			logistics() {
 				uni.navigateTo({
@@ -175,7 +195,7 @@
 			getimagetamper(value) {
 				let arr = value.tamperProofLabelImg.split(',')
 				return arr
-			}
+			},
 		}
 	}
 </script>
@@ -213,6 +233,19 @@
 		margin: 10rpx 0rpx 10rpx 10rpx;
 	}
 
+	.card_prescription {
+		margin-top: 20rpx;
+		padding: 20rpx;
+		border-radius: 10rpx;
+		background-color: #fff;
+
+		span {
+			font-size: 28rpx;
+			color: #909399;
+			margin-bottom: 10rpx;
+		}
+	}
+
 	.card_humiture {
 		margin-top: 30rpx;
 		// border-radius: 20rpx;
@@ -320,4 +353,17 @@
 	.examine_title:nth-child(1) {
 		border-right: 1rpx solid #e7e6e4;
 	}
+
+	.btn_distribute {
+		position: fixed;
+		z-index: 2;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		padding: 20rpx 30rpx 20rpx 30rpx;
+		background-color: #fff;
+		padding-bottom: constant(safe-area-inset-bottom); //兼容 IOS<11.2
+		padding-bottom: env(safe-area-inset-bottom); //兼容 IOS>11.2
+		border-top: 1rpx solid #E4E7ED;
+	}
 </style>

+ 68 - 3
pages/order/waybill.js

@@ -12,17 +12,41 @@ export const formRules = () => {
 		type: 'selectiveSearch',
 		required: true,
 	}, {
+		field: 'is_secondary_distribution',
+		label: '二次分配',
+		placeholder: '是否二次分配',
+		type: 'switch',
+		required: true,
+	}, {
+		field: 'drugBarCode',
+		label: '扫描药品条形码',
+		placeholder: '请扫描药品条形码',
+		type: 'drugBarCode',
+		required: true,
+		clearable: true,
+	}, {
+		type: 'divider',
+	}, {
+		field: 'prescription',
+		label: '处方',
+		placeholder: '请上传处方',
+		type: 'upload',
+		required: false,
+		fileList1: [],
+	}, {
 		field: 'tamperProofLabel',
 		label: '防拆标签码',
-		placeholder: '请输入防拆标签码',
+		placeholder: '请扫描防拆标签码',
 		type: 'input',
-		required: true,
+		required: false,
+		clearable: true,
 	}, {
 		field: 'tamperProofLabelImg',
 		label: '防拆标签图片',
 		placeholder: '请上传防拆标签图片',
 		type: 'upload',
-		required: true,
+		required: false,
+		fileList1: [],
 	}, {
 		field: 'remark',
 		label: '备注',
@@ -52,6 +76,27 @@ export const pickupRulesil = () => {
 		required: true,
 	}]
 }
+export const allocationRulesil = () => {
+	return [{
+		field: 'name',
+		label: '姓名',
+		placeholder: '请输入姓名',
+		type: 'input',
+		required: false,
+	}, {
+		field: 'phone',
+		label: '电话',
+		placeholder: '请输入电话',
+		type: 'input',
+		required: true,
+	}, {
+		field: 'address',
+		label: '地址',
+		placeholder: '请输入地址',
+		type: 'input',
+		required: false,
+	}]
+}
 export const iceRaftRulesil = () => {
 	return [{
 		field: 'code',
@@ -122,4 +167,24 @@ export const printList = () => {
 		type: 'input',
 		required: true,
 	}]
+}
+// 分配订单
+export const allocationList = () => {
+	return [{
+		field: 'drugBarCode',
+		label: '扫描药品条形码',
+		placeholder: '请扫描药品条形码',
+		type: 'drugBarCode',
+		required: true,
+		clearable: true,
+	}, {
+		type: 'divider',
+	}, {
+		field: 'prescription',
+		label: '处方',
+		placeholder: '请上传处方',
+		type: 'upload',
+		required: false,
+		fileList1: [],
+	}]
 }