优化直转申请时附件上传问题
This commit is contained in:
parent
be71adf543
commit
95df0be1cc
|
|
@ -133,6 +133,7 @@
|
||||||
:file-list="maForm.dirUrls"
|
:file-list="maForm.dirUrls"
|
||||||
:show-file-list="true"
|
:show-file-list="true"
|
||||||
:auto-upload="true"
|
:auto-upload="true"
|
||||||
|
:headers="headers"
|
||||||
:key="uploadKey"
|
:key="uploadKey"
|
||||||
:limit="3"
|
:limit="3"
|
||||||
list-type="picture-card"
|
list-type="picture-card"
|
||||||
|
|
@ -145,13 +146,22 @@
|
||||||
>
|
>
|
||||||
<!-- 文件格式下载,图片格式预览 -->
|
<!-- 文件格式下载,图片格式预览 -->
|
||||||
<div slot="file" slot-scope="{ file }">
|
<div slot="file" slot-scope="{ file }">
|
||||||
<img v-if="isImage(file)" class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
<img
|
||||||
|
v-if="isImage(file)"
|
||||||
|
class="el-upload-list__item-thumbnail"
|
||||||
|
:src="file.url"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
<div v-else class="picture-card-container">
|
<div v-else class="picture-card-container">
|
||||||
<img class="picture-card" :src="urlTemp" alt="" />
|
<img class="picture-card" :src="urlTemp" alt="" />
|
||||||
<p class="file-name">{{ file.name }}</p>
|
<p class="file-name">{{ file.name }}</p>
|
||||||
</div>
|
</div>
|
||||||
<span class="el-upload-list__item-actions">
|
<span class="el-upload-list__item-actions">
|
||||||
<span v-if="updataIf(file)" class="el-upload-list__item-delete" @click="handleDownload(file)">
|
<span
|
||||||
|
v-if="updataIf(file)"
|
||||||
|
class="el-upload-list__item-delete"
|
||||||
|
@click="handleDownload(file)"
|
||||||
|
>
|
||||||
<i class="el-icon-download" />
|
<i class="el-icon-download" />
|
||||||
</span>
|
</span>
|
||||||
<span v-else class="el-upload-list__item-preview" @click="picturePreviewFbs(file)">
|
<span v-else class="el-upload-list__item-preview" @click="picturePreviewFbs(file)">
|
||||||
|
|
@ -193,7 +203,12 @@
|
||||||
|
|
||||||
<el-form-item label="规格型号" prop="typeId">
|
<el-form-item label="规格型号" prop="typeId">
|
||||||
<el-select v-model="queryParams.typeId" placeholder="请选择规格型号" clearable filterable>
|
<el-select v-model="queryParams.typeId" placeholder="请选择规格型号" clearable filterable>
|
||||||
<el-option v-for="item in typeModelNameOpts" :key="item.typeId" :label="item.name" :value="item.typeId" />
|
<el-option
|
||||||
|
v-for="item in typeModelNameOpts"
|
||||||
|
:key="item.typeId"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.typeId"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="关键字" prop="keyWord">
|
<el-form-item label="关键字" prop="keyWord">
|
||||||
|
|
@ -209,10 +224,23 @@
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
||||||
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
|
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSave" v-if="!isDetail">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleSave"
|
||||||
|
v-if="!isDetail"
|
||||||
|
>
|
||||||
{{ isEdit ? '保存' : '发起申请' }}
|
{{ isEdit ? '保存' : '发起申请' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" plain icon="el-icon-arrow-left" size="mini" @click="handleApplyRecord">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-arrow-left"
|
||||||
|
size="mini"
|
||||||
|
@click="handleApplyRecord"
|
||||||
|
>
|
||||||
直转记录查看
|
直转记录查看
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -220,7 +248,12 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="loading" ref="equipmentList" :data="equipmentList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
ref="equipmentList"
|
||||||
|
:data="equipmentList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column align="center" label="序号" type="index" width="55" />
|
<el-table-column align="center" label="序号" type="index" width="55" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -260,6 +293,7 @@ import { getListProject, getListUnite, getAgreement } from '@/api/lease/apply'
|
||||||
import { getUseringData, receiveSubmit, receiveEdit, receiveDetail, getEquipmentThreeTypes } from '@/api/business/index'
|
import { getUseringData, receiveSubmit, receiveEdit, receiveDetail, getEquipmentThreeTypes } from '@/api/business/index'
|
||||||
import Treeselect from '@riophae/vue-treeselect'
|
import Treeselect from '@riophae/vue-treeselect'
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dicts: ['purchase_task_status'],
|
dicts: ['purchase_task_status'],
|
||||||
|
|
@ -421,7 +455,8 @@ export default {
|
||||||
dialogImageUrl: '',
|
dialogImageUrl: '',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
uploadKey: Date.now(),
|
uploadKey: Date.now(),
|
||||||
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload' // 上传的图片服务器地址
|
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload', // 上传的图片服务器地址
|
||||||
|
headers: { Authorization: 'Bearer ' + getToken() }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -458,7 +493,7 @@ export default {
|
||||||
console.log(this.$store, 'this.$store.getters')
|
console.log(this.$store, 'this.$store.getters')
|
||||||
console.log(this.$route.query, 'this.$route.query')
|
console.log(this.$route.query, 'this.$route.query')
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
// this.maForm.backAgreementId 变化时执行
|
// this.maForm.backAgreementId 变化时执行
|
||||||
'maForm.backAgreementId': {
|
'maForm.backAgreementId': {
|
||||||
handler: function (val, oldVal) {
|
handler: function (val, oldVal) {
|
||||||
|
|
@ -702,6 +737,23 @@ export default {
|
||||||
directApplyInfo: this.maForm,
|
directApplyInfo: this.maForm,
|
||||||
directApplyInfoDetails: this.multipleSelection
|
directApplyInfoDetails: this.multipleSelection
|
||||||
}
|
}
|
||||||
|
let fileList = []
|
||||||
|
if (params.directApplyInfo.dirUrls.length > 0) {
|
||||||
|
fileList = params.directApplyInfo.dirUrls.map(e => {
|
||||||
|
if (e.response.code === 200) {
|
||||||
|
return {
|
||||||
|
name: e.response.data.name,
|
||||||
|
url: e.response.data.url,
|
||||||
|
type: e.response.data.url.substring(
|
||||||
|
e.response.data.url.lastIndexOf('.') + 1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
params.directApplyInfo.dirUrls = fileList
|
||||||
|
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
delete params.directApplyInfo.directApplyDetails
|
delete params.directApplyInfo.directApplyDetails
|
||||||
console.log('🚀 ~ this.$modal.confirm ~ params:', params)
|
console.log('🚀 ~ this.$modal.confirm ~ params:', params)
|
||||||
|
|
@ -829,7 +881,11 @@ export default {
|
||||||
handleDownload(file) {
|
handleDownload(file) {
|
||||||
console.log(file)
|
console.log(file)
|
||||||
if (file.status === 'ready') {
|
if (file.status === 'ready') {
|
||||||
downloadFile({ fileName: file.name, fileData: file.raw, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
downloadFile({
|
||||||
|
fileName: file.name,
|
||||||
|
fileData: file.raw,
|
||||||
|
fileType: 'application/vnd.ms-excel;charset=utf-8'
|
||||||
|
})
|
||||||
} else if (file.status === 'success') {
|
} else if (file.status === 'success') {
|
||||||
downloadFileData({ fileName: file.name, fileUrl: file.url })
|
downloadFileData({ fileName: file.name, fileUrl: file.url })
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue