cuiqian2004
2024-07-05 37ff5e49c0e7c5b63e7e8e137058366244f826c1
pages/selPrj/index.vue
@@ -1,56 +1,7 @@
<style>
   .content {
      width: 100vw;
      height: 93vh;
      background: #EAEAEA;
      padding: 14rpx 0rpx 0rpx 0rpx;
   }
   input{
      border: 1px solid #d5d5d5;
      width: 77%;
      height: 80rpx;
      border-radius: 60rpx!important;
      padding: 0 60rpx 0 66rpx;
      margin: 0rpx 20rpx 10rpx 20rpx;
      background: #FFF;
   }
   .dv_query_body {
       height: 91%;
       background-color: #fff;
       border: 2rpx solid #d5d5d5;
       padding: 14rpx;
      overflow-y: auto;
   }
   .psn {
      width: 93%;
       margin: 0 12rpx 12rpx 0;
       padding: 8rpx 20rpx 10rpx;
       background-color: #55a1dd;
       font-size: 30rpx;
       color: #fff;
       border-radius: 20rpx;
       display: inline-block;
       cursor: pointer;
   }
   .dv_title{
      display: inline-block;
      width: 90%;
      vertical-align: middle;
   }
   button.btn_sava {
      margin-top: 60rpx;
      padding: 20rpx;
      line-height: 1.2;
      background: #27A6E1;
      border: none;
      color: #fff;
   }
</style>
<template>
   <view class="content">
   <view class="uni-page-selprj">
      <view style="height:90%;">
         <input type="text" class="txt_search" v-model="searchVal"  @keyup="onkeyup" placeholder="请输入项目名称进行查询" >
         <input type="text" class="txt_search" v-model="searchVal" @keyup="onkeyup" :placeholder="translate('input_project_name_query')" >
         <!-- <div class="dv_query_body" >
            <div class="psn">
               <checkbox-group class="ischeck" @change="onchange" data-ischeck="false" data-index="0" >
@@ -73,7 +24,7 @@
            </div>
         </div>
         
         <button type="default" @tap="sava" class="btn_sava">确定</button>
         <button type="default" @tap="sava" class="btn_sava">{{translateSys("ok")}}</button>
      </view>
      
   </view>
@@ -83,7 +34,7 @@
   export default {
      data() {
         return {
            title: '选择项目',
            title: this.translate('select_project'),
            relation:'-1',
            param:{},
            searchVal:'',
@@ -99,7 +50,19 @@
         // console.log(this.$data.param);
         
         
         var datainfo ={ relation: this.$data.relation, tag: '', type: '', kw: '', pindex: 1, psize: 999999999, state: '', order: 'CN_T_CREATE DESC', kwpmname: '', kwcode: '', sessionid: '' };
         var datainfo = {
            relation: this.$data.relation,
            tag: '',
            type: '',
            kw: '',
            pindex: 1,
            psize: 999999999,
            state: '',
            order: 'CN_T_CREATE DESC',
            kwpmname: '',
            kwcode: '',
            sessionid: ''
         };
         
         // console.log(datainfo);
         this.$store.dispatch('ProjectGetAnalysisList',datainfo).then(success=>{
@@ -112,18 +75,40 @@
               this.$data.data = success.data.Body;
               
            }else{
               uni.showModal({title:"错误1",content:success.msg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: this.translateSys("error") + "1",
                  content: success.msg,
                  showCancel: false,
                  confirmText:this.translateSys("cancel")
               });
            }
         }).catch(ex=>{
            // console.log(ex);
            uni.showModal({title:"错误1.1",content:ex.errMsg,showCancel:false,confirmText:"取消"});
            uni.showModal({
               title: this.translateSys("error") + "1.1",
               content: ex.errMsg,
               showCancel: false,
               confirmText: this.translateSys("cancel")
            });
         });
      },
      methods: {
         onkeyup(e) {
            // console.log(e.target);
            // console.log(this.$data.searchVal);
            var datainfo ={ relation: this.$data.priRel, tag: '', type: '', kw: this.$data.searchVal, pindex: 1, psize: 999999999, state: '', order: 'CN_T_CREATE DESC', kwpmname: '', kwcode: '', sessionid: '' };
            var datainfo = {
               relation: this.$data.priRel,
               tag: '',
               type: '',
               kw: this.$data.searchVal,
               pindex: 1,
               psize: 999999999,
               state: '',
               order: 'CN_T_CREATE DESC',
               kwpmname: '',
               kwcode: '',
               sessionid: ''
            };
            this.$store.dispatch('ProjectGetAnalysisList',datainfo).then(success=>{
               console.log(success);
               if (success.code=='00000') {
@@ -133,11 +118,21 @@
                  
                  this.$data.data = success.data.Body;
               }else{
                  uni.showModal({title:"错误2",content:success.msg,showCancel:false,confirmText:"取消"});
                  uni.showModal({
                     title: this.translateSys("error") + "2",
                     content: success.msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
               }
            }).catch(ex=>{
               // console.log(ex);
               uni.showModal({title:"错误2.1",content:ex.errMsg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: this.translateSys("error") + "2.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: this.translateSys("cancel")
               });
            });
            
         },
@@ -161,7 +156,12 @@
               }
            }
            if(data.length==0){
               uni.showModal({title:"提示",content:'未选择项目!',showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: this.translate('tip_no_select_project'),
                  showCancel: false,
                  confirmText: this.translateSys("cancel")
               });
               return;
            }
            const eventChannel = this.$scope.eventChannel;
@@ -169,8 +169,68 @@
            eventChannel.emit('AddPer',data,this.$data.param);
            
            uni.navigateBack()
         }
         },
         translate(t) {
            if (typeof this.$t == "function") return this.$t(`page.${t}`)
            else return t;
         },
         translateSys(t) {
            if (typeof this.$t == "function") return this.$t(`sys.${t}`)
            else return t;
         },
      }
   }
</script>
<style lang="scss">
   .uni-page-uni-page-selprj {
      width: 100vw;
      height: 93vh;
      background: #EAEAEA;
      padding: 14rpx 0rpx 0rpx 0rpx;
      input {
         border: 1px solid #d5d5d5;
         width: 77%;
         height: 80rpx;
         border-radius: 60rpx !important;
         padding: 0 60rpx 0 66rpx;
         margin: 0rpx 20rpx 10rpx 20rpx;
         background: #FFF;
      }
      .dv_query_body {
         height: 91%;
         background-color: #fff;
         border: 2rpx solid #d5d5d5;
         padding: 14rpx;
         overflow-y: auto;
      }
      .psn {
         width: 93%;
         margin: 0 12rpx 12rpx 0;
         padding: 8rpx 20rpx 10rpx;
         background-color: #55a1dd;
         font-size: 30rpx;
         color: #fff;
         border-radius: 20rpx;
         display: inline-block;
         cursor: pointer;
      }
      .dv_title {
         display: inline-block;
         width: 90%;
         vertical-align: middle;
      }
      button.btn_sava {
         margin-top: 60rpx;
         padding: 20rpx;
         line-height: 1.2;
         background: #27A6E1;
         border: none;
         color: #fff;
      }
   }
</style>