Эх сурвалжийг харах

试验文件上传删除修改

duy 2 жил өмнө
parent
commit
d24b90f931

+ 15 - 0
src/api/modules/data-fill/wbs.js

@@ -161,6 +161,13 @@ export default {
             params: form
         },msg);
     },
+    async getBussFileList1(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-business/detection/self/file-list',
+            method: 'get',
+            params: form
+        },msg);
+    },
     //逻辑删除
     async removeBussFile(form, msg = true) {
         return httpApi({
@@ -169,6 +176,14 @@ export default {
             params: form
         },msg);
     },
+    //删除试验文件
+    async removeBussFile1(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-manager/tablefile/remove-trial',
+            method: 'post',
+            params: form
+        },msg);
+    },
     //用户端删除复制信息表
     async removeBussTabInfo(form, msg = true) {
         return httpApi({

+ 22 - 2
src/views/tentative/detect/components/HcUpload.vue

@@ -26,11 +26,27 @@ const props = defineProps({
         type: Object,
         default: () => ({})
     },
+    baseData:{
+        type: Object,
+        default: () => ({})
+    },
+    contractId:{
+        type: String,
+        default: () => ('')
+    },
+    tableTypeValue:{
+        type: String,
+        default: () => ('')
+    }
 })
 
 //变量
 const uploadData = ref(props.datas)
 const fileListData = ref(props.fileList);
+const contractId = ref(props.contractId);
+const tableType = ref(props.tableTypeValue);
+const baseData = ref(props.baseData);
+
 const action = '/api/blade-business/detection/self/add-buss-file';
 const accept = 'image/png,image/jpg,image/jpeg,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/pdf,.doc,.docx,application/msword';
 const uploadDisabled = ref(false)
@@ -109,10 +125,14 @@ const uploadPreview = ({url}) => {
 
 //删除文件
 const delUploadData = async ({id}) => {
+ 
     loadingText.value = '删除中...'
     uploadDisabled.value = true
-    const {error, code} = await wbsApi.removeBussFile({
-        ids: id
+    const {error, code} = await wbsApi.removeBussFile1({
+        ids: id,
+        tableType:tableType.value,
+        contractId:contractId.value,
+        id:baseData.value.id
     })
     uploadDisabled.value = false
     if (!error && code === 200) {

+ 4 - 3
src/views/tentative/detect/components/ListItem.vue

@@ -85,7 +85,7 @@
 
     <!--上传文件-->
     <HcDialog :show="uploadModal" title="上传文件" widths="38rem" :footer="false" @close="uploadModal = false">
-        <HcUpload :fileList="fileListData" :datas="uploadData" @change='uploadChange' />
+        <HcUpload :fileList="fileListData" :datas="uploadData" @change='uploadChange' :tableTypeValue="tableTypeValue" :contractId="contractId" :baseData="baseData"/>
     </HcDialog>
 
     <!--插入特殊字符-->
@@ -559,12 +559,13 @@ const previewClick = async (item,index) => {
 const uploadModal = ref(false)
 const fileListData = ref([]);
 const uploadData = ref({})
-
+const tableTypeValue=ref('')
 //上传被点击
 const uploadClick = (item,index) => {
     const pkeyIds = item.pKeyId ? item.pKeyId + '' : ''
     const { id } = baseData.value
     const tableType = item.tableType ? item.tableType  : ''
+    tableTypeValue.value= item.tableType ? item.tableType  : ''
     const classify = authBtnTabKeyType.value
     const keyName = `item-${index}-${pkeyIds}`
     if (pkeyIds) {
@@ -593,7 +594,7 @@ const uploadClick = (item,index) => {
 //获取文件列表
 const getBussFileList = async (pkeyId) => {
     const { id } = baseData.value
-    const {error, code, data} = await wbsApi.getBussFileList({
+    const {error, code, data} = await wbsApi.getBussFileList1({
         pkeyid: pkeyId,
         id:id
     })