commit
This commit is contained in:
@@ -11,6 +11,62 @@
|
||||
|
||||
const { $, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip } = wangEditor
|
||||
|
||||
class PDFMenu extends BtnMenu {
|
||||
constructor(editor) {
|
||||
const $elem = wangEditor.$(
|
||||
`<div class="w-e-menu" data-title="上传pdf">
|
||||
pdf
|
||||
</div>`
|
||||
)
|
||||
super($elem, editor)
|
||||
}
|
||||
|
||||
clickHandler() {
|
||||
const _this = this
|
||||
const inputFileElement = document.querySelector('#'+this.editor.textElemId).parentElement.parentElement.nextElementSibling
|
||||
inputFileElement.click()
|
||||
inputFileElement.addEventListener('change', function () {
|
||||
const file = this.files[0];
|
||||
const fileName = file.name
|
||||
|
||||
if (!fileName.toLowerCase().endsWith('.pdf')) {
|
||||
alert('请上传pdf格式的文件')
|
||||
_this.clearInputFile()
|
||||
return
|
||||
}
|
||||
|
||||
const formData = new FormData()
|
||||
formData.append('file', file, file.name)
|
||||
axios.post('/file_server/uploadFile', formData, {}).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data.code === 0) {
|
||||
const html = `<a target="_blank" href="${FILE_STREAM_PREVIEW_ADDRESS}?id=${response.data.data.id}">
|
||||
${response.data.data.filename}
|
||||
</a>`
|
||||
_this.editor.txt.html(html)
|
||||
} else {
|
||||
alert(response.data.msg + ',上传pdf失败,请联系管理员!')
|
||||
_this.clearInputFile()
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
_this.clearInputFile()
|
||||
alert('上传pdf失败,请联系管理员!')
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
clearInputFile() {
|
||||
const obj = document.getElementById('fileInput');
|
||||
obj.outerHTML = obj.outerHTML
|
||||
}
|
||||
|
||||
tryChangeActive() {
|
||||
this.active()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class AlertMenu extends BtnMenu {
|
||||
constructor(editor) {
|
||||
const $elem = wangEditor.$(
|
||||
@@ -77,6 +133,7 @@ class AlertMenu extends BtnMenu {
|
||||
}
|
||||
|
||||
wangEditor.registerMenu("alertMenuKey", AlertMenu)
|
||||
wangEditor.registerMenu('pdfMenuKey', PDFMenu)
|
||||
module.exports = {
|
||||
name: "textEditor",
|
||||
props: {
|
||||
|
||||
@@ -37,36 +37,43 @@
|
||||
|
||||
<el-descriptions-item label="线路名称">{{ viewData.lineName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="旅行社名称">{{ viewData.travelAgencyName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="是否携带家属">
|
||||
<el-descriptions-item label="是否含随行人">
|
||||
<span class="label label-primary">
|
||||
{{ viewData.isFamily ? '携带' : '未携带' }}
|
||||
{{ (viewData.companionList && viewData.companionList.length > 0) ? '携带' : '未携带' }}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="床型">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
|
||||
<el-descriptions-item label="床位">{{
|
||||
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<template v-if="modifyConfig.bedInfo && viewData.bedInfo">
|
||||
<el-descriptions-item label="房间信息">
|
||||
<span class="label label-primary">
|
||||
{{ viewData.bedInfo.bedType }}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="床位">{{
|
||||
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="意向拼床人">
|
||||
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="意向拼床人">
|
||||
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
|
||||
</el-descriptions-item>-->
|
||||
</template>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default mt20" style="border: none">
|
||||
<div v-if="modifyConfig.familyInfo == 2" class="panel panel-default mt20" style="border: none">
|
||||
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
|
||||
<h3 class="panel-title">
|
||||
同伴信息
|
||||
随行人信息
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body" style="border: 1px solid rgb(235, 238, 245)">
|
||||
<el-table :data="viewData.companionList">
|
||||
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||
<el-table-column label="性别" prop="sex"></el-table-column>
|
||||
<el-table-column label="身份证号" prop="idCard"></el-table-column>
|
||||
<el-table-column label="年龄" prop="age"></el-table-column>
|
||||
<el-table-column label="床型" prop="bedType">
|
||||
<el-table-column label="年龄" prop="age"></el-table-column>
|
||||
<el-table-column label="身份证号" prop="idCard"></el-table-column>
|
||||
<el-table-column label="手机号" prop="mobile"></el-table-column>
|
||||
<!-- <el-table-column label="床型" prop="bedType">
|
||||
<template scope="{row}">
|
||||
{{ row.bedInfo.bedType }}
|
||||
</template>
|
||||
@@ -80,13 +87,13 @@
|
||||
<template scope="{row}">
|
||||
{{ row.bedInfo.otherSleepUser ? row.bedInfo.otherSleepUser : '暂无' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
<el-table-column label="关系" prop="relation"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="所属分工会审核信息" name="2" v-if="viewData.selfUnionAuditId">
|
||||
<el-tab-pane label="所属分工会审核信息" name="2" v-if="viewData.selfUnionAuditId && viewData.selfUnionAudit">
|
||||
<div class="panel panel-default mt20" style="border: none">
|
||||
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
|
||||
<h3 class="panel-title">
|
||||
@@ -104,7 +111,7 @@
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="意向线路分工会审核信息" name="3" v-if="viewData.joinLineUnionAuditId">
|
||||
<el-tab-pane label="意向线路分工会审核信息" name="3" v-if="viewData.joinLineUnionAuditId && viewData.joinLineUnionAudit">
|
||||
<div class="panel panel-default mt20" style="border: none">
|
||||
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
|
||||
<h3 class="panel-title">
|
||||
@@ -147,6 +154,7 @@ module.exports = {
|
||||
bedInfo: {},
|
||||
},
|
||||
loading: false,
|
||||
modifyConfig:{}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -169,9 +177,16 @@ module.exports = {
|
||||
openAudit(id, activeName) {
|
||||
this.findOne(id)
|
||||
this.activeName = activeName
|
||||
}
|
||||
},
|
||||
async getModifyConfig() {
|
||||
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
|
||||
if (res.code === 0) {
|
||||
this.modifyConfig = res.data
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
async created() {
|
||||
await this.getModifyConfig();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -42,19 +42,22 @@
|
||||
{{ viewData.isFamily ? '携带' : '未携带' }}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="床型">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
|
||||
<el-descriptions-item label="床位">{{
|
||||
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="意向拼床人">
|
||||
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
|
||||
</el-descriptions-item>
|
||||
<template v-if="modifyConfig.bedInfo">
|
||||
<el-descriptions-item label="床型">{{ viewData.bedInfo.bedType }}</el-descriptions-item>
|
||||
<el-descriptions-item label="床位">{{
|
||||
viewData.bedInfo.bedNum ? viewData.bedInfo.bedNum : '暂无'
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="意向拼床人">
|
||||
{{ viewData.bedInfo.otherSleepUser ? viewData.bedInfo.otherSleepUser : '暂无' }}
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default mt20" style="border: none">
|
||||
<div v-if="modifyConfig.familyInfo == 2" class="panel panel-default mt20" style="border: none">
|
||||
<div class="panel-heading" style="background: #fafafa;border:1px solid #ebeef5;border-bottom: none">
|
||||
<h3 class="panel-title">
|
||||
同伴信息
|
||||
@@ -129,6 +132,7 @@ module.exports = {
|
||||
bedInfo: {},
|
||||
},
|
||||
loading: false,
|
||||
modifyConfig:{}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -149,9 +153,16 @@ module.exports = {
|
||||
openAudit(id, activeName) {
|
||||
this.findOne(id)
|
||||
this.activeName = activeName
|
||||
}
|
||||
},
|
||||
async getModifyConfig() {
|
||||
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
|
||||
if (res.code === 0) {
|
||||
this.modifyConfig = res.data
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
async created() {
|
||||
await this.getModifyConfig();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user