商品扫码入库添加条形码
This commit is contained in:
parent
39a49b1b43
commit
1d63aad673
|
@ -1,16 +1,20 @@
|
||||||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
{
|
||||||
|
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
"version": "0.0",
|
"version" : "0.0",
|
||||||
"configurations": [{
|
"configurations" : [
|
||||||
"app-plus" :
|
|
||||||
{
|
{
|
||||||
|
"app-plus" : {
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"default" :
|
"default" : {
|
||||||
{
|
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"type" : "uniCloud"
|
"type" : "uniCloud"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"playground" : "custom",
|
||||||
|
"type" : "uni-app:app-android"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -322,32 +322,10 @@
|
||||||
},
|
},
|
||||||
addGoods(item = {}) {
|
addGoods(item = {}) {
|
||||||
item = (JSON.stringify(item));
|
item = (JSON.stringify(item));
|
||||||
console.log(item)
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&goodsInfo=${item}`
|
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&goodsInfo=${item}`
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
// if(this.isNullImage(item.image)||
|
|
||||||
// ( this.isNullImage(item.slider_image[0]) && this.isNullImage(item.slider_image[1]) && this.isNullImage(item.slider_image[2]) )){
|
|
||||||
// return Toast('请先上传商品图片后再加入店铺');
|
|
||||||
// }
|
|
||||||
// if(item.update) return Toast('请保存修改后再添加');
|
|
||||||
this.putGoods.id = item.id;
|
|
||||||
this.putGoods.price = '';
|
|
||||||
this.putGoods.stock = '';
|
|
||||||
this.putGoods.store_name = item.store_name;
|
|
||||||
Object.keys(this.showPutGoodsInput).forEach((key) => {
|
|
||||||
if (item[key] == null || item[key] == undefined || item[key] == '') {
|
|
||||||
this.showPutGoodsInput[key] = true;
|
|
||||||
this.putGoods[key] = '';
|
|
||||||
} else {
|
|
||||||
this.showPutGoodsInput[key] = false;
|
|
||||||
this.putGoods[key] = item[key];
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.initShop(item);
|
|
||||||
// this.addGoodsShow = true
|
|
||||||
// this.item = item
|
|
||||||
},
|
},
|
||||||
initShop(item) {
|
initShop(item) {
|
||||||
if (item.spec == '' || item.spec == undefined || item.spec == null) {
|
if (item.spec == '' || item.spec == undefined || item.spec == null) {
|
||||||
|
|
|
@ -540,7 +540,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
choseMedia(e) {
|
choseMedia(e) {
|
||||||
console.log(e.value)
|
|
||||||
this.show = false
|
this.show = false
|
||||||
if (e.value[0] == '图片') {
|
if (e.value[0] == '图片') {
|
||||||
this.handleChooseImage()
|
this.handleChooseImage()
|
||||||
|
@ -640,12 +639,7 @@
|
||||||
this.sets = true
|
this.sets = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
sexSelect(e) {
|
sexSelect(e) {
|
||||||
this.model1.userInfo.sex = e.name
|
this.model1.userInfo.sex = e.name
|
||||||
this.$refs.uForm.validateField('userInfo.sex')
|
this.$refs.uForm.validateField('userInfo.sex')
|
||||||
|
@ -656,16 +650,12 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
// console.log('show')
|
|
||||||
this.go = false
|
this.go = false
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},
|
},
|
||||||
showlayFn() {
|
showlayFn() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},
|
},
|
||||||
// submit() {
|
|
||||||
// console.log(this.formData)
|
|
||||||
// },
|
|
||||||
getAttr(object) {
|
getAttr(object) {
|
||||||
this.formData.product_attribute = object
|
this.formData.product_attribute = object
|
||||||
},
|
},
|
||||||
|
@ -722,11 +712,9 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
console.log(this.formData)
|
|
||||||
this.$refs.formData.validate().then(res => {
|
this.$refs.formData.validate().then(res => {
|
||||||
this.handAdd()
|
this.handAdd()
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
// console.log(errors)
|
|
||||||
uni.$u.toast(errors[0].message)
|
uni.$u.toast(errors[0].message)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -756,14 +744,13 @@
|
||||||
console.log(goods)
|
console.log(goods)
|
||||||
this.formData.store_name = goods.store_name
|
this.formData.store_name = goods.store_name
|
||||||
this.formData.imageList = [goods.image, ...goods.slider_image]
|
this.formData.imageList = [goods.image, ...goods.slider_image]
|
||||||
console.log(this.formData)
|
this.formData.attrValue[0].bar_code = goods.bar_code
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
// let that = this
|
|
||||||
this.initFormData(option)
|
this.initFormData(option)
|
||||||
this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet
|
this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet
|
||||||
this.isSet2()
|
this.isSet2()
|
||||||
|
@ -773,7 +760,6 @@
|
||||||
return item.value == this.formData.delivery_free[0]
|
return item.value == this.formData.delivery_free[0]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (option.product_id) {
|
if (option.product_id) {
|
||||||
this.formData.product_id = option.product_id
|
this.formData.product_id = option.product_id
|
||||||
this.mode = 'edit'
|
this.mode = 'edit'
|
||||||
|
@ -792,13 +778,9 @@
|
||||||
return item.value == this.formData.delivery_free[0]
|
return item.value == this.formData.delivery_free[0]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log(this.formData, 'formDATA')
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log(JSON.parse(option.formData))
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onBackPress: function(e) {
|
onBackPress: function(e) {
|
||||||
this.showlay = true
|
this.showlay = true
|
||||||
|
|
|
@ -58,8 +58,7 @@
|
||||||
</view>
|
</view>
|
||||||
<u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line>
|
<u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line>
|
||||||
<view class="card-li">
|
<view class="card-li">
|
||||||
<view style="display: flex;color: #777777;"
|
<view style="display: flex;color: #777777;" @click="delFn(index)">
|
||||||
@click="attrValue.splice(index,1),formData.attr.splice(index,1)">
|
|
||||||
<u-icon name="trash" style='margin-right: 8rpx;'></u-icon> 删除
|
<u-icon name="trash" style='margin-right: 8rpx;'></u-icon> 删除
|
||||||
</view>
|
</view>
|
||||||
<view class="" style="display: flex;align-items: center;">
|
<view class="" style="display: flex;align-items: center;">
|
||||||
|
@ -176,6 +175,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
delFn(index) {
|
||||||
|
if (this.attrValue.length == 1) {
|
||||||
|
return this.$util.Tips({
|
||||||
|
title: "最少保留一个规格"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.attrValue.splice(index, 1)
|
||||||
|
this.formData.attr.splice(index, 1)
|
||||||
|
},
|
||||||
|
|
||||||
choseAttr(name) {
|
choseAttr(name) {
|
||||||
this.isWhose ?
|
this.isWhose ?
|
||||||
this.attrValue[this.unitIndex].wholesale_unit_name = name :
|
this.attrValue[this.unitIndex].wholesale_unit_name = name :
|
||||||
|
@ -268,7 +277,6 @@
|
||||||
item.is_use = item.is_use ? '0' : '1'
|
item.is_use = item.is_use ? '0' : '1'
|
||||||
})
|
})
|
||||||
let that = this
|
let that = this
|
||||||
console.log(this.formData.attrValue)
|
|
||||||
this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0'
|
this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0'
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`
|
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`
|
||||||
|
|
Loading…
Reference in New Issue