| | |
| | | <el-form ref="arriveForm" label-width="160px" :model="arrive" :rules="arriveRules" autoComplete="on"> |
| | | <!-- 到达时间 --> |
| | | <el-form-item label="到达时间:" prop="arrivalTime"> |
| | | <el-date-picker v-model="arrive.arrivalTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="选择到达时间"> |
| | | <el-date-picker v-model="arrive.arrivalTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" |
| | | placeholder="选择到达时间"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <!-- 到达地址 --> |
| | |
| | | </el-form-item> |
| | | <!-- 现场情况照片 --> |
| | | <el-form-item label="现场情况照片:" prop="situationPic"> |
| | | <div class="upImg" > |
| | | <MyUpload :picture-list="arrive.situationPic" @setPictureUrl="setPicUrl" @delPictureUrl="delPicUrl"></MyUpload> |
| | | <div class="tip">{{ arrive.situationPic.length }} / 4</div> |
| | | <div class="upImg"> |
| | | <MyUpload :picture-list="arrive.situationPic" @setPictureUrl="setPicUrl" |
| | | @delPictureUrl="delPicUrl"></MyUpload> |
| | | <div class="tip"> |
| | | {{ arrive.situationPic.length }} / 4 |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <script> |
| | | import MyUpload from "@/components/myUpload" |
| | | import { deepClone } from "@/utils/helper"; |
| | | import { FILE_ORIGINAL_PATH } from "@/utils"; |
| | | export default { |
| | | components: { |
| | | MyUpload |
| | | }, |
| | | props: { |
| | | arriveData: { |
| | | type: Object, |
| | | default: () => null |
| | | } |
| | | }, |
| | | props: { |
| | | arriveData: { |
| | | type: Object, |
| | | default: () => null |
| | | } |
| | | }, |
| | | data() { |
| | | const checkTime = (rule, value, callback) => { |
| | | if (value) { |
| | |
| | | fileList: [], |
| | | } |
| | | }, |
| | | created() { |
| | | if (this.arriveData) { |
| | | this.arrive = deepClone(this.arriveData); |
| | | this.arrive.situationPic = this.arriveData.situationPic.split(','); |
| | | } |
| | | }, |
| | | methods: { |
| | | created() { |
| | | if (this.arriveData) { |
| | | this.arrive = deepClone(this.arriveData); |
| | | this.arrive.situationPic = this.arriveData.situationPic.split(','); |
| | | this.arrive.situationPic.forEach(item => { |
| | | item = FILE_ORIGINAL_PATH + item |
| | | }); |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | handleSuccess(res, file, filelist) { |
| | | const baseUrl = 'http://140.143.152.226:8410/'; |
| | | const baseUrl = ''; |
| | | if (this.arrive.situationPic.length < 4) { |
| | | this.arrive.situationPic.push(baseUrl + res.data.url1) |
| | | } |
| | |
| | | }, |
| | | // 设置上传成功之后的图片地址 |
| | | setPicUrl({ url }) { |
| | | const baseUrl = 'http://140.143.152.226:8410/'; |
| | | const baseUrl = ''; |
| | | if (this.arrive.situationPic.length < 4) { |
| | | this.arrive.situationPic.push(baseUrl + url) |
| | | this.arrive.situationPic.push(url) |
| | | } |
| | | }, |
| | | //删除图片 |
| | | delPicUrl({url}){ |
| | | const baseUrl = 'http://140.143.152.226:8410/'; |
| | | this.arrive.situationPic.splice(this.arrive.situationPic.indexOf(baseUrl + url),1); |
| | | delPicUrl({ url }) { |
| | | const baseUrl = ''; |
| | | this.arrive.situationPic.splice(this.arrive.situationPic.indexOf(baseUrl + url), 1); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | .upImg { |
| | | display: flex; |
| | | overflow: auto; |
| | | |
| | | .tip { |
| | | position: absolute; |
| | |
| | | |
| | | // ::v-deep .el-form-item__label { |
| | | // color: #4b9bb7; |
| | | // } |
| | | </style> |
| | | // }</style> |