Files
scrq-hd/.svn/pristine/27/277b567ad2c93cfdfd2c487fd3f937e4cb02e019.svn-base
2025-07-03 10:34:04 +08:00

340 lines
8.5 KiB
Plaintext

<template>
<div class="app-container">
<div class="main">
<div class="query" ref="query">
<el-form
:model="queryParams"
ref="queryParams"
:inline="true"
label-width="100px"
>
<el-form-item>
<el-input
v-model="queryParams.templateName"
placeholder="模板名称"
clearable
size="small"
style="width: 230px"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="Query"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
<el-button
type="primary"
:icon="showMore ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
size="mini"
></el-button>
</el-form-item>
<div v-show="showMore"></div>
</el-form>
</div>
<el-divider></el-divider>
<div>
<div>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-plus"
size="mini"
@click="add"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-check"
size="mini"
:disabled="buttonDown"
@click="update"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="buttonDown"
@click="handleDelete"
>删除</el-button
>
</el-col>
</el-row>
<el-table
ref="singleTable"
v-loading="loading"
highlight-current-row
@current-change="handleCurrentChange"
:data="tableData"
border
:height="tableHeight"
class="tableStyle"
style="width: 100%"
>
<el-table-column
type="index"
align="center"
label="序号"
width="50"
></el-table-column>
<el-table-column
prop="templateName1"
align="center"
header-align="center"
width="110"
label="模板内容维护"
>
<template slot-scope="scope">
<i style="color: blue;text-decoration:underline; cursor:pointer;" @click="printResizeClick(scope.row.templateName)">模板内容维护</i>
</template>
</el-table-column>
<el-table-column
prop="templateName"
align="center"
header-align="center"
label="模板名称"
></el-table-column>
<el-table-column
align="center"
header-align="center"
show-overflow-tooltip
label="模板内容"
>
<template slot-scope="scope">
<div v-html="scope.row.templateContent"></div>
</template>
</el-table-column>
<el-table-column
prop="description"
align="center"
header-align="center"
label="备注"
></el-table-column>
</el-table>
<el-pagination
style="margin-top: 10px; height: 20px"
@size-change="handleSizeChange"
@current-change="handleCurrentChange2"
:current-page="currentPage"
:page-sizes="[10, 20, 50, 100, 200, 500, 1000]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
import edit from "./eidt";
import printResize from '@/views/tool/printResize.vue'
export default {
name: "ProcedSigna",
components: {
edit,
},
data() {
return {
buttonDown: true,
indexShow: false,
tableHeight: 0,
showMore: false,
currentRow: null,
buttonEnable: true,
realList: [],
isAdd: null,
total: null,
propThis: this,
pageSize: 50,
currentPage: 1,
tableData: [],
queryParams: {},
loading: false,
stepLists: [],
devices: [],
};
},
mounted() {
this.$nextTick(() => {
this.tableHeight =
window.innerHeight - this.$refs.queryParams.$el.offsetTop - 250;
// 监听窗口大小变化
let self = this;
window.onresize = function () {
self.tableHeight =
window.innerHeight - self.$refs.queryParams.$el.offsetTop - 100;
};
});
this.getList();
},
methods: {
handleDelete() {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.$printTemplate.delete({ id: this.currentRow.id }).then((data) => {
if (data.data.code === 200) {
this.$message.success("删除成功");
this.getList();
}
});
});
},
handleCurrentChange2(val) {
// this.currentRow = val;
this.currentPage = val;
this.getList();
},
handleSizeChange(val) {
this.pageSize = val;
this.getList();
},
initPopover() {
const params = {
tableName: "ProManagement",
};
this.$refs.test.init();
},
getList() {
this.currentRow = undefined;
this.buttonDown = true;
this.loading = true;
const params = {
pageSize: this.pageSize,
pageNo: this.currentPage,
templateName: this.queryParams.templateName,
};
this.$printTemplate.getList(params).then((data) => {
if (data.data.code == 200) {
this.tableData = data.data.data.data;
this.total = data.data.data.recordsTotal;
} else {
this.$message.error(data.data.msg||data.data.data.msg);
}
this.loading = false;
});
},
Query() {
console.log(this.queryParams);
this.currentPage = 1;
this.getList();
},
resetQuery() {
this.queryParams = {};
},
handleCurrentChange(val) {
this.currentRow = val;
this.buttonDown = false;
},
printResizeClick(templateName)
//条码位置维护
{
this.$message.warning('9984')
this.g_method.sidebarReduce();
this.$layer.iframe({
resize: true,
shadeClose: false,
content: {
content: printResize,
parent: this,
data: {
templateName: templateName,
},
},
area: [this.g_const.dialogWidthHuge, "700px"],
title: "合并领料单",
});
},
add() {
this.$layer.iframe({
shadeClose: false,
content: {
content: edit, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
form: this.currentRow,
},
},
area: ["900px", "700px"],
title: "新增",
});
},
update() {
this.$layer.iframe({
shadeClose: false,
content: {
content: edit, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 2,
form: this.currentRow,
},
},
area: ["900px", "700px"],
title: "修改",
});
},
},
};
</script>
<style lang="scss" scoped>
>>> .el-table__expanded-cell:hover {
/*padding:20px 0px;*/
background-color: white !important;
}
>>> .el-table--striped .el-table__body tr.el-table__row--striped.current-row td,
>>> .el-table__body tr.current-row > td {
background-color: #8ac1ff !important;
cursor: pointer;
}
>>> .el-table__body tr:hover > td {
background-color: #e9edf3;
cursor: pointer;
}
>>> .el-link.el-link--default {
color: white;
}
>>> .el-form-item {
margin-bottom: 10px;
}
.el-divider {
margin-top: 0px;
}
</style>