Commit e6ebb63fb2f1177a5e202a825f7c4afa28df986d
1 parent
222dee41
v2.0 优化 开票无法上传的bug
Showing
3 changed files
with
32 additions
and
26 deletions
src/components/fee/uploadInvoicePhoto.vue
| 1 | 1 | <template> |
| 2 | - <el-dialog | |
| 3 | - :title="$t('uploadInvoicePhoto.title')" | |
| 4 | - :visible.sync="visible" | |
| 5 | - width="50%" | |
| 6 | - @close="closeDialog" | |
| 7 | - > | |
| 2 | + <el-dialog :title="$t('uploadInvoicePhoto.title')" :visible.sync="visible" width="50%" @close="closeDialog"> | |
| 8 | 3 | <el-form label-width="120px"> |
| 9 | 4 | <el-form-item :label="$t('uploadInvoicePhoto.invoiceCode')"> |
| 10 | - <el-input | |
| 11 | - v-model="form.invoiceCode" | |
| 12 | - :placeholder="$t('uploadInvoicePhoto.codeRequired')" | |
| 13 | - /> | |
| 5 | + <el-input v-model="form.invoiceCode" :placeholder="$t('uploadInvoicePhoto.codeRequired')" /> | |
| 14 | 6 | </el-form-item> |
| 15 | 7 | <el-form-item :label="$t('uploadInvoicePhoto.invoice')"> |
| 16 | - <upload-image-url | |
| 17 | - ref="uploadImage" | |
| 18 | - @notifyUploadCoverImage="handleImageUpload" | |
| 19 | - /> | |
| 8 | + <upload-image-url ref="uploadImage" @notifyUploadCoverImage="handleImageUpload" /> | |
| 20 | 9 | </el-form-item> |
| 21 | 10 | </el-form> |
| 22 | 11 | <div slot="footer"> |
| 23 | 12 | <el-button @click="closeDialog">{{ $t('common.cancel') }}</el-button> |
| 24 | - <el-button | |
| 25 | - type="primary" | |
| 26 | - @click="saveUploadInvoicePhoto" | |
| 27 | - >{{ $t('common.save') }}</el-button> | |
| 13 | + <el-button type="primary" @click="saveUploadInvoicePhoto">{{ $t('common.save') }}</el-button> | |
| 28 | 14 | </div> |
| 29 | 15 | </el-dialog> |
| 30 | 16 | </template> |
| ... | ... | @@ -56,7 +42,9 @@ export default { |
| 56 | 42 | invoiceCode: '', |
| 57 | 43 | photos: [] |
| 58 | 44 | } |
| 59 | - this.$refs.uploadImage.clearImages() | |
| 45 | + if (this.$refs.uploadImage) { | |
| 46 | + this.$refs.uploadImage.clearImages() | |
| 47 | + } | |
| 60 | 48 | this.visible = true |
| 61 | 49 | }, |
| 62 | 50 | closeDialog() { |
| ... | ... | @@ -74,7 +62,7 @@ export default { |
| 74 | 62 | this.$message.warning(this.$t('uploadInvoicePhoto.photoRequired')) |
| 75 | 63 | return |
| 76 | 64 | } |
| 77 | - | |
| 65 | + | |
| 78 | 66 | try { |
| 79 | 67 | const params = { |
| 80 | 68 | ...this.form, | ... | ... |
src/views/fee/invoiceApplyList.vue
| ... | ... | @@ -248,10 +248,28 @@ export default { |
| 248 | 248 | _openDeleteInvoiceApplyModel(row) { |
| 249 | 249 | this.$refs.deleteDialog.open(row) |
| 250 | 250 | }, |
| 251 | - hasPlugin(pluginName) { | |
| 252 | - // 实际项目中需要根据业务逻辑实现 | |
| 253 | - console.log(pluginName) | |
| 254 | - return true | |
| 251 | + hasPlugin(pluginType) { | |
| 252 | + const sysInfoStr = window.localStorage.getItem('java110SystemInfo') | |
| 253 | + if (!sysInfoStr) { | |
| 254 | + return false | |
| 255 | + } | |
| 256 | + let sysInfo | |
| 257 | + try { | |
| 258 | + sysInfo = JSON.parse(sysInfoStr) | |
| 259 | + } catch (error) { | |
| 260 | + return false | |
| 261 | + } | |
| 262 | + if (!sysInfo || !Object.prototype.hasOwnProperty.call(sysInfo, 'plugins')) { | |
| 263 | + return false | |
| 264 | + } | |
| 265 | + const plugins = sysInfo.plugins | |
| 266 | + let hasPlugin = false | |
| 267 | + plugins.forEach(p => { | |
| 268 | + if (pluginType === p.pluginType) { | |
| 269 | + hasPlugin = true | |
| 270 | + } | |
| 271 | + }) | |
| 272 | + return hasPlugin | |
| 255 | 273 | } |
| 256 | 274 | } |
| 257 | 275 | } | ... | ... |