Переглянути джерело

添加工会关心关爱功能

xianwait 2 роки тому
батько
коміт
449a67ed07

+ 24 - 0
.hbuilderx/launch.json

@@ -0,0 +1,24 @@
+{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version": "0.0",
+    "configurations": [{
+     	"app-plus" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"default" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"h5" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"mp-weixin" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"type" : "uniCloud"
+     }
+    ]
+}

+ 45 - 0
pageA/club/careAndLove.vue

@@ -0,0 +1,45 @@
+<template>
+	<view>
+		<view style="margin: auto;">
+			<view class="page-item" v-for="(item,i) in pageList" @click="toSicknessBenefit(i)">
+				{{item.text}}
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				pageList: [{
+					text: '常规住院'
+				}, {
+					text: '大病住院'
+				}, {
+					text: '人身伤害'
+				}]
+			}
+		},
+		methods: {
+			toSicknessBenefit(index) {
+				this.$goto('sicknessBenefit?type=' + index)
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.page-item {
+		padding: 5rpx 80rpx;
+		background-color: rgb(55,186,189);
+		border-radius: 20rpx;
+		margin: 50rpx 0;
+		font-size: 1.875rem;
+		color: rgb(255, 255, 255);
+	}
+
+	.page-item:active {
+		background-color: rgb(42, 143, 145);
+	}
+</style>

+ 109 - 0
pageA/club/sicknessBenefit.vue

@@ -0,0 +1,109 @@
+<template>
+	<view>
+		<hsInput label="姓名" v-model="form.userName" :disabled="true" />
+		<hsInput label="工会会员卡卡号" labelSize="8" inputSpan="16" v-model="form.clubNo" />
+		<view v-if="type === '0'">
+			<hsInput label="出院小结" v-model="form.cyxj" />
+			<hsInput label="疾病名称" v-model="form.jbmc" />
+			<hsInput label="住院日期" v-model="form.date1" model="date" />
+			<hsInput label="出院日期" v-model="form.date2" model="date" />
+			<hsPhoto label="添加出院小结照片" limit="5" v-model="form.fjtp"></hsPhoto>
+		</view>
+		<view v-if="type === '1'">
+			<hsInput label="出院小结" v-model="form.cyxj" />
+			<hsInput label="疾病名称" v-model="form.jbmc" />
+			<hsInput label="住院日期" v-model="form.date1" model="date" />
+			<hsInput label="出院日期" v-model="form.date2" model="date" />
+			<hsPhoto label="清添加”疾病病理报告” 和“出院小结” 照片" limit="5" v-model="form.fjtp"></hsPhoto>
+		</view>
+		<view v-if="type === '2'">
+			<view class="desc">
+				<hsDictSelect label="申请事项" dictKey="condole_renshenshanghai_type" v-model="form.remark" />
+			</view>
+
+			<hsInput label="案情简介" v-model="form.cyxj" model="textarea" />
+			<hsInput label="伤害时间" v-model="form.shanghaiDate" model="date" />
+			<hsInput label="具体工作场所" labelSize="8" inputSpan="12" v-model="form.jtgzcs" model="textarea" />
+			<hsInput label="双方关系" v-model="form.sfgx" model="textarea" />
+			<hsPhoto label="附件" limit="5" v-model="form.fjtp"></hsPhoto>
+		</view>
+		<view style="padding: 200px 0;"></view>
+		<view class="bottim_view">
+			<view>
+				<u-row>
+					<u-col span="11">
+						<u-button :disabled="isDisabled" class="btnDoPay" shape="circle" @click="submit"
+							color="rgb(55,186,189)" text="提交">
+						</u-button>
+					</u-col>
+				</u-row>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import hsDictSelect from "../components/dictSelect.vue"
+	import hsInput from "../components/input.vue"
+	import hsPhoto from "../components/photo.vue"
+	export default {
+		components: {
+			hsDictSelect,
+			hsInput,
+			hsPhoto
+		},
+		data() {
+			return {
+				type: null,
+				isDisabled: false,
+				form: {
+					nickName: '',
+					clubNo: '',
+					fjtp: ''
+				}
+			}
+		},
+		mounted() {
+			this.type = this.$root.$mp.query.type
+			this.form.userName = uni.getStorageSync("userInfo").nickName
+		},
+		methods: {
+			submit() {
+				uni.showModal({
+					content: " 请确保填写会员卡【" + this.form.clubNo +
+						"】内容准确无误,以免申请异常,确认无误后点击【确认】"
+				})
+				this.$httpRequest({
+					url: '/app/condoleRecord',
+					method: 'post',
+					data: this.form,
+					urlType: this.$getUrlType()
+				}).then(res => {
+					if (res.code === 200) {
+						this.$showModal("成功")
+					} else {
+						this.$showModal(res.msg)
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.desc {
+		padding: 10rpx 15rpx 0 15rpx;
+		color: #818181;
+		font-size: 20rpx;
+	}
+
+	.bottim_view {
+		padding: 5px 20px 30px;
+		position: fixed;
+		left: 0px;
+		bottom: 0px;
+		width: 100%;
+		height: 40px;
+		background-color: #ffffff;
+	}
+</style>

+ 89 - 10
pageA/components/input.vue

@@ -7,16 +7,47 @@
 				</view>
 			</uni-col>
 			<uni-col :span="inputSpan">
-				<view>
-					<uni-easyinput v-if="!textarea" primaryColor="#37babd" v-model="value" @input="input"
-						:disabled="disabled">
-					</uni-easyinput>
-					<uni-easyinput v-if="textarea" type="textarea" primaryColor="#37babd" v-model="value" @input="input"
+				<view style="padding: 0 10rpx 0 0;">
+					<uni-easyinput v-if="model === 'input'" primaryColor="#37babd" v-model="val" @input="input"
 						:disabled="disabled">
 					</uni-easyinput>
+					<uni-datetime-picker v-if="model === 'date'" type="date" :clear-icon="false" v-model="val"
+						:disabled="disabled" />
+					<view v-if="model === 'search'" class="pickerView pickerText">
+						<view @click="openSearch" class="pickerText" v-if="val">
+							{{val}}
+						</view>
+						<view @click="openSearch" class="pickerText" v-else>
+							待 选 择
+						</view>
+					</view>
+					<u-number-box v-if="model === 'number'" v-model="val" @change="changeNumber"></u-number-box>
+				</view>
+			</uni-col>
+			<uni-col :span="2" v-if="unit">
+				<view style="padding: 10rpx 5rpx 0 2rpx;color: #818181;font-size: 20rpx;">
+					{{unit}}
 				</view>
 			</uni-col>
 		</uni-row>
+		<view class="desc">
+			<uni-easyinput v-if="model === 'textarea'" type="textarea" primaryColor="#37babd" v-model="val"
+				@input="input" :disabled="disabled">
+			</uni-easyinput>
+		</view>
+		<uni-popup ref="searchPopup" background-color="#fff">
+			<view style="height: 800rpx;">
+				<view style="padding: 30rpx;">
+					<u-search v-model="searchText" :show-action="false" placeholder="快捷搜索" @change="getSearchApiData()">
+					</u-search>
+				</view>
+				<view style="padding: 5rpx;">
+					<uni-list v-for="item in searchData">
+						<uni-list-item :clickable="true" @click="dataToValue(item)" :title="item[searchLabelKey]" />
+					</uni-list>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
@@ -32,6 +63,14 @@
 				Type: String,
 				default: ''
 			},
+			unit: {
+				Type: String,
+				default: ''
+			},
+			model: {
+				Type: String,
+				default: 'input'
+			},
 			labelSize: {
 				Type: Number,
 				default: 5
@@ -40,12 +79,28 @@
 				Type: Number,
 				default: 19
 			},
-			disabled: false,
-			textarea: false
+			searchLabelKey: {
+				Type: String,
+				default: 'name'
+			},
+			searchApi: {
+				Type: String,
+				default: null
+			},
+			disabled: false
 		},
 		data() {
 			return {
-
+				val: '',
+				searchText: ''
+			}
+		},
+		watch: {
+			value(newVal) {
+				this.val = newVal
+			},
+			modelValue(newVal) {
+				this.val = newVal
 			}
 		},
 		mounted() {
@@ -53,7 +108,31 @@
 		},
 		methods: {
 			input: function(e) {
-				this.$emit('input', this.value)
+				this.$emit('input', this.val)
+			},
+			openSearch() {
+				console.log('click ---> Test')
+				this.$refs.searchPopup.open('bottom')
+			},
+			changeNumber(e) {
+				this.$emit('change', this.val)
+			},
+			//获取/查询 信息
+			async getSearchApiData() {
+				const {
+					data: res
+				} = await this.$httpRequest({
+					url: '/app/' + this.searchApi + this.searchText,
+					urlType: this.$getUrlType()
+				});
+				if (res.code === 200) {
+					this.searchData = res.data
+				}
+			},
+			//选择赋值给value
+			dataToValue(item) {
+				this.$emit('input', item[this.searchLabelKey])
+				this.$refs.searchPopup.close()
 			},
 		}
 	}
@@ -61,7 +140,7 @@
 
 <style lang="scss" scoped>
 	.desc {
-		padding: 10rpx 5rpx;
+		padding: 10rpx 15rpx 0 15rpx;
 		color: #818181;
 		font-size: 20rpx;
 	}

+ 102 - 0
pageA/components/photo.vue

@@ -0,0 +1,102 @@
+<template>
+	<view>
+		<view class="desc container">
+			<uni-section :title="label" type="line">
+				<view class="example-body">
+					<uni-file-picker :auto-upload="false" :value="fileList" :limit="limit" :title="'最多选择'+ limit +'张图片'"
+						@select="select" @delete="deletePhoto"></uni-file-picker>
+				</view>
+			</uni-section>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			value: [String, Object, Array],
+			// 图片数量限制
+			limit: {
+				type: Number,
+				default: 1,
+			},
+			label: {
+				Type: String,
+				default: ''
+			},
+		},
+		data() {
+			return {
+				fileList: []
+			}
+		},
+		methods: {
+			// 获取上传状态
+			select(e) {
+				this.uploadFilePromise(e['tempFilePaths'][0]).then(res => {
+					if (res.code === 200) {
+						this.fileList.push({
+							url: this.$BASE_URL + res.url,
+							extname: res.extname,
+							name: res.fileName
+						})
+						this.$emit("input", JSON.stringify(this.fileList))
+					}
+				})
+			},
+			deletePhoto(e) {
+				const findex = this.fileList.map(f => f.url).indexOf(e.tempFilePath);
+				if (findex > -1) {
+					this.fileList.splice(findex, 1);
+					this.$emit("input", JSON.stringify(this.fileList));
+				}
+			},
+			uploadFilePromise(url) {
+				return new Promise((resolve, reject) => {
+					let a = uni.uploadFile({
+						url: this.$BASE_URL + '/common/upload',
+						filePath: url,
+						name: 'file',
+						header: {
+							"Authorization": "Bearer " + uni.getStorageSync('token')
+						},
+						success: (res) => {
+							// console.log(JSON.parse(res.data).url);
+							setTimeout(() => {
+								resolve(JSON.parse(res.data))
+							}, 50)
+						}
+					});
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+	.desc {
+		padding: 10rpx 15rpx 0 15rpx;
+		color: #818181;
+		font-size: 20rpx;
+	}
+
+
+	.example-body {
+		padding: 10px;
+		padding-top: 0;
+	}
+
+	.custom-image-box {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: space-between;
+		align-items: center;
+	}
+
+	.text {
+		font-size: 14px;
+		color: #333;
+	}
+</style>

+ 19 - 19
pageA/components/show.vue

@@ -2,13 +2,13 @@
 	<view>
 		<view v-if="mode === 'text'">
 			<uni-row>
-				<uni-col :span="labelSize">
+				<uni-col :span="6">
 					<view class="desc">
 						{{label}}
 					</view>
 				</uni-col>
-				<uni-col :span="valueSize">
-					<view class="desc" style="text-align: right;" v-if="data !== '' && data !== null && data !== undefined">
+				<uni-col :span="18">
+					<view class="desc" v-if="data !== '' && data !== null && data !== undefined">
 						{{data}}
 					</view>
 				</uni-col>
@@ -16,12 +16,12 @@
 		</view>
 		<view v-if="mode === 'time'">
 			<uni-row>
-				<uni-col :span="labelSize">
+				<uni-col :span="6">
 					<view class="desc">
 						{{label}}
 					</view>
 				</uni-col>
-				<uni-col :span="valueSize">
+				<uni-col :span="18">
 					<view class="desc" v-if="data !== '' && data !== null && data !== undefined">
 						{{$dateResult(data,'date')}}
 					</view>
@@ -30,12 +30,12 @@
 		</view>
 		<view v-if="mode === 'dict'">
 			<uni-row>
-				<uni-col :span="labelSize">
+				<uni-col :span="6">
 					<view class="desc">
 						{{label}}
 					</view>
 				</uni-col>
-				<uni-col :span="valueSize">
+				<uni-col :span="18">
 					<view class="desc">
 						{{dictLabel}}
 					</view>
@@ -44,12 +44,12 @@
 		</view>
 		<view v-if="mode === 'dept'">
 			<uni-row>
-				<uni-col :span="labelSize">
+				<uni-col :span="6">
 					<view class="desc">
 						{{label}}
 					</view>
 				</uni-col>
-				<uni-col :span="valueSize">
+				<uni-col :span="18">
 					<view class="desc">
 						{{$dictTranslation(data,'deptData','dept')}}
 					</view>
@@ -58,18 +58,26 @@
 		</view>
 		<view v-if="mode === 'post'">
 			<uni-row>
-				<uni-col :span="labelSize">
+				<uni-col :span="6">
 					<view class="desc">
 						{{label}}
 					</view>
 				</uni-col>
-				<uni-col :span="valueSize">
+				<uni-col :span="18">
 					<view class="desc">
 						{{$dictTranslation(data,'postsData','post')}}
 					</view>
 				</uni-col>
 			</uni-row>
 		</view>
+		<view v-if="mode === 'photo'">
+			<view class="desc">
+				{{label}}
+			</view>
+			<view class="desc">
+				<uni-file-picker  :value="data"  file-mediatype="image" readonly></uni-file-picker>
+			</view>
+		</view>
 		<u-gap height="10" bgColor="#f7f7f7"></u-gap>
 	</view>
 </template>
@@ -81,14 +89,6 @@
 				type: String,
 				default: ''
 			},
-			labelSize: {
-				type: Number,
-				default: 6
-			},
-			valueSize: {
-				type: Number,
-				default: 18
-			},
 			data: {
 				type: String,
 				default: ''

+ 1 - 1
pageApp/components/input.vue

@@ -155,4 +155,4 @@
 		font-size: 26rpx;
 		color: #b1b1b1;
 	}
-</style>
+</style>

+ 9 - 0
pages.json

@@ -647,6 +647,15 @@
 					"navigationBarBackgroundColor": "#eeeeee",
 					"enablePullDownRefresh": false
 				}
+			}, {
+				"path": "club/sicknessBenefit",
+				"style": {
+					"navigationBarTextStyle": "black",
+					"backgroundColor": "#f3f3f3",
+					"navigationBarTitleText": "补助",
+					"navigationBarBackgroundColor": "#eeeeee",
+					"enablePullDownRefresh": false
+				}
 			}]
 		},
 		{

+ 4 - 3
util/request/api.js

@@ -5,8 +5,8 @@ const interval = 1000
 const dev = 'dev'
 const prod = 'prod'
 const devCloud = 'dev_cloud'
-const environment = dev
-// const environment = devCloud
+// const environment = dev
+const environment = devCloud
 // const environment = prod
 // 全局请求路径,也就是后端的请求基准路径
 export let BASE_URL
@@ -170,7 +170,8 @@ export const getAllDicts = () => {
 	let dictTypes = ['app_vacate_type', 'out_storage_type', 'app_msg_type', 'job_title', 'dimission_type',
 		'access_stroage_type', 'sys_user_sex', '', 'degree_dict', 'interview_type', 'hire_result',
 		"hzl_seal_use_type", "seal_type", "hzl_seal_use_address", 'hzl_file_type', 'welfare_apply_addr',
-		'device_repairs_urgency_level', 'device_scrap_status', 'goods_storage_type'
+		'device_repairs_urgency_level', 'device_scrap_status', 'goods_storage_type',
+		'condole_renshenshanghai_type'
 	]
 	for (var i = 0; i < dictTypes.length; i++) {
 		getDicts(dictTypes[i]).then(res => {