中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

299 lines
7.5 KiB

<template>
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
ref="crud"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template #menu-left>
<el-button @click="setBathCrew()" type="primary">批量分派</el-button>
</template>
7 months ago
<template #menu-right="{ size }"> </template>
<template #menu="scope">
<el-button type="primary" link @click="setCrew(scope.row)">分派</el-button>
</template>
<template #pdmCreateTime="scope">
{{ scope.row.pdmCreateTime ? scope.row.pdmCreateTime.substring(0, 10) : '' }}
</template>
</avue-crud>
<!-- 分派人员弹框 -->
<assignDaialog
:id="bcId"
:set-crew-open="setCrewOpen"
v-if="setCrewOpen"
type="platingAssort"
@setCrewOpeSancel="setCrewOpeSancel"
:title="title"
:updateRow="updateRow"
></assignDaialog>
</basic-container>
7 months ago
</template>
<script>
import { getList, setDispatch } from '@/api/processManagement/taskDispatch';
import assignDaialog from './components/assignDaialog.vue';
7 months ago
export default {
components: {
assignDaialog,
},
data() {
return {
bcId: null,
setCrewOpen: false,
form: {},
query: {},
loading: true,
selectionList: [],
parentId: '',
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
height: 'auto',
calcHeight: 32,
tip: false,
simplePage: true,
searchShow: true,
searchMenuSpan: 12,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
selectable:false,
viewBtn: false,
delBtn: false,
editBtn: false,
addBtn: false,
editBtnText: '修改',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
viewBtnText: '详情',
labelWidth: 120,
menuWidth: 60,
dialogWidth: 1200,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
index: false,
showOverflowTooltip: true,
menuAlign: 'left',
gridBtn: false,
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
searchMenuPosition: 'right',
align: 'center',
emptyText: '',
column: [
{
label: '零件号',
prop: 'partCode',
search: true,
sortable: true,
overHidden: true,
headerAlign: 'center',
align: 'left',
searchLabelWidth: 60,
width: 150,
},
{
label: '零件名称',
prop: 'partName',
sortable: true,
search: false,
overHidden: true,
headerAlign: 'center',
align: 'left',
width: 150,
},
{
label: '任务类型',
prop: 'taskType',
sortable: true,
search: true,
overHidden: true,
type: 'select',
filterable: true,
4 months ago
clearable: true,
headerAlign: 'center',
align: 'center',
width: 150,
dicUrl: '/blade-system/dict/dictionary?code=processTaskType',
props: {
label: 'dictValue',
value: 'dictKey',
7 months ago
},
},
{
label: 'PDM发布时间',
prop: 'pdmCreateTime',
sortable: true,
search: false,
overHidden: true,
headerAlign: 'center',
align: 'center',
width: 150,
},
{
label: 'PDM工艺路线',
prop: 'pdmWay',
sortable: true,
search: false,
overHidden: true,
headerAlign: 'center',
align: 'center',
width: 150,
},
{
label: '工艺路线详情',
prop: 'wayDetails',
sortable: true,
search: false,
overHidden: true,
headerAlign: 'center',
align: 'center',
width: 150,
},
{
label: '在制品建议',
prop: 'wipTake',
sortable: true,
search: false,
overHidden: true,
headerAlign: 'center',
align: 'center',
width: 150,
},
{
label: '备注',
prop: 'remarks',
sortable: true,
search: false,
overHidden: true,
headerAlign: 'center',
align: 'left',
width: 150,
},
],
},
data: [],
title: '分派',
updateRow: [],
};
},
methods: {
setBathCrew() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.updateRow = this.selectionList;
// this.selectionList.forEach(item => {
// if (item.children && item.children.length > 0) {
// item.children.forEach(element => {
// this.updateRow.push(element);
// });
// }
// });
// console.log(5555, this.updateRow);
this.setCrewOpen = true;
this.title = '批量分派';
},
// 设置班组人员
setCrew(row) {
this.updateRow = [row];
// if (row.children.length > 0) {
// row.children.forEach(element => {
// this.updateRow.push(element);
// });
// }
// console.log(999999, this.updateRow);
this.setCrewOpen = true;
this.title = '分派';
},
// 设置班组人员弹框关闭
setCrewOpeSancel(isRefresh) {
this.setCrewOpen = false;
this.onLoad(this.page, this.query);
},
// 重置
searchReset() {
this.query = {};
this.parentId = 0;
this.onLoad(this.page, this.query);
},
// 搜索
searchChange(params, done) {
this.query = params;
this.parentId = '';
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
// 选中表格数据
selectionChange(list) {
this.selectionList = list;
},
//
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
7 months ago
// 切换 页码
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
// 切换页面 数量
sizeChange(pageSize) {
this.page.pageSize = pageSize;
7 months ago
},
refreshChange() {
this.onLoad(this.page, this.query);
},
// 加载页面数据
onLoad(page, params = {}) {
this.loading = true;
7 months ago
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
this.data = res.data.data.records;
7 months ago
this.loading = false;
this.page.total = res.data.data.total;
this.selectionClear();
});
7 months ago
},
},
};
</script>
<style lang="scss" scoped>
:deep(.el-checkbox .is-disabled) {
display: none;
}
</style>