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

添加提示及相关修改

parent dec0c328
......@@ -5,6 +5,7 @@
clearable
style="width:500px;border-radius:0"
v-model="no"
@keyup.enter.native="query"
placeholder="Please enter the PO NO.(Order NO.) for enquiry"
>
<el-button
......@@ -96,8 +97,9 @@ export default {
},
methods: {
query() {
this.no = this.no.trim();
this.result = {};
if (!this.no) {
this.result = {};
return;
}
this.pageLoading = true;
......@@ -106,11 +108,30 @@ export default {
url: `api/order/search/${this.no}`
})
.then(res => {
this.result = res.data.data;
this.pageLoading = false;
console.log(this.result);
console.log(res);
if (res && res.data && res.data.data) {
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 => {
this.$message({
showClose: true,
message: "error",
type: "error"
});
this.pageLoading = false;
console.log(err);
});
......
import Vue from "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 lang from "element-ui/lib/locale/lang/en";
import locale from "element-ui/lib/locale";
// 设置语言
locale.use(lang);
Vue.use(Input);
......@@ -13,6 +12,7 @@ Vue.use(Button);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(Image);
Vue.prototype.$message = Message;
import axios from "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