Authored by htoooth

Merge branch 'release/2.0' into refactor/2.0

# Conflicts:
#	app/pages/product/edit/edit.vue
@@ -16,6 +16,10 @@ @@ -16,6 +16,10 @@
16 }, 16 },
17 brandId: { 17 brandId: {
18 type: String 18 type: String
  19 + },
  20 + selectWhenOnlyOne: {
  21 + type: Boolean,
  22 + default: false
19 } 23 }
20 }, 24 },
21 data() { 25 data() {
@@ -41,6 +45,10 @@ @@ -41,6 +45,10 @@
41 this.sellTypeService.getSellType({brandId: newValue}).then((result) => { 45 this.sellTypeService.getSellType({brandId: newValue}).then((result) => {
42 if (result.code === 200) { 46 if (result.code === 200) {
43 this.list = result.data; 47 this.list = result.data;
  48 +
  49 + if (result.data.length === 1 && this.selectWhenOnlyOne) {
  50 + this.value = result.data[0].id;
  51 + }
44 } 52 }
45 }); 53 });
46 } 54 }
@@ -10,11 +10,14 @@ @@ -10,11 +10,14 @@
10 10
11 <Form ref="formData" :model="formData" :label-width="70" :rules="ruleValidate"> 11 <Form ref="formData" :model="formData" :label-width="70" :rules="ruleValidate">
12 <Form-item label="品牌" prop="brandId"> 12 <Form-item label="品牌" prop="brandId">
13 - <select-brand v-model="formData.brandId" @change="selectBrand" style="width: 300px;"></select-brand> 13 + <select-brand v-model="formData.brandId" @change="selectBrand" :selectWhenOnlyOne="true" style="width: 300px;"></select-brand>
14 </Form-item> 14 </Form-item>
15 15
16 <Form-item label="销售类型" prop="sellType"> 16 <Form-item label="销售类型" prop="sellType">
17 - <select-sell-type v-model="formData.sellType" style="width: 300px;" :brandId="formData.brandId" @change="selectSellType"> 17 + <select-sell-type v-model="formData.sellType" style="width: 300px;"
  18 + :brandId="formData.brandId"
  19 + @change="selectSellType"
  20 + :selectWhenOnlyOne="true">
18 </select-sell-type> 21 </select-sell-type>
19 </Form-item> 22 </Form-item>
20 23
@@ -144,7 +144,9 @@ export default { @@ -144,7 +144,9 @@ export default {
144 144
145 this.productService.getProduct(this.$route.params.id).then((result) => { 145 this.productService.getProduct(this.$route.params.id).then((result) => {
146 if (result.code === 200) { 146 if (result.code === 200) {
147 - this.product = result.data; 147 + // 这里的处理单选的问题,双向绑定的问题
  148 + Object.assign(this.product, result.data);
  149 +
148 _.update(this.product, 'goodsSeason', (s) => `${s}`); 150 _.update(this.product, 'goodsSeason', (s) => `${s}`);
149 if (!_.has(this.product, 'materialList')) { 151 if (!_.has(this.product, 'materialList')) {
150 this.product.materialList = []; 152 this.product.materialList = [];
@@ -161,12 +163,17 @@ export default { @@ -161,12 +163,17 @@ export default {
161 if (!_.has(this.product, 'ageLevel')) { 163 if (!_.has(this.product, 'ageLevel')) {
162 this.product.ageLevel = ''; 164 this.product.ageLevel = '';
163 } 165 }
  166 + } else {
  167 + return Promise.reject();
164 } 168 }
165 }).then(() => { 169 }).then(() => {
166 return this.getAllAttr(this.product.smallSortId, this.product.maxSortId); 170 return this.getAllAttr(this.product.smallSortId, this.product.maxSortId);
167 }).then(() => { 171 }).then(() => {
168 this.init(); 172 this.init();
169 this.showLoading = false; 173 this.showLoading = false;
  174 + }).catch(() => {
  175 + this.$Message.error('商品出错');
  176 + this.showLoading = false;
170 }); 177 });
171 }, 178 },
172 methods: { 179 methods: {
@@ -351,7 +358,10 @@ export default { @@ -351,7 +358,10 @@ export default {
351 let goodsList = this.product.sellerGoodList; 358 let goodsList = this.product.sellerGoodList;
352 359
353 this.product.goods = _.range(goodsList.length || 0).map((i) => { 360 this.product.goods = _.range(goodsList.length || 0).map((i) => {
354 - return this.productCreateService.handleGoodsImage(this.product.sellerGoodsImagesList[i] || {}); 361 + return this.productCreateService.handleGoodsImage(
  362 + goodsList[i],
  363 + this.product.sellerGoodsImagesList[i] || {}
  364 + );
355 }); 365 });
356 }, 366 },
357 handleItem(goods, goodsImage) { 367 handleItem(goods, goodsImage) {
@@ -34,11 +34,11 @@ @@ -34,11 +34,11 @@
34 </filter-item> 34 </filter-item>
35 35
36 <filter-item label="品牌"> 36 <filter-item label="品牌">
37 - <select-brand v-model="brandId"></select-brand> 37 + <select-brand v-model="brandId" :selectWhenOnlyOne="true"></select-brand>
38 </filter-item> 38 </filter-item>
39 39
40 <filter-item label="销售类型"> 40 <filter-item label="销售类型">
41 - <select-sell-type v-model="sellType" :brandId="brandId"></select-sell-type> 41 + <select-sell-type v-model="sellType" :brandId="brandId" :selectWhenOnlyOne="true"></select-sell-type>
42 </filter-item> 42 </filter-item>
43 43
44 <filter-item label="上传文件"> 44 <filter-item label="上传文件">
@@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
6 </div> 6 </div>
7 7
8 <layout-action> 8 <layout-action>
9 - <Button type="primary" @click="back">返回入库物流列表</Button>  
10 <Button type="primary" @click="print">打印</Button> 9 <Button type="primary" @click="print">打印</Button>
  10 + <Button @click="back">返回入库物流列表</Button>
11 </layout-action> 11 </layout-action>
12 12
13 <layout-list> 13 <layout-list>
@@ -84,7 +84,9 @@ @@ -84,7 +84,9 @@
84 return this.invoiceService.listAvailableProduct({ 84 return this.invoiceService.listAvailableProduct({
85 proRequisitionFormId: this.oid, 85 proRequisitionFormId: this.oid,
86 brandId: this.brandId, 86 brandId: this.brandId,
87 - skuFactoryCode: this.skuFactoryCode 87 + skuFactoryCode: this.skuFactoryCode,
  88 + pageNo: this.pageData.current,
  89 + pageSize: this.pageData.pageSize
88 }).then((res) => { 90 }).then((res) => {
89 if (res.code === 200) { 91 if (res.code === 200) {
90 this.tableData = (res.data.records || []).map((i) => { 92 this.tableData = (res.data.records || []).map((i) => {
@@ -92,7 +94,7 @@ @@ -92,7 +94,7 @@
92 return i; 94 return i;
93 }); 95 });
94 this.pageData.total = res.data.totalCount; 96 this.pageData.total = res.data.totalCount;
95 - this.pageData.current = res.data.pageNo + 1; 97 + this.pageData.current = res.data.pageNo;
96 } else { 98 } else {
97 this.tableData = []; 99 this.tableData = [];
98 this.pageData.total = 0; 100 this.pageData.total = 0;
@@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
7 </layout-filter> 7 </layout-filter>
8 8
9 <layout-action> 9 <layout-action>
10 - <Button type="error" @click="onClickCreate" :disabled="this.selection.length === 0">发货</Button>  
11 - <Button type="primary" @click="$router.go(-1)">返回发货入库列表</Button> 10 + <Button type="primary" @click="onClickCreate" :disabled="this.selection.length === 0">发货</Button>
  11 + <Button @click="$router.go(-1)">返回发货入库列表</Button>
12 </layout-action> 12 </layout-action>
13 13
14 <layout-list> 14 <layout-list>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <order-info ref="info" :id="id"></order-info> 3 <order-info ref="info" :id="id"></order-info>
4 4
5 <layout-action> 5 <layout-action>
6 - <Button type="primary" @click="back">返回发货入库列表</Button> 6 + <Button @click="back">返回发货入库列表</Button>
7 </layout-action> 7 </layout-action>
8 <layout-list> 8 <layout-list>
9 <Tabs type="card" :animated="false" @on-click="onTabsClick"> 9 <Tabs type="card" :animated="false" @on-click="onTabsClick">
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 * @author: leo 3 * @author: leo
4 * @date: 04/05/2017 4 * @date: 04/05/2017
5 */ 5 */
6 -import { CellInfo} from 'components/cell'; 6 +import CellInfo from 'components/cell/cell-info';
7 import { CellDispatch, CellDeliver, CellStockOut } from '../components'; 7 import { CellDispatch, CellDeliver, CellStockOut } from '../components';
8 8
9 export default function() { 9 export default function() {
@@ -59,7 +59,6 @@ @@ -59,7 +59,6 @@
59 name: 'TabDone', 59 name: 'TabDone',
60 data() { 60 data() {
61 return { 61 return {
62 - self: this,  
63 filters: {}, 62 filters: {},
64 page: {}, 63 page: {},
65 table: {}, 64 table: {},
@@ -53,6 +53,7 @@ @@ -53,6 +53,7 @@
53 const params = { 53 const params = {
54 pageNo: 1, 54 pageNo: 1,
55 pageSize: 20, 55 pageSize: 20,
  56 + sellTypes: [7],
56 statusList: [2, 3] 57 statusList: [2, 3]
57 }; 58 };
58 59
@@ -96,13 +97,14 @@ @@ -96,13 +97,14 @@
96 const data = { 97 const data = {
97 pageNo: 1, 98 pageNo: 1,
98 pageSize: 20, 99 pageSize: 20,
  100 + sellTypes: [7],
99 statusList: [2, 3] 101 statusList: [2, 3]
100 }; 102 };
101 const mapKeys = { 103 const mapKeys = {
102 - expressNumber: 'expressNo',  
103 skn: 'prodCode', 104 skn: 'prodCode',
104 - skuFactoryCode: 'prodBarCode',  
105 - proReqFormId: 'orderNo' 105 + proReqFormId: 'orderNo',
  106 + expressNumber: 'expressNo',
  107 + skuFactoryCode: 'prodBarCode'
106 }; 108 };
107 109
108 if (!this.useFilter) { 110 if (!this.useFilter) {
@@ -162,7 +162,7 @@ @@ -162,7 +162,7 @@
162 values.endTime = ''; 162 values.endTime = '';
163 } 163 }
164 164
165 - values.isOvertime = ot === -1 ? '' : (ot === 1 ? 'N' : 'Y'); // eslint-disable-line 165 + values.isOvertime = ot ? (ot === 1 ? 'N' : 'Y') : ''; // eslint-disable-line
166 166
167 return values; 167 return values;
168 }, 168 },
@@ -233,15 +233,20 @@ class ProductCreateService extends Service { @@ -233,15 +233,20 @@ class ProductCreateService extends Service {
233 return colorsObj; 233 return colorsObj;
234 } 234 }
235 235
236 - handleGoodsImage(goodsColorInfo) { 236 + handleGoodsImage(goodsSize, goodsColorInfo) {
237 let image0 = {genderCover: 0, isDefault: 'Y'}; // 0商品正面图 237 let image0 = {genderCover: 0, isDefault: 'Y'}; // 0商品正面图
238 let image1 = {genderCover: 0, orderBy: 1}; // 0商品正面图 238 let image1 = {genderCover: 0, orderBy: 1}; // 0商品正面图
239 let image2 = {genderCover: 0, orderBy: 2}; // 0商品正面图 239 let image2 = {genderCover: 0, orderBy: 2}; // 0商品正面图
240 let image3 = {genderCover: 1, isDefault: 'N'}; // 3男生频道封面图 240 let image3 = {genderCover: 1, isDefault: 'N'}; // 3男生频道封面图
241 let image4 = {genderCover: 2, isDefault: 'N'}; // 4女生频道封面图 241 let image4 = {genderCover: 2, isDefault: 'N'}; // 4女生频道封面图
242 - let newGoods = this.handleGoods(goodsColorInfo);  
243 242
244 - _.get(goodsColorInfo, 'goodsImagesList', []).forEach((g, i) => { 243 + // 处理 productId, productSkc, productSkn, factoryGoodsName , isDefault
  244 + // 在批量新建中 goodsColorInfo 为空,但 goodsSize 不为空
  245 + let mergedGoodsInfo = Object.assign({}, goodsColorInfo, goodsSize);
  246 +
  247 + let newGoods = this.handleGoods(mergedGoodsInfo);
  248 +
  249 + _.get(mergedGoodsInfo, 'goodsImagesList', []).forEach((g, i) => {
245 if (_.isMatch(g, image0)) { 250 if (_.isMatch(g, image0)) {
246 newGoods.goodsImage[0].imageUrl = g.imageUrl; 251 newGoods.goodsImage[0].imageUrl = g.imageUrl;
247 return; 252 return;
@@ -11,6 +11,9 @@ const apiUrl = { @@ -11,6 +11,9 @@ const apiUrl = {
11 11
12 class ExpressService extends Service { 12 class ExpressService extends Service {
13 list(params) { 13 list(params) {
  14 + Object.assign(params, {
  15 + sellTypes: [2, 5, 6]
  16 + });
14 return this.post(apiUrl.listExpress, params); 17 return this.post(apiUrl.listExpress, params);
15 } 18 }
16 19
1 { 1 {
2 "name": "yoho-shop-manage", 2 "name": "yoho-shop-manage",
3 - "version": "1.0.12", 3 + "version": "1.0.13",
4 "description": "", 4 "description": "",
5 "main": "app.js", 5 "main": "app.js",
6 "scripts": { 6 "scripts": {