coys há 2 anos atrás
pai
commit
f333b0ea62

+ 17 - 3
src/api/evaluateTask.js

@@ -1,14 +1,28 @@
 // 外包履职评价
 import request from '@/utils/request'
 
-
 // 分页
 export function getEvaluatePage(query) {
   return request({
     url: '/core/task/appList',
-    
+
     method: 'get',
-    params:query
+    params: query
   })
 }
+// 评价获取详情
+export function getEvaluateByid(id) {
+  return request({
+    url: `/core/task/${id}`,
 
+    method: 'get'
+  })
+}
+// 评价提交
+export function submitEvaluate(data) {
+  return request({
+    url: `/core/task`,
+    method: 'put',
+    data
+  })
+}

+ 12 - 0
src/assets/css/index.scss

@@ -45,3 +45,15 @@ pre{
 .van-picker__confirm{
   color: #008cd6;
 }
+.wj-title-blue{
+  color: #008cd6;
+}
+.wj-title-orange{
+  color: #bc9f71;
+}
+.wj-title-green{
+  color: #009240;
+}
+.wj-title-red{
+  color: #d7000f;
+}

+ 10 - 7
src/views/home/works.vue

@@ -40,7 +40,7 @@
               class="mainTitle"
               :value="worksLink(2, item.taskType, i.recStatus ? i.recStatus : i.status)"
               :label="i.startTime + '-' + i.endTime"
-              :value-class="i.status == 0 ? `title-blue` : `title-orange`"
+              :value-class="iColorClas(item.taskType,i.status) "
             >
               <template #title>
                 <span class="custom-title"
@@ -104,6 +104,14 @@ export default {
     this.getList()
   },
   methods: {
+    iColorClas(type,status){
+      
+      if(status==0||type==0&&status==1){
+        return 'wj-title-blue'
+      }else {
+        return 'wj-title-orange'
+      }
+    },
     isFalgHandler(i, taskType, id) {
       
       if (i.isExist != undefined && i.isExist == 0) {
@@ -389,12 +397,7 @@ export default {
 }
 .index-container {
 }
-.title-orange {
-  color: #bc9f71;
-}
-.title-blue {
-  color: #008cd6;
-}
+
 .big_box {
   height: calc(100vh - 520px);
   overflow: auto;

+ 4 - 4
src/views/menu/rehearsalTask/index.vue

@@ -95,10 +95,10 @@
             </div>
             <div class="mainItem" @click="goInfo(item.id)">
               <div>演练状态</div>
-              <div v-if="item.status == 0||item.status == 5" :style="{ color: '#008cd6' }">{{ item.statusText }}</div>
-              <div v-else-if="item.status == 1||item.status == 2" :style="{ color: '#bc9f71' }">{{ item.statusText }}</div>
-              <div v-else-if="item.status == 3" :style="{ color: '#009240' }">{{ item.statusText }}</div>
-              <div v-else-if="item.status == 4" :style="{ color: '#d7000f' }">{{ item.statusText }}</div>
+              <div class="wj-title-blue" v-if="item.status == 0||item.status == 5" >{{ item.statusText }}</div>
+              <div class="wj-title-orange" v-else-if="item.status == 1||item.status == 2" >{{ item.statusText }}</div>
+              <div class="wj-title-green" v-else-if="item.status == 3" >{{ item.statusText }}</div>
+              <div class="wj-title-red" v-else-if="item.status == 4" >{{ item.statusText }}</div>
               
             </div>
             <div class="mainItem" @click="goInfo(item.id)">

+ 89 - 25
src/views/menu/resumptionEvaluate/evaluate.vue

@@ -3,43 +3,60 @@
     <NavBar :go="{ type: 'push', path: '/resumptionEvaluate' }" />
     <div class="evaluate">
       <van-row class="cell_cls">
-        <van-col span="24"> 三季度对押运公司的评价 </van-col>
+        <van-col span="24"> {{ formData.evaluateName }} </van-col>
       </van-row>
       <van-row class="cell_cls">
         <van-col span="24">
           <span class="evaluteTime">评价周期:</span>
-          <span>{{ '2023-09-01-2023-10-01' }}</span>
+          <span>{{ formData.startTime }}-{{ formData.endTime }}</span>
         </van-col>
       </van-row>
       <van-row>
         <van-col span="24" class="evaluteMain">
           <span class="titleLeft"></span>
-          <span class="text">评价内容</span>
+          <span class="text">{{ addOrInfo == 'add' ? '评价内容:' : '评价记录:' }}</span>
         </van-col>
       </van-row>
-      <van-cell title="1-被评价外包公司名称">
-        <!-- 使用 title 插槽来自定义标题 -->
-        <template #label>
-          <van-field v-model="text" required placeholder="请输入" />
-        </template>
-      </van-cell>
-      <van-cell title="2-外包公司在提供服务过程中的质量">
-        <!-- 使用 title 插槽来自定义标题 -->
-        <template #label>
-          <span style="font-size: 14px">评分:</span
-          ><van-rate count="10" v-model="value" :size="20" color="#ffd21e" void-icon="star" void-color="#eee" />
-        </template>
-      </van-cell>
+      <van-form @submit="onSubmit" ref="form">
+        <van-cell
+          :title="item.code + '.' + item.content"
+          v-for="item in formData.coreEvaluateContentList"
+          :key="item.id"
+        >
+          <!-- 使用 title 插槽来自定义标题 -->
+          <template #label v-if="item.contentType == '1'">
+            <van-field
+              v-model="item.score"
+              required
+              :placeholder="'请输入' + item.content"
+              :rules="[{ required: true, message: item.content + '不能为空' }]"
+            />
+          </template>
+          <template #label v-else>
+            <span style="font-size: 14px">评分:</span
+            ><van-rate
+              count="10"
+              v-model="item.score"
+              :size="20"
+              color="#ffd21e"
+              void-icon="star"
+              void-color="#eee"
+            />{{ item.score }}分
+          </template>
+        </van-cell>
+      </van-form>
     </div>
     <van-row class="cell-btutton">
       <van-col span="24">
-        <van-button type="info"  class="infoBtn">评价</van-button>
+        <van-button type="info" class="infoBtn" @click="onSubmit">评价</van-button>
       </van-col>
     </van-row>
   </div>
 </template>
 <script>
 import NavBar from '@/components/NavBar'
+import { getEvaluateByid, submitEvaluate } from '@/api/evaluateTask.js'
+import { Toast } from 'vant'
 export default {
   name: 'SocAppEvaluate',
   components: {
@@ -48,13 +65,60 @@ export default {
   data() {
     return {
       text: '',
+      id: '',
+      addOrInfo: '',
+      formData: {
+        coreEvaluateContentList: []
+      },
       value: 0
     }
   },
-
+  created() {
+    this.init()
+  },
   mounted() {},
 
-  methods: {}
+  methods: {
+    //获取详情数据
+    init() {
+      this.id = this.$route.params.id.split('_')[0] || ''
+      this.addOrInfo = this.$route.params.id.split('_')[1] || ''
+
+      if (this.$route.params.id.split('_')[1] === 'add') {
+        //评价
+
+        getEvaluateByid(this.id).then(res => {
+          let { code, data, msg } = res
+          if (code == 200) {
+            this.formData = data
+            console.log(this.formData)
+          }
+        })
+      } else {
+        //详情
+      }
+    },
+    //评价提交
+    onSubmit() {
+      this.$refs.form.validate().then(() => {
+        let obj =JSON.parse(JSON.stringify(this.formData))
+        obj.coreEvaluateContentList.forEach(item=>{
+          if(item.contentType=='2'){
+            item.score=item.score+''
+          }
+        })
+        submitEvaluate({ coreEvaluateTaskContentList:obj.coreEvaluateContentList , id: obj.id }).then(
+          res => {
+           
+            let {code,msg}=res
+            Toast.success(msg)
+            this.$router.push('/resumptionEvaluate')
+          }
+        )
+      })
+      // this.formData.coreEvaluateContentList.forEach
+    }
+  }
 }
 </script>
 <style lang="scss" scoped>
@@ -89,12 +153,12 @@ export default {
     vertical-align: middle;
   }
 }
-.infoBtn{
-    width: 100%;
+.infoBtn {
+  width: 100%;
 }
-.cell-btutton{
-    position: absolute;
-    bottom: 0%;
-    width: 100%;
+.cell-btutton {
+  position: absolute;
+  bottom: 0%;
+  width: 100%;
 }
 </style>

+ 25 - 7
src/views/menu/resumptionEvaluate/index.vue

@@ -2,7 +2,7 @@
   <div>
     <div class="topBox">
       <NavBar :go="{ type: 'push', path: '/menu' }" />
-           
+
       <van-row>
         <van-col span="24">
           <org-tree v-model="cascaderValue" :name="'sss'" @changeItem="getDataList"></org-tree>
@@ -76,7 +76,7 @@
         <van-panel :title="item.title" v-for="item in taskList" :key="item.id" class="card" status="状态">
           <template #header>
             <div class="titleClass">
-              <div class="title">{{ item.title }}</div>
+              <div class="title">{{ item.evaluateName }}</div>
               <div>
                 <van-button type="info" v-if="evaluateTure(item)" size="small" @click="evaluate(item.id)"
                   >评价</van-button
@@ -87,11 +87,12 @@
           <div>
             <div class="mainItem" @click="goInfo(item.id)">
               <div>评价状态</div>
-              <div>{{ item.orgName }}</div>
+              <div v-if="item.status=='0'" class="wj-title-blue">{{ item.status | statusList(this_) }}</div>
+              <div v-else class="wj-title-orange">{{ item.status | statusList(this_) }}</div>
             </div>
             <div class="mainItem" @click="goInfo(item.id)">
               <div>评价周期</div>
-              <div>{{ item.statusText }}</div>
+              <div>{{ item.startTime }}-{{ item.endTime }}</div>
             </div>
           </div>
         </van-panel>
@@ -117,7 +118,7 @@ export default {
       loading: false, //加载状态
       finished: false, //是否全部加载完毕
       evaluateName: '',
-
+      this_:this,
       orgName: JSON.parse(sessionStorage.getItem('SET_USER_ORGNAME')) || '', //机构名称
       cascaderValue: '', //机构ID
       show: false, //机构弹框显示隐藏
@@ -137,7 +138,7 @@ export default {
       statusValue: ' ', //状态值
       columns: ['全部'], //状态数组
       columnsList: [], //状态数组
-      currentDate: newDateDay(), //年份
+      currentDate: '', //年份
       conditionShow: false //机构弹框显示隐藏
     }
   },
@@ -160,6 +161,22 @@ export default {
     this.init()
     this.cascaderValue = JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + ''
   },
+  filters: {
+    statusList(val,this_) {
+      
+      if (this_.columnsList&&this_.columnsList.length>0&&val) {
+        let list =this_.columnsList.filter(item => item.dictValue == val)
+        if(list&&list.length>0 ){
+          return list[0].dictLabel
+        }else{
+          return ''
+        }
+         
+      } else {
+        return ''
+      }
+    }
+  },
   methods: {
     //机构搜索
     getDataList(val) {
@@ -278,7 +295,7 @@ export default {
 
     //评价
     evaluate(id) {
-      this.$router.push('/evaluate/' + id)
+      this.$router.push('/evaluate/' + id + '_add')
     },
 
     //跳转详情
@@ -365,4 +382,5 @@ export default {
   color: #323233;
   -webkit-text-fill-color: #323233;
 }
+
 </style>

+ 5 - 5
src/views/menu/training/index.vue

@@ -112,10 +112,10 @@
             </div>
             <div class="mainItem" @click="goInfo(item.id)">
               <div>培训状态</div>
-              <div v-if="item.status==0" :style="{'color':'#008cd6'}">{{ item.statusText }}</div>
-              <div v-else-if="item.status==1" :style="{'color':'#bc9f71'}">{{ item.statusText }}</div>
-              <div v-else-if="item.status==3" :style="{'color':'#d7000f'}">{{ item.statusText }}</div>
-              <div v-else :style="{'color':'#008cd6'}">{{ item.statusText }}</div>
+              <div v-if="item.status==0" class="wj-title-blue">{{ item.statusText }}</div>
+              <div v-else-if="item.status==1" class="wj-title-orange">{{ item.statusText }}</div>
+              <div v-else-if="item.status==3" class="wj-title-green">{{ item.statusText }}</div>
+              <div v-else class="wj-title-blue">{{ item.statusText }}</div>
             </div>
             
             <div class="mainItem">
@@ -148,7 +148,7 @@ import NavBar from '@/components/NavBar'
 import { Col, Row, Cascader, Dialog, DatetimePicker, Icon, Picker } from 'vant'
 import { gettrainingList, getsignUserList } from '@/api/training.js'
 import { deptTreeList } from '@/api/toConsult.js'
-import { Toast } from 'vant'
+
 import OrgTree from '@/components/orgTree'
 import { newDateMonth } from '@/utils/date.js'
 export default {