Commit 2373e54a by LJM

bug

parent 95b85ef1
Showing with 49 additions and 42 deletions
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Form, FormItem, Select, Option, Input, DatePicker, Button, Dropdown, DropdownMenu, DropdownItem, Table, TableColumn, Message, MessageBox, Dialog, Pagination, Tooltip, Autocomplete, Popover, Tag} from 'element-ui' import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
...@@ -423,50 +423,57 @@ export default { ...@@ -423,50 +423,57 @@ export default {
//新增优势货源提交 //新增优势货源提交
addBestgoodsSubmit() { addBestgoodsSubmit() {
var self = this; var self = this;
for (let i = 0; i < this.addBestgoodsParam.length; i++) {
if (!this.addBestgoodsParam[i].goods_name) {
this.$message({
message: '请输入第' + (i + 1) + '行型号',
type: 'warning'
});
return false;
}
if (!this.addBestgoodsParam[i].brand_name) { if (this.addBestgoodsParam.length > 0) {
this.$message({
message: '请输入第' + (i + 1) + '行品牌',
type: 'warning'
});
return false;
}
if (!this.addBestgoodsParam[i].start_order_number) {
this.$message({
message: '请输入第' + (i + 1) + '行起订量',
type: 'warning'
});
return false;
}
}
this.$http('post', "/api/bestgoods/addBestgoods", {add_json: JSON.stringify(this.addBestgoodsParam)}).then(res => { for (let i = 0; i < this.addBestgoodsParam.length; i++) {
if (res.code === 0) { if (!this.addBestgoodsParam[i].goods_name) {
this.$message({ this.$message({
message: res.msg, message: '请输入第' + (i + 1) + '行型号',
type: 'success', type: 'warning'
duration: 2000, });
onClose() { return false;
self.addBestgoods.dialogVisible = false; }
self.getData();
}
});
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
if (!this.addBestgoodsParam[i].brand_name) {
this.$message({
message: '请输入第' + (i + 1) + '行品牌',
type: 'warning'
});
return false;
}
if (!this.addBestgoodsParam[i].start_order_number) {
this.$message({
message: '请输入第' + (i + 1) + '行起订量',
type: 'warning'
});
return false;
}
}
this.$http('post', "/api/bestgoods/addBestgoods", {add_json: JSON.stringify(this.addBestgoodsParam)}).then(res => {
if (res.code === 0) {
this.$message({
message: res.msg,
type: 'success',
duration: 2000,
onClose() {
self.addBestgoods.dialogVisible = false;
self.getData();
}
});
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
} else {
this.$message({
message: '请添加数据',
type: 'warning'
});
}
}, },
//修改优势货源提交 //修改优势货源提交
updateBestgoodsSubmit() { updateBestgoodsSubmit() {
......
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 sign in to comment