Browse Source

单个保存与批量保存修改

duy 2 years ago
parent
commit
35f7979152

+ 1 - 1
src/views/tentative/detect/components/HcUpload.vue

@@ -31,7 +31,7 @@ const props = defineProps({
 //变量
 const uploadData = ref(props.datas)
 const fileListData = ref(props.fileList);
-const action = '/api/blade-manager/exceltab/add-buss-file';
+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)
 

+ 17 - 2
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' />
     </HcDialog>
 
     <!--插入特殊字符-->
@@ -182,6 +182,10 @@ const props = defineProps({
         type: String,
         default: () => ('')
     },
+    authBtnTabKey:{
+        type: String,
+        default: () => ('')
+    },
     checkTableId:{
         type: String,
         default: () => ('')
@@ -193,6 +197,7 @@ const {setPosInsert, setPosRange} = utilsText()
 const listDatas = ref(props.datas)
 const isStatus = ref(props.status)
 const baseData = ref(props.baseData)
+const authBtnTabKeyType = ref(props.authBtnTabKey)//所属方
 const useAppState = useAppStore()
 const projectId = ref(useAppState.getProjectId);
 const contractId = ref(useAppState.getContractId);
@@ -420,6 +425,7 @@ const saveExcelBussData = async (item, index, showTip = true) => {
         const InitObj = getFormDataInit(item)
         const {error, code} = await dataApi.saveExcelBussData({
             ...baseData.value,
+            isBatchSave:0,
             dataInfo: {
                 orderList: [{...formData.value[index], ...InitObj}]
             }
@@ -557,11 +563,18 @@ const uploadData = ref({})
 //上传被点击
 const uploadClick = (item,index) => {
     const pkeyIds = item.pKeyId ? item.pKeyId + '' : ''
+    const { id } = baseData.value
+    const tableType = item.tableType ? item.tableType  : ''
+    const classify = authBtnTabKeyType.value
     const keyName = `item-${index}-${pkeyIds}`
     if (pkeyIds) {
         if (isStatus.value !== '3' && item.isTableForm) {
             uploadModal.value = true
             uploadData.value = getFormDataInit(item,pkeyIds)
+            uploadData.value.tableType =tableType
+            uploadData.value.classify =classify
+             uploadData.value.id =id
+            console.log(  uploadData.value,'  uploadData.value');
             //获取文件列表
             getBussFileList(pkeyIds)
         } else if (!item.isRenderTableForm) {
@@ -579,8 +592,10 @@ const uploadClick = (item,index) => {
 
 //获取文件列表
 const getBussFileList = async (pkeyId) => {
+    const { id } = baseData.value
     const {error, code, data} = await wbsApi.getBussFileList({
-        pkeyid: pkeyId
+        pkeyid: pkeyId,
+        id:id
     })
     if (!error && code === 200) {
         fileListData.value = getArrValue(data)

+ 6 - 4
src/views/tentative/detect/test-form.vue

@@ -44,6 +44,7 @@
             <el-scrollbar ref="ListItemScrollRef" v-loading="isLoading" v-if="listItemData.length > 0">
                 <ListItem ref="ListItemRef" :datas="listItemData" :status="1" :baseData="listItemBaseData" @offsetTop="ListItemOffsetTop" @renew="getTableDataAll" 
                 :deviceUseIds="listDeviceUseIds"
+                :authBtnTabKey="authBtnTabKey"
                  @updeviceUseIds="updeviceUseIds"
                  @upcheckTableId="upcheckTableId"
                 />
@@ -500,7 +501,6 @@ const tableFormSaveClick = async () => {
       }
     
     let FormData = ListItemRef.value?.getFormData()
-    console.log(FormData,'FormData');
     let FormRegExpJson = ListItemRef.value?.getFormRegExpJson()
     //效验数据
     if (getObjNullValue(FormRegExpJson)) {
@@ -509,6 +509,7 @@ const tableFormSaveClick = async () => {
         tableFormSaveLoading.value = true
         const {error, code} = await dataApi.saveExcelBussData({
             ...listItemBaseData.value,
+            isBatchSave:1,
             dataInfo: {orderList: FormData},
             // deviceUseIds:listDeviceUseIds.value
         })
@@ -518,7 +519,7 @@ const tableFormSaveClick = async () => {
             listItemBaseData.value.deviceUseIds=''
             checkTabId.value=''
             if(!isaddType){
-                bussPdfsClick()
+                // bussPdfsClick()
             }else{
                 toBackClick()
             }
@@ -526,9 +527,10 @@ const tableFormSaveClick = async () => {
             getTableDataAll()
         }
     } else {
-        //    window.$message?.warning('请先选择你需要编辑的表格')
+       
          if(!isaddType){
-              bussPdfsClick()
+                 window.$message?.warning('请先选择你需要编辑的表格')
+            //   bussPdfsClick()
          }else{
              window.$message?.warning('请先选择你需要新增的表格')
          }