Showing
1 changed file
with
15 additions
and
3 deletions
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <layout-filter> | 3 | <layout-filter> |
4 | <filter-item :label="filters.id.label"> | 4 | <filter-item :label="filters.id.label"> |
5 | <Input v-model.trim="filters.id.model" | 5 | <Input v-model.trim="filters.id.model" |
6 | - :placeholder="filters.id.holder" ></Input> | 6 | + :placeholder="filters.id.holder" maxlength="9" ></Input> |
7 | </filter-item> | 7 | </filter-item> |
8 | 8 | ||
9 | <filter-item :label="filters.expressNumber.label"> | 9 | <filter-item :label="filters.expressNumber.label"> |
@@ -100,7 +100,11 @@ | @@ -100,7 +100,11 @@ | ||
100 | let params = {}; | 100 | let params = {}; |
101 | 101 | ||
102 | if (this.filters.id.model) { | 102 | if (this.filters.id.model) { |
103 | - params.proReqFormId = this.filters.id.model; | 103 | + if (this.isNumber(this.filters.id.model)) { |
104 | + params.proReqFormId = this.filters.id.model; | ||
105 | + } else { | ||
106 | + return Promise.reject('入库单号必须是数字'); | ||
107 | + } | ||
104 | } | 108 | } |
105 | 109 | ||
106 | if (this.filters.expressNumber.model) { | 110 | if (this.filters.expressNumber.model) { |
@@ -121,8 +125,8 @@ | @@ -121,8 +125,8 @@ | ||
121 | return Promise.resolve(params); | 125 | return Promise.resolve(params); |
122 | }, | 126 | }, |
123 | getExpress() { | 127 | getExpress() { |
128 | + this.$Loading.start(); | ||
124 | return this.filtersParams().then((params) => { | 129 | return this.filtersParams().then((params) => { |
125 | - this.$Loading.start(); | ||
126 | return this.expressService.list(params); | 130 | return this.expressService.list(params); |
127 | }).then((result) => { | 131 | }).then((result) => { |
128 | if (result.code === 200) { | 132 | if (result.code === 200) { |
@@ -131,6 +135,9 @@ | @@ -131,6 +135,9 @@ | ||
131 | this.tableData = result.data.records; | 135 | this.tableData = result.data.records; |
132 | } | 136 | } |
133 | this.$Loading.finish(); | 137 | this.$Loading.finish(); |
138 | + }).catch((err) => { | ||
139 | + this.$Loading.finish(); | ||
140 | + this.$Message.error(err); | ||
134 | }); | 141 | }); |
135 | }, | 142 | }, |
136 | info(data) { | 143 | info(data) { |
@@ -148,6 +155,11 @@ | @@ -148,6 +155,11 @@ | ||
148 | this.expressService.exportList().then((url) => { | 155 | this.expressService.exportList().then((url) => { |
149 | window.open(url, '_blank'); | 156 | window.open(url, '_blank'); |
150 | }); | 157 | }); |
158 | + }, | ||
159 | + isNumber(numStr) { | ||
160 | + const isNumber = /^[0-9]+$/; | ||
161 | + | ||
162 | + return isNumber.test(numStr); | ||
151 | } | 163 | } |
152 | } | 164 | } |
153 | }; | 165 | }; |
-
Please register or login to post a comment