研发图纸文件管理系统-前端项目
he wei
2023-08-03 4b6a8636e0116e310872c0b8b8ea9547171dbde9
U 软件中心修改
1个文件已修改
156 ■■■■ 已修改文件
src/pages/resourceManage/software/list.vue 156 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/software/list.vue
@@ -29,8 +29,8 @@
              onShowSizeChange: onSizeChange,
            }"
          >
            <template slot="dataIndex" slot-scope="{index}">
              {{index+1}}
            <template slot="dataIndex" slot-scope="{ index }">
              {{ index + 1 }}
            </template>
            <template slot="title">
              <a-space>
@@ -71,16 +71,27 @@
                <a-space class="btn-grp" direction="vertical" slot="content">
                  <a-button
                    v-if="canUploadSoftware"
                    :disabled="!!record.soft.lockFlag"
                    :disabled="record.soft.lockFlag != -1"
                    type="primary"
                    @click="updateDesc(record)">更新说明</a-button>
                    @click="updateDesc(record)"
                    >更新说明</a-button
                  >
                  <a-button
                    v-if="canLock"
                    v-if="
                      record.soft.lockFlag !== -1
                        ? canLock
                        : tester.some((v) => v == user.name)
                    "
                    type="primary"
                    @click="lock(record)">{{ record.soft.lockFlag ? "解锁" : "锁定" }}</a-button>
                    @click="lock(record)"
                    >{{ record.soft.lockFlag ? "解锁" : "锁定" }}</a-button
                  >
                  <a-button
                      v-if="canUploadSoftware"
                    type="primary" @click="handleEmailShow(record)">邮件通知</a-button>
                    v-if="canUploadSoftware"
                    type="primary"
                    @click="handleEmailShow(record)"
                    >邮件通知</a-button
                  >
                </a-space>
                <a>更多</a>
              </a-popover>
@@ -188,8 +199,15 @@
      title="邮件发送"
      :destroyOnClose="true"
      :maskClosable="false"
      @cancel="emailCancel">
      <email-card :visible.sync="emailShow" :users="userList" :title="emailInfo.title" :content="emailInfo.content" v-if="emailShow"></email-card>
      @cancel="emailCancel"
    >
      <email-card
        :visible.sync="emailShow"
        :users="userList"
        :title="emailInfo.title"
        :content="emailInfo.content"
        v-if="emailShow"
      ></email-card>
    </a-modal>
  </div>
</template>
@@ -202,7 +220,7 @@
import Pop from "./pop";
import offset from "@/assets/js/tools/offset";
import moment from "moment";
import {getUserList} from "../../permission/apis";
import { getUserList } from "../../permission/apis";
import {
  getList,
@@ -215,10 +233,13 @@
import { mapGetters } from "vuex";
import EmailCard from "../../components/emailCard";
const tester = ["李桂华"];
export default {
  name: "",
  data() {
    return {
      tester,
      versionTime: moment().format("YYYY-MM-DD HH:mm:ss"),
      reasonVisible: false,
      reason: "",
@@ -253,6 +274,37 @@
          width: 60,
          noSearch: true,
          scopedSlots: { customRender: "dataIndex" },
        },
        {
          title: "状态",
          dataIndex: "soft.lockFlag",
          dataType: "select",
          align: "center",
          width: 140,
          visible: false,
          searchAble: true,
          noSearch: true,
          search: {
            selectOptions: [
              {
                title: "全部",
                value: 11,
              },
              {
                title: "可用",
                value: 0,
              },
              {
                title: "不可用",
                value: 12,
              },
              {
                title: "待测试",
                value: -1,
              },
            ],
          },
          // customCell: this.customCell,
        },
        {
          title: "名称",
@@ -348,9 +400,9 @@
      emailShow: false,
      emailInfo: {
        title: "",
        content: ""
        content: "",
      },
      userList: []
      userList: [],
    };
  },
  components: {
@@ -366,8 +418,8 @@
      return current > moment().endOf("day");
    },
    onSearch(conditions, searchOptions) {
      // console.log(conditions);
      // console.log(searchOptions);
      console.log(conditions);
      console.log(searchOptions, "options");
      this.pageCurr = 1;
      this.conditions = conditions;
      this.searchData();
@@ -387,14 +439,21 @@
      this.searchData();
    },
    onReset(conditions) {
      console.log(conditions, "reset");
      this.conditions = conditions;
      this.searchData();
    },
    searchData() {
      const { pageCurr, pageSize, conditions } = this;
      let params = {};
      if (undefined == conditions["soft.lockFlag"]) {
        conditions["soft.lockFlag"] = 11;
      }
      Object.keys(conditions).forEach((v) => {
        switch (v) {
          case "soft.lockFlag":
            params["lockFlag"] = conditions[v];
            break;
          case "soft.fileName":
            params["fileName"] = conditions[v];
            break;
@@ -539,10 +598,10 @@
        return false;
      }
      let info = this.resData[0];
      if(!info.boardNumber || !info.type) {
      if (!info.boardNumber || !info.type) {
        this.$error({
          title: '系统提示',
          content: '缺少板号或软件类型,请输入板号和软件类型',
          title: "系统提示",
          content: "缺少板号或软件类型,请输入板号和软件类型",
        });
        return false;
      }
@@ -684,42 +743,47 @@
      this.reasonVisible = true;
    },
    handleEmailShow(record) {
      this.emailInfo.title = "[软件发布记录]"+record.soft.fileName+" 版本号:"+record.soft.version;
      let {
        soft,
        links
      } = record;
      this.emailInfo.title =
        "[软件发布记录]" +
        record.soft.fileName +
        " 版本号:" +
        record.soft.version;
      let { soft, links } = record;
      let content = [];
      content.push('软件基本信息');
      content.push('文件名称: ' + soft.fileName);
      content.push('板号: ' + soft.boardNumber);
      content.push('软件类型: ' + soft.type);
      content.push('软件版本: ' + soft.version);
      content.push('软件基于版本: ' + soft.basedVersion);
      content.push('软件负责人: ' + soft.owner);
      content.push('归档日期: ' + soft.filingDate);
      content.push('软件类型: ' + soft.type);
      content.push('软件适用机型');
      content.push("软件基本信息");
      content.push("文件名称: " + soft.fileName);
      content.push("板号: " + soft.boardNumber);
      content.push("软件类型: " + soft.type);
      content.push("软件版本: " + soft.version);
      content.push("软件基于版本: " + soft.basedVersion);
      content.push("软件负责人: " + soft.owner);
      content.push("归档日期: " + soft.filingDate);
      content.push("软件类型: " + soft.type);
      content.push("软件适用机型");
      links.forEach((v) => {
        content.push('物料编码: ' + v.applyMaterialCode + ' 规格型号: ' + v.applyModel);
        content.push(
          "物料编码: " + v.applyMaterialCode + " 规格型号: " + v.applyModel
        );
      });
      content.push('发布说明: ' + soft.releaseNotes);
      this.emailInfo.content = content.join('\n');
      content.push("发布说明: " + soft.releaseNotes);
      this.emailInfo.content = content.join("\n");
      this.emailShow = true;
    },
    emailCancel() {
      this.emailShow = false;
    },
    searchAllUserList() {
      getUserList().then(res=>{
        let rs = res.data;
        if(rs.code && rs.data) {
          this.userList = rs.data2;
        }
      }).catch(error=>{
        console.log(error);
      })
    }
      getUserList()
        .then((res) => {
          let rs = res.data;
          if (rs.code && rs.data) {
            this.userList = rs.data2;
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
  },
  watch: {
    update(n) {
@@ -756,7 +820,7 @@
    },
  },
  computed: {
    ...mapGetters("account", ["permits"]),
    ...mapGetters("account", ["permits", "user"]),
    ...mapGetters("setting", ["affixed"]),
    canUploadSoftware() {
      return checkPermit(PERMITS.uploadSoftware, this.permits);