|
@@ -1,23 +1,24 @@
|
|
|
<template>
|
|
|
<div class="inline-16">
|
|
|
- <el-button type="text" :disabled="data.status==='审核'" size="small" @click="onShow">编 辑</el-button>
|
|
|
+ <el-button type="text" :disabled="form.status==='审核'" size="small" @click="onShow">编 辑</el-button>
|
|
|
<el-drawer append-to-body title="编辑产品" :visible.sync="dialogFormVisible" size="50%">
|
|
|
<el-row class="drawer__panel" :gutter="40">
|
|
|
<el-form label-position="right" label-width="80px" :model="form" :rules="rules" ref="form" size="small">
|
|
|
<el-col :span="20">
|
|
|
<el-form-item label="产品图">
|
|
|
- <uploadFile
|
|
|
- ref="upload"
|
|
|
- v-if="data.attinfos.length === 0"
|
|
|
- style="margin-top:10px"
|
|
|
- :folderid="folderid"
|
|
|
- accept=".JPG,.PNG,.jpg,.png"
|
|
|
- btntype="image"
|
|
|
- :bindData="{ownertable:'plm_item',ownerid:form.itemid,usetype:'default'}"
|
|
|
- @onSuccess="uploadSuccess">
|
|
|
- </uploadFile>
|
|
|
- <previewImage v-else :image="data.attinfos[0]" :deletebtn="true"
|
|
|
+ <div class="flex-align-center" style="flex-wrap:wrap">
|
|
|
+ <uploadFile
|
|
|
+ style="margin:10px 10px 10px 0;"
|
|
|
+ ref="upload"
|
|
|
+ :folderid="folderid"
|
|
|
+ accept=".JPG,.PNG,.jpg,.png"
|
|
|
+ btntype="image"
|
|
|
+ :bindData="{ownertable:'plm_item',ownerid:form.itemid,usetype:'default'}"
|
|
|
+ @onSuccess="uploadSuccess">
|
|
|
+ </uploadFile>
|
|
|
+ <previewImage style="margin-right: 10px;margin-bottom:10px" v-for="image in form.attinfos" :key="image.index" :image="image" :deletebtn="true"
|
|
|
@onSuccess="clearCover"></previewImage>
|
|
|
+ </div>
|
|
|
<small style="display:block;margin-top:20px" class="info">注:建议上传图片大小1024x1024,大小不超过2M,格式为JPG/PNG</small>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -156,8 +157,8 @@
|
|
|
import uploadFile from '../../../components/upload/hw_obs_upload.vue'
|
|
|
import previewImage from '@/components/previewImage/index.vue'
|
|
|
export default {
|
|
|
- props:['data'],
|
|
|
components:{uploadFile,previewImage},
|
|
|
+ props:['data'],
|
|
|
data () {
|
|
|
return {
|
|
|
dialogFormVisible:false,
|
|
@@ -235,7 +236,6 @@ export default {
|
|
|
methods:{
|
|
|
onShow () {
|
|
|
this.dialogFormVisible = true
|
|
|
- console.log(this.data)
|
|
|
this.queryMain(()=>{
|
|
|
this.unitlist()
|
|
|
this.unitGrouplist()
|
|
@@ -310,8 +310,7 @@ export default {
|
|
|
this.showImage()
|
|
|
},
|
|
|
clearCover () {
|
|
|
- console.log("执行删除")
|
|
|
- this.form.attinfos = []
|
|
|
+ this.queryMain()
|
|
|
},
|
|
|
async showImage(){
|
|
|
const res = await this.$api.requested({
|