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

367 lines
9.2 KiB

7 months ago
<template>
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model:page="page"
v-model="form"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
4 months ago
@on-load="onLoad"
7 months ago
>
4 months ago
<template #menu-left>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete"> </el-button>
<el-button type="success" icon="el-icon-upload" @click="handleImport">导入 </el-button>
</template>
<template #status="{ row }">
<div style="display: flex; align-items: center; justify-content: center">
<span
:style="{
marginRight: '5px',
backgroundColor: row.status == 1 ? '#00A854' : '#F04134',
width: '12px',
height: '12px',
borderRadius: '50%',
display: 'inline-block',
}"
></span
><span>{{ row.status == 0 ? '暂停使用' : '使用中' }}</span>
</div>
</template>
7 months ago
</avue-crud>
4 months ago
<!-- 导入 -->
<basic-import
v-if="isShowImport"
title="导入"
:isShow="isShowImport"
templateUrl="/blade-desk/QA/CycleTestItem/download-excel-template"
templateName="试验项目模板.xlsx"
importUrl="/blade-desk/QA/CycleTestItem/import-excel"
@closeDialog="closeDialog"
></basic-import>
7 months ago
</basic-container>
</template>
<script>
4 months ago
import basicImport from '@/components/basic-import/main.vue';
7 months ago
export default {
4 months ago
components: {
basicImport,
},
data() {
return {
isShowImport: false,
data: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
form: {},
query: {},
loading: true,
excelBox: false,
option: {
tip: false,
height: 'auto',
calcHeight: 32,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
columnSort: true,
tree: false,
border: true,
index: true,
selection: true,
viewBtn: false,
delBtn: true,
editBtnText: '修改',
viewBtnText: '详情',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
4 months ago
labelWidth: 120,
dialogWidth: 600,
dialogClickModal: false,
searchEnter: true,
filterBtn: true,
searchShowBtn: false,
excelBtn: true,
showOverflowTooltip: true,
align: 'center',
searchLabelPosition: 'left',
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
column: [
{
label: '编码',
prop: 'tsCode',
search: true,
sortable: true,
filter: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
span: 24,
rules: [
{
required: true,
message: '请输入编码',
trigger: 'blur',
},
],
},
{
label: '名称',
prop: 'tsName',
type: 'select',
sortable: true,
filter: true,
span: 24,
search: true,
rules: [
{
required: true,
message: '请输入名称',
trigger: 'blur',
},
],
dicData: [
{
label: '化学镀镍作业中心',
value: 0,
},
{
label: '镀后库作业中心',
value: 1,
},
],
},
{
label: '槽号',
prop: 'slotNo1',
search: false,
sortable: true,
filter: true,
hide: true,
span: 24,
rules: [
{
required: true,
message: '请输入槽号',
trigger: 'blur',
},
],
},
{
label: '作业槽描述',
prop: 'wcDescribe',
type: 'textarea',
search: false,
sortable: true,
filter: true,
span: 24,
rules: [
{
required: true,
message: '请输入作业槽描述',
trigger: 'blur',
},
],
},
{
label: '状态',
prop: 'status',
type: 'switch',
search: true,
sortable: true,
filter: true,
span: 24,
dicData: [
{ label: '关', value: 0 },
{ label: '开', value: 1 },
],
},
{
label: '操作人',
prop: 'createUser',
search: false,
sortable: true,
filter: true,
editDisplay: false,
addDisplay: false,
span: 24,
rules: [
{
required: true,
message: '请输入作业槽描述',
trigger: 'blur',
},
],
},
{
label: '更新时间',
prop: 'updateTime',
search: false,
sortable: true,
editDisplay: false,
filter: true,
addDisplay: false,
span: 24,
rules: [
{
required: true,
message: '请输入作业槽描述',
trigger: 'blur',
},
],
},
],
},
excelOption: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: '模板上传',
prop: 'excelFile',
type: 'upload',
drag: true,
loadText: '模板上传中,请稍等',
span: 24,
propsHttp: {
res: 'data',
7 months ago
},
4 months ago
tip: '请上传 .xls,.xlsx 标准格式文件',
action: '/blade-system/user/import-user',
},
{
label: '模板下载',
prop: 'excelTemplate',
formslot: true,
span: 24,
},
],
},
selectionList: [],
};
},
mounted() {},
methods: {
// 点击导入按钮
handleImport() {
this.isShowImport = true
7 months ago
},
4 months ago
// 多选
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
rowUpdate(row, index, done, loading) {},
rowSave(row, done, loading) {},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
rowDel(row, index, done) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {});
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad() {
this.loading = true;
this.data = [
{
id: '1',
slotNo: '#21',
wcName: '化学镀镍作业中心',
wcDescribe: '低应力镍槽',
status: 1,
createUser: '张三',
updateTime: '2025-01-22 12:23:35',
7 months ago
},
4 months ago
{
id: '2',
slotNo: '#22',
wcName: '化学镀镍作业中心',
wcDescribe: '氰化镀铜槽',
status: 1,
createUser: '张三',
updateTime: '2025-01-22 12:23:35',
7 months ago
},
4 months ago
{
id: '3',
slotNo: '#23',
wcName: '化学镀镍作业中心',
wcDescribe: '氰化镀铜槽',
status: 1,
createUser: '张三',
updateTime: '2025-01-22 12:23:35',
7 months ago
},
4 months ago
{
id: '4',
slotNo: '#24',
wcName: '化学镀镍作业中心',
wcDescribe: '氰化镀铜槽',
status: 0,
createUser: '张三',
updateTime: '2025-01-22 12:23:35',
7 months ago
},
4 months ago
{
id: '5',
slotNo: '#25',
wcName: '化学镀镍作业中心',
wcDescribe: '氰化镀铜槽',
status: 1,
createUser: '张三',
updateTime: '2025-01-22 12:23:35',
7 months ago
},
4 months ago
];
this.page.total = this.data.length;
this.loading = false;
setTimeout(() => {
this.selectionClear();
}, 500);
},
},
};
7 months ago
</script>
4 months ago
<style></style>