Authored by 陈峰

Merge branch 'release/2.0' of http://git.yoho.cn/fe/yoho-shop-manage into release/2.0

... ... @@ -16,6 +16,10 @@
value: {
type: [Number, String],
default: 0
},
selectWhenOnlyOne: {
type: Boolean,
default: false
}
},
created() {
... ... @@ -23,6 +27,12 @@
this.brandService.getBrand().then((res) => {
this.optionList = res.data;
if (this.selectWhenOnlyOne) {
if (this.optionList.length === 1) {
this.brandId = this.optionList[0].brandId;
}
}
});
},
data() {
... ...
... ... @@ -11,8 +11,6 @@
<layout-list>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="20" show-total></Page>
</layout-list>
</layout-body>
... ... @@ -85,11 +83,6 @@
}
],
tableData: [],
pageData: {
current: 1,
pageSize: 20,
total: 0
},
id: null,
time: null,
storeroomName: null,
... ... @@ -108,9 +101,6 @@
}
},
methods: {
pageChange(num) {
this.pageData.current = num;
},
getExpress(id) {
return this.expressService.show({expressNumber: id}).then((result) => {
if (result.code === 200) {
... ...
... ... @@ -2,23 +2,23 @@
<layout-body>
<layout-filter>
<filter-item :label="filters.id.label">
<Input v-model.trim="filters.id.model" :number="true"
:placeholder="filters.id.holder" :maxlength="9"></Input>
<Input v-model.trim="filters.id.model"
:placeholder="filters.id.holder" ></Input>
</filter-item>
<filter-item :label="filters.expressNumber.label">
<Input v-model.trim="filters.expressNumber.model" :number="true"
:placeholder="filters.expressNumber.holder" :maxlength="9"></Input>
<Input v-model.trim="filters.expressNumber.model"
:placeholder="filters.expressNumber.holder" ></Input>
</filter-item>
<filter-item :label="filters.productSkn.label">
<Input v-model.trim="filters.productSkn.model" :number="true"
:placeholder="filters.productSkn.holder" :maxlength="9"></Input>
<Input v-model.trim="filters.productSkn.model"
:placeholder="filters.productSkn.holder"></Input>
</filter-item>
<filter-item :label="filters.skuFactoryCode.label">
<Input v-model.trim="filters.skuFactoryCode.model" :number="true"
:placeholder="filters.skuFactoryCode.holder" :maxlength="9"></Input>
<Input v-model.trim="filters.skuFactoryCode.model"
:placeholder="filters.skuFactoryCode.holder"></Input>
</filter-item>
<filter-item>
... ...
... ... @@ -13,11 +13,12 @@
</Form-item>
<Form-item label="预计到货时间">
<Date-picker v-model="createDate" type="date" placeholder="选择日期"></Date-picker>
<!--<Date-picker v-model="createDate" type="date" placeholder="选择日期"></Date-picker>-->
<date-pick v-model="createDate"></date-pick>
</Form-item>
<Form-item label="品牌">
<select-brand v-model="brandId"></select-brand>
<select-brand v-model="brandId" :selectWhenOnlyOne="true"></select-brand>
</Form-item>
</Form>
</div>
... ... @@ -33,6 +34,8 @@
<script>
import InvoiceService from 'services/repository/invoice-service';
import DatePick from './date-pick';
import moment from 'moment';
export default {
name: 'create-modal',
... ... @@ -49,8 +52,8 @@ export default {
};
},
computed: {
hanldeDate() {
return this.createDate.getTime() / 1000;
handleDate() {
return moment(this.createDate, 'YYYY-MM-DD').unix();
}
},
methods: {
... ... @@ -111,7 +114,7 @@ export default {
}
this.modal_loading = true;
return this.invoiceService.createOrder(this.storageId, this.hanldeDate, this.brandId).then((result) => {
return this.invoiceService.createOrder(this.storageId, this.handleDate, this.brandId).then((result) => {
if (result.code === 200) {
this.$Message.info('创建成功');
} else {
... ... @@ -124,7 +127,11 @@ export default {
emitEvent() {
this.$emit('on-success');
}
},
components: {
DatePick
}
};
</script>
... ...
<template>
<Date-picker
:value="value"
:type="type"
:options="options"
@on-change="updateHandle"
clearable
placeholder="选择日期">
</Date-picker>
</template>
<script>
const DAY_MS = 86400000;
export default {
props: {
value: {
type: Object,
default: null
},
type: {
type: String,
default: 'date'
},
options: {
type: Object,
default() {
return {
disabledDate(date) {
return date && date.valueOf() < Date.now() - DAY_MS;
}
};
}
}
},
methods: {
updateHandle(newValue) {
this.$emit('input', newValue);
}
},
watch: {
value(newValue) {
this.value = newValue;
}
}
};
</script>
... ...
... ... @@ -63,7 +63,7 @@
brandId: this.brandId
}).then((res) => {
if (res.code === 200) {
this.tableData = res.data.records.map((i) => {
this.tableData = (res.data.records || []).map((i) => {
i.buyingNums = null;
return i;
});
... ... @@ -77,7 +77,7 @@
brandId: this.brandId
}).then((res) => {
if (res.code === 200) {
this.tableData = res.data.goodsList.map((i) => {
this.tableData = (res.data.goodsList || []).map((i) => {
i.editable = false;
return i;
});
... ... @@ -108,7 +108,7 @@
this.invoiceService.addGoods(data).then((result) => {
if (result.code === 200) {
this.$Message.info('加入成功');
this.search();
params.row.hasAdded = true;
} else {
this.$Message.error('加入失败');
}
... ...
... ... @@ -49,9 +49,20 @@
methods: {
onClickCreate() {
this.tableData = this.$refs.goodsList.rebuildData;
this.$refs.sendModal.show(this.id, this.tableData.filter(i => {
let select = this.tableData.filter(i => {
return _.find(this.selection, (s) => s.id === i.id);
}));
});
if (!select.some((i) => {
return i.num && i.num <= i.buyingNums;
})) {
this.$Message.error('请正确填写发货数量');
this.selection = [];
return;
}
this.$refs.sendModal.show(this.id, select);
},
getGoods() {
return this.invoiceService.listProduct({
... ... @@ -61,6 +72,7 @@
if (res.code === 200) {
this.tableData = (res.data.goodsList || []).map((i) => {
i.num = null;
i._disabled = i.shipmentsNums === i.buyingNums;
return i;
});
}
... ...
... ... @@ -6,7 +6,7 @@
</filter-item>
<filter-item label="预计到货">
<Date-picker v-model="arrival" type="date" placeholder="选择日期"></Date-picker>
<Date-Pick v-model="arrival"></Date-Pick>
</filter-item>
<filter-item >
... ... @@ -41,7 +41,9 @@
import ProductList from './components/product-list';
import OrderInfo from './components/order-info';
import DatePick from './components/date-pick';
import InvoiceService from 'services/repository/invoice-service';
import moment from 'moment';
export default {
props: ['isEdit'],
... ... @@ -50,7 +52,7 @@
count: 0,
id: '',
storeId: '',
arrivalTime: new Date().getTime() / 1000,
arrivalTime: null,
brandId: '',
info: null
};
... ... @@ -63,10 +65,10 @@
computed: {
arrival: {
get() {
return new Date(this.arrivalTime * 1000);
return moment.unix(this.arrivalTime).format('YYYY-MM-DD');
},
set(newVal) {
this.arrivalTime = newVal.getTime() / 1000;
this.arrivalTime = moment(newVal, 'YYYY-MM-DD').unix();
}
}
},
... ... @@ -101,7 +103,8 @@
},
components: {
ProductList,
OrderInfo
OrderInfo,
DatePick
}
};
</script>
... ...
... ... @@ -69,11 +69,11 @@ let tableCols = function() {
},
{
title: '发货进度 已发数/采购数',
title: '发货进度 已发数/需发总数',
key: 'editTime',
align: 'center',
renderHeader() {
return '发货进度<br/> 已发数/采购数 ';
return '发货进度<br/> 已发数/需发总数 ';
},
render: (h, params) => {
let percent = 0;
... ... @@ -98,11 +98,11 @@ let tableCols = function() {
},
{
title: '入库进度 已入库数/采购数',
title: '入库进度 已入库数/需发总数',
key: 'editTime',
align: 'center',
renderHeader() {
return '入库进度<br/> 已入库数/采购数';
return '入库进度<br/> 已入库数/需发总数';
},
render: (h, params) => {
let percent = 0;
... ... @@ -131,10 +131,14 @@ let tableCols = function() {
key: 'action',
align: 'center',
render: (h, params) => {
let disabled = params.row.shipmentsNums === params.row.buyingNums;
return (
<i-input
value={params.row.num}
onInput={val => (params.row.num = val)}/>
onInput={val => (params.row.num = val)}
disabled={disabled}
/>
);
}
}
... ...
... ... @@ -72,7 +72,7 @@ let tableCols = function() {
);
},
renderHeader() {
return '发货进度<br/> 已发数/采购数 ';
return '发货进度<br/> 已发数/需发总数 ';
}
},
... ... @@ -101,7 +101,7 @@ let tableCols = function() {
);
},
renderHeader() {
return '入库进度<br/> 已入库数/采购数';
return '入库进度<br/> 已入库数/需发总数';
}
},
... ...
... ... @@ -112,7 +112,7 @@ let cols = function() {
if (!params.row.hasAdded) {
return (
<div class="action-btn-row">
<i-button type='warning' size="small" onClick={() => this.create(params)}> 保存 </i-button>
<i-button type='warning' size="small" onClick={() => this.create(params)}> 添加 </i-button>
</div>
);
} else {
... ... @@ -217,7 +217,7 @@ let infoCols = function() {
);
},
renderHeader() {
return '入库进度<br/> 已入库数/采购数';
return '入库进度<br/> 已入库数/需发总数';
}
},
];
... ...
... ... @@ -2,7 +2,7 @@
* Created by TaoHuang on 2017/5/8.
*/
import ProductList from './produc-list';
import ProductList from './product-list';
import EditName from './edit-name';
export {
... ...
... ... @@ -218,7 +218,7 @@
if (res.code === 200) {
this.tableData = res.data.list;
this.pageData.total = res.data.total;
this.pageData.current = res.data.page ;
this.pageData.current = res.data.page;
}
});
},
... ...