Ver Fonte

抽检意见接口调试

duy há 2 anos atrás
pai
commit
9c9f1ce077
2 ficheiros alterados com 14 adições e 12 exclusões
  1. 1 1
      src/api/modules/transfer/inspects.js
  2. 13 11
      src/views/transfer/inspects.vue

+ 1 - 1
src/api/modules/transfer/inspects.js

@@ -20,7 +20,7 @@ export default {
   //新增抽检意见/archiveInspectionInfo/add
   async addOpinion(form, msg = true) {
     return httpApi({
-        url: '/api/blade-archive/archiveInspectionInfo/add',
+        url: '/api/blade-archive/archiveInspectionInfo/submit',
         method: 'post',
         data: form
     }, msg);

+ 13 - 11
src/views/transfer/inspects.vue

@@ -21,8 +21,8 @@
         <div class="hc-page-content-box" v-show="!isCarrySpotChecksDrawer">
             <HcCard title="已形成的案卷">
                 <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" @row-click="tableRowClick">
-                    <template #key2="{row}">
-                        <div class="text-link" :class="row.isReviewed === 1 ? 'text-green' : 'text-blue'">{{row?.key2}}</div>
+                    <template #name="{row}">
+                        <div class="text-link" :class="row.isReviewed === 1 ? 'text-green' : ''">{{row?.name}}</div>
                     </template>
                 </HcTable>
                 <template #action>
@@ -120,7 +120,7 @@
                     <div class="header-box">
                         <div class="title">抽检意见:</div>
                         <div class="extra">
-                            <el-checkbox class="size-xl" v-model="reform.type">需要整改</el-checkbox>
+                            <el-checkbox class="size-xl" v-model="reform.type" >需要整改</el-checkbox>
                         </div>
                     </div>
                     <div class="textarea-box">
@@ -158,7 +158,7 @@
 <script setup>
 import {ref, watch, onMounted, nextTick} from "vue";
 import {useAppStore} from "~src/store";
-import { getArrValue} from "js-fast-way"
+import { getArrValue, getObjValue} from "js-fast-way"
 import HcTree from "~src/components/tree/hc-tree.vue"
 import MetaTable from "./components/meta-table.vue"
 import {getStoreValue, setStoreValue} from '~src/utils/storage'
@@ -296,9 +296,7 @@ const tableRowClick = async({row}) => {
     isCarrySpotChecksDrawer.value = true
     checkId.value=''
     const url=await viewPdf(row.id)
-        console.log(url,'url');
         pdfUrl.value=url
-       
         if(pdfUrl?.value.length>0&& isCarrySpotChecksDrawer.value){
             setTimeout(() => {
                  serReviewFile()
@@ -322,6 +320,7 @@ const changePdf=(row)=>{
     getopiniondata()
 
 }
+const opid=ref('')
 //获取抽检意见
 const getopiniondata=async()=>{
     const {error, code, data, msg} = await inspectApi.getOpinion({
@@ -329,6 +328,10 @@ const getopiniondata=async()=>{
     })
     if (!error && code === 200) {
         console.log(data,'data');
+        let opiniondata=getObjValue(data)
+        reform.value.content=opiniondata?.opinion
+        reform.value.type=opiniondata?.allOpinion?.length>0?true:false
+        opid.value=opiniondata?.id
     } 
 }
 //保存抽检意见
@@ -342,15 +345,14 @@ const submitOpinion=async()=>{
         opinion:reform.value.content,
         projectId:projectId.value,
         userId:userInfo.value.user_id,
-        archiveName:fileInfo.value.name
+        archiveName:fileInfo.value.name,
+        id:  opid.value||null
 
     })
     submitLoading.value=false
     if (!error && code === 200) {
-        console.log(data,'data');
-        if(data){
-            reform.value.type=true
-        }
+        window.$message.success(msg)
+      
     } 
     // addOpinion
 }