| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="上报时间:" prop="escalationTime" class="span"> |
| | | <el-date-picker |
| | | v-model="formData.escalationTime" |
| | | value-format="yyyy-MM-dd" |
| | | size="small" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | /> |
| | | <el-date-picker v-model="formData.escalationTime" value-format="yyyy-MM-dd" size="small" type="date" placeholder="选择日期" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="责任主体:" prop="unitId" class="span"> |
| | | <el-select v-model="formData.unitId" placeholder="请选择" size="small"> |
| | | <el-option |
| | | v-for="item in unitList" |
| | | :key="item.unitId" |
| | | :label="item.unitName" |
| | | :value="item.unitId" |
| | | /> |
| | | <el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName" :value="item.unitId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="污染分类:" prop="polluteType" class="span"> |
| | | <el-select v-model="formData.polluteType" placeholder="请选择" size="small"> |
| | | <el-option |
| | | v-for="item in polluteList" |
| | | :key="item.dataKey" |
| | | :label="item.dataValue" |
| | | :value="item.dataKey" |
| | | /> |
| | | <el-option v-for="item in polluteList" :key="item.dataKey" :label="item.dataValue" :value="item.dataKey" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="整改类型:" prop="changeType" class="span"> |
| | | <el-select v-model="formData.changeType" placeholder="请选择" size="small" @change="changeEnumList"> |
| | | <el-option |
| | | v-for="item in Dic.changeEnum" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.value" |
| | | /> |
| | | <el-option v-for="item in Dic.changeEnum" :key="item.value" :label="item.name" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="上报单位:" prop="escalationUnitId" class="span"> |
| | | <el-select v-model="formData.escalationUnitId" placeholder="请选择" size="small"> |
| | | <el-option |
| | | v-for="item in unitList" |
| | | :key="item.unitId" |
| | | :label="item.unitName" |
| | | :value="item.unitId" |
| | | /> |
| | | <el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName" :value="item.unitId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <div> |
| | | <div v-if="pageState==='edit'"> |
| | | <div v-for="(file,index) in fileBaseListCover" :key="file.fileId+index" class="block"> |
| | | <el-image |
| | | v-if="file.fileType ===1" |
| | | style="width: 100px; height: 100px" |
| | | :src="file.url" |
| | | :preview-src-list="getPreviewImages(file.fileId,fileBaseList)" |
| | | :initial-index="index" |
| | | /> |
| | | <el-image v-if="file.fileType ===1" style="width: 100px; height: 100px" :src="file.url" :preview-src-list="getPreviewImages(file.fileId,fileBaseList)" :initial-index="index" /> |
| | | <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)"> |
| | | 您的浏览器不支持 video 标签。 |
| | | </video> |
| | |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="videoVisible" width="600px" :modal-append-to-body="false" :destroy-on-close="true" @close="handleCancel"> |
| | | <div style="text-align: center;"> |
| | | <video |
| | | ref="video" |
| | | style="width: 300px;height: 500px" |
| | | :src="dialogImageUrl" |
| | | controls |
| | | autoplay |
| | | /> |
| | | <video ref="video" style="width: 300px;height: 500px" :src="dialogImageUrl" controls autoplay /> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | return { |
| | | videoVisible: false, |
| | | formData: { |
| | | unitId: '', |
| | | escalationUnitId: '', |
| | | changeType: '', |
| | | polluteType: '', |
| | | escalationTime: new Date(), |
| | | fileBaseList: [], |
| | | escalationName: '', |
| | | changeDay: 0, |
| | |
| | | changeType: [ |
| | | { required: true, message: '请选择整改类型', trigger: 'change' } |
| | | ], |
| | | changeDay: [ |
| | | { required: true, message: '请输入天数', trigger: 'blur' } |
| | | ], |
| | | changeDay: [{ required: true, message: '请输入天数', trigger: 'blur' }], |
| | | escalationUnitId: [ |
| | | { required: true, message: '请选择上报单位', trigger: 'change' } |
| | | ], |
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | 'pageState': { |
| | | pageState: { |
| | | handler(newVal) { |
| | | if (this.pageState === 'edit') { |
| | | if (this.parentFormData.fileBaseList && this.parentFormData.fileBaseList.length > 0) { |
| | | if ( |
| | | this.parentFormData.fileBaseList && |
| | | this.parentFormData.fileBaseList.length > 0 |
| | | ) { |
| | | this.parentFormData.fileBaseList.forEach(item => { |
| | | if (item.fileType === 1) { |
| | | this.fileBaseList.push(`${requestObj.baseUrl}file/preview/${item.fileId}`) // 原图 |
| | | this.fileBaseList.push( |
| | | `${requestObj.baseUrl}file/preview/${item.fileId}` |
| | | ) // 原图 |
| | | } |
| | | // const srcApi = item.fileType === 1 ? api + 'preview/' : api + 'preview/cover/' |
| | | // this.fileBaseList.push(`${requestObj.baseUrl}file/preview/${item.fileId}`) // 原图 |
| | | this.fileBaseListCover.push({ |
| | | url: item.fileType === 1 ? `${requestObj.baseUrl}file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}file/preview/${item.fileId}`, |
| | | url: |
| | | item.fileType === 1 |
| | | ? `${requestObj.baseUrl}file/preview/cover/${item.fileId}` |
| | | : `${requestObj.baseUrl}file/preview/${item.fileId}`, |
| | | fileType: item.fileType, |
| | | fileId: item.fileId, |
| | | fileName: item.fileName |
| | |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | | console.log('oldValue', this.parentFormData) |
| | | if (!(JSON.stringify(this.parentFormData) === '{}')) { |
| | | this.formData = this.parentFormData |
| | | this.formData.polluteType = String(this.parentFormData.polluteType) |
| | | } else { |
| | | const name = this.$store.state.user.name |
| | | this.formData.escalationName = name |
| | | } |
| | | |
| | | async created() { |
| | | this.getUnitList() |
| | | this.getContaminateList() |
| | | |
| | | console.log('oldValue', this.parentFormData) |
| | | |
| | | bus.$on('changeFileAfterList', (type, fileList) => { |
| | | this.formData.fileBaseList = [] |
| | | if (fileList.length > 0) { |
| | | fileList.map((item) => { |
| | | fileList.map(item => { |
| | | if (item.response) { |
| | | console.log('item.response.data', item.response.data) |
| | | this.formData.fileBaseList.push(item.response.data) |
| | |
| | | this.$request({ |
| | | url: '/allocation/unit', |
| | | method: 'get' |
| | | }).then((res) => { |
| | | }).then(res => { |
| | | this.unitList = res.data |
| | | this.getContaminateList() |
| | | }) |
| | | }, |
| | | getContaminateList() { |
| | | this.$request({ |
| | | url: '/allocation/contaminate', |
| | | method: 'get' |
| | | }).then((res) => { |
| | | }).then(res => { |
| | | this.polluteList = res.data |
| | | if (!(JSON.stringify(this.parentFormData) === '{}')) { |
| | | this.formData = this.parentFormData |
| | | this.formData.polluteType = String(this.parentFormData.polluteType) |
| | | } else { |
| | | const name = this.$store.state.user.name |
| | | this.formData.escalationName = name |
| | | this.formData.changeType = this.Dic.changeEnum[0].value |
| | | this.formData.unitId = this.unitList[0].unitId |
| | | this.formData.escalationUnitId = this.unitList[0].unitId |
| | | this.formData.polluteType = this.polluteList[0].dataKey |
| | | } |
| | | }) |
| | | }, |
| | | close() { |
| | | this.$nextTick(function() { |
| | | this.$nextTick(function () { |
| | | this.$refs.ruleForm.resetFields() |
| | | }) |
| | | this.$emit('update:visible', false) |
| | |
| | | }) |
| | | } |
| | | this.formData.state = val |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | this.$refs.ruleForm.validate(valid => { |
| | | if (valid) { |
| | | // this.formData.fileBaseList = [...this.parentFormData.fileBaseList, this.formData.fileBaseList] |
| | | this.$emit('handleSubmit', this.formData) |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .titBox{ |
| | | .titBox { |
| | | position: relative; |
| | | font-size: 18px; |
| | | div:first-child{ |
| | | div:first-child { |
| | | position: absolute; |
| | | left: 10px; |
| | | } |
| | | div{ |
| | | div { |
| | | display: inline-block; |
| | | } |
| | | } |
| | | .block { |
| | | display: inline-block !important; |
| | | margin-right: 10px; |
| | | display: inline-block !important; |
| | | margin-right: 10px; |
| | | } |
| | | .textBox { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-left: 15px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-left: 15px; |
| | | } |
| | | |
| | | .el-dialog__body>div { |
| | | border-bottom: 1px dashed rgba(187, 187, 187, 1); |
| | | .el-dialog__body > div { |
| | | border-bottom: 1px dashed rgba(187, 187, 187, 1); |
| | | } |
| | | .span{ |
| | | .span { |
| | | /deep/.el-form-item__content { |
| | | |
| | | div { |
| | | width: 100%; |
| | | } |
| | | div { |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .textare { |
| | | /deep/.el-form-item__content { |
| | | width: 800px; |
| | | /deep/.el-form-item__content { |
| | | width: 800px; |
| | | |
| | | div { |
| | | width: 100%; |
| | | } |
| | | div { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | } |
| | | </style> |