Commit 8a3a304b authored by 严宝瑞's avatar 严宝瑞

添加提示及相关修改

parent dec0c328
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
clearable clearable
style="width:500px;border-radius:0" style="width:500px;border-radius:0"
v-model="no" v-model="no"
@keyup.enter.native="query"
placeholder="Please enter the PO NO.(Order NO.) for enquiry" placeholder="Please enter the PO NO.(Order NO.) for enquiry"
> >
<el-button <el-button
...@@ -96,8 +97,9 @@ export default { ...@@ -96,8 +97,9 @@ export default {
}, },
methods: { methods: {
query() { query() {
this.no = this.no.trim();
this.result = {};
if (!this.no) { if (!this.no) {
this.result = {};
return; return;
} }
this.pageLoading = true; this.pageLoading = true;
...@@ -106,11 +108,30 @@ export default { ...@@ -106,11 +108,30 @@ export default {
url: `api/order/search/${this.no}` url: `api/order/search/${this.no}`
}) })
.then(res => { .then(res => {
this.result = res.data.data; console.log(res);
this.pageLoading = false; if (res && res.data && res.data.data) {
console.log(this.result); this.$message({
showClose: true,
message: "success",
type: "success"
});
this.result = res.data.data;
this.pageLoading = false;
} else {
this.$message({
showClose: true,
message: res.data.msg,
type: "error"
});
this.pageLoading = false;
}
}) })
.catch(err => { .catch(err => {
this.$message({
showClose: true,
message: "error",
type: "error"
});
this.pageLoading = false; this.pageLoading = false;
console.log(err); console.log(err);
}); });
......
import Vue from "vue"; import Vue from "vue";
import App from "./App.vue"; import App from "./App.vue";
import { Input, Button, Table, TableColumn, Image } from "element-ui"; import { Input, Button, Table, TableColumn, Image, Message } from "element-ui";
import "element-ui/lib/theme-chalk/index.css"; import "element-ui/lib/theme-chalk/index.css";
import lang from "element-ui/lib/locale/lang/en"; import lang from "element-ui/lib/locale/lang/en";
import locale from "element-ui/lib/locale"; import locale from "element-ui/lib/locale";
// 设置语言 // 设置语言
locale.use(lang); locale.use(lang);
Vue.use(Input); Vue.use(Input);
...@@ -13,6 +12,7 @@ Vue.use(Button); ...@@ -13,6 +12,7 @@ Vue.use(Button);
Vue.use(Table); Vue.use(Table);
Vue.use(TableColumn); Vue.use(TableColumn);
Vue.use(Image); Vue.use(Image);
Vue.prototype.$message = Message;
import axios from "axios"; import axios from "axios";
Vue.prototype.$http = axios; Vue.prototype.$http = axios;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment