|
@@ -114,7 +114,7 @@
|
|
</template>
|
|
</template>
|
|
<template #action="{row}">
|
|
<template #action="{row}">
|
|
<HcTooltip keys="tentative_detect_test_annex">
|
|
<HcTooltip keys="tentative_detect_test_annex">
|
|
- <el-button type="primary" size="small" plain @click="viewAttachmentModalClick(row)">附件</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="small" plain @click="viewAttachmentModalClick(row)">附件</el-button>
|
|
</HcTooltip>
|
|
</HcTooltip>
|
|
<HcTooltip keys="tentative_detect_test_info">
|
|
<HcTooltip keys="tentative_detect_test_info">
|
|
<el-button type="primary" size="small" plain @click="samplingRecordModalClick(row)">样品信息</el-button>
|
|
<el-button type="primary" size="small" plain @click="samplingRecordModalClick(row)">样品信息</el-button>
|
|
@@ -128,25 +128,27 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!--查看附件-->
|
|
<!--查看附件-->
|
|
- <HcDialog :show="viewAttachmentModal" title="查看附件" widths="70rem" :footer="false" isTable @close="viewAttachmentModalClose">
|
|
|
|
|
|
+ <HcDialog :show="viewAttachmentModal" title="查看附件" widths="100rem" :footer="false" isTable @close="viewAttachmentModalClose">
|
|
<template #extra>
|
|
<template #extra>
|
|
<HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange"/>
|
|
<HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange"/>
|
|
</template>
|
|
</template>
|
|
<div class="hc-switch-tab-content" v-loading="viewAttachmentLoading">
|
|
<div class="hc-switch-tab-content" v-loading="viewAttachmentLoading">
|
|
<div class="h-full w-full flex">
|
|
<div class="h-full w-full flex">
|
|
<div class="pdf-file-list-box">
|
|
<div class="pdf-file-list-box">
|
|
- <template v-for="item in viewAttachmentData">
|
|
|
|
- <div class="file-item cur">文件名称1.pdf</div>
|
|
|
|
|
|
+ <template v-for="item in viewAttachmentData" >
|
|
|
|
+ <div class="file-item" :class="[item.isCheck ? 'cur' : '']" @click="viewCurFile(item)">{{item.name||''}}</div>
|
|
</template>
|
|
</template>
|
|
- <div class="file-item">文件名称2.pdf</div>
|
|
|
|
|
|
+ <!-- <div class="file-item">文件名称2.pdf</div>
|
|
<div class="file-item">文件名称3.pdf</div>
|
|
<div class="file-item">文件名称3.pdf</div>
|
|
<div class="file-item">文件名称4.pdf</div>
|
|
<div class="file-item">文件名称4.pdf</div>
|
|
- <div class="file-item">文件名称5.pdf</div>
|
|
|
|
|
|
+ <div class="file-item">文件名称5.pdf</div> -->
|
|
</div>
|
|
</div>
|
|
- <!--iframe allow="display-capture" width='100%' height='100%' frameborder='1' :src="attachmentPdfUrl" v-if="attachmentPdfUrl"/-->
|
|
|
|
- <div class="hc-no-table-form">
|
|
|
|
|
|
+ <!-- <iframe width='80%' height='100%' frameborder='1' :src="attachmentPdfUrl" v-if="attachmentPdfUrl"/> -->
|
|
|
|
+ <div class="hc-no-table-form" >
|
|
<div class="table-form-no">
|
|
<div class="table-form-no">
|
|
- <HcDragUpload/>
|
|
|
|
|
|
+ <HcDragUpload @progress="uploadprogress" @finished="uploadFinished" :datas="uploadData" :fileList="fileListData" v-if="listuploadref==='1'"/>
|
|
|
|
+ <HcDragUpload @progress="uploadprogress" @finished="uploadFinished" :datas="uploadData" :fileList="fileListData" v-if="listuploadref==='2'"/>
|
|
|
|
+ <HcDragUpload @progress="uploadprogress" @finished="uploadFinished" :datas="uploadData" :fileList="fileListData" v-if="listuploadref==='3'"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -504,20 +506,27 @@ const viewAttachmentModal = ref(false)
|
|
const viewAttachmentLoading = ref(false)
|
|
const viewAttachmentLoading = ref(false)
|
|
const viewAttachmentData = ref([])
|
|
const viewAttachmentData = ref([])
|
|
const viewAttachmentModalClick = async ({id}) => {
|
|
const viewAttachmentModalClick = async ({id}) => {
|
|
- viewAttachmentModal.value = true
|
|
|
|
viewAttachmentLoading.value = true
|
|
viewAttachmentLoading.value = true
|
|
const { error, code, data } = await dataApi.ancillaryDocumentsList({id: id})
|
|
const { error, code, data } = await dataApi.ancillaryDocumentsList({id: id})
|
|
//处理数据
|
|
//处理数据
|
|
viewAttachmentLoading.value = false
|
|
viewAttachmentLoading.value = false
|
|
if (!error && code === 200) {
|
|
if (!error && code === 200) {
|
|
viewAttachmentData.value = getArrValue(data)
|
|
viewAttachmentData.value = getArrValue(data)
|
|
|
|
+ if ( viewAttachmentData.value.length<1) {
|
|
|
|
+ window.$message?.warning('该条记录不存在附件')
|
|
|
|
+ }else{
|
|
|
|
+ viewAttachmentModal.value = true
|
|
|
|
+ viewCurFile( viewAttachmentData.value[0])
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
viewAttachmentData.value = []
|
|
viewAttachmentData.value = []
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
const attachmentPdfUrl = ref('')
|
|
const attachmentPdfUrl = ref('')
|
|
-
|
|
|
|
|
|
+const curFileData =ref ({})
|
|
//类型tab数据和相关处理
|
|
//类型tab数据和相关处理
|
|
const tabTypeKey = ref('productionCertificate')
|
|
const tabTypeKey = ref('productionCertificate')
|
|
const tabTypeTab = ref([
|
|
const tabTypeTab = ref([
|
|
@@ -527,11 +536,73 @@ const tabTypeTab = ref([
|
|
]);
|
|
]);
|
|
const tabTypeChange = (item) => {
|
|
const tabTypeChange = (item) => {
|
|
tabTypeKey.value = item?.key
|
|
tabTypeKey.value = item?.key
|
|
|
|
+ viewCurFile(curFileData.value)
|
|
}
|
|
}
|
|
|
|
|
|
//关闭查看附件
|
|
//关闭查看附件
|
|
const viewAttachmentModalClose = () => {
|
|
const viewAttachmentModalClose = () => {
|
|
viewAttachmentModal.value = false
|
|
viewAttachmentModal.value = false
|
|
|
|
+ curFileData.value=''
|
|
|
|
+ attachmentPdfUrl.value=''
|
|
|
|
+}
|
|
|
|
+const uploadData = ref({})
|
|
|
|
+const fileListData=ref([])
|
|
|
|
+const listuploadref=ref('1')
|
|
|
|
+//查看当前文件pdf
|
|
|
|
+const viewCurFile = (item) => {
|
|
|
|
+ curFileData.value=item
|
|
|
|
+ viewAttachmentData.value.forEach((ele)=>{
|
|
|
|
+ if (ele.name===item.name) {
|
|
|
|
+ ele.isCheck=true
|
|
|
|
+ }else{
|
|
|
|
+ ele.isCheck=false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if(tabTypeKey.value=='productionCertificate'&&item.productionCertificate.length>0){
|
|
|
|
+ let arr=[]
|
|
|
|
+ arr.push({name:item.productionCertificate,url:item.productionCertificate})
|
|
|
|
+ fileListData.value =getArrValue(arr)
|
|
|
|
+ listuploadref.value='1'
|
|
|
|
+ }else if(tabTypeKey.value=='qualityInspectionReport'&&item.qualityInspectionReport.length>0){
|
|
|
|
+ let arr=[]
|
|
|
|
+ arr.push({name:item.qualityInspectionReport,url:item.qualityInspectionReport})
|
|
|
|
+ fileListData.value =getArrValue(arr)
|
|
|
|
+ listuploadref.value='2'
|
|
|
|
+ }else if(tabTypeKey.value=='otherAccessories'&&item.otherAccessories.length>0){
|
|
|
|
+ let arr=[]
|
|
|
|
+ arr.push({name:item.otherAccessories,url:item.otherAccessories})
|
|
|
|
+ fileListData.value =getArrValue(arr)
|
|
|
|
+ listuploadref.value='3'
|
|
|
|
+ }else{
|
|
|
|
+ attachmentPdfUrl.value=''
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//上传进度
|
|
|
|
+const uploadprogress = (res) => {
|
|
|
|
+ console.log('进度');
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const productionCertificatefile=ref('')
|
|
|
|
+const qualityInspectionReportfile=ref('')
|
|
|
|
+const otherAccessoriesfile=ref('')
|
|
|
|
+//上传完成
|
|
|
|
+const uploadFinished = async(res) => {
|
|
|
|
+ if(tabTypeKey.value=='productionCertificate'){
|
|
|
|
+ productionCertificatefile.value =res
|
|
|
|
+ } else if (tabTypeKey.value=='qualityInspectionReport') {
|
|
|
|
+ qualityInspectionReportfile.value=res
|
|
|
|
+ }else{
|
|
|
|
+ otherAccessoriesfile.value=res
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const { error, code, data } = await dataApi.updateAncillaryDocument(
|
|
|
|
+ {
|
|
|
|
+ id:curFileData.value.id,
|
|
|
|
+ productionCertificate:productionCertificatefile.value.link,
|
|
|
|
+ qualityInspectionReport:qualityInspectionReportfile.value.link,
|
|
|
|
+ otherAccessories:otherAccessoriesfile.value.link
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
//样品信息数据
|
|
//样品信息数据
|
|
@@ -600,9 +671,10 @@ const onmousedown = () => {
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
height: 100%;
|
|
height: 100%;
|
|
flex: 1;
|
|
flex: 1;
|
|
|
|
+
|
|
.file-item {
|
|
.file-item {
|
|
position: relative;
|
|
position: relative;
|
|
- cursor: default;
|
|
|
|
|
|
+ cursor: pointer;
|
|
padding: 6px 10px;
|
|
padding: 6px 10px;
|
|
&:hover {
|
|
&:hover {
|
|
color: var(--el-color-primary);
|
|
color: var(--el-color-primary);
|