Merge branch 'master' of http://106.12.13.113:3000/lanju/lanju-front
commit
0be124b6ab
@ -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>
|
Loading…
Reference in New Issue