| | |
| | | <template> |
| | | <div class="vio"> |
| | | <!-- 到达现场情况 --> |
| | | <MyArrive ref="arrive" :arriveData="arriveData"></MyArrive> |
| | | <!-- 调查取证 --> |
| | | <MyEvidence |
| | | ref="evidence" |
| | | :evidenceData="evidenceData" |
| | | :mytype="1" |
| | | :mycode="mycode" |
| | | ></MyEvidence> |
| | | <!-- 底部按钮 --> |
| | | <div class="footer"> |
| | | <el-button @click="handleSubmit" type="primary">确定</el-button> |
| | | <el-button @click="handleBack">返回</el-button> |
| | | <div class="vio"> |
| | | <!-- 到达现场情况 --> |
| | | <MyArrive ref="arrive" :arriveData="arriveData"></MyArrive> |
| | | <!-- 调查取证 --> |
| | | <MyEvidence ref="evidence" :evidenceData="evidenceData" :mytype="1" :mycode="mycode"></MyEvidence> |
| | | <!-- 底部按钮 --> |
| | | <div class="footer"> |
| | | <el-button @click="handleSubmit" type="primary">确定</el-button> |
| | | <el-button @click="handleBack">返回</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import MyArrive from "../components/arrive"; |
| | | import MyEvidence from "../components/evidence"; |
| | | import MyArrive from '../components/arrive' |
| | | import MyEvidence from "../components/evidence" |
| | | import casequery from "@/api/operate/basecase"; |
| | | |
| | | export default { |
| | | components: { |
| | | MyArrive, |
| | | MyEvidence, |
| | | }, |
| | | data() { |
| | | return { |
| | | arriveData: null, |
| | | evidenceData: null, |
| | | }; |
| | | }, |
| | | props: ["caseId", "closeDialog", "mycode", "vioData", "imageResourceId"], |
| | | created() { |
| | | this.arriveData = this.vioData.arrivalSituation; |
| | | this.evidenceData = this.vioData.investigation; |
| | | }, |
| | | methods: { |
| | | handleSubmit() { |
| | | const { arrive, evidence } = this.$refs; |
| | | const { arriveForm } = arrive.$refs; |
| | | const { evidenceForm } = evidence.$refs; |
| | | arriveForm.validate((valid) => { |
| | | if (valid) { |
| | | evidenceForm.validate((flag) => { |
| | | if (flag) { |
| | | 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 ? partyInfo.id : 0; |
| | | 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; |
| | | } |
| | | }); |
| | | } else { |
| | | evidenceForm.validate((flag) => { |
| | | if (!flag) { |
| | | return false; |
| | | } |
| | | }); |
| | | return false; |
| | | components: { |
| | | MyArrive, MyEvidence |
| | | }, |
| | | data() { |
| | | return { |
| | | arriveData: null, |
| | | evidenceData: null |
| | | } |
| | | }); |
| | | }, |
| | | handleBack() { |
| | | this.$emit("closeDialog", { flag: false }); |
| | | props: ['caseId', 'closeDialog','mycode', 'vioData', 'imageResourceId'], |
| | | created() { |
| | | this.arriveData = this.vioData.arrivalSituation; |
| | | this.evidenceData = this.vioData.investigation; |
| | | }, |
| | | }, |
| | | }; |
| | | methods: { |
| | | handleSubmit() { |
| | | const { arrive, evidence } = this.$refs; |
| | | const { arriveForm } = arrive.$refs; |
| | | const { evidenceForm } = evidence.$refs; |
| | | arriveForm.validate((valid) => { |
| | | if (valid) { |
| | | evidenceForm.validate((flag) => { |
| | | if (flag) { |
| | | 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 = this.evidenceData ? partyInfo.id : null; |
| | | const evidencePic = evidenceData.pic.join(','); |
| | | const situationPic = arriveData.situationPic.join(','); |
| | | delete evidenceData.id; |
| | | delete evidenceData.partyInfo; |
| | | delete evidenceData.userInfo; |
| | | 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; |
| | | } |
| | | }) |
| | | } else { |
| | | evidenceForm.validate((flag) => { |
| | | if (!flag) { |
| | | return false; |
| | | } |
| | | }) |
| | | return false; |
| | | } |
| | | }) |
| | | }, |
| | | handleBack(){ |
| | | this.$emit('closeDialog',{flag:false}); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .vio { |
| | | padding: 20px 200px 100px; |
| | | padding: 20px 200px 100px; |
| | | } |
| | | |
| | | .footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | </style> |