Authored by htoooth

Merge branch 'release/2.0' into refactor/2.0

# Conflicts:
#	app/pages/product/edit/edit.vue
... ... @@ -16,6 +16,10 @@
},
brandId: {
type: String
},
selectWhenOnlyOne: {
type: Boolean,
default: false
}
},
data() {
... ... @@ -41,6 +45,10 @@
this.sellTypeService.getSellType({brandId: newValue}).then((result) => {
if (result.code === 200) {
this.list = result.data;
if (result.data.length === 1 && this.selectWhenOnlyOne) {
this.value = result.data[0].id;
}
}
});
}
... ...
... ... @@ -10,11 +10,14 @@
<Form ref="formData" :model="formData" :label-width="70" :rules="ruleValidate">
<Form-item label="品牌" prop="brandId">
<select-brand v-model="formData.brandId" @change="selectBrand" style="width: 300px;"></select-brand>
<select-brand v-model="formData.brandId" @change="selectBrand" :selectWhenOnlyOne="true" style="width: 300px;"></select-brand>
</Form-item>
<Form-item label="销售类型" prop="sellType">
<select-sell-type v-model="formData.sellType" style="width: 300px;" :brandId="formData.brandId" @change="selectSellType">
<select-sell-type v-model="formData.sellType" style="width: 300px;"
:brandId="formData.brandId"
@change="selectSellType"
:selectWhenOnlyOne="true">
</select-sell-type>
</Form-item>
... ...
... ... @@ -144,7 +144,9 @@ export default {
this.productService.getProduct(this.$route.params.id).then((result) => {
if (result.code === 200) {
this.product = result.data;
// 这里的处理单选的问题,双向绑定的问题
Object.assign(this.product, result.data);
_.update(this.product, 'goodsSeason', (s) => `${s}`);
if (!_.has(this.product, 'materialList')) {
this.product.materialList = [];
... ... @@ -161,12 +163,17 @@ export default {
if (!_.has(this.product, 'ageLevel')) {
this.product.ageLevel = '';
}
} else {
return Promise.reject();
}
}).then(() => {
return this.getAllAttr(this.product.smallSortId, this.product.maxSortId);
}).then(() => {
this.init();
this.showLoading = false;
}).catch(() => {
this.$Message.error('商品出错');
this.showLoading = false;
});
},
methods: {
... ... @@ -351,7 +358,10 @@ export default {
let goodsList = this.product.sellerGoodList;
this.product.goods = _.range(goodsList.length || 0).map((i) => {
return this.productCreateService.handleGoodsImage(this.product.sellerGoodsImagesList[i] || {});
return this.productCreateService.handleGoodsImage(
goodsList[i],
this.product.sellerGoodsImagesList[i] || {}
);
});
},
handleItem(goods, goodsImage) {
... ...
... ... @@ -34,11 +34,11 @@
</filter-item>
<filter-item label="品牌">
<select-brand v-model="brandId"></select-brand>
<select-brand v-model="brandId" :selectWhenOnlyOne="true"></select-brand>
</filter-item>
<filter-item label="销售类型">
<select-sell-type v-model="sellType" :brandId="brandId"></select-sell-type>
<select-sell-type v-model="sellType" :brandId="brandId" :selectWhenOnlyOne="true"></select-sell-type>
</filter-item>
<filter-item label="上传文件">
... ...
... ... @@ -6,8 +6,8 @@
</div>
<layout-action>
<Button type="primary" @click="back">返回入库物流列表</Button>
<Button type="primary" @click="print">打印</Button>
<Button @click="back">返回入库物流列表</Button>
</layout-action>
<layout-list>
... ...
... ... @@ -84,7 +84,9 @@
return this.invoiceService.listAvailableProduct({
proRequisitionFormId: this.oid,
brandId: this.brandId,
skuFactoryCode: this.skuFactoryCode
skuFactoryCode: this.skuFactoryCode,
pageNo: this.pageData.current,
pageSize: this.pageData.pageSize
}).then((res) => {
if (res.code === 200) {
this.tableData = (res.data.records || []).map((i) => {
... ... @@ -92,7 +94,7 @@
return i;
});
this.pageData.total = res.data.totalCount;
this.pageData.current = res.data.pageNo + 1;
this.pageData.current = res.data.pageNo;
} else {
this.tableData = [];
this.pageData.total = 0;
... ...
... ... @@ -7,8 +7,8 @@
</layout-filter>
<layout-action>
<Button type="error" @click="onClickCreate" :disabled="this.selection.length === 0">发货</Button>
<Button type="primary" @click="$router.go(-1)">返回发货入库列表</Button>
<Button type="primary" @click="onClickCreate" :disabled="this.selection.length === 0">发货</Button>
<Button @click="$router.go(-1)">返回发货入库列表</Button>
</layout-action>
<layout-list>
... ...
... ... @@ -3,7 +3,7 @@
<order-info ref="info" :id="id"></order-info>
<layout-action>
<Button type="primary" @click="back">返回发货入库列表</Button>
<Button @click="back">返回发货入库列表</Button>
</layout-action>
<layout-list>
<Tabs type="card" :animated="false" @on-click="onTabsClick">
... ...
... ... @@ -3,7 +3,7 @@
* @author: leo
* @date: 04/05/2017
*/
import { CellInfo} from 'components/cell';
import CellInfo from 'components/cell/cell-info';
import { CellDispatch, CellDeliver, CellStockOut } from '../components';
export default function() {
... ...
... ... @@ -59,7 +59,6 @@
name: 'TabDone',
data() {
return {
self: this,
filters: {},
page: {},
table: {},
... ...
... ... @@ -53,6 +53,7 @@
const params = {
pageNo: 1,
pageSize: 20,
sellTypes: [7],
statusList: [2, 3]
};
... ... @@ -96,13 +97,14 @@
const data = {
pageNo: 1,
pageSize: 20,
sellTypes: [7],
statusList: [2, 3]
};
const mapKeys = {
expressNumber: 'expressNo',
skn: 'prodCode',
skuFactoryCode: 'prodBarCode',
proReqFormId: 'orderNo'
proReqFormId: 'orderNo',
expressNumber: 'expressNo',
skuFactoryCode: 'prodBarCode'
};
if (!this.useFilter) {
... ...
... ... @@ -162,7 +162,7 @@
values.endTime = '';
}
values.isOvertime = ot === -1 ? '' : (ot === 1 ? 'N' : 'Y'); // eslint-disable-line
values.isOvertime = ot ? (ot === 1 ? 'N' : 'Y') : ''; // eslint-disable-line
return values;
},
... ...
... ... @@ -233,15 +233,20 @@ class ProductCreateService extends Service {
return colorsObj;
}
handleGoodsImage(goodsColorInfo) {
handleGoodsImage(goodsSize, goodsColorInfo) {
let image0 = {genderCover: 0, isDefault: 'Y'}; // 0商品正面图
let image1 = {genderCover: 0, orderBy: 1}; // 0商品正面图
let image2 = {genderCover: 0, orderBy: 2}; // 0商品正面图
let image3 = {genderCover: 1, isDefault: 'N'}; // 3男生频道封面图
let image4 = {genderCover: 2, isDefault: 'N'}; // 4女生频道封面图
let newGoods = this.handleGoods(goodsColorInfo);
_.get(goodsColorInfo, 'goodsImagesList', []).forEach((g, i) => {
// 处理 productId, productSkc, productSkn, factoryGoodsName , isDefault
// 在批量新建中 goodsColorInfo 为空,但 goodsSize 不为空
let mergedGoodsInfo = Object.assign({}, goodsColorInfo, goodsSize);
let newGoods = this.handleGoods(mergedGoodsInfo);
_.get(mergedGoodsInfo, 'goodsImagesList', []).forEach((g, i) => {
if (_.isMatch(g, image0)) {
newGoods.goodsImage[0].imageUrl = g.imageUrl;
return;
... ...
... ... @@ -11,6 +11,9 @@ const apiUrl = {
class ExpressService extends Service {
list(params) {
Object.assign(params, {
sellTypes: [2, 5, 6]
});
return this.post(apiUrl.listExpress, params);
}
... ...
{
"name": "yoho-shop-manage",
"version": "1.0.12",
"version": "1.0.13",
"description": "",
"main": "app.js",
"scripts": {
... ...