New file |
| | |
| | | import axios from "@/assets/axios"; |
| | | |
| | | /** |
| | | * 发送邮件 |
| | | * @param data |
| | | * @returns {*} |
| | | */ |
| | | export const sendMail = (data) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "mail/sendMail", |
| | | data |
| | | }) |
| | | } |
New file |
| | |
| | | <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> |
New file |
| | |
| | | import emailCard from "./emailCard"; |
| | | export default emailCard; |
| | |
| | | @refresh="onRefresh" |
| | | @reset="onReset" |
| | | :format-conditions="true" |
| | | :scroll="{ x: 2500, y }" |
| | | :scroll="{ x: 1360, y }" |
| | | :pagination="{ |
| | | current: pageCurr, |
| | | pageSize: pageSize, |
| | |
| | | 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", |
| | |
| | | title: "型号", |
| | | dataIndex: "subModel", |
| | | key: "subModel", |
| | | width: 180, |
| | | searchAble: true, |
| | | align: "center", |
| | | }, |
| | |
| | | dataIndex: "subName", |
| | | key: "subName", |
| | | align: "center", |
| | | width: 180, |
| | | searchAble: true, |
| | | }, |
| | | { |
| | |
| | | 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", |
| | |
| | | * @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: [] |
| | |
| | | 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> |
| | |
| | | /> |
| | | </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> |
| | | |
| | |
| | | import Pop from "./pop"; |
| | | import offset from "@/assets/js/tools/offset"; |
| | | import moment from "moment"; |
| | | import {getUserList} from "../../permission/apis"; |
| | | |
| | | import { |
| | | getList, |
| | |
| | | updateSoftwareLock, |
| | | } from "./apis"; |
| | | import { mapGetters } from "vuex"; |
| | | import EmailCard from "../../components/emailCard/"; |
| | | |
| | | export default { |
| | | name: "", |
| | |
| | | noSearch: true, |
| | | }, |
| | | ], |
| | | emailShow: false, |
| | | emailInfo: { |
| | | title: "", |
| | | content: "" |
| | | }, |
| | | userList: [] |
| | | }; |
| | | }, |
| | | components: { |
| | | EmailCard, |
| | | AdvanceTable, |
| | | DescRes, |
| | | Pop, |
| | |
| | | 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) { |
| | |
| | | }, |
| | | mounted() { |
| | | this.searchData(); |
| | | this.searchAllUserList(); |
| | | window.addEventListener("resize", this.resize); |
| | | }, |
| | | destroyed() { |
| | |
| | | }, |
| | | methods: { |
| | | onMouseenter() { |
| | | this.visible = true; |
| | | this.$emit('update:visible', true); |
| | | }, |
| | | onMouseleave() { |
| | | this.visible = false; |
| | | this.$emit('update:visible', false); |
| | | } |
| | | }, |
| | | |
| | |
| | | </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 }" |
| | |
| | | id: "", |
| | | tel: "", |
| | | phone: "", |
| | | mail: "", |
| | | departId: undefined, |
| | | faceId: "", |
| | | roleId: undefined, |
| | |
| | | { |
| | | 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", |
| | | }, |
| | | ], |
| | |
| | | }, |
| | | 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); |
| | |
| | | :data-source="dataSource" |
| | | :loading="loading" |
| | | rowKey="id" |
| | | :scroll="{ x: 1900, y }" |
| | | :scroll="{ x: 1800, y }" |
| | | @search="onSearch" |
| | | @refresh="onRefresh" |
| | | :format-conditions="true" |
| | |
| | | dataIndex: "phone", |
| | | }, |
| | | { |
| | | title: "邮箱", |
| | | searchAble: true, |
| | | dataIndex: "mail", |
| | | }, |
| | | { |
| | | title: "部门", |
| | | dataIndex: ["depart", "departName"], |
| | | key: "departName", |