Browse Source

更新商品管理状态

李书文 1 năm trước cách đây
mục cha
commit
008b9a5a82
2 tập tin đã thay đổi với 4 bổ sung43 xóa
  1. 3 23
      pages/market/one/merchant/goods/add.vue
  2. 1 20
      pages/market/two/list.vue

+ 3 - 23
pages/market/one/merchant/goods/add.vue

@@ -16,24 +16,6 @@
 				</picker>
 				<input v-else placeholder="请选择" v-model="item.goodsName" :disabled="true" disabled="true"/>
 			</view>
-			<!-- <view class="form_group">
-				<view class="lable re">商品产地</view>
-				<input placeholder="请输入" v-model="item.placeOrigin" />
-			</view>
-			<view class="form_group">
-				<view class="lable re">商品类型</view>
-				<picker :range="dict.goodsType" @change="picker($event, 'goodsType')">
-					<input placeholder="请选择" v-model="item.goodsType" :disabled="true" />
-					<view class="icon more">&#xe8f2;</view>
-				</picker>
-			</view>
-			<view class="form_group">
-				<view class="lable re">商品单位</view>
-				<picker :range="dict.goodsUnits" @change="picker($event, 'goodsUnits')">
-					<input placeholder="请选择" v-model="item.goodsUnits" :disabled="true" />
-					<view class="icon more">&#xe8f2;</view>
-				</picker>
-			</view> -->
 			<view class="form_group">
 				<view class="lable re">商品价格</view>
 				<input type="number" placeholder="请输入" v-model="item.price" />
@@ -57,14 +39,10 @@
 			<view class="form_group">
 				<view class="lable re">商品状态</view>
 				<picker :range="dict.goodsStatus" @change="picker($event, 'goodsStatus')">
-					<input placeholder="请选择" :value="item.goodsStatus == 1 ? '在售' : '下架'" :disabled="true" />
+					<input placeholder="请选择" :value="item.goodsStatus" :disabled="true" />
 					<view class="icon more">&#xe8f2;</view>
 				</picker>
 			</view>
-			<!-- <view class="form_group">
-				<view class="lable re">商品描述</view>
-				<textarea v-model="item.description" placeholder="请输入"></textarea>
-			</view> -->
 		</view>
 	</view>
 </template>
@@ -91,6 +69,7 @@ export default {
 				url: '/level-one-server/app/TbGoodsTransit/getById?id=' + e.id,
 				success: res => {
 					this.item = res.data.data;
+					this.item.goodsStatus = this.item.goodsStatus == 1 ? '在售' : '下架';
 					uni.setNavigationBarTitle({ title: '编辑商品' });
 				}
 			});
@@ -149,6 +128,7 @@ export default {
 			uni.showModal({ content: this.verify.error, showCancel: false });
 			return false;
 		}
+		this.item.goodsStatus = this.item.goodsStatus == '在售' ? 1 : 0;
 		let url = '';
 		if(this.flag == '新增商品') {
 			url = '/level-one-server/app/TbGoodsTransit/transactionGoods';

+ 1 - 20
pages/market/two/list.vue

@@ -39,26 +39,7 @@ export default {
 		return {
 			user: this.getUser(),
 			show: false,
-			sort: [
-				{
-					name: '综合',
-					key: 1,
-					isAsc: 'desc',
-					check: false
-				},
-				{
-					name: '日期',
-					key: 2,
-					isAsc: 'desc',
-					check: false
-				},
-				{
-					name: '价格',
-					key: 3,
-					isAsc: 'desc',
-					check: false
-				}
-			],
+			sort: [{ name: '综合' }, { name: '日期' }, { name: '价格' }],
 			list: [{}, {}, {}, {}],
 			param: { pageNo: 1, pageSize: 10 },
 			loadMore: true