Browse Source

保存抽检记录修改

duy 1 year ago
parent
commit
35b02b22be

+ 9 - 0
src/api/modules/initial/initial.js

@@ -97,6 +97,7 @@ export default {
             data: form,
         }, msg)
      },
+
      //档案在线验收-开始抽检
      async startInspect(form, msg = true) {
         return httpApi({
@@ -121,4 +122,12 @@ export default {
             params: form,
         }, msg)
     },
+    //在线验收-获取档案文件抽检意见
+    async getArchiveFileOpinion(form, msg = true) {
+    return httpApi({
+        url: '/api/blade-archive/archivesauto/getArchiveFileOpinion',
+        method: 'get',
+        params: form,
+    }, msg)
+},
 }

+ 5 - 2
src/views/transfer/components/carry-spot-checks.vue

@@ -221,12 +221,14 @@ watch(() => [
     useAppState.getBubble,
     props.fileId,
     props.fileInfo,
-], ([show, bubble, FileId, FileInfo]) => {
+    props.projectId,
+], ([show, bubble, FileId, FileInfo, ProjectId]) => {
   
     isDrawer.value = show
     isBubble.value = bubble
     fileId.value = FileId
     fileInfo.value = FileInfo
+    projectId.value = ProjectId
 
     if (fileId.value && isDrawer.value) {
         getArchiveFileListData()
@@ -336,8 +338,9 @@ const opid = ref('')
 
 //获取抽检意见
 const getopiniondata = async ()=>{
-    const { error, code, data, msg } = await initialgApi.getOpinion({
+    const { error, code, data, msg } = await initialgApi.getArchiveFileOpinion({
         fileId: checkId.value,
+        projectId:projectId.value,
     })
     if (!error && code === 200) {
         console.log(data, 'data')

+ 16 - 3
src/views/transfer/components/examination/table-opinion.vue

@@ -8,7 +8,7 @@
             <span v-else>{{ row.opinion }}</span>
         </template>
         <template #action="{ row }">
-            <el-button v-if="row.isEdit" type="success" size="small" @click="saveClick(row)">
+            <el-button v-if="row.isEdit" type="success" size="small" :loading="submitLoading" @click="saveClick(row)">
                 保存
             </el-button>
             <el-button v-else type="primary" size="small" @click="editClick(row)">
@@ -85,12 +85,25 @@ const getTableData = async () => {
 const tableLoading = ref(false)
 
 //编辑
-const editClick = (row) => {
+const submitLoading = ref(false)
+const editClick = async (row) => {
     row.isEdit = true
+
 }
 //保存
-const saveClick = (row) => {
+const saveClick = async (row) => {
     row.isEdit = false
+    submitLoading.value = true
+    const { error, code, data, msg } = await initialgApi.saveInspect({
+     ...row,
+
+    })
+    submitLoading.value = false
+    if (!error && code === 200) {
+        window.$message.success(msg)
+      
+
+    }
 }
 //删除
 const delClick = (row) => {

+ 1 - 1
src/views/transfer/preliminary-examination.vue

@@ -83,7 +83,7 @@
 
         <!-- 展开抽查 -->
         <CarrySpotChecks
-            :show="isCarrySpotChecksDrawer" close-text="关闭案卷" check-text="保存并继续抽检" :file-id="fileId" :file-info="fileInfo" @check="onCarrySpotChecksClose"
+            :show="isCarrySpotChecksDrawer" close-text="关闭案卷" check-text="保存并继续抽检" :file-id="fileId" :file-info="fileInfo" :project-id="projectId" @check="onCarrySpotChecksClose"
             @close="onCarrySpotChecksClose"
         />
 

+ 21 - 4
src/views/transfer/writing-conclusion.vue

@@ -56,13 +56,13 @@
         <!-- 抽检记录详情 -->
         <hc-new-dialog v-model="isOpinionModal" title="抽检记录详情" widths="60%" is-table :footer="false" @close="onOpinionModalClose">
             <div class="hc-table-opinion-text">
-                <div class="title">案卷题名:安康至来凤国家高速公路奉节至巫山....</div>
+                <div class="title">案卷题名:{{ opRow.archiveName }}</div>
                 <div class="opinion-text">
                     <div class="text-1">抽检意见:</div>
                     <div v-if="!opinionTextEdit" class="text-2">{{ opinionText }}</div>
                     <div v-if="opinionTextEdit" class="text-2 input">
                         <el-input v-model="opinionText" style="flex: 1;" :rows="3" placeholder="请输入抽检意见" type="textarea" resize="none" />
-                        <el-button class="ml-4" hc-btn type="primary" @click="opinionTextEditHihe">保存</el-button>
+                        <el-button class="ml-4" hc-btn type="primary" :loading="submitLoading" @click="opinionTextEditHihe">保存</el-button>
                     </div>
                     <div v-if="!opinionTextEdit" class="text-blue text-hover icon-1" @click="opinionTextEditShow">
                         <HcIcon name="edit-2" />
@@ -85,6 +85,7 @@ import { useRouter } from 'vue-router'
 import TableStats from './components/conclusion/table-stats.vue'
 import TableOpinion from './components/conclusion/table-opinion.vue'
 import TableScore from './components/conclusion/table-score.vue'
+import initialgApi from '~api/initial/initial'
 
 //变量
 const router = useRouter()
@@ -122,8 +123,11 @@ const searchFormScore = ref({
 
 //查看意见
 const isOpinionModal = ref(false)
-const tableOpinionTap = () => {
+const opRow = ref({})
+const tableOpinionTap = (row) => {
     isOpinionModal.value = true
+    opRow.value = row
+    opinionText.value = row.opinion
 }
 const onOpinionModalClose = () => {
     isOpinionModal.value = false
@@ -136,8 +140,21 @@ const opinionTextEdit = ref(false)
 const opinionTextEditShow = () => {
     opinionTextEdit.value = true
 }
+const submitLoading = ref(false)
+const opinionTextEditHihe = async () => {
+    submitLoading.value = true
+    const { error, code, data, msg } = await initialgApi.saveInspect({
+     ... opRow.value,
+     opinion:opinionText.value,
+
+    })
+    submitLoading.value = false
+    if (!error && code === 200) {
+        window.$message.success(msg)
+      
+
+    }
 
-const opinionTextEditHihe = () => {
     opinionTextEdit.value = false
 }