|
@@ -0,0 +1,298 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="app-container">
|
|
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="名称" prop="sopName">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.sopName"
|
|
|
|
|
+ placeholder="请输入名称"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="内容" prop="sopCode">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.sopCode"
|
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button v-no-more-click type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button v-no-more-click icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button v-no-more-click
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleAdd"
|
|
|
|
|
+ v-hasPermi="['iscs:template:add']"
|
|
|
|
|
+ >新增
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button v-no-more-click
|
|
|
|
|
+ type="info"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-sort"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="toggleExpandAll"
|
|
|
|
|
+ >展开/折叠
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ v-if="refreshTable"
|
|
|
|
|
+ v-loading="loading"
|
|
|
|
|
+ :data="deptList"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column prop="templateCode" label="邮件模板编号"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="name" label="邮件模板名称"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="content" label="内容">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button type="text" @click="check(scope.row)">查看</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="添加时间" align="center" prop="createTime" width="200">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ scope.row.createTime }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button v-no-more-click
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
|
|
+ v-hasPermi="['iscs:template:edit']"
|
|
|
|
|
+ >修改
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button v-no-more-click
|
|
|
|
|
+
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
|
|
+ v-hasPermi="['iscs:template:remove']"
|
|
|
|
|
+ >删除
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <pagination
|
|
|
|
|
+ v-show="total > 0"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ :page.sync="queryParams.current"
|
|
|
|
|
+ :limit.sync="queryParams.size"
|
|
|
|
|
+ @pagination="getList"
|
|
|
|
|
+ />
|
|
|
|
|
+ <!-- 添加或修改部门对话框 -->
|
|
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="470px" append-to-body>
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
|
|
+ <el-form-item label="邮件模板名称" prop="name">
|
|
|
|
|
+ <el-input v-model="form.name" placeholder="请输入邮件模板名称"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="邮件模板内容" prop="content">
|
|
|
|
|
+ <el-input type="textarea" :rows="10" v-model="form.content" placeholder="请输入邮件模板名称"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button v-no-more-click type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
+ <el-button v-no-more-click @click="cancel">取 消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import {
|
|
|
|
|
+ listEmailTemplates,
|
|
|
|
|
+ getEmailTemplatesInfo,
|
|
|
|
|
+ addEmailTemplates,
|
|
|
|
|
+ updateEmailTemplates,
|
|
|
|
|
+ delEmailTemplates
|
|
|
|
|
+} from '@/api/mes/email/templates'
|
|
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
|
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
+import { genCode } from '@/api/system/autocode/rule'
|
|
|
|
|
+import Template from '@/views/print/printtemplate/list.vue'
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: 'Dept',
|
|
|
|
|
+ dicts: ['sys_normal_disable', 'sop_type'],
|
|
|
|
|
+ components: { Template, Treeselect },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ // 遮罩层
|
|
|
|
|
+ loading: true,
|
|
|
|
|
+ //自动生成编码
|
|
|
|
|
+ autoGenFlag: false,
|
|
|
|
|
+ // 显示搜索条件
|
|
|
|
|
+ showSearch: true,
|
|
|
|
|
+ isEditing: false,//添加一个标识符
|
|
|
|
|
+ // 总条数
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ // 表格树数据
|
|
|
|
|
+ deptList: [],
|
|
|
|
|
+ // 弹出层标题
|
|
|
|
|
+ title: '',
|
|
|
|
|
+ // 是否显示弹出层
|
|
|
|
|
+ open: false,
|
|
|
|
|
+ // 是否展开,默认全部展开
|
|
|
|
|
+ isExpandAll: true,
|
|
|
|
|
+ // 重新渲染表格状态
|
|
|
|
|
+ refreshTable: true,
|
|
|
|
|
+ // 查询参数
|
|
|
|
|
+ queryParams: {
|
|
|
|
|
+ current: 1,
|
|
|
|
|
+ size: 10
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 表单参数
|
|
|
|
|
+ form: {
|
|
|
|
|
+ machineryId: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ // 表单校验
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ sopCode: [
|
|
|
|
|
+ { required: true, message: 'SOP编码不能为空', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ sopName: [
|
|
|
|
|
+ { required: true, message: 'SOP名称不能为空', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ workstationId: [
|
|
|
|
|
+ { required: true, message: '岗位不能为空', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ lotoId: [
|
|
|
|
|
+ { required: true, message: '锁定站不能为空', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ machineryId: [
|
|
|
|
|
+ { required: true, message: '设备/工艺不能为空', trigger: 'blur' }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ /** 查询部门列表 */
|
|
|
|
|
+ getList() {
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ listEmailTemplates(this.queryParams).then(response => {
|
|
|
|
|
+ debugger;
|
|
|
|
|
+ this.deptList = response.data.records
|
|
|
|
|
+ this.total = response.data.total
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 取消按钮
|
|
|
|
|
+ cancel() {
|
|
|
|
|
+ this.open = false
|
|
|
|
|
+ this.reset()
|
|
|
|
|
+ },
|
|
|
|
|
+ // 表单重置
|
|
|
|
|
+ reset() {
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ sopId: undefined,
|
|
|
|
|
+ parentId: undefined,
|
|
|
|
|
+ sopName: undefined
|
|
|
|
|
+ }
|
|
|
|
|
+ this.autoGenFlag = false
|
|
|
|
|
+ this.resetForm('form')
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /** 搜索按钮操作 */
|
|
|
|
|
+ handleQuery() {
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 重置按钮操作 */
|
|
|
|
|
+ resetQuery() {
|
|
|
|
|
+ this.resetForm('queryForm')
|
|
|
|
|
+ this.queryParams.sopName = ''
|
|
|
|
|
+ this.handleQuery()
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /** 展开/折叠操作 */
|
|
|
|
|
+ toggleExpandAll() {
|
|
|
|
|
+ this.refreshTable = false
|
|
|
|
|
+ this.isExpandAll = !this.isExpandAll
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.refreshTable = true
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 新增按钮操作 */
|
|
|
|
|
+ handleAdd() {
|
|
|
|
|
+ this.reset()
|
|
|
|
|
+ this.open = true
|
|
|
|
|
+ this.title = '添加邮件模板'
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 修改按钮操作 */
|
|
|
|
|
+ handleUpdate(row) {
|
|
|
|
|
+ this.reset()
|
|
|
|
|
+ this.isEditing = true
|
|
|
|
|
+ getEmailTemplatesInfo(row.templateCode).then(response => {
|
|
|
|
|
+ this.form = response.data
|
|
|
|
|
+ this.open = true
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.isEditing = false
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ this.title = '修改邮件模板'
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 提交按钮 */
|
|
|
|
|
+ submitForm: function() {
|
|
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ if (this.form.templateCode != undefined) {
|
|
|
|
|
+ updateEmailTemplates(this.form).then(response => {
|
|
|
|
|
+ this.$modal.msgSuccess('修改成功')
|
|
|
|
|
+ this.open = false
|
|
|
|
|
+
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ addEmailTemplates(this.form).then(response => {
|
|
|
|
|
+ this.$modal.msgSuccess('新增成功')
|
|
|
|
|
+ this.open = false
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 删除按钮操作 */
|
|
|
|
|
+ handleDelete(row) {
|
|
|
|
|
+ this.$modal.confirm('是否确认删除名称为"' + row.sopName + '"的数据项?').then(function() {
|
|
|
|
|
+ return delEmailTemplates(row.sopId)
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|