coys 2 年 前
コミット
d60b2bd801

+ 8 - 0
src/api/optimalLearning.js

@@ -17,3 +17,11 @@ export function getRecTaskList(data) {
     data
   })
 }
+// 提交评优
+export function submitRecTask(data) {
+  return request({
+    url: '/core/drill/task/doRecTask',
+    method: 'post',
+    data
+  })
+}

+ 7 - 0
src/api/public.js

@@ -44,6 +44,13 @@ export function getMenu() {
     method: 'get',
   })
 }
+// 获取天气预警
+export function getTheAreaWeather(orgId) {
+  return request({
+    url: `/core/weatherWarning/getTheAreaWeather/${orgId}`,
+    method: 'get',
+  })
+}
 
 
 

+ 41 - 5
src/views/home/menu.vue

@@ -2,24 +2,40 @@
   <div class="menu-container">
     <top-bar></top-bar>
     <!-- 天气预警 -->
-    <van-notice-bar :scrollable="false" text="在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。" />
+    <van-swipe style="height: 50px" vertical autoplay="1000">
+      <van-swipe-item>
+        <div class="color">
 
+        </div>
+      </van-swipe-item> 
+      <van-swipe-item>2</van-swipe-item> 
+      <van-swipe-item>3</van-swipe-item>
+      <van-swipe-item>4</van-swipe-item>
+      <template #indicator>
+    <div class="custom-indicator"></div>
+      </template>
+    </van-swipe>
     <div class="menu-list">
       <div class="menu-list-item" v-for="(v, i) in menuList" :key="i">
         <p @click="onclick">{{ v.meta.title }}</p>
         <van-grid border :column-num="3">
-          <van-grid-item v-for="(item,index) in v.children" :key="index" :icon="item.meta.icon" :text="item.meta.title" :to="item.path" />
+          <van-grid-item
+            v-for="(item, index) in v.children"
+            :key="index"
+            :icon="item.meta.icon"
+            :text="item.meta.title"
+            :to="item.path"
+          />
         </van-grid>
       </div>
     </div>
-    
   </div>
 </template>
 
 <script>
 import TopBar from '@/components/TopBar'
 import { mapGetters } from 'vuex'
-import { getMenu } from '@/api/public'
+import { getMenu,getTheAreaWeather } from '@/api/public'
 export default {
   name: 'menus',
   components: { TopBar },
@@ -29,10 +45,11 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['userName'])
+    ...mapGetters(['userName','orgId'])
   },
   mounted() {
     this.getMenuList()
+    this.getTheWeather()
   },
   methods: {
     getMenuList() {
@@ -40,6 +57,12 @@ export default {
         this.menuList = res.data
       })
     },
+    //获取天气数据
+    getTheWeather(){
+      getTheAreaWeather(this.orgId).then(res=>{
+        console.log(res);
+      }) 
+    },
     onclick() {
       this.$router.push('/workTime')
     }
@@ -48,6 +71,19 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.color{
+  width: 100%;
+  height: 100%;
+  background-color: red;
+}
+  .custom-indicator {
+    position: absolute;
+    right: 5px;
+    bottom: 5px;
+    padding: 2px 5px;
+    font-size: 12px;
+    background: rgba(0, 0, 0, 0.1);
+  }
 .menu-container {
   background-color: rgba(237, 252, 255, 1);
 }

+ 98 - 53
src/views/menu/rehearsalTask/components/rehearsalTaskSign.vue

@@ -88,8 +88,16 @@
     <div class="mainItem">
       <!-- <div class="label"></div> -->
       <div>
-        <van-checkbox-group v-model="result" direction="horizontal" >
-          <van-checkbox v-for="item in resultList" :key="item.value" @change="clickChekcBox($event,item)" :disabled="disabledCheck(item)" shape="square" :name="item.value">{{ item.name }}</van-checkbox>
+        <van-checkbox-group v-model="result" direction="horizontal" @change="clickChekcBox($event)">
+          <van-checkbox
+            v-for="item in resultList"
+            :key="item.value"
+            :disabled="item.disabled"
+            shape="square"
+            :checked="item.checked"
+            :name="item.value"
+            >{{ item.name }}</van-checkbox
+          >
         </van-checkbox-group>
       </div>
     </div>
@@ -122,7 +130,8 @@
 <script>
 import NavBar from '@/components/NavBar'
 import writingPad from '@/components/writingPad/index.vue'
-import { getrehearsalInfo, singrehearsalTask, drillInfo, drillSignInfo } from '@/api/drillTask.js'
+import { getrehearsalInfo, singrehearsalTask, drillSignInfo } from '@/api/drillTask.js'
+import { submitRecTask } from '@/api/optimalLearning.js'
 import { upload } from '@/api/public'
 import imgCom from '@/components/imgCom/index.vue'
 import { base64ToBlob } from '@/utils/base64TurnImg.js'
@@ -147,7 +156,7 @@ export default {
       value: 0, //评分
       this_window: window,
       show: false,
-      resultList:[],
+      resultList: [],
       taskUserList: [], //参与人员
       qsUserList: [], //缺席人员
       imgList: [], //图片数组
@@ -209,44 +218,6 @@ export default {
     }
   },
   created() {
-    //获取当前登录人机构类型
-    this.orgType = window.sessionStorage.getItem('SET_USER_ORGTYPE')
-    console.log( this.orgType );
-    if (this.orgType == 1) {
-      //省联社
-      this.resultList = [
-        {
-          name: '设置为省级优秀案例',
-          value: 5
-        }
-      ]
-    } else if (this.orgType == 2) {
-      //办事处
-      this.resultList = [
-      {
-          name: '设置为地区优秀案例',
-          value: 3
-        },
-        {
-          name: '推荐为省级优秀案例',
-          value: 4
-        }
-        
-      ]
-    } else if (this.orgType == 3) {
-      //行社
-      this.resultList = [
-      {
-          name: '设置为行社优秀案例',
-          value: 1
-        },
-        {
-          name: '推荐为地区优秀案例',
-          value: 2
-        }
-        
-      ]
-    }
     //获取详情信息
     getrehearsalInfo(this.$route.params.id.split('_')[0]).then(res => {
       let { code, data, msg } = res
@@ -282,22 +253,89 @@ export default {
         }
 
         this.imgList = this.trainingData.imageList.split(',') || []
+        //获取当前登录人机构类型
+        this.orgType = window.sessionStorage.getItem('SET_USER_ORGTYPE')
+        
+        if (this.orgType == 1) {
+          //省联社
+          this.resultList = [
+            {
+              name: '设置为省级优秀案例',
+              value: 5,
+             
+              disabled: false
+            }
+          ]
+          if(data.recStatus==5){
+            this.result=[5]
+          }
+        } else if (this.orgType == 2) {
+          //办事处
+          this.resultList = [
+            {
+              name: '设置为地区优秀案例',
+              value: 3,
+             
+              disabled: false
+            },
+            {
+              name: '推荐为省级优秀案例',
+              value: 4,
+              
+              disabled: true
+            }
+          ]
+          if(data.recStatus==4){
+            this.result=[3,4]
+          }else if(data.recStatus==3){
+            this.result=[3]
+
+          }
+        } else if (this.orgType == 3) {
+          //行社
+          this.resultList = [
+            {
+              name: '设置为行社优秀案例',
+              value: 1,
+              
+              disabled: false
+            },
+            {
+              name: '推荐为地区优秀案例',
+              value: 2,
+              
+              disabled: true
+            }
+          ]
+          if(data.recStatus==2){
+            this.result=[1,2]
+          }else if(data.recStatus==1){
+            this.result=[1]
+
+          }
+        }
       }
     })
   },
-  mounted() {
-    
-  },
+  mounted() {},
 
   methods: {
-    disabledCheck(item){
+    disabledCheck(item) {
+      if (item == 'false') return false
+      if (item == 'true') return true
       //当前是最后一个复选框禁用
-      if(this.resultList.length>1&&item.value==this.resultList[this.resultList.length-1].value){
+      if (this.resultList.length > 1 && item.value == this.resultList[this.resultList.length - 1].value) {
         return true
+      } else {
+        return false
       }
     },
-    clickChekcBox(v,item){
-      console.log(v,item);
+    clickChekcBox(v) {
+      if (v[0] == this.resultList[0].value) {
+        this.resultList[1].disabled = this.disabledCheck('false')
+      } else {
+        this.resultList[1].disabled = this.disabledCheck('true')
+      }
     },
     signatureHandler() {
       this.show = true
@@ -344,10 +382,17 @@ export default {
           })
       } else {
         //评价推优
-        if(this.result.length==0){
-          Toast('推荐优秀或设置优秀不能为空')
-          return
-        }
+        
+
+        submitRecTask({
+          drillTaskId: this.trainingData.id,
+          recStatus: Math.max(...this.result)
+        }).then(res => {
+          Toast('评优成功')
+          setTimeout(() => {
+            this.$router.push('/rehearsaloptimal')
+          }, 1000)
+        })
       }
     },
     clearHandler() {

+ 11 - 7
src/views/menu/rehearsalTask/index.vue

@@ -212,7 +212,8 @@ export default {
     },
     //判断是否展示签名按钮
     isSignature(list) {
-  
+     
+      
       let falg = false
       let timefalg = false
       //value1 当前登陆用户ID
@@ -227,12 +228,15 @@ export default {
           timefalg = true
         }
       }
-      list.userList.forEach(item => {
-        console.log(this.value1, 'sss')
-        if (this.value1 == item.userId && item.sign === 0 && item.type == 1) {
-          falg = true
-        }
-      })
+      if(list.userList&&list.userList.length>0){
+
+        list.userList.forEach(item => {
+          console.log(this.value1, 'sss')
+          if (this.value1 == item.userId && item.sign === 0 && item.type == 1) {
+            falg = true
+          }
+        })
+      }
 
       if (falg && timefalg) {
         return true

+ 39 - 27
src/views/menu/rehearsalTask/optimal.vue

@@ -106,13 +106,12 @@
         </van-panel>
       </van-list>
     </div>
-   
   </div>
 </template>
 <script>
 import NavBar from '@/components/NavBar'
 import { Col, Row, Cascader, Dialog, DatetimePicker, Icon, Picker } from 'vant'
-import { getlearningListPage,  } from '@/api/optimalLearning.js'
+import { getlearningListPage } from '@/api/optimalLearning.js'
 import { deptTreeList } from '@/api/toConsult.js'
 import { Toast } from 'vant'
 import OrgTree from '@/components/orgTree'
@@ -126,9 +125,9 @@ export default {
       pageNum: 1,
       loading: false, //加载状态
       finished: false, //是否全部加载完毕
-     
+
       yearColumns: [],
-    
+
       orgName: JSON.parse(sessionStorage.getItem('SET_USER_ORGNAME')) || '', //机构名称
       cascaderValue: '', //机构ID
       show: false, //机构弹框显示隐藏
@@ -139,16 +138,16 @@ export default {
         children: 'children'
       },
       taskList: [], //列表数据
-     
+
       yearSelect: null,
       value1: JSON.parse(sessionStorage.getItem('SET_USER_ID')) || '', //输入框model
-      columnsList:[],
+      columnsList: [],
       showStatus: false, //状态显示隐藏
       showDate: false, //月份显示隐藏
       fieldValue: '全部', //状态名称
       statusValue: ' ', //状态值
       columns: [], //状态数组
-      currentDate: newDateYear(), //年份
+      currentDate: newDateYear() //年份
     }
   },
   components: {
@@ -163,11 +162,9 @@ export default {
     Cascader
   },
 
-  
-
   created() {
     this.presentDate = new Date(newDateYear())
-  
+
     this.yearData()
   },
   mounted() {
@@ -181,11 +178,32 @@ export default {
       this.orgName = val.name
       this.selectListAppHandler()
     },
-   
+    // 当前行社 3 -> 0:正常案例、1:行社优秀案例、2:已推荐地区优秀案例
+
+    // 当前地区 2 -> 2:已推荐地区优秀案例、3:地区优秀案例、4:已推荐省级优秀案例
+
+    // 当前省联社 1 -> 4:已推荐省级优秀案例、5:省级优秀案例
     //判断是否展示登记按钮
-    isSign(list) {
+    isSign(item) {
+      let orgType = window.sessionStorage.getItem('SET_USER_ORGTYPE')
+      if (orgType == '2') {
+        if (item.recStatus == 2 || item.recStatus == 3 || item.recStatus == 4) {
+          return true
+        }
+        // 办事处
+      } else if (orgType == 3) {
+        if (item.recStatus == 0 || item.recStatus == 1 || item.recStatus == 2) {
+          return true
+        }
+        // 行社
+      } else if (orgType == 1) {
+        if (item.recStatus == 4 || item.recStatus == 5) {
+          return true
+        }
+        // 省联社
+      }
+
       return true
-      
     },
     //清空查询条件
     clearSearch() {
@@ -193,7 +211,7 @@ export default {
       this.statusValue = ''
       this.cascaderValue = ''
       this.currentDate = ''
-    
+
       this.typeName = ''
       this.orgName = ''
 
@@ -202,8 +220,8 @@ export default {
 
     //初始化
     init() {
-       //获取数据字典
-       this.getDictHandler('drill_task_rec_status', res => {
+      //获取数据字典
+      this.getDictHandler('drill_task_rec_status', res => {
         this.columnsList = res
         this.columns = res.map(item => item.dictLabel)
         this.columns.unshift('全部')
@@ -212,7 +230,6 @@ export default {
     },
     selectListAppHandler(type = 0, callback = () => {}) {
       let obj = {
-       
         pageNum: this.pageNum,
         pageSize: 10
       }
@@ -227,9 +244,8 @@ export default {
       obj.orgId = this.cascaderValue || JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + '' || ''
 
       if (this.currentDate) {
-        obj.date = this.currentDate+'-'+this.active
+        obj.date = this.currentDate + '-' + this.active
       }
-    
 
       //获取任务列表
       getlearningListPage(obj).then(res => {
@@ -250,9 +266,6 @@ export default {
       })
     },
 
-   
-   
-
     //搜索选择状态时触发
     onConfirm(value, index) {
       this.fieldValue = value
@@ -267,7 +280,7 @@ export default {
       this.selectListAppHandler()
       this.showStatus = false
     },
-    tbsHandler(){
+    tbsHandler() {
       this.selectListAppHandler()
     },
     //月份选中触发
@@ -316,15 +329,14 @@ export default {
       this.selectListAppHandler(1, () => {
         this.pageNum++
         this.loading = false
-       
       })
     },
-   
+
     //培训登记跳转
     commentSign(id) {
-        this.$router.push('/commentSign/' + id + '_comment')
+      this.$router.push('/commentSign/' + id + '_comment')
     },
-  
+
     //跳转详情
     goInfo(id) {
       this.$router.push('/commentSign/' + id + '_info')

+ 10 - 1
vue.config.js

@@ -69,13 +69,21 @@ module.exports = defineConfig({
           }
       },
       '/jingyuanchao': {
-          target: "http://10.87.11.173:8080",
+          target: "http://10.87.10.109:8080",
           // ws:true,
           changOrigin:true,
           pathRewrite:{
             '^/jingyuanchao':'/'
           }
       },
+      // '/jingyuanchao': {
+      //     target: "http://10.87.11.173:8080",
+      //     // ws:true,
+      //     changOrigin:true,
+      //     pathRewrite:{
+      //       '^/jingyuanchao':'/'
+      //     }
+      // },
       '/luowei': {
         target: "http://10.87.10.47:8080",
         // ws:true,
@@ -116,6 +124,7 @@ module.exports = defineConfig({
           '^/chao':'/'
         }
       },
+    
     }
   },
   css: {