|
|
@ -116,7 +116,7 @@ |
|
|
|
<el-form-item class="trightb_item"> |
|
|
|
<upload style="margin-top: 20px;margin-bottom: 20px;" class="addinputw" ref="uploadImg2" |
|
|
|
v-model="imgList" :limit="1" @change="backData" bucket="map" |
|
|
|
:upload-data="{ type: '0001' }"></upload> |
|
|
|
:upload-data="{ type: '0001' }" :class="{ hide: hideUploadBtn }"></upload> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -151,7 +151,7 @@ |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<el-dialog title="添加商品" :visible.sync="editDialog" width="30%"> |
|
|
|
<el-dialog title="添加商品" :visible.sync="editDialog" width="30%" @close='handleCancle'> |
|
|
|
<table class="e-table" cellspacing="0"> |
|
|
|
<tr> |
|
|
|
<td>商品名称</td> |
|
|
@ -187,7 +187,7 @@ |
|
|
|
</table> |
|
|
|
<div style="margin-top: 20px; text-align: center;"> |
|
|
|
<el-button type="primary" @click="save()">保 存</el-button> |
|
|
|
<el-button @click="editDialog = false">关 闭</el-button> |
|
|
|
<el-button @click="handleCancle">关 闭</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
@ -230,7 +230,8 @@ |
|
|
|
price: "", |
|
|
|
|
|
|
|
}, |
|
|
|
goods: [] |
|
|
|
goods: [], |
|
|
|
hideUploadBtn: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -246,7 +247,7 @@ |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
const index = this.formobj.goods.findIndex((item) => item.goodsSid === sid) |
|
|
|
console.log("index》》》》", index) |
|
|
|
console.log("index》》》》", index) |
|
|
|
this.formobj.goods.splice(index, 1) |
|
|
|
}) |
|
|
|
}, |
|
|
@ -296,6 +297,17 @@ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
handleCancle(){ |
|
|
|
this.GiftBagGood = { |
|
|
|
goodsSid: "", |
|
|
|
goodsNumber: "", |
|
|
|
name: "", |
|
|
|
unitName: "", |
|
|
|
price: "", |
|
|
|
|
|
|
|
} |
|
|
|
this.editDialog = false |
|
|
|
}, |
|
|
|
input(val) { |
|
|
|
console.log("input》》》》", val) |
|
|
@ -330,7 +342,15 @@ |
|
|
|
console.log("backData》》》》", value) |
|
|
|
console.log("imgList", this.imgList) |
|
|
|
|
|
|
|
this.formobj.iconUrl = this.imgList[0].url |
|
|
|
|
|
|
|
if (this.imgList.length > 0) { |
|
|
|
this.formobj.iconUrl = this.imgList[0].url |
|
|
|
} else { |
|
|
|
this.formobj.iconUrl = "" |
|
|
|
} |
|
|
|
|
|
|
|
this.hideUploadBtn = this.imgList.length != 0; |
|
|
|
console.log("this.hideUploadBtn", this.hideUploadBtn) |
|
|
|
}, |
|
|
|
|
|
|
|
saveOrUpdate() { |
|
|
@ -347,12 +367,12 @@ |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.submitdisabled = false |
|
|
|
this.submitdisabled = false |
|
|
|
// 根据resp.code进行异常情况处理 |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn(isreload) { |
|
|
@ -381,24 +401,37 @@ |
|
|
|
if (resp.success) { |
|
|
|
this.formobj = resp.data |
|
|
|
this.imgList = [] |
|
|
|
this.imgList.push({ |
|
|
|
url: resp.data.iconUrl |
|
|
|
}) |
|
|
|
|
|
|
|
if (resp.data.iconUrl != '') |
|
|
|
this.imgList.push({ |
|
|
|
url: resp.data.iconUrl |
|
|
|
}) |
|
|
|
this.hideUploadBtn = this.imgList.length != 0; |
|
|
|
console.log("this.hideUploadBtn", this.hideUploadBtn) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(e => { |
|
|
|
this.formobj = row |
|
|
|
this.imgList = [] |
|
|
|
this.imgList.push({ |
|
|
|
url: formobj.iconUrl |
|
|
|
}) |
|
|
|
if (resp.data.iconUrl != '') |
|
|
|
this.imgList.push({ |
|
|
|
url: formobj.iconUrl |
|
|
|
}) |
|
|
|
this.hideUploadBtn = this.imgList.length != 0; |
|
|
|
console.log("this.hideUploadBtn", this.hideUploadBtn) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
// 隐藏上传组件 |
|
|
|
|
|
|
|
::v-deep .hide { |
|
|
|
.el-upload--picture-card { |
|
|
|
display: none !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.trightb { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
@ -416,7 +449,7 @@ |
|
|
|
font-weight: 400; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/.el-collapse-item__header { |
|
|
|
::v-deep .el-collapse-item__header { |
|
|
|
height: 40px; |
|
|
|
padding: 10px; |
|
|
|
font-weight: bold; |
|
|
@ -426,7 +459,7 @@ |
|
|
|
background-color: #0294d7; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/.el-collapse-item__content { |
|
|
|
::v-deep .el-collapse-item__content { |
|
|
|
padding-bottom: 0; |
|
|
|
} |
|
|
|
</style> |