|
@@ -16,55 +16,36 @@
|
|
</picker>
|
|
</picker>
|
|
<input v-else placeholder="请选择" v-model="item.goodsName" :disabled="true" disabled="true"/>
|
|
<input v-else placeholder="请选择" v-model="item.goodsName" :disabled="true" disabled="true"/>
|
|
</view>
|
|
</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"></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"></view>
|
|
|
|
- </picker>
|
|
|
|
- </view> -->
|
|
|
|
<view class="form_group">
|
|
<view class="form_group">
|
|
<view class="lable re">商品价格</view>
|
|
<view class="lable re">商品价格</view>
|
|
<input type="number" placeholder="请输入" v-model="item.price" />
|
|
<input type="number" placeholder="请输入" v-model="item.price" />
|
|
- <view class="ops">元</view>
|
|
|
|
|
|
+ <view class="ops" v-if="flag === '编辑商品'">{{ item.goodsUnits }}</view>
|
|
|
|
+ <view class="ops" v-else>{{ item.unit }}</view>
|
|
</view>
|
|
</view>
|
|
<view class="form_group">
|
|
<view class="form_group">
|
|
<view class="lable re">商品数量</view>
|
|
<view class="lable re">商品数量</view>
|
|
<input type="number" placeholder="请输入" v-model="item.stock" />
|
|
<input type="number" placeholder="请输入" v-model="item.stock" />
|
|
- <view class="ops">{{ item.goodsUnits }}</view>
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
<view class="form_group">
|
|
<view class="form_group">
|
|
<view class="lable re">净重</view>
|
|
<view class="lable re">净重</view>
|
|
<input placeholder="请输入" v-model="item.netWeight" />
|
|
<input placeholder="请输入" v-model="item.netWeight" />
|
|
- <view class="ops">吨</view>
|
|
|
|
|
|
+ <view class="ops" v-if="flag === '编辑商品'">{{ item.goodsUnits }}</view>
|
|
|
|
+ <view class="ops" v-else>{{ item.unit }}</view>
|
|
</view>
|
|
</view>
|
|
<view class="form_group">
|
|
<view class="form_group">
|
|
<view class="lable re">毛重</view>
|
|
<view class="lable re">毛重</view>
|
|
<input placeholder="请输入" v-model="item.grossWeight" />
|
|
<input placeholder="请输入" v-model="item.grossWeight" />
|
|
- <view class="ops">吨</view>
|
|
|
|
|
|
+ <view class="ops" v-if="flag === '编辑商品'">{{ item.goodsUnits }}</view>
|
|
|
|
+ <view class="ops" v-else>{{ item.unit }}</view>
|
|
</view>
|
|
</view>
|
|
<view class="form_group">
|
|
<view class="form_group">
|
|
<view class="lable re">商品状态</view>
|
|
<view class="lable re">商品状态</view>
|
|
<picker :range="dict.goodsStatus" @change="picker($event, 'goodsStatus')">
|
|
<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"></view>
|
|
<view class="icon more"></view>
|
|
</picker>
|
|
</picker>
|
|
</view>
|
|
</view>
|
|
- <!-- <view class="form_group">
|
|
|
|
- <view class="lable re">商品描述</view>
|
|
|
|
- <textarea v-model="item.description" placeholder="请输入"></textarea>
|
|
|
|
- </view> -->
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -74,7 +55,7 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
flag: '新增商品',
|
|
flag: '新增商品',
|
|
- item: {},
|
|
|
|
|
|
+ item: {tradeAreaName:''},
|
|
dict: {
|
|
dict: {
|
|
goodsType: ['水果', '药品', '茶叶'],
|
|
goodsType: ['水果', '药品', '茶叶'],
|
|
goodsUnits: ['吨', '个', '柜'],
|
|
goodsUnits: ['吨', '个', '柜'],
|
|
@@ -91,6 +72,7 @@ export default {
|
|
url: '/level-one-server/app/TbGoodsTransit/getById?id=' + e.id,
|
|
url: '/level-one-server/app/TbGoodsTransit/getById?id=' + e.id,
|
|
success: res => {
|
|
success: res => {
|
|
this.item = res.data.data;
|
|
this.item = res.data.data;
|
|
|
|
+ this.item.goodsStatus = this.item.goodsStatus == 1 ? '在售' : '下架';
|
|
uni.setNavigationBarTitle({ title: '编辑商品' });
|
|
uni.setNavigationBarTitle({ title: '编辑商品' });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -105,9 +87,11 @@ export default {
|
|
},
|
|
},
|
|
pickerGoods(e) {
|
|
pickerGoods(e) {
|
|
this.item['goodsName'] = this.goodsList[e.detail.value].name;
|
|
this.item['goodsName'] = this.goodsList[e.detail.value].name;
|
|
|
|
+ this.item['unit'] = this.goodsList[e.detail.value].unit;
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
if(this.flag == '新增商品') {
|
|
if(this.flag == '新增商品') {
|
|
this.item.id = this.goodsList[e.detail.value].id;
|
|
this.item.id = this.goodsList[e.detail.value].id;
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
pickerTradeArea(e) {
|
|
pickerTradeArea(e) {
|
|
@@ -147,12 +131,16 @@ export default {
|
|
uni.showModal({ content: this.verify.error, showCancel: false });
|
|
uni.showModal({ content: this.verify.error, showCancel: false });
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ this.item.goodsStatus = this.item.goodsStatus == '在售' ? 1 : 0;
|
|
let url = '';
|
|
let url = '';
|
|
if(this.flag == '新增商品') {
|
|
if(this.flag == '新增商品') {
|
|
url = '/level-one-server/app/TbGoodsTransit/transactionGoods';
|
|
url = '/level-one-server/app/TbGoodsTransit/transactionGoods';
|
|
} else {
|
|
} else {
|
|
url = '/level-one-server/app/TbGoodsTransit/update';
|
|
url = '/level-one-server/app/TbGoodsTransit/update';
|
|
}
|
|
}
|
|
|
|
+ delete this.item.createTime;
|
|
|
|
+ delete this.item.createBy;
|
|
|
|
+ delete this.item.createName;
|
|
this.http.request({
|
|
this.http.request({
|
|
url: url,
|
|
url: url,
|
|
method: 'POST',
|
|
method: 'POST',
|