Authored by 李奇

trade service 添加

import OutStock from './out-stock';
export {
OutStock
};
... ...
<template>
<Modal
v-model="showModal"
@on-ok="ok"
@on-cancel="cancel"
width="auto"
class-name="out-stock-modal"
cancel-text="取消"
ok-text="提交">
<div class="detail">
<Table
stripe
:columns="tableCols"
:data="tableData">
</Table>
</div>
<p class="danger-tip">
*缺货数量提交后无法更改,平台将对顾客订单商品进行退单处理,请慎重操作!
</p>
</Modal>
</template>
<script>
import tradeService from 'trade-service';
import _ from 'lodash';
export default {
name: 'OutStock',
props: {
},
data() {
return {
showModal: true,
showLoading: true,
tableCols: [
{
title: '商品图片',
key: 'image'
},
{
title: '商品信息',
key: 'info'
},
{
title: '缺货数',
key: 'shortNum'
}
],
tableData: [
{
shortNum: 2
}
]
};
},
watch: {
},
methods: {
ok(){
// todo
},
cancel(){
this.$Message.info('click cancel')
}
}
};
</script>
<style lang="scss">
.out-stock-modal {
.detail {
height: 200px;
}
.danger-tip {
color: #ff0000;
text-align: center;
}
.ivu-modal {
width: 70%;
}
}
</style>
... ...
<template>
<div class="un-finished">
<div class="un-done">
<LayoutFilter>
<FilterItem :label="filters.orderNo.label">
<Input v-model.trim="filters.orderNo.model"
... ... @@ -44,6 +44,11 @@
<Page :total="page.total" :current="page.current"
@on-change="pageChange" :page-size="20" show-total></Page>
</LayoutList>
<div class="haha">
<OutStock></OutStock>
</div>
</div>
</template>
... ... @@ -52,8 +57,11 @@
import moment from 'moment';
import service from 'trade-service';
import Store from '../store/undone';
import { OutStock } from 'trade/out-stock'
import { CellInfo, CellDispatch, CellDeliver, CellStockOut } from 'trade/table-cell';
console.log(OutStock)
export default {
name: 'TabUndone',
... ... @@ -62,11 +70,13 @@
self: this,
filters: {},
page: {},
table: {}
table: {},
useFilterSign: false,
showOutStock: true
};
},
created() {
const store = new Store();
const store = Store();
this.filters = store.filters;
this.page = store.page;
... ... @@ -128,14 +138,31 @@
});
},
filterSearch(){
this.params();
const params = this.params();
this.useFilterSign = true;
this.productList(params);
this.page.current = 1;
},
clearFilter(){
this.filters = Store().filters;
this.productList();
this.useFilterSign = false;
this.page.current = 1;
},
pageChange(page) {
let params = {};
this.page.current = page;
if(this.useFilterSign) {
params = this.params();
}
},
pageChange() {
_.merge(params, {
page
});
this.productList(params);
},
selectChange(){
... ... @@ -160,7 +187,8 @@
CellInfo,
CellDispatch,
CellDeliver,
CellStockOut
CellStockOut,
OutStock
}
};
</script>
... ...
... ... @@ -4,10 +4,9 @@
* @date: 04/05/2017
*/
class Store {
constructor() {
console.log('new instance Data')
this.filters = {
export default () => {
return {
filters: {
orderNo: {
label: '入库单号',
model: '',
... ... @@ -61,12 +60,12 @@ class Store {
}
]
}
};
this.page = {
},
page: {
total: 0,
current: 1
};
this.table = {
},
table: {
cols: [
{
type: 'selection',
... ... @@ -138,6 +137,4 @@ class Store {
list: []
}
}
}
export default Store;
\ No newline at end of file
};
\ No newline at end of file
... ...
... ... @@ -3,12 +3,16 @@
* @author: Leo
* @date: 2017/05/04
*/
import _ from 'lodash';
import axios from 'axios';
const apiUrl = {
allotPurchaseList: '/erp/allotPurchaseList',
allotDelivery: '/erp/delivery',
allotDelivery: '/erp/allotDelivery',
allotExpressList: '/erp/allotExpressList',
allotExpressDetail: '/erp/allotExpressDetail',
allotWarehouseInfo: '/erp/allotWarehouseInfo',
allotStockOut: '/erp/allotStockOut',
allotExpressNumList: '/erp/allotExpressNumList'
};
const tradeService = {
... ... @@ -22,6 +26,66 @@ const tradeService = {
return {};
});
},
allotDelivery(params) {
return axios.post(apiUrl.allotDelivery, params)
.then(res => {
if(res.status === 200) {
return res.data;
}
return {};
});
},
allotExpressList(params) {
return axios.post(apiUrl.allotExpressList, params)
.then(res => {
if(res.status === 200) {
return res.data;
}
return {};
});
},
allotExpressDetail(params) {
return axios.post(apiUrl.allotExpressDetail, params)
.then(res => {
if(res.status === 200) {
return res.data;
}
return {};
});
},
allotWarehouseInfo(params) {
return axios.post(apiUrl.allotWarehouseInfo, params)
.then(res => {
if(res.status === 200) {
return res.data;
}
return {};
});
},
allotStockOut(params) {
return axios.post(apiUrl.allotStockOut, params)
.then(res => {
if(res.status === 200) {
return res.data;
}
return {};
});
},
allotExpressNumList(params) {
return axios.post(apiUrl.allotExpressNumList, params)
.then(res => {
if(res.status === 200) {
return res.data;
}
return {};
});
},
};
export default tradeService;
... ...