From f78386db30fc23cdfa77192e4d8c29aeaf8e71a9 Mon Sep 17 00:00:00 2001
From: luobisheng <727299681@qq.com>
Date: 星期三, 23 十一月 2022 18:09:10 +0800
Subject: [PATCH] 上传处置结果处理

---
 src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/vio/index.vue |   87 ++++++++++++++++++-------------------------
 1 files changed, 37 insertions(+), 50 deletions(-)

diff --git a/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/vio/index.vue b/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/vio/index.vue
index 6b1f6fc..ac96037 100644
--- a/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/vio/index.vue
+++ b/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/vio/index.vue
@@ -3,7 +3,7 @@
         <!-- 鍒拌揪鐜板満鎯呭喌 -->
         <MyArrive ref="arrive" :arriveData="arriveData"></MyArrive>
         <!-- 璋冩煡鍙栬瘉 -->
-        <MyEvidence ref="evidence" :evienceData="evienceData" :mytype="1" :mycode="mycode"></MyEvidence>
+        <MyEvidence ref="evidence" :evidenceData="evidenceData" :mytype="1" :mycode="mycode"></MyEvidence>
         <!-- 搴曢儴鎸夐挳 -->
         <div class="footer">
             <el-button @click="handleSubmit" type="primary">纭畾</el-button>
@@ -14,7 +14,7 @@
 <script>
 import MyArrive from '../components/arrive'
 import MyEvidence from "../components/evidence"
-import { parseTime } from '@/utils/index'
+import casequery from "@/api/operate/casequery";
 
 export default {
     components: {
@@ -23,13 +23,13 @@
     data() {
         return {
           arriveData: null,
-          evienceData: null
+          evidenceData: null
         }
     },
-    props: ['caseId', 'closeDialog','mycode', 'vioData'],
+    props: ['caseId', 'closeDialog','mycode', 'vioData', 'imageResourceId'],
     created() {
       this.arriveData = this.vioData.arrivalSituation;
-      this.evienceData = this.vioData.investigation;
+      this.evidenceData = this.vioData.investigation;
     },
     methods: {
         handleSubmit() {
@@ -40,51 +40,38 @@
                 if (valid) {
                     evidenceForm.validate((flag) => {
                         if (flag) {
-                            this.$axios({
-                                method: 'post',
-                                url: `sccg/dispatch_handle/addition_dispose_result?caseId=`+this.caseId+'&type=1',
-                                data:{
-                                    arrivalAddress: arrive.arrive.arrivalAddress,
-                                    arrivalTime: parseTime(arrive.arrive.arrivalTime),
-                                    situationExplain: arrive.arrive.situationExplain,
-                                    replyExplain: arrive.arrive.replyExplain,
-                                    situationPic: `${arrive.arrive.situationPic}`,
-                                    // 
-                                    undertaker: evidence.evidence.undertaker,
-                                    assistant: evidence.evidence.assistant,
-                                    investigationTime: parseTime(evidence.evidence.investigationTime),
-                                    address: evidence.evidence.address,
-                                    caseAction: evidence.evidence.caseAction,
-                                    description: evidence.evidence.description,
-                                    pic: `${evidence.evidence.pic}`,
-                                    // 
-                                    name: evidence.user.name,
-                                    phoneCode: evidence.user.phoneCode,
-                                    certificateType: evidence.user.certificateType,
-                                    certificateCode: evidence.user.certificateCode,
-                                    educationDegree: evidence.user.educationDegree,
-                                    career: evidence.user.career,
-                                    work: evidence.user.work,
-                                    nation: evidence.user.nation,
-                                    nativePlace: evidence.user.nativePlace,
-                                    liveAddress: evidence.user.liveAddress,
-                                    registerAddress: evidence.user.registerAddress,
-                                }
-                            })
-                                .then(res => {
-                                    if (res.code === 200) {
-                                        this.$message({
-                                            type: 'success',
-                                            message:'涓婁紶鎴愬姛',
-                                        })
-                                        this.$emit('closeDialog', { flag: false });
-                                    }else{
-                                        this.$message({
-                                            type:'warning',
-                                            message:res.message
-                                        })
-                                    }
-                                })
+                          const arriveData = Object.assign({}, arrive.arrive);
+                          const evidenceData = Object.assign({}, evidence.evidence);
+                          const { partyInfo } = evidenceData;
+                          const arrivalSituationId = arriveData.id;
+                          const investigationId = evidenceData.id;
+                          const partyInfoId = partyInfo.id;
+                          const evidencePic = evidenceData.pic.join(',');
+                          const situationPic = arriveData.situationPic.join(',');
+                          delete evidenceData.id;
+                          delete evidenceData.partyInfo;
+                          delete evidenceData.pic;
+                          delete arriveData.situationPic;
+                          delete arriveData.id;
+                          casequery.updateDisposeResult({
+                            caseId: this.caseId,
+                            imageResourceId: this.imageResourceId,
+                            pic: evidencePic,
+                            arrivalSituationId,
+                            situationPic,
+                            partyInfoId,
+                            investigationId,
+                            ...arriveData,
+                            ...evidenceData,
+                            ...partyInfo
+                          })
+                              .then(() => {
+                                this.$message.success('鎿嶄綔鎴愬姛');
+                                this.$emit('closeDialog');
+                              })
+                              .catch(err => {
+                                this.$message.error(err);
+                              })
                         } else {
                             return false;
                         }

--
Gitblit v1.8.0