From 59f4dc012a2c42eebd31301444e0f8df9af088e0 Mon Sep 17 00:00:00 2001
From: wjt <1797368093@qq.com>
Date: 星期三, 26 六月 2024 10:13:12 +0800
Subject: [PATCH] Merge branch 'master' of http://218.28.192.34:9999/r/sqys/sqys_xcx

---
 policy/policyApply/perPicker.vue |  118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 118 insertions(+), 0 deletions(-)

diff --git a/policy/policyApply/perPicker.vue b/policy/policyApply/perPicker.vue
new file mode 100644
index 0000000..1aea242
--- /dev/null
+++ b/policy/policyApply/perPicker.vue
@@ -0,0 +1,118 @@
+<template>
+	<u-popup mode="bottm" :show="show"  :safeAreaInsetBottom="false">
+		<view class="picker-view-box">
+			<view class="options">
+				<view class="button" @click="cancel" size="mini">鍙栨秷</view>
+				<view class="button entery" @click="entery" color="#1171E0" size="mini">纭畾</view>
+			</view>
+			<u-search v-model="companyName" @search="companyList" @clear="clearContent" @confirm="companyList" @custom="companyList()"></u-search>
+			<view>
+				<picker-view immediate-change :value="value" @change="bindChange" class="picker-view">
+					<picker-view-column>
+						<view  class="text-center" v-for="(item,index) in columns" :key="index">{{item[keyName]}}</view>
+					</picker-view-column>
+				</picker-view>
+			</view>
+		</view>
+	</u-popup>
+</template>
+
+<script>
+	import { companyList } from '@/api/policy.js'
+	export default {
+		props: {
+			keyName: {
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				columns: [],
+				show: false,
+				companyName: "",
+				index: 0,
+				value: []
+			}
+		},
+		mounted() {
+			this.companyList()
+		},
+		methods: {
+			clearContent() {
+				this.companyName = ""
+				this.companyList()
+			},
+			cancel() {
+				this.show = false
+			},
+			open() {
+				this.show = true
+			},
+			bindChange(e) {
+				this.index = e.detail.value[0]
+			},
+			companyList() {
+				companyList({companyName: this.companyName}).then(val => {
+					if(val.data.code == 200){
+						if(!val.data.rows.length || !val.data.rows){
+							uni.showToast({
+								title: '娌℃湁绗﹀悎鐨勬暟鎹紝璇锋鏌ヨ緭鍏ョ殑鎵ф硶瀵硅薄',
+								icon: 'none',
+								duration: 3000
+							})
+						} else {
+							this.columns = val.data.rows
+						}
+						
+					}
+				})
+			},
+			entery() {
+				const info = this.columns[this.index]
+				this.$emit('confirm', info)
+				this.show = false
+			}
+			
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.picker-view-box{
+		position: fixed;
+		z-index: 120000;
+		background-color: white;
+		height: 600rpx;
+		padding: 40rpx 32rpx 0;
+		bottom: 0;
+		width: 100%;
+		box-sizing: border-box;
+		border-radius: 20rpx 20rpx 0 0;
+	}
+	.options{
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		margin-bottom: 40rpx;
+		.button{
+			padding: 10rpx 20rpx;
+			border-radius: 10rpx;
+			font-size: 28rpx;
+		}
+		.entery{
+			background-color: $main-color;
+			color: white;
+			
+		}
+	}
+	.text-center{
+		text-align: center;
+		line-height: 34px;
+	}
+		.picker-view {
+			width: 100%;
+			height: 500rpx;
+			margin-top: 20rpx;
+		}
+</style>
\ No newline at end of file

--
Gitblit v1.9.1