| | |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="故障类型" prop="errorType"> |
| | | <el-select v-model="fastDistributeForm.errorType"> |
| | | <el-option label="市政施工" value="市政施工"/> |
| | | <el-option label="设备故障" value="设备故障"/> |
| | | <el-option label="设备遗失" value="设备遗失"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="数量限制" prop="fastNumLimit"> |
| | | <el-input v-model="fastDistributeForm.fastNumLimit" size="small" type="number" placeholder="此次工单下发最大数量"></el-input> |
| | | </el-form-item> |
| | |
| | | </el-form> |
| | | <el-button slot="reference" type="primary" size="small">快捷下发</el-button> |
| | | </el-popover> |
| | | <el-button size="small" type="primary" @click="page" class="op">刷新</el-button> |
| | | <el-button size="small" type="primary" @click="page">刷新</el-button> |
| | | <el-button size="small" type="primary" @click="handleAdd">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | |
| | | <!-- 添加或修改【请填写功能名称】对话框 --> |
| | | <el-dialog :title="detailName" :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="运维单位" prop="unitId"> |
| | | <el-select v-model="form.unitId" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in unitList" |
| | | :key="item.id" |
| | | :label="item.value" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="工单来源" prop="source"> |
| | | <el-select |
| | | v-model="form.source" |
| | | filterable |
| | | remote |
| | | reserve-keyword |
| | | placeholder="请选择来源" |
| | | :remote-method="remoteGetPoints" |
| | | :loading="selectLoading"> |
| | | <el-option |
| | | v-for="item in pointList" |
| | | :key="item.id" |
| | | :label="item.value" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="故障类型" prop="errorType"> |
| | | <el-select v-model="form.errorType"> |
| | | <el-option label="市政施工" value="市政施工"/> |
| | | <el-option label="设备故障" value="设备故障"/> |
| | | <el-option label="设备遗失" value="设备遗失"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {distributeWorkOrder, fastDistribute} from '@/api/platform/work-order' |
| | | import {distributeWorkOrder, fastDistribute, addWorkOrder, updateWorkOrder} from '@/api/platform/work-order' |
| | | import {unitSelect} from "@/api/platform/unit"; |
| | | import { pointSelectData } from "@/api/platform/point"; |
| | | export default { |
| | | name: 'index', |
| | | data() { |
| | |
| | | fastNumLimit: [ |
| | | { required: true, message: "请输入快速分发数量限制", trigger: "change" } |
| | | ], |
| | | errorType: [ |
| | | { required: true, message: "请故障类型", trigger: "change" } |
| | | ], |
| | | }, |
| | | queryParams: { |
| | | unitId: null, |
| | |
| | | activeIndex: '0', |
| | | loading: false, |
| | | workOrderList: [], |
| | | // 弹出层标题 |
| | | title: "", |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | // 表单参数 |
| | | form: { |
| | | }, |
| | | // 下拉加载 |
| | | selectLoading: false, |
| | | // 点位list |
| | | pointList: [], |
| | | // 表单校验 |
| | | rules: { |
| | | source: [ |
| | | { required: true, message: "工单来源不能为空", trigger: "blur" } |
| | | ], |
| | | workOrderNo: [ |
| | | { required: true, message: "工单号不能为空", trigger: "blur" } |
| | | ], |
| | | unitId: [ |
| | | { required: true, message: "运维单位不能为空", trigger: "blur" } |
| | | ], |
| | | errorType: [ |
| | | { required: true, message: "请选择故障类型", trigger: "blur" } |
| | | ], |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.page(); |
| | | this.selectUnit(); |
| | | }, |
| | | methods: { |
| | | submitSetting() { |
| | |
| | | handleSelectionChange(selection) { |
| | | this.multipleSelection = selection.map(item => item.id) |
| | | }, |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "添加合同"; |
| | | }, |
| | | // 表单重置 |
| | | reset() { |
| | | this.form = {}; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateWorkOrder(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.page(); |
| | | }); |
| | | } else { |
| | | addWorkOrder(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.page(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 运维公司下拉数据 |
| | | selectUnit() { |
| | | unitSelect().then(res => { |
| | | this.unitList = res.data; |
| | | }) |
| | | }, |
| | | // 远程搜索点位 |
| | | remoteGetPoints(query) { |
| | | if (query !== '') { |
| | | this.selectLoading = true; |
| | | let data = { |
| | | "keyword": query |
| | | } |
| | | pointSelectData(data).then(res => { |
| | | this.pointList = res.data; |
| | | this.selectLoading = false; |
| | | }) |
| | | } else { |
| | | this.pointList = []; |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |