Commit 99241393 by LJM

订单追踪/已采购订单:生成发货单无事件触发

parent 7ffb2665
Showing with 147 additions and 138 deletions
...@@ -3,12 +3,10 @@ ...@@ -3,12 +3,10 @@
<div class="goods-con"> <div class="goods-con">
<el-form :inline="true" :model="formInline" label-width="80px" ref="formInline"> <el-form :inline="true" :model="formInline" label-width="80px" ref="formInline">
<el-form-item label="型号" prop="goods_name"> <el-form-item label="型号" prop="goods_name">
<el-autocomplete v-model="formInline.goods_name" :trigger-on-focus="false" @keyup.enter.native="onSubmit" <el-autocomplete v-model="formInline.goods_name" :trigger-on-focus="false" @keyup.enter.native="onSubmit" :fetch-suggestions="querySearchAsync" placeholder="请输入型号" clearable></el-autocomplete>
:fetch-suggestions="querySearchAsync" placeholder="请输入型号" clearable></el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label="品牌" prop="brand_name"> <el-form-item label="品牌" prop="brand_name">
<el-autocomplete v-model="formInline.brand_name" :trigger-on-focus="false" @keyup.enter.native="onSubmit" <el-autocomplete v-model="formInline.brand_name" :trigger-on-focus="false" @keyup.enter.native="onSubmit" :fetch-suggestions="querySearchAsyncBrand" placeholder="请输入品牌" clearable></el-autocomplete>
:fetch-suggestions="querySearchAsyncBrand" placeholder="请输入品牌" clearable></el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label="订单状态" prop="status"> <el-form-item label="订单状态" prop="status">
<el-select v-model="formInline.status" placeholder="请选择"> <el-select v-model="formInline.status" placeholder="请选择">
...@@ -55,9 +53,9 @@ ...@@ -55,9 +53,9 @@
<div class="data-box th-all" v-if="tableData"> <div class="data-box th-all" v-if="tableData">
<el-table :data="tableData" border max-height="600" @selection-change="handleSelectionChange"> <el-table :data="tableData" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="37"></el-table-column> <el-table-column fixed type="selection" width="37"></el-table-column>
<el-table-column label="订货公司" min-width="150"> <el-table-column label="订货公司" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="'/#/orderTrackGoodsDetail?purchase_id='+scope.row.purchase_id" class="f-blue">{{ scope.row.company_name }}</a> <a :href="'/#/orderTrackGoodsDetail?purchase_id='+scope.row.purchase_id" class="f-blue">{{ scope.row.company_name }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status_val" label="订单状态" min-width="80"></el-table-column> <el-table-column prop="status_val" label="订单状态" min-width="80"></el-table-column>
...@@ -70,152 +68,162 @@ ...@@ -70,152 +68,162 @@
<el-table-column prop="source_type" label="订单来源" width="100"></el-table-column> <el-table-column prop="source_type" label="订单来源" width="100"></el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="150"></el-table-column> <el-table-column prop="create_time" label="创建时间" min-width="150"></el-table-column>
</el-table> </el-table>
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]"
:total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"> :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
<Menu /> <Menu/>
</section> </section>
</template> </template>
<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, Button, Table, TableColumn, Message, Dialog, Pagination, Autocomplete, Cascader, DatePicker} from 'element-ui' import {Autocomplete, Button, Cascader, DatePicker, Dialog, Form, FormItem, Input, Message, Option, Pagination, Select, Table, TableColumn} from 'element-ui'
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination);
Vue.use(TableColumn).use(Table).use(Cascader).use(Autocomplete).use(DatePicker); Vue.use(TableColumn).use(Table).use(Cascader).use(Autocomplete).use(DatePicker);
export default { export default {
name: "orderTrackGoods", name: "orderTrackGoods",
data() { data() {
return { return {
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
formInline: { formInline: {
goods_name: '', goods_name: '',
brand_name: '', brand_name: '',
shipping_status: '', shipping_status: '',
status: '', status: '',
pay_status: '', pay_status: '',
quote_sn: '', quote_sn: '',
source_type: '', source_type: '',
},
tableData: "",
multipleSelection:[]
};
},
created() {
this.getData();
},
computed: {},
methods: {
getData() {
this.$http('post', "/api/purchase/getPurchaseList", {
page: this.page,
limit: this.limit,
brand_name: this.formInline.brand_name,
goods_name: this.formInline.goods_name,
shipping_status: this.formInline.shipping_status,
status: this.formInline.status,
pay_status: this.formInline.pay_status,
quote_sn: this.formInline.quote_sn,
source_type: this.formInline.source_type,
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: "error"
});
}
})
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
submit() {
this.page = 1;
this.getData();
}, },
resetForm(formName) { tableData: "",
this.$refs[formName].resetFields(); multipleSelection: []
}, };
//生成发货单 },
addSend() { created() {
if (this.multipleSelection.length != 1) { this.getData();
},
computed: {},
methods: {
getData() {
this.$http('post', "/api/purchase/getPurchaseList", {
page: this.page,
limit: this.limit,
brand_name: this.formInline.brand_name,
goods_name: this.formInline.goods_name,
shipping_status: this.formInline.shipping_status,
status: this.formInline.status,
pay_status: this.formInline.pay_status,
quote_sn: this.formInline.quote_sn,
source_type: this.formInline.source_type,
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({ this.$message({
message: "请选择一条数据进行操作", message: res.msg,
type: 'warning' type: "error"
}); });
return
} }
this.$router.push({ })
path: "/OrderTrackPurAdd", },
query: { handleCurrentChange(val) {
purchase_id:this.multipleSelection[0].purchase_id this.page = val;
} this.getData();
}) },
}, handleSelectionChange(val) {
//型号 this.multipleSelection = val;
querySearchAsync(queryString, cb) { },
this.$http('get', "/api/search/getspu", { handleSizeChange(val) {
spu_name: queryString this.limit = val;
}).then(res => { this.getData();
if (res.code == 0) { },
if (res.data.list.length > 0) { submit() {
var arrlist_ = res.data.list || []; this.page = 1;
var arr_ = [] this.getData();
for (var i = 0; i < arrlist_.length; i++) { },
arr_.push({ resetForm(formName) {
value: arrlist_[i]['spu_name'] this.$refs[formName].resetFields();
}) },
} //生成发货单
cb(arr_); addSend() {
} else { if (this.multipleSelection.length != 1) {
cb([]); this.$message({
message: "请选择一条数据进行操作",
type: 'warning'
});
return false;
}
if (this.multipleSelection[0].shipping_status_val != '待发货') {
this.$message({
message: "请选择待发货数据进行操作",
type: 'warning'
});
return false;
}
this.$router.push({
path: "/OrderTrackPurAdd",
query: {
purchase_id: this.multipleSelection[0].purchase_id
}
})
},
//型号
querySearchAsync(queryString, cb) {
this.$http('get', "/api/search/getspu", {
spu_name: queryString
}).then(res => {
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
} }
cb(arr_);
} else {
cb([]);
} }
}) }
}, })
//品牌 },
querySearchAsyncBrand(queryString, cb) { //品牌
this.$http('get', "/api/brand/get_stand_brand", { querySearchAsyncBrand(queryString, cb) {
brand: queryString this.$http('get', "/api/brand/get_stand_brand", {
}).then(res => { brand: queryString
if (res.code == 0) { }).then(res => {
if (res.data.list.length > 0) { if (res.code == 0) {
var arrlist_ = res.data.list || []; if (res.data.list.length > 0) {
var arr_ = [] var arrlist_ = res.data.list || [];
for (var i = 0; i < arrlist_.length; i++) { var arr_ = []
arr_.push({ for (var i = 0; i < arrlist_.length; i++) {
value: arrlist_[i] arr_.push({
}) value: arrlist_[i]
} })
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
}) }
}, })
}, },
components: { },
Menu components: {
} Menu
}; }
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/goods/goods.min.css"; @import "../../assets/css/goods/goods.min.css";
</style> </style>
\ No newline at end of file
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