|
@@ -16,12 +16,15 @@
|
|
|
<el-button v-if="state === 2" hc-btn type="primary" @click="onSubmitReportClick">查看验收意见</el-button>
|
|
|
<el-button v-if="state === 2" hc-btn type="primary">撤回提交</el-button>
|
|
|
<el-button v-if="state === 1" hc-btn type="primary" @click="submissionClick">确认提交</el-button>
|
|
|
- <el-button hc-btn type="primary">暂存草稿</el-button>
|
|
|
+ <el-button hc-btn type="primary" @click="officeDraft">暂存草稿</el-button>
|
|
|
<el-button hc-btn @click="previousStep">上一步</el-button>
|
|
|
<el-button hc-btn @click="toBackClick">返回主页</el-button>
|
|
|
</template>
|
|
|
-
|
|
|
- <HcOnlineOffice :key1="dataKey" :src="docxUrl" title="测试的文档.docx" :url="saveUrl" :project-id="projectId" :token="token" :user-info="userInfo" />
|
|
|
+ <HcOnlineOffice
|
|
|
+ ref="officeRef" :key1="dataKey" :src="docxUrl" title="测试的文档.docx"
|
|
|
+ :url="saveUrl" :project-id="projectId" :token="token" :user-info="userInfo"
|
|
|
+ @download="officeDownload"
|
|
|
+ />
|
|
|
</hc-new-card>
|
|
|
|
|
|
<!-- 短信认证 -->
|
|
@@ -74,8 +77,6 @@ onMounted(() => {
|
|
|
setTimeout(() => {
|
|
|
geDocxUrl()
|
|
|
}, 1000)
|
|
|
-
|
|
|
-
|
|
|
})
|
|
|
|
|
|
const state = ref(1)
|
|
@@ -85,6 +86,19 @@ const dataKey = ref('')
|
|
|
const datafile = ref({})
|
|
|
//const docxUrl = ref('https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20230317/e2bdc6581e397b810b46ac7cd71b111b.docx')
|
|
|
|
|
|
+//暂存草稿
|
|
|
+const officeRef = ref(null)
|
|
|
+const officeDraft = () => {
|
|
|
+ //执行下载命令
|
|
|
+ const xxx = officeRef.value.getDocRef()
|
|
|
+ xxx.downloadAs()
|
|
|
+}
|
|
|
+
|
|
|
+//office文件下载事件
|
|
|
+const officeDownload = (data) => {
|
|
|
+ console.log('文件地址:', data)
|
|
|
+}
|
|
|
+
|
|
|
//获取文档地址
|
|
|
const geDocxUrl = async ()=>{
|
|
|
const { error, code, data } = await initialgApi.getArchiveConclusion({
|
|
@@ -95,7 +109,7 @@ const geDocxUrl = async ()=>{
|
|
|
dataKey.value = data['id'] + '_' + Math.random() + ''
|
|
|
console.log(dataKey.value, 'dataKey')
|
|
|
datafile.value = data
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
docxUrl.value = ''
|
|
|
}
|