From 1bf90d7e6f8f394112a06bb3e459326fb5041de6 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Mon, 23 Oct 2023 15:51:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E4=BF=AE+=E5=A7=94=E5=A4=96=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/device/faultReport.js | 9 + src/api/device/outsourceWorkOrder.js | 44 +++ src/views/device/faultReport/index.vue | 81 ++-- .../{single.vue => selectSingleEquipment.vue} | 113 ++---- .../device/faultReport/selectSinglePerson.vue | 183 +++++++++ src/views/device/outsourceWorkOrder/index.vue | 349 ++++++++++++++++++ 6 files changed, 685 insertions(+), 94 deletions(-) create mode 100644 src/api/device/outsourceWorkOrder.js rename src/views/device/faultReport/{single.vue => selectSingleEquipment.vue} (74%) create mode 100644 src/views/device/faultReport/selectSinglePerson.vue create mode 100644 src/views/device/outsourceWorkOrder/index.vue diff --git a/src/api/device/faultReport.js b/src/api/device/faultReport.js index e183880..81cb245 100644 --- a/src/api/device/faultReport.js +++ b/src/api/device/faultReport.js @@ -68,3 +68,12 @@ export function checkFaultReport(data) { data: data }); } + +// 查询报修人员列表 +export function getPersonList(query) { + return request({ + url: '/device/faultReport/getPersonList', + method: 'get', + params: query + }); +} diff --git a/src/api/device/outsourceWorkOrder.js b/src/api/device/outsourceWorkOrder.js new file mode 100644 index 0000000..486fca1 --- /dev/null +++ b/src/api/device/outsourceWorkOrder.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询委外工单列表 +export function listOutsourceWorkOrder(query) { + return request({ + url: '/device/outsourceWorkOrder/list', + method: 'get', + params: query + }); +} + +// 查询委外工单详细 +export function getOutsourceWorkOrder(workId) { + return request({ + url: '/device/outsourceWorkOrder/' + workId, + method: 'get' + }); +} + +// 新增委外工单 +export function addOutsourceWorkOrder(data) { + return request({ + url: '/device/outsourceWorkOrder', + method: 'post', + data: data + }); +} + +// 修改委外工单 +export function updateOutsourceWorkOrder(data) { + return request({ + url: '/device/outsourceWorkOrder', + method: 'put', + data: data + }); +} + +// 删除委外工单 +export function delOutsourceWorkOrder(workId) { + return request({ + url: '/device/outsourceWorkOrder/' + workId, + method: 'delete' + }); +} diff --git a/src/views/device/faultReport/index.vue b/src/views/device/faultReport/index.vue index 5d9b6bb..f515bd4 100644 --- a/src/views/device/faultReport/index.vue +++ b/src/views/device/faultReport/index.vue @@ -194,7 +194,7 @@ {{ parseTime(scope.row.orderTime) }} - + - - + + - - + + + + + + + - + @@ -533,6 +538,7 @@ - + @@ -587,14 +597,27 @@ + placeholder="请选择报修人" + style="width: 200px" + > + + + + @@ -632,10 +655,13 @@ import { getEquipmentList, checkFaultReport, } from "@/api/device/faultReport"; -import ItemSelect from "./single.vue"; +import ItemSelect from "./selectSingleEquipment.vue"; +import ItemSelectPerson from "./selectSinglePerson.vue"; +import { Message } from 'element-ui' + export default { name: "FaultReport", - components: { ItemSelect }, + components: { ItemSelect,ItemSelectPerson }, dicts: ["device_order_source"], data() { return { @@ -760,11 +786,19 @@ export default { this.form.workPlanTime = new Date(); log("时间时间", new Date()); }, - //新增 设备选择弹出框 + //设备选择 handleSelectEquipment() { this.$refs.itemSelect.showFlag = true; }, - //新增 设备选择弹出框 + //人员选择 + handleSelectPerson() { + this.$refs.itemSelectPerson.showFlag = true; + }, + //人员选择 + onItemSelectedPerson(obj) { + this.form.orderRepairman = obj; + }, + //设备选择 onItemSelectedEquipment(obj) { this.form.equipmentCode = obj; }, @@ -782,9 +816,10 @@ export default { this.open = false; this.reset(); }, - // 返回按钮 - cancel() { + // 审核返回按钮 + cancelCheckForm() { this.openCheck = false; + this.reset(); }, // 表单重置 reset() { @@ -851,9 +886,13 @@ export default { this.reset(); const orderId = row.orderId || this.ids; getFaultReport(orderId).then((response) => { - this.form = response.data; - this.openCheck = true; - this.title = "审核故障报修"; + if(response.data.orderStatus == "审核通过" || response.data.orderStatus == "驳回"){ + Message.warning("该报修记录已审核,请勿重复审核!"); + }else{ + this.form = response.data; + this.openCheck = true; + this.title = "审核故障报修"; + } }); }, /** 提交按钮 */ diff --git a/src/views/device/faultReport/single.vue b/src/views/device/faultReport/selectSingleEquipment.vue similarity index 74% rename from src/views/device/faultReport/single.vue rename to src/views/device/faultReport/selectSingleEquipment.vue index 534d12f..c8ca697 100644 --- a/src/views/device/faultReport/single.vue +++ b/src/views/device/faultReport/selectSingleEquipment.vue @@ -137,25 +137,24 @@ export default { }, methods: { - // 表单重置 - reset() { - this.form = { - itemId: null, - itemCode: this.processId, - itemType: null, - }; - this.resetForm("form"); - }, + // 表单重置 + reset() { + this.form = { + itemId: null, + itemCode: this.processId, + itemType: null, + }; + this.resetForm("form"); + }, handleEquipmentSelectionChange (val) { - this.itemList = val + this.itemList = val }, - // 生成表头序号 - indexMethod(index){ - return index+1 ; - }, - // + // 生成表头序号 + indexMethod(index){ + return index+1 ; + }, /** 查询设备编码列表*/ getList() { @@ -192,11 +191,11 @@ export default { this.handleQuery(); }, - /** 搜索按钮操作 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); - }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, /** 重置按钮操作 */ resetQuery() { @@ -205,19 +204,6 @@ export default { this.handleQuery(); }, - // handleCurrent(row){ - // if(row){ - // this.selectedRows = row; - // } - // }, - - // handleRowDbClick(row){ - // if(row){ - // this.selectedRows = row; - // this.$emit('onSelected',this.selectedRows); - // this.showFlag = false; - // } - // }, // 多选框选中数据 handleEquipmentSelectionChange(selection) { @@ -227,53 +213,34 @@ export default { console.log("多选框",this.ids); }, - // 单选选中数据 - // handleRowChange(row) { - // debugger; - // if(row){ - // this.selectedRows = row; - // } - // }, - - //确定选中 - // confirmSelect(){ - // if(this.selectedItemId ==null || this.selectedItemId==0){ - // this.$notify({ - // title:'提示', - // type:'warning', - // message: '请至少选择一条数据!' - // }); - // return; - // } - // this.$emit('onSelected',this.selectedRows); - // this.showFlag = false; - // } - // submitEquipmentForm() { const data = this.ids; - console.log("数据",data); - const equipmentCode = data.toString(); - console.log("拆分数据",equipmentCode); - console.log("原来的数据",this.queryParams.itemCodeGet); - if(this.queryParams.itemCodeGet == ""){ - this.queryParams.itemCodeGet = equipmentCode; + if(data.length >1){ + Message.warning("只能选择一个报修机器,请勿选择多个!"); }else{ - this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ equipmentCode; + const equipmentCode = data.toString(); + if(this.queryParams.itemCodeGet == ""){ + this.queryParams.itemCodeGet = equipmentCode; + }else{ + this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ equipmentCode; + } + this.selectedRows = this.queryParams.itemCodeGet; + this.$emit('onSelected', this.selectedRows); + this.queryParams.equipmentTypeCode = null; + this.getList(); + console.log('111111',this.queryParams.equipmentTypeCode); + this.showFlag = false; + this.queryParams.itemCodeGet = ""; } - this.selectedRows = this.queryParams.itemCodeGet; - this.$emit('onSelected', this.selectedRows); - this.queryParams.equipmentTypeCode = null; - this.getList(); - console.log('111111',this.queryParams.equipmentTypeCode); - this.showFlag = false; - this.queryParams.itemCodeGet = ""; - }, + }, + cancelEquipmentForm(){ this.queryParams.equipmentTypeCode = null; - this.getList(); - console.log('111111',this.queryParams.equipmentTypeCode); - this.showFlag = false; + this.getList(); + console.log('111111',this.queryParams.equipmentTypeCode); + this.showFlag = false; } + } }; diff --git a/src/views/device/faultReport/selectSinglePerson.vue b/src/views/device/faultReport/selectSinglePerson.vue new file mode 100644 index 0000000..68cf559 --- /dev/null +++ b/src/views/device/faultReport/selectSinglePerson.vue @@ -0,0 +1,183 @@ + + + diff --git a/src/views/device/outsourceWorkOrder/index.vue b/src/views/device/outsourceWorkOrder/index.vue new file mode 100644 index 0000000..ecd9392 --- /dev/null +++ b/src/views/device/outsourceWorkOrder/index.vue @@ -0,0 +1,349 @@ + + +