|
|
|
@ -44,7 +44,7 @@
|
|
|
|
|
<el-table-column prop="purchasingCompany" label="采购公司" width="180" align="center "/> |
|
|
|
|
<el-table-column label="商品图片" width="180" align="center" > |
|
|
|
|
<template #default="props"> |
|
|
|
|
<img :src="props.row.photo" class='el-Img'> |
|
|
|
|
<img :src="props.row.photo" class='el-Img'> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="buyingTime" label="购买时间" width="180" align="center "/> |
|
|
|
@ -125,15 +125,23 @@
|
|
|
|
|
:on-success="ImgSuccess" |
|
|
|
|
:before-upload="beforeAvatarUpload" |
|
|
|
|
:headers="headers" |
|
|
|
|
v-if='!img' |
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
<template #trigger> |
|
|
|
|
<template #trigger > |
|
|
|
|
<div class='img-icon'> |
|
|
|
|
<el-button type="primary">点击上传图片</el-button> |
|
|
|
|
<el-icon><UploadFilled /></el-icon> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-upload> |
|
|
|
|
<div v-else class='el-img'> |
|
|
|
|
<div class='el-img-left'> |
|
|
|
|
<el-icon><PictureFilled /></el-icon> |
|
|
|
|
<span>{{ImgText}}</span> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-icon><SuccessFilled /></el-icon> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="型号"> |
|
|
|
@ -203,11 +211,10 @@ const background = ref(true); // 是否开启背景颜色
|
|
|
|
|
const disabled = ref(false); // 是否禁止使用页码功能 |
|
|
|
|
const data = ref([]); // 表单数据 |
|
|
|
|
const TabHeight = ref();//动态获取表格高度 |
|
|
|
|
const AddLalog = ref(true)//提交弹窗 |
|
|
|
|
const AddForm = ref({ |
|
|
|
|
name: '', |
|
|
|
|
region: '', |
|
|
|
|
type: '', |
|
|
|
|
const AddLalog = ref(false)//提交弹窗 |
|
|
|
|
const img=ref(false);//图片是否上传成功 |
|
|
|
|
const ImgText=ref('') |
|
|
|
|
const AddForm = ref({ //表单信息 |
|
|
|
|
}) |
|
|
|
|
const value1 = ref('') //日期 |
|
|
|
|
const optionsvalue = ref('')//下拉框值 |
|
|
|
@ -274,7 +281,12 @@ const imageUrl = ref('')
|
|
|
|
|
const ImgSuccess: UploadProps['onSuccess'] = (response,uploadFile) => { |
|
|
|
|
console.log(response,uploadFile,'123123123123123122312123'); |
|
|
|
|
console.log('================================================================'); |
|
|
|
|
|
|
|
|
|
if(response.success===true){ |
|
|
|
|
img.value=true; |
|
|
|
|
console.log(img.value); |
|
|
|
|
ImgText.value = response.data.originalName |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 上传图片规则 |
|
|
|
|
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => { |
|
|
|
@ -465,10 +477,37 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
:deep(.upload-demo){ |
|
|
|
|
|
|
|
|
|
width:100%; |
|
|
|
|
.el-upload{ |
|
|
|
|
width:100% |
|
|
|
|
} |
|
|
|
|
ul{ |
|
|
|
|
margin-top:0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
// 图片上传成功 |
|
|
|
|
.el-img{ |
|
|
|
|
border: 1px solid #ccc; |
|
|
|
|
width: 100%; |
|
|
|
|
border-radius: 4px; |
|
|
|
|
padding: 0 8px; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
.el-img-left{ |
|
|
|
|
display:flex; |
|
|
|
|
align-items:center; |
|
|
|
|
i{ |
|
|
|
|
margin-right:8px; |
|
|
|
|
color:#ccc; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
i{ |
|
|
|
|
color: #10d070; |
|
|
|
|
margin-left: 6px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |