Authored by 陈峰

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

... ... @@ -517,6 +517,7 @@ export default {
JSON.stringify(this.handleColor());
newProduct.goodsImagesReqStr =
JSON.stringify(this.productCreateService.handleEditColorImage(this.product));
newProduct.productStandardRelationStr =
JSON.stringify(this.productCreateService.handleRelation(this.render.productStandardRelationStr));
newProduct.attributeProValuesOne =
... ... @@ -565,7 +566,8 @@ export default {
return Promise.reject();
}
})
.then(this.save).catch(() => this.$Loading.error());
.then(this.save)
.catch(() => this.$Loading.error());
},
handleColor() {
return this.table.data.map(tableColor => {
... ...
... ... @@ -3,7 +3,7 @@
<layout-filter>
<filter-item :label="filters.orderNo.label">
<Input v-model.trim="filters.orderNo.model"
:placeholder="filters.orderNo.holder"></Input>
:placeholder="filters.orderNo.holder" :maxlength="9"></Input>
</filter-item>
<filter-item :label="filters.orderTime.label">
<Date-picker type="daterange"
... ... @@ -18,7 +18,7 @@
</filter-item>
</layout-filter>
<layout-list>
<Table border :context="self" :columns="tableCols" :data="tableData"></Table>
<Table border :columns="columns" :data="dataList"></Table>
<Page :total="page.total" :current="page.current"
@on-change="pageChange" :page-size="20" show-total></Page>
</layout-list>
... ... @@ -27,28 +27,15 @@
<script>
import _ from 'lodash';
import moment from 'moment';
import {TradeService} from 'services/trade';
import allotStore from './store';
import {TradeService} from 'services/trade';
export default {
data() {
return {
self: this,
tableCols: [],
tableData: {},
page: {},
filters: {},
enableFilter: false
};
return allotStore.apply(this);
},
created() {
this.tradeService = new TradeService();
const allot = allotStore.apply(this);
this.page = allot.page;
this.tableData = allot.list;
this.filters = allot.fields;
this.tableCols = allot.columns;
this.allotList(this.filterValues());
},
methods: {
... ... @@ -94,11 +81,12 @@
this.allotList(this.filterValues());
},
clearFilter() {
const allot = allotStore.apply(this);
this.page.current = 1;
this.enableFilter = false;
this.filters = allot.fields;
this.filters.orderNo.model = '';
this.filters.orderTime.model = '';
this.filters.startTime.model = '';
this.filters.endTime.model = '';
this.allotList(this.filterValues());
},
allotList(params) {
... ... @@ -125,7 +113,7 @@
this.page.current = 1;
},
resolveData(data) {
this.tableData = data.records;
this.dataList = data.records;
this.page.total = data.totalCount;
},
pageChange(page) {
... ...
... ... @@ -7,6 +7,7 @@ import timeFormat from 'filters/time-format';
export default function() {
return {
enableFilter: false,
columns: [
{
title: '调拨单号',
... ... @@ -133,12 +134,12 @@ export default function() {
}
}
],
list: [],
dataList: [],
page: {
total: 0,
current: 1
},
fields: {
filters: {
orderNo: {
label: '调拨单号',
model: ''
... ...
... ... @@ -285,14 +285,17 @@ class ProductCreateService extends Service {
}
addNoneItem(objArray) {
objArray.forEach(obj => {
const objArrayClone = _.cloneDeep(objArray);
objArrayClone.forEach(obj => {
obj.model = [];
if (obj.inputType === 'checkbox') {
return;
}
obj.idNameList && obj.idNameList.unshift({id: 0, text: '请选择' + obj.attributeName});
});
return objArray;
return objArrayClone;
}
}
... ...