| | |
| | | <el-select |
| | | v-model="dispatch.enforcementTeam" |
| | | placeholder="选择中队" |
| | | :disabled=" |
| | | squadronOptions.length !== 0 && squadronOptions ? false : true |
| | | " |
| | | :disabled="!(squadronOptions.length !== 0 && squadronOptions)" |
| | | @change="handleMidChange" |
| | | > |
| | | <el-option |
| | |
| | | <el-select |
| | | v-model="dispatch.lawEnforcer" |
| | | placeholder="请选择人员" |
| | | :disabled=" |
| | | personOptions.length !== 0 && personOptions ? false : true |
| | | " |
| | | :disabled="!(personOptions.length !== 0 && personOptions)" |
| | | @change="handlePerChange" |
| | | > |
| | | <el-option |
| | |
| | | </template> |
| | | <script> |
| | | import MyMap from "@/components/map"; |
| | | import { parseTime } from "@/utils/index"; |
| | | export default { |
| | | components: { |
| | | MyMap, |
| | | }, |
| | | props: ["id", "changeDialog", "refresh", "mytype"], |
| | | props: ["id", "changeDialog", "refresh", "mytype", "isGetData"], |
| | | created() { |
| | | // 判断车辆类型 |
| | | this.mytype === 1 ? this.getLawCarList() : this.getSoilCarList(); |
| | | this.isGetDispatchData = this.isGetData ? this.isGetData : false; |
| | | this.getDepartList(); |
| | | }, |
| | | data() { |
| | |
| | | callback(); |
| | | } else { |
| | | callback(new Error("派遣意见不能为空")); |
| | | } |
| | | }; |
| | | const checkDistance = (rule, value, callback) => { |
| | | if (value) { |
| | | callback(); |
| | | } else { |
| | | callback(new Error("距离不能为空")); |
| | | } |
| | | }; |
| | | const checkTeam = (rule, value, callback) => { |
| | |
| | | dispatchOpinion: [ |
| | | { required: true, trigger: "change", validator: checkOpinion }, |
| | | ], |
| | | // distance: [ |
| | | // { required: true, trigger: "change", validator: checkDistance }, |
| | | // ], |
| | | // enforcementTeam: [ |
| | | // { required: true, trigger: 'change', validator: checkTeam } |
| | | // ], |
| | | lawEnforcer: [ |
| | | { required: true, trigger: "change", validator: checkPerson }, |
| | | ], |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | carOptions: [ |
| | | { |
| | | label: "车辆一", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: "车辆二", |
| | | value: 2, |
| | | }, |
| | | ], |
| | | carOptions: [], |
| | | departOptions: [], |
| | | carOptions: [ |
| | | { |
| | | label: "车辆一", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: "车辆二", |
| | | value: 2, |
| | | }, |
| | | ], |
| | | squadronOptions: [], |
| | | personOptions: [], |
| | | isGetDispatchData: true |
| | | }; |
| | | }, |
| | | methods: { |
| | | // 执行调度 |
| | | handleDispatch() { |
| | | console.log(this.dispatch); |
| | | this.$refs.form.validate((valid) => { |
| | | console.log(valid); |
| | | if (valid) { |
| | | const { dispatch, id } = this; |
| | | // dispatch.disposeDate = new Date(); |
| | | console.log(id); |
| | | dispatch.baseCaseId = id; |
| | | console.log(dispatch); |
| | | this.$axios({ |
| | | method: "post", |
| | | url: `sccg/dispatch_handle/dispatch`, |
| | | data: dispatch, |
| | | }).then((res) => { |
| | | this.$message({ |
| | | type: res.code === 200 ? "success" : "error", |
| | | message: res.code === 200 ? "调度成功" : res.message, |
| | | if (this.isGetDispatchData) { |
| | | this.$emit('getDispatchData', this.dispatch); |
| | | } else { |
| | | const { dispatch, id } = this; |
| | | dispatch.baseCaseId = id; |
| | | this.$axios({ |
| | | method: "post", |
| | | url: `sccg/dispatch_handle/dispatch`, |
| | | data: dispatch, |
| | | }).then((res) => { |
| | | this.$message({ |
| | | type: res.code === 200 ? "success" : "error", |
| | | message: res.code === 200 ? "调度成功" : res.message, |
| | | }); |
| | | this.refresh(); |
| | | }); |
| | | this.$emit("changeDialog", { flag: false }); |
| | | this.refresh(); |
| | | }); |
| | | } |
| | | this.$emit("changeDialog", { flag: false }); |
| | | } else { |
| | | return false; |
| | | this.$message.warning('请检查必填项'); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | url: `sccg/car_Manage/query_enforce?current=1&size=1000`, |
| | | }).then((res) => { |
| | | this.carOptions = res.data.records; |
| | | console.log(res, this.carOptions); |
| | | }); |
| | | }, |
| | | // 获取渣土车辆 |
| | |
| | | }, |
| | | // 获取中队 |
| | | async getTeamList(id) { |
| | | console.log(id); |
| | | await this.$axios({ |
| | | method: "get", |
| | | url: `sccg/depart/query_father_children?fatherId=${id}`, |
| | |
| | | this.squadronOptions = res.data; |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | // 获取部门下的用户 |
| | | async getDepartUserList(id) { |
| | | console.log(id); |
| | | await this.$axios({ |
| | | method: "get", |
| | | url: `sccg/admin/getDepartUser/${id}`, |
| | |
| | | this.dispatch.contactWay = ""; |
| | | this.dispatch.lawEnforcerName = ""; |
| | | await this.getTeamList(id); |
| | | // if (this.squadronOptions.length === 0) { |
| | | // await this.getDepartUserList(id); |
| | | // } |
| | | }, |
| | | // 中队更改 |
| | | async handleMidChange(id) { |
| | |
| | | watch: { |
| | | "squadronOptions.length": { |
| | | handler(newval, oldval) { |
| | | console.log(newval); |
| | | if (newval === 0) { |
| | | console.log(1); |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "该部门下没有中队", |
| | |
| | | <span>报警记录</span> |
| | | <span>乱停乱放违法占道</span> |
| | | </div> |
| | | <el-form ref="currentEvent" label-width="120px" :model="currentEvent" :rules="rules"> |
| | | <el-form ref="currentEvent" label-width="120px" :model="eventInfoData" :rules="rules"> |
| | | <el-form-item label="事件编号:"> |
| | | <span>{{ currentEvent.code }}</span> |
| | | </el-form-item> |
| | |
| | | <span>{{ currentEvent.conntinueTime }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="关联店铺" prop="store"> |
| | | <el-select v-model="currentEvent.store" @change="selectStoreChange" placeholder="请选择关联店铺"> |
| | | <el-select v-model="eventInfoData.store" @change="selectStoreChange" placeholder="请选择关联店铺"> |
| | | <el-option v-for="store in storeList" :value="store.id" :label="store.storeName" :key="store.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="currentEvent.store" label="店铺得分:"> |
| | | <span>{{ selectStoreChange(currentEvent.store).storeScore }}</span> |
| | | <el-form-item v-if="eventInfoData.store" label="店铺得分:"> |
| | | <span>{{ selectStoreChange(eventInfoData.store).storeScore }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="处理意见:" prop="advice"> |
| | | <el-radio-group v-model="currentEvent.advice"> |
| | | <el-radio-group v-model="eventInfoData.advice"> |
| | | <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="categoryId"> |
| | | <el-select v-model="currentEvent.categoryId" placeholder="请选择大类名称" @change="categoryChange"> |
| | | <el-select v-model="eventInfoData.categoryId" placeholder="请选择大类名称" @change="categoryChange"> |
| | | <el-option v-for="category in categoryOptions" :key="category.id" :value="category.id" :label="category.name" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="小类名称:" prop="typeId"> |
| | | <el-select v-model="currentEvent.typeId" placeholder="请选择小类名称"> |
| | | <el-select v-model="eventInfoData.typeId" placeholder="请选择小类名称"> |
| | | <el-option v-for="type in typeOptions" :key="type.id" :value="type.id" :label="type.name" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="车牌号:" prop="carNumber"> |
| | | <el-input v-model="currentEvent.carNumber" placeholder="请填写车牌号码"></el-input> |
| | | <el-input v-model="eventInfoData.carNumber" placeholder="请填写车牌号码"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="备注:" prop="description"> |
| | | <el-input type="textarea" :rows="5" v-model="currentEvent.description"></el-input> |
| | | <el-input type="textarea" :rows="5" v-model="eventInfoData.description"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button :disabled="currentPage === 1" @click="pageChange('prev')">上一条</el-button> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog :visible="isShowDialog" title="调度信息"> |
| | | <MyDispatch v-if="isShowDialog" :mytype="1" @confirmInspection="handleConfirm" :isGetData="true" @changeDialog="closeDialog"></MyDispatch> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { getStoreInfoList } from "@/api/operate/storeManagement"; |
| | | import { FILE_ORIGINAL_URL } from "@/utils"; |
| | | import { validateCarNum } from "@/utils/validate"; |
| | | import MyDispatch from '@/components/dispatch'; |
| | | |
| | | export default { |
| | | components: { MyDispatch }, |
| | | created() { |
| | | this.getInspectionData(); |
| | | this.initEventParams(); |
| | | basecase.getInspectionCountData() |
| | | .then(res => { |
| | | this.countData = res; |
| | |
| | | currentEvent: {}, |
| | | adviceList: [ |
| | | { |
| | | id: 1, |
| | | id: 2, |
| | | label: '上报', |
| | | }, |
| | | { |
| | | id: 2, |
| | | id: 6, |
| | | label: '调度', |
| | | }, |
| | | { |
| | |
| | | label: '暂不处理', |
| | | }, |
| | | ], |
| | | eventInfoData: null, |
| | | rules:{ |
| | | advice:[ |
| | | { |
| | |
| | | categoryOptions: [], |
| | | typeOptions: [], |
| | | storeList: [], |
| | | typeList: [] |
| | | typeList: [], |
| | | isShowDialog: false |
| | | } |
| | | }, |
| | | methods:{ |
| | |
| | | handleConfirm(){ |
| | | this.$refs.currentEvent.validate((flag)=>{ |
| | | if(flag){ |
| | | this.currentEvent.linkShop = 0; |
| | | if (this.currentEvent.store) { |
| | | const selectedStore = this.selectStoreChange(this.currentEvent.store); |
| | | this.currentEvent.shopName = selectedStore.storeName; |
| | | this.currentEvent.linkShop = 1; |
| | | this.eventInfoData.baseId = this.currentEvent.code; |
| | | |
| | | // 调度 |
| | | if (this.eventInfoData.advice === 6) { |
| | | this.isShowDialog = true; |
| | | } else { |
| | | this.confirmInspection(); |
| | | } |
| | | basecase.confirmInspection(this.currentEvent) |
| | | .then(() => { |
| | | this.$message.success('操作成功'); |
| | | this.getInspectionData(); |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | } else { |
| | | this.$message.warning('请检查必填项'); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | initEventParams() { |
| | | this.eventInfoData = { |
| | | baseId: null, |
| | | store: null, |
| | | advice: null, |
| | | categoryId: null, |
| | | typeId: null, |
| | | carNumber: null, |
| | | description: null, |
| | | linkShop: 0, |
| | | shopName: null |
| | | } |
| | | }, |
| | | |
| | | categoryChange(id) { |
| | | this.typeOptions = this.typeList.filter(type => type.parentId === id); |
| | | }, |
| | | |
| | | confirmInspection(data) { |
| | | basecase.confirmInspection({ ...this.eventInfoData, ...data }) |
| | | .then(() => { |
| | | this.$message.success('操作成功'); |
| | | this.getInspectionData(); |
| | | this.initEventParams(); |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | }, |
| | | |
| | | closeDialog() { |
| | | this.isShowDialog = false; |
| | | }, |
| | | |
| | | selectStoreChange(id) { |
| | | return this.storeList.find(store => store.id === id); |
| | | const selectedStore = this.storeList.find(store => store.id === id); |
| | | this.eventInfoData.shopName = selectedStore.storeName; |
| | | this.eventInfoData.linkShop = 1; |
| | | return selectedStore; |
| | | } |
| | | } |
| | | } |
| | |
| | | }, |
| | | created() { |
| | | const { setBigKindList, getStreetList, getEventLevel } = this; |
| | | console.log(this.mytype); |
| | | this.vio.category = this.mytype + 1; |
| | | setBigKindList(); |
| | | getStreetList(0); |
| | |
| | | selectBlur(e) { |
| | | if (e.target.value) { |
| | | this.vio.actionCause = e.target.value; |
| | | console.log(e.target.value); |
| | | } |
| | | } |
| | | }, |