From 697082adae9e0225bf5ab20b33353970dd8b3f3a Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期一, 04 三月 2024 16:59:31 +0800
Subject: [PATCH] 1、用户管理页面表单填写界面新增选择设备功能 2、避免命名冲突,更改原选择设备组件名称为selectDeviceDrawer,用户管理页面选择设备组件名称为selectDeviceModal
---
src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue | 270 ++++++++++++++++++++++++++++++++---------------------
1 files changed, 164 insertions(+), 106 deletions(-)
diff --git a/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue b/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
index 9131ded..ede2781 100644
--- a/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
+++ b/src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
@@ -19,6 +19,14 @@
type="primary"
v-has="'dailyInspectionOrder:SW'"
>寮�宸�</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="handleReport"
@@ -129,8 +137,8 @@
:pagination="ipagination"
:loading="loading"
@change="handleTableChange"
- :scroll="{ x: 'calc(1000px + 50%)', y: 900 }"
>
+ <!-- :scroll="{ x: 'calc(1000px + 50%)', y: 900 }" -->
<template
v-for="col in columns"
:slot="col.dataIndex"
@@ -149,20 +157,29 @@
alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"
/>
+ <!-- <j-dict-select-tag
+ v-if="col.dataIndex == 'inspectionProjectResult' "
+ allow-clear
+ @input="handleChange()"
+ :disabled="record.disabled"
+ :placeholder="'璇烽�夋嫨鐐规缁撴灉'"
+ :triggerChange="true"
+ style="width: 100%"
+ dictCode="inspection_project_result"
+ /> -->
<a-select
- v-if="col.dataIndex == 'inspectionProjectResult' && record.testValueType == '2'"
+ v-if="col.dataIndex == 'inspectionProjectResult' "
:value="text"
@change="(e) => handleChange(e, record.key, col, index)"
style="width: 100%"
:disabled="record.disabled"
>
- <!-- :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
+ <!-- <a-input-number
:value="text"
v-if="col.dataIndex == 'inspectionProjectResult' && record.testValueType == '1'"
:min="0"
@@ -170,7 +187,7 @@
@change="(e)=>handleChange(e, record.key, col, index,record)"
style="width: 100%"
:disabled="record.disabled"
- />
+ /> -->
<a-textarea
:value="text"
v-if="col.dataIndex == 'abnormalDesc'"
@@ -311,7 +328,7 @@
},
data() {
return {
- title: "鏃ュ父鐐规宸ュ崟鎵ц",
+ title: "鑷富缁存姢鐐规鎵ц",
visible: false,
maskClosable: true,
confirmLoading: false,
@@ -329,6 +346,18 @@
xs: { span: 24 },
sm: { span: 18 },
},
+ /* 鍒嗛〉鍙傛暟 */
+ ipagination: {
+ current: 1,
+ pageSize: 99,
+ pageSizeOptions: ['99'],
+ showTotal: (total, range) => {
+ return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+ },
+ showQuickJumper: true,
+ showSizeChanger: true,
+ total: 0
+ },
columns: [
{
title: '#',
@@ -340,18 +369,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: '鐐规椤圭洰',
@@ -385,24 +414,25 @@
scopedSlots: { customRender: 'inspectionProjectResult' },
},
// 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' },
},
+ // className: 'red',
// {
// title: '寮傚父鎷嶇収',
// align: 'center',
@@ -426,6 +456,7 @@
editStatus: "/eam/inspectionOrder/editStatus",
revocation: "/eam/inspectionOrder/revocation",
report: "/eam/inspectionOrder/report",
+ normalReport: "/eam/inspectionOrder/normalReport",
},
}
},
@@ -466,11 +497,11 @@
// }
//update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
this.dataSource = res.result.records || res.result;
- if (res.result.total) {
- this.ipagination.total = res.result.total;
- } else {
- this.ipagination.total = 0;
- }
+ // if (res.result.total) {
+ // this.ipagination.total = res.result.total;
+ // } else {
+ // this.ipagination.total = 0;
+ // }
//update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
} else {
this.$message.warning(res.message)
@@ -486,7 +517,7 @@
this.loadData1(1)
},
loadData() {
- this.loadData1(1)
+ // this.loadData1(1)
},
getBackground() {
return "background-color:rgba(127, 127, 127,0.08)";
@@ -561,14 +592,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;
@@ -602,6 +640,55 @@
})
},
+ //鎵�鏈夌粨鏋滄甯�
+ handleNormalReport() {
+ const that = this;
+ for (let i = 0; i < that.dataSource.length; i++) {
+ let o = this.dataSource[i]
+ o.inspectionProjectResult = "1"
+ o.abnormalDesc = ""
+ o.treatmentMeasure = null
+ }
+ },
+
+
+ //鎶ュ伐
+ handleNormalReport1() {
+ 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;
@@ -610,14 +697,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
@@ -671,29 +765,29 @@
if (target) {
if (column.dataIndex == 'inspectionProjectResult') {
- 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 (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['abnormalDesc'] = null;
}
+ target['treatmentMeasure'] = null;
+
+ // if (value == null || value == "") {
+ // target['judgmentResult'] = "";
+ // }
+ // }
}
if (column.dataIndex == 'abnormalDesc') {
target[column.dataIndex] = value.target.value;
@@ -737,43 +831,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)
- }
- },
},
}
@@ -796,7 +854,7 @@
.hight {
color: #f5222d;
}
-/deep/ .red {
+.red {
color: red;
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3