luobisheng
2022-11-29 4641a877cd6a94e4d35dca7f7f14bc1443e2d2ad
src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/ill/index.vue
@@ -3,9 +3,9 @@
        <!-- 到达现场情况 -->
        <MyArrive ref="arrive" :arriveData="arriveData"></MyArrive>
        <!-- 调查取证 -->
        <MyEvidence ref="evidence" :evidenceData="evidenceData" :mytype="2" :mycode="mycode"></MyEvidence>
        <MyEvidence ref="evidence" :evidenceData="evidenceData" :illegal-type="illegalType"></MyEvidence>
        <!-- 文种书类 -->
        <MyBook ref="book" :writ="writ" :mycode="mycode"></MyBook>
        <MyBook ref="book" :writ="writ"></MyBook>
        <div class="footer">
            <el-button @click="handleSubmit" type="primary">确定</el-button>
@@ -17,7 +17,8 @@
import MyArrive from '../components/arrive'
import MyEvidence from "../components/evidence"
import MyBook from "../components/book"
import {parseTime} from '@/utils/index'
import { parseTime } from '@/utils/index'
import casequery from "@/api/operate/basecase";
export default {
    components: {
        MyArrive, MyEvidence, MyBook
@@ -29,7 +30,7 @@
        writ: null
      }
  },
    props: ['caseId','closeDialog','mycode', 'vioData'],
    props: ['caseId','closeDialog', 'vioData', 'illegalType', 'imageResourceId'],
    created() {
      this.arriveData = this.vioData.arrivalSituation;
      this.evidenceData = this.vioData.investigation;
@@ -42,72 +43,59 @@
            const { evidenceForm } = evidence.$refs;
            const { bookForm } = book.$refs;
            arriveForm.validate((valid) => {
              // const partyInfoId = this.evidenceData ? partyInfo.id : null;
                if (valid) {
                    evidenceForm.validate((flag) => {
                        if (flag) {
                            bookForm.validate((bookFlag) => {
                                if (bookFlag) {
                                    this.$axios({
                                        method: 'post',
                                        url: `sccg/dispatch_handle/addition_dispose_result?caseId=${this.caseId}&type=2`,
                                        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}`,
                                            partyInfoId: this.evidenceData ? evidence.evidence.partyInfo.id : null,
                                            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,
                                            //
                                            writType: book.book.writType,
                                            writCode: book.book.writCode,
                                            illegalType: book.book.illegalType,
                                            sendTime: parseTime(book.book.sendTime),
                                            limitTime: parseTime(book.book.limitTime),
                                            sendContent: book.book.sendContent,
                                            rectifySituation:book.book.rectifySituation,
                                            rectifyTime:parseTime(book.book.rectifyTime),
                                            remark: book.book.remark,
                                            writPic: `${book.book.writPic}`,
                                            originalPic: `${book.book.originalPic}`,
                                            rectifiedPic: `${book.book.rectifiedPic}`,
                                            otherPic: `${book.book.otherPic}`,
                                        }
                                    })
                                        .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 bookData = Object.assign({}, book.book);
                                  const partyInfo = evidence.user;
                                  const arrivalSituationId = arriveData.id;
                                  const investigationId = evidenceData.id;
                                  const partyInfoId = this.evidenceData ? partyInfo.id : null;
                                  const evidencePic = evidenceData.pic.join(',');
                                  const situationPic = arriveData.situationPic.join(',');
                                  const otherPic = bookData.otherPic.join(',');
                                  const writPic = bookData.writPic.join(',');
                                  const rectifiedPic = bookData.rectifiedPic.join(',');
                                  const originalPic = bookData.originalPic.join(',');
                                  delete evidenceData.id;
                                  delete evidenceData.partyInfo;
                                  delete evidenceData.userInfo;
                                  delete evidenceData.pic;
                                  delete arriveData.situationPic;
                                  delete arriveData.id;
                                  delete bookData.otherPic;
                                  delete bookData.writPic;
                                  delete bookData.rectifiedPic;
                                  delete bookData.originalPic;
                                  delete evidenceData.illegalType;
                                  casequery.updateDisposeResult({
                                    caseId: this.caseId,
                                    imageResourceId: this.imageResourceId,
                                    pic: evidencePic,
                                    arrivalSituationId,
                                    situationPic,
                                    partyInfoId,
                                    investigationId,
                                    otherPic,
                                    writPic,
                                    rectifiedPic,
                                    originalPic,
                                    ...arriveData,
                                    ...evidenceData,
                                    ...partyInfo,
                                    ...bookData
                                  })
                                      .then(() => {
                                        this.$message.success('操作成功');
                                        this.$emit('closeDialog');
                                      })
                                      .catch(err => {
                                        this.$message.error(err);
                                      })
                                } else {
                                    return false;
                                }