研发图纸文件管理系统-前端项目
he wei
2023-08-07 97fae68ef02a15bd654d002005d1ac22c2b160d6
U 软件由测试人员确认后 自动发邮件
1个文件已修改
50 ■■■■ 已修改文件
src/pages/resourceManage/software/list.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/software/list.vue
@@ -77,11 +77,7 @@
                    >更新说明</a-button
                  >
                  <a-button
                    v-if="
                      record.soft.lockFlag !== -1
                        ? canLock
                        : tester.some((v) => v == user.name)
                    "
                    v-if="record.soft.lockFlag !== -1 ? canLock : isTester"
                    type="primary"
                    @click="lock(record)"
                    >{{ record.soft.lockFlag ? "解锁" : "锁定" }}</a-button
@@ -232,6 +228,10 @@
} from "./apis";
import { mapGetters } from "vuex";
import EmailCard from "../../components/emailCard";
import {
  searchDefaultMailUser,
  sendMail,
} from "../../components/emailCard/apis";
// TODO
const tester = ["李桂华"];
@@ -240,6 +240,7 @@
  name: "",
  data() {
    return {
      mailList: [],
      tester,
      versionTime: moment().format("YYYY-MM-DD HH:mm:ss"),
      reasonVisible: false,
@@ -735,18 +736,27 @@
        if (code && data) {
          this.$message.success("操作成功");
          this.reasonVisible = false;
          // 如果是测试人员解锁确认 则自动发送邮件
          if (lockFlagNow == -1 && this.isTester) {
            this.sendEmail();
          }
          this.searchData();
        } else {
          this.$message.error("操作失败");
        }
      });
    },
    sendEmail() {
      let { title, content } = this.handleEmailShow(this.currentObj, true);
      let params = { mailList: this.mailList, title, content };
      sendMail(params);
    },
    lock(record) {
      this.reason = "";
      this.currentObj = record;
      this.reasonVisible = true;
    },
    handleEmailShow(record) {
    handleEmailShow(record, get) {
      this.emailInfo.title =
        "[软件发布记录]" +
        record.soft.fileName +
@@ -771,6 +781,12 @@
      });
      content.push("发布说明: " + soft.releaseNotes);
      this.emailInfo.content = content.join("\n");
      if (get) {
        return {
          title: this.emailInfo.title,
          content: content.join("\n"),
        };
      }
      this.emailShow = true;
    },
    emailCancel() {
@@ -782,11 +798,30 @@
          let rs = res.data;
          if (rs.code && rs.data) {
            this.userList = rs.data2;
            this.searchDefaultMailUser();
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
    searchDefaultMailUser() {
      // 软件 type为1
      let type = 1;
      searchDefaultMailUser(type).then((res) => {
        let rs = res.data;
        let data = [];
        if (rs.code === 1) {
          data = rs.data.map((item) => {
            return item.user;
          });
        }
        this.mailList = this.userList
          .filter((o) => data.includes(o.name) && o.mail)
          .map((item) => {
            return item.mail;
          });
      });
    },
  },
  watch: {
@@ -835,6 +870,9 @@
    canLock() {
      return checkPermit(PERMITS.lockOther, this.permits);
    },
    isTester() {
      return this.tester.some((v) => v == this.user.name);
    },
  },
  mounted() {
    this.searchData();