研发图纸文件管理系统-前端项目
longyvfengyun
2022-10-18 75fe3da78dda8c76f79cdb98dc4ac10ced61b7e1
前端提交
3个文件已添加
6个文件已修改
374 ■■■■ 已修改文件
src/pages/components/emailCard/apis.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/emailCard/emailCard.vue 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/emailCard/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/materialsCenter/list.vue 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/list.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/software/list.vue 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/software/pop.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/user/components/userInfo.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/user/list.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/emailCard/apis.js
New file
@@ -0,0 +1,14 @@
import axios from "@/assets/axios";
/**
 * 发送邮件
 * @param data
 * @returns {*}
 */
export const sendMail = (data) => {
  return axios({
    method: "POST",
    url: "mail/sendMail",
    data
  })
}
src/pages/components/emailCard/emailCard.vue
New file
@@ -0,0 +1,146 @@
<template>
  <a-form-model ref="formRef" :model="form" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
    <a-form-model-item label="收件人:" prop="mailList">
      <a-select
          mode="multiple"
          placeholder=""
          :value="selectedItems"
          style="width: 100%"
          allow-clear
          @change="handleChange">
        <a-select-option v-for="item in filteredOptions" :key="item.name" :value="item.name" :disabled="!item.isHasMail">
          {{ item.name }}
        </a-select-option>
      </a-select>
    </a-form-model-item>
    <a-form-model-item label="主题:" prop="title">
      <a-input v-model="form.title" allow-clear></a-input>
    </a-form-model-item>
    <a-form-model-item label="邮件内容:" prop="content">
      <a-textarea v-model="form.content"  allow-clear :rows="6"></a-textarea>
    </a-form-model-item>
    <div class="email-footer">
      <a-button type="primary" @click="checkForm">确认发送</a-button>
    </div>
  </a-form-model>
</template>
<script>
import {sendMail} from "./apis";
export default {
  name: "emailCard",
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    users: {
      type: Array,
      default() {
        return [];
      }
    },
    title: {
      type: [String, Number],
      default: ""
    },
    content: {
      type: [String, Number],
      default: ""
    }
  },
  data() {
    return {
      labelCol: { span: 3 },
      wrapperCol: { span: 21 },
      form: {
        mailList: [],
        title: "",
        content: "",
      },
      rules: {
        mailList: [
          {
            required: true,
            message: "请选择角色",
            trigger: "blur",
          },
        ],
        title: [
          {
            required: true,
            message: "请输入邮件标题",
            trigger: "blur",
          },
        ],
        content: [
          {
            required: true,
            message: "请输入邮件内容",
            trigger: "blur",
          },
        ],
      },
      selectedItems: [],
    };
  },
  computed: {
    filteredOptions() {
      let users = this.users;
      return users.filter(o => !this.selectedItems.includes(o.name)).map(o=> {
        o.isHasMail = o.mail?true:false;
        return o;
      });
    },
  },
  methods: {
    handleChange(selectedItems) {
      this.selectedItems = selectedItems;
      let users = this.users;
      let mailList = users.filter(o => this.selectedItems.includes(o.name)).map(item=>{
        return item.mail;
      });
      this.form.mailList = mailList;
    },
    checkForm() {
      this.$refs.formRef.validate((valid) => {
        if (!valid) {
          this.$message.error("存在未通过检验的表单项");
          return false;
        } else {
          this.sendEmail();
        }
      });
    },
    sendEmail() {
      let {mailList, title, content} = this.form;
      let params = {mailList, title, content};
      let loading = this.$layer.loading();
      sendMail(params).then(res=>{
        this.$layer.close(loading);
        let rs = res.data;
        if(rs.code == 1) {
          this.$emit('update:visible', false);
          this.$message.success("邮件发送成功!");
        }else {
          this.$message.error(rs.msg);
        }
      }).catch(error=>{
        this.$layer.close(loading);
        console.log(error);
        this.$message.error("邮件发送失败,请检查网络!");
      });
    }
  },
  mounted() {
    this.form.title = this.title;
    this.form.content = this.content;
  }
}
</script>
<style scoped>
.email-footer {
  text-align: right;
}
</style>
src/pages/components/emailCard/index.js
New file
@@ -0,0 +1,2 @@
import emailCard from "./emailCard";
export default emailCard;
src/pages/resourceManage/materialsCenter/list.vue
@@ -15,7 +15,7 @@
            @refresh="onRefresh"
            @reset="onReset"
            :format-conditions="true"
            :scroll="{ x: 2500, y }"
            :scroll="{ x: 1360, y }"
            :pagination="{
              current: pageCurr,
              pageSize: pageSize,
@@ -209,14 +209,14 @@
      webUrl: getWebUrl(),
      conditions: {},
      columns: [
        {
          title: "类别",
          dataIndex: "category",
          key: "category",
          align: "center",
          width: 80,
          searchAble: true,
        },
        // {
        //   title: "类别",
        //   dataIndex: "category",
        //   key: "category",
        //   align: "center",
        //   width: 80,
        //   searchAble: true,
        // },
        {
          title: "编码",
          dataIndex: "subCode",
@@ -229,7 +229,6 @@
          title: "型号",
          dataIndex: "subModel",
          key: "subModel",
          width: 180,
          searchAble: true,
          align: "center",
        },
@@ -238,7 +237,6 @@
          dataIndex: "subName",
          key: "subName",
          align: "center",
          width: 180,
          searchAble: true,
        },
        {
@@ -249,61 +247,61 @@
          width: 80,
          noSearch: true,
        },
        {
          title: "生产商",
          dataIndex: "producer",
          key: "producer",
          align: "center",
          width: 80,
          noSearch: true,
        },
        {
          title: "元件编号/料厚",
          dataIndex: "thickness",
          key: "thickness",
          align: "center",
          noSearch: true,
          width: 180,
        },
        {
          title: "表面处理/物料详情",
          dataIndex: "surfaceDetail",
          key: "surfaceDetail",
          align: "center",
          noSearch: true,
          width: 180,
        },
        {
          title: "备注",
          dataIndex: "notes",
          key: "notes",
          align: "center",
          noSearch: true,
        },
        // {
        //   title: "生产商",
        //   dataIndex: "producer",
        //   key: "producer",
        //   align: "center",
        //   width: 80,
        //   noSearch: true,
        // },
        // {
        //   title: "元件编号/料厚",
        //   dataIndex: "thickness",
        //   key: "thickness",
        //   align: "center",
        //   noSearch: true,
        //   width: 180,
        // },
        // {
        //   title: "表面处理/物料详情",
        //   dataIndex: "surfaceDetail",
        //   key: "surfaceDetail",
        //   align: "center",
        //   noSearch: true,
        //   width: 180,
        // },
        // {
        //   title: "备注",
        //   dataIndex: "notes",
        //   key: "notes",
        //   align: "center",
        //   noSearch: true,
        // },
        {
          title: "图片",
          dataIndex: "pictureUrl",
          key: "pictureUrl",
          align: "center",
          noSearch: true,
          width: 120,
          width: 200,
          scopedSlots: { customRender: "pictureUrl" },
        },
        {
          title: "上传人",
          dataIndex: "upUser",
          key: "upUser",
          align: "center",
          noSearch: true,
        },
        {
          title: "创建时间",
          dataIndex: "createDate",
          key: "createDate",
          align: "center",
          width: 160,
          noSearch: true,
        },
        // {
        //   title: "上传人",
        //   dataIndex: "upUser",
        //   key: "upUser",
        //   align: "center",
        //   noSearch: true,
        // },
        // {
        //   title: "创建时间",
        //   dataIndex: "createDate",
        //   key: "createDate",
        //   align: "center",
        //   width: 160,
        //   noSearch: true,
        // },
        {
          title: "操作",
          dataIndex: "operation",
src/pages/resourceManage/product/list.vue
@@ -951,8 +951,8 @@
     * @returns {{ab: *[], error: *[]}}
     */
    getAbAndError(list) {
      let ab = ['0101', '0102', '0103', '0105'];
      let error = ['0104', '0106'];
      let ab = ['0101', '0102', '0103', '0105', '0106'];
      let error = ['0104'];
      let result = {
        ab: [],
        error: []
src/pages/resourceManage/software/list.vue
@@ -70,15 +70,14 @@
                    v-if="canUploadSoftware"
                    :disabled="!!record.soft.lockFlag"
                    type="primary"
                    @click="updateDesc(record)"
                    >更新说明</a-button
                  >
                    @click="updateDesc(record)">更新说明</a-button>
                  <a-button
                    v-if="canLock"
                    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>
                </a-space>
                <a>更多</a>
              </a-popover>
@@ -177,6 +176,18 @@
        />
      </a-form-model-item>
    </a-modal>
    <!-- 上传软件 -->
    <a-modal
      :visible="emailShow"
      :footer="null"
      :width="760"
      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>
    </a-modal>
  </div>
</template>
@@ -188,6 +199,7 @@
import Pop from "./pop";
import offset from "@/assets/js/tools/offset";
import moment from "moment";
import {getUserList} from "../../permission/apis";
import {
  getList,
@@ -198,6 +210,7 @@
  updateSoftwareLock,
} from "./apis";
import { mapGetters } from "vuex";
import EmailCard from "../../components/emailCard/";
export default {
  name: "",
@@ -319,9 +332,16 @@
          noSearch: true,
        },
      ],
      emailShow: false,
      emailInfo: {
        title: "",
        content: ""
      },
      userList: []
    };
  },
  components: {
    EmailCard,
    AdvanceTable,
    DescRes,
    Pop,
@@ -642,6 +662,24 @@
      this.currentObj = record;
      this.reasonVisible = true;
    },
    handleEmailShow(record) {
      this.emailInfo.title = "[软件发布记录]"+record.soft.fileName+" 版本号:"+record.soft.version;
      this.emailInfo.content = record.soft.releaseNotes;
      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);
      })
    }
  },
  watch: {
    update(n) {
@@ -692,6 +730,7 @@
  },
  mounted() {
    this.searchData();
    this.searchAllUserList();
    window.addEventListener("resize", this.resize);
  },
  destroyed() {
src/pages/resourceManage/software/pop.vue
@@ -50,10 +50,10 @@
  },
  methods: {
    onMouseenter() {
      this.visible = true;
      this.$emit('update:visible', true);
    },
    onMouseleave() {
      this.visible = false;
      this.$emit('update:visible', false);
    }
  },
src/pages/user/components/userInfo.vue
@@ -72,6 +72,19 @@
              </a-col>
              <a-col :span="24">
                <a-form-model-item
                    label="邮箱"
                    :labelCol="{ span: 5 }"
                    :wrapperCol="{ span: 18, offset: 1 }"
                    prop="mail"
                >
                  <a-input
                      v-model="info.mail"
                      placeholder="请输入用户邮箱"
                  />
                </a-form-model-item>
              </a-col>
              <a-col :span="24">
                <a-form-model-item
                  label="部门"
                  :labelCol="{ span: 5 }"
                  :wrapperCol="{ span: 18, offset: 1 }"
@@ -136,6 +149,7 @@
  id: "",
  tel: "",
  phone: "",
  mail: "",
  departId: undefined,
  faceId: "",
  roleId: undefined,
@@ -195,6 +209,18 @@
          {
            pattern: /^1\d{10}$/,
            message: "请输入正确的手机号",
            trigger: "blur",
          },
        ],
        mail: [
          {
            required: true,
            message: "邮箱必填",
            trigger: "blur",
          },
          {
            pattern: /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/,
            message: "请输入正确的邮箱地址",
            trigger: "blur",
          },
        ],
@@ -264,15 +290,15 @@
    },
    submit() {
      let formData = new FormData();
      let { id, tel, phone, departId, faceId, roleId, name } = this.info;
      let { id, tel, phone, mail, departId, faceId, roleId, name } = this.info;
      let params = {};
      let operation;
      if (this.isEdit) {
        operation = editUser;
        params = { id, tel, phone, departId, faceId, roleId };
        params = { id, tel, phone, mail, departId, faceId, roleId };
      } else {
        operation = addUser;
        params = { name, tel, phone, departId, faceId, roleId };
        params = { name, tel, phone, mail, departId, faceId, roleId };
      }
      let json = JSON.stringify(params);
      // console.log(json);
src/pages/user/list.vue
@@ -10,7 +10,7 @@
          :data-source="dataSource"
          :loading="loading"
          rowKey="id"
          :scroll="{ x: 1900, y }"
          :scroll="{ x: 1800, y }"
          @search="onSearch"
          @refresh="onRefresh"
          :format-conditions="true"
@@ -102,6 +102,11 @@
          dataIndex: "phone",
        },
        {
          title: "邮箱",
          searchAble: true,
          dataIndex: "mail",
        },
        {
          title: "部门",
          dataIndex: ["depart", "departName"],
          key: "departName",