From d2e867966539004b6b5a73ae3566a659ac6f8b6d Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 30 十月 2025 11:55:34 +0800
Subject: [PATCH] 检验任务数据分类查询问题修复
---
src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue | 36 ++++++++++++++++++++++--------------
1 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue
index b5c9e52..9a8bf6b 100644
--- a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue
@@ -25,8 +25,8 @@
<p><span class="required-span">* </span>鐩戠潱鍛橈細</p>
</td>
<td colspan="2">
- <el-select v-if="currentStep === 0" @change="usePersonName" v-model="form.supervisorId" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
- <el-option v-for="item in recordUserList" :key="item.userId" :label="item.userName" :value="item.userId"></el-option>
+ <el-select v-if="currentStep === 0" @change="usePersonName" v-model="form.supervisor" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+ <el-option v-for="item in recordUserList" :key="item.userName" :label="item.userName" :value="item.userName"></el-option>
</el-select>
<span v-else class="td-info"> {{ form.supervisor }}</span>
</td>
@@ -235,7 +235,10 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="closeRecordsDia">鍙� 娑�</el-button>
- <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+ <el-button v-if="currentStep === 0 && userId == supervisedUserId" :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>
@@ -248,6 +251,7 @@
getSuperviseDetailRecord
} from "@/api/cnas/process/ensureResults/qualitySupervise";
import {selectUserCondition} from "@/api/business/inspectionTask";
+import {mapGetters} from "vuex";
export default {
name: 'recordsDialog',
@@ -285,12 +289,18 @@
editLoad: false,
personList: [],
recordUserList: [],
+ supervisedUserId: '',
+ ratifyUserId: '',
};
+ },
+ computed: {
+ ...mapGetters(["userId"]),
},
// 鏂规硶闆嗗悎
methods: {
openDia(row) {
this.formDia = true
+ this.supervisedUserId = row.supervisedUserId
this.searchInfo(row)
this.getAuthorizedPerson()
},
@@ -304,11 +314,11 @@
searchInfo (row) {
getSuperviseDetailRecord({superviseDetailsId: row.superviseDetailsId}).then(res => {
// 鏈塻uperviseDetailsRecordId璇存槑鎻愪氦杩囪褰�
- if (res.data.superviseDetailsRecordId) {
+ 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) {
+ } else if (res.data.isFinish == 1) {
this.currentStep = 2
}
} else {
@@ -316,13 +326,14 @@
}
this.form = res.data
this.form.superviseDetailsId = row.superviseDetailsId
+ this.ratifyUserId = res.data.ratifyUserId
this.getRecordUser()
}).catch(err => {
console.log('err---', err);
})
},
// 鎻愪氦娴佺▼
- handleEdit () {
+ handleEdit (isFinish) {
if (!this.form.testMember || !this.form.supervisor || !this.form.testItem || !this.form.sampleNumber
|| !this.form.testDate) {
this.$message.warning('璇峰~鍐欏畬鏁�')
@@ -331,15 +342,11 @@
if (this.currentStep === 0) {
this.addInfo()
} else {
- this.editInfo()
+ this.editInfo(isFinish)
}
},
// 鎻愪氦璁板綍
addInfo () {
- if (!this.form.ratifyUserId) {
- this.$message.warning('璇烽�夋嫨涓嬩竴姝ユ壒鍑嗕汉')
- return
- }
this.editLoad = true
addSuperviseDetailRecord(this.form).then(res => {
this.editLoad = false
@@ -351,7 +358,7 @@
})
},
// 鎻愪氦鎵瑰噯
- editInfo () {
+ editInfo (isFinish) {
if (!this.form.ratifyOpinion) {
this.$message.warning('璇峰~鍐欏鎵规剰瑙�')
return
@@ -361,6 +368,7 @@
return
}
this.editLoad = true
+ this.form.isFinish = isFinish
addSuperviseRecordOpinion(this.form).then(res => {
this.editLoad = false
this.$message.success('鎿嶄綔鎴愬姛')
@@ -376,7 +384,7 @@
this.$emit('closeRecordsDia')
},
getAuthorizedPerson() {
- selectUserCondition({ type: 1 }).then((res) => {
+ selectUserCondition({ type: 2 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
--
Gitblit v1.9.3