346149741
2024-09-03 0e9b58dea98030029d30e86a0460323c8e56b1ec
policy/policyApply/perPicker.vue
@@ -1,20 +1,47 @@
<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-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="add" color="#1171E0" size="mini">新增企业</view>
            </view>
            <view class="set-flex">
               <u-search v-model="companyName" @search="companyList" @clear="clearContent" @confirm="companyList" @custom="companyList()"></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-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>
      </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>
      </view>
   </u-popup>
      </u-popup>
   </view>
</template>
<script>
@@ -32,7 +59,9 @@
            show: false,
            companyName: "",
            index: 0,
            value: []
            value: [],
            showadd:false,
            name:''
         }
      },
      mounted() {
@@ -53,14 +82,15 @@
            this.index = e.detail.value[0]
         },
         companyList() {
            companyList({companyName: this.companyName, companyStatus: 0, checkStatus: 2}).then(val => {
            return companyList({companyName: this.companyName, companyStatus: 0, checkStatus: 2}).then(val => {
               if(val.data.code == 200){
                  if(!val.data.rows.length || !val.data.rows){
                     uni.showToast({
                        title: '没有符合的数据,请检查输入的执法对象',
                        icon: 'none',
                        duration: 3000
                     })
                     // uni.showToast({
                     //    title: '没有符合的数据,请检查输入的执法对象',
                     //    icon: 'none',
                     //    duration: 3000
                     // })
                     this.columns = val.data.rows || []
                  } else {
                     this.columns = val.data.rows
                  }
@@ -72,6 +102,35 @@
            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
            // await this.companyList()
            // // console.log(this.columns.length)
            // if(this.columns.length) {
            // } else {
            //    this.$emit('setCompany', this.companyName)
            //    this.show = false
            // }
         },
         addContent() {
            if(this.name==''){
               uni.showToast({
                  title: '请输入企业名称',
                  icon: 'none',
                  duration: 3000
               })
               return
            }
            this.$emit('setCompany', this.name)
            this.show = false
            this.showadd = false
         }
         
      }
@@ -115,4 +174,31 @@
         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>