scw пре 2 месеци
родитељ
комит
192173afd0

+ 11 - 0
App.vue

@@ -1,3 +1,6 @@
+<view>
+	dsadasdasd
+</view>
 <script>
 	export default {
 		onLaunch: function(options) {
@@ -190,6 +193,14 @@
 	text {
 		font-family: FZZhunYuan-M02S;
 	}
+	.flex-ac{
+		display: flex;
+		align-items: center;
+	}
+	.flex-dc{
+		display: flex;
+		flex-direction: column;
+	}
 	.flex-box-r{
 		display: flex;
 		align-items: center;

+ 157 - 0
api/hospital.js

@@ -0,0 +1,157 @@
+// 使用的接口  开始
+//获取与管理老师关联的医院列表
+export const getHospitalListByManage = (params) => {
+	return uni.$u.http.get(`/info/hospital/teacher/simpleList`, {
+		params: params,
+	})
+}
+
+//查看护工列表
+export const getNurseList = (params) => {
+	return uni.$u.http.get(`/info/nursingWorker/list`, {
+		params: params,
+	})
+}
+
+//查看护工详情
+export const getNurseDetail = (id) => {
+	return uni.$u.http.get(`/info/nursingWorker/info/${id}`)
+}
+
+//新增护工信息
+export const addNurseInfo = (data) => {
+	return uni.$u.http.post(`/info/nursingWorker/add`, data)
+}
+
+//修改护工信息
+export const updateNurseInfo = (data) => {
+	return uni.$u.http.post(`/info/nursingWorker/edit`, data)
+}
+
+//获取护工工作台的信息
+export const getNurseInfo = (params) => {
+	return uni.$u.http.get(`/info/nursingWorker/workbench`, {
+		params: params,
+	})
+
+}
+
+//获取管理老师工作台信息
+export const getManageInfo = (params) => {
+	return uni.$u.http.get(`/info/managementTeacher/workbench`, {
+		params: params,
+	})
+
+}
+
+
+//查询管理老师订单列表
+export const getManageOrderList = (params) => {
+	return uni.$u.http.get(`/teacher/order/page`, {
+		params: params,
+
+	})
+
+}
+
+//分配护工
+export const assignNurse = (data) => {
+	return uni.$u.http.post(`/teacher/order/assignWorker`, data)
+
+}
+
+//获取科室列表
+export const getDepartmentList = (params) => {
+	return uni.$u.http.get(`/info/hospitalDepartment/list`, {
+		params: params,
+	})
+}
+
+//获取管理老师关联的科室列表
+export const getDepartmentListByManage = (params) => {
+	return uni.$u.http.get(`/info/hospitalDepartment/teacher/simpleList`, {
+		params: params,
+
+	})
+
+}
+
+///获取管理老师关联的科室订单统计
+export const getDepartmentOrderCount = (params) => {
+	return uni.$u.http.get(`/info/hospitalDepartment/teacher/statistics`, {
+		params: params,
+	})
+}
+
+//获取护工电话
+export const getNursePhone = (id) => {
+	return uni.$u.http.get(`/teacher/order/getWorkerPhone/${id}`)
+
+}
+
+//获取管理老师电话
+export const getManagePhone = (id) => {
+	return uni.$u.http.get(`/worker/order/getManagerPhone/${id}`)
+}
+
+//取消订单
+export const cancelOrderManage = (id) => {
+	return uni.$u.http.post(`/teacher/order/cancel/${id}`)
+
+}
+
+//获取管理老师订单详细信息
+export const getOrderDetailManage = (id) => {
+	return uni.$u.http.get(`/teacher/order/info/${id}`)
+}
+
+//获取护工订单详细信息
+export const getOrderDetailNurse = (id) => {
+	return uni.$u.http.get(`/worker/order/info/${id}`)
+}
+
+//开始服务
+export const startService = (id) => {
+	return uni.$u.http.post(`/worker/order/startService/${id}`)
+
+}
+
+//完成服务
+export const finishService = (id) => {
+	return uni.$u.http.post(`/worker/order/finishService/${id}`)
+
+}
+
+//护工订单
+export const getNurseOrderList = (params) => {
+	return uni.$u.http.get(`/worker/order/page`, {
+		params: params,
+
+	})
+}
+
+//新增售后订单
+export const addAfterSaleOrder = (data) => {
+	return uni.$u.http.post(`/orderRefund/add`, data)
+}
+
+
+//查询管理老师的售后订单列表
+export const getAfterSaleOrderList = (params) => {
+	return uni.$u.http.get(`/teacher/orderRefund/page`, {
+		params: params,
+	})
+}
+
+//同意或则拒绝售后订单
+export const agreeOrRefuseAfterSaleOrder = (data) => {
+	return uni.$u.http.post(`/teacher/orderRefund/agreeOrRefuse`, data)
+}
+
+
+
+
+
+
+
+// 使用的接口  结束

+ 36 - 3
api/order.js

@@ -46,17 +46,50 @@ export const getPrivacy = (params) => {
 
 //获取默认就诊人
 export const getDefaultPatient = () => {
-  return uni.$u.http.get(`/patient/patient/getDefaulted`)
+	return uni.$u.http.get(`/patient/patient/getDefaulted`)
 }
 
 //取消订单
-export const cancelOrder = (id) => { 
+export const cancelOrder = (id) => {
 	return uni.$u.http.post(`/order/order/cancel/${id}`)
 }
 
+//查询售后订单列表
+export const getAfterSaleOrderList = (params) => {
+	return uni.$u.http.get(`/orderRefund/page`, {
+		params: params,
+	})
+}
+
+//获取退款状态枚举
+export const getRefundStatus = (params) => {
+	return uni.$u.http.get(`/orderRefund/enum`, {
+		params: params,
+	})
+}
+
+//查询售后订单详情
+export const getAfterSaleOrderDetail = (id) => {
+	return uni.$u.http.get(`/orderRefund/info/${id}`)
+}
+
+//取消售后订单
+export const cancelAfterSaleOrder = (id) => {
+	return uni.$u.http.post(`/orderRefund/cancel/${id}`)
+}
 
+//查询服务电话列表
+export const getServicePhoneList = (params) => {
+	return uni.$u.http.get(`/info/operatingPhone/list`, {
+		params: params,
+	})
+}
 
+//评价订单
+export const evaluateOrder = (data) => {
+	return uni.$u.http.post(`/order/order/evaluate`, data)
+}
 
 
-// 使用的接口  结束
 
+// 使用的接口  结束

+ 3 - 2
config/request.js

@@ -12,8 +12,9 @@ module.exports = (vm) => {
 	// config.baseURL = 'http://192.168.0.17:8299/api'; /* 根域名 */
     // config.baseURL = 'http://192.168.0.151:8299/api'; /* 根域名 */
     // config.baseURL = 'https://bwshop.caiquanwang.com.cn/prod-api/api'
-	config.baseURL = 'http://192.168.0.70:8181/api'; //郭
-	// config.baseURL = 'https://peihu.songlanyun.com/prod-api/api'
+	// config.baseURL = 'http://192.168.0.70:8181/api'; //郭
+	// config.baseURL = 'http://192.168.0.236:8181/api'; //白
+	config.baseURL = 'https://peihu.songlanyun.com/prod-api/api'
     // config.baseURL = 'https://wrj.songlanyun.com/prod-api/api'; /* 根域名 */
     return config
   })

+ 110 - 46
pages.json

@@ -3,52 +3,116 @@
 		"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
 	},
 	"pages": [{
-		"path": "pages/tabBar/index",
-		"style": {
-			"navigationBarTitleText": "润护通",
-			"enablePullDownRefresh": true,
-			"enableShareAppMessage": true // 开启分享
-			
-		}
-	}, {
-		"path": "pages/tabBar/order",
-		"style": {
-			"navigationBarTitleText": "我的订单",
-			"enablePullDownRefresh": true
-		}
-	}, {
-		"path": "pages/order/orderDetails",
-		"style": {
-			"navigationBarTitleText": "订单详情",
-			"enablePullDownRefresh": true
-		}
-	}, {
-		"path": "pages/tabBar/mine",
-		"style": {
-			"navigationBarTitleText": "我的",
-			"enablePullDownRefresh": true
-		}
-	}, {
-		"path": "pages/order/placeAnOrder",
-		"style": {
-			"navigationBarTitleText": "下单"
-		}
-	}, {
-		"path": "pages/order/chooseService",
-		"style": {
-			"navigationBarTitleText": "选择服务"
-		}
-	}, {
-		"path": "pages/login/index",
-		"style": {
-			"navigationBarTitleText": "登录"
-		}
-	}, {
-		"path": "pages/web-view/web",
-		"style": {
-			"navigationBarTitleText": "第三方网站"
+			"path": "pages/tabBar/index",
+			"style": {
+				"navigationBarTitleText": "润护通",
+				"enablePullDownRefresh": true,
+				"enableShareAppMessage": true // 开启分享
+
+			}
+		}, {
+			"path": "pages/tabBar/mine",
+			"style": {
+				"navigationBarTitleText": "我的",
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+			"path": "pages/workbench/refundOrder",
+			"style": {
+				"navigationBarTitleText": "退款订单"
+			}
+		}, {
+			"path": "pages/tabBar/order",
+			"style": {
+				"navigationBarTitleText": "我的订单",
+				"enablePullDownRefresh": true
+			}
+		}, {
+			"path": "pages/workbench/order/list",
+			"style": {
+				"navigationBarTitleText": "订单",
+				"enablePullDownRefresh": true
+			}
+		}, {
+			"path": "pages/workbench/manager",
+			"style": {
+				"navigationBarTitleText": "管理老师工作台",
+				"enablePullDownRefresh": true
+			}
+		}, {
+			"path": "pages/workbench/order/orderDetails",
+			"style": {
+				"navigationBarTitleText": "订单详情",
+				"enablePullDownRefresh": true
+			}
+		}, {
+			"path": "pages/order/refundDetails",
+			"style": {
+				"navigationBarTitleText": "退款详情",
+				"enablePullDownRefresh": true
+			}
+		}, {
+			"path": "pages/workbench/caregiverManage",
+			"style": {
+				"navigationBarTitleText": "护工管理"
+			}
+		}, {
+			"path": "pages/workbench/caregiverForm",
+			"style": {
+				"navigationStyle": "custom",
+				"navigationBarTitleText": "新增护工"
+			}
+		}, {
+			"path": "pages/workbench/caregiver",
+			"style": {
+				"navigationBarTitleText": "护工工作台",
+				"enablePullDownRefresh": true
+			}
+		}, {
+			"path": "pages/workbench/caregiverDetails",
+			"style": {
+				"navigationBarTitleText": "护工详情"
+			}
+		}, {
+			"path": "pages/workbench/managementDept",
+			"style": {
+				"navigationBarTitleText": "查看管理科室"
+			}
+		}, {
+			"path": "pages/order/orderDetails",
+			"style": {
+				"navigationBarTitleText": "订单详情",
+				"enablePullDownRefresh": true
+			}
+		}, {
+			"path": "pages/order/placeAnOrder",
+			"style": {
+				"navigationBarTitleText": "下单"
+			}
+		}, {
+			"path": "pages/order/chooseService",
+			"style": {
+				"navigationBarTitleText": "选择服务"
+			}
+		}, {
+			"path": "pages/login/index",
+			"style": {
+				"navigationBarTitleText": "登录"
+			}
+		}, {
+			"path": "pages/web-view/web",
+			"style": {
+				"navigationBarTitleText": "第三方网站"
+			}
+		},
+		{
+			"path": "pages/order/applyRefund",
+			"style": {
+				"navigationBarTitleText": "申请退款"
+			}
 		}
-	}],
+	],
 	"subpackages": [
 		// {
 		// 	"root": "pages/order",
@@ -239,7 +303,7 @@
 	"tabBar": {
 		"color": "#333333",
 		"backgroundColor": "#ffffff",
-		"selectedColor": "#1A56A6",//选中时字体颜色
+		"selectedColor": "#1A56A6", //选中时字体颜色
 		"list": [{
 				"pagePath": "pages/tabBar/index",
 				"iconPath": "/static/tabBar/home.png",

+ 509 - 0
pages/order/applyRefund.vue

@@ -0,0 +1,509 @@
+<template>
+	<view class="container">
+		<view class="order-info">
+			<image :src="orderInfo.hospitalVo.logoUrl" mode="aspectFill"></image>
+			<view class="info-content">
+				<span class="name">{{orderInfo.hospitalVo.name || '-'}}</span>
+				<span class="address">
+					<u-icon name="map" color="#999999" size="14"></u-icon>
+					<span class="txt">{{orderInfo.hospitalVo.address || '-'}}</span>
+				</span>
+				<!-- <span class="area">所属区:{{orderInfo.hospitalVo.areaName || '-'}}</span> -->
+			</view>
+		</view>
+		<view class="info-box">
+			<view class="info-item">
+				<span class="title">所在科室</span>
+				<span class="txt">{{orderInfo.hospitalDepartmentName || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">房床号</span>
+				<span class="txt">{{orderInfo.roomNumber || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item info-item-spa">
+				<span class="title">备注</span>
+				<span class="txt">{{orderInfo.remarks || '-'}}</span>
+			</view>
+		</view>
+		<view class="info-box">
+			<view class="info-item">
+				<span class="title">就诊人</span>
+				<span class="txt">{{orderInfo.patientVo.name || '-'}}({{orderInfo.patientVo.mobile || '-'}})</span>
+			</view>
+		</view>
+		<view class="info-box">
+			<view class="info-item">
+				<span class="title">服务产品</span>
+				<span class="txt">{{orderInfo.serviceName || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">期望时间</span>
+				<span class="txt">{{orderInfo.expectedTime || '-'}}</span>
+			</view>
+		</view>
+
+		<!-- 基本信息 -->
+		<view class="info-box">
+			<span class="title-m">基本信息</span>
+			<view class="info-item">
+				<span class="title">订单号</span>
+				<span class="txt">{{orderInfo.orderNo || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">下单时间</span>
+				<span class="txt">{{orderInfo.createTime || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">下单数量</span>
+				<span class="txt">{{orderInfo.orderNum || '-'}}({{ getUnitTxt(orderInfo.serviceUnit) }})</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">销售价格</span>
+				<span class="txt">¥{{orderInfo.sellingPrice || "0.00"}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">应付金额</span>
+				<span class="txt">¥{{orderInfo.totalPrice || "0.00"}}</span>
+			</view>
+		</view>
+		<view class="info-box">
+			<span class="title-m">退款信息</span>
+
+			<view class="form-box">
+				<u--form labelWidth="140rpx" :model="formData" :rules="rules" ref="uForm">
+					<u-form-item label="退款原因" prop="refundReason" borderBottom @click="showReason = true" required>
+						<u-input :border="none" disabled v-model="formData.refundReason" disabledColor="#ffffff"
+							placeholder="请选择" inputAlign="right" />
+						<u-icon slot="right" name="arrow-right" color="#999999"></u-icon>
+					</u-form-item>
+					<u-form-item label="退款数量" prop="refundQuantity" borderBottom required>
+						<view class="switch-box">
+							<u-number-box v-model="formData.refundQuantity" :max="orderInfo.orderNum"
+								min="1"></u-number-box>
+						</view>
+					</u-form-item>
+
+					<u-form-item label="退款金额" prop="refundAmount" borderBottom required>
+						<u--input type="number" maxlength="9" v-model="formData.refundAmount"
+							placeholder-class="input-placeholder" border="none" clearable placeholder="请输入"
+							inputAlign="right"></u--input>
+					</u-form-item>
+
+					<u-form-item label="退款方式" prop="refundWayName" borderBottom>
+						<u--input v-model="formData.refundWayName" placeholder-class="input-placeholder" border="none"
+							clearable placeholder="请输入" disabled inputAlign="right"></u--input>
+					</u-form-item>
+
+
+					<u-form-item label="退款说明" prop="refundDesc" borderBottom labelPosition="top">
+						<u--textarea v-model="formData.refundDesc" placeholder="请输入退款说明,非必填"
+							height="200rpx"></u--textarea>
+					</u-form-item>
+
+				</u--form>
+			</view>
+		</view>
+
+		<view class="footer-btn">
+			<span class="btn" @click="submitForm">确认提交</span>
+		</view>
+
+
+		<u-action-sheet :show="showReason" :actions="reasonList" title="请选择性别" @close="showReason = false"
+			@select="reasonSelect" safeAreaInsetBottom>
+		</u-action-sheet>
+	</view>
+</template>
+
+<script>
+	import {
+		dictData
+	} from "@/api/home.js"
+	import {
+		getOrderDetail,
+		getServiceUnit,
+	} from '@/api/order.js'
+	import {
+		addAfterSaleOrder
+	} from '@/api/hospital.js'
+	export default {
+		data() {
+			return {
+				unitList: [],
+				orderInfo: {},
+				orderId: '',
+				showReason: false,
+				formData: {
+					refundReason: '',
+					refundQuantity: 1,
+					refundAmount: '',
+					refundWay: '原路返回'
+				},
+				reasonList: [],
+				rules: {
+					refundReason: [{
+						required: true,
+						message: '请选择退款原因',
+						trigger: ['blur', 'change'],
+
+					}],
+					// refundQuantity: [{
+					// 	required: true,
+					// 	message: '请输入退款数量',
+					// 	trigger: ['blur', 'change'],
+
+					// }],
+					// refundAmount: [{
+					// 	required: true,
+					// 	message: '请输入退款金额',
+					// 	trigger: ['blur', 'change'],
+					// }],
+				}
+			}
+		},
+		//计算refundAmount
+		computed: {
+			refundAmount() {
+				this.formData.refundAmount = this.formData.refundQuantity * this.orderInfo.sellingPrice;
+				return this.formData.refundQuantity * this.orderInfo.sellingPrice;
+			}
+
+		},
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+		},
+		onLoad(options) {
+			if (options.id) {
+				this.orderId = options.id;
+			}
+			this.getServiceUnit();
+			this.getReasonList()
+			this.getRefundMethod()
+		},
+		onShow() {
+			this.getInfoById(this.orderId);
+		},
+		methods: {
+
+			//获取退款原因
+			getReasonList() {
+				let that = this;
+				dictData('reason_refund').then(res => {
+					let data = res.data;
+					data.forEach(item => {
+						item.name = item.dictLabel
+					})
+					that.reasonList = data;
+
+				}, err => {
+					console.log(err);
+				}).finally(() => {
+
+				});
+			},
+
+			//获取退款方式
+			getRefundMethod() {
+				let that = this;
+				dictData('refund_way').then(res => {
+					let data = res.data;
+					data.forEach(item => {
+						item.name = item.dictLabel
+					})
+					that.formData.refundWay = data[0].dictValue;
+					that.formData.refundWayName = data[0].name
+				}, err => {
+					console.log(err);
+				}).finally(() => {
+
+				});
+			},
+
+			reasonSelect(e) {
+				this.formData.refundReason = e.dictValue;
+			},
+			getUnitTxt(value) {
+				let obj = this.unitList.find(item => item.code == value);;
+				return obj ? obj.value : ''
+			},
+			getInfoById(id) {
+				let that = this;
+				uni.showLoading({
+					title: '加载中',
+					mask: true,
+				});
+				getOrderDetail(id).then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							that.orderInfo = data;
+						}
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+					.finally(() => {
+						uni.hideLoading();
+					});
+			},
+			//查询单位
+			getServiceUnit() {
+				let that = this;
+				getServiceUnit().then(res => {
+						if (res.code == 200) {
+							that.unitList = res.data.serviceUnit;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+
+			},
+
+			submitForm() {
+				console.log("formData", this.formData);
+				this.$refs.uForm.validate().then((res) => {
+						if (res) {
+							this.formData.orderId = this.orderId;
+							addAfterSaleOrder(this.formData).then(res => {
+								uni.$u.toast('添加成功');
+								setTimeout(() => {
+									uni.navigateBack({
+										delta: 1,
+									});
+								}, 1000)
+							}, err => {
+								console.log(err);
+							}).finally(() => {
+
+							});
+						}
+					})
+					.catch((errors) => {
+						console.log(",errors", errors);
+						uni.$u.toast('校验失败');
+					});
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.container {
+		padding: 20rpx 20rpx 200rpx;
+
+		.order-info {
+			display: flex;
+			align-items: center;
+			padding: 20rpx;
+			background: #fff;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+
+			image {
+				width: 180rpx;
+				height: 180rpx;
+				border-radius: 10rpx;
+				margin-right: 20rpx;
+			}
+
+			.info-content {
+				display: flex;
+				flex-direction: column;
+				flex: 1;
+
+				.name {
+					word-break: break-all;
+					font-size: 32rpx;
+					color: #333;
+					font-weight: bold;
+				}
+
+				.address {
+					font-size: 28rpx;
+					color: #666;
+					margin-top: 20rpx;
+
+					width: 100%;
+					font-weight: 500;
+					line-height: 35rpx;
+					display: flex;
+					justify-content: flex-start;
+					align-items: flex-start;
+					overflow: hidden; //超出的文本隐藏
+					text-overflow: ellipsis; //溢出用省略号显示
+					white-space: normal; //处理元素中的 空白
+					display: -webkit-box;
+					-webkit-line-clamp: 2;
+					-webkit-box-orient: vertical;
+					display: -moz-box;
+					-moz-line-clamp: 2;
+					-moz-box-orient: vertical;
+					overflow-wrap: break-word;
+					word-break: break-all;
+
+					::v-deep .u-icon {
+						display: inline-block;
+					}
+
+					.txt {
+						margin-left: 15rpx;
+					}
+				}
+
+				.area {
+					font-size: 28rpx;
+					color: #666;
+					margin-top: 10rpx;
+				}
+			}
+		}
+
+		.info-box {
+			padding: 20rpx;
+			background: #fff;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+
+			.info-item {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding: 30rpx 0;
+
+				.title {
+					width: 250rpx;
+					font-size: 28rpx;
+					color: #333;
+				}
+
+				.txt {
+					/* flex: 1; */
+					max-width: 540rpx;
+					text-align: left;
+					font-size: 28rpx;
+					color: #757575;
+				}
+			}
+
+			.info-item-spa {
+				align-items: flex-start;
+				flex-direction: column;
+
+				.txt {
+					margin-left: 0;
+					margin-top: 20rpx;
+					text-align: left;
+				}
+			}
+
+			.tip-txt {
+				padding: 30rpx 0;
+				font-size: 28rpx;
+				color: #333;
+			}
+		}
+
+		.title-m {
+			/* 竖线和文字对齐 */
+			display: flex;
+			align-items: center;
+			padding: 20rpx 0;
+			font-size: 28rpx;
+			color: #333;
+			font-weight: bold;
+			line-height: 28rpx;
+
+			/* 左边加一个竖线 */
+			&::before {
+				content: '';
+				display: inline-block;
+				width: 6rpx;
+				height: 30rpx;
+				background: #4B91D1;
+				margin-right: 10rpx;
+			}
+		}
+
+		.form-box {
+			padding: 20rpx;
+			background-color: #fff;
+
+			::v-deep .u-input {
+				padding: 15rpx !important;
+			}
+
+			::v-deep .u-upload {
+				margin-top: 15rpx;
+			}
+
+			.upload-box {
+				margin-top: 20rpx;
+
+				.name-box {
+					display: flex;
+					align-items: center;
+					margin-top: 20rpx;
+
+					.btn {
+						padding: 10rpx 20rpx;
+						background-color: #4B91D1;
+						color: #fff;
+						border-radius: 10rpx;
+						margin-left: 20rpx;
+						border: 1rpx solid #4B91D1;
+					}
+
+					.btn2 {
+						background-color: #fff;
+						color: #FF0000;
+						border: 1rpx solid #FF0000;
+					}
+				}
+			}
+
+			.switch-box {
+				display: flex;
+				align-items: center;
+				justify-content: flex-end;
+				padding: 20rpx 0;
+
+				.name {
+					margin-right: 20rpx;
+					font-size: 30rpx;
+				}
+			}
+		}
+
+		.footer-btn {
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			width: 100%;
+			padding: 50rpx 30rpx;
+			box-sizing: border-box;
+			font-size: 28rpx;
+			background-color: #fff;
+			box-shadow: 0 -2rpx 30rpx #c5c5c53a;
+
+			.btn {
+				display: block;
+				width: 100%;
+				padding: 20rpx 0;
+				border: 1rpx solid #4B91D1;
+				background-color: #4B91D1;
+				border-radius: 40rpx;
+				color: #fff;
+				text-align: center;
+			}
+		}
+
+	}
+</style>

+ 479 - 12
pages/order/orderDetails.vue

@@ -3,7 +3,9 @@
 		<view class="info-box order-status">
 			<view class="status-text">
 				<span class="status">订单状态:{{getStatusTxt(orderInfo.status)}}</span>
+				<span v-if="orderInfo.hasRefund">(有退款)</span>
 			</view>
+			<view class="refund-btn" v-if="orderInfo.hasRefund" @click="viewRefund">查看退款信息</view>
 		</view>
 		<view class="order-info">
 			<image :src="orderInfo.hospitalVo.logoUrl" mode="aspectFill"></image>
@@ -46,9 +48,11 @@
 			<u-line></u-line>
 			<view class="info-item">
 				<span class="title">期望时间</span>
-				<span class="txt">{{orderInfo.expectedTime}}</span>
+				<span class="txt">{{orderInfo.expectedTime || '-'}}</span>
 			</view>
 		</view>
+
+		<!-- 基本信息 -->
 		<view class="info-box">
 			<span class="title-m">基本信息</span>
 			<view class="info-item">
@@ -58,13 +62,12 @@
 			<u-line></u-line>
 			<view class="info-item">
 				<span class="title">下单时间</span>
-				<span class="txt">{{orderInfo.createTime}}</span>
+				<span class="txt">{{orderInfo.createTime || '-'}}</span>
 			</view>
 			<u-line></u-line>
 			<view class="info-item">
 				<span class="title">下单数量</span>
-				<span
-					class="txt">{{orderInfo.orderNum || '-'}}({{  getUnitTxt(orderInfo.serviceUnit) }})</span>
+				<span class="txt">{{orderInfo.orderNum || '-'}}({{ getUnitTxt(orderInfo.serviceUnit) }})</span>
 			</view>
 			<u-line></u-line>
 			<view class="info-item">
@@ -77,6 +80,128 @@
 				<span class="txt">¥{{orderInfo.totalPrice || "0.00"}}</span>
 			</view>
 		</view>
+
+		<!-- 护工信息 -->
+		<view class="info-box">
+			<span class="title-m">护工信息</span>
+			<view class="info-item">
+				<span class="title">姓名</span>
+				<span class="txt">{{orderInfo.orderWorkerChangeRecord.workerName || '-'}}</span>
+			</view>
+			<!-- <u-line></u-line>
+			<view class="info-item">
+				<span class="title">电话</span>
+				<span class="txt">{{orderInfo.createTime || '-'}}</span>
+			</view> -->
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">性别</span>
+				<span class="txt">{{orderInfo.orderWorkerChangeRecord.sex == 1 ? '男' : '女' || '-'}}</span>
+			</view>
+		</view>
+
+		<!-- 服务信息 -->
+		<view class="info-box" v-if="orderInfo.status != '1' || orderInfo.status != '2'">
+			<span class="title-m">服务信息</span>
+			<view class="info-item">
+				<span class="title">开始时间</span>
+				<span class="txt">{{orderInfo.orderWorkerChangeRecord.workerStartTime || '-'}}</span>
+			</view>
+			<u-line></u-line>
+
+			<view class="info-item">
+				<span class="title">完成时间</span>
+				<span class="txt">{{orderInfo.orderWorkerChangeRecord.workerEndTime || '-'}}</span>
+			</view>
+		</view>
+
+		<!-- 评价信息 -->
+		<view class="info-box" v-if="orderInfo.status == '5'">
+			<span class="title-m">评价信息</span>
+			<view class="info-item">
+				<span class="title">服务态度</span>
+				<u-rate :count="count" v-model="orderInfo.orderReviews.serviceAttitude"></u-rate>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">着装仪态</span>
+				<u-rate :count="count" v-model="orderInfo.orderReviews.dressAppearance"></u-rate>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">沟通能力</span>
+				<u-rate :count="count" v-model="orderInfo.orderReviews.communicationAbility"></u-rate>
+			</view>
+			<u-line></u-line>
+			<view class="tip-txt">
+				文字评价:{{orderInfo.orderReviews.content}}
+			</view>
+		</view>
+
+		<!-- 底部按钮 -->
+		<view class="footer-box" v-if="orderInfo.status !=5 || orderInfo.status !=6">
+			<view class="btn-box">
+				<!-- 待确认 -->
+				<span class="btn " v-if="orderInfo.status == 1" @click.stop="cancleOrder(orderInfo.id)">取消订单</span>
+				<!-- 待服务 -->
+				<template v-if="orderInfo.status == 2  || orderInfo.status == 3">
+					<span class="btn" @click.stop="apllyRefund(orderInfo.id)">申请退款</span>
+					<span class="btn btn1" @click.stop="contactPerson(orderInfo.id)">联系护工</span>
+				</template>
+				<!-- 待评价 -->
+				<span class="btn btn1" v-if="orderInfo.status == 4" @click.stop="evaluateShow = true">去评价</span>
+			</view>
+		</view>
+
+		<!-- 评价 -->
+		<u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="evaluateShow"
+			@close="evaluateClose" @open="evaluateOpen" :round="20">
+			<view class="pop-box">
+				<view class="pop-title">订单评价</view>
+				<view class="pop-content">
+					<view class="info-item">
+						<span class="title">服务态度</span>
+						<u-rate :count="count" size="20" v-model="evaluateInfo.serviceAttitude"></u-rate>
+					</view>
+					<u-line></u-line>
+					<view class="info-item">
+						<span class="title">着装仪态</span>
+						<u-rate :count="count" size="20" v-model="evaluateInfo.dressAppearance"></u-rate>
+					</view>
+					<u-line></u-line>
+					<view class="info-item">
+						<span class="title">沟通能力</span>
+						<u-rate :count="count" size="20" v-model="evaluateInfo.communicationAbility"></u-rate>
+					</view>
+					<u-line></u-line>
+					<view class="tip-txt">
+						<span class="name">文字评价</span>
+						<u--textarea v-model="evaluateInfo.content" placeholder="请输入内容"></u--textarea>
+					</view>
+				</view>
+				<view class="footer-btn">
+					<span class="btn" @click="confirmEvaluate">确认提交</span>
+				</view>
+			</view>
+		</u-popup>
+
+		<!-- 联系护工 -->
+		<u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="popShow" @close="popClose"
+			@open="open" :round="20">
+			<view class="pop-box">
+				<view class="pop-title">联系护工</view>
+				<view class="pop-content">
+					<view class="pop-item" v-for="item,index in workerList" :key="index"
+						@click="confirmAndCall(item.phoneNumber)">
+						<u-icon name="phone" color="#fff"></u-icon>
+						<span class="txt">{{item.phoneNumber || '-'}}</span>
+					</view>
+				</view>
+				<view class="pop-footer-btn">
+					<span class="btn" @click="popClose()">取消</span>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -85,12 +210,18 @@
 		getOrderDetail,
 		getServiceUnit,
 		getOrderStatus,
+		cancelOrder,
+		getServicePhoneList,
+		evaluateOrder
 	} from '@/api/order.js'
 
 	export default {
 		components: {},
 		data() {
 			return {
+				evaluateShow: '',
+				count: 5,
+				value: 3,
 				orderInfo: {
 					serviceUnit: ''
 				},
@@ -99,22 +230,41 @@
 				disableScroll: false,
 				timer: null,
 				unitList: [],
+				orderId: '',
+				evaluateInfo: {
+					content: '',
+					serviceAttitude: 0,
+					dressAppearance: 0,
+					communicationAbility: 0,
+				},
+
+				workerList: [],
+				popShow: false,
 			}
 		},
 		onLoad(options) {
-			this.getInfoById(options.id);
+			if (options.id) {
+				this.orderId = options.id;
+			}
 			this.getOrderStatus();
 			this.getServiceUnit();
 		},
 		onShow() {
 			// this.getOrderStatus();
-			// this.getInfoById(options.id);
+			this.getInfoById(this.orderId);
 		},
 		onUnload() {
 			// 当页面关闭或卸载时清除定时器
 
 		},
 		methods: {
+			evaluateOpen() {
+				this.evaluateShow = true;
+			},
+
+			evaluateClose() {
+				this.evaluateShow = false;
+			},
 			getStatusTxt(value) {
 				let obj = this.typeList.find(item => item.code == value);;
 				return obj ? obj.value : '待确认'
@@ -142,7 +292,7 @@
 					})
 
 			},
-			//查询订单状态
+			//查询单位
 			getServiceUnit() {
 				let that = this;
 				getServiceUnit().then(res => {
@@ -157,6 +307,14 @@
 
 			},
 
+			//查看退款信息
+			viewRefund() {
+				let id = this.orderInfo.refundList[0].id;
+				uni.navigateTo({
+					url: '/pages/order/refundDetails?id=' + id
+				})
+			},
+
 			getInfoById(id) {
 				let that = this;
 				uni.showLoading({
@@ -177,22 +335,177 @@
 					});
 			},
 
+			//取消订单
+			cancleOrder(id) {
+				//确认是否删除
+				uni.showModal({
+					title: '提示',
+					content: '确定取消订单吗?',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('用户点击确定');
+							cancelOrder(id).then(res => {
+								if (res.code == 200) {
+									uni.showToast({
+										title: '取消成功',
+										icon: 'success'
+									})
+									this.getInfoById(this.orderId);
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+			},
+
+			//申请退款
+			apllyRefund(id) {
+				uni.navigateTo({
+					url: '/pages/order/applyRefund?id=' + id
+				})
+			},
+
+
+			confirmAndCall(phoneNumber) {
+				// 先验证电话号码
+				if (!this.isValidPhoneNumber(phoneNumber)) {
+					uni.showToast({
+						title: '电话号码格式不正确',
+						icon: 'none'
+					});
+					return;
+				}
+
+				// 显示确认对话框
+				uni.showModal({
+					title: '确认拨打电话',
+					content: `确定要拨打 ${phoneNumber} 吗?`,
+					success: (res) => {
+						if (res.confirm) {
+							// 用户点击确定,执行拨打电话
+							this.makePhoneCall(phoneNumber);
+						}
+					}
+				});
+			},
+
+			isValidPhoneNumber(phoneNumber) {
+				// 简单的电话号码验证
+				return /^1[3-9]\d{9}$/.test(phoneNumber);
+			},
+
+
+			makePhoneCall(phoneNumber) {
+				uni.makePhoneCall({
+					phoneNumber: phoneNumber,
+					success: () => {
+						console.log('拨打电话成功');
+					},
+					fail: (err) => {
+						console.error('拨打电话失败', err);
+						uni.showToast({
+							title: '拨打电话失败',
+							icon: 'none'
+						});
+					}
+				});
+			},
+
+			//联系护工
+			contactPerson(item) {
+				this.open()
+			},
+
+			open() {
+				let that = this;
+				getServicePhoneList().then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							this.workerList = data;
+							this.popShow = true;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+
+			popClose() {
+				this.popShow = false;
+			},
+
+			// 评价订单
+			confirmEvaluate() {
+				if (!this.evaluateInfo.content) {
+					uni.showToast({
+						title: '请填写内容',
+						icon: 'none'
+					});
+					return
+				}
+
+				let that = this;
+				uni.showLoading({
+					title: '评价中',
+					mask: true,
+				});
+				that.evaluateInfo.orderId = that.orderId
+				evaluateOrder(that.evaluateInfo).then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							that.evaluateInfo = {
+								content: '',
+								serviceAttitude: 0,
+								dressAppearance: 0,
+								communicationAbility: 0,
+							}
+							that.evaluateClose()
+							that.getInfoById(that.orderId)
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+					.finally(() => {
+						uni.hideLoading();
+					});
+			},
+
+			//下拉刷新回调函数
+			onPullDownRefresh() {
+				this.getInfoById(this.orderId);
+				setTimeout(function() {
+					uni.stopPullDownRefresh();
+				}, 1000);
+			},
 		},
 	}
 </script>
 
 <style lang='scss' scoped>
 	.container {
-		padding: 20rpx 20rpx 100rpx;
+		padding: 20rpx 20rpx 200rpx;
 
 		.order-status {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
 			padding: 40rpx 20rpx !important;
 
 			.status-text {
-				text-align: center;
+				/* text-align: center; */
 				font-weight: bold;
-				font-size: 40rpx;
-				color: #4c96d6;
+				font-size: 30rpx;
+				color: #333;
+			}
+
+			.refund-btn {
+				font-size: 28rpx;
+				color: #4B91D1;
 			}
 		}
 
@@ -230,7 +543,7 @@
 
 					width: 100%;
 					font-weight: 500;
-									line-height: 35rpx;
+					line-height: 35rpx;
 					display: flex;
 					justify-content: flex-start;
 					align-items: flex-start;
@@ -300,6 +613,12 @@
 					text-align: left;
 				}
 			}
+
+			.tip-txt {
+				padding: 30rpx 0;
+				font-size: 28rpx;
+				color: #333;
+			}
 		}
 
 		.title-m {
@@ -322,5 +641,153 @@
 				margin-right: 10rpx;
 			}
 		}
+
+		.footer-box {
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			width: 100%;
+			padding: 50rpx 30rpx;
+			box-sizing: border-box;
+			font-size: 28rpx;
+			background-color: #fff;
+			box-shadow: 0 -2rpx 30rpx #c5c5c53a;
+
+			.btn-box {
+
+				display: flex;
+				align-items: center;
+				justify-content: flex-end;
+
+				.btn {
+					width: 170rpx;
+					height: 60rpx;
+					margin-left: 20rpx;
+					line-height: 60rpx;
+					text-align: center;
+					background-color: #fff;
+					border: 1rpx solid #4B91D1;
+					color: #4B91D1;
+					border-radius: 30rpx;
+					font-size: 24rpx;
+					margin-left: 30rpx;
+				}
+
+				.btn1 {
+					background-color: #00aa00;
+					border: 1rpx solid #00aa00;
+					color: #fff;
+				}
+
+				.btn2 {
+					background-color: #4B91D1;
+					border: 1rpx solid #4B91D1;
+					color: #fff;
+				}
+			}
+
+		}
+
+	}
+
+
+	.pop-box {
+		.pop-title {
+			font-size: 32rpx;
+
+			font-weight: bold;
+			text-align: center;
+			padding: 20rpx 0;
+
+		}
+
+		.pop-content {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 30rpx;
+			font-size: 28rpx;
+			color: #6F6F6F;
+			padding: 0 20rpx;
+
+			.info-item {
+				display: flex;
+				justify-content: space-between;
+				padding: 20rpx 0;
+				width: 100%;
+			}
+
+			.tip-txt {
+				display: flex;
+				flex-direction: column;
+				padding: 20rpx 0;
+				width: 100%;
+
+				.name {
+					margin-bottom: 20rpx;
+				}
+			}
+
+			&>view {
+				margin-bottom: 20rpx;
+
+				&:last-child {
+					margin-bottom: 0;
+
+				}
+
+			}
+
+			.pop-item {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				width: 500rpx;
+				padding: 20rpx 0;
+				background-color: #4B91D1;
+				border-radius: 40rpx;
+				color: #fff;
+
+				.txt {
+					font-size: 28rpx;
+				}
+			}
+
+
+		}
+
+		.footer-btn {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 30rpx;
+			padding: 20rpx;
+
+			.btn {
+				width: 100%;
+				padding: 20rpx 0;
+				border: 1rpx solid #4B91D1;
+				background-color: #4B91D1;
+				border-radius: 40rpx;
+				color: #fff;
+				text-align: center;
+			}
+		}
+
+		.pop-footer-btn {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 60rpx;
+
+			.btn {
+				width: 500rpx;
+				padding: 20rpx 0;
+				border: 1rpx solid #4B91D1;
+				border-radius: 40rpx;
+				color: #333;
+				text-align: center;
+			}
+		}
 	}
 </style>

+ 3 - 2
pages/order/placeAnOrder.vue

@@ -49,7 +49,7 @@
 							placeholder="请选择服务开始时间" inputAlign="right" />
 						<u-icon slot="right" name="arrow-right"></u-icon>
 						<u-datetime-picker :show="showTimePicker" v-model="form.expectedTime" mode="datetime"
-							@confirm=selectTime @cancel="showTimePicker = false"
+							@confirm="selectTime"  @cancel="showTimePicker = false"
 							:filter="timeFilter"></u-datetime-picker>
 
 					</u-form-item>
@@ -400,6 +400,7 @@
 					})
 					return
 				}
+				this.form.expectedTime = this.form.expectedTime + ':00'
 				addOrder(this.form).then(res => {
 					if (res.code == 200) {
 						uni.showToast({
@@ -422,7 +423,7 @@
 			},
 			//选择时间
 			selectTime(e) {
-				this.form.expectedTime = e.value
+				this.form.expectedTime =  this.$utils.mFormatDate(e.value, 'yyyy-MM-dd HH:mm')
 				console.log("this.form.expectedTime", this.form.expectedTime);
 				this.form.expectedTimeFormat = this.$utils.mFormatDate(e.value, 'yyyy-MM-dd HH:mm')
 				console.log("this.form.expectedTimeFormat", this.form.expectedTimeFormat);

+ 730 - 0
pages/order/refundDetails.vue

@@ -0,0 +1,730 @@
+<template>
+	<view class="container" :class="{disableScroll:disableScroll}">
+		<view class="info-box order-status">
+			<view class="status-text">
+				<span class="status">订单状态:{{getRefundTxt(refundInfo.refundStatus)}}</span>
+			</view>
+		</view>
+		<view class="order-info">
+			<image :src="orderInfo.hospitalVo.logoUrl" mode="aspectFill"></image>
+			<view class="info-content">
+				<span class="name">{{orderInfo.hospitalVo.name || '-'}}</span>
+				<span class="address">
+					<u-icon name="map" color="#999999" size="14"></u-icon>
+					<span class="txt">{{orderInfo.hospitalVo.address || '-'}}</span>
+				</span>
+				<!-- <span class="area">所属区:{{orderInfo.hospitalVo.areaName || '-'}}</span> -->
+			</view>
+		</view>
+		<view class="info-box">
+			<view class="info-item">
+				<span class="title">所在科室</span>
+				<span class="txt">{{orderInfo.hospitalDepartmentName || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">房床号</span>
+				<span class="txt">{{orderInfo.roomNumber || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item info-item-spa">
+				<span class="title">备注</span>
+				<span class="txt">{{orderInfo.remarks || '-'}}</span>
+			</view>
+		</view>
+		<view class="info-box">
+			<view class="info-item">
+				<span class="title">就诊人</span>
+				<span class="txt">{{orderInfo.patientVo.name || '-'}}({{orderInfo.patientVo.mobile || '-'}})</span>
+			</view>
+		</view>
+		<view class="info-box">
+			<view class="info-item">
+				<span class="title">服务产品</span>
+				<span class="txt">{{orderInfo.serviceName || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">期望时间</span>
+				<span class="txt">{{orderInfo.expectedTime || '-'}}</span>
+			</view>
+		</view>
+
+		<!-- 基本信息 -->
+		<view class="info-box">
+			<span class="title-m">基本信息</span>
+			<view class="info-item">
+				<span class="title">订单号</span>
+				<span class="txt">{{orderInfo.orderNo || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">下单时间</span>
+				<span class="txt">{{orderInfo.createTime || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">下单数量</span>
+				<span class="txt">{{orderInfo.orderNum || '-'}}({{ getUnitTxt(orderInfo.serviceUnit) }})</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">销售价格</span>
+				<span class="txt">¥{{orderInfo.sellingPrice || "0.00"}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">应付金额</span>
+				<span class="txt">¥{{orderInfo.totalPrice || "0.00"}}</span>
+			</view>
+		</view>
+
+		<!-- 退款信息 -->
+		<view class="info-box">
+			<span class="title-m">退款信息</span>
+			<view class="info-item">
+				<span class="title">退款原因</span>
+				<span class="txt">{{refundInfo.refundReason || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">退款数量</span>
+				<span class="txt">{{refundInfo.refundQuantity || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">退款金额</span>
+				<span class="txt">{{refundInfo.refundAmount || "0.00"}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">退款说明</span>
+				<span class="txt">{{refundInfo.refundDesc || "-"}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">申请时间</span>
+				<span class="txt">{{refundInfo.createTime || "-"}}</span>
+			</view>
+		</view>
+
+
+		<!-- 操作信息 退款成功  退款失败-->
+		<view class="info-box" v-if="refundInfo.refundStatus == 2 || refundInfo.refundStatus == 3">
+			<span class="title-m">操作信息</span>
+			<view class="info-item" v-if="refundInfo.refundStatus == 2">
+				<span class="title">实退金额</span>
+				<span class="txt">¥{{refundInfo.actualRefundAmount || '-'}}</span>
+			</view>
+			<view class="info-item">
+				<span class="title">操作原因</span>
+				<span class="txt">{{refundInfo.operationReason || '-'}}</span>
+			</view>
+			<u-line></u-line>
+
+			<view class="info-item">
+				<span class="title">操作时间</span>
+				<span class="txt">{{refundInfo.createTime || '-'}}</span>
+			</view>
+		</view>
+
+		<!-- 底部按钮 -->
+		<view class="footer-box" v-if="roleType != 'guanli' && refundInfo.refundStatus == 1">
+			<view class="btn-box">
+				<!-- 退款中 -->
+				<span class="btn " @click.stop="cancleOrder(refundInfo.id)">取消退款</span>
+			</view>
+		</view>
+
+
+		<view class="footer-box" v-if="roleType == 'guanli' && refundInfo.refundStatus == 1">
+			<view class="btn-box">
+				<span class="btn btn1" v-if="refundInfo.refundStatus == 1" @click.stop="opration('refuse')">拒绝退款</span>
+				<span class="btn btn2" v-if="refundInfo.refundStatus == 1" @click.stop="opration('agree')">同意退款</span>
+			</view>
+		</view>
+
+		<!-- 操作 -->
+		<u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="popShow" @close="popClose"
+			@open="open" :round="20">
+			<view class="pop-box">
+				<view class="pop-title">{{popTile}}</view>
+				<view class="pop-content">
+					<u--form labelWidth="140rpx" labelPosition="top" :model="formData" :rules="rules" ref="uForm">
+						<u-form-item label="实退金额" prop="actualRefundAmount" borderBottom required
+							v-if="popType == 'agree'">
+							<u--input type="number" maxlength="9" v-model="formData.actualRefundAmount"
+								placeholder-class="input-placeholder" border="none" clearable
+								placeholder="请输入"></u--input>
+						</u-form-item>
+		
+						<u-form-item label="操作原因" prop="operationReason" borderBottom required>
+		
+							<u--textarea v-model="formData.operationReason" placeholder="请输入内容"></u--textarea>
+						</u-form-item>
+					</u--form>
+					<view class="tip-txt">
+						注意:请填写退款失败的原因,如果已提供服务不能申请退款
+					</view>
+				</view>
+				<view class="footer-btn">
+					<span class="btn" @click="confirm">确认</span>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	import {
+		getOrderDetail,
+		getServiceUnit,
+		getOrderStatus,
+		cancelOrder,
+		getRefundStatus,
+		getAfterSaleOrderDetail,
+		cancelAfterSaleOrder
+	} from '@/api/order.js'
+	import {agreeOrRefuseAfterSaleOrder} from '@/api/hospital.js'
+
+	export default {
+		components: {},
+		data() {
+			return {
+				orderInfo: {
+					serviceUnit: ''
+				},
+				typeList: [],
+				couponList: [],
+				disableScroll: false,
+				timer: null,
+				unitList: [],
+				orderId: '',
+				evaluateInfo: {
+					content: '',
+					serviceAttitude: 0,
+					dressAppearance: 0,
+					communicationAbility: 0,
+				},
+				refundStatusList: [],
+				refundInfo: {},
+				roleType: '',
+				
+				popShow: false,
+				popTile: '退款处置',
+				popType: '',
+				orderId: '',
+				
+				formData: {
+					actualRefundAmount: '',
+					operationReason: '',
+				},
+				rules: {
+					actualRefundAmount: [{
+						required: true,
+						message: '请填写实退金额',
+						trigger: ['blur', 'change'],
+					}],
+					operationReason: [{
+						required: true,
+						message: '请填写操作原因',
+						trigger: ['blur', 'change'],
+					}],
+				}
+			}
+		},
+		onLoad(options) {
+			if (options.id) {
+				this.orderId = options.id;
+			}
+			if (options.role) {
+				this.roleType = options.role
+			}
+			this.getOrderStatus();
+			this.getServiceUnit();
+			this.getRefundStatus();
+		},
+		onShow() {
+			this.getInfoById(this.orderId);
+		},
+		onUnload() {},
+		methods: {
+			open() {
+				this.popShow = true;
+			},
+
+			popClose() {
+				this.popShow = false;
+			},
+			confirm() {
+				let that = this;
+				uni.showLoading({
+					title: '操作中',
+					mask: true,
+				});
+				that.$refs.uForm.validate().then((res) => {
+					if (res) {
+						that.formData.id = that.orderId
+						that.formData.refundStatus = that.popType == 'agree' ? 2 : 3
+						agreeOrRefuseAfterSaleOrder(this.formData).then(res => {
+							uni.$u.toast('操作成功');
+							that.formData = {
+								actualRefundAmount: '',
+								operationReason: '',
+							}
+							that.popClose();
+							that.getInfoById(that.orderId)
+						}, err => {
+							console.log(err);
+						}).finally(() => {
+							uni.hideLoading()
+						});
+					}
+				})
+			},
+			
+			getStatusTxt(value) {
+				let obj = this.typeList.find(item => item.code == value);;
+				return obj ? obj.value : '待确认'
+			},
+			getUnitTxt(value) {
+				let obj = this.unitList.find(item => item.code == value);;
+				return obj ? obj.value : ''
+			},
+
+			getRefundTxt(value) {
+				let obj = this.refundStatusList.find(item => item.code == value);;
+				return obj ? obj.value : '-'
+			},
+			//查询退款状态
+			getRefundStatus() {
+				let that = this;
+				getRefundStatus().then(res => {
+						if (res.code == 200) {
+							let data = res.data.refundStatus;
+							this.refundStatusList = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+			//查询订单状态
+			getOrderStatus() {
+				let that = this;
+				getOrderStatus().then(res => {
+						if (res.code == 200) {
+							let data = res.data.orderStatus;
+							data.unshift({
+								value: '全部',
+								code: '',
+							})
+							this.typeList = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+
+			},
+			//查询单位
+			getServiceUnit() {
+				let that = this;
+				getServiceUnit().then(res => {
+						if (res.code == 200) {
+							this.unitList = res.data.serviceUnit;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+
+			},
+
+			getInfoById(id) {
+				let that = this;
+				uni.showLoading({
+					title: '加载中',
+					mask: true,
+				});
+				getAfterSaleOrderDetail(id).then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							this.refundInfo = data;
+							this.orderInfo = data.orderVo;
+						}
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+					.finally(() => {
+						uni.hideLoading();
+					});
+			},
+
+			//取消订单
+			cancleOrder(id) {
+				//确认是否删除
+				uni.showModal({
+					title: '提示',
+					content: '确定取消订单吗?',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('用户点击确定');
+							cancelAfterSaleOrder(id).then(res => {
+								if (res.code == 200) {
+									uni.showToast({
+										title: '取消成功',
+										icon: 'success'
+									})
+									this.getInfoById(this.orderId);
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+			},
+
+			//申请退款
+			apllyRefund(id) {
+				uni.navigateTo({
+					url: '/pages/order/applyRefund?id=' + id
+				})
+			},
+
+			opration(type) {
+				this.popShow = true;
+				this.popType = type;
+			},
+
+
+			confirmAndCall(phoneNumber) {
+				let that = this;
+				//获取电话
+				getNursePhone(that.orderInfo.orderWorkerChangeRecord.orderId).then(res => {
+					if (res.code == 200) {
+						phoneNumber = res.msg;
+						// 先验证电话号码
+						if (!that.isValidPhoneNumber(phoneNumber)) {
+							uni.showToast({
+								title: '电话号码格式不正确',
+								icon: 'none'
+							});
+							return;
+						}
+
+						// 显示确认对话框
+						uni.showModal({
+							title: '确认拨打电话',
+							content: `确定要拨打 ${phoneNumber} 吗?`,
+							success: (res) => {
+								if (res.confirm) {
+									// 用户点击确定,执行拨打电话
+									that.makePhoneCall(phoneNumber);
+								}
+							}
+						});
+					}
+				})
+
+			},
+
+			isValidPhoneNumber(phoneNumber) {
+				// 简单的电话号码验证
+				return /^1[3-9]\d{9}$/.test(phoneNumber);
+			},
+
+
+			makePhoneCall(phoneNumber) {
+				uni.makePhoneCall({
+					phoneNumber: phoneNumber,
+					success: () => {
+						console.log('拨打电话成功');
+					},
+					fail: (err) => {
+						console.error('拨打电话失败', err);
+						uni.showToast({
+							title: '拨打电话失败',
+							icon: 'none'
+						});
+					}
+				});
+			},
+
+
+			//下拉刷新回调函数
+			onPullDownRefresh() {
+				this.getInfoById(this.orderId);
+				setTimeout(function() {
+					uni.stopPullDownRefresh();
+				}, 1000);
+			},
+
+		},
+	}
+</script>
+
+<style lang='scss' scoped>
+	.container {
+		padding: 20rpx 20rpx 200rpx;
+
+		.order-status {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			padding: 40rpx 20rpx !important;
+
+			.status-text {
+				/* text-align: center; */
+				font-weight: bold;
+				font-size: 32rpx;
+				color: #333;
+			}
+
+			.refund-btn {
+				font-size: 28rpx;
+				color: #4B91D1;
+			}
+		}
+
+		.order-info {
+			display: flex;
+			align-items: center;
+			padding: 20rpx;
+			background: #fff;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+
+			image {
+				width: 180rpx;
+				height: 180rpx;
+				border-radius: 10rpx;
+				margin-right: 20rpx;
+			}
+
+			.info-content {
+				display: flex;
+				flex-direction: column;
+				flex: 1;
+
+				.name {
+					word-break: break-all;
+					font-size: 32rpx;
+					color: #333;
+					font-weight: bold;
+				}
+
+				.address {
+					font-size: 28rpx;
+					color: #666;
+					margin-top: 20rpx;
+
+					width: 100%;
+					font-weight: 500;
+					line-height: 35rpx;
+					display: flex;
+					justify-content: flex-start;
+					align-items: flex-start;
+					overflow: hidden; //超出的文本隐藏
+					text-overflow: ellipsis; //溢出用省略号显示
+					white-space: normal; //处理元素中的 空白
+					display: -webkit-box;
+					-webkit-line-clamp: 2;
+					-webkit-box-orient: vertical;
+					display: -moz-box;
+					-moz-line-clamp: 2;
+					-moz-box-orient: vertical;
+					overflow-wrap: break-word;
+					word-break: break-all;
+
+					::v-deep .u-icon {
+						display: inline-block;
+					}
+
+					.txt {
+						margin-left: 15rpx;
+					}
+				}
+
+				.area {
+					font-size: 28rpx;
+					color: #666;
+					margin-top: 10rpx;
+				}
+			}
+		}
+
+		.info-box {
+			padding: 20rpx;
+			background: #fff;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+
+			.info-item {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding: 30rpx 0;
+
+				.title {
+					width: 250rpx;
+					font-size: 28rpx;
+					color: #333;
+				}
+
+				.txt {
+					/* flex: 1; */
+					max-width: 540rpx;
+					text-align: left;
+					font-size: 28rpx;
+					color: #757575;
+				}
+			}
+
+			.info-item-spa {
+				align-items: flex-start;
+				flex-direction: column;
+
+				.txt {
+					margin-left: 0;
+					margin-top: 20rpx;
+					text-align: left;
+				}
+			}
+
+			.tip-txt {
+				padding: 30rpx 0;
+				font-size: 28rpx;
+				color: #333;
+			}
+		}
+
+		.title-m {
+			/* 竖线和文字对齐 */
+			display: flex;
+			align-items: center;
+			padding: 20rpx 0;
+			font-size: 28rpx;
+			color: #333;
+			font-weight: bold;
+			line-height: 28rpx;
+
+			/* 左边加一个竖线 */
+			&::before {
+				content: '';
+				display: inline-block;
+				width: 6rpx;
+				height: 30rpx;
+				background: #4B91D1;
+				margin-right: 10rpx;
+			}
+		}
+
+		.footer-box {
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			width: 100%;
+			padding: 50rpx 30rpx;
+			box-sizing: border-box;
+			font-size: 28rpx;
+			background-color: #fff;
+			box-shadow: 0 -2rpx 30rpx #c5c5c53a;
+
+			.btn-box {
+
+				display: flex;
+				align-items: center;
+				justify-content: flex-end;
+
+				.btn {
+					width: 170rpx;
+					height: 60rpx;
+					margin-left: 20rpx;
+					line-height: 60rpx;
+					text-align: center;
+					background-color: #fff;
+					border: 1rpx solid #4B91D1;
+					color: #4B91D1;
+					border-radius: 30rpx;
+					font-size: 24rpx;
+					margin-left: 30rpx;
+				}
+
+				.btn1 {
+					background-color: #00aa00;
+					border: 1rpx solid #00aa00;
+					color: #fff;
+				}
+
+				.btn2 {
+					background-color: #4B91D1;
+					border: 1rpx solid #4B91D1;
+					color: #fff;
+				}
+			}
+
+		}
+
+	}
+
+
+	.pop-box {
+		.pop-title {
+			font-size: 32rpx;
+
+			font-weight: bold;
+			text-align: center;
+			padding: 20rpx 0;
+
+		}
+
+		.pop-content {
+			margin-top: 30rpx;
+			font-size: 28rpx;
+			color: #6F6F6F;
+			padding: 0 40rpx;
+			width: 100%;
+			box-sizing: border-box;
+
+			.info-item {
+				display: flex;
+				justify-content: space-between;
+				padding: 20rpx 0;
+				width: 100%;
+			}
+
+			.tip-txt {
+				margin-top: 20rpx;
+				font-size: 24rpx;
+				color: #6F6F6F;
+
+				
+			}
+
+		}
+
+		.footer-btn {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 30rpx;
+			padding: 20rpx;
+
+			.btn {
+				width: 100%;
+				padding: 20rpx 0;
+				border: 1rpx solid #4B91D1;
+				background-color: #4B91D1;
+				border-radius: 40rpx;
+				color: #fff;
+				text-align: center;
+			}
+		}
+	}
+</style>

+ 40 - 13
pages/tabBar/index.vue

@@ -87,28 +87,55 @@
 			// 		this.getList();
 			// 	}
 			// });
+
 			this.realoadData();
 		},
 		onShow() {
-			 wx.showShareMenu({
-			    withShareTicket: true,
-			    menus: ['shareAppMessage', 'shareTimeline']
-			  });
+			wx.showShareMenu({
+				withShareTicket: true,
+				menus: ['shareAppMessage', 'shareTimeline']
+			});
 
 		},
 		methods: {
 			async realoadData() {
-				let data = await this.$utils.getLocation();
-				if (data) {
-					console.log('当前位置的经度:' + data.long);
-					console.log('当前位置的纬度:' + data.lat);
-					this.coordinates = data.long + ',' + data.lat;
+				this.getBannerList();
+				//定位缓存
+				let locationInfo = uni.getStorageSync('locationInfo');
+				if (locationInfo) {
+					this.coordinates = locationInfo.longitude + ',' + locationInfo.latitude;
 					this.getList();
+					//再去判断是否有最新的定位信息
+					let data = await this.$utils.getLocation();
+					if (data.long != locationInfo.longitude || data.lat != locationInfo.latitude) {
+						// 如果有新的定位,刷新列表
+						uni.setStorageSync('locationInfo', {
+							longitude: data.long,
+							latitude: data.lat
+						})
+						this.getList();
+					}
 				} else {
-					this.coordinates = undefined;
-					this.getList();
+					// 无缓存信息
+					let data = await this.$utils.getLocation();
+					if (data) {
+						//有授权定位
+						console.log('当前位置的经度:' + data.long);
+						console.log('当前位置的纬度:' + data.lat);
+						this.coordinates = data.long + ',' + data.lat;
+						uni.setStorageSync('locationInfo', {
+							longitude: data.long,
+							latitude: data.lat
+						})
+						this.getList();
+					} else {
+						// 无授权定位
+						this.coordinates = undefined;
+						this.getList();
+					}
 				}
-				this.getBannerList();
+
+
 			},
 			getList() {
 				let that = this;
@@ -186,7 +213,7 @@
 				const nickName = '您的好友'
 				const title = '润护通为您提供服务',
 					path = `/pages/tabBar/index`
-					// imageUrl = 'https://www.baidu.com.cn/img/20211108/activity.png'
+				// imageUrl = 'https://www.baidu.com.cn/img/20211108/activity.png'
 				return {
 					title,
 					path

+ 48 - 1
pages/tabBar/mine.vue

@@ -62,6 +62,18 @@
 				</view>
 			</view>
 		</view>
+
+		<!-- 护工端和管理端 -->
+		<view class="platform-box">
+			<view class="platform-item" @click="toPath('/pages/workbench/caregiver', 'hugong')" v-if="userInfo.workerId">
+				<image class="platform-img" src="/static/my/icon-04.png" mode="aspectFill"></image>
+				<span class="platform-name">护工工作台</span>
+			</view>
+			<view class="platform-item" @click="toPath('/pages/workbench/manager', 'guanli')" v-if="userInfo.teacherId">
+				<image class="platform-img" src="/static/my/icon-03.png" mode="aspectFill"></image>
+				<span class="platform-name">管理老师工作台</span>
+			</view>
+		</view>
 		<view class="logout-btn" v-if="isLogin">
 			<span class="btn" @click="logOut">退出登录</span>
 		</view>
@@ -133,11 +145,14 @@
 				// this.getStoreUserInfo();
 			},
 
-			toPath(path) {
+			toPath(path,type) {
 				uni.setStorageSync('patientType', 'mine')
 				uni.navigateTo({
 					url: path
 				})
+				if(type){
+					uni.setStorageSync('roleType', type)
+				}
 			},
 
 			toLogin() {
@@ -362,6 +377,7 @@
 				margin: 0 20rpx;
 				height: 100rpx;
 				border-bottom: 1rpx solid #F1F1F1;
+
 				&:last-child {
 					border-bottom: none;
 				}
@@ -413,6 +429,37 @@
 			}
 		}
 
+		.platform-box {
+			display: flex;
+			flex-direction: column;
+			margin-top: 40rpx;
+
+			.platform-item {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				padding: 40rpx 0;
+				border-radius: 20rpx;
+				box-shadow: 0rpx 0rpx 20rpx #f1f1f1;
+				margin-bottom: 30rpx;
+
+				.platform-img {
+					width: 70rpx;
+					height: 70rpx;
+					margin-right: 20rpx;
+
+				}
+
+				.platform-name {
+					font-size: 36rpx;
+					color: #1a1a1a;
+					font-weight: bold;
+				}
+			}
+
+
+		}
+
 		.logout-btn {
 			.btn {
 				display: block;

+ 295 - 29
pages/tabBar/order.vue

@@ -15,9 +15,9 @@
 			<u-tabs :lineWidth="50" :activeStyle="{ color: '#4B91D1' }" :list="typeList" keyName="value"
 				:current="current" @change="changeTab"></u-tabs>
 		</u-sticky>
-		<view class="order-list">
+		<!-- 正常状态 -->
+		<view class="order-list" v-if="orderStatus != 7">
 			<view class="order-item" v-for="item,index in orderList" :key="index" @click="toDetails(item)">
-				<!-- 头部为左右结构,左边为名称、订单编号,右边为订单金额 -->
 				<view class="order-t-box">
 					<view class="order-t-box-l">
 						<view class="order-name">
@@ -61,8 +61,61 @@
 					<view class="btn-box-r">
 						<span class="btn btn1" v-if="item.status == 1" @click.stop="cancleOrder(item.id)">取消订单</span>
 						<!--  -->
-						<span class="btn btn2" v-if="item.status == 2 || item.status == 3" @click.stop="contactPerson(item.id)">联系护工</span>
-						<span class="btn btn2" v-if="item.status == 5" @click.stop="goEvaluation(item.id)">去评价</span>
+						<span class="btn btn2" v-if="item.status == 2 || item.status == 3"
+							@click.stop="contactPerson(item.id)">联系护工</span>
+						<span class="btn btn2" v-if="item.status == 4" @click.stop="goEvaluation(item.id)">去评价</span>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 退款 -->
+		<view class="order-list" v-else>
+			<view class="order-item" v-for="item,index in orderList" :key="index" @click="toDetails(item,'refund')">
+				<view class="order-t-box">
+					<view class="order-t-box-l">
+						<view class="order-name">
+							{{item.serviceName || '-'}}(数量:{{item.orderNum || '-'}})
+						</view>
+						<view class="order-no">
+							<span>退款订单号:{{item.orderRefundNo || '-'}}</span>
+							<image class="icon" :src="copyImg" mode="aspectFill"
+								@click.stop="$utils.copyTxt(item.orderRefundNo)"></image>
+						</view>
+					</view>
+					<view class="order-t-box-r">
+						<span class="title">退款金额</span>
+						<span class="price">¥{{item.refundAmount || '-'}}</span>
+					</view>
+				</view>
+				<u-line color="#f0f0f0"></u-line>
+				<view class="order-b-box">
+					<view class="order-b-box-l">
+						<view class="order-b-item">
+							<span class="title">医院:</span>
+							<span class="txt">{{item.orderVo.hospitalName || '-'}}</span>
+						</view>
+						<view class="order-b-item">
+							<span class="title">科室:</span>
+							<span class="txt">{{item.orderVo.hospitalDepartmentName || '-'}}</span>
+						</view>
+						<view class="order-b-item">
+							<span class="title">就诊人:</span>
+							<span
+								class="txt">{{item.orderVo.patientName || '-'}}({{item.orderVo.patientMobile || '-'}})</span>
+						</view>
+					</view>
+					<view class="order-b-box-r">
+						<span class="status">{{getRefundTxt(item.refundStatus)}}</span>
+					</view>
+				</view>
+				<u-line color="#f0f0f0"></u-line>
+				<view class="btn-box">
+					<span class="time">{{$utils.mFormatDate(item.createTime, 'yyyy-MM-dd HH:mm') || '-'}}</span>
+					<view class="btn-box-r">
+						<span class="btn btn1" v-if="item.refundStatus == 1"
+							@click.stop="cancleOrder(item.id)">取消退款</span>
+
+						<span class="txt" v-if="item.refundStatus == 2">实退金额:{{item.actualRefundAmount || 0}}</span>
 					</view>
 				</view>
 			</view>
@@ -77,22 +130,56 @@
 				:nomore-text="nomoreText" @loadmore="loadmore" dashed line marginTop="20" />
 		</view>
 
+		<!-- 联系护工 -->
 		<u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="popShow" @close="popClose"
 			@open="open" :round="20">
 			<view class="pop-box">
 				<view class="pop-title">联系护工</view>
 				<view class="pop-content">
 					<view class="pop-item" v-for="item,index in workerList" :key="index"
-						@click="confirmAndCall(item.mobile)">
+						@click="confirmAndCall(item.phoneNumber)">
 						<u-icon name="phone" color="#fff"></u-icon>
-						<span class="txt">{{item.mobile || '-'}}</span>
+						<span class="txt">{{item.phoneNumber || '-'}}</span>
+					</view>
+				</view>
+				<view class="pop-footer-btn">
+					<span class="btn" @click="popClose()">取消</span>
+				</view>
+			</view>
+		</u-popup>
+
+		<!-- 评价 -->
+		<u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="evaluateShow"
+			@close="evaluateClose" @open="evaluateOpen" :round="20">
+			<view class="pop-box">
+				<view class="pop-title">订单评价</view>
+				<view class="pop-content">
+					<view class="info-item">
+						<span class="title">服务态度</span>
+						<u-rate :count="count" size="20" v-model="evaluateInfo.serviceAttitude"></u-rate>
+					</view>
+					<u-line></u-line>
+					<view class="info-item">
+						<span class="title">着装仪态</span>
+						<u-rate :count="count" size="20" v-model="evaluateInfo.dressAppearance"></u-rate>
+					</view>
+					<u-line></u-line>
+					<view class="info-item">
+						<span class="title">沟通能力</span>
+						<u-rate :count="count" size="20" v-model="evaluateInfo.communicationAbility"></u-rate>
+					</view>
+					<u-line></u-line>
+					<view class="tip-txt">
+						<span class="name">文字评价</span>
+						<u--textarea v-model="evaluateInfo.content" placeholder="请输入内容"></u--textarea>
 					</view>
 				</view>
 				<view class="footer-btn">
-					<span class="btn">取消</span>
+					<span class="btn" @click="confirmEvaluate">确认提交</span>
 				</view>
 			</view>
 		</u-popup>
+
 	</view>
 </template>
 
@@ -100,7 +187,11 @@
 	import {
 		getOrderList,
 		getOrderStatus,
-		cancelOrder
+		cancelOrder,
+		getAfterSaleOrderList,
+		getRefundStatus,
+		getServicePhoneList,
+		evaluateOrder
 	} from "@/api/order.js"
 	export default {
 		data() {
@@ -127,14 +218,20 @@
 				current: 0,
 				isFirst: true,
 
-				workerList: [{
-					mobile: '13555265325',
-				}, {
-					mobile: '15800215426',
-				}, {
-					mobile: '15074125896',
-				}],
+				workerList: [],
 				popShow: false,
+
+				refundStatusList: [],
+
+				evaluateInfo: {
+					content: '',
+					serviceAttitude: 0,
+					dressAppearance: 0,
+					communicationAbility: 0,
+				},
+				evaluateShow: false,
+				count: 5,
+				orderId: '',
 			}
 		},
 		onLoad(option) {
@@ -194,8 +291,66 @@
 				this.getOrderStatus();
 			},
 
+			evaluateOpen() {
+				this.evaluateShow = true;
+			},
+
+			evaluateClose() {
+				this.evaluateShow = false;
+			},
+
+			// 评价订单
+			confirmEvaluate() {
+				if (!this.evaluateInfo.content) {
+					uni.showToast({
+						title: '请填写内容',
+						icon: 'none'
+					});
+					return
+				}
+
+				let that = this;
+				uni.showLoading({
+					title: '评价中',
+					mask: true,
+				});
+				that.evaluateInfo.orderId = that.orderId
+				evaluateOrder(that.evaluateInfo).then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							that.evaluateInfo = {
+								content: '',
+								serviceAttitude: 0,
+								dressAppearance: 0,
+								communicationAbility: 0,
+							}
+							that.evaluateClose()
+							that.getOrderList('reload')
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+					.finally(() => {
+						uni.hideLoading();
+					});
+			},
+
+
 			open() {
-				this.popShow = true;
+				let that = this;
+				getServicePhoneList().then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							this.workerList = data;
+							this.popShow = true;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
 			},
 
 			popClose() {
@@ -248,16 +403,25 @@
 			},
 
 			changeTab(item) {
-				// console.log("item", item);
+				console.log("item", item);
 				this.pageNum = 1;
-				this.orderList = [];
 				this.orderStatus = item.code;
-				this.getOrderList("reload");
+				if (item.code != 7) {
+					this.orderList = [];
+					this.getOrderList("reload");
+				} else {
+					this.getRefundStatus();
+					this.getAfterSaleOrderList("reload");
+				}
 			},
 			getStatusTxt(value) {
 				let obj = this.typeList.find(item => item.code == value);;
 				return obj ? obj.value : '-'
 			},
+			getRefundTxt(value) {
+				let obj = this.refundStatusList.find(item => item.code == value);;
+				return obj ? obj.value : '-'
+			},
 
 			//取消订单
 			cancleOrder(id) {
@@ -290,11 +454,9 @@
 			},
 
 			//去评价
-			goEvaluation(item) {
-				uni.navigateTo({
-					url: '/pages/order/evaluation?id=' + item.id
-
-				})
+			goEvaluation(id) {
+				this.orderId = id
+				this.evaluateOpen()
 			},
 
 			//获取订单列表
@@ -339,6 +501,42 @@
 					});
 			},
 
+			//查询售后订单列表
+			getAfterSaleOrderList(reload) {
+				let that = this;
+				if (reload) {
+					that.pageNum = 1;
+					that.orderList = [];
+				}
+				uni.showLoading({
+					title: '加载中',
+					mask: true,
+				});
+				let param = {
+					pageNum: that.pageNum,
+					pageSize: that.pageSize,
+				}
+				getAfterSaleOrderList(param).then(res => {
+						let data = res.rows;
+						if (data) {
+							that.orderList.push(...data); //在列表后面新增新获取的数据
+							that.total = res.total; //获取数据总页数
+							if (that.orderList.length >= that.total) {
+								that.status = 'nomore';
+								return;
+							}
+						} else {
+							that.status = 'nomore';
+						}
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+					.finally(() => {
+						uni.hideLoading();
+					});
+			},
+
 			//查询订单状态
 			getOrderStatus() {
 				let that = this;
@@ -349,6 +547,10 @@
 								value: '全部',
 								code: undefined,
 							})
+							data.push({
+								value: '退款',
+								code: 7,
+							})
 							this.typeList = data;
 						}
 
@@ -359,11 +561,34 @@
 
 			},
 
+			//查询退款状态
+			getRefundStatus() {
+				let that = this;
+				getRefundStatus().then(res => {
+						if (res.code == 200) {
+							let data = res.data.refundStatus;
+							this.refundStatusList = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+
 			//去详情
-			toDetails(item) {
-				uni.navigateTo({
-					url: '/pages/order/orderDetails?id=' + item.id
-				})
+			toDetails(item, type) {
+				if (type) {
+					uni.navigateTo({
+						url: '/pages/order/refundDetails?id=' + item.id
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/order/orderDetails?id=' + item.id
+					})
+				}
+
+
 			},
 
 			//去验收
@@ -382,7 +607,11 @@
 				}
 				this.status = 'loading'; //状态改为加载中
 				this.pageNum++;
-				this.getOrderList();
+				if (this.orderStatus != 7) {
+					this.getOrderList();
+				} else {
+					this.getAfterSaleOrderList();
+				}
 			},
 
 			onReachBottom() {
@@ -598,9 +827,46 @@
 				}
 			}
 
+			.info-item {
+				display: flex;
+				justify-content: space-between;
+				padding: 20rpx 0;
+				width: 100%;
+			}
+
+			.tip-txt {
+				display: flex;
+				flex-direction: column;
+				padding: 20rpx 0;
+				width: 100%;
+
+				.name {
+					margin-bottom: 20rpx;
+				}
+			}
+
+
 		}
 
 		.footer-btn {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 30rpx;
+			padding: 20rpx;
+
+			.btn {
+				width: 100%;
+				padding: 20rpx 0;
+				border: 1rpx solid #4B91D1;
+				background-color: #4B91D1;
+				border-radius: 40rpx;
+				color: #fff;
+				text-align: center;
+			}
+		}
+
+		.pop-footer-btn {
 			display: flex;
 			flex-direction: column;
 			align-items: center;

+ 272 - 0
pages/workbench/caregiver.vue

@@ -0,0 +1,272 @@
+<template>
+	<view class="container">
+		<view class="user-info-box">
+			<view class="img-box">
+				<u-avatar :src="nurseInfo.photographUrl || defaultImg" size="121rpx" mode="aspectFill"></u-avatar>
+			</view>
+			<view class="info-r">
+				<view class="info-r-top">
+					<span class="name">{{nurseInfo.name || '-'}}</span>
+					<span class="status" v-if="nurseInfo.orderReceivingStatus == '0'">正常接单</span>
+					<span class="status" v-else>关闭接单</span>
+				</view>
+				<span class="phone">{{nurseInfo.phoneNumber || '-'}}</span>
+			</view>
+		</view>
+		<view class="num-box flex-ac">
+			<view class="num-item flex-ac">
+				<view class="num-item-l">
+					<span class="name">今日订单数</span>
+					<span class="num">{{nurseInfo.todayCount || 0}}</span>
+				</view>
+				<image src="/static/copy.png" mode="aspectFill"></image>
+			</view>
+			<view class="num-item flex-ac">
+				<view class="num-item-l">
+					<span class="name">总订单数</span>
+					<span class="num">{{nurseInfo.orderCount || 0}}</span>
+				</view>
+				<image src="/static/copy.png" mode="aspectFill"></image>
+			</view>
+		</view>
+
+		<view class="order-box flex-dc">
+			<view class="title-box flex-box-c-b">
+				<span class="title">订单管理</span>
+				<span class="more" @click="toPath(0)">查看全部></span>
+			</view>
+			<view class="order-list flex-box">
+				<view class="order-item flex-box-cloum" v-for="item,index in orderType" :key="index"
+					@click="toPath(item.index)">
+					<image :src="item.icon" mode="aspectFill"></image>
+					<span class="name">{{item.name}}</span>
+				</view>
+			</view>
+		</view>
+
+		<view class="order-box flex-dc">
+			<view class="title-box flex-box-c-b">
+				<span class="title">应用中心</span>
+			</view>
+			<view class="order-list flex-box">
+				<view class="order-item flex-box-cloum" @click="toPath(2)">
+					<image src="@/static/my/icon-04.png" mode="aspectFill"></image>
+					<span class="name">待服务</span>
+					<u-badge type="error" max="99" :value="nurseInfo.waitServiceCount" :offset="[-10, -10]"
+						absolute></u-badge>
+				</view>
+				<view class="order-item flex-box-cloum" @click="toPath(3)">
+					<image src="@/static/my/icon-04.png" mode="aspectFill"></image>
+					<span class="name">服务中</span>
+					<u-badge type="error" max="99" :value="nurseInfo.inServiceCount" :offset="[-10, -10]"
+						absolute></u-badge>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	
+	import {
+		getNurseInfo
+	} from "@/api/hospital.js"
+	export default {
+		data() {
+			return {
+
+				defaultImg: require('@/static/default-head-photo.png'),
+				nurseInfo: {
+					nickname: '张三',
+					phone: '18509887879'
+				},
+				orderType: [{
+					index: 2,
+					name: '待服务',
+					icon: require('@/static/my/icon-04.png'),
+				}, {
+					index: 3,
+					name: '服务中',
+					icon: require('@/static/my/icon-04.png'),
+				}, {
+					index: 4,
+					name: '待评价',
+					icon: require('@/static/my/icon-04.png'),
+				}, {
+					index: 5,
+					name: '已完成',
+					icon: require('@/static/my/icon-04.png'),
+				}, ],
+				nurseInfo: {},
+			}
+		},
+		onLoad() {
+			this.getNurseInfo()
+		},
+		methods: {
+			//获取信息
+			getNurseInfo(){
+				let that = this;
+				getNurseInfo().then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							this.nurseInfo = data;
+							
+						}
+				
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+			toPath(val) {
+				uni.navigateTo({
+					url: '/pages/workbench/order/list?type=' + val 
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		padding: 30rpx;
+
+		.user-info-box {
+			display: flex;
+			align-items: center;
+			padding: 20rpx;
+			background-color: #fff;
+			border-radius: 20rpx;
+
+			.img-box {}
+
+			.info-r {
+				display: flex;
+				flex-direction: column;
+				margin-left: 25rpx;
+
+				.info-r-top {
+					display: flex;
+					align-items: center;
+					margin-bottom: 10rpx;
+
+					.name {
+						display: inline-flex;
+						font-size: 36rpx;
+						height: 36rpx;
+						line-height: 36rpx;
+						justify-content: center;
+						font-weight: bold;
+					}
+
+					.status {
+						display: inline-flex;
+						font-size: 24rpx;
+						margin-left: 10rpx;
+						height: 40rpx;
+						line-height: 40rpx;
+						padding: 0 20rpx;
+						background-color: #FFF9D9;
+						color: #B16E55;
+						border-radius: 50rpx;
+
+					}
+				}
+
+				.phone {
+					font-size: 28rpx;
+					color: #101010;
+				}
+
+			}
+
+
+		}
+
+		.num-box {
+			margin-top: 20rpx;
+
+			.num-item {
+				width: 48%;
+				padding: 20rpx;
+				background-color: #fff;
+				border-radius: 20rpx;
+				justify-content: center;
+
+				&:first-child {
+					margin-right: 20rpx;
+
+				}
+
+				.num-item-l {
+					display: flex;
+					align-items: center;
+					flex-direction: column;
+					margin-right: 20rpx;
+
+					.name {
+						font-size: 36rpx;
+						color: #101010;
+
+					}
+
+					.num {
+						font-size: 36rpx;
+						font-weight: bold;
+						color: #101010;
+
+					}
+
+				}
+
+				image {
+					width: 40rpx;
+					height: 40rpx;
+					border-radius: 50%;
+				}
+			}
+		}
+
+		.order-box {
+			background-color: #fff;
+			padding: 20rpx;
+			border-radius: 20rpx;
+			margin-top: 20rpx;
+
+			.title-box {
+				margin-bottom: 20rpx;
+
+				.title {
+					font-size: 36rpx;
+					font-weight: bold;
+					color: #101010;
+				}
+
+				.more {
+					font-size: 28rpx;
+					color: #9a9a9a;
+				}
+			}
+
+			.order-list {
+				.order-item {
+					position: relative;
+					margin: 20rpx 40rpx;
+
+					image {
+						width: 90rpx;
+						height: 90rpx;
+					}
+
+					.name {
+						margin-top: 15rpx;
+						font-size: 28rpx;
+						color: #101010;
+					}
+				}
+			}
+
+		}
+	}
+</style>

+ 368 - 0
pages/workbench/caregiverDetails.vue

@@ -0,0 +1,368 @@
+<template>
+	<view class="container">
+		<view class="item-box">
+			<u-image :src="infoData.photographUrl" width="196rpx" height="256rpx" :lazy-load="true"></u-image>
+			<view class="info-box">
+				<view class=" item-txt">{{infoData.name || '-'}}</view>
+				<view class="info-item age-box">
+					<view class="box-l">
+						<view class="item-txt">{{infoData.sex == '2' ? '女' : '男'}}</view>
+						<view class="item-txt age">{{infoData.age || '0'}}岁</view>
+					</view>
+				</view>
+				<view class="info-item item-txt">工作年限:{{infoData.workYears || 0}}年</view>
+				<view class="info-item service-box">
+					<span class="item-txt">服务中:{{infoData.inProgressCount || 0}}</span>
+					<span class="item-txt total">服务总数: {{infoData.finishCount || 0}}</span>
+				</view>
+			</view>
+		</view>
+
+		<view class="certificate-box"
+			v-if="infoData.nursingCertificateList && infoData.nursingCertificateList.length > 0">
+			<view class="title">从业证书</view>
+			<view class="box-item" v-for="item,index in infoData.nursingCertificateList">
+				<u-image :src="item.pictureUrl" width="680rpx" height="350rpx" :lazy-load="true"></u-image>
+				<span class="name">{{item.certificateName}}</span>
+			</view>
+		</view>
+
+		<view class="btn-box">
+			<span class="btn btn1" v-if="type == 'guanli'" @click="toEdit">编辑信息</span>
+			<span class="btn btn2" @click.stop="confirmAndCall(infoData.phoneNumber)">联系护工</span>
+			<span class="btn btn3" v-if="type == 'fenpei'" @click="confirmFen">确认分配</span>
+			<span class="btn btn3" v-if="type == 'genghuan'" @click="confirmFen">确认更换</span>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	import {
+		getNurseDetail,
+		assignNurse
+	} from '@/api/hospital.js'
+
+	export default {
+		data() {
+			return {
+				infoData: {},
+				type: '',
+				orderNo: '',
+				id: '',
+
+				popShow: false,
+			}
+		},
+		onLoad(option) {
+			if (option.id) {
+				this.id = option.id
+			}
+			if (option.type) {
+				this.type = option.type
+			}
+			if (option.orderNo) {
+				this.orderNo = option.orderNo
+				console.log('orderNo', this.orderNo);
+			}
+		},
+		onShow() {
+			this.getNurseDetail(this.id)
+		},
+		methods: {
+			getNurseDetail(id) {
+				let that = this;
+				getNurseDetail(id).then(res => {
+						if (res.code == 200) {
+							this.infoData = res.data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+
+			},
+
+			toEdit() {
+				uni.navigateTo({
+					url: '/pages/workbench/caregiverForm?id=' + this.infoData.id + '&type=edit'
+				})
+
+			},
+
+			confirmAndCall(phoneNumber) {
+				// 先验证电话号码
+				if (!this.isValidPhoneNumber(phoneNumber)) {
+					uni.showToast({
+						title: '电话号码格式不正确',
+						icon: 'none'
+					});
+					return;
+				}
+
+				// 显示确认对话框
+				uni.showModal({
+					title: '确认拨打电话',
+					content: `确定要拨打 ${phoneNumber} 吗?`,
+					success: (res) => {
+						if (res.confirm) {
+							// 用户点击确定,执行拨打电话
+							this.makePhoneCall(phoneNumber);
+						}
+					}
+				});
+			},
+
+			isValidPhoneNumber(phoneNumber) {
+				// 简单的电话号码验证
+				return /^1[3-9]\d{9}$/.test(phoneNumber);
+			},
+
+
+			makePhoneCall(phoneNumber) {
+				uni.makePhoneCall({
+					phoneNumber: phoneNumber,
+					success: () => {
+						console.log('拨打电话成功');
+					},
+					fail: (err) => {
+						console.error('拨打电话失败', err);
+						uni.showToast({
+							title: '拨打电话失败',
+							icon: 'none'
+						});
+					}
+				});
+			},
+
+			confirmFen() {
+				let that = this;
+				let txt = '';
+				switch (this.type) {
+					case 'fenpei':
+						txt = '分配';
+						break;
+
+					case 'genghuan':
+						txt = '更换';
+						break;
+				}
+
+				//确认是否
+				uni.showModal({
+					title: '提示',
+					content: '确定' + txt + '护工吗?',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('用户点击确定');
+							let params = {
+								id: that.orderNo,
+								workerId: that.infoData.id
+							};
+							assignNurse(params).then(res => {
+									if (res.code == 200) {
+										uni.showToast({
+											title: txt + '成功',
+											icon: 'success'
+										})
+										setTimeout(() => {
+											uni.navigateTo({
+												url: '/pages/workbench/order/list'
+											})
+										}, 1000)
+									}
+
+								})
+								.catch((err) => {
+									console.log(err);
+								})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.container {
+		padding: 20rpx 20rpx 200rpx;
+
+		.item-box {
+			display: flex;
+			align-items: center;
+			background-color: #fff;
+			border-radius: 10rpx;
+			padding: 20rpx;
+
+			.info-box {
+				display: flex;
+				flex-direction: column;
+				justify-content: space-between;
+				margin-left: 20rpx;
+				flex: 1;
+
+				.info-item {
+					margin-top: 30rpx;
+				}
+
+				.item-txt {
+					font-size: 28rpx;
+					color: #1a1a1a;
+				}
+
+				.age-box {
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+
+					.box-l {
+						display: flex;
+						align-items: center;
+
+						.age {
+							margin-left: 30rpx;
+						}
+					}
+
+					.btn {
+						font-size: 28rpx;
+						color: #4B91D1;
+					}
+				}
+
+				.service-box {
+
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+
+					.total {}
+				}
+			}
+		}
+
+
+		.certificate-box {
+			display: flex;
+			flex-direction: column;
+			padding: 0 20rpx;
+			margin-top: 20rpx;
+			background-color: #fff;
+			border-radius: 10rpx;
+
+			.title {
+				padding: 20rpx 0;
+				font-size: 32rpx;
+				font-weight: bold;
+			}
+
+			.box-item {
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+
+				::v-deep .u-image {
+					background-color: #f3f4f6;
+				}
+
+				.name {
+					padding: 30rpx;
+					font-size: 30rpx;
+					font-weight: bold;
+				}
+			}
+		}
+
+		.btn-box {
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			display: flex;
+			align-items: center;
+			justify-content: space-around;
+			width: 100%;
+			padding: 40rpx;
+			box-sizing: border-box;
+			background-color: #fff;
+
+			.btn {
+				width: 206rpx;
+				height: 60rpx;
+				border-radius: 10rpx;
+				background-color: #4B91D1;
+				text-align: center;
+				line-height: 60rpx;
+				color: #fff;
+				font-size: 28rpx;
+			}
+		}
+	}
+
+	.pop-box {
+		.pop-title {
+			font-size: 32rpx;
+
+			font-weight: bold;
+			text-align: center;
+			padding: 20rpx 0;
+
+		}
+
+		.pop-content {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 30rpx;
+			font-size: 28rpx;
+			color: #6F6F6F;
+			padding: 0 20rpx;
+
+			&>view {
+				margin-bottom: 20rpx;
+
+				&:last-child {
+					margin-bottom: 0;
+
+				}
+
+			}
+
+			.pop-item {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				width: 500rpx;
+				padding: 20rpx 0;
+				background-color: #4B91D1;
+				border-radius: 40rpx;
+				color: #fff;
+
+				.txt {
+					font-size: 28rpx;
+				}
+			}
+
+		}
+
+		.footer-btn {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 60rpx;
+
+			.btn {
+				width: 500rpx;
+				padding: 20rpx 0;
+				border: 1rpx solid #4B91D1;
+				border-radius: 40rpx;
+				color: #333;
+				text-align: center;
+			}
+		}
+	}
+</style>

+ 599 - 0
pages/workbench/caregiverForm.vue

@@ -0,0 +1,599 @@
+<template>
+	<view class="container">
+		<u-navbar :title="title" leftIconColor="#333" titleStyle="color:#333" :autoBack="true" placeholder></u-navbar>
+
+		<view class="form-box">
+			<u--form labelWidth="140rpx" :model="formData" :rules="rules" ref="uForm">
+				<u-form-item label="常驻医院" prop="hospitalName" borderBottom @click="showHospital = true">
+					<u-input :border="none" disabled v-model="formData.hospitalName" disabledColor="#ffffff"
+						placeholder="请选择医院" inputAlign="right" />
+					<u-icon slot="right" name="arrow-right" color="#999999"></u-icon>
+				</u-form-item>
+				<u-form-item label="护工姓名" prop="name" borderBottom required>
+					<u--input v-model="formData.name" border="none" placeholder="请输入" :disabled="type == 'view'"
+						maxlength="10" inputAlign="right"></u--input>
+				</u-form-item>
+				<u-form-item label="形象照片" prop="photographUrl" borderBottom required labelPosition="top">
+					<view class="upload-box">
+						<u-upload :fileList="formData.photographUrlList" file="image" :multiple="false" :maxCount="1"
+							@afterRead="afterRead" @delete="deletePic" name="upload1" width="75" height="75">
+						</u-upload>
+						<span class="tips">支持png、jpg和gif格式,限制1张</span>
+					</view>
+				</u-form-item>
+				<u-form-item label="性别" prop="genderName" borderBottom @click="showSex = true" required>
+					<u-input :border="none" disabled v-model="formData.genderName" disabledColor="#ffffff"
+						placeholder="请选择" inputAlign="right" />
+					<u-icon slot="right" name="arrow-right" color="#999999"></u-icon>
+				</u-form-item>
+				<u-form-item label="身份证号" prop="idCard" borderBottom required>
+					<u--input v-model="formData.idCard" border="none" placeholder="请输入" :disabled="type == 'view'"
+						maxlength="18" inputAlign="right"></u--input>
+				</u-form-item>
+				<u-form-item label="年龄" prop="age" borderBottom required>
+					<u--input type="number" maxlength="3" v-model="formData.age" placeholder-class="input-placeholder"
+						border="none" clearable placeholder="请输入" :disabled="type == 'view'"
+						inputAlign="right"></u--input>
+				</u-form-item>
+				<u-form-item label="手机号" prop="phoneNumber" borderBottom required>
+					<u--input type="number" v-model="formData.phoneNumber" placeholder-class="input-placeholder"
+						border="none" clearable placeholder="必填,请输入手机号码" maxlength="11" :disabled="type == 'view'"
+						inputAlign="right"></u--input>
+				</u-form-item>
+				<u-form-item label="工作年限" prop="workYears" borderBottom required>
+					<u--input type="number" maxlength="3" v-model="formData.workYears"
+						placeholder-class="input-placeholder" border="none" clearable placeholder="请输入"
+						:disabled="type == 'view'" inputAlign="right"></u--input>
+				</u-form-item>
+
+				<u-form-item label="从业证书" prop="name" borderBottom required labelPosition="top">
+					<view class="upload-box" v-for="item,index in formData.nursingCertificateList" :key="index">
+						<view class="name-box">
+							<u--input v-model="item.certificateName" placeholder="请输入" maxlength="10"></u--input>
+							<span class="btn btn1" @click="addUpload">新增</span>
+							<span class="btn btn2" v-if="index > 0" @click="deleteUpload(index)">删除</span>
+						</view>
+						<u-upload :fileList="item.pictureUrlList" file="image" :multiple="false" :maxCount="1"
+							@afterRead="(event) => afterRead2(event, index)"
+							@delete="(event) => deletePic2(event, index)" :name="'upload_' + index" width="75"
+							height="75">
+						</u-upload>
+						<span class="tips">支持png、jpg和gif格式,限制1张</span>
+					</view>
+				</u-form-item>
+				<u-form-item label="接单状态" prop="orderReceivingStatus" borderBottom required>
+					<view class="switch-box">
+						<span class="name">开启或关闭接单</span>
+						<u-switch v-model="formData.orderReceivingStatus" activeColor="#4B91D1" inactiveColor="#D8D8D8"
+							inactiveValue="0" activeValue="1"></u-switch>
+					</view>
+				</u-form-item>
+
+				<u-form-item label="排序号" prop="sortOrder" borderBottom required>
+					<view class="switch-box">
+						<u-number-box v-model="formData.sortOrder" max="999" min="1"></u-number-box>
+					</view>
+				</u-form-item>
+
+
+
+			</u--form>
+
+		</view>
+		<!-- 底部按钮 -->
+		<view class="footer-box" v-if="type != 'view'">
+			<view class="btn-box">
+				<view class="submit-btn" @click="submitForm">保存</view>
+			</view>
+		</view>
+
+		<u-action-sheet :show="showSex" :actions="sexList" title="请选择性别" @close="showSex = false" @select="sexSelect"
+			safeAreaInsetBottom>
+		</u-action-sheet>
+
+		<u-action-sheet :show="showHospital" :actions="hospitalList" title="请选择性别" @close="showHospital = false"
+			@select="hospitalSelect" safeAreaInsetBottom>
+		</u-action-sheet>
+	</view>
+</template>
+
+<script>
+	import {
+		dictData
+	} from "@/api/home.js"
+	import {
+		storage
+	} from "@/utils/tools.js"
+
+	import {
+		getNurseDetail,
+		getHospitalListByManage,
+		updateNurseInfo,
+		addNurseInfo
+	} from "@/api/hospital.js"
+
+	export default {
+		data() {
+			return {
+				type: 'add',
+				title: '新增护工',
+				formData: {
+					hospitalName: '',
+					hospitalId: '',
+					genderName: '',
+					sex: '',
+					name: '',
+					age: '',
+					photographUrlList: [],
+					photographUrl: '',
+					idCard: '',
+					age: '',
+					phoneNumber: '',
+					workYears: undefined,
+					nursingCertificateList: [{
+						certificateName: '',
+						pictureUrl: '',
+						pictureUrlList: [],
+					}],
+					orderReceivingStatus: '1',
+					sortOrder: 1,
+					enableStatus: 0,
+				},
+				rules: {
+					hospitalName: [{
+						required: true,
+						message: '请选择医院',
+						trigger: ['blur', 'change'],
+					}],
+					name: [{
+						required: true,
+						message: '请填写姓名',
+						trigger: ['blur', 'change'],
+					}],
+					photographUrl: [{
+						required: true,
+						message: '请选择头像',
+						trigger: ['blur', 'change'],
+					}, {
+						validator: (rule, value, callback) => {
+							if (value && value.length > 0) {
+								callback();
+							} else {
+								callback(new Error('请上传照片'));
+							}
+						},
+						trigger: 'change'
+					}],
+					sex: [{
+						required: true,
+						message: '请选择性别',
+						trigger: ['blur', 'change'],
+					}],
+					idCard: [{
+							required: true,
+							message: '请填写身份证号',
+							trigger: ['blur', 'change'],
+						},
+						{
+							// 自定义验证函数
+							validator: (rule, value, callback) => {
+								// 返回true表示校验通过,返回false表示不通过
+								return this.$u.test.idCard(value)
+							},
+							message: '身份证不正确',
+							// 触发器可以同时用blur和change
+							trigger: ['blur', 'change'],
+						}
+					],
+					age: [{
+							required: true,
+							message: '请填写年龄',
+							trigger: ['blur', 'change'],
+						},
+						{
+							pattern: /^[1-9]\d*$/,
+							message: '请输入正确的年龄',
+							trigger: 'blur',
+						}
+					],
+					phoneNumber: [{
+							required: true,
+							message: '请输入手机号',
+							trigger: ['change', 'blur'],
+						},
+						{
+							validator: (rule, value, callback) => {
+								// uni.$u.test.mobile()就是返回true或者false的
+								return uni.$u.test.mobile(value);
+							},
+							message: '手机号码不正确',
+							// 触发器可以同时用blur和change
+							trigger: ['change', 'blur'],
+						}
+					],
+					workYears: [{
+							required: true,
+							message: '请填写工作年限',
+							trigger: ['blur'],
+						},
+						{
+							pattern: /^[1-9]\d*$/,
+							message: '请输入正确的工作年限',
+							trigger: 'blur',
+						},
+					],
+					// sortOrder: [{
+					// 	required: true,
+					// 	message: '请填写排序号',
+					// 	trigger: ['blur', 'change'],
+					// }]
+				},
+				showHospital: false,
+				hospitalList: [],
+
+				showSex: false,
+				sexList: [{
+						name: '未知',
+						value: 0
+					},
+					{
+						name: '男',
+						value: 1
+					},
+					{
+						name: '女',
+						value: 2
+					},
+				],
+				certificateList: [{
+					certificateName: '',
+					pictureUrl: [],
+				}],
+
+				infoId: '',
+			}
+		},
+		
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+		},
+		onLoad(option) {
+			if (option.type) {
+				this.type = option.type
+				if (this.type == 'add') {
+					this.title = '新增护工'
+				} else if (this.type == 'edit') {
+					this.title = '编辑护工'
+				}
+			}
+			if (option.id) {
+				this.infoId = option.id
+				this.getNurseDetail(this.infoId);
+			} else {
+				this.getHospitalList()
+				this.getSexList();
+			}
+		},
+		methods: {
+			//获取于老师关联的医院
+			getHospitalList() {
+				let that = this;
+				getHospitalListByManage().then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							that.hospitalList = data;
+							if (that.infoId) {
+								that.formData.hospitalName = that.hospitalList.find(item => item.id == that
+									.formData
+									.hospitalId).name
+							}
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+
+
+			//获取性别字典
+			getSexList() {
+				let that = this;
+				dictData('sys_user_sex').then(res => {
+					let data = res.data;
+					data.forEach(item => {
+						item.name = item.dictLabel
+					})
+					that.sexList = data;
+					if (that.infoId) {
+						that.formData.genderName = that.sexList.find(item => item.dictValue == that
+							.formData
+							.sex).name
+					}
+				}, err => {
+					console.log(err);
+				}).finally(() => {
+
+				});
+			},
+
+			getNurseDetail(id) {
+				let that = this;
+				getNurseDetail(id).then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							//在hospitalList中查找和formData中hospitalId 一样的值,取值hospitalName
+							data.photographUrlList = [{
+								url: data.photographUrl,
+							}]
+							if (data.nursingCertificateList.length == 0) {
+								data.nursingCertificateList.push({
+									certificateName: '',
+									pictureUrl: '',
+									pictureUrlList: [],
+								})
+							} else {
+								data.nursingCertificateList.forEach(item => {
+									item.pictureUrlList = [{
+										url: item.pictureUrl,
+									}]
+
+								})
+							}
+							data.workYears = JSON.stringify(data.workYears)
+							that.formData = data;
+							that.getSexList();
+							that.getHospitalList();
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+
+			},
+
+			// valChange(e) {
+			// 	console.log('当前值为: ' + e.value)
+			// 	this.formData.sortOrder = e.value
+			// },
+			addUpload() {
+				this.formData.nursingCertificateList.push({
+					certificateName: '',
+					pictureUrl: '',
+					pictureUrlList: [],
+				})
+			},
+			deleteUpload(index) {
+				this.formData.nursingCertificateList.splice(index, 1)
+			},
+			hospitalSelect(e) {
+				this.formData.hospitalName = e.name;
+				this.formData.hospitalId = e.id
+			},
+			sexSelect(e) {
+				this.formData.sex = e.dictValue;
+				this.formData.genderName = e.dictLabel
+			},
+
+			afterRead(e) {
+				console.log(e)
+				uni.showLoading({
+					title: '上传中',
+				});
+				uni.uploadFile({
+					url: uni.$u.http.config.baseURL + '/common/upload',
+					filePath: e.file.url,
+					name: 'file',
+					header: {
+						apiToken: storage.get('apiToken')
+					},
+					success: (res) => {
+						uni.hideLoading();
+						let data = JSON.parse(res.data);
+						console.log('data', data);
+						if (data.code != 200) return
+						this.formData.photographUrlList = [{
+							url: data.data.url,
+						}]
+						this.formData.photographUrl = data.data.url;
+						console.log('this.formData.photographUrl', this.formData.photographUrl);
+						//验证photographUrl
+						this.$refs.uForm.validateField('photographUrl');
+						uni.showToast({
+							title: '上传成功',
+							icon: 'success',
+							duration: 1000
+						})
+					},
+					fail: (err) => {
+						console.log(err);
+						uni.hideLoading();
+						uni.showModal({
+							content: err.errMsg,
+							showCancel: false
+						});
+					}
+				});
+			},
+
+			deletePic(e) {
+				this.formData.photographUrl.splice(e.index, 1);
+			},
+
+			afterRead2(event, index) {
+				console.log(`第${index}个循环上传组件上传前`, event);
+				console.log(event)
+				uni.showLoading({
+					title: '上传中',
+				});
+				uni.uploadFile({
+					url: uni.$u.http.config.baseURL + '/common/upload',
+					filePath: event.file.url,
+					name: 'file',
+					header: {
+						apiToken: storage.get('apiToken')
+					},
+					success: (res) => {
+						uni.hideLoading();
+						let data = JSON.parse(res.data);
+						if (data.code != 200) return
+						this.formData.nursingCertificateList[index].pictureUrl = data.data.url;
+						this.formData.nursingCertificateList[index].pictureUrlList.push({
+							url: data.data.url,
+						})
+						console.log('this.formData.nursingCertificateList', this.formData
+							.nursingCertificateList);
+						uni.showToast({
+							title: '上传成功',
+							icon: 'success',
+							duration: 1000
+						})
+					},
+					fail: (err) => {
+						console.log(err);
+						uni.hideLoading();
+						uni.showModal({
+							content: err.errMsg,
+							showCancel: false
+						});
+					}
+				});
+			},
+
+			deletePic2(e, index) {
+				this.formData.nursingCertificateList[index].pictureUrl = [];
+			},
+
+			submitForm() {
+				console.log("formData", this.formData);
+				this.$refs.uForm.validate().then((res) => {
+						if (res) {
+							if (this.type == 'add') {
+								addNurseInfo(this.formData).then(res => {
+									uni.$u.toast('新增成功');
+									setTimeout(() => {
+										uni.navigateBack({
+											delta: 1,
+										});
+									}, 1000)
+								}, err => {
+									console.log(err);
+								}).finally(() => {
+
+								});
+
+							} else {
+								updateNurseInfo(this.formData).then(res => {
+									uni.$u.toast('修改成功');
+									setTimeout(() => {
+										// uni.$emit('returnAddress', this.formData);
+										uni.navigateBack({
+											delta: 1,
+										});
+									}, 1000)
+								}, err => {
+									console.log(err);
+								}).finally(() => {
+
+								});
+
+							}
+
+						}
+					})
+					.catch((errors) => {
+						console.log(",errors", errors);
+						uni.$u.toast('校验失败');
+					});
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.container {
+		padding: 20rpx;
+		padding-bottom: 200rpx;
+
+		.form-box {
+			padding: 20rpx;
+			background-color: #fff;
+
+			::v-deep .u-input {
+				padding: 15rpx !important;
+			}
+
+			::v-deep .u-upload {
+				margin-top: 15rpx;
+			}
+
+			.upload-box {
+				margin-top: 20rpx;
+
+				.name-box {
+					display: flex;
+					align-items: center;
+					margin-top: 20rpx;
+
+					.btn {
+						padding: 10rpx 20rpx;
+						background-color: #4B91D1;
+						color: #fff;
+						border-radius: 10rpx;
+						margin-left: 20rpx;
+						border: 1rpx solid #4B91D1;
+					}
+
+					.btn2 {
+						background-color: #fff;
+						color: #FF0000;
+						border: 1rpx solid #FF0000;
+					}
+				}
+			}
+
+			.switch-box {
+				display: flex;
+				align-items: center;
+				justify-content: flex-end;
+				padding: 20rpx 0;
+
+				.name {
+					margin-right: 20rpx;
+					font-size: 30rpx;
+				}
+			}
+		}
+
+		.footer-box {
+			position: fixed;
+			bottom: 0;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			width: 100%;
+			padding: 50rpx 30rpx;
+			box-sizing: border-box;
+			font-size: 28rpx;
+			background-color: #fff;
+			box-shadow: 0 -2rpx 30rpx #c5c5c53a;
+
+			.btn-box {
+				width: 100%;
+
+				.submit-btn {
+					display: block;
+					width: 100%;
+					height: 80rpx;
+					line-height: 80rpx;
+					text-align: center;
+					color: #fff;
+					background-color: #026EB7;
+					border-radius: 50rpx;
+				}
+			}
+		}
+
+	}
+</style>

+ 368 - 0
pages/workbench/caregiverManage.vue

@@ -0,0 +1,368 @@
+<template>
+	<view class="container">
+		<view class="top-box">
+			<view class="select-item" @click="showSelect(1)">
+				<span class="name">{{params.hospitalId ? hospitalName : '全部医院'}}</span>
+				<image src="/static/下箭头.png" mode="aspectFill"></image>
+			</view>
+			<view class="select-item" @click="showSelect(2)">
+				<span class="name">{{params.sex ? sexName : '性别'}}</span>
+				<image src="/static/下箭头.png" mode="aspectFill"></image>
+			</view>
+			<view class="select-item" @click="showSelect(3)">
+				<span class="name">年龄</span>
+				<image src="/static/sort2.png" mode="aspectFill"></image>
+			</view>
+			<view class="select-item" @click="showSelect(4)">
+				<span class="name">服务中</span>
+				<image src="/static/sort2.png" mode="aspectFill"></image>
+			</view>
+		</view>
+
+		<view class="list-box">
+			<view class="item-box" v-for="item,index in list" :key="index">
+				<u-image :src="item.photographUrl" width="196rpx" height="256rpx" :lazy-load="true"></u-image>
+				<view class="info-box">
+					<view class=" item-txt">{{item.name}}</view>
+					<view class="info-item age-box">
+						<view class="box-l">
+							<view class="item-txt">{{item.sex == '2' ? '女' : '男'}}</view>
+							<view class="item-txt age">{{item.age || '0'}}岁</view>
+						</view>
+						<span class="btn" @click="toDetails(item.id)">去查看></span>
+					</view>
+					<view class="info-item item-txt">工作年限:{{item.workYears || 0}}年</view>
+					<view class="info-item service-box">
+						<span class="item-txt">服务中:{{item.inProgressCount || 0}}</span>
+						<span class="item-txt total">服务总数: {{item.finishCount || 0}}</span>
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 底部按钮 -->
+		<view class="footer-box" v-if="type == 'guanli'">
+			<view class="btn-box">
+				<view class="submit-btn" @click="addCaregiver">新增护工</view>
+			</view>
+		</view>
+
+
+		<u-action-sheet :show="showAction" :actions="hospitalList" title="请选择" @close="showAction = false"
+			@select="actionSelect">
+		</u-action-sheet>
+
+
+
+		<u-action-sheet :show="showSex" :actions="sexList" title="请选择性别" @close="showSex = false" @select="sexSelect"
+			safeAreaInsetBottom>
+		</u-action-sheet>
+
+
+	</view>
+</template>
+
+<script>
+	import {
+		dictData
+	} from "@/api/home.js"
+	import {
+		getNurseList,
+		getHospitalListByManage
+	} from '@/api/hospital.js'
+	export default {
+		data() {
+			return {
+				showSex: false,
+				showAction: false,
+				list: [],
+				params: {
+					hospitalId: '',
+					sex: '',
+					sortFiled: 'age', //排序字段 年龄-age 服务中(数量)-serviceCount
+					sortMethod: 'asc', //排序方式 正序-asc 倒序-desc
+				},
+				hospitalList: [],
+				hospitalName: '',
+
+				sexList: [],
+				sexName: '',
+
+				type: 'guanli',
+				orderNo: '',
+			}
+		},
+		onLoad(option) {
+			this.getNurseList()
+			this.getHospitalList()
+			this.getSexList()
+			if (option.type) {
+				this.type = option.type
+			}
+			if (option.orderNo) {
+				this.orderNo = option.orderNo
+				this.params.hospitalId = option.hospitalId
+				this.hospitalName = option.hospitalName
+			}
+		},
+		methods: {
+			getNurseList() {
+				let that = this;
+				uni.showLoading({
+					title: '加载中',
+					mask: true,
+				});
+
+				getNurseList(this.params).then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							this.list = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					}).finally(() => {
+						uni.hideLoading();
+					});
+			},
+			//获取于老师关联的医院
+			getHospitalList() {
+				let that = this;
+				getHospitalListByManage().then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							data.unshift({
+								id: '',
+								name: '全部',
+							})
+							this.hospitalList = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+
+			//去查看详情
+			toDetails(id) {
+				uni.navigateTo({
+					url: '/pages/workbench/caregiverDetails?id=' + id + '&type=' + this.type + '&orderNo=' + this.orderNo
+
+				})
+			},
+
+			//获取性别字典
+			getSexList() {
+				let that = this;
+				dictData('sys_user_sex').then(res => {
+					let data = res.data;
+					data.forEach(item => {
+						item.name = item.dictLabel
+					})
+					data.unshift({
+						dictValue: '',
+						name: '全部',
+					})
+					that.sexList = data;
+					// if (that.InfoId) {
+					// 	that.formData.genderName = that.sexList.find(item => item.dictValue == that.formData
+					// 		.gender).name
+					// }
+				}, err => {
+					console.log(err);
+				}).finally(() => {
+
+				});
+			},
+
+
+			showSelect(val) {
+				if(this.type != 'guanli') return
+				switch (val) {
+					case 1:
+						this.showAction = true;
+						break;
+					case 2:
+						this.showSex = true;
+						break;
+					case 3:
+						this.params.sortFiled = 'age';
+						this.params.sortMethod = this.params.sortMethod == 'asc' ? 'desc' : 'asc';
+						this.getNurseList();
+						break;
+					case 4:
+						this.params.sortFiled = 'serviceCount';
+						this.params.sortMethod = this.params.sortMethod == 'asc' ? 'desc' : 'asc';
+						this.getNurseList();
+						break;
+				}
+			},
+			actionSelect(e) {
+				console.log(e);
+				this.showAction = false;
+				this.params.hospitalId = e.id
+				this.hospitalName = e.name
+				this.getNurseList()
+			},
+
+			sexSelect(e) {
+				console.log(e);
+				this.showAction = false;
+				this.params.sex = e.dictValue
+				this.sexName = e.name
+				this.getNurseList()
+			},
+
+			addCaregiver() {
+				uni.navigateTo({
+					url: '/pages/workbench/caregiverForm?type=add',
+				})
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.container {
+		padding: 20rpx 20rpx 200rpx;
+
+		.top-box {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.select-item {
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				padding: 20rpx;
+				border-radius: 10rpx;
+				background-color: #fff;
+				margin-right: 10rpx;
+
+
+				&:first-child {
+					width: 250rpx;
+
+					.name {
+						font-size: 24rpx;
+						margin-right: 10rpx;
+						//一行省略
+						overflow: hidden;
+						text-overflow: ellipsis;
+						white-space: nowrap;
+						width: 200rpx;
+					}
+				}
+
+				&:last-child {
+					margin-right: 0;
+
+				}
+
+				.name {
+					font-size: 24rpx;
+					margin-right: 10rpx;
+				}
+
+				image {
+					width: 30rpx;
+					height: 30rpx;
+				}
+			}
+		}
+
+		.list-box {
+			display: flex;
+			flex-direction: column;
+
+			.item-box {
+				display: flex;
+				align-items: center;
+				background-color: #fff;
+				border-radius: 10rpx;
+				margin-top: 20rpx;
+				padding: 20rpx;
+
+				.info-box {
+					display: flex;
+					flex-direction: column;
+					justify-content: space-between;
+					margin-left: 20rpx;
+					flex: 1;
+
+					.info-item {
+						margin-top: 30rpx;
+					}
+
+					.item-txt {
+						font-size: 28rpx;
+						color: #1a1a1a;
+					}
+
+					.age-box {
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+
+						.box-l {
+							display: flex;
+							align-items: center;
+
+							.age {
+								margin-left: 30rpx;
+							}
+						}
+
+						.btn {
+							font-size: 28rpx;
+							color: #4B91D1;
+						}
+					}
+
+					.service-box {
+
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+
+						.total {}
+					}
+				}
+			}
+		}
+
+
+		.footer-box {
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			width: 100%;
+			padding: 50rpx 30rpx;
+			box-sizing: border-box;
+			font-size: 28rpx;
+			background-color: #fff;
+			box-shadow: 0 -2rpx 30rpx #c5c5c53a;
+
+			.btn-box {
+				width: 100%;
+
+				.submit-btn {
+					display: block;
+					width: 100%;
+					height: 80rpx;
+					line-height: 80rpx;
+					text-align: center;
+					color: #fff;
+					background-color: #026EB7;
+					border-radius: 50rpx;
+				}
+			}
+		}
+	}
+</style>

+ 280 - 0
pages/workbench/managementDept.vue

@@ -0,0 +1,280 @@
+<template>
+	<view class="container">
+		<view class="top-box">
+			<view class="select-item" @click="showSelect(1)">
+				<span class="name">{{params.hospitalId ? hospitalName : '全部医院'}}</span>
+				<image src="/static/下箭头.png" mode="aspectFill"></image>
+			</view>
+			<view class="select-item" @click="showSelect(2)">
+				<span class="name">{{params.departmentId ? deptName : '全部科室'}}</span>
+				<image src="/static/下箭头.png" mode="aspectFill"></image>
+			</view>
+		</view>
+		<view class="main-info">
+			<view class="title">
+				订单汇总信息
+			</view>
+			<view class="num-box ">
+				<view class="num-item flex-box-cloum">
+					<span class="num">{{statisticsInfo.inProgressCount || 0}}</span>
+					<span class="name">服务中</span>
+				</view>
+				<view class="num-item flex-box-cloum">
+					<span class="num">{{statisticsInfo.finishCount || 0}}</span>
+					<span class="name">已完成</span>
+				</view>
+				<view class="num-item flex-box-cloum">
+					<span class="num">{{statisticsInfo.orderCount || 0}}</span>
+					<span class="name">累计订单数</span>
+				</view>
+			</view>
+		</view>
+		<view class="hospital-list">
+			<view class="hospital-item" v-for="item,index in deptList" :key="index">
+				<view class="title-box">
+					<u-icon name="calendar" color="#2979ff" size="28"></u-icon>
+					<span class="name">{{item.hospitalName || ''}}-{{item.departmentName || ''}}</span>
+				</view>
+				<view class="num-box">
+					<view class="num-item flex-box-cloum">
+						<span class="num">{{item.inProgressCount || 0}}</span>
+						<span class="name">服务中</span>
+					</view>
+					<view class="num-item flex-box-cloum">
+						<span class="num">{{item.finishCount || 0}}</span>
+						<span class="name">已完成</span>
+					</view>
+					<view class="num-item flex-box-cloum">
+						<span class="num">{{item.orderCount || 0}}</span>
+						<span class="name">累计订单数</span>
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<u-action-sheet :show="showAction" :actions="hospitalList" title="请选择" @close="showAction = false"
+			:closeOnClickOverlay="true" :closeOnClickAction="true" @select="actionSelect">
+		</u-action-sheet>
+
+
+		<u-action-sheet :show="showDept" :actions="deptActions" title="请选择" @close="showDept = false"
+			:closeOnClickOverlay="true" :closeOnClickAction="true" @select="deptSelect">
+		</u-action-sheet>
+	</view>
+</template>
+
+<script>
+	import {
+		getDepartmentList,
+		getHospitalListByManage,
+		getDepartmentListByManage,
+		getDepartmentOrderCount
+	} from '@/api/hospital.js'
+	export default {
+		data() {
+			return {
+				showAction: false,
+				hospitalId: undefined,
+				actions: [],
+				hospitalList: [],
+
+				hospitalName: '',
+				deptList: [],
+
+				departmentId: '',
+
+				showDept: false,
+				deptActions: [],
+				deptName: '',
+
+				statisticsInfo: null,
+
+				params: {
+					hospitalId: undefined,
+					departmentId: undefined
+				},
+			}
+		},
+		onLoad() {
+			this.getHospitalList();
+			this.getDepartmentOrderCount()
+		},
+		methods: {
+			//获取于老师关联的医院
+			getHospitalList() {
+				let that = this;
+				getHospitalListByManage().then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							data.unshift({
+								id: '',
+								name: '全部医院',
+							})
+							that.hospitalList = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+
+			//获取管理老师关联的科室订单统计
+			getDepartmentOrderCount() {
+				let that = this;
+				uni.showLoading({
+					title: '加载中',
+					mask: true,
+				});
+				getDepartmentOrderCount(that.params).then(res => {
+					if (res.code == 200) {
+						if (res.data) {
+							that.statisticsInfo = res.data;
+							that.deptList = res.data.departmentOrderCountList
+						}
+					}
+				}).catch((err) => {
+					console.log(err);
+
+				}).finally(() => {
+					uni.hideLoading();
+
+				})
+			},
+
+			//获取科室列表
+			getDepartmentList() {
+				let that = this;
+				let param = {
+					hospitalId: that.params.hospitalId
+				};
+				getDepartmentListByManage(param).then(res => {
+					if (res.code == 200) {
+						// this.actions = res.data
+						let data = res.data
+						data.unshift({
+							id: '',
+							name: '全部科室',
+						})
+						this.deptActions = data
+					}
+				})
+			},
+			showSelect(type) {
+				switch (type) {
+					case 1:
+						this.showAction = true;
+						break;
+					case 2:
+						this.showDept = true;
+						break;
+
+				}
+			},
+			deptSelect(e) {
+				console.log(e);
+				this.showDept = false;
+				this.params.departmentId = e.id
+				this.deptName = e.name
+				this.getDepartmentOrderCount()
+			},
+			actionSelect(e) {
+				console.log(e);
+				this.showAction = false;
+				this.params.hospitalId = e.id
+				this.hospitalName = e.name
+				this.getDepartmentList();
+				this.getDepartmentOrderCount()
+			},
+
+
+
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.container {
+		padding: 20rpx;
+
+		.top-box {
+			display: flex;
+			align-items: center;
+
+			.select-item {
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				padding: 20rpx;
+				border-radius: 10rpx;
+				background-color: #fff;
+				flex: 1;
+
+				&:first-child {
+					margin-right: 20rpx;
+				}
+
+				.name {
+					font-size: 30rpx;
+				}
+
+				image {
+					width: 40rpx;
+					height: 40rpx;
+				}
+			}
+		}
+
+		.main-info {
+			background-color: #fff;
+			border-radius: 10rpx;
+			padding: 20rpx;
+			margin-top: 20rpx;
+
+			.title {
+				width: 100%;
+				padding: 0 20rpx;
+				text-align: center;
+			}
+
+		}
+
+		.hospital-list {
+
+			.hospital-item {
+				padding: 20rpx;
+				margin-top: 20rpx;
+				background-color: #fff;
+				border-radius: 10rpx;
+
+				.title-box {
+					display: flex;
+					align-items: center;
+					padding: 0 20rpx;
+				}
+			}
+		}
+
+		.num-box {
+			display: flex;
+			align-items: center;
+			justify-content: space-around;
+			margin-top: 20rpx;
+
+			.num-item {
+
+				.num {
+					font-size: 32rpx;
+					font-weight: bold;
+				}
+
+				.name {
+					margin-top: 10rpx;
+					font-size: 28rpx;
+					color: #666666;
+
+				}
+			}
+		}
+	}
+</style>

+ 352 - 0
pages/workbench/manager.vue

@@ -0,0 +1,352 @@
+<template>
+	<view class="container">
+		<view class="user-info-box">
+			<view class="box-l">
+				<view class="img-box">
+					<u-avatar :src="workbenchInfo.photographUrl || defaultImg" size="121rpx"
+						mode="aspectFill"></u-avatar>
+				</view>
+				<view class="info-r">
+					<view class="info-r-top">
+						<span class="name">{{workbenchInfo.name || '-'}}</span>
+					</view>
+					<span class="phone">{{workbenchInfo.phoneNumber || '-'}}</span>
+				</view>
+			</view>
+			<view class="box-r">
+				<span class="btn" @click="toDept">查看管理科室</span>
+			</view>
+
+		</view>
+		<view class="num-box flex-ac">
+			<view class="num-item flex-ac">
+				<view class="num-item-l">
+					<span class="name">今日订单数</span>
+					<span class="num">{{workbenchInfo.todayCount || 0}}</span>
+				</view>
+				<image src="/static/copy.png" mode="aspectFill"></image>
+			</view>
+			<view class="num-item flex-ac">
+				<view class="num-item-l">
+					<span class="name">总订单数</span>
+					<span class="num">{{workbenchInfo.orderCount || 0}}</span>
+				</view>
+				<image src="/static/copy.png" mode="aspectFill"></image>
+			</view>
+		</view>
+
+		<view class="order-box flex-dc">
+			<view class="title-box flex-box-c-b">
+				<span class="title">订单管理</span>
+				<span class="more" @click="toPath(0)">查看全部></span>
+			</view>
+			<view class="order-list flex-box-a">
+				<view class="order-item flex-box-cloum" v-for="item,index in orderType" :key="index"
+					@click="toPath(item.index)">
+					<image :src="item.icon" mode="aspectFill"></image>
+					<span class="name">{{item.name}}</span>
+				</view>
+			</view>
+		</view>
+
+		<view class="order-box flex-dc">
+			<view class="title-box flex-box-c-b">
+				<span class="title">应用中心</span>
+			</view>
+			<view class="order-list flex-box-a">
+				<view class="order-item flex-box-cloum" @click="toPath(2)">
+					<image src="@/static/my/icon-04.png" mode="aspectFill"></image>
+					<span class="name">待服务</span>
+					<u-badge type="error" max="99" :value="workbenchInfo.waitConfirmedCount" :offset="[-10, -10]"
+						absolute></u-badge>
+				</view>
+				<view class="order-item flex-box-cloum" @click="toRefund">
+					<image src="@/static/my/icon-04.png" mode="aspectFill"></image>
+					<span class="name">退款售后</span>
+					<u-badge type="error" max="99" :value="workbenchInfo.waitRefundCount" :offset="[-10, -10]"
+						absolute></u-badge>
+				</view>
+				<view class="order-item flex-box-cloum" @click="toPage">
+					<image src="@/static/my/icon-04.png" mode="aspectFill"></image>
+					<span class="name">护工管理</span>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		getManageInfo,
+	} from '@/api/hospital.js'
+	export default {
+		data() {
+			return {
+
+				defaultImg: require('@/static/default-head-photo.png'),
+				workbenchInfo: {
+
+				},
+				orderType: [{
+					index: 1,
+					name: '待确认',
+					icon: require('@/static/my/icon-04.png'),
+				}, {
+					index: 2,
+					name: '待服务',
+					icon: require('@/static/my/icon-04.png'),
+				}, {
+					index: 3,
+					name: '服务中',
+					icon: require('@/static/my/icon-04.png'),
+				}, {
+					index: 4,
+					name: '待评价',
+					icon: require('@/static/my/icon-04.png'),
+				}, {
+					index: 5,
+					name: '已完成',
+					icon: require('@/static/my/icon-04.png'),
+				}, ],
+				quickOrder: [{
+					index: 1,
+					name: '待服务',
+					icon: require('@/static/my/icon-04.png'),
+					value: 100
+				}, {
+					index: 2,
+					name: '退款售后',
+					icon: require('@/static/my/icon-04.png'),
+					value: 10
+				}, {
+					index: 3,
+					name: '护工管理',
+					icon: require('@/static/my/icon-04.png'),
+					value: 100
+				}, ]
+			}
+		},
+		onLoad() {
+			this.getManageInfo()
+		},
+		methods: {
+			//获取信息
+			getManageInfo() {
+				let that = this;
+				getManageInfo().then(res => {
+						if (res.code == 200) {
+							let data = res.data;
+							this.workbenchInfo = data;
+							// data.unshift({
+							// 	value: '全部',
+							// 	code: undefined,
+							// })
+							// this.typeList = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+			
+			
+
+			//查看管理科室
+			toDept() {
+				uni.navigateTo({
+					url: '/pages/workbench/managementDept',
+				})
+			},
+			toPath(val) {
+				uni.navigateTo({
+					url: '/pages/workbench/order/list?type=' + val
+				})
+			},
+
+			toPage() {
+				if (this.workbenchInfo.manageNursingFlag == 'Y') {
+					uni.navigateTo({
+						url: '/pages/workbench/caregiverManage?type=guanli',
+					})
+
+				} else {
+					uni.showToast({
+						title: '您没有权限',
+						icon: 'none',
+						duration: 2000,
+					})
+				}
+			},
+			
+			toRefund(){
+				uni.navigateTo({
+						url: '/pages/workbench/refundOrder',
+						
+				})
+			},
+
+			//下拉刷新回调函数
+			onPullDownRefresh() {
+				// wx.setStorageSync('isChangeBanner', true);
+				this.getManageInfo();
+				setTimeout(function() {
+					uni.stopPullDownRefresh();
+				}, 1000);
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		padding: 30rpx;
+
+		.user-info-box {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 20rpx;
+			background-color: #fff;
+			border-radius: 20rpx;
+
+			.box-l {
+				display: flex;
+				align-items: center;
+
+				.info-r {
+					display: flex;
+					flex-direction: column;
+					margin-left: 25rpx;
+
+					.info-r-top {
+						display: flex;
+						align-items: center;
+						margin-bottom: 10rpx;
+
+						.name {
+							display: inline-flex;
+							font-size: 36rpx;
+							height: 36rpx;
+							line-height: 36rpx;
+							justify-content: center;
+							font-weight: bold;
+						}
+
+						.status {
+							display: inline-flex;
+							font-size: 24rpx;
+							margin-left: 10rpx;
+							height: 40rpx;
+							line-height: 40rpx;
+							padding: 0 20rpx;
+							background-color: #FFF9D9;
+							color: #B16E55;
+							border-radius: 50rpx;
+
+						}
+					}
+
+					.phone {
+						font-size: 28rpx;
+						color: #101010;
+					}
+
+				}
+
+			}
+
+			.box-r {
+				.btn {
+					font-size: 28rpx;
+					color: #B16E55;
+				}
+			}
+		}
+
+		.num-box {
+			margin-top: 20rpx;
+
+			.num-item {
+				width: 48%;
+				padding: 20rpx;
+				background-color: #fff;
+				border-radius: 20rpx;
+				justify-content: center;
+
+				&:first-child {
+					margin-right: 20rpx;
+
+				}
+
+				.num-item-l {
+					display: flex;
+					align-items: center;
+					flex-direction: column;
+					margin-right: 20rpx;
+
+					.name {
+						font-size: 36rpx;
+						color: #101010;
+
+					}
+
+					.num {
+						font-size: 36rpx;
+						font-weight: bold;
+						color: #101010;
+
+					}
+
+				}
+
+				image {
+					width: 40rpx;
+					height: 40rpx;
+					border-radius: 50%;
+				}
+			}
+		}
+
+		.order-box {
+			background-color: #fff;
+			padding: 20rpx;
+			border-radius: 20rpx;
+			margin-top: 20rpx;
+
+			.title-box {
+				margin-bottom: 20rpx;
+
+				.title {
+					font-size: 36rpx;
+					font-weight: bold;
+					color: #101010;
+				}
+
+				.more {
+					font-size: 28rpx;
+					color: #9a9a9a;
+				}
+			}
+
+			.order-list {
+				.order-item {
+					position: relative;
+					margin: 20rpx 0;
+
+					image {
+						width: 90rpx;
+						height: 90rpx;
+					}
+
+					.name {
+						margin-top: 15rpx;
+						font-size: 28rpx;
+						color: #101010;
+					}
+				}
+			}
+
+		}
+	}
+</style>

+ 773 - 0
pages/workbench/order/list.vue

@@ -0,0 +1,773 @@
+<template>
+	<view class="container">
+		<u-sticky bgColor="#fff">
+			<!-- <view class="search-box">
+				<u-input placeholder="搜索我的订单" v-model="serviceName"
+					:customStyle="{backgroundColor: '#eee',borderRadius: '50rpx',padding:'12rpx 30rpx'}" :border="false"
+					@confirm="getOrderList('reload')">
+					<template slot="suffix">
+						<image src="/static/search-02.png" mode="aspectFill" style="width: 40rpx;height: 36rpx;"
+							@click="getOrderList('reload')">
+						</image>
+					</template>
+				</u-input>
+			</view> -->
+			<u-tabs :lineWidth="50" :activeStyle="{ color: '#4B91D1' }" :list="typeList" keyName="value"
+				:current="current" @change="changeTab"></u-tabs>
+		</u-sticky>
+		<view class="order-list">
+			<view class="order-item" v-for="item,index in orderList" :key="index" @click="toDetails(item)">
+				<!-- 头部为左右结构,左边为名称、订单编号,右边为订单金额 -->
+				<view class="order-t-box">
+					<view class="order-t-box-l">
+						<view class="order-name">
+							{{item.serviceName || '-'}}(数量:{{item.orderNum || '-'}})
+						</view>
+						<view class="order-no">
+							<span>订单编号:{{item.orderNo || '-'}}</span>
+							<image class="icon" :src="copyImg" mode="aspectFill"
+								@click.stop="$utils.copyTxt(item.orderNo)"></image>
+						</view>
+					</view>
+					<view class="order-t-box-r">
+						<span class="title">订单金额</span>
+						<span class="price">¥{{item.totalPrice || '-'}}</span>
+					</view>
+				</view>
+				<u-line color="#f0f0f0"></u-line>
+				<view class="order-b-box">
+					<view class="order-b-box-l">
+						<view class="order-b-item">
+							<span class="title">医院:</span>
+							<span class="txt">{{item.hospitalVo.name || '-'}}</span>
+						</view>
+						<view class="order-b-item">
+							<span class="title">科室:</span>
+							<span class="txt">{{item.hospitalDepartmentName || '-'}}</span>
+						</view>
+						<view class="order-b-item">
+							<span class="title">就诊人:</span>
+							<span class="txt">{{item.patientVo.name || '-'}}({{item.patientVo.mobile || '-'}})</span>
+						</view>
+					</view>
+					<view class="order-b-box-r">
+						<span class="status"
+							:class="item.status == 6 ? 'cancle' : ''">{{getStatusTxt(item.status)}}</span>
+					</view>
+				</view>
+				<u-line color="#f0f0f0"></u-line>
+				<view class="btn-box">
+					<span class="time">{{$utils.mFormatDate(item.expectedTime, 'yyyy-MM-dd HH:mm') || '-'}}</span>
+					<!-- 联系管理老师 -->
+					<view class="btn-box-r" v-if="roleType == 'guanli'">
+						<!-- 待确认 -->
+						<span class="btn " v-if="item.status == 1" @click.stop="cancleOrder(item.id)">取消订单</span>
+						<span class="btn btn2" v-if="item.status == 1"
+							@click.stop="allocation(item.id,item.hospitalId,item.hospitalVo.name)">分配护工</span>
+						<!-- 待服务,服务中 -->
+						<span class="btn btn1" v-if="item.status == 2 || item.status == 3"
+							@click.stop="contactPerson(item.id)">联系护工</span>
+						<span class="btn btn2" v-if="item.status == 2 || item.status == 3"
+							@click.stop="changeCaregiver(item.id,item.hospitalId,item.hospitalVo.name)">更换护工</span>
+
+						<!-- <span class="btn " v-if="item.status == 1 || item.status == 2 "
+							@click.stop="contactPerson(item.id)">联系管理老师</span>
+						<span class="btn btn1" v-if="item.status == 1" @click.stop="startOrder(item.id)">开始服务</span>
+						<span class="btn btn2" v-if="item.status == 2" @click.stop="confirmOrder(item.id)">完成服务</span> -->
+					</view>
+					<!-- 护工 -->
+					<view class="btn-box-r" v-if="roleType == 'hugong'">
+						<span class="btn btn2" v-if="item.status == 2 || item.status == 3"
+							@click.stop="contactPersonManage(item.id)">联系管理老师</span>
+						<span class="btn " v-if="item.status == 2" @click.stop="startService(item.id)">开始服务</span>
+						<span class="btn " v-if="item.status == 3" @click.stop="finishService(item.id)">完成服务</span>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="empty-box" v-if="!orderList.length">
+			<u-image src="/static/none.png" mode="aspectFill" width="582rpx" height="582rpx"></u-image>
+			<span class="empty-txt">暂无数据!</span>
+			<!-- <u-empty marginTop="100" style="width: 100%;"></u-empty> -->
+		</view>
+		<view style="width: 100%;padding-bottom: 40rpx;" v-else>
+			<u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText"
+				:nomore-text="nomoreText" @loadmore="loadmore" dashed line marginTop="20" />
+		</view>
+
+		<u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="popShow" @close="popClose"
+			@open="open" :round="20">
+			<view class="pop-box">
+				<view class="pop-title">联系{{popTitle}}</view>
+				<view class="pop-content">
+					<view class="pop-item" v-for="item,index in workerList" :key="index" @click="confirmAndCall(item)">
+						<u-icon name="phone" color="#fff"></u-icon>
+						<span class="txt">{{item || '-'}}</span>
+					</view>
+				</view>
+				<view class="footer-btn">
+					<span class="btn">取消</span>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	import {
+		getOrderList,
+		getOrderStatus,
+	} from "@/api/order.js"
+	import {
+		getManageOrderList,
+		getNursePhone,
+		getManagePhone,
+		cancelOrderManage,
+		startService,
+		finishService,
+		getNurseOrderList
+	} from "@/api/hospital.js"
+	export default {
+		data() {
+			return {
+				copyImg: require('@/static/copy.png'),
+				serviceName: undefined,
+				orderStatus: undefined,
+				roleType: 'guanli',
+				orderList: [{
+					status: 1,
+				}, {
+					status: 2,
+				}],
+				typeList: [],
+				loading: false,
+				pageSize: 10,
+				pageNum: 1,
+				botLoadingShow: 0, //0不显示  1显示 3.显示没有更多了
+				loadingShow: false,
+				status: 'loadmore',
+				loadingText: '努力加载中',
+				loadmoreText: '上拉或点击加载更多',
+				nomoreText: '实在没有了',
+				total: 0,
+				customBar: 0, //状态栏高度 + 导航栏高度
+				status: {
+					10: ''
+				},
+				current: 0,
+				isFirst: true,
+
+				workerList: [{
+					mobile: '13555265325',
+				}, {
+					mobile: '15800215426',
+				}, {
+					mobile: '15074125896',
+				}],
+				popShow: false,
+				popTitle: '护工',
+			}
+		},
+		onLoad(option) {
+			let roleType = uni.getStorageSync('roleType');
+			if (roleType) { //当前权限
+				this.roleType = roleType
+			}
+			if (option.type) {  //订单状态
+				this.orderStatus = option.type;
+				if (roleType == 'hugong') {
+					this.current = option.type - 1;
+				} else {
+					this.current = option.type;
+				}
+			}
+		},
+		onShow() {
+			if (this.isFirst) {
+				this.isFirst = false;
+			} else {
+				// 获取全局参数
+				const app = getApp();
+				if (app.globalData.switchTabParams) {
+					const params = app.globalData.switchTabParams;
+					console.log('接收到的参数:', params);
+					if (params.reload) {
+						console.log('onShow');
+						this.init()
+						// 使用完后可以清除
+						app.globalData.switchTabParams = null;
+						return
+					} else {
+
+					}
+
+				}
+			}
+
+		},
+		onLoad() {
+			this.init();
+		},
+		methods: {
+			init() {
+				console.log("初始化");
+				this.getOrderList("reload")
+				this.getOrderStatus();
+			},
+
+			//获取订单列表
+			getOrderList(reload) {
+				// 验证登录
+				// let token = uni.getStorageSync('apiToken');
+				// if (!token) return
+				let that = this;
+				if (reload) {
+					that.pageNum = 1;
+					that.orderList = [];
+				}
+				uni.showLoading({
+					title: '加载中',
+					mask: true,
+				});
+				let param = {
+					status: that.orderStatus,
+					pageNum: that.pageNum,
+					pageSize: that.pageSize,
+				};
+
+				if (that.roleType == 'guanli') {
+					getManageOrderList(param).then(res => {
+							let data = res.rows;
+							if (data) {
+								that.orderList.push(...data); //在列表后面新增新获取的数据
+								that.total = res.total; //获取数据总页数
+								if (that.orderList.length >= that.total) {
+									that.status = 'nomore';
+									return;
+								}
+							} else {
+								that.status = 'nomore';
+							}
+						})
+						.catch((err) => {
+							console.log(err);
+						})
+						.finally(() => {
+							uni.hideLoading();
+						});
+				} else {
+					getNurseOrderList(param).then(res => {
+							let data = res.rows;
+							if (data) {
+								that.orderList.push(...data); //在列表后面新增新获取的数据
+								that.total = res.total; //获取数据总页数
+								if (that.orderList.length >= that.total) {
+									that.status = 'nomore';
+									return;
+								}
+							} else {
+								that.status = 'nomore';
+							}
+						})
+						.catch((err) => {
+							console.log(err);
+						})
+						.finally(() => {
+							uni.hideLoading();
+						});
+				}
+
+
+			},
+
+			//查询订单状态
+			getOrderStatus() {
+				let that = this;
+				getOrderStatus().then(res => {
+						if (res.code == 200) {
+							let data = res.data.orderStatus;
+							//data数据,根据 roleType 判断显示的订单状态,如果为hugong,则不显示待确认
+							if (that.roleType == 'hugong') {
+								data = data.filter(item => item.code != '1')
+								console.log("data", data);
+							}
+
+							data.unshift({
+								value: '全部',
+								code: undefined,
+							})
+							this.typeList = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+
+			},
+
+
+			//分配护工/更换护工
+			allocation(orderNo, hospitalId, hospitalName) {
+				uni.navigateTo({
+					url: '/pages/workbench/caregiverManage?orderNo=' + orderNo + '&type=fenpei' + '&hospitalId=' +
+						hospitalId + '&hospitalName=' + hospitalName
+				})
+			},
+
+			changeCaregiver(orderNo, hospitalId, hospitalName) {
+				uni.navigateTo({
+					url: '/pages/workbench/caregiverManage?orderNo=' + orderNo + '&type=genghuan' +
+						'&hospitalId=' +
+						hospitalId + '&hospitalName=' + hospitalName
+				})
+			},
+
+			open() {
+				this.popShow = true;
+			},
+
+			popClose() {
+				this.popShow = false;
+			},
+
+			//拨打电话
+			confirmAndCall(phoneNumber) {
+				// 先验证电话号码
+				if (!this.isValidPhoneNumber(phoneNumber)) {
+					uni.showToast({
+						title: '电话号码格式不正确',
+						icon: 'none'
+					});
+					return;
+				}
+
+				// 显示确认对话框
+				uni.showModal({
+					title: '确认拨打电话',
+					content: `确定要拨打 ${phoneNumber} 吗?`,
+					success: (res) => {
+						if (res.confirm) {
+							// 用户点击确定,执行拨打电话
+							this.makePhoneCall(phoneNumber);
+						}
+					}
+				});
+			},
+
+			isValidPhoneNumber(phoneNumber) {
+				// 简单的电话号码验证
+				return /^1[3-9]\d{9}$/.test(phoneNumber);
+			},
+
+			makePhoneCall(phoneNumber) {
+				uni.makePhoneCall({
+					phoneNumber: phoneNumber,
+					success: () => {
+						console.log('拨打电话成功');
+					},
+					fail: (err) => {
+						console.error('拨打电话失败', err);
+						uni.showToast({
+							title: '拨打电话失败',
+							icon: 'none'
+						});
+					}
+				});
+			},
+
+			changeTab(item) {
+				// console.log("item", item);
+				this.pageNum = 1;
+				this.orderList = [];
+				this.orderStatus = item.code;
+				this.getOrderList("reload");
+			},
+			getStatusTxt(value) {
+				let obj = this.typeList.find(item => item.code == value);;
+				return obj ? obj.value : '-'
+			},
+
+			//取消订单
+			cancleOrder(id) {
+				//确认是否删除
+				uni.showModal({
+					title: '提示',
+					content: '确定取消订单吗?',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('用户点击确定');
+							cancelOrderManage(id).then(res => {
+								if (res.code == 200) {
+									uni.showToast({
+										title: '取消成功',
+										icon: 'success'
+									})
+									this.getOrderList("reload")
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+			},
+
+
+			//联系护工
+			contactPerson(id) {
+				let that = this;
+				getNursePhone(id).then(res => {
+						if (res.code == 200) {
+							that.popTitle = '护工'
+							that.workerList = [res.msg];
+							that.open()
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+
+			//联系管理老师
+			contactPersonManage(id) {
+				let that = this;
+				getManagePhone(id).then(res => {
+						if (res.code == 200) {
+							that.popTitle = '管理老师'
+							that.workerList = [res.msg];
+							that.open()
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+
+					})
+
+			},
+
+
+			//开始服务
+			startService(id) {
+				//确认是否
+				uni.showModal({
+					title: '提示',
+					content: '确定开始服务吗?',
+					success: (res) => {
+						if (res.confirm) {
+							startService(id).then(res => {
+								if (res.code == 200) {
+									uni.showToast({
+										title: '开始成功',
+										icon: 'success'
+									})
+									this.getOrderList("reload")
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+			},
+
+			//完成服务
+			finishService(id) {
+				//确认是否
+				uni.showModal({
+					title: '提示',
+					content: '确定完成服务吗?',
+					success: (res) => {
+						if (res.confirm) {
+							finishService(id).then(res => {
+								if (res.code == 200) {
+									uni.showToast({
+										title: '确认成功',
+										icon: 'success'
+									})
+									this.getOrderList("reload")
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+			},
+			//去评价
+			// goEvaluation(item) {
+			// 	uni.navigateTo({
+			// 		url: '/pages/order/evaluation?id=' + item.id
+
+			// 	})
+			// },
+
+
+
+			//去详情
+			toDetails(item) {
+				uni.navigateTo({
+					url: '/pages/workbench/order/orderDetails?id=' + item.id
+				})
+			},
+
+			//去验收
+			toAcceptance(item) {
+				uni.navigateTo({
+					url: '/pages/mineOrders/acceptance?id=' + item.id
+				})
+			},
+
+			//加载更多
+			loadmore() {
+				// 如果当前页数大于等于总页数,状态修改为没有更多了,不再继续往下执行代码
+				if (this.orderList.length >= this.total) {
+					this.status = 'nomore';
+					return;
+				}
+				this.status = 'loading'; //状态改为加载中
+				this.pageNum++;
+				this.getOrderList();
+			},
+
+			onReachBottom() {
+				this.loadmore();
+			},
+
+
+
+			//下拉刷新回调函数
+			onPullDownRefresh() {
+				// wx.setStorageSync('isChangeBanner', true);
+				this.init();
+				setTimeout(function() {
+					uni.stopPullDownRefresh();
+				}, 1000);
+			},
+
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		background-color: #f6f6f6;
+	}
+
+	.search-box {
+		display: flex;
+		align-items: center;
+		padding: 20rpx;
+	}
+
+	.order-list {
+		margin: 20rpx;
+
+		.order-item {
+			margin-bottom: 20rpx;
+			background-color: #fff;
+			border-radius: 20rpx;
+			padding: 10rpx 24rpx 30rpx;
+
+			.order-t-box {
+				display: flex;
+				justify-content: space-between;
+				align-items: flex-start;
+				padding: 20rpx 0;
+
+				.order-t-box-l {
+					.order-name {
+						font-size: 32rpx;
+						font-weight: bold;
+					}
+
+					.order-no {
+						display: flex;
+						align-items: center;
+						margin-top: 15rpx;
+						font-size: 24rpx;
+						color: #6F6F6F;
+
+						.icon {
+							width: 40rpx;
+							height: 40rpx;
+							margin-left: 10rpx;
+						}
+					}
+				}
+
+				.order-t-box-r {
+					display: flex;
+					align-items: center;
+					flex-direction: column;
+
+					.title {
+						font-size: 24rpx;
+						color: #6F6F6F;
+					}
+
+					.price {
+						margin-top: 15rpx;
+						font-size: 32rpx;
+						font-weight: bold;
+						color: #FF0000;
+					}
+				}
+			}
+
+			.order-b-box {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding: 20rpx 0;
+
+				.order-b-box-l {
+					flex: 1;
+
+					.order-b-item {
+						margin-bottom: 15rpx;
+
+						&:last-child {
+							margin-bottom: 0;
+						}
+
+						.title {
+
+							font-size: 26rpx;
+							color: #1A1A1A;
+						}
+
+						.txt {
+							font-size: 26rpx;
+							color: #808080;
+						}
+					}
+				}
+
+				.order-b-box-r {
+					width: 110rpx;
+					text-align: right;
+					font-size: 24rpx;
+					color: #0085FF;
+
+					.cancle {
+						color: #FF0000;
+					}
+				}
+			}
+
+			.btn-box {
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				margin-top: 15rpx;
+
+				.time {
+					font-size: 24rpx;
+					color: #6F6F6F;
+				}
+
+				.btn-box-r {
+
+					display: flex;
+					align-items: center;
+
+					.btn {
+						width: 170rpx;
+						height: 60rpx;
+						margin-left: 20rpx;
+						line-height: 60rpx;
+						text-align: center;
+						background-color: #fff;
+						border: 1rpx solid #4B91D1;
+						color: #4B91D1;
+						border-radius: 30rpx;
+						font-size: 24rpx;
+					}
+
+					.btn1 {
+						background-color: #00aa00;
+						border: 1rpx solid #00aa00;
+						color: #fff;
+					}
+
+					.btn2 {
+						background-color: #4B91D1;
+						border: 1rpx solid #4B91D1;
+						color: #fff;
+					}
+				}
+
+			}
+
+		}
+
+
+	}
+
+	.pop-box {
+		.pop-title {
+			font-size: 32rpx;
+
+			font-weight: bold;
+			text-align: center;
+			padding: 20rpx 0;
+
+		}
+
+		.pop-content {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 30rpx;
+			font-size: 28rpx;
+			color: #6F6F6F;
+			padding: 0 20rpx;
+
+			&>view {
+				margin-bottom: 20rpx;
+
+				&:last-child {
+					margin-bottom: 0;
+
+				}
+
+			}
+
+			.pop-item {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				width: 500rpx;
+				padding: 20rpx 0;
+				background-color: #4B91D1;
+				border-radius: 40rpx;
+				color: #fff;
+
+				.txt {
+					font-size: 28rpx;
+				}
+			}
+
+		}
+
+		.footer-btn {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 60rpx;
+
+			.btn {
+				width: 500rpx;
+				padding: 20rpx 0;
+				border: 1rpx solid #4B91D1;
+				border-radius: 40rpx;
+				color: #333;
+				text-align: center;
+			}
+		}
+	}
+</style>

+ 656 - 0
pages/workbench/order/orderDetails.vue

@@ -0,0 +1,656 @@
+<template>
+	<view class="container" :class="{disableScroll:disableScroll}">
+		<view class="info-box order-status">
+			<view class="status-text">
+				<span class="status">订单状态:{{getStatusTxt(orderInfo.status)}}</span>
+			</view>
+			<view class="refund-btn" v-if="orderInfo.hasRefund" @click="viewRefund">查看退款信息</view>
+		</view>
+		<view class="order-info">
+			<image :src="orderInfo.hospitalVo.logoUrl" mode="aspectFill"></image>
+			<view class="info-content">
+				<span class="name">{{orderInfo.hospitalVo.name || '-'}}</span>
+				<span class="address">
+					<u-icon name="map" color="#999999" size="14"></u-icon>
+					<span class="txt">{{orderInfo.hospitalVo.address || '-'}}</span>
+				</span>
+				<!-- <span class="area">所属区:{{orderInfo.hospitalVo.areaName || '-'}}</span> -->
+			</view>
+		</view>
+		<view class="info-box">
+			<view class="info-item">
+				<span class="title">所在科室</span>
+				<span class="txt">{{orderInfo.hospitalDepartmentName || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">房床号</span>
+				<span class="txt">{{orderInfo.roomNumber || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item info-item-spa">
+				<span class="title">备注</span>
+				<span class="txt">{{orderInfo.remarks || '-'}}</span>
+			</view>
+		</view>
+		<view class="info-box">
+			<view class="info-item">
+				<span class="title">就诊人</span>
+				<span class="txt">{{orderInfo.patientVo.name || '-'}}({{orderInfo.patientVo.mobile || '-'}})</span>
+			</view>
+		</view>
+		<view class="info-box">
+			<view class="info-item">
+				<span class="title">服务产品</span>
+				<span class="txt">{{orderInfo.serviceName || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">期望时间</span>
+				<span class="txt">{{orderInfo.expectedTime || '-'}}</span>
+			</view>
+		</view>
+
+		<!-- 基本信息 -->
+		<view class="info-box">
+			<span class="title-m">基本信息</span>
+			<view class="info-item">
+				<span class="title">订单号</span>
+				<span class="txt">{{orderInfo.orderNo || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">下单时间</span>
+				<span class="txt">{{orderInfo.createTime || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">下单数量</span>
+				<span class="txt">{{orderInfo.orderNum || '-'}}({{ getUnitTxt(orderInfo.serviceUnit) }})</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">销售价格</span>
+				<span class="txt">¥{{orderInfo.sellingPrice || "0.00"}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">应付金额</span>
+				<span class="txt">¥{{orderInfo.totalPrice || "0.00"}}</span>
+			</view>
+		</view>
+
+		<!-- 护工信息 -->
+		<view class="info-box" v-if="orderInfo.orderWorkerChangeRecord">
+			<span class="title-m">护工信息</span>
+			<view class="info-item">
+				<span class="title">姓名</span>
+				<span class="txt">{{orderInfo.orderWorkerChangeRecord.workerName || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">电话</span>
+				<span class="txt">{{orderInfo.orderWorkerChangeRecord.workerPhoneNumber || '-'}}</span>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">性别</span>
+				<span class="txt">{{orderInfo.orderWorkerChangeRecord.sex == 1 ? '男' : '女' || '-'}}</span>
+			</view>
+		</view>
+
+		<!-- 服务信息 -->
+		<view class="info-box" v-if="orderInfo.status != '1' || orderInfo.status != '2'">
+			<span class="title-m">服务信息</span>
+			<view class="info-item">
+				<span class="title">开始时间</span>
+				<span class="txt">{{orderInfo.orderWorkerChangeRecord.workerStartTime || '-'}}</span>
+			</view>
+			<u-line></u-line>
+
+			<view class="info-item">
+				<span class="title">完成时间</span>
+				<span class="txt">{{orderInfo.orderWorkerChangeRecord.workerEndTime || '-'}}</span>
+			</view>
+		</view>
+
+		<!-- 评价信息 -->
+		<view class="info-box" v-if="orderInfo.status == '5'">
+			<span class="title-m">评价信息</span>
+			<view class="info-item">
+				<span class="title">服务态度</span>
+				<u-rate :count="count" v-model="orderInfo.orderReviews.serviceAttitude"></u-rate>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">着装仪态</span>
+				<u-rate :count="count" v-model="orderInfo.orderReviews.dressAppearance"></u-rate>
+			</view>
+			<u-line></u-line>
+			<view class="info-item">
+				<span class="title">沟通能力</span>
+				<u-rate :count="count" v-model="orderInfo.orderReviews.communicationAbility"></u-rate>
+			</view>
+			<u-line></u-line>
+			<view class="tip-txt">
+				文字评价:{{orderInfo.orderReviews.content}}
+			</view>
+		</view>
+
+		<!-- 底部按钮 -->
+		<view class="footer-box">
+			<!-- 管理 -->
+			<view class="btn-box" v-if="roleType == 'guanli'">
+				<!-- 待确认 -->
+				<span class="btn " v-if="orderInfo.status == 1" @click.stop="cancleOrder(orderInfo.id)">取消订单</span>
+				<span class="btn btn2" v-if="orderInfo.status == 1"
+					@click.stop="allocation(orderInfo.id,orderInfo.hospitalId,orderInfo.hospitalVo.name)">分配护工</span>
+				<!-- 待服务,服务中 -->
+				<span class="btn btn1" v-if="orderInfo.status == 2 || orderInfo.status == 3"
+					@click.stop="confirmAndCall(orderInfo.orderWorkerChangeRecord.workerPhoneNumber)">联系护工</span>
+				<span class="btn btn2" v-if="orderInfo.status == 2 || orderInfo.status == 3"
+					@click.stop="changeCaregiver(orderInfo.id,orderInfo.hospitalId,orderInfo.hospitalVo.name)">更换护工</span>
+			</view>
+			<!-- 护工 -->
+			<view class="btn-box" v-if="roleType == 'hugong'">
+				<!-- 待服务 -->
+				<span class="btn btn2" v-if="orderInfo.status == 2 || orderInfo.status == 3"
+					@click.stop="confirmAndCall(orderInfo.orderWorkerChangeRecord.operatingTeacherPhoneNumber)">联系管理老师</span>
+				<span class="btn " v-if="orderInfo.status == 2" @click.stop="startService(orderInfo.id)">开始服务</span>
+				<!-- 服务中 -->
+				<span class="btn " v-if="orderInfo.status == 3" @click.stop="finishService(orderInfo.id)">完成服务</span>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		getOrderDetail,
+		getServiceUnit,
+		getOrderStatus,
+	} from '@/api/order.js'
+	import {
+		getOrderDetailManage,
+		getNursePhone,
+		cancelOrderManage,
+		startService,
+		finishService,
+		getOrderDetailNurse
+	} from '@/api/hospital.js'
+
+	export default {
+		components: {},
+		data() {
+			return {
+				count: 5,
+				value: 3,
+				orderInfo: {
+					serviceUnit: ''
+				},
+				typeList: [],
+				couponList: [],
+				disableScroll: false,
+				timer: null,
+				unitList: [],
+				orderId: '',
+				roleType: uni.getStorageSync('roleType')
+			}
+		},
+		onLoad(options) {
+			if (options.id) {
+				this.orderId = options.id;
+			}
+			this.getOrderStatus();
+			this.getServiceUnit();
+		},
+		onShow() {
+			this.getInfoById(this.orderId);
+		},
+		onUnload() {
+			// 当页面关闭或卸载时清除定时器
+
+		},
+		methods: {
+			getStatusTxt(value) {
+				let obj = this.typeList.find(item => item.code == value);;
+				return obj ? obj.value : '待确认'
+			},
+			getUnitTxt(value) {
+				let obj = this.unitList.find(item => item.code == value);;
+				return obj ? obj.value : ''
+			},
+			//查询订单状态
+			getOrderStatus() {
+				let that = this;
+				getOrderStatus().then(res => {
+						if (res.code == 200) {
+							let data = res.data.orderStatus;
+							data.unshift({
+								value: '全部',
+								code: '',
+							})
+							this.typeList = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+
+			},
+			//查询订单状态
+			getServiceUnit() {
+				let that = this;
+				getServiceUnit().then(res => {
+						if (res.code == 200) {
+							this.unitList = res.data.serviceUnit;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+
+			},
+
+			getInfoById(id) {
+				let that = this;
+				uni.showLoading({
+					title: '加载中',
+					mask: true,
+				});
+				if (this.roleType == 'guanli') {
+					getOrderDetailManage(id).then(res => {
+							if (res.code == 200) {
+								let data = res.data;
+								this.orderInfo = data;
+							}
+						})
+						.catch((err) => {
+							console.log(err);
+						})
+						.finally(() => {
+							uni.hideLoading();
+						});
+				} else if (this.roleType == 'hugong') {
+					getOrderDetailNurse(id).then(res => {
+							if (res.code == 200) {
+								let data = res.data;
+								this.orderInfo = data;
+							}
+						})
+						.catch((err) => {
+							console.log(err);
+						})
+						.finally(() => {
+							uni.hideLoading();
+						});
+				}
+
+			},
+
+			//分配护工/更换护工
+			allocation(orderNo, hospitalId, hospitalName) {
+				uni.navigateTo({
+					url: '/pages/workbench/caregiverManage?orderNo=' + orderNo + '&type=fenpei' + '&hospitalId=' +
+						hospitalId + '&hospitalName=' + hospitalName
+				})
+			},
+			changeCaregiver(orderNo, hospitalId, hospitalName) {
+				uni.navigateTo({
+					url: '/pages/workbench/caregiverManage?orderNo=' + orderNo + '&type=genghuan' +
+						'&hospitalId=' +
+						hospitalId + '&hospitalName=' + hospitalName
+				})
+			},
+
+			//开始服务
+			startService(id) {
+				//确认是否
+				uni.showModal({
+					title: '提示',
+					content: '确定开始服务吗?',
+					success: (res) => {
+						if (res.confirm) {
+							startService(id).then(res => {
+								if (res.code == 200) {
+									uni.showToast({
+										title: '开始成功',
+										icon: 'success'
+									})
+									this.getInfoById(this.orderId);
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+			},
+
+			//完成服务
+			finishService(id) {
+				//确认是否
+				uni.showModal({
+					title: '提示',
+					content: '确定完成服务吗?',
+					success: (res) => {
+						if (res.confirm) {
+							finishService(id).then(res => {
+								if (res.code == 200) {
+									uni.showToast({
+										title: '确认成功',
+										icon: 'success'
+									})
+									this.getInfoById(this.orderId);
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+			},
+
+			//取消订单
+			cancleOrder(id) {
+				//确认是否删除
+				uni.showModal({
+					title: '提示',
+					content: '确定取消订单吗?',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('用户点击确定');
+							cancelOrderManage(id).then(res => {
+								if (res.code == 200) {
+									uni.showToast({
+										title: '取消成功',
+										icon: 'success'
+									})
+									this.getInfoById(this.orderId);
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					},
+				})
+			},
+
+			confirmAndCall(phoneNumber) {
+				let that = this;
+				//获取电话
+				getNursePhone(that.orderInfo.orderWorkerChangeRecord.orderId).then(res => {
+					if (res.code == 200) {
+						phoneNumber = res.msg;
+						// 先验证电话号码
+						if (!that.isValidPhoneNumber(phoneNumber)) {
+							uni.showToast({
+								title: '电话号码格式不正确',
+								icon: 'none'
+							});
+							return;
+						}
+
+						// 显示确认对话框
+						uni.showModal({
+							title: '确认拨打电话',
+							content: `确定要拨打 ${phoneNumber} 吗?`,
+							success: (res) => {
+								if (res.confirm) {
+									// 用户点击确定,执行拨打电话
+									that.makePhoneCall(phoneNumber);
+								}
+							}
+						});
+					}
+				})
+
+			},
+
+			isValidPhoneNumber(phoneNumber) {
+				// 简单的电话号码验证
+				return /^1[3-9]\d{9}$/.test(phoneNumber);
+			},
+
+
+			makePhoneCall(phoneNumber) {
+				uni.makePhoneCall({
+					phoneNumber: phoneNumber,
+					success: () => {
+						console.log('拨打电话成功');
+					},
+					fail: (err) => {
+						console.error('拨打电话失败', err);
+						uni.showToast({
+							title: '拨打电话失败',
+							icon: 'none'
+						});
+					}
+				});
+			},
+			
+			//查看退款信息
+			viewRefund() {
+				let id = this.orderInfo.refundList[0].id;
+				uni.navigateTo({
+					url: '/pages/order/refundDetails?id=' + id
+				})
+			},
+			
+			//下拉刷新回调函数
+			onPullDownRefresh() {
+				this.getInfoById(this.orderId);
+				setTimeout(function() {
+					uni.stopPullDownRefresh();
+				}, 1000);
+			},
+
+		},
+	}
+</script>
+
+<style lang='scss' scoped>
+	.container {
+		padding: 20rpx 20rpx 200rpx;
+
+		.order-status {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			padding: 40rpx 20rpx !important;
+		
+			.status-text {
+				/* text-align: center; */
+				font-weight: bold;
+				font-size: 30rpx;
+				color: #333;
+			}
+		
+			.refund-btn {
+				font-size: 28rpx;
+				color: #4B91D1;
+			}
+		}
+
+		.order-info {
+			display: flex;
+			align-items: center;
+			padding: 20rpx;
+			background: #fff;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+
+			image {
+				width: 180rpx;
+				height: 180rpx;
+				border-radius: 10rpx;
+				margin-right: 20rpx;
+			}
+
+			.info-content {
+				display: flex;
+				flex-direction: column;
+				flex: 1;
+
+				.name {
+					word-break: break-all;
+					font-size: 32rpx;
+					color: #333;
+					font-weight: bold;
+				}
+
+				.address {
+					font-size: 28rpx;
+					color: #666;
+					margin-top: 20rpx;
+
+					width: 100%;
+					font-weight: 500;
+					line-height: 35rpx;
+					display: flex;
+					justify-content: flex-start;
+					align-items: flex-start;
+					overflow: hidden; //超出的文本隐藏
+					text-overflow: ellipsis; //溢出用省略号显示
+					white-space: normal; //处理元素中的 空白
+					display: -webkit-box;
+					-webkit-line-clamp: 2;
+					-webkit-box-orient: vertical;
+					display: -moz-box;
+					-moz-line-clamp: 2;
+					-moz-box-orient: vertical;
+					overflow-wrap: break-word;
+					word-break: break-all;
+
+					::v-deep .u-icon {
+						display: inline-block;
+					}
+
+					.txt {
+						margin-left: 15rpx;
+					}
+				}
+
+				.area {
+					font-size: 28rpx;
+					color: #666;
+					margin-top: 10rpx;
+				}
+			}
+		}
+
+		.info-box {
+			padding: 20rpx;
+			background: #fff;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+
+			.info-item {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding: 30rpx 0;
+
+				.title {
+					width: 250rpx;
+					font-size: 28rpx;
+					color: #333;
+				}
+
+				.txt {
+					/* flex: 1; */
+					max-width: 540rpx;
+					text-align: left;
+					font-size: 28rpx;
+					color: #757575;
+				}
+			}
+
+			.info-item-spa {
+				align-items: flex-start;
+				flex-direction: column;
+
+				.txt {
+					margin-left: 0;
+					margin-top: 20rpx;
+					text-align: left;
+				}
+			}
+
+			.tip-txt {
+				padding: 30rpx 0;
+				font-size: 28rpx;
+				color: #333;
+			}
+		}
+
+		.title-m {
+			/* 竖线和文字对齐 */
+			display: flex;
+			align-items: center;
+			padding: 20rpx 0;
+			font-size: 28rpx;
+			color: #333;
+			font-weight: bold;
+			line-height: 28rpx;
+
+			/* 左边加一个竖线 */
+			&::before {
+				content: '';
+				display: inline-block;
+				width: 6rpx;
+				height: 30rpx;
+				background: #4B91D1;
+				margin-right: 10rpx;
+			}
+		}
+	}
+
+	.footer-box {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		width: 100%;
+		padding: 50rpx 30rpx;
+		box-sizing: border-box;
+		font-size: 28rpx;
+		background-color: #fff;
+		box-shadow: 0 -2rpx 30rpx #c5c5c53a;
+
+		.btn-box {
+
+			display: flex;
+			align-items: center;
+			justify-content: flex-end;
+
+			.btn {
+				width: 170rpx;
+				height: 60rpx;
+				margin-left: 20rpx;
+				line-height: 60rpx;
+				text-align: center;
+				background-color: #fff;
+				border: 1rpx solid #4B91D1;
+				color: #4B91D1;
+				border-radius: 30rpx;
+				font-size: 24rpx;
+				margin-left: 30rpx;
+			}
+
+			.btn1 {
+				background-color: #00aa00;
+				border: 1rpx solid #00aa00;
+				color: #fff;
+			}
+
+			.btn2 {
+				background-color: #4B91D1;
+				border: 1rpx solid #4B91D1;
+				color: #fff;
+			}
+		}
+
+	}
+</style>

+ 452 - 0
pages/workbench/refundOrder.vue

@@ -0,0 +1,452 @@
+<template>
+	<view class="container">
+		<view class="order-list">
+			<view class="order-item" v-for="item,index in orderList" :key="index" @click="toDetails(item)">
+				<view class="order-t-box">
+					<view class="order-t-box-l">
+						<view class="order-name">
+							{{item.serviceName || '-'}}(数量:{{item.orderNum || '-'}})
+						</view>
+						<view class="order-no">
+							<span>退款订单号:{{item.orderRefundNo || '-'}}</span>
+							<image class="icon" :src="copyImg" mode="aspectFill"
+								@click.stop="$utils.copyTxt(item.orderRefundNo)"></image>
+						</view>
+					</view>
+					<view class="order-t-box-r">
+						<span class="title">退款金额</span>
+						<span class="price">¥{{item.refundAmount || '-'}}</span>
+					</view>
+				</view>
+				<u-line color="#f0f0f0"></u-line>
+				<view class="order-b-box">
+					<view class="order-b-box-l">
+						<view class="order-b-item">
+							<span class="title">医院:</span>
+							<span class="txt">{{item.orderVo.hospitalName || '-'}}</span>
+						</view>
+						<view class="order-b-item">
+							<span class="title">科室:</span>
+							<span class="txt">{{item.orderVo.hospitalDepartmentName || '-'}}</span>
+						</view>
+						<view class="order-b-item">
+							<span class="title">就诊人:</span>
+							<span
+								class="txt">{{item.orderVo.patientName || '-'}}({{item.orderVo.patientMobile || '-'}})</span>
+						</view>
+					</view>
+					<view class="order-b-box-r">
+						<span class="status">{{getRefundTxt(item.refundStatus)}}</span>
+					</view>
+				</view>
+				<u-line color="#f0f0f0"></u-line>
+				<view class="btn-box">
+					<span class="time">{{$utils.mFormatDate(item.createTime, 'yyyy-MM-dd HH:mm') || '-'}}</span>
+					<view class="btn-box-r">
+						<span class="btn btn1" v-if="item.refundStatus == 1"
+							@click.stop="opration(item.id,'refuse')">拒绝退款</span>
+						<span class="btn btn2" v-if="item.refundStatus == 1"
+							@click.stop="opration(item.id,'agree')">同意退款</span>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="empty-box" v-if="!orderList.length">
+			<u-image src="/static/none.png" mode="aspectFill" width="582rpx" height="582rpx"></u-image>
+			<span class="empty-txt">暂无数据!</span>
+		</view>
+		<view style="width: 100%;padding-bottom: 40rpx;" v-else>
+			<u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText"
+				:nomore-text="nomoreText" @loadmore="loadmore" dashed line marginTop="20" />
+		</view>
+
+		<!-- 操作 -->
+		<u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="popShow" @close="popClose"
+			@open="open" :round="20">
+			<view class="pop-box">
+				<view class="pop-title">{{popTile}}</view>
+				<view class="pop-content">
+					<u--form labelWidth="140rpx" labelPosition="top" :model="formData" :rules="rules" ref="uForm">
+						<u-form-item label="实退金额" prop="actualRefundAmount" borderBottom required
+							v-if="popType == 'agree'">
+							<u--input type="number" maxlength="9" v-model="formData.actualRefundAmount"
+								placeholder-class="input-placeholder" border="none" clearable
+								placeholder="请输入"></u--input>
+						</u-form-item>
+
+						<u-form-item label="操作原因" prop="operationReason" borderBottom required>
+
+							<u--textarea v-model="formData.operationReason" placeholder="请输入内容"></u--textarea>
+						</u-form-item>
+					</u--form>
+				</view>
+				<view class="footer-btn">
+					<span class="btn" @click="confirm">确认</span>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	import {
+		getAfterSaleOrderList,
+		getRefundStatus,
+		agreeOrRefuseAfterSaleOrder
+	} from "@/api/hospital.js"
+	export default {
+		data() {
+			return {
+				orderList: [],
+				loading: false,
+				pageSize: 10,
+				pageNum: 1,
+				botLoadingShow: 0, //0不显示  1显示 3.显示没有更多了
+				loadingShow: false,
+				status: 'loadmore',
+				loadingText: '努力加载中',
+				loadmoreText: '上拉或点击加载更多',
+				nomoreText: '实在没有了',
+				total: 0,
+				customBar: 0, //状态栏高度 + 导航栏高度
+				refundStatusList: [],
+
+				popShow: false,
+				popTile: '退款处置',
+				popType: '',
+				orderId: '',
+
+				formData: {
+					actualRefundAmount: '',
+					operationReason: '',
+				},
+				rules: {
+					actualRefundAmount: [{
+						required: true,
+						message: '请填写实退金额',
+						trigger: ['blur', 'change'],
+					}],
+					operationReason: [{
+						required: true,
+						message: '请填写操作原因',
+						trigger: ['blur', 'change'],
+					}],
+				}
+			}
+		},
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+		},
+		onShow() {
+			this.getOrderList("reload")
+		},
+		methods: {
+			//获取订单列表
+			getOrderList(reload) {
+				let that = this;
+				if (reload) {
+					that.pageNum = 1;
+					that.orderList = [];
+				}
+				uni.showLoading({
+					title: '加载中',
+					mask: true,
+				});
+				let param = {
+					status: that.orderStatus,
+					serviceName: that.serviceName,
+					pageNum: that.pageNum,
+					pageSize: that.pageSize,
+				};
+
+				getAfterSaleOrderList(param).then(res => {
+						let data = res.rows;
+						if (data) {
+							that.orderList.push(...data); //在列表后面新增新获取的数据
+							that.total = res.total; //获取数据总页数
+							if (that.orderList.length >= that.total) {
+								that.status = 'nomore';
+								return;
+							}
+						} else {
+							that.status = 'nomore';
+						}
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+					.finally(() => {
+						uni.hideLoading();
+					});
+			},
+
+			getRefundTxt(value) {
+				let obj = this.refundStatusList.find(item => item.code == value);;
+				return obj ? obj.value : '-'
+			},
+
+			//查询退款状态
+			getRefundStatus() {
+				let that = this;
+				getRefundStatus().then(res => {
+						if (res.code == 200) {
+							let data = res.data.refundStatus;
+							this.refundStatusList = data;
+						}
+
+					})
+					.catch((err) => {
+						console.log(err);
+					})
+			},
+
+			//去详情
+			toDetails(item) {
+				uni.navigateTo({
+					url: '/pages/order/refundDetails?id=' + item.id + '&role=guanli'
+				})
+			},
+
+			opration(id, type) {
+				this.orderId = id;
+				this.popShow = true;
+				this.popType = type;
+			},
+
+			open() {
+				this.popShow = true;
+			},
+
+			popClose() {
+				this.popShow = false;
+			},
+
+			confirm() {
+				let that = this;
+				uni.showLoading({
+					title: '操作中',
+					mask: true,
+				});
+				that.$refs.uForm.validate().then((res) => {
+					if (res) {
+						that.formData.id = that.orderId
+						that.formData.refundStatus = that.popType == 'agree' ? 2 : 3
+						agreeOrRefuseAfterSaleOrder(this.formData).then(res => {
+							uni.$u.toast('操作成功');
+							that.formData = {
+								actualRefundAmount: '',
+								operationReason: '',
+							}
+							that.popClose();
+							that.getOrderList('reload')
+						}, err => {
+							console.log(err);
+						}).finally(() => {
+							uni.hideLoading()
+						});
+					}
+				})
+			},
+
+
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.container {
+		background-color: #f6f6f6;
+
+		.order-list {
+			margin: 20rpx;
+
+			.order-item {
+				margin-bottom: 20rpx;
+				background-color: #fff;
+				border-radius: 20rpx;
+				padding: 10rpx 24rpx 30rpx;
+
+				.order-t-box {
+					display: flex;
+					justify-content: space-between;
+					align-items: flex-start;
+					padding: 20rpx 0;
+
+					.order-t-box-l {
+						.order-name {
+							font-size: 32rpx;
+							font-weight: bold;
+						}
+
+						.order-no {
+							display: flex;
+							align-items: center;
+							margin-top: 15rpx;
+							font-size: 24rpx;
+							color: #6F6F6F;
+
+							.icon {
+								width: 40rpx;
+								height: 40rpx;
+								margin-left: 10rpx;
+							}
+						}
+					}
+
+					.order-t-box-r {
+						display: flex;
+						align-items: center;
+						flex-direction: column;
+
+						.title {
+							font-size: 24rpx;
+							color: #6F6F6F;
+						}
+
+						.price {
+							margin-top: 15rpx;
+							font-size: 32rpx;
+							font-weight: bold;
+							color: #FF0000;
+						}
+					}
+				}
+
+				.order-b-box {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					padding: 20rpx 0;
+
+					.order-b-box-l {
+						flex: 1;
+
+						.order-b-item {
+							margin-bottom: 15rpx;
+
+							&:last-child {
+								margin-bottom: 0;
+							}
+
+							.title {
+
+								font-size: 26rpx;
+								color: #1A1A1A;
+							}
+
+							.txt {
+								font-size: 26rpx;
+								color: #808080;
+							}
+						}
+					}
+
+					.order-b-box-r {
+						width: 110rpx;
+						text-align: right;
+						font-size: 24rpx;
+						color: #0085FF;
+
+						.cancle {
+							color: #FF0000;
+						}
+					}
+				}
+
+				.btn-box {
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					margin-top: 15rpx;
+
+					.time {
+						font-size: 24rpx;
+						color: #6F6F6F;
+					}
+
+					.btn-box-r {
+
+						display: flex;
+						align-items: center;
+
+						.btn {
+							width: 160rpx;
+							height: 60rpx;
+							margin-left: 20rpx;
+							line-height: 60rpx;
+							text-align: center;
+							background-color: #4B91D1;
+							color: #fff;
+							border-radius: 30rpx;
+							font-size: 24rpx;
+						}
+
+						.btn1 {
+							background-color: #fff;
+							border: 1rpx solid #FF0000;
+							color: #FF0000;
+						}
+					}
+
+				}
+
+			}
+
+
+		}
+
+	}
+
+	.pop-box {
+		.pop-title {
+			font-size: 32rpx;
+
+			font-weight: bold;
+			text-align: center;
+			padding: 20rpx 0;
+
+		}
+
+		.pop-content {
+			margin-top: 30rpx;
+			font-size: 28rpx;
+			color: #6F6F6F;
+			padding: 0rpx 40rpx;
+			box-sizing: border-box;
+
+
+			.tip-txt {
+				display: flex;
+				flex-direction: column;
+				padding: 20rpx 0;
+				width: 100%;
+
+				.name {
+					margin-bottom: 20rpx;
+				}
+			}
+
+
+		}
+
+		.footer-btn {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			margin-top: 30rpx;
+			padding: 20rpx 40rpx;
+
+			.btn {
+				width: 100%;
+				padding: 20rpx 0;
+				border: 1rpx solid #4B91D1;
+				background-color: #4B91D1;
+				border-radius: 40rpx;
+				color: #fff;
+				text-align: center;
+			}
+		}
+
+
+	}
+</style>


BIN
static/下箭头.png