15179599649
2023-12-19 b6f05aa0808a440f20f65ca579b67c73c66c9a61
'添加留言'
10 files modified
1 files added
396 ■■■■ changed files
public/images/close.png patch | view | raw | blame | history
src/api/hfiveget/index.js 53 ●●●●● patch | view | raw | blame | history
src/router/axios.js 1 ●●●● patch | view | raw | blame | history
src/views/Addmessage/index.vue 45 ●●●● patch | view | raw | blame | history
src/views/Appraising/index.vue 23 ●●●● patch | view | raw | blame | history
src/views/Checkandassess/index.vue 1 ●●●● patch | view | raw | blame | history
src/views/examine/index.vue 2 ●●● patch | view | raw | blame | history
src/views/login/index.vue 10 ●●●●● patch | view | raw | blame | history
src/views/message/index.vue 77 ●●●● patch | view | raw | blame | history
src/views/toAppraising/index.vue 146 ●●●● patch | view | raw | blame | history
src/views/toexamine/index.vue 38 ●●●●● patch | view | raw | blame | history
public/images/close.png
src/api/hfiveget/index.js
@@ -25,8 +25,8 @@
//登录
export const Loginto = (params) => {
    return request({
        url: "/api/blade-auth/oauth/token",
        // url: '/api/blade-auth/oauth/token?tenantId=000000&username=' + params + '&password=21232f297a57a5a743894a0e4a801fc3&grant_type=password&scope=all&type=account',
        // url: "/api/blade-auth/oauth/token",
        url: '/api/blade-auth/oauth/token?tenantId=000000&username=' + params + '&password=21232f297a57a5a743894a0e4a801fc3&grant_type=password&scope=all&type=account',
        method: "post",
        apiKey: true,
        params: {
@@ -99,8 +99,57 @@
        url: "/api/evaluate/evaluateTask/taskList/" + params.dept_id + "/" + params.user_id,
        method: "get",
        apiKey: true,
        data: {
            ...params,
        },
    });
};
// 获取所有部门
export const deptlistAll = (params) => {
    return request({
        url: "/api/blade-system/dept/listAll",
        method: "get",
        apiKey: true,
        params: {
            ...params,
        },
    });
};
// 提交评优结果
export const evaluateResult = (params) => {
    return request({
        url: "/api/evaluate/evaluateResult/submit ",
        method: "post",
        apiKey: true,
        data: {
            ...params,
        },
    });
};
// 发布留言
export const leaveWords = (params) => {
    return request({
        url: "/api/leave/leaveWords/submit",
        method: "post",
        apiKey: true,
        data: {
            ...params,
        },
    });
};
// 图片上传
export const endpoint = (data) => {
    return request({
        url: "/api/blade-resource/oss/endpoint/put-file",
        method: "post",
        apiKey: true,
        data
    });
};
src/router/axios.js
@@ -63,6 +63,7 @@
        router.push("/login");
      }, 1000);
    }
    console.log(res)
    return res;
  },
  (error) => {
src/views/Addmessage/index.vue
@@ -1,4 +1,4 @@
<!--留言-->
<!--添加留言-->
<template>
  <div class="Addmessage">
    <van-cell-group inset>
@@ -13,24 +13,32 @@
      />
    </van-cell-group>
    <div class="my-uploader">
      <van-uploader v-model="fileList" multiple />
      <van-uploader
        v-model="fileList"
        multiple
        :after-read="afterread"
        :before-delete="beforedelete"
      />
    </div>
    <div class="attention">
      <img src="images/attention.png" />
      <span>请勿涉及不文明及违规内容,违法必究!</span>
    </div>
    <div class="bottom">
      <van-button type="primary" @click="submit">提交</van-button>
      <van-button type="primary" @click="submit()">添加留言</van-button>
    </div>
  </div>
</template>
              
    <script>
<script>
import { leaveWords, endpoint } from "@/api/hfiveget/index.js";
export default {
  data() {
    return {
      messagecom: "",
      fileList: []
      fileindex: null,
      fileList: [],
      submitlist: []
    };
  },
  mounted() {
@@ -39,9 +47,32 @@
  computed: {},
  created() {},
  methods: {
    // 上传图片后的操作
    afterread({ file }) {
      const formdata = new FormData();
      formdata.append("file", file);
      endpoint(formdata).then(res => {
        this.submitlist.push(res.data.data.link);
      });
    },
    // 删除图片前的操作
    beforedelete(file, filelist) {
      this.submitlist.splice(filelist.index, 1);
      this.fileList.splice(filelist.index, 1);
    },
    submit() {
      this.$router.push({
        path: "/"
      let toData = {
        userName: localStorage.getItem("nick_name"),
        deptName: localStorage.getItem("dept_name"),
        userPost: localStorage.getItem("post_name"),
        content: this.messagecom,
        imageUrls: this.submitlist.join(",")
      };
      leaveWords(toData).then(res => {
        setTimeout(() => {
          this.$router.push("/");
        }, 1000);
        this.$toast.success("添加成功");
      });
    }
  }
src/views/Appraising/index.vue
@@ -5,8 +5,8 @@
      <p class="TaskNumber">
        <span>{{item.type==0?'公司评优(部门候选人评定)':'部门评优'}}</span>
        <span
          :class="item.taskType=='优秀员工'?'evaluationget':'evaluation'"
        >{{item.taskType=='优秀员工'?'待完成 ':'待完成'}}</span>
          :class="item.isEvaluateOk==false?'evaluation':'evaluationget'"
        >{{item.isEvaluateOk==false?'待完成 ':'已完成'}}</span>
      </p>
      <p class="Tasktime">
        <span>评优任务名称:</span>
@@ -24,7 +24,8 @@
        <span>截止日期:</span>
        <span>{{item.evaluateCutoffTime}}</span>
      </p>
      <van-button @click="toAppraising(item)">去评优</van-button>
      <van-button @click="toAppraising(item)" v-show="item.isEvaluateOk==false">去评优</van-button>
      <p class="details" @click="toAppraising(item)" v-show="item.isEvaluateOk==true">查看详情</p>
    </div>
    <div class="not" v-show="ViewData.length==0">
      <img src="images/notdata.png" />
@@ -54,7 +55,16 @@
        dept_id: localStorage.getItem("dept_id")
      };
      evaluateTask(data).then(res => {
        this.ViewData = res.data.data;
        this.ViewData = res.data.data.records;
        this.ViewData.sort((a, b) => {
          if (a.isEvaluateOk && !b.isEvaluateOk) {
            return 1; // a排在b之前
          } else if (!a.isEvaluateOk && b.isEvaluateOk) {
            return -1; // b排在a之前
          } else {
            return 0; // 顺序不变
          }
        });
      });
    },
    toAppraising(item) {
@@ -122,6 +132,11 @@
      background: linear-gradient(163deg, #01bdfc 0%, #017bfc 100%);
      border-radius: 8px;
    }
    .details {
      font-size: 16px;
      color: #8894a8;
      text-align: right;
    }
  }
  .not {
    img {
src/views/Checkandassess/index.vue
@@ -37,7 +37,6 @@
    getTaskData() {
      let toUserId = localStorage.getItem("tokensave");
      listGroupByTask(toUserId).then(res => {
        console.log(res.data.data);
        this.ViewData = res.data.data;
      });
    }
src/views/examine/index.vue
@@ -25,7 +25,7 @@
        <span>对({{item.assessmentTaskVO.type==0?item.userName:item.deptName}})进行评分</span>
      </p>
      <van-button @click="toexamine(item)" v-show="item.assessmentScoreVO==null">去评分</van-button>
      <p class="read" v-show="item.assessmentScoreVO!=null" @click="toexamine(item)">查看评分</p>
      <p class="read" v-show="item.assessmentScoreVO!=null" @click="toexamine(item)">查看详情</p>
    </div>
    <div class="not" v-show="ViewData.length==0">
      <img src="images/notdata.png" />
src/views/login/index.vue
@@ -95,17 +95,19 @@
          phone: this.username,
          code: this.Code
        };
        Loginto(Data).then(res => {
        Loginto(Data.phone).then(res => {
          if (res.data.code == 400) {
            this.$toast.fail(res.data.msg);
          } else {
            setTimeout(() => {
              this.$router.push("/");
            }, 1000);
            console.log(res.data);
            localStorage.setItem("Appraising", "message");
            localStorage.setItem("tokensave", res.data.user_id);
            localStorage.setItem("dept_id", res.data.dept_id);
            localStorage.setItem("tokensave", res.data.user_id); //用户id
            localStorage.setItem("dept_id", res.data.dept_id); //部门id
            localStorage.setItem("nick_name", res.data.nick_name); //姓名
            localStorage.setItem("dept_name", res.data.dept_name); //部门
            localStorage.setItem("post_name", res.data.post_name); //职位
            setToken(res.data.access_token);
            this.$toast.success("登录成功");
          }
src/views/message/index.vue
@@ -27,15 +27,6 @@
        />
      </p>
      <!-- 评论区域 -->
      <!-- <div class="tocomments">
        <p>
          <img src="images/Anonymouscomments.png" />
          <span>匿名评论</span>
          <img src="images/Anonymouscomments.png" />
          <span>评论</span>
        </p>
      </div>-->
      <!-- 评论区域 -->
      <div class="comment">
        <p>
          <span class="name">匿名用户:</span>
@@ -46,13 +37,21 @@
          <span class="comin">可以的,确实可以哦</span>
        </p>
        <div class="tocomment">
          <van-field v-model="value" placeholder="说点什么吧" />
          <van-uploader>
            <img src="images/pic.png" class="pic" />
          </van-uploader>
          <img src="images/anonymous.png" class="anonymous" />
          <div class="notanonymous" v-show="isshownotnm">
            <img src="images/notanonymous.png" />
          <div class="imgurl">
            <span v-for="(item,index) in imageData" :key="item">
              <img :src="item" class="toimg" />
              <img src="images/close.png" class="close" @click="closeimg(index)" />
            </span>
          </div>
          <div class="tocomment_in">
            <van-field v-model="value" placeholder="说点什么吧" />
            <van-uploader :after-read="afterread">
              <img src="images/pic.png" class="pic" />
            </van-uploader>
            <img src="images/anonymous.png" class="anonymous" />
            <div class="notanonymous" v-show="isshownotnm">
              <img src="images/notanonymous.png" />
            </div>
          </div>
        </div>
      </div>
@@ -62,12 +61,14 @@
</template>
  
<script>
import { endpoint } from "@/api/hfiveget/index.js";
import { ImagePreview } from "vant";
export default {
  data() {
    return {
      inputValue: "",
      isshownotnm: true,
      imageData: [],
      imageUrls: [
        "https://img1.baidu.com/it/u=4049022245,514596079&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1702054800&t=f78ab44b6c79d50010356b808487b695",
        "https://img0.baidu.com/it/u=3368678403,249914024&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1702054800&t=46a3ab3b84070007415537fac57564cc",
@@ -83,6 +84,18 @@
      localStorage.getItem("tokensave") == "111" ? false : true;
  },
  methods: {
    // 删除图片
    closeimg(index) {
      this.imageData.splice(index, 1);
    },
    // 图片上传
    afterread({ file }) {
      const formdata = new FormData();
      formdata.append("file", file);
      endpoint(formdata).then(res => {
        this.imageData.push(res.data.data.link);
      });
    },
    // 图片预览
    previewImages(index) {
      ImagePreview({
@@ -169,7 +182,6 @@
    }
  }
  .comment {
    // background: #f4f5f7;
    padding: 10px;
    font-size: 16px;
    p {
@@ -179,11 +191,34 @@
      color: #4a80ea;
    }
    .tocomment {
      display: flex;
      align-items: center;
      margin-top: 10px;
      background: #f4f5f7;
      padding: 5px;
      margin-top: 5px;
      .imgurl {
        span {
          width: 60px;
          height: 60px;
          margin: 0px 4px 4px 0px;
          display: inline-block;
          position: relative;
          .toimg {
            width: 60px;
            height: 60px;
          }
          .close {
            width: 20px;
            height: 20px;
            position: absolute;
            top: -5px;
            right: -5px;
          }
        }
      }
      .tocomment_in {
        display: flex;
        align-items: center;
        padding: 5px;
      }
      .van-cell {
        background: none;
        font-size: 20px;
src/views/toAppraising/index.vue
@@ -15,32 +15,45 @@
        <span>认定标准描述:</span>
        <span>{{this.poepleinfo.remark}}</span>
      </p>
      <div class="toin">
        <van-field
          v-model="currentValue"
          is-link
          readonly
          label="请选择:"
          placeholder="选择人员"
          @click="showPicker = true"
          class="van-hairline"
        />
        <p class="Reasons">评选理由:</p>
        <van-field
          class="van-borderline"
          v-model="Reasonsin"
          rows="5"
          type="textarea"
          placeholder="请输入对该评选人的评选理由..."
        />
      <p class="info">
        <span>截止日期:</span>
        <span>{{this.poepleinfo.evaluateCutoffTime}}</span>
      </p>
      <div v-if="poepleinfo.isEvaluateOk == false">
        <div class="toin">
          <van-field
            v-model="currentValue"
            is-link
            readonly
            label="请选择:"
            placeholder="请选择"
            @click="showPicker = true"
            class="van-hairline"
          />
          <p class="Reasons">评选理由:</p>
          <van-field
            class="van-borderline"
            v-model="toData.remark"
            rows="5"
            type="textarea"
            placeholder="请输入评选理由..."
          />
        </div>
        <van-button @click="SubmitTo()">提交</van-button>
      </div>
      <van-button @click="SubmitTo(item)">提交</van-button>
      <div class="showdetails" v-else>
        <p class="title">评选{{this.poepleinfo.type==0?"人":"部门"}}</p>
        <p class="fraction">{{toshow.name}}</p>
        <p class="title">评选说明</p>
        <p class="instruct">{{toshow.remark==''?'无':toshow.remark}}</p>
      </div>
    </div>
    <van-popup v-model="showPicker" round position="bottom">
      <van-picker
        show-toolbar
        @cancel="showPicker = false"
        @confirm="onConfirm"
        :value-key="pickerkey"
        :columns="columns"
        v-model="currentValue"
      />
@@ -50,34 +63,90 @@
          
<script>
import { Picker } from "vant";
import { deptlistAll, evaluateResult } from "@/api/hfiveget/index.js";
export default {
  data() {
    return {
      showPicker: false,
      pickerkey: "",
      currentValue: "", // 用于绑定选择结果的变量
      columns: ["张三", "李四", "王五"], // 选择器的选项列表
      poepleinfo: {}
      columns: [], // 选择器的选项列表
      poepleinfo: {},
      toData: {},
      toshow: {}
    };
  },
  computed: {},
  mounted() {
    localStorage.setItem("Appraising", "Appraising");
  },
  created() {
    this.poepleinfo = JSON.parse(this.$route.query.info);
    console.log(this.poepleinfo);
    this.toData.scoreUserId = localStorage.getItem("tokensave");
    this.toData.evaluateTaskId = this.poepleinfo.id; //任务id
    this.toData.type = this.poepleinfo.type;
    // 部门候选人评定进行选择
    if (this.poepleinfo.type == 0) {
      let index = this.poepleinfo.selfCandidate.findIndex(
        item => item.id === localStorage.getItem("tokensave")
      );
      if (index !== -1) {
        this.poepleinfo.selfCandidate.splice(index, 1);
      }
      this.pickerkey = "name";
      this.columns = this.poepleinfo.selfCandidate;
      if (this.poepleinfo.isEvaluateOk == true) {
        this.columns.forEach(item => {
          if (item.id == this.poepleinfo.evaluateResultVO.beId) {
            this.toshow = {
              name: item.name,
              remark: this.poepleinfo.evaluateResultVO.remark
            };
          }
        });
      }
    }
    //对部门进行选择评优
    else if (this.poepleinfo.type == 1) {
      deptlistAll().then(res => {
        this.pickerkey = "deptName";
        this.columns = res.data.data;
        if (this.poepleinfo.isEvaluateOk == true) {
          this.columns.forEach(item => {
            if (item.id == this.poepleinfo.evaluateResultVO.beId) {
              this.toshow = {
                name: item.deptName,
                remark: this.poepleinfo.evaluateResultVO.remark
              };
            }
          });
        }
      });
    }
  },
  methods: {
    onConfirm(select) {
      this.currentValue = select;
      // 选择评选人或评选部门
      if (this.pickerkey == "deptName") {
        this.currentValue = select.deptName;
      } else if (this.pickerkey == "name") {
        this.currentValue = select.name;
      }
      this.toData.beId = select.id;
      this.showPicker = false;
    },
    //提交
    SubmitTo() {
      this.$router.push({
        path: "/"
      });
      if (this.toData.beId == undefined) {
        this.$toast.fail("请选择评优项");
      } else {
        evaluateResult(this.toData).then(res => {
          setTimeout(() => {
            this.$router.push("/");
          }, 1000);
          this.$toast.success("评选完成");
        });
      }
    }
  }
};
@@ -92,6 +161,7 @@
  .Beingevaluated {
    background: white;
    padding: 20px;
    height: 100%;
    .title {
      font-size: 18px;
      font-weight: bold;
@@ -125,6 +195,7 @@
      }
      .van-borderline {
        border: 1px solid #dee1e7;
        font-weight: 100;
        border-radius: 8px;
        padding: 5px;
      }
@@ -136,6 +207,27 @@
      background: linear-gradient(163deg, #01bdfc 0%, #017bfc 100%);
      border-radius: 8px;
    }
    .showdetails {
      font-size: 20px;
      line-height: 20px;
      .title {
        text-align: center;
        font-size: 20px;
        font-weight: bold;
        margin: 20px;
      }
      .fraction {
        font-size: 30px;
        text-align: center;
        color: #017bfc;
        font-weight: bold;
      }
      .instruct {
        color: #999999;
        font-size: 16px;
        text-align: center;
      }
    }
  }
}
</style>
src/views/toexamine/index.vue
@@ -95,12 +95,16 @@
          weight: this.poepleinfo.weight,
          rangeVal: this.poepleinfo.rangeVal
        };
        assessmentScore(Data).then(res => {
          setTimeout(() => {
            this.$router.push("/");
          }, 1000);
          this.$toast.success("评分成功");
        });
        if (Data.scoreVal == "") {
          this.$toast.fail("请输入评分");
        } else {
          assessmentScore(Data).then(res => {
            setTimeout(() => {
              this.$router.push("/");
            }, 1000);
            this.$toast.success("评分成功");
          });
        }
      }
    }
  }
@@ -176,17 +180,17 @@
  .showdetails {
    font-size: 20px;
    line-height: 20px;
  }
  .fraction {
    font-size: 30px;
    text-align: center;
    color: #017bfc;
    font-weight: bold;
  }
  .instruct {
    color: #999999;
    font-size: 14px;
    text-align: center;
    .fraction {
      font-size: 30px;
      text-align: center;
      color: #017bfc;
      font-weight: bold;
    }
    .instruct {
      color: #999999;
      font-size: 14px;
      text-align: center;
    }
  }
}
</style>