Commit 62011a1463fd806eff8f6deb23a2c2d36ba0af96
1 parent
c3bd0a26
v1.9 修复合同上传附件bug 修复
Showing
5 changed files
with
77 additions
and
118 deletions
src/api/contract/contractDetailFileApi.js
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | 2 | ||
| 3 | export function queryContractFile(params) { | 3 | export function queryContractFile(params) { |
| 4 | - return request({ | ||
| 5 | - url: '/contractFile/queryContractFile', | ||
| 6 | - method: 'get', | ||
| 7 | - params | 4 | + return new Promise((resolve, reject) => { |
| 5 | + request({ | ||
| 6 | + url: '/contractFile/queryContractFile', | ||
| 7 | + method: 'get', | ||
| 8 | + params | ||
| 9 | + }).then(response => { | ||
| 10 | + const res = response.data | ||
| 11 | + resolve(res) | ||
| 12 | + }).catch(error => { | ||
| 13 | + reject(error) | ||
| 14 | + }) | ||
| 8 | }) | 15 | }) |
| 9 | } | 16 | } |
| 10 | \ No newline at end of file | 17 | \ No newline at end of file |
src/components/contract/contractDetailFile.vue
| @@ -2,17 +2,19 @@ | @@ -2,17 +2,19 @@ | ||
| 2 | <div class="margin-top"> | 2 | <div class="margin-top"> |
| 3 | <el-row class="margin-top-lg"></el-row> | 3 | <el-row class="margin-top-lg"></el-row> |
| 4 | <div class="margin-top"> | 4 | <div class="margin-top"> |
| 5 | - <el-row> | ||
| 6 | - <el-col :span="10"> | ||
| 7 | - <el-form-item :label="$t('contractDetailFile.relatedFiles')"> | ||
| 8 | - <div v-for="(file,index) in contractDetailFileInfo.files" :key="index" style="margin-left: 50px;"> | ||
| 9 | - <el-link type="primary" @click="_viewFile(file)"> | ||
| 10 | - {{ file.fileRealName }} | ||
| 11 | - </el-link> | ||
| 12 | - </div> | ||
| 13 | - </el-form-item> | ||
| 14 | - </el-col> | ||
| 15 | - </el-row> | 5 | + <el-form :model="contractDetailFileInfo" label-width="120px" class="text-left"> |
| 6 | + <el-row> | ||
| 7 | + <el-col :span="10"> | ||
| 8 | + <el-form-item :label="$t('contractDetailFile.relatedFiles')"> | ||
| 9 | + <div v-for="(file, index) in contractDetailFileInfo.files" :key="index" style="margin-left: 50px;"> | ||
| 10 | + <el-link type="primary" @click="_viewFile(file)"> | ||
| 11 | + {{ file.fileRealName }} | ||
| 12 | + </el-link> | ||
| 13 | + </div> | ||
| 14 | + </el-form-item> | ||
| 15 | + </el-col> | ||
| 16 | + </el-row> | ||
| 17 | + </el-form> | ||
| 16 | </div> | 18 | </div> |
| 17 | </div> | 19 | </div> |
| 18 | </template> | 20 | </template> |
| @@ -30,21 +32,25 @@ export default { | @@ -30,21 +32,25 @@ export default { | ||
| 30 | contractId: '', | 32 | contractId: '', |
| 31 | roomNum: '', | 33 | roomNum: '', |
| 32 | allOweFeeAmount: '0' | 34 | allOweFeeAmount: '0' |
| 33 | - } | 35 | + }, |
| 36 | + pagination: { | ||
| 37 | + page: 1, | ||
| 38 | + row: 100 | ||
| 39 | + }, | ||
| 34 | } | 40 | } |
| 35 | }, | 41 | }, |
| 36 | methods: { | 42 | methods: { |
| 37 | open(data) { | 43 | open(data) { |
| 38 | this.contractDetailFileInfo.contractId = data.contractId | 44 | this.contractDetailFileInfo.contractId = data.contractId |
| 39 | - this._loadContractDetailFileData(1, this.pagination.pageSize) | 45 | + this._loadContractDetailFileData(1, this.pagination.row) |
| 40 | }, | 46 | }, |
| 41 | _loadContractDetailFileData(page, row) { | 47 | _loadContractDetailFileData(page, row) { |
| 42 | const params = { | 48 | const params = { |
| 43 | contractId: this.contractDetailFileInfo.contractId, | 49 | contractId: this.contractDetailFileInfo.contractId, |
| 44 | page: page || 1, | 50 | page: page || 1, |
| 45 | - row: row || 100 | 51 | + row: row || this.pagination.row |
| 46 | } | 52 | } |
| 47 | - | 53 | + |
| 48 | queryContractFile(params).then(response => { | 54 | queryContractFile(params).then(response => { |
| 49 | this.contractDetailFileInfo.files = response.data | 55 | this.contractDetailFileInfo.files = response.data |
| 50 | }).catch(error => { | 56 | }).catch(error => { |
| @@ -65,6 +71,7 @@ export default { | @@ -65,6 +71,7 @@ export default { | ||
| 65 | .margin-top { | 71 | .margin-top { |
| 66 | margin-top: 20px; | 72 | margin-top: 20px; |
| 67 | } | 73 | } |
| 74 | + | ||
| 68 | .margin-top-lg { | 75 | .margin-top-lg { |
| 69 | margin-top: 30px; | 76 | margin-top: 30px; |
| 70 | } | 77 | } |
src/components/contract/editContract.vue
| 1 | <template> | 1 | <template> |
| 2 | - <el-dialog | ||
| 3 | - :title="$t('contractManage.edit.title')" | ||
| 4 | - :visible.sync="visible" | ||
| 5 | - width="70%" | ||
| 6 | - :before-close="handleClose" | ||
| 7 | - > | 2 | + <el-dialog :title="$t('contractManage.edit.title')" :visible.sync="visible" width="70%" :before-close="handleClose"> |
| 8 | <el-form :model="editContractInfo" label-width="120px" class="text-left" ref="editForm"> | 3 | <el-form :model="editContractInfo" label-width="120px" class="text-left" ref="editForm"> |
| 9 | <el-row :gutter="20"> | 4 | <el-row :gutter="20"> |
| 10 | <el-col :span="8"> | 5 | <el-col :span="8"> |
| 11 | <el-form-item :label="$t('contractManage.edit.contractName')" prop="contractName" required> | 6 | <el-form-item :label="$t('contractManage.edit.contractName')" prop="contractName" required> |
| 12 | - <el-input | ||
| 13 | - v-model="editContractInfo.contractName" | ||
| 14 | - :placeholder="$t('contractManage.edit.contractNamePlaceholder')" | ||
| 15 | - /> | 7 | + <el-input v-model="editContractInfo.contractName" |
| 8 | + :placeholder="$t('contractManage.edit.contractNamePlaceholder')" /> | ||
| 16 | </el-form-item> | 9 | </el-form-item> |
| 17 | </el-col> | 10 | </el-col> |
| 18 | <el-col :span="8"> | 11 | <el-col :span="8"> |
| 19 | <el-form-item :label="$t('contractManage.edit.contractCode')" prop="contractCode" required> | 12 | <el-form-item :label="$t('contractManage.edit.contractCode')" prop="contractCode" required> |
| 20 | - <el-input | ||
| 21 | - v-model="editContractInfo.contractCode" | ||
| 22 | - :placeholder="$t('contractManage.edit.contractCodePlaceholder')" | ||
| 23 | - /> | 13 | + <el-input v-model="editContractInfo.contractCode" |
| 14 | + :placeholder="$t('contractManage.edit.contractCodePlaceholder')" /> | ||
| 24 | </el-form-item> | 15 | </el-form-item> |
| 25 | </el-col> | 16 | </el-col> |
| 26 | <el-col :span="8"> | 17 | <el-col :span="8"> |
| 27 | <el-form-item :label="$t('contractManage.edit.contractType')" prop="contractType" required> | 18 | <el-form-item :label="$t('contractManage.edit.contractType')" prop="contractType" required> |
| 28 | - <el-select | ||
| 29 | - v-model="editContractInfo.contractType" | ||
| 30 | - :placeholder="$t('contractManage.edit.contractTypePlaceholder')" | ||
| 31 | - style="width:100%" | ||
| 32 | - disabled | ||
| 33 | - > | ||
| 34 | - <el-option | ||
| 35 | - v-for="item in editContractInfo.contractTypes" | ||
| 36 | - :key="item.contractTypeId" | ||
| 37 | - :label="item.typeName" | ||
| 38 | - :value="item.contractTypeId" | ||
| 39 | - /> | 19 | + <el-select v-model="editContractInfo.contractType" |
| 20 | + :placeholder="$t('contractManage.edit.contractTypePlaceholder')" style="width:100%" disabled> | ||
| 21 | + <el-option v-for="item in editContractInfo.contractTypes" :key="item.contractTypeId" | ||
| 22 | + :label="item.typeName" :value="item.contractTypeId" /> | ||
| 40 | </el-select> | 23 | </el-select> |
| 41 | </el-form-item> | 24 | </el-form-item> |
| 42 | </el-col> | 25 | </el-col> |
| @@ -45,26 +28,18 @@ | @@ -45,26 +28,18 @@ | ||
| 45 | <el-row :gutter="20"> | 28 | <el-row :gutter="20"> |
| 46 | <el-col :span="8"> | 29 | <el-col :span="8"> |
| 47 | <el-form-item :label="$t('contractManage.edit.partyA')" prop="partyA" required> | 30 | <el-form-item :label="$t('contractManage.edit.partyA')" prop="partyA" required> |
| 48 | - <el-input | ||
| 49 | - v-model="editContractInfo.partyA" | ||
| 50 | - :placeholder="$t('contractManage.edit.partyAPlaceholder')" | ||
| 51 | - /> | 31 | + <el-input v-model="editContractInfo.partyA" :placeholder="$t('contractManage.edit.partyAPlaceholder')" /> |
| 52 | </el-form-item> | 32 | </el-form-item> |
| 53 | </el-col> | 33 | </el-col> |
| 54 | <el-col :span="8"> | 34 | <el-col :span="8"> |
| 55 | <el-form-item :label="$t('contractManage.edit.aContacts')" prop="aContacts" required> | 35 | <el-form-item :label="$t('contractManage.edit.aContacts')" prop="aContacts" required> |
| 56 | - <el-input | ||
| 57 | - v-model="editContractInfo.aContacts" | ||
| 58 | - :placeholder="$t('contractManage.edit.aContactsPlaceholder')" | ||
| 59 | - /> | 36 | + <el-input v-model="editContractInfo.aContacts" |
| 37 | + :placeholder="$t('contractManage.edit.aContactsPlaceholder')" /> | ||
| 60 | </el-form-item> | 38 | </el-form-item> |
| 61 | </el-col> | 39 | </el-col> |
| 62 | <el-col :span="8"> | 40 | <el-col :span="8"> |
| 63 | <el-form-item :label="$t('contractManage.edit.aLink')" prop="aLink" required> | 41 | <el-form-item :label="$t('contractManage.edit.aLink')" prop="aLink" required> |
| 64 | - <el-input | ||
| 65 | - v-model="editContractInfo.aLink" | ||
| 66 | - :placeholder="$t('contractManage.edit.aLinkPlaceholder')" | ||
| 67 | - /> | 42 | + <el-input v-model="editContractInfo.aLink" :placeholder="$t('contractManage.edit.aLinkPlaceholder')" /> |
| 68 | </el-form-item> | 43 | </el-form-item> |
| 69 | </el-col> | 44 | </el-col> |
| 70 | </el-row> | 45 | </el-row> |
| @@ -72,26 +47,18 @@ | @@ -72,26 +47,18 @@ | ||
| 72 | <el-row :gutter="20"> | 47 | <el-row :gutter="20"> |
| 73 | <el-col :span="8"> | 48 | <el-col :span="8"> |
| 74 | <el-form-item :label="$t('contractManage.edit.partyB')" prop="partyB" required> | 49 | <el-form-item :label="$t('contractManage.edit.partyB')" prop="partyB" required> |
| 75 | - <el-input | ||
| 76 | - v-model="editContractInfo.partyB" | ||
| 77 | - :placeholder="$t('contractManage.edit.partyBPlaceholder')" | ||
| 78 | - /> | 50 | + <el-input v-model="editContractInfo.partyB" :placeholder="$t('contractManage.edit.partyBPlaceholder')" /> |
| 79 | </el-form-item> | 51 | </el-form-item> |
| 80 | </el-col> | 52 | </el-col> |
| 81 | <el-col :span="8"> | 53 | <el-col :span="8"> |
| 82 | <el-form-item :label="$t('contractManage.edit.bContacts')" prop="bContacts" required> | 54 | <el-form-item :label="$t('contractManage.edit.bContacts')" prop="bContacts" required> |
| 83 | - <el-input | ||
| 84 | - v-model="editContractInfo.bContacts" | ||
| 85 | - :placeholder="$t('contractManage.edit.bContactsPlaceholder')" | ||
| 86 | - /> | 55 | + <el-input v-model="editContractInfo.bContacts" |
| 56 | + :placeholder="$t('contractManage.edit.bContactsPlaceholder')" /> | ||
| 87 | </el-form-item> | 57 | </el-form-item> |
| 88 | </el-col> | 58 | </el-col> |
| 89 | <el-col :span="8"> | 59 | <el-col :span="8"> |
| 90 | <el-form-item :label="$t('contractManage.edit.bLink')" prop="bLink" required> | 60 | <el-form-item :label="$t('contractManage.edit.bLink')" prop="bLink" required> |
| 91 | - <el-input | ||
| 92 | - v-model="editContractInfo.bLink" | ||
| 93 | - :placeholder="$t('contractManage.edit.bLinkPlaceholder')" | ||
| 94 | - /> | 61 | + <el-input v-model="editContractInfo.bLink" :placeholder="$t('contractManage.edit.bLinkPlaceholder')" /> |
| 95 | </el-form-item> | 62 | </el-form-item> |
| 96 | </el-col> | 63 | </el-col> |
| 97 | </el-row> | 64 | </el-row> |
| @@ -99,26 +66,19 @@ | @@ -99,26 +66,19 @@ | ||
| 99 | <el-row :gutter="20"> | 66 | <el-row :gutter="20"> |
| 100 | <el-col :span="8"> | 67 | <el-col :span="8"> |
| 101 | <el-form-item :label="$t('contractManage.edit.operator')" prop="operator" required> | 68 | <el-form-item :label="$t('contractManage.edit.operator')" prop="operator" required> |
| 102 | - <el-input | ||
| 103 | - v-model="editContractInfo.operator" | ||
| 104 | - :placeholder="$t('contractManage.edit.operatorPlaceholder')" | ||
| 105 | - /> | 69 | + <el-input v-model="editContractInfo.operator" |
| 70 | + :placeholder="$t('contractManage.edit.operatorPlaceholder')" /> | ||
| 106 | </el-form-item> | 71 | </el-form-item> |
| 107 | </el-col> | 72 | </el-col> |
| 108 | <el-col :span="8"> | 73 | <el-col :span="8"> |
| 109 | <el-form-item :label="$t('contractManage.edit.operatorLink')" prop="operatorLink" required> | 74 | <el-form-item :label="$t('contractManage.edit.operatorLink')" prop="operatorLink" required> |
| 110 | - <el-input | ||
| 111 | - v-model="editContractInfo.operatorLink" | ||
| 112 | - :placeholder="$t('contractManage.edit.operatorLinkPlaceholder')" | ||
| 113 | - /> | 75 | + <el-input v-model="editContractInfo.operatorLink" |
| 76 | + :placeholder="$t('contractManage.edit.operatorLinkPlaceholder')" /> | ||
| 114 | </el-form-item> | 77 | </el-form-item> |
| 115 | </el-col> | 78 | </el-col> |
| 116 | <el-col :span="8"> | 79 | <el-col :span="8"> |
| 117 | <el-form-item :label="$t('contractManage.edit.amount')" prop="amount"> | 80 | <el-form-item :label="$t('contractManage.edit.amount')" prop="amount"> |
| 118 | - <el-input | ||
| 119 | - v-model="editContractInfo.amount" | ||
| 120 | - :placeholder="$t('contractManage.edit.amountPlaceholder')" | ||
| 121 | - /> | 81 | + <el-input v-model="editContractInfo.amount" :placeholder="$t('contractManage.edit.amountPlaceholder')" /> |
| 122 | </el-form-item> | 82 | </el-form-item> |
| 123 | </el-col> | 83 | </el-col> |
| 124 | </el-row> | 84 | </el-row> |
| @@ -126,46 +86,32 @@ | @@ -126,46 +86,32 @@ | ||
| 126 | <el-row :gutter="20"> | 86 | <el-row :gutter="20"> |
| 127 | <el-col :span="8"> | 87 | <el-col :span="8"> |
| 128 | <el-form-item :label="$t('contractManage.edit.startTime')" prop="startTime" required> | 88 | <el-form-item :label="$t('contractManage.edit.startTime')" prop="startTime" required> |
| 129 | - <el-date-picker | ||
| 130 | - v-model="editContractInfo.startTime" | ||
| 131 | - type="datetime" | ||
| 132 | - :placeholder="$t('contractManage.edit.startTimePlaceholder')" | ||
| 133 | - style="width:100%" | ||
| 134 | - /> | 89 | + <el-date-picker v-model="editContractInfo.startTime" type="datetime" |
| 90 | + :placeholder="$t('contractManage.edit.startTimePlaceholder')" style="width:100%" /> | ||
| 135 | </el-form-item> | 91 | </el-form-item> |
| 136 | </el-col> | 92 | </el-col> |
| 137 | <el-col :span="8"> | 93 | <el-col :span="8"> |
| 138 | <el-form-item :label="$t('contractManage.edit.endTime')" prop="endTime" required> | 94 | <el-form-item :label="$t('contractManage.edit.endTime')" prop="endTime" required> |
| 139 | - <el-date-picker | ||
| 140 | - v-model="editContractInfo.endTime" | ||
| 141 | - type="datetime" | ||
| 142 | - :placeholder="$t('contractManage.edit.endTimePlaceholder')" | ||
| 143 | - style="width:100%" | ||
| 144 | - /> | 95 | + <el-date-picker v-model="editContractInfo.endTime" type="datetime" |
| 96 | + :placeholder="$t('contractManage.edit.endTimePlaceholder')" style="width:100%" /> | ||
| 145 | </el-form-item> | 97 | </el-form-item> |
| 146 | </el-col> | 98 | </el-col> |
| 147 | <el-col :span="8"> | 99 | <el-col :span="8"> |
| 148 | <el-form-item :label="$t('contractManage.edit.signingTime')" prop="signingTime" required> | 100 | <el-form-item :label="$t('contractManage.edit.signingTime')" prop="signingTime" required> |
| 149 | - <el-date-picker | ||
| 150 | - v-model="editContractInfo.signingTime" | ||
| 151 | - type="datetime" | ||
| 152 | - :placeholder="$t('contractManage.edit.signingTimePlaceholder')" | ||
| 153 | - style="width:100%" | ||
| 154 | - /> | 101 | + <el-date-picker v-model="editContractInfo.signingTime" type="datetime" |
| 102 | + :placeholder="$t('contractManage.edit.signingTimePlaceholder')" style="width:100%" /> | ||
| 155 | </el-form-item> | 103 | </el-form-item> |
| 156 | </el-col> | 104 | </el-col> |
| 157 | </el-row> | 105 | </el-row> |
| 158 | 106 | ||
| 159 | <!-- 合同类型规格 --> | 107 | <!-- 合同类型规格 --> |
| 160 | - <div v-for="(item,index) in editContractInfo.contractTypeSpecs" :key="index"> | 108 | + <div v-for="(item, index) in editContractInfo.contractTypeSpecs" :key="index"> |
| 161 | <el-row :gutter="20" v-if="index % 3 === 0"> | 109 | <el-row :gutter="20" v-if="index % 3 === 0"> |
| 162 | <el-col :span="8" v-for="i in 3" :key="i"> | 110 | <el-col :span="8" v-for="i in 3" :key="i"> |
| 163 | <div v-if="editContractInfo.contractTypeSpecs[index + i - 1]"> | 111 | <div v-if="editContractInfo.contractTypeSpecs[index + i - 1]"> |
| 164 | <el-form-item :label="editContractInfo.contractTypeSpecs[index + i - 1].specName"> | 112 | <el-form-item :label="editContractInfo.contractTypeSpecs[index + i - 1].specName"> |
| 165 | - <el-input | ||
| 166 | - v-model="editContractInfo.contractTypeSpecs[index + i - 1].value" | ||
| 167 | - :placeholder="editContractInfo.contractTypeSpecs[index + i - 1].specHoldplace" | ||
| 168 | - /> | 113 | + <el-input v-model="editContractInfo.contractTypeSpecs[index + i - 1].value" |
| 114 | + :placeholder="editContractInfo.contractTypeSpecs[index + i - 1].specHoldplace" /> | ||
| 169 | </el-form-item> | 115 | </el-form-item> |
| 170 | </div> | 116 | </div> |
| 171 | </el-col> | 117 | </el-col> |
| @@ -177,18 +123,14 @@ | @@ -177,18 +123,14 @@ | ||
| 177 | <el-button type="primary" @click="addFileStep"> | 123 | <el-button type="primary" @click="addFileStep"> |
| 178 | {{ $t('contractManage.edit.addFile') }} | 124 | {{ $t('contractManage.edit.addFile') }} |
| 179 | </el-button> | 125 | </el-button> |
| 180 | - <div v-for="(item,index) in editContractInfo.contractFilePo" :key="index" style="margin-top:10px"> | 126 | + <div v-for="(item, index) in editContractInfo.contractFilePo" :key="index" style="margin-top:10px"> |
| 181 | <el-row :gutter="10"> | 127 | <el-row :gutter="10"> |
| 182 | <el-col :span="2"> | 128 | <el-col :span="2"> |
| 183 | - <span>{{ $t('contractManage.edit.fileIndex', {index: index+1}) }}</span> | 129 | + <span>{{ $t('contractManage.edit.fileIndex', { index: index + 1 }) }}</span> |
| 184 | </el-col> | 130 | </el-col> |
| 185 | <el-col :span="10"> | 131 | <el-col :span="10"> |
| 186 | - <input | ||
| 187 | - type="file" | ||
| 188 | - style="display:inline-block;width:100%" | ||
| 189 | - @change="getFile($event,index)" | ||
| 190 | - accept=".png,.pdf,.jpg" | ||
| 191 | - /> | 132 | + <input type="file" style="display:inline-block;width:100%" @change="getFile($event, index)" |
| 133 | + accept=".png,.pdf,.jpg" /> | ||
| 192 | </el-col> | 134 | </el-col> |
| 193 | <el-col :span="6"> | 135 | <el-col :span="6"> |
| 194 | <span>{{ item.fileRealName }}</span> | 136 | <span>{{ item.fileRealName }}</span> |
| @@ -211,7 +153,8 @@ | @@ -211,7 +153,8 @@ | ||
| 211 | </template> | 153 | </template> |
| 212 | 154 | ||
| 213 | <script> | 155 | <script> |
| 214 | -import { updateContract, queryContractTypeSpec, queryContractFile, uploadContactFile } from '@/api/contract/contractManageApi' | 156 | +import { updateContract, queryContractTypeSpec, queryContractFile } from '@/api/contract/contractManageApi' |
| 157 | +import { uploadFile } from '@/api/system/paymentPoolApi' | ||
| 215 | 158 | ||
| 216 | export default { | 159 | export default { |
| 217 | name: 'EditContract', | 160 | name: 'EditContract', |
| @@ -352,8 +295,8 @@ export default { | @@ -352,8 +295,8 @@ export default { | ||
| 352 | const formData = new FormData() | 295 | const formData = new FormData() |
| 353 | formData.append('uploadFile', this.editContractInfo.tempfile) | 296 | formData.append('uploadFile', this.editContractInfo.tempfile) |
| 354 | 297 | ||
| 355 | - const fileSaveName = await uploadContactFile(formData) | ||
| 356 | - this.editContractInfo.contractFilePo[index].fileSaveName = fileSaveName | 298 | + const data = await uploadFile(formData,{}) |
| 299 | + this.editContractInfo.contractFilePo[index].fileSaveName = data.realFileName | ||
| 357 | this.$message.success(this.$t('contractManage.edit.uploadSuccess')) | 300 | this.$message.success(this.$t('contractManage.edit.uploadSuccess')) |
| 358 | } catch (error) { | 301 | } catch (error) { |
| 359 | console.error('上传文件失败:', error) | 302 | console.error('上传文件失败:', error) |
src/views/contract/addContractList.vue
| @@ -235,6 +235,7 @@ import { saveContract, queryContractType, queryContractPartya, queryContractType | @@ -235,6 +235,7 @@ import { saveContract, queryContractType, queryContractPartya, queryContractType | ||
| 235 | import PurchaseApprovers from '@/components/contract/purchaseApprovers' | 235 | import PurchaseApprovers from '@/components/contract/purchaseApprovers' |
| 236 | import SearchRoom from '@/components/room/searchRoom' | 236 | import SearchRoom from '@/components/room/searchRoom' |
| 237 | import SearchOwner from '@/components/owner/SearchOwner' | 237 | import SearchOwner from '@/components/owner/SearchOwner' |
| 238 | +import { uploadFile } from '@/api/system/paymentPoolApi' | ||
| 238 | 239 | ||
| 239 | export default { | 240 | export default { |
| 240 | name: 'AddContractList', | 241 | name: 'AddContractList', |
| @@ -385,7 +386,7 @@ export default { | @@ -385,7 +386,7 @@ export default { | ||
| 385 | this.addContractInfo.contractFilePo[index].fileRealName = this.addContractInfo.tempfile.name | 386 | this.addContractInfo.contractFilePo[index].fileRealName = this.addContractInfo.tempfile.name |
| 386 | this._importData(index) | 387 | this._importData(index) |
| 387 | }, | 388 | }, |
| 388 | - _importData(index) { | 389 | + async _importData(index) { |
| 389 | console.log(index) | 390 | console.log(index) |
| 390 | const _fileName = this.addContractInfo.tempfile.name | 391 | const _fileName = this.addContractInfo.tempfile.name |
| 391 | const _suffix = _fileName.substring(_fileName.lastIndexOf('.') + 1) | 392 | const _suffix = _fileName.substring(_fileName.lastIndexOf('.') + 1) |
| @@ -396,7 +397,8 @@ export default { | @@ -396,7 +397,8 @@ export default { | ||
| 396 | 397 | ||
| 397 | const formData = new FormData() | 398 | const formData = new FormData() |
| 398 | formData.append("uploadFile", this.addContractInfo.tempfile) | 399 | formData.append("uploadFile", this.addContractInfo.tempfile) |
| 399 | - | 400 | + const data = await uploadFile(formData, {}) |
| 401 | + this.addContractInfo.contractFilePo[index].fileSaveName = data.realFileName | ||
| 400 | // 这里需要实现文件上传逻辑 | 402 | // 这里需要实现文件上传逻辑 |
| 401 | // uploadContactFile(formData).then(response => { | 403 | // uploadContactFile(formData).then(response => { |
| 402 | // this.addContractInfo.contractFilePo[index].fileSaveName = response.data | 404 | // this.addContractInfo.contractFilePo[index].fileSaveName = response.data |
src/views/contract/newContractManageList.vue
| @@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
| 38 | <el-card class="table-card"> | 38 | <el-card class="table-card"> |
| 39 | <div slot="header" class="flex justify-between"> | 39 | <div slot="header" class="flex justify-between"> |
| 40 | <span>{{ $t('newContractManage.list.title') }}</span> | 40 | <span>{{ $t('newContractManage.list.title') }}</span> |
| 41 | - <el-button type="primary" size="small" @click="handleAdd"> | 41 | + <el-button type="primary" size="small" @click="handleAdd"> |
| 42 | <i class="el-icon-plus"></i> | 42 | <i class="el-icon-plus"></i> |
| 43 | {{ $t('newContractManage.list.draft') }} | 43 | {{ $t('newContractManage.list.draft') }} |
| 44 | </el-button> | 44 | </el-button> |