| | |
| | | <template> |
| | | <div class="study-judge"> |
| | | <div class="study-judge-header"> |
| | | <span>您有1111条待审核报警信息,今日立案0条,再学习{{ currentEvent.review }}条</span> |
| | | <span>您有{{ eventList.length }}条待审核报警信息,今日立案0条,再学习{{ countData.review }}条</span> |
| | | </div> |
| | | <div class="study-judge-main"> |
| | | <div class="sjm-header"> |
| | |
| | | </div> |
| | | <div class="sjm-content"> |
| | | <div class="sjm-content-left"> |
| | | <div class="img-item"> |
| | | <div class="img-item" v-for="(item, index) in imageList" :key="item.id"> |
| | | <span>报警图片</span> |
| | | <img :src="currentEvent.picData"> |
| | | <span>报警时间:2022-09-08 14:23:34</span> |
| | | </div> |
| | | <div class="img-item"> |
| | | <img |
| | | src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__67d4d15bfc501319f8377f2ce37bf441.svg" |
| | | alt=""> |
| | | </div> |
| | | <div class="img-item"> |
| | | <img |
| | | src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__67d4d15bfc501319f8377f2ce37bf441.svg" |
| | | alt=""> |
| | | <img :src="item"> |
| | | <span v-if="index === 0">报警时间:{{ currentEvent.alarmTime }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="sjm-content-center"> |
| | |
| | | <el-radio :label="item.id" v-for="item in adviceList" :key="item.id">{{ item.label }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="问题类型:" prop="type"> |
| | | <el-input v-model="currentEvent.type" placeholder="请选择问题类型"></el-input> |
| | | <el-form-item label="大类名称:" prop="categoryId"> |
| | | <el-input v-model="currentEvent.categoryId" placeholder="请选择大类名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="大类名称:" prop="bigKind"> |
| | | <el-input v-model="currentEvent.bigKind" placeholder="请选择大类名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="小类名称:" prop="smallKind"> |
| | | <el-input v-model="currentEvent.smallKind" placeholder="请选择小类名称"></el-input> |
| | | <el-form-item label="小类名称:" prop="typeId"> |
| | | <el-input v-model="currentEvent.typeId" placeholder="请选择小类名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="车牌号:" prop="carNumber"> |
| | | <el-input v-model="currentEvent.carNumber" placeholder="请填写车牌号码"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="备注:"> |
| | | <el-input type="textarea" :rows="5" v-model="currentEvent.tip"></el-input> |
| | | <el-form-item label="备注:" prop="description"> |
| | | <el-input type="textarea" :rows="5" v-model="currentEvent.description"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button>上一条</el-button> |
| | | <el-button @click="pageChange('prev')">上一条</el-button> |
| | | <el-button @click.native.prevent="handleConfirm">确认</el-button> |
| | | <el-button>下一条</el-button> |
| | | <el-button @click="pageChange('next')">下一条</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | |
| | | export default { |
| | | created() { |
| | | basecase.getInspectionData({ current: 1 }) |
| | | .then(({ records }) => { |
| | | this.eventList = records; |
| | | this.currentEvent = this.eventList[0]; |
| | | if (this.currentEvent.picData) { |
| | | this.currentEvent.picData = `${FILE_ORIGINAL_URL}${this.currentEvent.picData}`; |
| | | } |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | |
| | | this.getInspectionData(); |
| | | basecase.getInspectionCountData() |
| | | .then(res => { |
| | | this.currentEvent.review = res.review; |
| | | this.countData = res; |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | }, |
| | | data() { |
| | | const validateAdvice = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('处理意见不能为空')) |
| | | } |
| | | } |
| | | const validateType = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('问题类型不能为空')) |
| | | } |
| | | } |
| | | const validateBigKind = (rule,value,callback)=>{ |
| | | console.log(value) |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('大类名称不能为空')) |
| | | } |
| | | } |
| | | const validateSmallKind = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('小类名称不能为空')) |
| | | } |
| | | } |
| | | const validateCarNumber = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('车牌号不能为空')) |
| | | } |
| | | } |
| | | return { |
| | | eventList: [], |
| | | currentEvent: { |
| | | code: null, |
| | | grade: null, |
| | | picData: null, |
| | | street: null, |
| | | urlAddress: null, |
| | | name: null, |
| | | latitude: null, |
| | | longitude: null, |
| | | countData: { |
| | | review: 0 |
| | | }, |
| | | currentEvent: {}, |
| | | adviceList: [ |
| | | { |
| | | id: 1, |
| | |
| | | rules:{ |
| | | advice:[ |
| | | { |
| | | trigger:'blur',validator:validateAdvice |
| | | required: true, trigger:['blur', 'change'], message: '处理意见不能为空' |
| | | }, |
| | | ], |
| | | type:[ |
| | | categoryId:[ |
| | | { |
| | | trigger:'blur',validator:validateType |
| | | required: true, trigger:['blur', 'change'], message: '大类名称不能为空' |
| | | } |
| | | ], |
| | | bigKind:[ |
| | | typeId:[ |
| | | { |
| | | trigger:'blur',validator:validateBigKind |
| | | } |
| | | ], |
| | | smallKind:[ |
| | | { |
| | | trigger:'blur',validator:validateSmallKind |
| | | required: true, trigger:['blur', 'change'], message: '小类名称不能为空' |
| | | } |
| | | ], |
| | | carNumber:[ |
| | | { |
| | | trigger:'blur',validator:validateCarNumber |
| | | required: true, trigger:['blur', 'change'], message: '车牌号不能为空' |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | imageList: [], |
| | | currentPage: 1 |
| | | } |
| | | }, |
| | | methods:{ |
| | | pageChange(type) { |
| | | if (this.eventList.length === this.currentPage) { |
| | | this.$message.warning('当前已是最后一页'); |
| | | return; |
| | | } |
| | | if (type === 'next') { |
| | | this.currentPage += 1; |
| | | } else { |
| | | this.currentPage -= 1; |
| | | } |
| | | this.currentEvent = this.eventList[this.currentPage - 1]; |
| | | }, |
| | | |
| | | getInspectionData() { |
| | | basecase.getInspectionData({ current: this.currentPage }) |
| | | .then(({ records }) => { |
| | | this.eventList = records; |
| | | this.eventList.forEach(item => { |
| | | if (item.picData) { |
| | | const imageUrls = item.picData.split(','); |
| | | this.imageList = imageUrls.map(url => `${FILE_ORIGINAL_URL}${url}`); |
| | | } |
| | | }) |
| | | this.currentEvent = this.eventList[this.currentPage - 1]; |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | }, |
| | | |
| | | // 确认点击事件 |
| | | handleConfirm(){ |
| | | console.log(this.$refs.currentEvent) |
| | | this.$refs.currentEvent.validate((flag)=>{ |
| | | console.log(flag) |
| | | if(flag){ |
| | | |
| | | basecase.confirmInspection(this.currentEvent) |
| | | .then(() => { |
| | | this.$message.success('操作成功'); |
| | | this.getInspectionData(); |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | }else{ |
| | | return false |
| | | this.$message.warning('请检查必填项') |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | .el-form { |
| | | ::v-deep .el-form-item { |
| | | // margin-bottom: 10px; |
| | | } |
| | | |
| | | ::v-deep .el-form-item__label { |