shuchang 1 mês atrás
pai
commit
88ae962b6d

+ 14 - 7
common/config/application-api.js

@@ -7,11 +7,11 @@ export const getProtocolList = (data) => http.get('/dev-api/care/protocol/list',
 //获取用户协议详情
 export const getProtocolInfo = (data) => http.get(`/dev-api/care/protocol/${data.id??0}`, data);
 //查询护理人员列表
-export const getNursesList = (data) => http.get(`/dev-api/care/nurses/list`,data);
+export const getNursesList = (data) => http.get(`/dev-api/care/nurses/list`, data);
 //查询护理人员详情
-export const getNursesInfo = (data) => http.get(`/dev-api/care/nurses/${data.id??0}`,data);
+export const getNursesInfo = (data) => http.get(`/dev-api/care/nurses/${data.id??0}`, data);
 //编辑护理人员
-export const editNurses = (data) => http.get(`/dev-api/care/nurses/${data.id??0}`,data);
+export const editNurses = (data) => http.get(`/dev-api/care/nurses/${data.id??0}`, data);
 
 //护理申请列表
 export const getCareList = (data) => http.get(`/dev-api/care/applications/list`, data);
@@ -25,20 +25,22 @@ export const postCareStart = (params, config = {}) => http.post('/dev-api/care/a
 //流程记录列表
 export const getCareRecords = (data) => http.get('/dev-api/care/careRecords/list', data);
 //删除审批单
-export const delCareApp = (params, config = {}) => http.delete(`/dev-api/care/applications/${params.id??0}`, params, config);
+export const delCareApp = (params, config = {}) => http.delete(`/dev-api/care/applications/${params.id??0}`, params,
+	config);
 //护理指派
 export const postCareAssign = (parmas, config = {}) => http.post('/dev-api/care/applications/assign', parmas, config)
 //护理审核
 export const postCareCheck = (parmas, config = {}) => http.post('/dev-api/care/applications/check', parmas, config)
 //完成护理申请
-export const postCareComplete = (parmas, config = {}) => http.post('/dev-api/care/applications/complete', parmas, config)
+export const postCareComplete = (parmas, config = {}) => http.post('/dev-api/care/applications/complete', parmas,
+	config)
 //查询全部公司 
-export const getCompanyList = (data) =>http.get('/dev-api/care/companies/listAll', data)
+export const getCompanyList = (data) => http.get('/dev-api/care/companies/listAll', data)
 //查询公司的护理人员
 export const getCompanyNursesList = (data) => http.get('/dev-api/care/nurses/listCompanyNurses', data)
 
 //图片上传
-export const uploadImg = (params, config = {}) => http.upload(`/dev-api/care/clocks/upload`,params, config);
+export const uploadImg = (params, config = {}) => http.upload(`/dev-api/care/clocks/upload`, params, config);
 
 export const uploadImgUrl = `/dev-api/care/clocks/upload`;
 
@@ -52,6 +54,8 @@ export const getImgNumber = (data) => http.get(`/dev-api/system/workConfig/type/
 
 //添加护理打卡记录
 export const addCareClocks = (params, config = {}) => http.post(`/dev-api/care/clocks`, params, config);
+//添加死亡记录
+export const addDieRecord = (params, config = {}) => http.post(`/dev-api/care/clocks/die`, params, config);
 //修改护理打卡记录
 export const updateCareClocks = (params, config = {}) => http.put(`/dev-api/care/clocks`, params, config);
 //删除护理打卡记录
@@ -70,3 +74,6 @@ export const getClockList = (data) => http.get(`/dev-api/care/clocks/list`, data
 
 //完成护理任务
 export const completeTask = (params, config = {}) => http.post(`/dev-api/care/applications/complete`, params, config);
+
+//评分
+export const rateRequest = (params, config = {}) => http.post(`/dev-api/care/scores`, params, config);

+ 1 - 1
pages.json

@@ -147,7 +147,7 @@
 			"iconPath": "static/tabbar/index.png",
 			"selectedIconPath": "static/tabbar/index-selected.png",
 			"pagePath": "pages/tabbar/application/application",
-			"text": "申请"
+			"text": "首页"
 		}, {
 			"iconPath": "static/tabbar/message.png",
 			"selectedIconPath": "static/tabbar/message-selected.png",

+ 11 - 0
pages/subpack/components/apply/apply-item.vue

@@ -22,6 +22,8 @@
 					<text>申请日期:</text>
 					<text>{{item.applyDate??'-'}}</text>
 				</view>
+				<text v-if="item.dealStatus === 'complete'" class="font-sm text-disable"
+					style="margin-left: auto;">支付状态:{{getPayStatus(item.payStatus)}}</text>
 			</view>
 		</view>
 	</view>
@@ -50,6 +52,15 @@
 		},
 	})
 
+	// 获取支付状态
+	const getPayStatus = (status) => {
+		if (status === 'dis_pay') {
+			return '未支付'
+		} else {
+			return '已支付'
+		}
+	}
+
 	const tapItemHandle = () => {
 		emit('tapItem', props.item)
 	}

+ 107 - 8
pages/subpack/pages/application/componenets/page2.vue

@@ -7,6 +7,29 @@
 				<text class="info-item-content text-overflow">{{item.value??'-'}}</text>
 			</view>
 		</view>
+		<view v-if="item.dieTime" class="info-dot">死亡信息</view>
+		<view v-if="item.dieTime" class="info-list">
+			<view class="info-item">
+				<text class="info-item-label">死亡日期</text>
+				<text class="info-item-content text-overflow">{{item.dieTime && item.dieTime.substring(0,10)}}</text>
+			</view>
+			<view class="info-item" @click="previewDie(item.dieImg)">
+				<text class="info-item-label">死亡证明</text>
+				<text class="info-item-content text-overflow">点击查看</text>
+			</view>
+		</view>
+
+		<view v-if="item.dealStatus === 'complete'" class="info-dot">评价信息</view>
+		<view v-if="item.dealStatus === 'complete'" class="info-list">
+			<view class="info-item">
+				<text class="info-item-label">评价得分</text>
+				<view v-if="showRate" class="flex-row align-center">
+					<u-rate :count="5" :minCount='0' v-model="rateCount" :readonly="!showRateBtn"></u-rate>
+					<text v-if="showRateBtn" class="font text-main-color ml-12" @click="submitRate">确定</text>
+				</view>
+			</view>
+		</view>
+
 		<view class="info-dot">护理需求</view>
 		<view class="info-list">
 			<view class="info-item flex-column" style="align-items: flex-start;">
@@ -45,12 +68,23 @@
 	import {
 		computed,
 		reactive,
-		ref
+		ref,
+		onMounted,
+		getCurrentInstance,
+		watch
 	} from 'vue';
 	import {
 		getDict
 	} from '@/common/status/index.js'
-	import {delCareApp, postCareStart} from '@/common/config/application-api.js'
+	import {
+		delCareApp,
+		postCareStart,
+		rateRequest
+	} from '@/common/config/application-api.js'
+
+	const {
+		proxy
+	} = getCurrentInstance();
 
 	const props = defineProps({
 		item: {
@@ -60,6 +94,9 @@
 			}
 		}
 	})
+
+	const rateCount = ref(0)
+
 	const objKeyValue = reactive([{
 			name: '姓名',
 			key: 'personName'
@@ -85,6 +122,26 @@
 			key: 'applyDate'
 		},
 	])
+
+	// onMounted(() => {
+	// 	console.log('onMounted', props.item.scoreAssess);
+	// 	if (props.item.scoreAssess) {
+
+	// 	} else {
+	// 		rateCount.value = 0;
+	// 	}
+	// })
+
+	watch(() => props.item, (newVal) => {
+		console.log('newVal', newVal);
+		if (newVal.scoreAssess) {
+			console.log(newVal.scoreAssess);
+			rateCount.value = parseInt(newVal.scoreAssess);
+		} else {
+			rateCount.value = 0;
+		}
+	})
+
 	//中间层 - item和objKeyValue
 	const itemHandle = computed(() => {
 		let itemArray = uni.$u.deepClone(objKeyValue);
@@ -103,6 +160,43 @@
 		return itemArray;
 	})
 
+	const showRateBtn = computed(() => {
+		if (rateCount.value > 0 && !props.item.scoreAssess) {
+			return true
+		} else {
+			return false
+		}
+	})
+
+	const showRate = computed(() => {
+		return proxy.vuex_user.roles.includes('village')
+	})
+
+
+	// 提交评分
+	const submitRate = () => {
+		console.log(rateCount.value);
+		rateRequest({
+				applyId: props.item.applyId,
+				userId: proxy.vuex_user.id,
+				assess: rateCount.value,
+				reason: ''
+			})
+			.then(res => {
+				console.log('评分', res);
+			})
+			.catch(err => {
+				console.log('评分err', err);
+			})
+	}
+
+	const previewDie = (img) => {
+		uni.previewImage({
+			urls: [img],
+			current: 0
+		})
+	}
+
 	//编辑按钮
 	function editTap() {
 		uni.$u.route('/pages/subpack/pages/apply/apply', {
@@ -116,15 +210,17 @@
 			content: '您确定删除吗?',
 			success(res) {
 				if (res.confirm) {
-					delCareApp({id: props.item.applyId}).then(res=>{
+					delCareApp({
+						id: props.item.applyId
+					}).then(res => {
 						uni.$u.toast('删除成功');
 						uni.$emit('renderApplyList');
-						setTimeout(()=>{
+						setTimeout(() => {
 							uni.$u.route({
 								type: 'back'
 							})
 						}, 1000)
-						
+
 					})
 				}
 			}
@@ -137,10 +233,12 @@
 			content: '您确定提交审核吗?',
 			success(res) {
 				if (res.confirm) {
-					postCareStart({...props.item}).then(res=>{
+					postCareStart({
+						...props.item
+					}).then(res => {
 						uni.$u.toast('送审成功');
 						uni.$emit('renderApplyList');
-						setTimeout(()=>{
+						setTimeout(() => {
 							uni.$u.route({
 								type: 'back'
 							})
@@ -230,7 +328,8 @@
 		width: 690rpx;
 		z-index: 999999;
 	}
-	.btn-box-disagree{
+
+	.btn-box-disagree {
 		bottom: calc(50px + var(--status-bar-height));
 	}
 </style>

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

@@ -137,7 +137,10 @@
 
 	// 死亡
 	function dieHandle() {
-
+		uni.$u.route('/pages/subpack/pages/nurse/clockIn', {
+			type: 1,
+			id: props.item.applyId
+		})
 	}
 
 	//结束

+ 4 - 4
pages/subpack/pages/application/info.vue

@@ -12,8 +12,8 @@
 			<Page3 class="page3" :item="appItem" v-if="judgePageIsShow('page3')" />
 			<Page4 class="page4" :item="appItem" v-if="judgePageIsShow('page4')" />
 		</view>
-		<u-tabbar :value="tabbarKey" v-if="judgeTabbarIsShow('tabbar')" @change="tabbarChange" fixed placeholder safeAre
-			aInsetBottom>
+		<u-tabbar :value="tabbarKey" v-if="judgeTabbarIsShow('tabbar')" @change="tabbarChange" :zIndex="9" 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" />
@@ -55,8 +55,8 @@
 	const handleTitle = computed(() => {
 		if (tabbarKey.value === 'page2') return '特困审批';
 		else if (tabbarKey.value === 'page1') return '基本信息';
-		else if(tabbarKey.value === 'page3') return '申请进度';
-		else if(tabbarKey.value === 'page4') return '护理打卡';
+		else if (tabbarKey.value === 'page3') return '申请进度';
+		else if (tabbarKey.value === 'page4') return '护理打卡';
 		return '特困表单';
 	})
 	const roleAuthStatus = {

+ 46 - 23
pages/subpack/pages/nurse/clockIn.vue

@@ -9,27 +9,29 @@
 					<up-input v-model="formData.nursingTime" disabled disabledColor="#ffffff" border="none"
 						placeholder="请选择打卡时间" />
 				</up-form-item>
-				<up-form-item v-else label="死亡时间" labelWidth="auto" labelPosition="left" required prop="nursingTime">
-					<up-input v-model="formData.nursingTime" disabled disabledColor="#ffffff" border="none"
+				<up-form-item v-else label="死亡时间" labelWidth="auto" labelPosition="left" required prop="dieTime"
+					@click="showTime = true">
+					<up-input v-model="formData.dieTime" disabled disabledColor="#ffffff" border="none"
 						placeholder="请选择死亡时间" />
 				</up-form-item>
-				<up-form-item :label="`护理打卡(最少上传${imgNum}张图片)`" labelWidth="auto" prop="img" required>
+				<up-form-item :label="submitType==='0'?`护理打卡(最少上传${imgNum}张图片)`:'死亡证明'" labelWidth="auto" prop="img"
+					required>
 					<view class="flex-row justify-between align-center" style="width: 100%;">
 						<up-upload :fileList="fileList" multiple :sizeType="['compressed']" :capture="['camera']"
-							:maxCount="imgNum" @afterRead="afterRead" @delete="deletePic" />
+							:maxCount="submitType==='0'?imgNum:1" @afterRead="afterRead" @delete="deletePic" />
 					</view>
 				</up-form-item>
-				<up-form-item label="备注" labelWidth="auto">
+				<up-form-item v-if="submitType==='0'" label="备注" labelWidth="auto">
 					<up-textarea v-model="formData.remark" placeholder="请输入您的打卡备注" count />
 				</up-form-item>
 			</up-form>
 		</view>
 
-		<u-datetime-picker ref="datetimePicker" :show="showTime" v-model="timeValue" mode="datetime" closeOnClickOverlay
+		<u-datetime-picker ref="datetimePicker" :show="showTime" v-model="timeValue" mode="date" closeOnClickOverlay
 			@cancel="showTime = false" @close="showTime = false" @confirm="timeConfirm" :formatter="formatter" />
 		<view class="btn-box">
 			<view class="flex-row ">
-				<up-button class="up-button" type="primary" @tap="checkTap">确定打卡</up-button>
+				<up-button class="up-button" type="primary" @tap="checkTap">{{submitType==='0'?'确定打卡':'确定'}}</up-button>
 			</view>
 		</view>
 	</view>
@@ -53,6 +55,7 @@
 	import {
 		getImgNumber,
 		addCareClocks,
+		addDieRecord,
 		uploadImgUrl,
 		uploadImg
 	} from '@/common/config/application-api.js'
@@ -88,6 +91,11 @@
 			message: '请选择护理时间',
 			trigger: ['blur', 'change']
 		}],
+		dieTime: [{
+			required: true,
+			message: '请选择死亡时间',
+			trigger: ['blur', 'change']
+		}],
 		img: [{
 			validator: (rule, value, callback) => {
 				return value.length >= imgNum.value;
@@ -114,18 +122,39 @@
 		fileList.value.map(file => {
 			formData.img.push(file.url);
 		});
-		// console.log('2=>', formData);
 		formRef.value.validate().then(res => {
 			if (res) {
 				formData.imgPaths = formData.img.join(',');
 				formData.imgNum = formData.img.length;
 				delete formData.img;
-				addClocks();
-				// uni.$u.toast('校验通过')
+				if (submitType.value === '0') {
+					addClocks();
+				} else {
+					submitDie();
+				}
 			}
 		})
 	}
 
+	const submitDie = () => {
+		let params = {};
+		console.log('formData', formData);
+		addDieRecord({
+				applyId: applyId.value,
+				dieTime: formData.dieTime + ' 00:00:00',
+				imgPaths: formData.imgPaths
+			})
+			.then(res => {
+				console.log('死亡记录res', res);
+				uni.navigateBack({
+					delta: 2
+				});
+			})
+			.catch(err => {
+				console.log('死亡记录err', err);
+			})
+	}
+
 	//点击打卡 --新增打卡记录
 	function addClocks() {
 		let reqClockParams = {
@@ -171,9 +200,9 @@
 	}
 
 	function timeConfirm(e) {
-		// console.log('timeConfirm=>', e);
+		console.log('timeConfirm=>', e);
 		timeValue.value = e.value;
-		formData.nursingTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss');
+		formData.dieTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd');
 		showTime.value = false;
 	}
 
@@ -234,7 +263,7 @@
 						catch: true
 					}
 				})
-				console.log('result: ', result);
+				// console.log('result: ', result);
 				let item = fileList.value[fileListLen]
 				fileList.value.splice(fileListLen, 1, Object.assign(item, {
 					status: 'success',
@@ -242,7 +271,7 @@
 					url: uni.$u.http.config.baseURL + result.imgUrl,
 					// fileName: result.fileName
 				}))
-				console.log(fileList);
+				// console.log(fileList);
 				fileListLen++
 			} catch (e) {
 				// uni.$u.toast(JSON.stringify(e))
@@ -259,19 +288,13 @@
 		}
 	}
 
-	/**
-	 * TODO 上传图片有问题,上传的时间是选择 还是当前时间
-	 * 如果今天上传的护理记录  是否还可以继续上传 一天上传几次护理打卡记录
-	 * 思路 2/23  page4 里面显示打卡记录  然后打卡记录里面可能是死亡/打卡/结束几个按钮
-	 * 从page4 里面进入打卡页面和死亡表单页面
-	 *
-	 *
-	 */
-
 	//获取打卡图片数量
 	const imgNum = ref(0);
 
 	function getNumber() {
+		if (submitType.value === '1') {
+			return imgNum.value = 1
+		}
 		getImgNumber({
 			params: {
 				key: 'need_img_num'

+ 0 - 1
utils/request/index.js

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