通知公告

master
shaoyong 6 months ago
parent 4d748312f2
commit c030d1d1f3

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 查询通知公告-班组列表
export function listNoticeGroup(query) {
return request({
url: '/system/noticeGroup/list',
method: 'get',
params: query
});
}
// 查询通知公告-班组详细
export function getNoticeGroup(id) {
return request({
url: '/system/noticeGroup/' + id,
method: 'get'
});
}
// 新增通知公告-班组
export function addNoticeGroup(data) {
return request({
url: '/system/noticeGroup',
method: 'post',
data: data
});
}
// 修改通知公告-班组
export function updateNoticeGroup(data) {
return request({
url: '/system/noticeGroup',
method: 'put',
data: data
});
}
// 删除通知公告-班组
export function delNoticeGroup(data) {
return request({
url: '/system/noticeGroup/delNoticeGroup',
method: 'post',
data: data
});
}
export function teamBind(data) {
return request({
url: '/system/noticeGroup/teamBind',
method: 'post',
data: data
});
}

@ -0,0 +1,198 @@
<template>
<diV>
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
size="mini"
:disabled="multiple"
@click="handleDisBindTeam"
>删除</el-button>
</el-col>
</el-row>
<el-table :data="noticeGroupList" v-loading="loading" @selection-change="handleSelChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" align="center" width="50"/>
<el-table-column label="班组编码" align="center" prop="groupCode" />
<el-table-column label="班组名称" align="center" prop="groupName" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="teamClose"> </el-button>
</div>
</el-dialog>
<el-dialog :title="teamTitle" :visible.sync="teamOpen" width="800px" append-to-body>
<el-table :data="teamList" v-loading="teamLoading" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" align="center" width="50"/>
<el-table-column label="班组编码" align="center" prop="teamCode" />
<el-table-column label="班组名称" align="center" prop="teamDesc" />
<el-table-column prop="teamType" label="班组类别" align="center" >
<template slot-scope="scope">
{{ scope.row.teamType == "team_type1" ? "生产班组" : "检验班组" }}
</template>
</el-table-column>
<el-table-column label="所属产线" align="center" prop="productionLineCode" />
<el-table-column label="班组负责人" align="center" prop="teamLeaderName" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createDate" />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleBindTeam"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</diV>
</template>
<script>
import { listTeam,} from "@/api/wms/team";
import { getNoticeGroup,delNoticeGroup,teamBind,} from "@/api/system/noticeGroup";
export default {
name:"teamBind",
props: {
noticeId: Number,
},
data() {
return {
//
loading: true,
teamLoading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
groupCodes:[],
groupNames:[],
teamOpen: false,
//
total: 0,
//
noticeGroupList: [],
teamList: [],
//
title: "班组绑定",
teamTitle: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
noticeId: null,
createBy: null
},
};
},
created() {
this.getTeamList();
},
methods: {
//
getList() {
this.loading = true;
getNoticeGroup(this.noticeId).then(response => {
this.noticeGroupList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
getTeamList(){
listTeam().then(response => {
this.teamList = response.rows;
});
},
cancel() {
this.teamOpen = false;
},
teamClose() {
this.$emit('cancel');
//this.reset();
},
//
handleSelChange(selection) {
this.groupCodes = selection.map(item => item.groupCode)
this.single = selection.length!=1
this.multiple = !selection.length
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.teamCode)
this.groupNames = selection.map(item => item.teamDesc)
this.single = selection.length!=1
this.multiple = !selection.length
},
//
handleAdd() {
this.teamLoading = true;
listTeam().then(response => {
this.teamList = response.rows;
this.teamOpen = true;
this.teamTitle = "添加班组";
this.teamLoading = false;
});
},
//
handleBindTeam() {
const groupCodes = this.ids
const groupNames = this.groupNames
const noticeId = this.noticeId
const data = {
noticeId,
groupCodes,
groupNames
}
if (this.noticeId != undefined) {
teamBind(data).then(response => {
if(response.code == 200) {
this.$modal.msgSuccess("绑定成功");
}
this.teamOpen = false;
this.getList();
});
}
},
//
handleDisBindTeam() {
const groupCodes = this.groupCodes;
const noticeId = this.noticeId;
const data = {
noticeId,
groupCodes
}
this.$modal.confirm('是否确认删除班组编码为"' + groupCodes + '"的数据项?').then(function() {
return delNoticeGroup(data);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
},
};
</script>
<style scoped>
.mb8 {
margin-bottom: 8px;
}
</style>

@ -66,6 +66,17 @@
v-hasPermi="['system:notice:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-link"
size="mini"
:disabled="single"
@click="handleBind"
v-hasPermi="['system:notice:edit']"
>班组绑定</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -125,56 +136,62 @@
<!-- 添加或修改公告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="公告标题" prop="noticeTitle">
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公告类型" prop="noticeType">
<el-select v-model="form.noticeType" placeholder="请选择公告类型">
<el-option
v-for="dict in dict.type.sys_notice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_notice_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内容">
<editor v-model="form.noticeContent" :min-height="192"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="公告标题" prop="noticeTitle">
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公告类型" prop="noticeType">
<el-select v-model="form.noticeType" placeholder="请选择公告类型">
<el-option
v-for="dict in dict.type.sys_notice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_notice_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内容">
<editor v-model="form.noticeContent" :min-height="192"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<TeamBind ref="teamBind"
:noticeId="ids[0]"
@cancel="handleClose"
></TeamBind>
</div>
</template>
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import TeamBind from './TeamBind.vue';
export default {
name: "Notice",
dicts: ['sys_notice_status', 'sys_notice_type'],
components: {TeamBind},
data() {
return {
//
@ -195,6 +212,7 @@ export default {
title: "",
//
open: false,
teamOpen: false,
//
queryParams: {
pageNum: 1,
@ -306,6 +324,14 @@ export default {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
handleBind(){
this.$refs.teamBind.open = true;
this.$refs.teamBind.getList();
},
handleClose() {
this.$refs.teamBind.open = false;
this.getList();
}
}
};

Loading…
Cancel
Save