更新编辑图片上传问题

This commit is contained in:
姜棚 2021-12-10 13:46:15 +08:00
parent 416b344c00
commit 9a7b730e4c
3 changed files with 12 additions and 6 deletions

View File

@ -161,6 +161,11 @@ export default class menu extends React.Component {
} }
componentDidMount() { componentDidMount() {
} }
@ -356,9 +361,7 @@ export default class menu extends React.Component {
return ( <div return ( <div><div className = "gird" style={{"border": this.props.isBorder ? "1px solid #dfe1e6":"none"}} >
><div className = "gird" style={{"border": this.props.isBorder ? "1px solid #dfe1e6":"none"}} >
<div className = "th-head" > { <div className = "th-head" > {
this.props.isMultiple ? ( < div className = "th-td" this.props.isMultiple ? ( < div className = "th-td"
style = { style = {

View File

@ -333,7 +333,7 @@ export default class exchangedit extends React.Component{
if(file.length > 0 && file[0].status == "success") if(file.length > 0 && file[0].status == "success")
{ {
let rowIndex =this.state.tempdata.findIndex((o)=>{return o.product_id == row.product_id}) let rowIndex =this.state.tempdata.findIndex((o)=>{return o.product_id == row.product_id})
this.state.tempdata[rowIndex].describe_url =file[0].src; this.state.tempdata[rowIndex].show_url =file[0].src;
this.setState({tempdata:this.state.tempdata}) this.setState({tempdata:this.state.tempdata})
} }

View File

@ -132,6 +132,8 @@ export default class adduserinfo extends React.Component{
official_price:cur_product.official_price, official_price:cur_product.official_price,
cost_price:cur_product.cost_price, cost_price:cur_product.cost_price,
quantity:quantity, quantity:quantity,
stock:quantity,
usage:0,
product_name:this.state.model.product_name, product_name:this.state.model.product_name,
show_url:picItem ? picItem.pic : "", show_url:picItem ? picItem.pic : "",
describe_url:picItem ? picItem.pic : "", describe_url:picItem ? picItem.pic : "",
@ -312,13 +314,14 @@ export default class adduserinfo extends React.Component{
<Ipt onChange={(e)=>{ <Ipt onChange={(e)=>{
let model2 = this.state.model; let model2 = this.state.model;
model2.quantity = e; model2.quantity = e;
model2.stock = e;
this.setState({model:model2}) this.setState({model:model2})
}} }}
onClearItem={(e)=>{ onClearItem={(e)=>{
let model2 = this.state.model; let model2 = this.state.model;
model2.quantity = ""; model2.quantity = "";
model2.stock = 0;
this.setState({model:model2}) this.setState({model:model2})
}} }}