shuchang 2 月之前
父节点
当前提交
24fbee594b

+ 49 - 20
pages/subpack/pages/application/choose.vue

@@ -68,13 +68,13 @@
 		maxCount: 3, //最大选中的数量
 		dufaultIds: '', //默认选中的id
 		keyword: '', //名字查询
+		query: {}, //条件查询
 		pageType: '' //条件:返回带入
 	})
 
 	const nameText = computed(() => {
 		return (name) => {
-			
-			name = name.replaceAll('南充','').replaceAll('服务','').replaceAll('养老', '').replaceAll('有限公司', '');
+			name = name.replaceAll('南充', '').replaceAll('服务', '').replaceAll('养老', '').replaceAll('有限公司', '');
 			let index = name.length - 2;
 			index = index >= 0 ? index : 0;
 			return name.substring(index);
@@ -147,9 +147,9 @@
 			})
 		} */
 		console.log('data==>', data);
-		if(data.pageType === 'user') {
+		if (data.pageType === 'user') {
 			getUserList(pageNo, pageSize);
-		}else if(data.pageType === 'company'){
+		} else if (data.pageType === 'company') {
 			getFirmList(pageNo, pageSize);
 		}
 		/* setTimeout(() => {
@@ -157,31 +157,60 @@
 			uni.hideLoading();
 		}, 500) */
 	}
-	
-	function getUserList(pageNo, pageSize){
+
+	function getUserList(pageNo, pageSize) {
+		let reqParmas = {
+			pageNum: pageNo,
+			pageSize
+		}
+		if(typeof data.query === 'object' 
+		&& Object.keys(data.query).length>0){
+			reqParmas = uni.$u.deepMerge(reqParmas, data.query);
+		}
+		if(data.keyword) {
+			reqParmas.name = data.keyword;
+		}
+
 		getCompanyNursesList({
-			params: {
-				pageNum: pageNo,
-				pageSize
+			parmas: reqParmas,
+			custom: {
+				catch: true
 			}
-		}).then(res=>{
-			
-			console.log('getUserList=>', res);
+		}).then(res => {
+			let list = [];
+			res.map(item => {
+				list.push({
+					id: item.userId,
+					name: item.name,
+					des: `工作经验(${item.experienceYears}年)`,
+					checked: data.dufaultIds.indexOf(item.userId) != -1
+				})
+			})
+			paging.value.complete(list);
 		})
 	}
-	
+
 	function getFirmList(pageNo, pageSize) {
+		let reqParmas = {
+			pageNum: pageNo,
+			pageSize
+		}
+		if(typeof data.query === 'object' 
+		&& Object.keys(data.query).length>0){
+			reqParmas = uni.$u.deepMerge(reqParmas, data.query);
+		}
+		if(data.keyword) {
+			reqParmas.name = data.keyword;
+		}
+
 		getCompanyList({
-			parmas: {
-				pageNum: pageNo,
-				pageSize
-			},
+			parmas: reqParmas,
 			custom: {
 				catch: true
 			}
-		}).then(res=>{
+		}).then(res => {
 			let list = [];
-			res.map(item=>{
+			res.map(item => {
 				list.push({
 					id: item.companyId,
 					name: item.name,
@@ -190,7 +219,7 @@
 				})
 			})
 			paging.value.complete(list);
-			
+
 		})
 	}
 

+ 20 - 5
pages/subpack/pages/application/componenets/page1.vue

@@ -6,7 +6,9 @@
 				<view class="flex-row justify-between align-center" style="width: 100%;">
 					<view v-if="item.status === 'wait_assign_company'">
 						<view class="">护理公司</view>
-						<view>请选择护理公司</view>
+						<view class="flow-tips-content" :class="{'theme-color': chooseInfo.name}">
+							{{chooseInfo.name??'请选择护理公司'}}
+						</view>
 					</view>
 					<view v-if="item.status === 'wait_assign_nurse'">
 						<view class="flow-tips">护理人员</view>
@@ -98,6 +100,7 @@
 	//名字取值
 	const nameText = computed(() => {
 		return (name) => {
+			name = name.replaceAll('南充','').replaceAll('服务','').replaceAll('养老', '').replaceAll('有限公司', '');
 			let index = name.length - 2;
 			index = index >= 0 ? index : 0;
 			return name.substring(index);
@@ -112,7 +115,7 @@
 		if (chooseInfo.value.name) {
 			params.dufaultIds = chooseInfo.value.id + "";
 		}
-		console.log('item=>', props.item)
+		
 		if(props.item.status === 'wait_assign_company') {
 			params.pageType = 'company';
 		}else if(props.item.status === 'wait_assign_nurse') {
@@ -124,14 +127,26 @@
 	//是否显示退回按钮
 	function isShowBack(){
 		let user = store.state.vuex_user;
-		console.log('area=>', user.roles);
-		console.log('props.item.status=>',  props.item.status);
 		return user.roles.includes('area') && props.item.status == 'wait_check';
 	}
 	
 	//点击处理指派
 	function assignTap(){
-		postCareComplete({...props.item}).then(res=>{
+		if(!chooseInfo.value.id) {
+			uni.$u.toast('请选择指派的公司');
+			return false;
+		}
+		let checkParams = {...props.item};
+		
+		if(props.item.status === 'wait_assign_nurse') {
+			checkParams.status = 'assigned';
+			checkParams.nurseId = chooseInfo.value.id;
+		} else {
+			checkParams.status = 'wait_assign_nurse';
+			checkParams.companyId = chooseInfo.value.id;
+		}
+		checkParams.assignNurseRemark = formData.remark;
+		postCareAssign(checkParams).then(res=>{
 			uni.$u.toast('指派成功');
 			uni.$emit('renderApplyList');
 			setTimeout(()=>{

+ 4 - 1
pages/subpack/pages/application/componenets/page3.vue

@@ -121,7 +121,10 @@
 	}
 
 	onMounted(() => {
-		initFlowList();
+		if(props.item.status!=='assigned') {
+			initFlowList();
+		}
+		
 	})
 </script>
 

+ 233 - 0
pages/subpack/pages/application/componenets/page4.vue

@@ -0,0 +1,233 @@
+<template>
+	<view class="page1-warp">
+		<up-form labelPosition="top" :model="formData" ref="formRef">
+			<!-- 'wait_assign_company,wait_assign_nurse'.includes(item.status) -->
+			<up-form-item label="指派任务" labelWidth="auto" v-if="item.status && item.status.includes('wait_assign')" required>
+				<view class="flex-row justify-between align-center" style="width: 100%;">
+					<view v-if="item.status === 'wait_assign_company'">
+						<view class="">护理公司</view>
+						<view class="flow-tips-content" :class="{'theme-color': chooseInfo.name}">
+							{{chooseInfo.name??'请选择护理公司'}}
+						</view>
+					</view>
+					<view v-if="item.status === 'wait_assign_nurse'">
+						<view class="flow-tips">护理人员</view>
+						<view class="flow-tips-content" :class="{'theme-color': chooseInfo.name}">
+							{{chooseInfo.name??'请选择护理人员'}}
+						</view>
+					</view>
+					<view class="icon-box" @tap="goToChoosePage">
+						<up-icon v-if="!chooseInfo.name" size="28" class="up-icon" name="plus" />
+						<up-avatar v-else size="80rpx" :text="nameText(chooseInfo.name)" shape="square"
+							bgColor="#305BFF" />
+					</view>
+
+				</view>
+			</up-form-item>
+			<!-- <up-form-item label="护理打卡(0/6)" labelWidth="auto" required>
+				<view class="flex-row justify-between align-center" style="width: 100%;">
+					<u-upload :sizeType="['compressed']" :capture="['camera']" />
+				</view>
+			</up-form-item>
+			<up-form-item label="护理评分" labelWidth="auto" required>
+				<view class="flex-row justify-between align-center" style="width: 100%;">
+					<up-rate v-model="formData.score" activeIcon="heart-fill" inactiveIcon="heart" count="10"
+						:size="25" />
+					<view>{{formData.score*10}}</view>
+				</view>
+			</up-form-item> -->
+			<up-form-item label="审批意见" labelWidth="auto" required>
+				<up-textarea v-model="formData.remark" placeholder="请输入您的审批意见" count />
+			</up-form-item>
+		</up-form>
+		<view class="btn-box">
+			<view class="flex-row ">
+				<up-button class="up-button" v-if="isShowBack" type="error" 
+				style="width: 250rpx;" @tap="checkTap(2)">‌退回</up-button>
+				<view v-if="isShowBack" class="btn-place"></view>
+				<up-button v-if='item.status && item.status.includes("wait_assign")' 
+				class="up-button" type="primary" @tap="assignTap"
+				>指派</up-button>
+				<up-button v-else class="up-button" type="primary"
+				 @tap="checkTap(1)">通过</up-button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref,
+		reactive,
+		computed
+	} from 'vue';
+	import {
+		useStore
+	} from 'vuex';
+	import {
+		onLoad,
+		onUnload
+	} from "@dcloudio/uni-app"
+	import {
+		postCareAssign,
+		postCareCheck,
+		postCareComplete
+	} from '@/common/config/application-api.js'
+	
+	
+	const store = useStore();
+	const props = defineProps({
+		item: {
+			type: Object,
+			default () {
+				return {}
+			}
+		}
+	})
+	// 使用 ref 创建响应式引用  
+	const formRef = ref(null);
+	const formData = reactive({
+		remark: '', //审核意见
+		careCompany: '', //护理公司
+		careStaff: '', //护理人员
+		score: 1, //评分
+	})
+	const formRule = reactive({
+		remark: ''
+	})
+	const chooseInfo = ref({}); //选择的数据
+	
+	//名字取值
+	const nameText = computed(() => {
+		return (name) => {
+			name = name.replaceAll('南充','').replaceAll('服务','').replaceAll('养老', '').replaceAll('有限公司', '');
+			let index = name.length - 2;
+			index = index >= 0 ? index : 0;
+			return name.substring(index);
+		};
+	})
+
+	//跳转选择的页面
+	function goToChoosePage() {
+		let params = {
+			maxCount: 1
+		}
+		if (chooseInfo.value.name) {
+			params.dufaultIds = chooseInfo.value.id + "";
+		}
+		
+		if(props.item.status === 'wait_assign_company') {
+			params.pageType = 'company';
+		}else if(props.item.status === 'wait_assign_nurse') {
+			params.pageType = 'user';
+		}
+		uni.$u.route('/pages/subpack/pages/application/choose', params)
+	}
+	
+	//是否显示退回按钮
+	function isShowBack(){
+		let user = store.state.vuex_user;
+		return user.roles.includes('area') && props.item.status == 'wait_check';
+	}
+	
+	//点击处理指派
+	function assignTap(){
+		if(!chooseInfo.value.id) {
+			uni.$u.toast('请选择指派的公司');
+			return false;
+		}
+		let checkParams = {...props.item};
+		
+		if(props.item.status === 'wait_assign_nurse') {
+			checkParams.status = 'assigned';
+			checkParams.nurseId = chooseInfo.value.id;
+		} else {
+			checkParams.status = 'wait_assign_nurse';
+			checkParams.companyId = chooseInfo.value.id;
+		}
+		checkParams.assignNurseRemark = formData.remark;
+		postCareAssign(checkParams).then(res=>{
+			uni.$u.toast('指派成功');
+			uni.$emit('renderApplyList');
+			setTimeout(()=>{
+				uni.$u.route({
+					type: 'back'
+				})
+			}, 1000)
+		})
+	}
+	//点击处理审核 1 审核  2 退回
+	function checkTap(type = 2){
+		if(!formData.remark){
+			uni.$u.toast('审核理由不能为空');
+			return false;
+		}
+		let checkParams = {...props.item};
+		checkParams.status = 'wait_assign_company';
+		if(type == 2) {
+			checkParams.status = 'disagree';
+		}
+		checkParams.auditReason = formData.remark;
+		postCareCheck(checkParams).then(res=>{
+			uni.$u.toast('审核成功');
+			uni.$emit('renderApplyList');
+			setTimeout(()=>{
+				uni.$u.route({
+					type: 'back'
+				})
+			}, 1000)
+		})
+	}
+
+	onLoad(() => {
+		uni.$on('choose', ({
+			checkList
+		}) => {
+			if (checkList && checkList.length > 0) chooseInfo.value = checkList[0];
+		})
+	})
+	onUnload(() => {
+		uni.$off('choose')
+	})
+</script>
+
+<style lang="scss" scoped>
+	.page1-warp {
+		padding: 24rpx 0;
+	}
+
+	.flow-tips {
+		font-size: 30rpx;
+		color: #222222;
+	}
+
+	.flow-tips-content {
+		font-size: 24rpx;
+		margin-top: 4rpx;
+		color: rgba(34, 34, 34, .3);
+	}
+
+	.btn-box {
+		padding: 20rpx 36rpx;
+		background-color: #fff;
+		position: fixed;
+		bottom: calc(50px + var(--status-bar-height));
+		/* bottom: 50px; */
+		width: 690rpx;
+
+		.btn-place {
+			width: 100rpx;
+		}
+	}
+
+	.theme-color {
+		color: #305BFF !important;
+	}
+
+	.icon-box {
+		overflow: hidden;
+		width: 80rpx;
+		height: 80rpx;
+
+	}
+</style>

+ 7 - 1
pages/subpack/pages/application/info.vue

@@ -10,10 +10,12 @@
 			<Page1 class="page1" :item="appItem" v-show="judgePageIsShow('page2')" />
 			<Page2 class="page2" :item="appItem" v-show="judgePageIsShow('page1')" />
 			<Page3 class="page3" :item="appItem" v-show="judgePageIsShow('page3')" />
+			<Page4 class="page4" :item="appItem" v-show="judgePageIsShow('page4')" />
 		</view>
 		<u-tabbar :value="tabbarKey" v-if="judgeTabbarIsShow('tabbar')" @change="tabbarChange" fixed placeholder safeAre
 			aInsetBottom>
 			<u-tabbar-item name="page1" text="基本信息" icon="file-text-fill" />
+			<u-tabbar-item name="page4" text="护理打卡" icon="chrome-circle-fill" v-if="judgeTabbarIsShow('page4')"/>
 			<u-tabbar-item name="page2" text="特困审批" v-if="judgeTabbarIsShow('page2')" icon="chrome-circle-fill" />
 			<u-tabbar-item name="page3" text="申请进度" v-if="judgeTabbarIsShow('page3')" icon="hourglass-half-fill" />
 		</u-tabbar>
@@ -56,7 +58,7 @@
 	const roleAuthStatus = {
 		village: ['no_check'],
 		area: ['wait_assign_company', 'wait_check'],
-		nurse: ['no_check'],
+		nurse: ['assigned'],
 		company: ['wait_assign_nurse'],
 	}
 
@@ -77,6 +79,8 @@
 			//流程记录页面只有除了护理人员之外的人看到	
 		} else if (pageName === 'page3') {
 			if (roles.includes('nurse')) judgeBool = false;
+		} else if (pageName === 'page4') {
+			if (!roles.includes('nurse')) judgeBool = false;
 		}
 		return judgeBool && tabbarKey.value == pageName;
 	}
@@ -97,6 +101,8 @@
 			else if (!roleAuthArray.includes(status)) return false;
 		} else if (pageName === 'page3') {
 			if (roles.includes('nurse')) return false;
+		} else if (pageName === 'page4') {
+			if (!roles.includes('nurse')) return false;
 		}
 		return true;
 	}

+ 1 - 1
pages/subpack/pages/application/list.vue

@@ -150,7 +150,7 @@
 		nurse: [{
 			name: '护理任务',
 			query: {
-				status: 'no_check'
+				status: 'assigned',
 			}
 		}, {
 			name: '已完成',

+ 4 - 3
pages/tabbar/mine/mine.vue

@@ -75,7 +75,8 @@
 		useStore
 	} from 'vuex';
 	import {
-		onLoad
+		onLoad,
+		onShow
 	} from '@dcloudio/uni-app'
 
 	const {
@@ -113,8 +114,8 @@
 		})
 		return roleText.join(',');
 	}
-	onMounted(() => {
-		console.log('store=>', store.state);
+	onShow(() => {
+		// console.log('store=>', store.state);
 		user.value = store.state.vuex_user;
 	})
 </script>

+ 1 - 0
utils/request/index.js

@@ -12,6 +12,7 @@ const initRequest = (vm) => {
 	http.setConfig((defaultConfig) => {
 		// defaultConfig.baseURL = 'http://133.46.152.185' /* 根域名 */
 		defaultConfig.baseURL = 'http://tkhtest.natapp1.cc' /* 根域名 */
+		// defaultConfig.baseURL = 'http://tkhtest.natapp1.cc' /* 根域名 */
 		// defaultConfig.baseURL = 'http://127.0.0.1' /* 根域名 */
 		defaultConfig = {
 			...defaultConfig,

+ 0 - 1
utils/request/interceptors.js

@@ -30,7 +30,6 @@ const responseInterceptors = (vm) => {
 	 * @param {Object} http 
 	 */
 	http.interceptors.response.use((response) => {
-		// console.log('response: ', response);
 		if (response?.config?.custom?.isCloseLoad) {
 			uni.hideLoading();
 		}