Merge branch 'master' of http://yun.pashanhoo.com:9090/bdc/bdcjg-web
Showing
3 changed files
with
152 additions
and
120 deletions
1 | <!-- | ||
2 | * @Author: xiaomiao 1158771342@qq.com | ||
3 | * @Date: 2023-03-09 15:24:53 | ||
4 | * @LastEditors: xiaomiao 1158771342@qq.com | ||
5 | * @LastEditTime: 2023-04-03 09:04:26 | ||
6 | * @FilePath: \上报\bdcjg-web\src\components\Button.vue | ||
7 | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||
8 | --> | ||
1 | <template> | 9 | <template> |
2 | <el-button class="button" :class="nativeType" @click.prevent="handleClick" :type="nativeType"> | 10 | <el-button class="button" :disabled="disableds" :class="nativeType" @click.prevent="handleClick" :type="nativeType"> |
3 | <slot></slot> | 11 | <slot></slot> |
4 | </el-button> | 12 | </el-button> |
5 | </template> | 13 | </template> |
... | @@ -11,6 +19,10 @@ | ... | @@ -11,6 +19,10 @@ |
11 | type: String, | 19 | type: String, |
12 | default: 'cx' | 20 | default: 'cx' |
13 | }, | 21 | }, |
22 | disableds: { | ||
23 | type: Boolean, | ||
24 | default: false | ||
25 | } | ||
14 | }, | 26 | }, |
15 | methods: { | 27 | methods: { |
16 | handleClick (evt) { | 28 | handleClick (evt) { |
... | @@ -20,5 +32,4 @@ | ... | @@ -20,5 +32,4 @@ |
20 | }; | 32 | }; |
21 | </script> | 33 | </script> |
22 | <style scoped lang="scss"> | 34 | <style scoped lang="scss"> |
23 | |||
24 | </style> | 35 | </style> | ... | ... |
... | @@ -334,6 +334,19 @@ | ... | @@ -334,6 +334,19 @@ |
334 | .btnColRight { | 334 | .btnColRight { |
335 | box-sizing: border-box; | 335 | box-sizing: border-box; |
336 | text-align: right; | 336 | text-align: right; |
337 | |||
338 | |||
339 | .is-disabled, | ||
340 | .is-disabled:hover, | ||
341 | .is-disabled:focus { | ||
342 | cursor: wait; | ||
343 | background: url("../image/btn.png") no-repeat 0 0; | ||
344 | background-size: cover; | ||
345 | |||
346 | } | ||
347 | |||
348 | |||
349 | |||
337 | } | 350 | } |
338 | 351 | ||
339 | 352 | ||
... | @@ -513,6 +526,7 @@ | ... | @@ -513,6 +526,7 @@ |
513 | } | 526 | } |
514 | 527 | ||
515 | // 按钮样式 | 528 | // 按钮样式 |
529 | |||
516 | .cx { | 530 | .cx { |
517 | background: url("../image/btn.png") no-repeat 0 -34px; | 531 | background: url("../image/btn.png") no-repeat 0 -34px; |
518 | background-size: cover; | 532 | background-size: cover; | ... | ... |
... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
25 | <el-form-item> | 25 | <el-form-item> |
26 | <btn nativeType="cz" @click="handleResetForm">重置</btn> | 26 | <btn nativeType="cz" @click="handleResetForm">重置</btn> |
27 | <btn nativeType="cx" @click="featchDataSelf">查询</btn> | 27 | <btn nativeType="cx" @click="featchDataSelf">查询</btn> |
28 | <btn nativeType="cx" @click="handlesetExport2Excel(downTitle)">导出</btn> | 28 | <btn nativeType="cx" :disableds="disableds" @click="handlesetExport2Excel(downTitle)">导出</btn> |
29 | </el-form-item> | 29 | </el-form-item> |
30 | </el-col> | 30 | </el-col> |
31 | </el-row> | 31 | </el-row> |
... | @@ -45,135 +45,142 @@ | ... | @@ -45,135 +45,142 @@ |
45 | </template> | 45 | </template> |
46 | 46 | ||
47 | <script> | 47 | <script> |
48 | // 接入质量评价表 | 48 | // 接入质量评价表 |
49 | // 引入表格头部数据 | 49 | // 引入表格头部数据 |
50 | import data from "./data"; | 50 | import data from "./data"; |
51 | // 引入table混入方法 | 51 | // 引入table混入方法 |
52 | import tableMixin from "@/mixins/tableMixin.js"; | 52 | import tableMixin from "@/mixins/tableMixin.js"; |
53 | // 导出excel表格 | 53 | // 导出excel表格 |
54 | import downLbTable from '@/components/DownLbTable' | 54 | import downLbTable from '@/components/DownLbTable' |
55 | // 获取时间 | 55 | // 获取时间 |
56 | import { getCurrentDate, setExport2Excel } from "@/utils/tools"; | 56 | import { getCurrentDate, setExport2Excel } from "@/utils/tools"; |
57 | import { dataReceiveQuality } from "@/api/statistics.js"; | 57 | import { dataReceiveQuality } from "@/api/statistics.js"; |
58 | export default { | 58 | export default { |
59 | name: "jsbwcx", | 59 | name: "jsbwcx", |
60 | components: { | 60 | components: { |
61 | downLbTable | 61 | downLbTable |
62 | }, | 62 | }, |
63 | mixins: [tableMixin], | 63 | mixins: [tableMixin], |
64 | data () { | 64 | data () { |
65 | return { | 65 | return { |
66 | pickerOptionsStart: { | 66 | |
67 | disabledDate: (time) => { | 67 | pickerOptionsStart: { |
68 | let endDateVal = this.form.endTime; | 68 | disabledDate: (time) => { |
69 | if (endDateVal) { | 69 | let endDateVal = this.form.endTime; |
70 | return ( | 70 | if (endDateVal) { |
71 | time.getTime() >= | 71 | return ( |
72 | new Date(endDateVal).getTime() | 72 | time.getTime() >= |
73 | ); | 73 | new Date(endDateVal).getTime() |
74 | } | 74 | ); |
75 | } | ||
76 | }, | ||
75 | }, | 77 | }, |
76 | }, | 78 | pickerOptionsEnd: { |
77 | pickerOptionsEnd: { | 79 | disabledDate: (time) => { |
78 | disabledDate: (time) => { | 80 | let beginDateVal = this.form.startTime; |
79 | let beginDateVal = this.form.startTime; | 81 | if (beginDateVal) { |
80 | if (beginDateVal) { | 82 | return ( |
81 | return ( | 83 | time.getTime() < |
82 | time.getTime() < | 84 | new Date(beginDateVal).getTime() |
83 | new Date(beginDateVal).getTime() | 85 | ); |
84 | ); | 86 | } |
85 | } | 87 | }, |
86 | }, | 88 | }, |
87 | }, | 89 | // 表格数据 |
88 | // 表格数据 | 90 | form: { |
91 | startTime: "", // 开始日期 | ||
92 | endTime: "" // 结束日期 | ||
93 | }, | ||
94 | // 校验规则 | ||
95 | rules: { | ||
96 | startTime: [ | ||
97 | { required: true, message: "请选择开始日期", trigger: "change" }, | ||
98 | ], | ||
99 | endTime: [ | ||
100 | { required: true, message: "请选择结束日期", trigger: "change" }, | ||
101 | ] | ||
102 | }, | ||
103 | // 表格数据 | ||
104 | tableData: { | ||
105 | // 表格头部 | ||
106 | columns: [ | ||
107 | { | ||
108 | label: "序号", | ||
109 | type: "index", | ||
110 | width: "50", | ||
111 | // index: this.indexMethod, | ||
112 | } | ||
113 | ] | ||
114 | .concat(data.columns()), | ||
115 | data: [] | ||
116 | }, | ||
117 | // 导出表格标题 | ||
118 | downTitle: '', | ||
119 | disableds: false, | ||
120 | } | ||
121 | }, | ||
122 | watch: { | ||
89 | form: { | 123 | form: { |
90 | startTime: "", // 开始日期 | 124 | handler (newVal, oldVal) { |
91 | endTime: "" // 结束日期 | 125 | this.generateFileName() |
126 | }, | ||
127 | deep: true | ||
128 | } | ||
129 | }, | ||
130 | created () { | ||
131 | this.handleResetForm() | ||
132 | this.generateFileName() | ||
133 | }, | ||
134 | methods: { | ||
135 | handleSearch () { }, | ||
136 | // 生成文件名 | ||
137 | generateFileName () { | ||
138 | var reg = /(\d{4})\-(\d{2})\-(\d{2})/; | ||
139 | this.downTitle = `汉中市不动产登记增量数据接入质量评价表(${this.form.startTime.replace(reg, "$1年$2月$3日")}至${this.form.endTime.replace(reg, "$1年$2月$3日")})` | ||
92 | }, | 140 | }, |
93 | // 校验规则 | 141 | headerStyle ({ row, rowIndex }) { |
94 | rules: { | 142 | if (rowIndex == 4) { |
95 | startTime: [ | 143 | row[2].rowSpan = 2; |
96 | { required: true, message: "请选择开始日期", trigger: "change" }, | 144 | row[3].rowSpan = 2; |
97 | ], | 145 | row[4].rowSpan = 2; |
98 | endTime: [ | 146 | } |
99 | { required: true, message: "请选择结束日期", trigger: "change" }, | ||
100 | ] | ||
101 | }, | 147 | }, |
102 | // 表格数据 | 148 | headerStyle1 ({ row, rowIndex }) { |
103 | tableData: { | 149 | if (rowIndex == 3) { |
104 | // 表格头部 | 150 | row[2].rowSpan = 2; |
105 | columns: [ | 151 | row[3].rowSpan = 2; |
106 | { | 152 | row[4].rowSpan = 2; |
107 | label: "序号", | 153 | } |
108 | type: "index", | ||
109 | width: "50", | ||
110 | // index: this.indexMethod, | ||
111 | } | ||
112 | ] | ||
113 | .concat(data.columns()), | ||
114 | data: [] | ||
115 | }, | 154 | }, |
116 | // 导出表格标题 | 155 | handlesetExport2Excel (val) { |
117 | downTitle: '' | 156 | this.disableds = true |
118 | } | 157 | setTimeout(() => { |
119 | }, | 158 | this.disableds = false |
120 | watch: { | 159 | }, 1000); |
121 | form: { | 160 | |
122 | handler (newVal, oldVal) { | 161 | setExport2Excel(val) |
123 | this.generateFileName() | ||
124 | }, | 162 | }, |
125 | deep: true | 163 | // 初始化数据 |
126 | } | 164 | featchDataSelf () { |
127 | }, | 165 | dataReceiveQuality(this.form.startTime, this.form.endTime).then(res => { |
128 | created () { | 166 | let records = res.result |
129 | this.handleResetForm() | 167 | this.tableData.data = records ? records : [] |
130 | this.generateFileName() | 168 | }) |
131 | }, | 169 | }, |
132 | methods: { | 170 | // 重置 |
133 | handleSearch () { }, | 171 | handleResetForm () { |
134 | // 生成文件名 | 172 | this.form.startTime = getCurrentDate() |
135 | generateFileName () { | 173 | this.form.endTime = getCurrentDate('time') |
136 | var reg = /(\d{4})\-(\d{2})\-(\d{2})/; | 174 | this.featchDataSelf() |
137 | this.downTitle = `汉中市不动产登记增量数据接入质量评价表(${this.form.startTime.replace(reg, "$1年$2月$3日")}至${this.form.endTime.replace(reg, "$1年$2月$3日")})` | ||
138 | }, | ||
139 | headerStyle ({ row, rowIndex }) { | ||
140 | if (rowIndex == 4) { | ||
141 | row[2].rowSpan = 2; | ||
142 | row[3].rowSpan = 2; | ||
143 | row[4].rowSpan = 2; | ||
144 | } | ||
145 | }, | ||
146 | headerStyle1 ({ row, rowIndex }) { | ||
147 | if (rowIndex == 3) { | ||
148 | row[2].rowSpan = 2; | ||
149 | row[3].rowSpan = 2; | ||
150 | row[4].rowSpan = 2; | ||
151 | } | 175 | } |
152 | }, | ||
153 | handlesetExport2Excel (val) { | ||
154 | setExport2Excel(val) | ||
155 | }, | ||
156 | // 初始化数据 | ||
157 | featchDataSelf () { | ||
158 | dataReceiveQuality(this.form.startTime, this.form.endTime).then(res => { | ||
159 | let records = res.result | ||
160 | this.tableData.data = records ? records : [] | ||
161 | }) | ||
162 | }, | ||
163 | // 重置 | ||
164 | handleResetForm () { | ||
165 | this.form.startTime = getCurrentDate() | ||
166 | this.form.endTime = getCurrentDate('time') | ||
167 | this.featchDataSelf() | ||
168 | } | 176 | } |
169 | } | 177 | } |
170 | } | ||
171 | </script> | 178 | </script> |
172 | <style scoped lang="scss"> | 179 | <style scoped lang="scss"> |
173 | @import "../css/index.scss"; | 180 | @import "../css/index.scss"; |
174 | 181 | ||
175 | /deep/th.el-table__cell { | 182 | /deep/th.el-table__cell { |
176 | height: 0 !important; | 183 | height: 0 !important; |
177 | } | 184 | } |
178 | </style> | 185 | </style> |
179 | 186 | ... | ... |
-
Please register or sign in to post a comment