Elements-SY

modify

1 -<template>
2 - <div ref="formHeaderRef" class="form-header container">
3 - <el-row>
4 - <el-col>
5 - <yl-form
6 - ref="ruleForm"
7 - :formConfig="formConfig"
8 - :queryForm="queryForm"
9 - :inline="false"
10 - formWidth="auto"
11 - @blur="blurEvent"
12 - />
13 - </el-col>
14 - </el-row>
15 - <yl-table
16 - ref="ylTable"
17 - :attrs="tableAttr"
18 - :loadingTable="tableAttr.loadingTable"
19 - :columns="columns"
20 - :tableData="tableData"
21 - :pageConfig="pageConfig"
22 - @sizeChange="handleSizeChange"
23 - @currentChange="handleCurrentChange"
24 - @search="searchBtn"
25 - @add="addBtn"
26 - >
27 - </yl-table>
28 - </div>
29 -</template>
30 -<script>
31 -import YlForm from "@/components/YlForm";
32 -import YlTable from "@/components/YlTable";
33 -import { formConfig } from "./formConfig";
34 -import { tableAttr, columnHeader } from "./tableConfig";
35 -import { restTableHeight, sortList } from "@/utils";
36 -import store from '@/store'
37 -import {
38 - findAllEtesRules, // ET86查询
39 - deleteEtesRuleById, // 删除
40 -} from "@/api/et86";
41 -export default {
42 - components: {
43 - YlForm,
44 - YlTable,
45 - },
46 - data() {
47 - return {
48 - formConfig: formConfig, // 表单配置项
49 - queryForm: {
50 - // 表单参数
51 - status: "有效",
52 - },
53 - pageConfig: {
54 - // 分页配置项
55 - isPagination: true,
56 - total: 0,
57 - pageData: {
58 - page: 1,
59 - size: 10,
60 - },
61 - },
62 - tableAttr: tableAttr, // table配置项
63 - columns: columnHeader(this.indexAdd, this.viewRow, this.editRow, this.deleteRow), // 表头
64 - tableData: [], // 表格数据
65 - };
66 - },
67 - created() {
68 - // ET86查询
69 - this.$nextTick(() => {
70 - this.searchBtn();
71 - });
72 - },
73 - mounted() {
74 - this.$nextTick(() => {
75 - this.tableAttr.maxHeight =
76 - window.innerHeight - restTableHeight(this.$refs);
77 - });
78 - },
79 - methods: {
80 - // ET86查询
81 - queryFindAllEtesRules() {
82 - const { page, size } = this.pageConfig.pageData;
83 - let params = {
84 - originOfFlightNo: this.queryForm.originOfFlightNo,
85 - updateTimeStart: this.queryForm.startTime
86 - ? this.queryForm.startTime
87 - : "",
88 - updateTimeEnd: this.queryForm.endTime ? this.queryForm.endTime : "",
89 - limitStart: (page - 1) * size,
90 - limitSize: size,
91 - status: this.queryForm.status,
92 - };
93 - if (this.queryForm.status == "有效") {
94 - params.status = "1";
95 - }
96 - this.tableAttr.loadingTable = true;
97 - findAllEtesRules(params)
98 - .then((res) => {
99 - this.tableAttr.loadingTable = false;
100 - const { code, data } = res;
101 - if (code == 200) {
102 - const valid = data.list.filter((item) => item.status == "1"); // 有效
103 - const invalid = data.list.filter((item) => item.status == "0"); // 无效
104 - this.tableData = valid.concat(invalid);
105 - this.pageConfig.total = data.total;
106 - }
107 - })
108 - .catch(() => {});
109 - },
110 - // 失焦事件
111 - blurEvent({ originOfFlightNo }) {
112 - this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo);
113 - },
114 - // 搜索
115 - searchBtn() {
116 - this.pageConfig.pageData.page = 1;
117 - this.pageConfig.pageData.size = 10;
118 - this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
119 - this.queryFindAllEtesRules();
120 - });
121 - },
122 - // 翻页序号递增
123 - indexAdd(index){
124 - const page = this.pageConfig.pageData.page // 当前页码
125 - const pagesize = this.pageConfig.pageData.size // 每页条数
126 - return index + 1 + (page - 1) * pagesize
127 - },
128 - //条数变化
129 - handleSizeChange(e) {
130 - this.pageConfig.pageData.size = e;
131 - this.pageConfig.pageData.page = 1;
132 - this.queryFindAllEtesRules();
133 - },
134 - //页码变化
135 - handleCurrentChange(e) {
136 - this.pageConfig.pageData.page = e;
137 - this.queryFindAllEtesRules();
138 - },
139 - // 添加
140 - addBtn(item) {
141 - this.$router.push({
142 - path: "/edit",
143 - query: {
144 - name: "add",
145 - },
146 - });
147 - },
148 - // 重置表单
149 - restForm() {
150 - this.$refs.ruleForm.resetFields("ruleForm");
151 - },
152 - // 查看
153 - viewRow({ row }) {
154 - this.$router.push({
155 - path: "/edit",
156 - query: {
157 - name: "view",
158 - id: row.id,
159 - status: row.status,
160 - },
161 - });
162 - },
163 - // 编辑
164 - editRow({ row }) {
165 - this.$router.push({
166 - path: "/edit",
167 - query: {
168 - name: "edit",
169 - id: row.id,
170 - status: row.status,
171 - },
172 - });
173 - },
174 - // 删除
175 - deleteRow({ row }) {
176 - this.$confirm("是否确认删除? 删除后该规则设置为无效,不可恢复", "提示", {
177 - confirmButtonText: "确定",
178 - cancelButtonText: "取消",
179 - type: "warning",
180 - center: true,
181 - })
182 - .then(() => {
183 - deleteEtesRuleById({ id: row.id }).then((res) => {
184 - const { code, msg } = res;
185 - if (code == 200) {
186 - this.searchBtn();
187 - this.msgSuccess("删除成功!");
188 - } else {
189 - this.msgError(msg || "删除失败");
190 - }
191 - });
192 - })
193 - .catch(() => {});
194 - },
195 - },
196 -};
197 -</script>
198 -<style lang="scss" scoped></style>
...@@ -506,8 +506,6 @@ export default { ...@@ -506,8 +506,6 @@ export default {
506 serviceCodeTableSelectAll(val) { 506 serviceCodeTableSelectAll(val) {
507 this.nowSelect = val 507 this.nowSelect = val
508 }, 508 },
509 -<<<<<<< HEAD
510 -=======
511 // 确认消息提示 509 // 确认消息提示
512 confirmHandle($index, row){ 510 confirmHandle($index, row){
513 this.$confirm(row.msg, "提示", { 511 this.$confirm(row.msg, "提示", {
...@@ -543,7 +541,6 @@ export default { ...@@ -543,7 +541,6 @@ export default {
543 this.confirmHandle($index, row) 541 this.confirmHandle($index, row)
544 } 542 }
545 } 543 }
546 ->>>>>>> test
547 } 544 }
548 } 545 }
549 </script> 546 </script>
......