<template>
|
<view>
|
<u-popup mode="bottm" :show="show" @close="cancel" :safeAreaInsetBottom="false">
|
<view class="picker-view-box">
|
<view class="options" @click="cancel">
|
<u-icon name="close" size="28rpx" color="#000"></u-icon>
|
</view>
|
<view class="set-flex">
|
<u-search v-model="planName" @search="getRectifyList" @clear="clearContent" @confirm="getRectifyList"
|
@custom="getRectifyList()"></u-search>
|
<text @click="entery">确定</text>
|
</view>
|
<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>
|
<u-popup mode="bottm" :show="showadd" :safeAreaInsetBottom="false">
|
<view class="picker-view-box">
|
<view class="head">
|
新增临时企业
|
</view>
|
<view style="margin: 20rpx 0;">
|
<u-input v-model="name" placeholder="请输入企业名称" type="text" />
|
</view>
|
<view class="bz">
|
备注:如企业搜索无结果或企业无二维码,则该企业未在平台内进行注册,可点击“新增”输入该企业名称新增临时企业,新增的企业只需要提交申请-审批通过后即可填报执法结果,无需扫企业二维码。如企业已有二维码,请返回搜索页搜索并选择该企业,不要新增临时企业。
|
</view>
|
<view class="down-button">
|
<view>
|
<u-button shape="circle" @click="close">取消</u-button>
|
</view>
|
<view>
|
<u-button shape="circle" color="#1171E0" @click="addContent">确定</u-button>
|
</view>
|
</view>
|
</view>
|
|
</u-popup>
|
</view>
|
</template>
|
|
<script>
|
import {
|
companyList,
|
getRectifyList
|
} from '@/api/policy.js'
|
export default {
|
props: {
|
keyName: {
|
type: String,
|
default: ''
|
},
|
companyId: {
|
type: String,
|
default: ''
|
},
|
applyOrgId: {
|
type: String,
|
default: ''
|
},
|
},
|
data() {
|
return {
|
columns: [],
|
show: false,
|
planName: '',
|
index: 0,
|
value: [],
|
showadd: false,
|
name: ''
|
}
|
},
|
|
methods: {
|
clearContent() {
|
this.planName = ""
|
this.getRectifyList()
|
},
|
cancel() {
|
this.show = false
|
},
|
open() {
|
this.show = true
|
this.getRectifyList()
|
},
|
bindChange(e) {
|
this.index = e.detail.value[0]
|
},
|
getRectifyList() {
|
return getRectifyList({
|
enforceReason: this.planName,
|
companyId: this.companyId,
|
applyOrgId: this.applyOrgId,
|
}).then(val => {
|
console.log(val)
|
if (val.data.code == 200) {
|
this.columns = val.data.data || []
|
}
|
})
|
},
|
entery() {
|
const info = this.columns[this.index]
|
this.$emit('confirm', info)
|
this.show = false
|
},
|
close() {
|
this.show = true
|
this.showadd = false
|
},
|
add() {
|
this.show = false
|
this.showadd = true
|
},
|
addContent() {
|
if (this.name == '') {
|
uni.showToast({
|
title: '请输入企业名称',
|
icon: 'none',
|
duration: 3000
|
})
|
return
|
}
|
this.$emit('setCompany', this.name)
|
this.show = false
|
this.showadd = false
|
}
|
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.picker-view-box {
|
position: fixed;
|
z-index: 120000;
|
background-color: white;
|
height: 600rpx;
|
padding: 20rpx 32rpx 0;
|
bottom: 0;
|
width: 100%;
|
box-sizing: border-box;
|
border-radius: 20rpx 20rpx 0 0;
|
}
|
|
.options {
|
display: flex;
|
justify-content: flex-end;
|
align-items: center;
|
|
.button {
|
position: absolute;
|
right: 20rpx;
|
top: -10rpx;
|
padding: 10rpx 20rpx;
|
border-radius: 10rpx;
|
font-size: 28rpx;
|
}
|
}
|
|
.text-center {
|
text-align: center;
|
line-height: 34px;
|
}
|
|
.picker-view {
|
width: 100%;
|
height: 500rpx;
|
margin-top: 20rpx;
|
}
|
|
.set-flex {
|
display: flex;
|
justify-content: flex-start;
|
align-items: center;
|
|
text {
|
display: inline-block;
|
background-color: $main-color;
|
color: white;
|
border-radius: 5px;
|
padding: 5px 15px;
|
margin-left: 20rpx;
|
font-size: 24rpx;
|
}
|
}
|
|
.bz {
|
font-size: 24rpx;
|
color: #999;
|
}
|
|
.down-button {
|
margin-top: 60rpx;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
|
&>view {
|
width: 45%;
|
}
|
}
|
</style>
|