From cb2a01ee7dea28a2661720060b03c41dc372acb5 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期五, 01 八月 2025 11:53:16 +0800
Subject: [PATCH] 完善串口处理数据,数据选择
---
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue | 117 ++++++++++++++++++++++++----------------------------------
1 files changed, 49 insertions(+), 68 deletions(-)
diff --git a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
index e7379c8..70a291d 100644
--- a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
+++ b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
@@ -1,9 +1,8 @@
<template>
+<!--璐ㄩ噺鐩戞帶-瀹炴柦娴佺▼椤甸潰-->
<div>
- <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
- :visible.sync="formDia"
- title="瀹炴柦"
- width="60%" @close="closeCarryOutDia">
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="formDia" title="瀹炴柦"
+ width="60%" @close="closeCarryOutDia">
<el-steps :active="currentStep" align-center finish-status="success">
<el-step title="瀹炴柦"></el-step>
<el-step title="鎵瑰噯"></el-step>
@@ -15,9 +14,7 @@
<p>鐩戞帶椤圭洰锛�</p>
</td>
<td colspan="3">
- <el-input v-if="currentStep === 0" v-model="form.monitorProject"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small">
+ <el-input v-if="currentStep === 0" v-model="form.monitorProject" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
</el-input>
<span v-else class="td-info"> {{ form.monitorProject }}</span>
</td>
@@ -25,9 +22,7 @@
<p>鐩戞帶鏃堕棿锛�</p>
</td>
<td colspan="3">
- <el-input v-if="currentStep === 0" v-model="form.monitorData"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small">
+ <el-input v-if="currentStep === 0" v-model="form.monitorData" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
</el-input>
<span v-else class="td-info"> {{ form.monitorData }}</span>
</td>
@@ -38,11 +33,8 @@
<p>鐩戞帶鐩殑锛�</p>
</div>
<div>
- <el-input v-if="currentStep === 0" v-model="form.monitorPurpose"
- :rows="3"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small"
- type="textarea">
+ <el-input v-if="currentStep === 0" v-model="form.monitorPurpose" :rows="3" placeholder="璇疯緭鍏ュ唴瀹�"
+ size="small" type="textarea">
</el-input>
<span v-else class="td-info2"> {{ form.monitorPurpose }}</span>
</div>
@@ -54,11 +46,8 @@
<p>鐩戞帶鏂规硶锛�</p>
</div>
<div>
- <el-input v-if="currentStep === 0" v-model="form.monitorMethod"
- :rows="4"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small"
- type="textarea">
+ <el-input v-if="currentStep === 0" v-model="form.monitorMethod" :rows="4" placeholder="璇疯緭鍏ュ唴瀹�"
+ size="small" type="textarea">
</el-input>
<span v-else class="td-info2"> {{ form.monitorMethod }}</span>
</div>
@@ -70,11 +59,8 @@
<p>鍙傚姞浜哄憳锛�</p>
</div>
<div>
- <el-input v-if="currentStep === 0" v-model="form.participant"
- :rows="3"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small"
- type="textarea">
+ <el-input v-if="currentStep === 0" v-model="form.participant" :rows="3" placeholder="璇疯緭鍏ュ唴瀹�" size="small"
+ type="textarea">
</el-input>
<span v-else class="td-info2"> {{ form.participant }}</span>
</div>
@@ -86,11 +72,8 @@
<p>杩囩▼鎺у埗锛�</p>
</div>
<div>
- <el-input v-if="currentStep === 0" v-model="form.processControl"
- :rows="3"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small"
- type="textarea">
+ <el-input v-if="currentStep === 0" v-model="form.processControl" :rows="3" placeholder="璇疯緭鍏ュ唴瀹�"
+ size="small" type="textarea">
</el-input>
<span v-else class="td-info2"> {{ form.processControl }}</span>
</div>
@@ -102,11 +85,8 @@
<p>缁撴灉璇勪环鏍囧噯锛堝浣曡瘎浠凤級锛�</p>
</div>
<div>
- <el-input v-if="currentStep === 0" v-model="form.howEvaluate"
- :rows="3"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small"
- type="textarea">
+ <el-input v-if="currentStep === 0" v-model="form.howEvaluate" :rows="3" placeholder="璇疯緭鍏ュ唴瀹�" size="small"
+ type="textarea">
</el-input>
<span v-else class="td-info2"> {{ form.howEvaluate }}</span>
</div>
@@ -118,9 +98,7 @@
<p>缁忚垂棰勭畻锛�</p>
</div>
<div>
- <el-input v-if="currentStep === 0" v-model="form.budget"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small">
+ <el-input v-if="currentStep === 0" v-model="form.budget" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
</el-input>
<span v-else class="td-info2"> {{ form.budget }}</span>
</div>
@@ -132,9 +110,7 @@
<p>妫�娴嬮儴闂細</p>
</div>
<div>
- <el-input v-if="currentStep === 0" v-model="form.inspectionDepartment"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small">
+ <el-input v-if="currentStep === 0" v-model="form.inspectionDepartment" placeholder="璇疯緭鍏ュ唴瀹�" size="small">
</el-input>
<span v-else class="td-info2"> {{ form.inspectionDepartment }}</span>
</div>
@@ -143,10 +119,9 @@
<div v-if="currentStep === 0">
<div>鎵瑰噯浜猴細</div>
<div>
- <el-select v-if="currentStep === 0" v-model="form.ratifyUserId" clearable
- filterable
- placeholder="璇烽�夋嫨" size="small">
- <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
+ <el-select v-if="currentStep === 0" v-model="form.ratifyUserId" clearable filterable placeholder="璇烽�夋嫨"
+ size="small">
+ <el-option v-for="(item, i) in personList" :key="i" :label="item.label" :value="item.value">
</el-option>
</el-select>
<span v-else class="td-info2"> {{ form.ratifyName }}</span>
@@ -157,11 +132,8 @@
<p>鎵瑰噯鎰忚锛�</p>
</div>
<div>
- <el-input v-if="currentStep === 1" v-model="form.ratifyOpinion"
- :rows="3"
- placeholder="璇疯緭鍏ュ唴瀹�"
- size="small"
- type="textarea">
+ <el-input v-if="currentStep === 1" v-model="form.ratifyOpinion" :rows="3" placeholder="璇疯緭鍏ュ唴瀹�"
+ size="small" type="textarea">
</el-input>
<span v-if="currentStep === 2" class="td-info2"> {{ form.ratifyOpinion }}</span>
<span v-if="currentStep !== 0" class="td-info3"> {{ '鎵瑰噯浜猴細' + form.ratifyName }}</span>
@@ -173,7 +145,10 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="closeCarryOutDia">鍙� 娑�</el-button>
- <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+ <el-button v-if="currentStep === 0" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+ <el-button v-if="currentStep === 1 && userId == ratifyUserId" :loading="editLoad" @click="handleEdit(0)">涓嶉�氳繃</el-button>
+ <el-button v-if="currentStep === 1 && userId == ratifyUserId" :loading="editLoad" type="primary" @click="handleEdit(1)">閫�
+ 杩�</el-button>
</span>
</el-dialog>
</div>
@@ -185,7 +160,8 @@
addQualityMonitorRatify, addQualityMonitorRatifyOpinion,
getQualityMonitorRatify
} from "@/api/cnas/process/ensureResults/qualityMonitor";
-import {selectUserCondition} from "@/api/business/inspectionTask";
+import { selectUserCondition } from "@/api/business/inspectionTask";
+import {mapGetters} from "vuex";
export default {
name: 'carryOutDialog',
@@ -214,7 +190,11 @@
personList: [],
editLoad: false,
isCarryOut: false, // 鏄惁涓哄疄鏂�
+ ratifyUserId: ''
};
+ },
+ computed: {
+ ...mapGetters(["userId"]),
},
// 鏂规硶闆嗗悎
methods: {
@@ -224,12 +204,12 @@
this.getAuthorizedPerson()
},
// 鏌ヨ鐩戞帶璁″垝璇︽儏瀹炴柦淇℃伅
- searchInfo (row) {
- getQualityMonitorRatify({qualityMonitorDetailsId: row.qualityMonitorDetailsId}).then(res => {
+ searchInfo(row) {
+ getQualityMonitorRatify({ qualityMonitorDetailsId: row.qualityMonitorDetailsId }).then(res => {
// 鏈塪etailsRatifyId鍒欒鏄庢彁浜よ繃瀹炴柦淇℃伅
- if (res.data.detailsRatifyId) {
+ if (res.data.ratifyUserId) {
// 鏄惁缁撴潫0:鏈粨鏉�, 1:宸茬粨鏉�
- if (res.data.isFinish == 0) {
+ if (res.data.isFinish != 1) {
this.currentStep = 1
} else if (res.data.isFinish == 1) {
this.currentStep = 2
@@ -238,28 +218,24 @@
this.currentStep = 0
}
this.form = res.data
+ this.ratifyUserId = res.data.ratifyUserId
}).catch(err => {
console.log('err---', err);
})
},
// 鎻愪氦
- handleEdit() {
- if (!this.form.ratifyUserId) {
- this.$message.warning('璇烽�夋嫨鎵瑰噯浜�')
- return
- }
+ handleEdit(isFinish) {
this.editLoad = true
if (this.currentStep == 0) {
this.addInfo()
} else {
- this.editInfo()
+ this.editInfo(isFinish)
}
},
// 鎻愪氦瀹炴柦
- addInfo () {
+ addInfo() {
addQualityMonitorRatify(this.form).then(res => {
this.editLoad = false
- if (res.code === 201) return
this.$message.success('鎿嶄綔鎴愬姛')
this.closeCarryOutDia()
}).catch(err => {
@@ -268,10 +244,10 @@
})
},
// 鎻愪氦鎵瑰噯
- editInfo () {
+ editInfo(isFinish) {
+ this.form.isFinish = isFinish
addQualityMonitorRatifyOpinion(this.form).then(res => {
this.editLoad = false
- if (res.code === 201) return
this.$message.success('鎿嶄綔鎴愬姛')
this.closeCarryOutDia()
}).catch(err => {
@@ -280,12 +256,12 @@
})
},
// 鍏抽棴寮规
- closeCarryOutDia () {
+ closeCarryOutDia() {
this.formDia = false
this.$emit('closeCarryOutDia')
},
getAuthorizedPerson() {
- selectUserCondition({ type: 1 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
@@ -306,6 +282,7 @@
width: 100%;
margin-top: 10px;
}
+
.td-title {
height: 40px;
width: 100px;
@@ -315,6 +292,7 @@
white-space: normal;
padding: 6px;
}
+
.td-info {
display: inline-block;
width: 100%;
@@ -323,6 +301,7 @@
word-wrap: break-word;
white-space: normal;
}
+
.td-info2 {
display: inline-block;
width: 90%;
@@ -332,6 +311,7 @@
white-space: normal;
margin-left: 20px;
}
+
.tables td {
height: 40px;
width: 100px;
@@ -340,6 +320,7 @@
white-space: normal;
padding: 6px;
}
+
.td-info3 {
width: 90%;
display: inline-block;
--
Gitblit v1.9.3