更改商品上传字段

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

View File

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

View File

@ -402,7 +402,6 @@ export default class acclist extends React.Component{
sum += parseInt( o.quantity); sum += parseInt( o.quantity);
}) })
console.log("sum",sum)
if(sum < this.state.codeInfo.issued) if(sum < this.state.codeInfo.issued)
{ {
Notify.error("所选商品库存总数小于发放量") Notify.error("所选商品库存总数小于发放量")
@ -421,7 +420,6 @@ export default class acclist extends React.Component{
return item.text return item.text
}) })
console.log(rank)
let tableData = this.state.distdata; let tableData = this.state.distdata;
let temp = { let temp = {
@ -453,6 +451,8 @@ export default class acclist extends React.Component{
}) })
temp.product = arr; temp.product = arr;
console.log("dasdas",temp)
if(this.state.rowIndex > -1) if(this.state.rowIndex > -1)
{ {
@ -989,8 +989,8 @@ export default class acclist extends React.Component{
<RadioGroup onChange={(e)=>{ this.onStyleChange(e)} } value={this.state.model.style} disabled={this.state.isEdit} > <RadioGroup onChange={(e)=>{ this.onStyleChange(e)} } value={this.state.model.style} disabled={this.state.isEdit} >
<RadioButton value={1}>串码</RadioButton> <RadioButton value={1}>串码</RadioButton>
<RadioButton value={2} >链接</RadioButton> <RadioButton value={2} >链接</RadioButton>
<RadioButton value={4} >二维码</RadioButton> <RadioButton value={4} >二维码</RadioButton>
<RadioButton value={6} >白名单</RadioButton> <RadioButton value={6} >白名单</RadioButton>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>

View File

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

View File

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