27594 27623
This commit is contained in:
@@ -29,7 +29,7 @@
|
|||||||
<i :style="{ opacity: item.mustFill === '1' ? 1 : 0 }">*</i>
|
<i :style="{ opacity: item.mustFill === '1' ? 1 : 0 }">*</i>
|
||||||
<h2>请上传{{ item.annexName }}</h2>
|
<h2>请上传{{ item.annexName }}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="upload-item__wrapper" @click="upload(index)">
|
<div class="upload-item__wrapper" @click="uploads(index)">
|
||||||
<image v-if="item.src" mode="aspectFill" :src="item.src" />
|
<image v-if="item.src" mode="aspectFill" :src="item.src" />
|
||||||
<i v-if="!item.src" class="iconfont"></i>
|
<i v-if="!item.src" class="iconfont"></i>
|
||||||
<h2 v-if="!item.src">上传照片</h2>
|
<h2 v-if="!item.src">上传照片</h2>
|
||||||
@@ -347,7 +347,8 @@ export default {
|
|||||||
const i = e.target.dataset.i
|
const i = e.target.dataset.i
|
||||||
const dict = e.target.dataset.dict
|
const dict = e.target.dataset.dict
|
||||||
const value = e.detail.value
|
const value = e.detail.value
|
||||||
const key = this.$dict.getLabel(dict, value)
|
// const key = this.$dict.getLabel(dict, value)
|
||||||
|
const key = this.$dict.getDict(dict)[value].dictName
|
||||||
|
|
||||||
this.$set(this.tableForm[index][i], 'fieldValue', value)
|
this.$set(this.tableForm[index][i], 'fieldValue', value)
|
||||||
this.$set(this.tableForm[index][i], 'fieldDictName', key)
|
this.$set(this.tableForm[index][i], 'fieldDictName', key)
|
||||||
@@ -373,7 +374,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 图片上传
|
* 图片上传
|
||||||
*/
|
*/
|
||||||
upload(index) {
|
uploads(index) {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: 1,
|
count: 1,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
@@ -382,7 +383,7 @@ export default {
|
|||||||
const path = res.tempFilePaths[0]
|
const path = res.tempFilePaths[0]
|
||||||
// this.$loading()
|
// this.$loading()
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: this.$instance.baseURL + '/admin/file/add',
|
url: this.$instance.config.baseURL + '/admin/file/add2',
|
||||||
filePath: path,
|
filePath: path,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: {
|
||||||
@@ -391,10 +392,12 @@ export default {
|
|||||||
},
|
},
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
const data = JSON.parse(res.data)
|
const data = JSON.parse(res.data)
|
||||||
|
|
||||||
if (data.code === 0) {
|
if (data.code === 0) {
|
||||||
this.$set(this.info.processAnnexDefs[index], 'src', data.data[0].split(';')[0])
|
// this.$set(this.info.processAnnexDefs[index], 'src', data.data[0].split(';')[0])
|
||||||
this.$set(this.info.processAnnexDefs[index], 'annexFileId', data.data[0].split(';')[1])
|
// this.$set(this.info.processAnnexDefs[index], 'annexFileId', data.data[0].split(';')[1])
|
||||||
|
|
||||||
|
this.$set(this.info.processAnnexDefs[index], 'src', data.data.url)
|
||||||
|
this.$set(this.info.processAnnexDefs[index], 'id', data.data.id)
|
||||||
} else {
|
} else {
|
||||||
this.$toast(data.msg)
|
this.$toast(data.msg)
|
||||||
}
|
}
|
||||||
@@ -410,7 +413,7 @@ export default {
|
|||||||
next() {
|
next() {
|
||||||
if (this.currIndex === 2) {
|
if (this.currIndex === 2) {
|
||||||
for (let item of this.info.processAnnexDefs) {
|
for (let item of this.info.processAnnexDefs) {
|
||||||
if (item.mustFill === '1' && !item.annexFileId) {
|
if (item.mustFill === '1' && !item.id) {
|
||||||
return this.$toast(`请上传${item.annexName}`)
|
return this.$toast(`请上传${item.annexName}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user