中航光电热表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.

476 lines
12 KiB

8 months ago
<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"
@row-save="rowSave"
>
<template #menu-left>
<el-button type="primary" @click="addFn">新增</el-button>
</template>
<template #menu="scope">
<el-button type="text" @click="detailsFn(scope.row)"> 详情</el-button>
<!-- 是否展示 -->
5 months ago
<el-button type="text" v-if="scope.row.isSpecial == 1" @click="setCrew(scope.row)">
设置班组</el-button
>
</template>
<template #menu-right="{ size }">
<span style="display: inline-flex; margin-right: 12px">
5 months ago
<el-button type="primary" @click="handleImport">导入</el-button>
</span>
</template>
<template #isDispatch="scope">
<el-tag v-if="scope.row.isDispatch == 1" type="success"></el-tag>
<el-tag v-else type="danger"></el-tag>
</template>
<template #isSpecial="scope">
<el-tag v-if="scope.row.isSpecial == 1" type="success"></el-tag>
<el-tag v-else type="danger"></el-tag>
</template>
<template #special="scope">
<el-tag v-if="scope.row.mainProcess == 1" type="success"></el-tag>
<el-tag v-else type="danger"></el-tag>
</template>
<template #isMain="scope">
<el-tag v-if="scope.row.isMain == 1" type="success"></el-tag>
<el-tag v-else type="danger"></el-tag>
</template>
5 months ago
<template #isCheckout="scope">
<el-tag v-if="scope.row.isCheckout == 1" type="success"></el-tag>
<el-tag v-else type="danger"></el-tag>
</template>
<template #cyropactorControl-label="{ type, disabled }">
<span></span>
</template>
8 months ago
<template #name="{ row }">
<i :class="row.source" style="margin-right: 5px" />
<span>{{ row.name }}</span>
</template>
<template #source="{ row }">
<div style="text-align: center">
<i :class="row.source" />
</div>
</template>
</avue-crud>
8 months ago
<setCrew
:pId="rowId"
:set-crew-open="setCrewOpen"
v-if="setCrewOpen"
type="abnormalConfig"
@setCrewOpeSancel="setCrewOpeSancel"
/>
<!-- 新增和详情 -->
<addBasicProcessesDialog
:showDialog="isAddOpen"
v-if="isAddOpen"
@closeDialog="closeDialog"
:title="openTitle"
:id="rowId"
></addBasicProcessesDialog>
5 months ago
<!-- 导入 -->
5 months ago
<basic-import
v-if="isShowImport"
title="导入"
:isShow="isShowImport"
templateUrl="/blade-desk/bsProcessSet/import-template"
templateName="工序导入模板.xls"
importUrl="/blade-desk/bsProcessSet/import-excel-processSet"
@closeDialog="closeDialog"
></basic-import>
</basic-container>
8 months ago
</template>
<script>
5 months ago
import { getList, remove, add } from '@/api/processManagement/basicProcesses';
import addBasicProcessesDialog from './components/addBasicProcessesDialog.vue';
import { mapGetters } from 'vuex';
import { getDictionary } from '@/api/system/dict';
import setCrew from './components/setCrew.vue';
import basicImport from '@/components/basic-import/main.vue';
8 months ago
export default {
components: {
setCrew,
addBasicProcessesDialog,
5 months ago
basicImport,
},
data() {
return {
5 months ago
isShowImport: false,
ppsId: null,
setCrewOpen: false,
form: {},
query: {},
loading: true,
selectionList: [],
5 months ago
parentId: '',
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
5 months ago
height: 'auto',
calcHeight: 32,
tip: false,
simplePage: true,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: false,
viewBtn: false,
addBtn: false,
delBtn: false,
editBtn: false,
5 months ago
editBtnText: '修改',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
viewBtnText: '详情',
// labelWidth: 120,
menuWidth: 140,
dialogWidth: 840,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
showOverflowTooltip: true,
5 months ago
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
5 months ago
menuAlign: 'left',
gridBtn: false,
5 months ago
searchMenuPosition: 'right',
align: 'center',
column: [
{
5 months ago
label: '编码',
prop: 'code',
search: true,
sortable: true,
overHidden: true,
order: 9,
5 months ago
headerAlign: 'center',
align: 'center',
searchLabelWidth: 45,
rules: [
{
required: true,
5 months ago
message: '请输入配置码',
trigger: 'blur',
},
],
},
{
5 months ago
label: '名称',
prop: 'name',
sortable: true,
search: true,
overHidden: true,
order: 8,
width: 200,
5 months ago
headerAlign: 'center',
align: 'left',
searchLabelWidth: 45,
rules: [
{
required: true,
5 months ago
message: '请选择镀种分类',
trigger: 'click',
},
],
},
{
label: '是否检验工序',
prop: 'isCheckout', //1:是 2:否
sortable: true,
search: true,
overHidden: true,
span: 8,
headerAlign: 'center',
align: 'center',
searchLabelWidth: 120,
type: 'select',
5 months ago
filterable:true,
5 months ago
clearable: true,
dicData: [
{
label: '是',
value: '1',
},
{
label: '否',
value: '0',
},
],
rules: [
{
required: false,
message: '请选择',
trigger: 'click',
},
],
},
{
5 months ago
label: '不分派',
prop: 'isDispatch', //1:是 2:否
sortable: true,
search: true,
overHidden: true,
span: 8,
5 months ago
headerAlign: 'center',
align: 'center',
searchLabelWidth: 60,
5 months ago
type: 'select',
5 months ago
filterable:true,
clearable: true,
dicData: [
{
5 months ago
label: '是',
value: '1',
},
{
5 months ago
label: '否',
value: '2',
},
],
rules: [
{
required: false,
5 months ago
message: '请输入镀种',
trigger: 'click',
},
],
},
{
5 months ago
label: '特殊',
prop: 'isSpecial',
sortable: true,
search: true,
overHidden: true,
span: 8,
5 months ago
headerAlign: 'center',
align: 'center',
searchLabelWidth: 45,
5 months ago
type: 'select',
5 months ago
filterable:true,
clearable: true,
dicData: [
{
5 months ago
label: '是',
value: '1',
},
{
5 months ago
label: '否',
value: '2',
},
],
rules: [
{
required: false,
5 months ago
message: '请输入镀层编码',
trigger: 'click',
},
],
},
{
5 months ago
label: '主工序',
prop: 'isMain',
sortable: true,
search: false,
span: 8,
5 months ago
headerAlign: 'center',
align: 'center',
rules: [
{
required: false,
5 months ago
message: '请输入镀种小类',
trigger: 'click',
},
],
},
{
5 months ago
label: '班组',
prop: 'team',
sortable: true,
search: false,
overHidden: true,
display: false,
5 months ago
headerAlign: 'center',
align: 'left',
rules: [
{
required: false,
5 months ago
message: '请输入材料',
trigger: 'click',
},
],
},
{
5 months ago
label: '标准周期',
prop: 'cycle',
sortable: true,
search: false,
order: 7,
span: 24,
5 months ago
headerAlign: 'center',
align: 'center',
rules: [
{
required: true,
5 months ago
message: '请输入标准周期',
trigger: 'click',
},
],
},
{
5 months ago
label: '电流(A)',
prop: 'eleStream',
display: true,
hide: true,
span: 8,
},
{
5 months ago
label: '电导率',
prop: 'eleRate',
display: true,
hide: true,
span: 8,
},
{
5 months ago
label: 'PH',
prop: 'phValue',
display: true,
hide: true,
span: 8,
},
{
5 months ago
label: 'Ni+',
prop: 'niValue',
display: true,
hide: true,
span: 8,
},
{
5 months ago
label: '转速/振频',
prop: 'viSpeed',
display: true,
hide: true,
span: 6,
},
{
5 months ago
label: '整流机控制模式',
prop: 'cyropactorControl',
display: true,
hide: true,
span: 10,
},
],
},
data: [],
isAddOpen: false,
5 months ago
openTitle: '',
rowId: '',
};
},
8 months ago
methods: {
5 months ago
// 点击导入按钮
handleImport() {
5 months ago
this.isShowImport = true;
5 months ago
},
// 新增
addFn() {
this.isAddOpen = true;
5 months ago
this.openTitle = '新增';
},
closeDialog(isRefresh) {
this.isAddOpen = false;
if (isRefresh) {
// this.$refs.myTable.load();
this.onLoad(this.page, this.query);
}
},
detailsFn(row) {
5 months ago
this.openTitle = '详情';
this.isAddOpen = true;
this.rowId = row.id;
},
// 设置班组人员
setCrew(row) {
this.rowId = row.id;
this.setCrewOpen = true;
},
// 设置班组人员弹框关闭
setCrewOpeSancel(isRefresh) {
if (isRefresh) {
5 months ago
this.onLoad(this.page, this.query);
}
this.setCrewOpen = false;
},
8 months ago
// 重置
searchReset() {
this.query = {};
this.parentId = 0;
this.onLoad(this.page);
8 months ago
},
// 搜索
searchChange(params, done) {
this.query = params;
5 months ago
this.parentId = '';
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
8 months ago
},
// 切换 页码
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
// 切换页面 数量
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
8 months ago
refreshChange() {
this.onLoad(this.page, this.query);
},
// 加载页面数据
onLoad(page, params = {}) {
this.loading = true;
5 months ago
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
this.data = res.data.data.records;
this.loading = false;
this.page.total = res.data.data.total;
this.selectionClear();
});
8 months ago
},
},
};
</script>