Просмотр исходного кода

Merge branch 'master' of http://git.huaml.com/zhh/front-end

yangming 5 лет назад
Родитель
Сommit
8084cd53fd

+ 41 - 23
ghs/src/views/item/list.vue

@@ -50,32 +50,41 @@
 				>
 			</template>
 
-      <template #table-column-addPrice="{scope}">
+		<template #table-header-cost>
+			<div class="set-sort">
+				<span>每扎成本价</span>
+				<el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
+				<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
+			</div>
+		</template>
+		<template #table-column-cost="{scope}">
+			<span v-if="!costPrice">{{ scope.row.cost }}</span>
+			<el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
+		</template>
+		<template #table-header-addPrice>
+			<div class="set-sort">
+				<span>每扎加价</span>
+				<el-button v-if="!canAddPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showAddPrice" class="show"></el-button>
+				<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
+			</div>
+		</template>
+      	<template #table-column-addPrice="{scope}">
         <span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
         <el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.addPrice" @blur="changeSort(scope.row, 'addPrice')" ></el-input>
       </template>
+	  	<template #table-header-weight>
+		<div class="set-sort">
+			<span>重量(公斤)</span>
+			<el-button v-if="!costWeight" icon="el-icon-edit-outline" size="small" type="text" @click="showWeight" class="show"></el-button>
+			<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
+		</div>
+	  </template>
+		<template #table-column-weight="{scope}">
+			<span v-if="!costWeight">{{ scope.row.weight }}</span>
+			<el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.weight" @blur="changeSort(scope.row, 'weight')"></el-input>
+		</template>
 
-      <template #table-header-addPrice>
-        <div class="set-sort">
-          <span>每扎加价</span>
-          <el-button v-if="!canAddPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showAddPrice" class="show"></el-button>
-          <el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
-        </div>
-      </template>
 
-      <template #table-header-cost>
-        <div class="set-sort">
-          <span>每扎成本价</span>
-          <el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
-          <el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
-        </div>
-      </template>
-
-
-      <template #table-column-cost="{scope}">
-        <span v-if="!costPrice">{{ scope.row.cost }}</span>
-        <el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
-      </template>
       <template #slot-add-goods-btn>
         <el-button type="primary" size="mini" @click="addFn()">添加</el-button>
       </template>
@@ -202,6 +211,7 @@ export default {
       },
       canAddPrice:false,
       costPrice: false,
+	  costWeight: false,
       classId: 0,
       className:'',
       showItemModal: false,
@@ -377,7 +387,7 @@ export default {
               prop: 'cost',
               label: '每扎成本价',
               align: 'center',
-              'min-width': 120
+              'min-width': 130
             },
             {
               prop: 'addPrice',
@@ -389,7 +399,7 @@ export default {
               prop: 'weight',
               label: '重量(公斤)',
               align: 'center',
-              'min-width': 90
+              'min-width': 130
             },
             {
               prop: 'unit',
@@ -456,6 +466,10 @@ export default {
     showAddPrice(){
       this.initData = []
        this.canAddPrice = true
+    },
+  	showWeight(){
+      this.initData = []
+       this.costWeight = true
     },
     showSort (e) {
       this.initData = []
@@ -467,6 +481,7 @@ export default {
         this.sort.status = false;
         this.canAddPrice = false
         this.costPrice = false
+        this.costWeight = false
         return;
       }
       this.dataList.form.data = JSON.stringify(this.initData)
@@ -477,6 +492,7 @@ export default {
       this.sort.status = false;
       this.canAddPrice = false
       this.costPrice = false
+      this.costWeight = false
     },
     replaceBtnFn(id) {
       this.addDialog = true
@@ -516,6 +532,8 @@ export default {
         obj.addPrice = d.addPrice
       } else if(type == 'cost') {
         obj.cost  = d.cost 
+      }else if(type == 'weight') {
+        obj.weight  = d.weight
       }
       this.initData.push(obj)
     }

+ 10 - 5
ghsApp/src/admin/billing/affirm.vue

@@ -123,10 +123,7 @@
       </button>
     </view>
     <!-- 选择客户 -->
-    <AppCustomerSel
-      :show.sync="showCustomer"
-      @change="changeCustomerFn"
-    />
+    <AppCustomerSel :isNewClient.sync="isNewClient" :show.sync="showCustomer" @change="changeCustomerFn"/>
   </view>
 </template>
 
@@ -181,7 +178,7 @@ export default {
       },
       money: "",
 						realMoney: 0,
-      showCustomer: false,
+      showCustomer: false
     };
   },
   onLoad () {
@@ -198,6 +195,14 @@ export default {
     }
     this.realMoney = this.allPrice.toFixed(2);
   },
+	onShow(){
+		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
+			this.showCustomer = true;
+		}
+	},
+	onUnload(){
+			uni.removeStorageSync('newClient');
+	},
   computed: {
     ...mapGetters(["getMerchantInfo", "getLoginInfo"]),
   },

+ 3 - 0
ghsApp/src/admin/home/member.vue

@@ -119,6 +119,9 @@ export default {
     }
   },
   onLoad(option) {},
+	onShow(){
+		uni.removeStorageSync('newClient');
+	},
   methods: {
     init() {
       if(!this.AUTHORITY_SHOW) {

+ 15 - 19
ghsApp/src/components/app-customer-sel.vue

@@ -28,23 +28,18 @@
 				</div>-->
 				<!-- 列表 -->
 				<scroll-view class="customer-list" scroll-y>
-					<view
-						v-for="(item, index) in customerListData"
-						:key="index"
-						@click="switchCustomer(item, index)"
-						class="customer-item"
-					>
+					<view v-for="(item, index) in customerListData" :key="index" @click="switchCustomer(item, index)" class="customer-item">
 						<view class="item-avatar">
 							<image :src="item.smallAvatar" alt="商品图" />
 						</view>
-						<view class="item-name"> {{ item.name || "" }}</view>
+						<view class="item-name"> {{ item.name || "" }} <text v-if="newClientId==item.id">新客户</text></view>
 						<view class="item-level">{{ getCustomerLevelName(item) }}</view>
 						<!-- <view class="item-tag">NEW</view> -->
 					</view>
 				</scroll-view>
-<!--				<view class="add-customer-bar" @click="gotoAddCustomer">-->
-<!--					没有找到客户?新增-->
-<!--				</view>-->
+				<view class="add-customer-bar" @click="gotoAddCustomer">
+					没有找到客户?新增
+				</view>
 			</div>
 		</bottom-popup>
 	</div>
@@ -74,6 +69,7 @@ export default {
 		return {
 			showPopup: false,
 			name: "",
+			newClientId: "",
 			customerListData: []
 		};
 	},
@@ -81,14 +77,9 @@ export default {
 		this.showPopup = this.show;
 	},
 	computed: {},
-	// onLoad(val) {
-
-	// },
-
 	watch: {
 		show(val) {
 			this.showPopup = val;
-
 			// #ifdef H5
 			this.$nextTick(function() {
 				setTimeout(() => {
@@ -106,9 +97,8 @@ export default {
 		initList() {
 			return getList({ type: "1", name: this.name })
 				.then(res => {
-					const {
-						data: { list }
-					} = res;
+					const {data: { list }} = res;
+					this.newClientId = uni.getStorageSync("newClient")?uni.getStorageSync("newClient").id:'';
 					this.customerListData = list;
 				})
 				.catch(err => {});
@@ -217,7 +207,13 @@ export default {
 			.item-name {
 				flex-shrink: 0;
 				margin: 0 20upx;
-				width: 200upx;
+				/*width: 200upx;*/
+				text{
+					padding: 0 10rpx;
+					margin-left: 20rpx;
+					color: #3385ff;
+					border: 1px solid #3385ff;
+				}
 			}
 			.item-level {
 				margin: 0 20upx;

+ 2 - 1
ghsApp/src/components/plugin/tabs.vue

@@ -246,7 +246,8 @@ export default {
 		},
 		// 新增
 		add() {
-			this.$emit("add");
+			uni.navigateTo({url:'/pagesClient/member/add'})
+			// this.$emit("add");
 		}
 	}
 };

+ 56 - 42
ghsApp/src/pagesClient/member/add.vue

@@ -6,44 +6,47 @@
 					<div class="tui-title required">花店名称</div>
 					<input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" placeholder="请输入" maxlength="50" type="text" />
 				</tui-list-cell>
+				<!--<tui-list-cell class="line-cell" :hover="false">-->
+					<!--<div class="tui-title required">店长姓名</div>-->
+					<!--<input v-model="form.adminName" placeholder-class="phcolor" class="tui-input" name="adminName" placeholder="请输入" maxlength="50" type="text" />-->
+				<!--</tui-list-cell>-->
 				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title required">店长姓名</div>
-					<input v-model="form.adminName" placeholder-class="phcolor" class="tui-input" name="adminName" placeholder="请输入" maxlength="50" type="text" />
-				</tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title required">店长手机号</div>
+					<div class="tui-title required">手机号</div>
 					<input v-model="form.mobile" placeholder-class="phcolor" class="tui-input" name="mobile" placeholder="请输入" maxlength="50" type="number" />
 				</tui-list-cell>
 				<tui-list-cell class="line-cell" :hover="false">
 					<div class="tui-title required">确认手机号</div>
 					<input v-model="form.confirmMobile" placeholder-class="phcolor" class="tui-input" name="confirmMobile" placeholder="请输入" maxlength="50" type="number" />
 				</tui-list-cell>
-				<view class="line-hint_bx">
-					以下选填
-				</view>
-				<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">
-					<div class="tui-title">所在城市</div>
-					<div class="tui-input" v-if="form.province">{{ form.province + '-' + form.city }}</div>
-					<div class="tui-placeholder" v-else>请选择</div>
+				<tui-list-cell class="line-cell" :hover="false">
+					<div class="tui-title">地址</div>
+					<input v-model="form.address" placeholder-class="phcolor" class="tui-input" name="confirmMobile" placeholder="请输入" maxlength="50" type="text" />
+				</tui-list-cell>
+				<tui-list-cell class="line-cell" :hover="false">
+					<div class="tui-title">允许欠款</div>
+					<switch :checked="form.debt" @change="form.debt = !form.debt" color="#3385FF"/>
 				</tui-list-cell>
-				 <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">
-					<div class="tui-title">详细地址</div>
-					<div class="tui-input" v-if="form.address">{{ form.address }}</div>
-					<div class="tui-placeholder" v-else>请填写详细地址</div>
-					</tui-list-cell>
-					<tui-list-cell class="line-cell" :hover="false">
-						<div class="tui-title">门牌号</div>
-						<input
-							v-model="form.floor"
-							placeholder-class="phcolor"
-							placeholder-style="color:#CCCCCC"
-							class="tui-input"
-							placeholder="楼号门牌号(选填)"
-						/>
-					</tui-list-cell>
+				<!--<view class="line-hint_bx">-->
+					<!--以下选填-->
+				<!--</view>-->
+				<!--<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="openAddres">-->
+					<!--<div class="tui-title">所在城市</div>-->
+					<!--<div class="tui-input" v-if="form.province">{{ form.province + '-' + form.city }}</div>-->
+					<!--<div class="tui-placeholder" v-else>请选择</div>-->
+				<!--</tui-list-cell>-->
+				 <!--<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">-->
+					<!--<div class="tui-title">详细地址</div>-->
+					<!--<div class="tui-input" v-if="form.address">{{ form.address }}</div>-->
+					<!--<div class="tui-placeholder" v-else>请填写详细地址</div>-->
+					<!--</tui-list-cell>-->
+					<!--<tui-list-cell class="line-cell" :hover="false">-->
+						<!--<div class="tui-title">门牌号</div>-->
+						<!--<input v-model="form.floor" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" placeholder="楼号门牌号(选填)"/>-->
+					<!--</tui-list-cell>-->
 					<div class="btn-wrap">
-					<button class="admin-button-com blue big" formType="submit">确认</button>
-				</div>		
+					<!--<button class="admin-button-com blue big" formType="submit">确认</button>-->
+					<button class="admin-button-com blue big" @click="confirmFn" >确认</button>
+				</div>
 			</div>
 			<!-- 选择地区 -->
 			<app-area-sel :show.sync="showRegion" @change="changeAreaFn" :city="form.city" />
@@ -92,7 +95,8 @@ export default {
 				name: '',
 				adminName: '',
 				lat:'',
-				long: ''
+				long: '',
+				debt:true
 			},
 			levelSelData: {}
 		}
@@ -125,16 +129,26 @@ export default {
 			this.$refs.simpleAddress.open();
 		},
 		confirmFn() {
+			let pattern = /^1\d{10}$/;  //验证以1开头11位数
+			if(this.$util.isEmpty(this.form.name)){this.$msg('请输入花店名称');return;}
+			if(!pattern.test(this.form.mobile)){this.$msg('请输入正确的手机号');return;}
+			if(this.form.mobile!=this.form.confirmMobile){this.$msg('两次手机号不一致');return;}
 			add({
-				...this.form,
-				mobile: +this.form.mobile,
-				confirmMobile: +this.form.confirmMobile
+				name:this.form.name,
+				mobile: this.form.mobile,
+				confirmMobile: this.form.confirmMobile,
+				address:this.form.address,
+				debt:this.form.debt?1:0,
 			}).then(res => {
-				this.$msg('添加成功!')
+				this.$msg('添加成功!');
+				uni.setStorageSync('newClient', res.data)
 				setTimeout(() => {
-					uni.reLaunch({
-						url: '/admin/home/member'
-					});
+					// uni.reLaunch({
+					// 	url: '/admin/home/member'
+					// });
+						uni.navigateBack({
+							delta: 1
+						})
 				}, 1000)
 			})
 		},
@@ -151,11 +165,11 @@ export default {
 					rule: ['required'],
 					msg: ['请输入花店名称']
 				},
-				{
-					name: 'adminName',
-					rule: ['required'],
-					msg: ['请输入店长名称']
-				},
+				// {
+				// 	name: 'adminName',
+				// 	rule: ['required'],
+				// 	msg: ['请输入店长名称']
+				// },
 				{
 					name: 'mobile',
 					rule: ['required'],

+ 75 - 57
hd/src/views/item/list.vue

@@ -1,8 +1,8 @@
 <template>
 	<div class="app-list-content">
 		<x-crud
-				class="liu-crud-wrap"
-				@load="onLoad"
+			class="liu-crud-wrap"
+			@load="onLoad"
 		>
 			<template #slot-tabs>
 				<el-tabs class="liu-tabs" type="border-card" v-model="tabIndex" @tab-click="tabClick">
@@ -13,10 +13,10 @@
 
 			<template #table-column-cover="{ scope }">
 				<cl-avatar
-						shape="square"
-						:size="32"
-						:src="scope.row.cover"
-						:style="{ margin: 'auto' }"
+					shape="square"
+					:size="32"
+					:src="scope.row.cover"
+					:style="{ margin: 'auto' }"
 				></cl-avatar>
 			</template>
 
@@ -44,17 +44,23 @@
 
 			<template #slot-modify="{ scope }">
 				<el-button
-						type="text"
-						@click.native.stop="replaceBtnFn(scope.row.id)"
+					type="text"
+					@click.native.stop="replaceBtnFn(scope.row.id)"
 				>修改</el-button
 				>
 			</template>
 
-			<template #table-column-addPrice="{scope}">
-				<span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
-				<el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.addPrice" @blur="changeSort(scope.row, 'addPrice')" ></el-input>
+			<template #table-header-cost>
+				<div class="set-sort">
+					<span>每扎成本价</span>
+					<el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
+					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
+				</div>
+			</template>
+			<template #table-column-cost="{scope}">
+				<span v-if="!costPrice">{{ scope.row.cost }}</span>
+				<el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
 			</template>
-
 			<template #table-header-addPrice>
 				<div class="set-sort">
 					<span>每扎加价</span>
@@ -62,20 +68,23 @@
 					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
 				</div>
 			</template>
-
-			<template #table-header-cost>
+			<template #table-column-addPrice="{scope}">
+				<span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
+				<el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.addPrice" @blur="changeSort(scope.row, 'addPrice')" ></el-input>
+			</template>
+			<template #table-header-weight>
 				<div class="set-sort">
-					<span>每扎成本价</span>
-					<el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
+					<span>重量(公斤)</span>
+					<el-button v-if="!costWeight" icon="el-icon-edit-outline" size="small" type="text" @click="showWeight" class="show"></el-button>
 					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
 				</div>
 			</template>
+			<template #table-column-weight="{scope}">
+				<span v-if="!costWeight">{{ scope.row.weight }}</span>
+				<el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.weight" @blur="changeSort(scope.row, 'weight')"></el-input>
+			</template>
 
 
-			<template #table-column-cost="{scope}">
-				<span v-if="!costPrice">{{ scope.row.cost }}</span>
-				<el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
-			</template>
 			<template #slot-add-goods-btn>
 				<el-button type="primary" size="mini" @click="addFn()">添加</el-button>
 			</template>
@@ -85,32 +94,32 @@
 		</item-list-layer>
 		<!-- 新增弹窗 -->
 		<el-dialog
-				title="修改花材"
-				:visible.sync="addDialog"
-				:close-on-click-modal="false"
-				width="600px"
+			title="修改花材"
+			:visible.sync="addDialog"
+			:close-on-click-modal="false"
+			width="600px"
 		>
 			<div class="ad-modal-content">
 				<el-form
-						:model="replaceForm"
-						:rules="replaceFormRules"
-						ref="replaceForm"
-						label-width="100px"
-						class="demo-form"
+					:model="replaceForm"
+					:rules="replaceFormRules"
+					ref="replaceForm"
+					label-width="100px"
+					class="demo-form"
 				>
 					<el-form-item label="名称" prop="name">
 						<el-input
-								v-model="replaceForm.name"
-								placeholder="请输入名称"
-								size="small"
+							v-model="replaceForm.name"
+							placeholder="请输入名称"
+							size="small"
 						></el-input>
 					</el-form-item>
 
 					<el-form-item label="别名" prop="alias">
 						<el-input
-								v-model="replaceForm.alias"
-								placeholder="请输入别名"
-								size="small"
+							v-model="replaceForm.alias"
+							placeholder="请输入别名"
+							size="small"
 						></el-input>
 					</el-form-item>
 
@@ -121,15 +130,15 @@
 
 					<el-form-item label="分类" prop="classId">
 						<el-select
-								v-model="replaceForm.className"
-								size="small"
-								placeholder="请选择分类"
-								@change="selClassFn"
+							v-model="replaceForm.className"
+							size="small"
+							placeholder="请选择分类"
+							@change="selClassFn"
 						>
 							<el-option
-									v-for="(item, index) in itemClassList"
-									:key="index"
-									:value="item.name"
+								v-for="(item, index) in itemClassList"
+								:key="index"
+								:value="item.name"
 							>{{ item.name }}</el-option
 							>
 						</el-select>
@@ -137,33 +146,33 @@
 
 					<el-form-item label="库存预警" prop="stockWarning">
 						<el-input
-								v-model="replaceForm.stockWarning"
-								placeholder="请输入数值"
-								size="small"
+							v-model="replaceForm.stockWarning"
+							placeholder="请输入数值"
+							size="small"
 						></el-input>
 					</el-form-item>
 
 					<el-form-item label="每扎重量" prop="weight">
 						<el-input
-								v-model="replaceForm.weight"
-								placeholder="请输入斤数"
-								size="small"
+							v-model="replaceForm.weight"
+							placeholder="请输入斤数"
+							size="small"
 						></el-input>
 					</el-form-item>
 
 					<el-form-item label="每扎成本价" prop="cost">
 						<el-input
-								v-model="replaceForm.cost"
-								placeholder="请输入成本价"
-								size="small"
+							v-model="replaceForm.cost"
+							placeholder="请输入成本价"
+							size="small"
 						></el-input>
 					</el-form-item>
 
 					<el-form-item label="每扎加价" prop="addPrice">
 						<el-input
-								v-model="replaceForm.addPrice"
-								placeholder="请输入加价"
-								size="small"
+							v-model="replaceForm.addPrice"
+							placeholder="请输入加价"
+							size="small"
 						></el-input>
 					</el-form-item>
 
@@ -202,6 +211,7 @@
 				},
 				canAddPrice:false,
 				costPrice: false,
+				costWeight: false,
 				classId: 0,
 				className:'',
 				showItemModal: false,
@@ -359,7 +369,7 @@
 								prop: 'name',
 								label: '名称',
 								align: 'center',
-								'min-width': 100
+								'min-width': 180
 							},
 							{
 								prop: 'className',
@@ -377,7 +387,7 @@
 								prop: 'cost',
 								label: '每扎成本价',
 								align: 'center',
-								'min-width': 120
+								'min-width': 130
 							},
 							{
 								prop: 'addPrice',
@@ -389,7 +399,7 @@
 								prop: 'weight',
 								label: '重量(公斤)',
 								align: 'center',
-								'min-width': 90
+								'min-width': 130
 							},
 							{
 								prop: 'unit',
@@ -457,6 +467,10 @@
 				this.initData = []
 				this.canAddPrice = true
 			},
+			showWeight(){
+				this.initData = []
+				this.costWeight = true
+			},
 			showSort (e) {
 				this.initData = []
 				this.sort.status = true;
@@ -467,6 +481,7 @@
 					this.sort.status = false;
 					this.canAddPrice = false
 					this.costPrice = false
+					this.costWeight = false
 					return;
 				}
 				this.dataList.form.data = JSON.stringify(this.initData)
@@ -477,6 +492,7 @@
 				this.sort.status = false;
 				this.canAddPrice = false
 				this.costPrice = false
+				this.costWeight = false
 			},
 			replaceBtnFn(id) {
 				this.addDialog = true
@@ -516,6 +532,8 @@
 					obj.addPrice = d.addPrice
 				} else if(type == 'cost') {
 					obj.cost  = d.cost
+				}else if(type == 'weight') {
+					obj.weight  = d.weight
 				}
 				this.initData.push(obj)
 			}