From 5cbba170e270e6f1c99a91e27dbb7951a27d596a Mon Sep 17 00:00:00 2001 From: “linengliang” <vanSuperEnergy@163.com> Date: 星期五, 24 十一月 2023 16:41:32 +0800 Subject: [PATCH] 故障报修验收 --- src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue | 282 ++++++++++++++++++++++++++++++++------------------------ 1 files changed, 161 insertions(+), 121 deletions(-) diff --git a/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue b/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue index e63f4fb..19dafbd 100644 --- a/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue +++ b/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue @@ -17,18 +17,28 @@ @click="handleSW" :disabled=SWbuttonDistable type="primary" + v-has="'dailyInspectionOrder:SW'" >寮�宸�</a-button> <a-button :style="{marginRight: '8px'}" @click="handleReport" :disabled="buttonDistable" type="primary" + v-has="'dailyInspectionOrder:report'" >鎶ュ伐</a-button> + <a-button + :style="{marginRight: '8px'}" + @click="handleNormalReport" + :disabled="buttonDistable" + type="primary" + v-has="'dailyInspectionOrder:normalReport'" + >缁撴灉姝e父骞舵姤宸�</a-button> <a-button :style="{marginRight: '8px'}" @click="handleReset" :disabled="revocationDistable" type="primary" + v-has="'dailyInspectionOrder:reset'" >鎾ら攢</a-button> </a-row> </div> @@ -38,7 +48,7 @@ <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" - label="璁惧缂栫爜" + label="缁熶竴缂栫爜" class="hightColor" > <span @@ -126,8 +136,8 @@ :pagination="ipagination" :loading="loading" @change="handleTableChange" - :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" > + <!-- :scroll="{ x: 'calc(1000px + 50%)', y: 900 }" --> <template v-for="col in columns" :slot="col.dataIndex" @@ -147,22 +157,27 @@ style="max-width:80px;font-size: 12px;font-style: italic;" /> <a-select - v-if="col.dataIndex == 'inspectionProjectResult' && record.analysisMethod == '2'" + v-if="col.dataIndex == 'inspectionProjectResult' " :value="text" - :options="record.inspectionCycles" @change="(e) => handleChange(e, record.key, col, index)" style="width: 100%" :disabled="record.disabled" - /> - <a-input-number + > + <!-- :options="record.inspectionCycles" --> + <a-select-option value="1">姝e父</a-select-option> + <a-select-option value="2">寮傚父</a-select-option> + <a-select-option value="3">鏁呴殰鍋滄満</a-select-option> + <a-select-option value="4">娌″紑鏈�</a-select-option> + </a-select> + <!-- <a-input-number :value="text" - v-if="col.dataIndex == 'inspectionProjectResult' && record.analysisMethod == '1'" + v-if="col.dataIndex == 'inspectionProjectResult' && record.testValueType == '1'" :min="0" :max="20000" @change="(e)=>handleChange(e, record.key, col, index,record)" style="width: 100%" :disabled="record.disabled" - /> + /> --> <a-textarea :value="text" v-if="col.dataIndex == 'abnormalDesc'" @@ -262,11 +277,13 @@ @click="handleTS" :disabled="buttonDistable" type="primary" + v-has="'dailyInspectionOrder:TS'" >鏆傚瓨</a-button> <a-button @click="handleOk" :disabled="buttonDistable" type="primary" + v-has="'dailyInspectionOrder:save'" >淇濆瓨</a-button> </a-row> </div> @@ -301,7 +318,7 @@ }, data() { return { - title: "鏃ュ父鐐规宸ュ崟鎵ц", + title: "鑷富缁存姢鐐规鎵ц", visible: false, maskClosable: true, confirmLoading: false, @@ -330,18 +347,18 @@ }, width: 50, }, - { - title: '閮ㄤ綅', - align: 'center', - dataIndex: 'location', - }, - // class: "notshow" - { - title: '绀烘剰鍥�', - align: 'center', - dataIndex: 'photo', - scopedSlots: { customRender: 'photo' }, - }, + // { + // title: '閮ㄤ綅', + // align: 'center', + // dataIndex: 'location', + // }, + // // class: "notshow" + // { + // title: '绀烘剰鍥�', + // align: 'center', + // dataIndex: 'photo', + // scopedSlots: { customRender: 'photo' }, + // }, // class: "notshow" { title: '鐐规椤圭洰', @@ -353,61 +370,60 @@ align: 'center', dataIndex: 'detectionStandard', }, - { - title: '鍚堟牸鑼冨洿', - align: 'center', - dataIndex: 'acceptabilityLimit', - }, - { - title: '鏂规硶', - align: 'center', - dataIndex: 'inspectionMethod_dictText', - }, - { - title: '宸ュ叿', - align: 'center', - dataIndex: 'inspectionTool', - }, + // { + // title: '鍚堟牸鑼冨洿', + // align: 'center', + // dataIndex: 'acceptabilityLimit', + // }, + // { + // title: '鏂规硶', + // align: 'center', + // dataIndex: 'inspectionMethod_dictText', + // }, + // { + // title: '宸ュ叿', + // align: 'center', + // dataIndex: 'inspectionTool', + // }, { title: '*鐐规缁撴灉', align: 'center', dataIndex: 'inspectionProjectResult', scopedSlots: { customRender: 'inspectionProjectResult' }, - className: 'red', }, + // className: 'red', + // { + // title: '鍒ゅ畾', + // align: 'center', + // dataIndex: 'judgmentResult', + // customRender: (text) => { + // if (text == 'pass') { + // return "姝e父"; + // } else if (text == 'fail') { + // return "寮傚父"; + // } + // }, + // }, { - title: '鍒ゅ畾', - align: 'center', - dataIndex: 'judgmentResult', - customRender: (text) => { - if (text == 'pass') { - return "姝e父"; - } else if (text == 'fail') { - return "寮傚父"; - } - }, - }, - { - title: '寮傚父鎻忚堪', + title: '*寮傚父鎻忚堪', align: 'center', dataIndex: 'abnormalDesc', scopedSlots: { customRender: 'abnormalDesc' }, }, - { - title: '寮傚父鎷嶇収', - align: 'center', - dataIndex: 'abnormalPhoto', - scopedSlots: { customRender: 'abnormalPhoto' }, - // dataIndex: 'action', - // scopedSlots: { customRender: 'action' }, - }, + // className: 'red', + // { + // title: '寮傚父鎷嶇収', + // align: 'center', + // dataIndex: 'abnormalPhoto', + // scopedSlots: { customRender: 'abnormalPhoto' }, + // }, { title: '*寮傚父澶勭疆', align: 'center', dataIndex: 'treatmentMeasure', - className: 'red', scopedSlots: { customRender: 'treatmentMeasure' }, }, + // className: 'red', ], url: { list: "/eam/inspectionOrderDetail/list", @@ -418,6 +434,7 @@ editStatus: "/eam/inspectionOrder/editStatus", revocation: "/eam/inspectionOrder/revocation", report: "/eam/inspectionOrder/report", + normalReport: "/eam/inspectionOrder/normalReport", }, } }, @@ -553,14 +570,21 @@ for (let i = 0; i < that.dataSource.length; i++) { let o = this.dataSource[i] if (o.inspectionProjectResult == null || o.inspectionProjectResult == '') { - that.$message.warning('璇疯緭鍏ョ偣妫�缁撴灉锛�') + that.$message.warning("璇峰~鍐欑" + (i + 1) + "鐐规缁撴灉锛�"); that.confirmLoading = false; return } - if (o.treatmentMeasure == null || o.treatmentMeasure == '') { - that.$message.warning('璇烽�夋嫨寮傚父澶勭疆锛�') - that.confirmLoading = false; - return + if (o.inspectionProjectResult == '2' || o.inspectionProjectResult == '3') { + if (o.abnormalDesc == null || o.abnormalDesc == '') { + that.$message.warning("璇峰~鍐欑" + (i + 1) + "寮傚父鎻忚堪锛�"); + that.confirmLoading = false; + return + } + if (o.treatmentMeasure == null || o.treatmentMeasure == '') { + that.$message.warning("璇峰~鍐欑" + (i + 1) + "寮傚父澶勭疆锛�"); + that.confirmLoading = false; + return + } } } formData.inspectionOrderDetailList = that.dataSource; @@ -594,6 +618,43 @@ }) }, + //鎶ュ伐 + handleNormalReport() { + const that = this; + that.confirmLoading = true; + let formData = Object.assign(this.model); + formData.inspectionOrderDetailList = that.dataSource; + formData.id = that.model.id; + formData.status = "5"; + formData.equipmentId = that.model.equipmentId; + this.$confirm({ + title: '鐐规宸ュ崟鎶ュ伐', + content: '鎻愮ず锛氱偣妫�缁撴灉鍏ㄩ儴姝e父锛屾姤宸ュ悗鐐规宸ュ崟瀹屽伐锛岃璋ㄦ厧鎿嶄綔锛�', + okText: '纭', + cancelText: '鍙栨秷', + onOk() { + requestPut(that.url.normalReport, formData).then((res) => { + if (res.success) { + that.model.status = '5' + that.$message.success(res.message) + that.buttonDistable = false + that.revocationDistable = true + that.SWbuttonDistable = true + that.$emit('ok'); + that.alterFlag = new Date(); + that.close(); + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false; + // + }) + }, + }) + }, + + //淇濆瓨 handleOk() { const that = this; @@ -602,14 +663,21 @@ for (let i = 0; i < that.dataSource.length; i++) { let o = this.dataSource[i] if (o.inspectionProjectResult == null || o.inspectionProjectResult == '') { - that.$message.warning('璇疯緭鍏ョ偣妫�缁撴灉锛�') + that.$message.warning("璇峰~鍐欑" + (i + 1) + "鐐规缁撴灉锛�"); that.confirmLoading = false; return } - if (o.treatmentMeasure == null || o.treatmentMeasure == '') { - that.$message.warning('璇烽�夋嫨寮傚父澶勭疆锛�') - that.confirmLoading = false; - return + if (o.inspectionProjectResult == '2' || o.inspectionProjectResult == '3') { + if (o.abnormalDesc == null || o.abnormalDesc == '') { + that.$message.warning("璇峰~鍐欑" + (i + 1) + "寮傚父鎻忚堪锛�"); + that.confirmLoading = false; + return + } + if (o.treatmentMeasure == null || o.treatmentMeasure == '') { + that.$message.warning("璇峰~鍐欑" + (i + 1) + "寮傚父澶勭疆锛�"); + that.confirmLoading = false; + return + } } } formData.inspectionOrderDetails = that.dataSource @@ -663,21 +731,29 @@ if (target) { if (column.dataIndex == 'inspectionProjectResult') { - if (target.analysisMethod === "1") { - target[column.dataIndex] = value; - let maxValue = target.maxValue - let minValue = target.minValue - if (value > minValue && value < maxValue) { - target['judgmentResult'] = "pass"; - } else { - target['judgmentResult'] = "fail"; - } - if (value == null || value == "") { - target['judgmentResult'] = ""; - } - } else { - - } + // if (target.testValueType === "1") { + // target[column.dataIndex] = value; + // let maxValue = target.maxValue + // let minValue = target.minValue + // if (value > minValue && value < maxValue) { + // target['judgmentResult'] = "pass"; + // } else { + // target['judgmentResult'] = "fail"; + // } + // if (value == null || value == "") { + // target['judgmentResult'] = ""; + // } + // } else { + target[column.dataIndex] = value; + // if (value == "1") { + // target['judgmentResult'] = "pass"; + // } else { + // target['judgmentResult'] = "fail"; + // } + // if (value == null || value == "") { + // target['judgmentResult'] = ""; + // } + // } } if (column.dataIndex == 'abnormalDesc') { target[column.dataIndex] = value.target.value; @@ -721,43 +797,7 @@ }) }, - getSrc(record) { - if (!record.path) { - return ''; - } - //鏈湴锛歭ocal\Minio锛歮inio\闃块噷浜戯細alioss - if (record.uploadType == 'local') { - let ssoLoginFlag = Vue.ls.get("ssoLoginFlag"); - let deployMode = Vue.ls.get("deployMode"); - - if (ssoLoginFlag && deployMode == "container") { - var baseProject = Vue.ls.get("baseProject"); - console.log("baseProject==>" + baseProject) - - var hostname = window.location.protocol + "//" + window.location.host; - var url = hostname + '/' + baseProject + '/sys/common/static'; - return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer']) - } else { - //鏍规嵁鍙戝竷鐘舵�佷慨鏀筯ttps 鎴� http - return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer']) - } - - } else if (record.uploadType == 'alioss') { - - const OSS = require('ali-oss') - const client = new OSS({ - // region浠ユ澀宸炰负渚嬶紙oss-cn-hangzhou锛夛紝鍏朵粬region鎸夊疄闄呮儏鍐靛~鍐欍�� - region: window._CONFIG['region'], - // 闃块噷浜戜富璐﹀彿AccessKey鎷ユ湁鎵�鏈堿PI鐨勮闂潈闄愶紝椋庨櫓寰堥珮銆傚己鐑堝缓璁偍鍒涘缓骞朵娇鐢≧AM璐﹀彿杩涜API璁块棶鎴栨棩甯歌繍缁达紝璇风櫥褰昍AM鎺у埗鍙板垱寤篟AM璐﹀彿銆� - accessKeyId: window._CONFIG['accessKeyId'], - accessKeySecret: window._CONFIG['accessKeySecret'], - bucket: window._CONFIG['bucket'], - }) - // object-key琛ㄧず浠嶰SS涓嬭浇鏂囦欢鏃堕渶瑕佹寚瀹氬寘鍚枃浠跺悗缂�鍦ㄥ唴鐨勫畬鏁磋矾寰勶紝渚嬪abc/efg/123.jpg銆� - return client.signatureUrl(record.path) - } - }, }, } @@ -780,7 +820,7 @@ .hight { color: #f5222d; } -/deep/ .red { +.red { color: red; } </style> \ No newline at end of file -- Gitblit v1.9.3