From 14d29f928b24d203e76f1dcefc1a51182657cd45 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 10 三月 2025 16:29:09 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev
---
src/views/CNAS/personnel/personnelInfo/Department/components/Records/index.vue | 406 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 406 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/index.vue
new file mode 100644
index 0000000..413d1a2
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/index.vue
@@ -0,0 +1,406 @@
+<template>
+ <div class="flex_column">
+ <div>
+ <TableCard :showTitle="false">
+ <template v-slot:form>
+ <div class="items_center">
+ <!-- <span>鍏抽敭瀛�</span>
+ <el-input size="small" class="search" v-model="superviseForm.searchVal" placeholder="璇疯緭鍏�"></el-input>
+ <el-button type="primary" size="small">鏌ヨ</el-button> -->
+ <el-button v-if="multipleSelection.length > 0" slot="reference" size="small" type="danger"
+ @click="delRecords">鍒犻櫎</el-button>
+ </div>
+ <div>
+ <el-button size="small" type="primary" @click="addRecord"
+ v-show="departId && departId != 1">鏂板</el-button>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable :column="superviseColumnData" :handleSelectionChange="handleSelectionChange"
+ :height="'calc(100vh - 19em)'" :isSelection="true" :table-data="superviseTableData"
+ :table-loading="superviseLoading" rowKey="id" style="margin-top: 18px; padding: 0 15px;"
+ :page="page" @pagination="pagination">
+ <div slot="action" slot-scope="scope">
+ <el-button type="text" @click="openDownloadDia(scope.row)">
+ <span>瀵煎嚭</span>
+ </el-button>
+ <el-button type="text" @click="openRecord(scope.row)">
+ <span>鐩戠潱璁板綍</span>
+ </el-button>
+ <el-button type="text" @click="openControl(scope.row.id)"
+ :disabled="scope.row.evaluationSupervisionSituation != '涓嶇鍚�'">
+ <span :style="renderBtn(scope.row.currentStateControl)">鎺у埗鍗�</span>
+ </el-button>
+ <el-button type="text" @click="openDispose(scope.row.id)"
+ :disabled="scope.row.correctiveMeasure != '1'">
+ <span :style="renderBtn(scope.row.currentStateProcessing)">澶勭悊鍗�</span>
+ </el-button>
+ </div>
+ </limsTable>
+ </template>
+ </TableCard>
+ </div>
+ <RecordAdd ref="recordModal" @submit="getTableData" :departId="departId"></RecordAdd>
+ <ControlModal ref="controlModal" @getTableData="getTableData" :departId="departId"></ControlModal>
+ <DisposeModal ref="disposeModal" @getTableData='getTableData' :departId="departId"></DisposeModal>
+ <el-dialog :visible.sync="downloadDialog" title="瀵煎嚭" width="600px">
+ <span>
+ <el-button :disabled="!download.currentStateControl" plain type="primary"
+ @click="controlDown">鎺у埗鍗曞鍑�</el-button>
+ <el-button :disabled="!download.currentStateProcessing" plain type="primary"
+ @click="processingDown">澶勭悊鍗曞鍑�</el-button>
+ <el-button plain type="primary" @click="supervisoryDown">鐩戠潱璁板綍瀵煎嚭</el-button>
+ </span>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="downloadDialog = false">鍙� 娑�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import TableCard from '@/components/TableCard/index.vue';
+import RecordAdd from "./Add.vue"
+import limsTable from "@/components/Table/lims-table.vue";
+import ControlModal from "./control/index.vue"
+import DisposeModal from "./dispose/index.vue"
+import {
+ personSupervisionRecordPage,
+ deletePersonSupervisionRecord,
+ exportSupervisionControlSheet,
+ exportSupervisionProcessingSheet,
+ exportPersonSupervisionRecord
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ props: {
+ isDepartment: {
+ type: Boolean,
+ default: false
+ },
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ },
+ components: {
+ TableCard,
+ RecordAdd,
+ limsTable,
+ ControlModal,
+ DisposeModal
+ },
+ data() {
+ return {
+ loading: false,
+ page: {
+ current: 1,
+ pageSize: 20,
+ total: 0
+ },
+ // 鐩戠潱璁板綍
+ superviseForm: {
+ searchVal: undefined
+ },
+ superviseColumnData: [
+ // {
+ // label: 'id',
+ // prop: 'id'
+ // },
+ {
+ label: '妫�娴嬩汉鍛�',
+ prop: 'testerName',
+ width: 120
+ }, {
+ label: '鐩戠潱浜哄憳',
+ prop: 'supervisorName',
+ width: 120
+ }, {
+ label: '妫�楠岄」鐩�',
+ prop: 'testItem',
+ width: 120
+ }, {
+ label: '鏍峰搧缂栧彿',
+ prop: 'sampleNumber',
+ width: 120
+ }, {
+ label: '妫�楠屾棩鏈�',
+ prop: 'detectionDate',
+ width: 160
+ }, {
+ label: '鎺у埗鍗曠姸鎬�',
+ prop: 'currentStateControl',
+ formatData: (item) => {
+ let result = undefined
+ switch (item) {
+ case '0':
+ result = '宸ヤ綔鎯呭喌'
+ break;
+ case '1':
+ result = '琚洃鐫d汉纭'
+ break;
+ case '2':
+ result = '澶勭悊鎺柦'
+ break;
+ case '3':
+ result = '绾犳鎺柦'
+ break;
+ case '4':
+ result = '閫氱煡瀹㈡埛'
+ break;
+ }
+ return result
+ },
+ width: 140,
+ }, {
+ label: '娴佺▼鍗曠姸鎬�',
+ prop: 'currentStateProcessing',
+ formatData: (item) => {
+ let result = undefined
+ switch (item) {
+ case '0':
+ result = '闂鎻忚堪'
+ break;
+ case '1':
+ result = '鍘熷洜鍒嗘瀽'
+ break;
+ case '2':
+ result = '绾犳鎺柦'
+ break;
+ case '3':
+ result = '楠岃瘉缁撴灉'
+ break;
+ }
+ return result
+ },
+ width: 140,
+ }, {
+ label: '浜哄憳',
+ prop: 'personnel',
+ width: 150
+ }, {
+ label: '璁惧浠櫒',
+ prop: 'instrumentEquipment',
+ width: 140
+ }, {
+ label: '宸ヤ綔鐜',
+ prop: 'workingEnvironment',
+ width: 140
+ }, {
+ label: '鏍峰搧閲囬泦',
+ prop: 'sampleCollection',
+ width: 140
+ }, {
+ label: '鏍峰搧鐨勫噯澶�',
+ prop: 'samplePreparation',
+ width: 140
+ }, {
+ label: '妫�楠屾柟娉�',
+ prop: 'testMethod',
+ width: 120
+ }, {
+ label: '妫�娴嬭褰�',
+ prop: 'testingRecords',
+ width: 120
+ }, {
+ label: '妫�楠屾姤鍛�',
+ prop: 'testReport',
+ width: 120
+ }, {
+ label: '鐩戠潱鎯呭喌璇勪环',
+ prop: 'evaluationSupervisionSituation',
+ width: 140
+ }, {
+ label: '涓嶇鍚堝鐞嗘剰瑙�',
+ prop: 'doNotMeetTheHandlingOpinions',
+ width: 140
+ }, {
+ fixed: 'right',
+ dataType: "slot",
+ width: 280,
+ label: '鎿嶄綔',
+ slot: 'action',
+ }
+ ],
+ superviseTableData: [],
+ superviseLoading: false,
+ multipleSelection: [],
+ downloadDialog: false,
+ download: {
+ currentStateControl: '',
+ currentStateProcessing: '',
+ },
+ downloadId: '',
+ }
+ },
+ mounted() {
+ this.getTableData()
+ },
+ methods: {
+ /**
+ * @desc 鑾峰彇鏍戠殑浜哄憳id
+ */
+ getDepart() {
+ this.getTableData()
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.pageSize = limit;
+ this.getTableData();
+ },
+ // 鑾峰彇鐩戠潱璁板綍
+ async getTableData() {
+ this.loading = true
+ const { code, data } = await personSupervisionRecordPage({
+ departLimsId: this.isDepartment ? this.departId : null,
+ userId: this.isDepartment ? null : this.departId,
+ current: this.page.current,
+ size: this.page.pageSize
+ })
+ if (code == 200) {
+ this.superviseTableData = data.records
+ this.page.total = data.total
+ }
+ this.loading = false
+ },
+ // 鏂板鐩戠潱璁板綍
+ addRecord(row, type = false) {
+ this.$refs.recordModal.openDialog({ departId: this.departId, ...row }, type)
+ },
+ openRecord(row) {
+ this.$refs.recordModal.openDialog(row, true)
+ },
+ // 鎵撳紑瀵煎嚭寮规
+ openDownloadDia(row) {
+ this.downloadDialog = true
+ this.download = row
+ console.log('this.download', this.download.currentStateProcessing, this.download.currentStateControl);
+ this.downloadId = row.id
+ },
+ // 鎺у埗鍗曞鍑�
+ controlDown() {
+ exportSupervisionControlSheet({ supervisionRecordId: this.downloadId }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, '鎺у埗鍗曞鍑�' + '.docx')
+ })
+ },
+ // 澶勭悊鍗曞鍑�
+ processingDown() {
+ exportSupervisionProcessingSheet({ supervisionRecordId: this.downloadId }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, '澶勭悊鍗曞鍑�' + '.docx')
+ })
+ },
+ // 鐩戠潱璁板綍瀵煎嚭
+ supervisoryDown() {
+ exportPersonSupervisionRecord({ id: this.downloadId }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, '鐩戠潱璁板綍瀵煎嚭' + '.docx')
+ })
+ },
+ // 鏄剧ず鎺у埗鍗�
+ openControl(id) {
+ this.$refs.controlModal.openDialog(id)
+ },
+ // 鏄剧ず澶勭悊鍗�
+ openDispose(id) {
+ this.$refs.disposeModal.openDialog(id)
+ },
+ // 琛ㄦ牸澶氶�夋縺娲诲悗鍋氫粈涔�
+ handleSelectionChange(val) {
+ this.multipleSelection = val
+ },
+ /**
+ * @desc 鎵归噺鍒犻櫎鐩戠潱璁板綍
+ */
+ delRecords() {
+ this.$confirm(
+ '姝ゆ搷浣滃皢鍒犻櫎閫変腑鏁版嵁, 鏄惁缁х画?',
+ '鎻愮ず',
+ {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ })
+ .then(() => {
+ console.log(this.multipleSelection)
+ let ids = this.multipleSelection.map((item) => item.id)
+ const code = this.delTableData(ids)
+ this.$message({
+ type: code == 200 ? 'success' : 'error',
+ message: code == 200 ? '鍒犻櫎鎴愬姛锛�' : '鍒犻櫎澶辫触锛�'
+ });
+ this.getTableData()
+ })
+ },
+ // 鍒犻櫎api
+ async delTableData(ids) {
+ const { code } = await this.$axios({
+ method: 'delete',
+ url: deletePersonSupervisionRecord,
+ data: ids
+ })
+ return code
+ },
+ // 琛岃儗鏅壊
+ renderBtn(currentState) {
+ let status = Number(currentState)
+ let res = {}
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ res = { color: '#337ecc' }
+ break;
+ case 2:
+ res = { color: '#409EFF' }
+ break;
+ case 3:
+ res = { color: '#79bbff' }
+ break;
+ case 4:
+ res = { color: '#a0cfff' }
+ break;
+ }
+ return res;
+ }
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ departId: {
+ handler(newId, oldId) {
+ if (this.isDepartment) {
+ this.getTableData();
+ } else {
+ this.getTableData()
+ }
+ }
+ }
+ }
+}
+</script>
+<style scoped>
+.flex_column {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+
+.items_center {
+ display: flex;
+ align-items: center;
+}
+
+.date_box {
+ margin: 0 5px;
+}
+
+.search {
+ width: 150px;
+ padding: 0 16px;
+}
+</style>
--
Gitblit v1.9.3