|
@@ -181,12 +181,22 @@
|
|
|
</template>
|
|
|
<div class="hc-switch-tab-content">
|
|
|
<div class="h-full w-full">
|
|
|
- <iframe allow="display-capture" width='100%' height='100%' frameborder='1' :src="tableRowData[tabTypeKey]" v-if="tableRowData[tabTypeKey]"/>
|
|
|
+ <div v-if="tableRowData[tabTypeKey]">
|
|
|
+ <iframe allow="display-capture" width='100%' height='100%' frameborder='1' :src="tableRowData[tabTypeKey]" style="height:500px;width:90%" />
|
|
|
+ <el-button type="primary" hc-btn :loading="importModalLoading" @click="deleteFile" style="margin-bottom: 30px;margin-left:5px">
|
|
|
+ <HcIcon name="delete-bin-2"/>
|
|
|
+ <span>删除</span>
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="hc-no-table-form" v-else>
|
|
|
<div class="table-form-no">
|
|
|
<img :src="notableform" alt=""/>
|
|
|
<div class="desc">暂无 PDF 数据,请上传</div>
|
|
|
- <HcDragUpload autoUpload @progress="tableRowPdfProgress" @finished="tableRowPdfFinished"/>
|
|
|
+ <HcDragUpload autoUpload @progress="tableRowPdfProgress" @finished="tableRowPdfFinished" :action="'endpoint/put-file-attach'"
|
|
|
+ :accept="'image/png,image/jpg,image/jpeg,application/pdf,.doc,.docx,application/msword'"
|
|
|
+ :formatTip="'允许格式:jpg/png/pdf/word'"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -206,7 +216,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {ref, onMounted} from "vue";
|
|
|
+import {ref,onMounted} from "vue";
|
|
|
import {useAppStore} from "~src/store";
|
|
|
import HcDragUpload from "./components/HcDragUpload.vue"
|
|
|
import FormItemUpload from "./components/FormItemUpload.vue"
|
|
@@ -615,13 +625,15 @@ const viewAttachmentModalClick = (row) => {
|
|
|
|
|
|
//类型tab数据和相关处理
|
|
|
const tabTypeKey = ref('productionCertificate')
|
|
|
+const tabTypeKeyType=ref(1)
|
|
|
const tabTypeTab = ref([
|
|
|
- {key:'productionCertificate', name: '生产合格证'},
|
|
|
- {key:'qualityInspectionReport', name: '厂家质检报告'},
|
|
|
- {key:'otherAccessories', name: '其他文件'},
|
|
|
+ {key:'productionCertificate', name: '生产合格证',type:1},
|
|
|
+ {key:'qualityInspectionReport', name: '厂家质检报告',type:2},
|
|
|
+ {key:'otherAccessories', name: '其他文件',type:3},
|
|
|
]);
|
|
|
const tabTypeChange = (item) => {
|
|
|
tabTypeKey.value = item?.key
|
|
|
+ tabTypeKeyType.value=item?.type
|
|
|
}
|
|
|
|
|
|
//上传进度
|
|
@@ -631,15 +643,31 @@ const tableRowPdfProgress = (res) => {
|
|
|
}
|
|
|
|
|
|
//上传完成
|
|
|
-const tableRowPdfFinished = async (data) => {
|
|
|
+const tableRowPdfFinished = async (data1) => {
|
|
|
+ console.log(data1,'data');
|
|
|
tableRowPdfDisabled.value = true
|
|
|
const row = tableRowData.value, key = tabTypeKey.value
|
|
|
- row[key] = data?.pdfUrl
|
|
|
- //保存请求
|
|
|
- const { error, code } = await approachApi.submitForm({
|
|
|
- ...row,
|
|
|
- projectId: projectId.value,
|
|
|
- contractId: contractId.value
|
|
|
+ row[key] = data1?.link
|
|
|
+ console.log(row,'row');
|
|
|
+ // //保存请求
|
|
|
+ // const { error, code } = await approachApi.submitForm({
|
|
|
+ // ...row,
|
|
|
+ // projectId: projectId.value,
|
|
|
+ // contractId: contractId.value
|
|
|
+ // })
|
|
|
+ // //处理数据
|
|
|
+ // tableRowData.value = row
|
|
|
+ // tableRowPdfDisabled.value = false
|
|
|
+ // if (!error && code === 200) {
|
|
|
+ // window?.$message?.success('操作成功')
|
|
|
+ // await getTableData()
|
|
|
+ // }
|
|
|
+ const { error, code, data } = await approachApi.updateMobilizationFile(
|
|
|
+ {
|
|
|
+ id:row.id,
|
|
|
+ type: tabTypeKeyType.value,
|
|
|
+ url:data1?.link,
|
|
|
+
|
|
|
})
|
|
|
//处理数据
|
|
|
tableRowData.value = row
|
|
@@ -649,7 +677,12 @@ const tableRowPdfFinished = async (data) => {
|
|
|
await getTableData()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+//删除上传附件
|
|
|
+const deleteFile=()=>{
|
|
|
+ console.log('删除');
|
|
|
+ console.log(tableRowData.value[tabTypeKey]);
|
|
|
+ tableRowData.value[tabTypeKey.value]=''
|
|
|
+}
|
|
|
//关闭查看附件
|
|
|
const viewAttachmentModalClose = () => {
|
|
|
viewAttachmentModal.value = false
|