更改商品上传字段

This commit is contained in:
姜棚 2022-01-25 11:33:22 +08:00
parent c243d9657c
commit 9c3114524c
5 changed files with 45 additions and 4 deletions

View File

@ -212,10 +212,19 @@ componentDidMount() {
Notify.error(`商品总库存量不能小于已使用数量`);
return;
}
let urls = _.map(this.state.productpic,(o)=>{
return o.url
})
if(urls.length <= 0)
{
Notify.error(`商品图至少请上传一张`);
return;
}
let formdata = {
"product_type": this.state.model.type,
"product_name": this.state.model.name,

View File

@ -70,12 +70,14 @@ export default class adduserinfo extends React.Component{
let model = this.state.model;
model.product_id = model_temp.product_id;
model.product_type = model_temp.product_type
model.contract_price = model_temp.contract_price
model.official_price = model_temp.official_price
model.cost_price = model_temp.cost_price
model.quantity = model_temp.quantity
model.product_name = model_temp.product_name
model.show_url = model_temp.show_url
model.account_type = model_temp.account_type
model.detail_url = model_temp.detail_url
let defaultPic = []
let arr = []
@ -196,6 +198,13 @@ export default class adduserinfo extends React.Component{
let urls = _.map(this.state.productpic,(o)=>{
return o.url
})
if(urls.length <= 0)
{
Notify.error(`商品图至少请上传一张`);
return;
}
console.log("存储的链接",8888)
temp[index].describe_url = urls
@ -214,6 +223,13 @@ export default class adduserinfo extends React.Component{
let urls = _.map(this.state.productpic,(o)=>{
return o.url
})
if(urls.length <= 0)
{
Notify.error(`商品图至少请上传一张`);
return;
}
model.describe_url = urls
this.setState({model:model})

View File

@ -402,7 +402,6 @@ export default class acclist extends React.Component{
sum += parseInt( o.quantity);
})
console.log("sum",sum)
if(sum < this.state.codeInfo.issued)
{
Notify.error("所选商品库存总数小于发放量")
@ -421,7 +420,6 @@ export default class acclist extends React.Component{
return item.text
})
console.log(rank)
let tableData = this.state.distdata;
let temp = {
@ -453,6 +451,8 @@ export default class acclist extends React.Component{
})
temp.product = arr;
console.log("dasdas",temp)
if(this.state.rowIndex > -1)
{

View File

@ -94,6 +94,11 @@ export default class adduserinfo extends React.Component{
Notify.error(`请上传商品Logo`);
return
}
if(this.state.model.describe_url.length <= 0)
{
Notify.error(`商品图至少请上传一张`);
return;
}
let temp = []

View File

@ -74,6 +74,7 @@ export default class adduserinfo extends React.Component{
model.product_name = model_temp.product_name
model.show_url = model_temp.show_url
model.detail_url = model_temp.detail_url
model.account_type = model_temp.account_type
let defaultPic = []
let arr = []
@ -210,6 +211,11 @@ export default class adduserinfo extends React.Component{
let urls = _.map(this.state.productpic,(o)=>{
return o.url
})
if(urls.length <= 0)
{
Notify.error(`商品图至少请上传一张`);
return;
}
console.log(8888)
temp[index].describe_url = urls
temp[index].map_product_name = this.state.model.map_product_name
@ -226,6 +232,11 @@ export default class adduserinfo extends React.Component{
let urls = _.map(this.state.productpic,(o)=>{
return o.url
})
if(urls.length <= 0)
{
Notify.error(`商品图至少请上传一张`);
return;
}
model.describe_url = urls
this.setState({model:model})