|
@@ -302,12 +302,13 @@
|
|
|
</template>
|
|
|
<template #action="{row,index}">
|
|
|
<el-button type="danger" plain size="small" :loading="row['delBtnLoading']" @click="delUploadData(row,index)">删除</el-button>
|
|
|
+ <el-button type="danger" plain size="small" :loading="row['delBtnLoading']" @click="replaceUploadData(row,index)">替换</el-button>
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
<template #footer>
|
|
|
<div class="lr-dialog-footer">
|
|
|
<div class="left flex items-center">
|
|
|
- <el-button type="primary" hc-btn @click="uploadFileClick">
|
|
|
+ <el-button type="primary" hc-btn @click="uploadFileClick" v-if="tableUploadType==='add'">
|
|
|
<HcIcon name="add-circle"/>
|
|
|
<span>新增上传</span>
|
|
|
</el-button>
|
|
@@ -433,9 +434,21 @@ const uploadFileClick = () => {
|
|
|
const HcUploadFileProgress = (res) => {
|
|
|
uploadsLoading.value = res
|
|
|
}
|
|
|
+
|
|
|
// 文件上传成功的回调
|
|
|
const HcUploadFileSuccess = (res) => {
|
|
|
console.log('文件上传成功', res)
|
|
|
+ console.log(isReplace.value,'isReplace.valu');
|
|
|
+ if(isReplace.value){
|
|
|
+ console.log(1111);
|
|
|
+ res.fileNumber=replacerow.value?.fileNumber
|
|
|
+ res.fileTime=replacerow.value?.fileTime
|
|
|
+ res.isApproval=replacerow.value?.isApproval
|
|
|
+ res.isNeedCertification=replacerow.value?.isNeedCertification
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(res,'res');
|
|
|
+
|
|
|
uploadsChange(res)
|
|
|
}
|
|
|
|
|
@@ -1184,7 +1197,7 @@ const tableUploadColumn = ref([
|
|
|
{key:'isNeedCertification', name: '是否需要认证'},
|
|
|
{key:'dutyUser', name: '责任者'},
|
|
|
{key:'isElement', name: '是否四要素'},
|
|
|
- {key:'action', name: '操作', width: 100}
|
|
|
+ {key:'action', name: '操作'}
|
|
|
])
|
|
|
const setTableUploadColumn = () => {
|
|
|
if (isBuiltDrawing.value === 2) {
|
|
@@ -1200,7 +1213,7 @@ const setTableUploadColumn = () => {
|
|
|
{key:'isNeedCertification', name: '是否需要认证'},
|
|
|
{key:'dutyUser', name: '责任者'},
|
|
|
{key:'isElement', name: '是否四要素'},
|
|
|
- {key:'action', name: '操作', width: 100}
|
|
|
+ {key:'action', name: '操作'}
|
|
|
]
|
|
|
sheetTypeStatus()
|
|
|
sheetSourceStatus()
|
|
@@ -1213,7 +1226,7 @@ const setTableUploadColumn = () => {
|
|
|
{key:'isNeedCertification', name: '是否需要认证'},
|
|
|
{key:'dutyUser', name: '责任者'},
|
|
|
{key:'isElement', name: '是否四要素'},
|
|
|
- {key:'action', name: '操作', width: 100}
|
|
|
+ {key:'action', name: '操作',}
|
|
|
]
|
|
|
}
|
|
|
}
|
|
@@ -1221,6 +1234,7 @@ const tableUploadData = ref([])
|
|
|
|
|
|
//上传的文件结果
|
|
|
const uploadsChange = (item) => {
|
|
|
+ console.log(item,'item');
|
|
|
if (getObjVal(item)) {
|
|
|
let newArr = tableUploadData.value
|
|
|
const sheet = sheetType.value, source = sheetSourceType.value
|
|
@@ -1230,22 +1244,26 @@ const uploadsChange = (item) => {
|
|
|
projectId: projectId.value,
|
|
|
contractId: contractId.value,
|
|
|
nodeId: nodeIds.value,
|
|
|
- fileNumber: '',
|
|
|
+ fileNumber:item?.fileNumber || '',
|
|
|
fileName: fileName,
|
|
|
ossFileName: item?.name || '',
|
|
|
- fileTime: null,
|
|
|
+ // fileTime: null,
|
|
|
+ fileTime: item?.fileTime || null,
|
|
|
fileUrl: item?.link || '',
|
|
|
sheetType: sheet.length > 0 ? sheet[0]['dictKey'] || '': '',
|
|
|
sheetSource: source.length > 0 ? source[0]['dictKey'] || '': '',
|
|
|
drawingNo: '',
|
|
|
citeChangeNumber: '',
|
|
|
- isApproval: 1,
|
|
|
- isNeedCertification: 1,
|
|
|
+ isApproval:item?.isApproval?.length>0?item?.isApproval:1 || 1,
|
|
|
+ isNeedCertification: item?.isNeedCertification?.length>0?item.isNeedCertification:1 || 1,
|
|
|
dutyUser: dutyUser.value,
|
|
|
pdfFileUrl: item?.pdfUrl || '',
|
|
|
filePage: item?.page || '',
|
|
|
isElement: 0
|
|
|
})
|
|
|
+ console.log(newArr,'newArr');
|
|
|
+ newArr[0].isApproval=item?.isApproval
|
|
|
+ newArr[0].isNeedCertification=item?.isNeedCertification
|
|
|
tableUploadData.value = newArr
|
|
|
} else {
|
|
|
console.log(item)
|
|
@@ -1274,7 +1292,21 @@ const delUploadData = async (row,index) => {
|
|
|
tableUploadData.value.splice(index,1);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+const isReplace=ref(false)
|
|
|
+const replacerow=ref({})
|
|
|
+const replaceIndex=ref()
|
|
|
+//替换replaceUploadData
|
|
|
+const replaceUploadData = async (row,index) => {
|
|
|
+ console.log(row,index);
|
|
|
+ replacerow.value=row
|
|
|
+ replaceIndex.value=index
|
|
|
+
|
|
|
+ setdutyUser()
|
|
|
+ HcUploadFileRef?.value.btnUpload()
|
|
|
+
|
|
|
+ isReplace.value=true
|
|
|
+ tableUploadData.value.splice(replaceIndex.value,1);
|
|
|
+}
|
|
|
//批量上传保存
|
|
|
const uploadSaveLoading = ref(false)
|
|
|
const batchUploadSave = async () => {
|