luobisheng
2022-11-29 4641a877cd6a94e4d35dca7f7f14bc1443e2d2ad
src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/ill/index.vue
@@ -1,15 +1,12 @@
<template>
    <div class="ill">
        <!-- 到达现场情况 -->
        <MyArrive ref="arrive"></MyArrive>
        <MyArrive ref="arrive" :arriveData="arriveData"></MyArrive>
        <!-- 调查取证 -->
        <MyEvidence ref="evidence" :mytype="2"></MyEvidence>
        <MyEvidence ref="evidence" :evidenceData="evidenceData" :illegal-type="illegalType"></MyEvidence>
        <!-- 文种书类 -->
        <MyBook ref="book"></MyBook>
        <!-- <div class="result">
            <el-input v-model="result" placeholder="请输入处理意见"></el-input>
        </div> -->
        <!-- 底部按钮 -->
        <MyBook ref="book" :writ="writ"></MyBook>
        <div class="footer">
            <el-button @click="handleSubmit" type="primary">确定</el-button>
            <el-button @click="handleBack">返回</el-button>
@@ -20,19 +17,24 @@
import MyArrive from '../components/arrive'
import MyEvidence from "../components/evidence"
import MyBook from "../components/book"
import { parseTime } from '@/utils/index'
import casequery from "@/api/operate/basecase";
export default {
    components: {
        MyArrive, MyEvidence, MyBook
    },
    data() {
        return {
            // result:'',
        }
    },
    props: ['caseId','closeDialog'],
  data() {
      return {
        arriveData: null,
        evidenceData: null,
        writ: null
      }
  },
    props: ['caseId','closeDialog', 'vioData', 'illegalType', 'imageResourceId'],
    created() {
        console.log(this.caseId);
        this.getUserId();
      this.arriveData = this.vioData.arrivalSituation;
      this.evidenceData = this.vioData.investigation;
      this.writ = this.vioData.writ;
    },
    methods: {
        handleSubmit() {
@@ -42,74 +44,58 @@
            const { bookForm } = book.$refs;
            arriveForm.validate((valid) => {
                if (valid) {
                    console.log(valid);
                    evidenceForm.validate((flag) => {
                        if (flag) {
                            console.log(flag);
                            bookForm.validate((bookFlag) => {
                                console.log(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: arrive.arrive.arrivalTime,
                                            situationExplain: arrive.arrive.situationExplain,
                                            replyExplain: arrive.arrive.replyExplain,
                                            situationPic: `${arrive.arrive.situationPic}`,
                                            //
                                            undertaker: evidence.evidence.undertaker,
                                            assistant: evidence.evidence.assistant,
                                            investigationTime: evidence.evidence.investigationTime,
                                            address: evidence.evidence.address,
                                            caseAction: evidence.evidence.caseAction,
                                            description: evidence.evidence.description,
                                            pic: `${evidence.evidence.pic}`,
                                            //
                                            illegalType: evidence.user.illegalType,
                                            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: book.book.sendTime,
                                            limitTime: book.book.limitTime,
                                            sendContent: book.book.sendContent,
                                            rectifySituation:book.book.rectifySituation,
                                            rectifyTime: 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 => {
                                            console.log(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;
                                }
@@ -140,17 +126,6 @@
                    })
                    return false;
                }
            })
        },
        // 获取用户id
        getUserId(){
            const myname = sessionStorage.getItem('name');
            this.$axios({
                method:'get',
                url:'sccg/admin/info?name='+myname,
            })
            .then(res=>{
                console.log(res);
            })
        },
        handleBack(){