|
|
@@ -52,7 +52,7 @@
|
|
|
<div class="row">
|
|
|
<el-form-item label="文物类别:">
|
|
|
<el-select
|
|
|
- v-model="ruleForm.category"
|
|
|
+ v-model="ruleForm.goodsTypeId"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
@@ -193,45 +193,6 @@
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<!-- 图片和附件 -->
|
|
|
- <!-- <el-form-item label="藏品图片:">
|
|
|
- <el-upload action="http://192.168.0.135:8004/cms/goods/uploadImg" list-type="picture-card" :auto-upload="false" @on-success='onSuccess'>
|
|
|
- <i slot="default" class="el-icon-plus"></i>
|
|
|
- <div slot="file" slot-scope="{ file }">
|
|
|
- <img
|
|
|
- class="el-upload-list__item-thumbnail"
|
|
|
- :src="file.url"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <span class="el-upload-list__item-actions">
|
|
|
- <span
|
|
|
- class="el-upload-list__item-preview"
|
|
|
- @click="handlePictureCardPreview(file)"
|
|
|
- >
|
|
|
- <i class="el-icon-zoom-in"></i>
|
|
|
- </span>
|
|
|
- <span
|
|
|
- v-if="!disabled"
|
|
|
- class="el-upload-list__item-delete"
|
|
|
- @click="handleDownload(file)"
|
|
|
- >
|
|
|
- <i class="el-icon-download"></i>
|
|
|
- </span>
|
|
|
- <span
|
|
|
- v-if="!disabled"
|
|
|
- class="el-upload-list__item-delete"
|
|
|
- @click="handleRemove(file)"
|
|
|
- >
|
|
|
- <i class="el-icon-delete"></i>
|
|
|
- </span>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
- <span class="txt">支持上传jpg,png格式,最大10M</span>
|
|
|
- <el-dialog :visible.sync="dialogVisible">
|
|
|
- <img width="100%" :src="dialogImageUrl" alt="" />
|
|
|
- </el-dialog>
|
|
|
- </el-form-item> -->
|
|
|
-
|
|
|
<el-form-item label="藏品图片:">
|
|
|
<el-upload
|
|
|
class="avatar-uploader"
|
|
|
@@ -240,17 +201,17 @@
|
|
|
token,
|
|
|
}"
|
|
|
:show-file-list="false"
|
|
|
- :before-upload="beforefileIdsUpload"
|
|
|
- :on-success="upload_fileIds_success"
|
|
|
+ :before-upload="beforethumbUpload"
|
|
|
+ :on-success="upload_thumb_success"
|
|
|
>
|
|
|
- <div v-if="ruleForm.fileIds" class="imgdiv">
|
|
|
+ <div v-if="ruleForm.thumb" class="imgdiv">
|
|
|
<img
|
|
|
style="width: 100%; height: 100%"
|
|
|
- :src="'http://192.168.0.135:8004' + ruleForm.fileIds"
|
|
|
+ :src="'http://192.168.0.135:8004' + ruleForm.thumb"
|
|
|
/>
|
|
|
<i
|
|
|
class="el-icon-circle-close"
|
|
|
- @click.stop="ruleForm.fileIds = ''"
|
|
|
+ @click.stop="ruleForm.thumb = ''"
|
|
|
></i>
|
|
|
</div>
|
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
@@ -318,7 +279,7 @@ export default {
|
|
|
checkInYear: '', // 入藏年底
|
|
|
dirCode: 'daliCK', // 目录码
|
|
|
fileIds: '', // 图片类型使用,文件id, 多个以逗号分隔
|
|
|
- goodsTypeId: '', // 文物类型Id
|
|
|
+ goodsTypeId: 1, // 文物类型Id
|
|
|
height: '', // 高
|
|
|
// id:'',//id, 修改时必须传,新增忽略
|
|
|
integrity: 1, // 完整度, -1:残缺,0:基本完整, 1:完整
|
|
|
@@ -337,8 +298,7 @@ export default {
|
|
|
textureCategory: '', // 质地类别
|
|
|
textureType: 0, // 质地类型,前端输入, 0:单一质地, 1:复活质地
|
|
|
thumb: '', // 缩略图url
|
|
|
- width: '', // 宽
|
|
|
- category: 1 //
|
|
|
+ width: '' // 宽
|
|
|
},
|
|
|
checkInScope: ['1949.10.1前', '1949.10.1-1965', '1966-1976', '1977-2000', '2001至今'], // 入藏时间范围
|
|
|
qualityRange: ['<0.01kg', '0.01-1kg', '1-50kg', '50-100kg', '100-1000kg', '>1000kg'], // 质量范围
|
|
|
@@ -377,8 +337,7 @@ export default {
|
|
|
// 方法集合
|
|
|
methods: {
|
|
|
// 上传图片
|
|
|
- beforefileIdsUpload (file) {
|
|
|
- // console.log(1111, file)
|
|
|
+ beforethumbUpload (file) {
|
|
|
// 限制图片大小和格式
|
|
|
const sizeOk = file.size / 1024 / 1024 < 10
|
|
|
const typeOk = file.type === 'image/png' || file.type === 'image/jpeg'
|
|
|
@@ -404,15 +363,23 @@ export default {
|
|
|
// this.$message.success('上传成功')
|
|
|
// }
|
|
|
},
|
|
|
- upload_fileIds_success (data) {
|
|
|
+ upload_thumb_success (data) {
|
|
|
this.loading = false
|
|
|
- this.ruleForm.fileIds = data.data.filePath
|
|
|
+ this.ruleForm.thumb = data.data.filePath
|
|
|
},
|
|
|
// 点击确定
|
|
|
async btnOK () {
|
|
|
- console.log(this.ruleForm)
|
|
|
- await holdingAdd(this.ruleForm)
|
|
|
- this.cancel()
|
|
|
+ try {
|
|
|
+ await this.$refs.ruleForm.validate()
|
|
|
+ console.log(this.ruleForm)
|
|
|
+ // this.ruleForm.amount = Number(this.ruleForm.amount)
|
|
|
+ const res = await holdingAdd(this.ruleForm)
|
|
|
+ console.log(6666, res)
|
|
|
+ this.$message.success('新增成功')
|
|
|
+ this.cancel()
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
},
|
|
|
// 点击取消
|
|
|
cancel () {
|