From 15d66d6d34ce779744bfe56a03e3bb15f33cd7b0 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 02 八月 2025 11:17:24 +0800
Subject: [PATCH] 1.不合格处理流程添加权限
---
src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/temperature-humidity-record.vue | 301 ++++++++++++++++++++++---------------------------
1 files changed, 134 insertions(+), 167 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/temperature-humidity-record.vue b/src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/temperature-humidity-record.vue
index f848a42..c43c3c2 100644
--- a/src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/temperature-humidity-record.vue
+++ b/src/views/CNAS/resourceDemand/facilitiesEnvironment/component/facilities-environmental-conditions/temperature-humidity-record.vue
@@ -4,60 +4,58 @@
<el-col :span="12">
<div class="header">
<div>璇曢獙鍖哄煙</div>
- <div>
- 鍚嶇О锛�
- <el-input v-model="search.testAreaName" clearable size="small" style="width: 120px"></el-input>
- <el-button size="small" type="primary" @click="initData">鏌ヨ</el-button>
- <el-button size="small" type="primary" @click="clickAdd">鏂� 澧�</el-button>
+ <div style="display: flex;">
+ <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
+ <span style="width: 48px;font-size: 14px;font-weight: 700;color: #606266;">鍚嶇О</span>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="search.testAreaName"
+ @keyup.enter.native="initData"></el-input>
+ </div>
+ <div style="line-height: 30px;">
+ <el-button size="mini" type="primary" @click="initData">鏌ヨ</el-button>
+ <el-button size="mini" type="primary" @click="clickAdd">鏂� 澧�</el-button>
+ </div>
</div>
</div>
- <el-table
- :data="tableData"
- height="calc(100vh - 18em)"
- highlight-current-row
- style="width: 100%"
- @row-click="clickRow">
+ <el-table :data="tableData" height="calc(100vh - 18em)" highlight-current-row style="width: 100%"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
+ @row-click="clickRow">
<el-table-column label="搴忓彿" type="index" width="60" align="center"></el-table-column>
- <el-table-column label="鏈堝害鏃堕棿" min-width="180" prop="monthDate"></el-table-column>
+ <el-table-column label="鏈堝害鏃堕棿" min-width="100" prop="monthDate"></el-table-column>
<el-table-column label="璇曢獙鍖哄煙鍚嶇О" min-width="180" prop="testAreaName"></el-table-column>
- <el-table-column label="纭鐘舵��" min-width="180" prop="isAffirm">
- <template slot-scope="scope">
- <el-tag type="danger" v-if="scope.row.isAffirm == 0">鏈‘璁�</el-tag>
- <el-tag type="success" v-if="scope.row.isAffirm == 1">宸茬‘璁�</el-tag>
- </template>
- </el-table-column>
- <el-table-column label="澧炶ˉ淇℃伅" min-width="180" prop="subjoin"></el-table-column>
+ <el-table-column label="璁板綍鍛�" min-width="120" prop="registrarUserName"></el-table-column>
+ <el-table-column label="娓╁害鍖洪棿" min-width="100" prop="temperatureSection"></el-table-column>
+ <el-table-column label="婀垮害鍖洪棿" min-width="100" prop="humiditySection"></el-table-column>
<el-table-column fixed="right" label="鎿嶄綔" min-width="180" align="center">
<template v-slot="scope">
<el-button size="small" type="text" @click="downLoadPost(scope.row)">瀵煎嚭</el-button>
- <el-button size="small" type="text" @click="edit(scope.row)">缂栬緫</el-button>
- <el-button :disabled="scope.row.isAffirm === '1'" size="small" type="text" @click="openApprovalDialog(scope.row)">纭</el-button>
- <el-button size="small" type="text" @click="deleteRowFun(scope.row)">鍒犻櫎</el-button>
+<!-- <el-button size="small" type="text" @click="edit(scope.row)">缂栬緫</el-button>-->
+ <el-button size="small" type="text"
+ @click="openApprovalDialog(scope.row)">璁板綍鍛樼粦瀹�</el-button>
+<!-- <el-button size="small" type="text" @click="deleteRowFun(scope.row)">鍒犻櫎</el-button>-->
</template>
</el-table-column>
</el-table>
- <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
- :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange">
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]" background
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
</el-pagination>
</el-col>
<el-col :span="12">
<div class="header">
<div>娓╂箍搴﹁褰曪細{{ saveRow.monthDate }}</div>
<div>
- <el-button v-if="saveRow.monthDate" size="small" type="primary" @click="dialogVisible1 = true">鏂� 澧�</el-button>
+ <el-button v-if="saveRow.monthDate" size="small" type="primary" @click="dialogVisible1 = true">鏂�
+ 澧�</el-button>
</div>
</div>
- <el-table
- :data="tableData1"
- height="calc(100vh - 18em)"
- style="width: 100%">
+ <el-table :data="tableData1" height="calc(100vh - 18em)" style="width: 100%" :row-class-name="tableRowClassName">
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
<el-table-column label="搴忓彿" type="index" width="60" align="center"></el-table-column>
<el-table-column label="鏃ユ湡" min-width="100" prop="recordDate"></el-table-column>
<el-table-column align="center" label="涓婂崍" min-width="200">
<template>
- <el-table-column label="鏃堕棿" min-width="110" prop="morningTestTime" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鏃堕棿" min-width="110" prop="morningTestTime"
+ show-overflow-tooltip></el-table-column>
<el-table-column label="娓╁害" min-width="80" prop="morningTemp" show-overflow-tooltip></el-table-column>
<el-table-column label="婀垮害" min-width="80" prop="morningHum" show-overflow-tooltip></el-table-column>
</template>
@@ -79,37 +77,27 @@
</template>
</el-table-column>
</el-table>
- <el-pagination :current-page="1" :page-size="search1.size" :page-sizes="[10, 20, 30, 50, 100]"
- :total="search1.total" layout="->,total, sizes, prev, pager, next, jumper"
- @size-change="handleSizeChange1"
- @current-change="handleCurrentChange1">
+ <el-pagination :current-page="1" :page-size="search1.size" :page-sizes="[10, 20, 30, 50, 100]" background
+ :total="search1.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange1"
+ @current-change="handleCurrentChange1">
</el-pagination>
</el-col>
</el-row>
- <el-dialog
- :visible.sync="dialogVisible"
- title="鎻愮ず"
- width="50%">
+ <el-dialog :visible.sync="dialogVisible" title="鎻愮ず" width="50%">
<div style="height: 20vh;">
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item :rules="[{ required: true, message: '璇疯緭鍏ユ湀搴︽椂闂�', trigger: 'blur' }]" label="鏈堝害鏃堕棿"
- prop="monthDate">
- <el-date-picker
- v-model="form.monthDate"
- format="yyyy-MM"
- placeholder="閫夋嫨鏈堜唤"
- size="small"
- style="width: 100%"
- type="month"
- value-format="yyyy-MM">
+ prop="monthDate">
+ <el-date-picker v-model="form.monthDate" format="yyyy-MM" placeholder="閫夋嫨鏈堜唤" size="small"
+ style="width: 100%" type="month" value-format="yyyy-MM">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :rules="[{ required: true, message: '璇疯緭鍏ヨ瘯楠屽尯鍩�', trigger: 'blur' }]" label="璇曢獙鍖哄煙"
- prop="testAreaName">
+ prop="testAreaName">
<el-input v-model="form.testAreaName"></el-input>
</el-form-item>
</el-col>
@@ -117,40 +105,25 @@
</el-form>
</div>
<span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" :loading="submitLoading" @click="addPowerSupplyStability">纭� 瀹�</el-button>
- </span>
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" :loading="submitLoading" @click="addPowerSupplyStability">纭� 瀹�</el-button>
+ </span>
</el-dialog>
- <el-dialog
- :visible.sync="dialogVisible1"
- title="鎻愮ず"
- width="50%"
- @open="openDialog">
+ <el-dialog :visible.sync="dialogVisible1" title="鎻愮ず" width="50%" @open="openDialog">
<div style="height: 40vh;">
<el-form ref="form1" :model="form1" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="鏃ユ湡">
- <el-date-picker
- v-model="form1.recordDate"
- format="yyyy-MM-dd"
- placeholder="璇烽�夋嫨鏃ユ湡"
- size="small"
- style="width: 50%"
- type="date"
- value-format="yyyy-MM-dd">
+ <el-date-picker v-model="form1.recordDate" format="yyyy-MM-dd" placeholder="璇烽�夋嫨鏃ユ湡" size="small"
+ style="width: 50%" type="date" value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="涓婂崍鏃堕棿">
- <el-time-picker
- v-model="form1.morningTestTime"
- size="small"
- value-format="HH:mm:ss"
- format="HH:mm:ss"
- style="width: 100%"
- placeholder="璇烽�夋嫨鏃堕棿">
+ <el-time-picker v-model="form1.morningTestTime" size="small" value-format="HH:mm:ss" format="HH:mm:ss"
+ style="width: 100%" placeholder="璇烽�夋嫨鏃堕棿">
</el-time-picker>
</el-form-item>
</el-col>
@@ -166,8 +139,8 @@
</el-col>
<el-col :span="12">
<el-form-item label="涓婂崍璁板綍鍛�">
- <el-select v-model="form1.morningRecorderId" clearable filterable placeholder="璇烽�夋嫨"
- size="small" style="width: 100%;">
+ <el-select v-model="form1.morningRecorderId" clearable filterable placeholder="璇烽�夋嫨" size="small"
+ style="width: 100%;">
<el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@@ -175,13 +148,8 @@
</el-col>
<el-col :span="12">
<el-form-item label="涓嬪崍鏃堕棿">
- <el-time-picker
- v-model="form1.afternoonTime"
- size="small"
- value-format="HH:mm:ss"
- format="HH:mm:ss"
- style="width: 100%"
- placeholder="璇烽�夋嫨鏃堕棿">
+ <el-time-picker v-model="form1.afternoonTime" size="small" value-format="HH:mm:ss" format="HH:mm:ss"
+ style="width: 100%" placeholder="璇烽�夋嫨鏃堕棿">
</el-time-picker>
</el-form-item>
</el-col>
@@ -197,8 +165,8 @@
</el-col>
<el-col :span="12">
<el-form-item label="涓嬪崍璁板綍鍛�">
- <el-select v-model="form1.afternoonRecorderId" clearable filterable placeholder="璇烽�夋嫨"
- size="small" style="width: 100%;">
+ <el-select v-model="form1.afternoonRecorderId" clearable filterable placeholder="璇烽�夋嫨" size="small"
+ style="width: 100%;">
<el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@@ -206,11 +174,7 @@
</el-col>
<el-col :span="24">
<el-form-item label="澶囨敞">
- <el-input
- v-model="form1.note"
- :rows="2"
- placeholder="璇疯緭鍏ュ唴瀹�"
- type="textarea">
+ <el-input v-model="form1.note" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�" type="textarea">
</el-input>
</el-form-item>
</el-col>
@@ -218,24 +182,41 @@
</el-form>
</div>
<span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible1 = false">鍙� 娑�</el-button>
- <el-button type="primary" :loading="submitLoading" @click="addPowerSupplyStability1">纭� 瀹�</el-button>
- </span>
- </el-dialog>
- <el-dialog :visible.sync="approvalDialog" title="纭" width="30%" @close="subjoin = ''">
- <span>
- 澧炶ˉ淇℃伅锛�
- <el-input v-model="subjoin" type="textarea"></el-input>
+ <el-button @click="dialogVisible1 = false">鍙� 娑�</el-button>
+ <el-button type="primary" :loading="submitLoading" @click="addPowerSupplyStability1">纭� 瀹�</el-button>
</span>
+ </el-dialog>
+ <el-dialog :visible.sync="approvalDialog" title="璁板綍鍛樼粦瀹�" width="30%" @open="openDialog">
+ <el-form ref="recordForm" :model="recordForm">
+ <el-form-item label="璁板綍鍛�: ">
+ <el-select v-model="recordForm.registrarUserId" clearable filterable placeholder="璇烽�夋嫨" size="small"
+ style="width: 80%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-form>
<span slot="footer" class="dialog-footer">
- <el-button :loading="approvalLoading" @click="subjoin = '', approvalDialog = false">涓嶇‘璁�</el-button>
- <el-button :loading="approvalLoading" type="primary" @click="handleApproval">纭� 璁�</el-button>
+ <el-button :loading="approvalLoading" @click="approvalDialog = false">鍙栨秷</el-button>
+ <el-button :loading="approvalLoading" type="primary" @click="handleApproval">淇濆瓨</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
+import {
+ getFeTempHumDate,
+ addFeTempHumDate,
+ getFeTempHumRecordPage,
+ addFeTempHumRecord,
+ selectUserCondition,
+ deleteFeTempHumRecord,
+ deleteFeTempHumDate,
+ exportTemperatureAndHumidityRecords,
+ affirmFeTempHumDate
+} from '@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment'
+
export default {
data() {
return {
@@ -261,8 +242,10 @@
responsibleOptions: [],
approvalDialog: false,
approvalLoading: false,
- subjoin: '',
approvalRow: {},
+ recordForm: {
+ registrarUserId: ''
+ }
}
},
mounted() {
@@ -283,22 +266,18 @@
}
},
methods: {
- openApprovalDialog (row) {
+ openApprovalDialog(row) {
this.approvalDialog = true
this.approvalRow = row
+ this.recordForm.registrarUserId = row.registrarUserId
},
- handleApproval () {
+ handleApproval() {
this.approvalLoading = true
const params = {
dateId: this.approvalRow.dateId,
- subjoin: this.subjoin,
+ registrarUserId: this.recordForm.registrarUserId
}
- this.$axios.post(this.$api.facilitiesAndEnvironment.affirmFeTempHumDate, params, {
- headers: {
- 'Content-Type': 'application/json'
- },
- noQs: true
- }).then(res => {
+ affirmFeTempHumDate(params).then(res => {
this.approvalLoading = false
if (res.code === 200) {
this.$message.success('纭鎴愬姛锛�')
@@ -310,7 +289,7 @@
})
},
openDialog() {
- this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
+ selectUserCondition().then(res => {
if (res.code == 200) {
this.responsibleOptions = res.data
}
@@ -320,11 +299,7 @@
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true
- this.$axios.post(this.$api.facilitiesAndEnvironment.addFeTempHumDate, this.form, {
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(res => {
+ addFeTempHumDate(this.form).then(res => {
if (res.code === 200) {
this.$message.success('鏂板鎴愬姛!')
this.submitLoading = false
@@ -346,11 +321,7 @@
this.submitLoading = true
if (valid) {
this.form1.dateId = this.saveRow.dateId
- this.$axios.post(this.$api.facilitiesAndEnvironment.addFeTempHumRecord, this.form1, {
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(res => {
+ addFeTempHumRecord(this.form1).then(res => {
if (res.code === 200) {
this.$message.success('鏂板鎴愬姛!')
this.submitLoading = false
@@ -365,10 +336,11 @@
},
clickRow(row) {
this.saveRow = row
+ this.search1.current = 1
this.initData1(row.dateId)
},
edit(row) {
- this.form = {...row}
+ this.form = { ...row }
this.dialogVisible = true
},
deleteRowFun(row) {
@@ -377,47 +349,22 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeTempHumDate + '?dateId=' + row.dateId).then(res => {
+ deleteFeTempHumDate({ dateId: row.dateId }).then(res => {
this.$message.success('鍒犻櫎鎴愬姛锛�')
this.initData()
})
})
},
edit1(row) {
- this.form1 = {...row}
+ this.form1 = { ...row }
this.dialogVisible1 = true
},
// 瀵煎嚭
downLoadPost(row) {
- this.$axios.get(this.$api.facilitiesAndEnvironment.exportTemperatureAndHumidityRecords + '?dateId=' + row.dateId,{responseType: "blob"}).then(res => {
+ exportTemperatureAndHumidityRecords({ dateId: row.dateId }).then(res => {
this.outLoading = false
- const blob = new Blob([res],{ type: 'application/msword' });
- //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆
- let reader = new FileReader();
- reader.readAsText(blob, 'utf-8');
- reader.onload = () => {
- try {
- let result = JSON.parse(reader.result);
- if (result.message) {
- this.$message.error(result.message);
- } else {
- const url = URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.href = url;
- link.download = '娓╂箍搴﹁褰�' + '.docx';
- link.click();
- this.$message.success('瀵煎嚭鎴愬姛')
- }
- } catch (err) {
- console.log(err);
- const url = URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.href = url;
- link.download = '娓╂箍搴﹁褰�' + '.docx';
- link.click();
- this.$message.success('瀵煎嚭鎴愬姛')
- }
- }
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, '娓╂箍搴﹁褰�.docx')
})
},
deleteRowFun1(row) {
@@ -426,29 +373,46 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- this.$axios.delete(this.$api.facilitiesAndEnvironment.deleteFeTempHumRecord + '?tempHumId=' + row.tempHumId).then(res => {
+ deleteFeTempHumRecord({ tempHumId: row.tempHumId }).then(res => {
this.$message.success('鍒犻櫎鎴愬姛锛�')
this.initData1(this.saveRow.dateId)
})
})
},
initData() {
- this.$axios.get(this.$api.facilitiesAndEnvironment.getFeTempHumDate + '?size=' + this.search.size + '¤t=' + this.search.current + '&testAreaName=' + this.search.testAreaName).then(res => {
- if (res.code === 201) return;
- this.tableData = res.data.records;
- this.search.total = res.data.total;
- if (res.data.records.length === 0) {
- this.tableData1 = []
- this.saveRow.monthDate = ''
+ getFeTempHumDate({
+ ...this.search,
+ ...this.search
+ }).then(res => {
+ if (res.code === 200) {
+ this.tableData = res.data.records;
+ this.search.total = res.data.total;
+ if (res.data.records.length === 0) {
+ this.tableData1 = []
+ this.saveRow.monthDate = ''
+ }
+ }
+
+ })
+ },
+ initData1(dateId) {
+ let form = { dateId: dateId }
+ getFeTempHumRecordPage({
+ ...this.search1,
+ ...form
+ }).then(res => {
+ if (res.code === 200) {
+ this.tableData1 = res.data.records;
+ this.search1.total = res.data.total;
}
});
},
- initData1(dateId) {
- this.$axios.get(this.$api.facilitiesAndEnvironment.getFeTempHumRecordPage + '?size=' + this.search1.size + '¤t=' + this.search1.current + '&dateId=' + dateId).then(res => {
- if (res.code === 201) return;
- this.tableData1 = res.data.records;
- this.search1.total = res.data.total;
- });
+ // 鍒ゆ柇娓╂箍搴﹀尯闂村彉鑹�
+ tableRowClassName({row, rowIndex}) {
+ if (row.isIssue == 1) {
+ return 'warning-row';
+ }
+ return '';
},
handleSizeChange(val) {
this.search.size = val;
@@ -460,11 +424,11 @@
},
handleSizeChange1(val) {
this.search1.size = val;
- this.initData1();
+ this.initData1(this.saveRow.dateId);
},
handleCurrentChange1(val) {
this.search1.current = val;
- this.initData1();
+ this.initData1(this.saveRow.dateId);
},
clickAdd() {
this.dialogVisible = true
@@ -480,4 +444,7 @@
display: flex;
justify-content: space-between;
}
+>>>.warning-row {
+ background: #eea7ae;
+}
</style>
--
Gitblit v1.9.3